Exemple #1
0
function transRewrite()
{
    $rewrite_array = array("blog", "photo");
    $script_name = basename($_SERVER['SCRIPT_NAME']);
    $request_str = getReUrl();
    if (strpos(',' . $request_str, '/')) {
        $request_arr = explode('/', $request_str);
        array_shift($request_arr);
        if ($script_name == 'home.php' || intval($request_arr[0])) {
            isset($request_arr[0]) && ($_GET['user_id'] = $_GET['h'] = $request_arr[0]);
            isset($request_arr[1]) && ($_GET['app'] = $request_arr[1]);
            $app = $request_arr[1];
        } else {
            if ($script_name == 'modules.php' && in_array($request_arr[0], $rewrite_array)) {
                isset($request_arr[0]) && ($_GET['app'] = $request_arr[0]);
                $app = $request_arr[0];
            }
        }
        if (isset($app)) {
            switch ($app) {
                case "hstart":
                    isset($request_arr[0]) && ($_GET['user_id'] = $request_arr[0]);
                    isset($request_arr[1]) && ($_GET['app'] = $request_arr[1]);
                    break;
                case "blog":
                    if ($script_name == 'home.php' || intval($request_arr[0])) {
                        isset($request_arr[0]) && ($_GET['user_id'] = $_GET['h'] = $request_arr[0]);
                        isset($request_arr[1]) && ($_GET['app'] = $request_arr[1]);
                        isset($request_arr[2]) && ($_GET['id'] = $request_arr[2]);
                    } else {
                        if ($script_name == 'modules.php') {
                            isset($request_arr[0]) && ($_GET['app'] = $request_arr[0]);
                            isset($request_arr[1]) && ($_GET['id'] = $request_arr[1]);
                            isset($request_arr[2]) && ($_GET['user_id'] = $_GET['h'] = $request_arr[2]);
                        }
                    }
                    break;
                case "photo":
                    if ($script_name == 'home.php' || intval($request_arr[0])) {
                        isset($request_arr[0]) && ($_GET['user_id'] = $_GET['h'] = $request_arr[0]);
                        isset($request_arr[1]) && ($_GET['app'] = $request_arr[1]);
                        isset($request_arr[2]) && ($_GET['photo_id'] = $request_arr[2]);
                        isset($request_arr[3]) && ($_GET['album_id'] = $request_arr[3]);
                    } else {
                        if ($script_name == 'modules.php') {
                            isset($request_arr[0]) && ($_GET['app'] = $request_arr[0]);
                            isset($request_arr[1]) && ($_GET['photo_id'] = $request_arr[1]);
                            isset($request_arr[2]) && ($_GET['album_id'] = $request_arr[2]);
                            isset($request_arr[3]) && ($_GET['user_id'] = $_GET['h'] = $request_arr[3]);
                        }
                    }
                    break;
            }
        }
    }
}
Exemple #2
0
$hi_langpackage = new hilp();
$mo_langpackage = new moodlp();
$pr_langpackage = new privacylp();
$ah_langpackage = new arrayhomelp();
//变量获得
$holder_id = intval(get_argg('h'));
//主人id
$user_id = get_sess_userid();
$dress_name = short_check(get_argg('dress_name'));
//装扮名称
//表声明区
$t_mood = $tablePreStr . "mood";
$t_users = $tablePreStr . "users";
$t_online = $tablePreStr . "online";
//获取并重写url参数
$urlParaStr = getReUrl();
//取得主人信息
$user_info = $holder_id ? api_proxy("user_self_by_uid", "*", $holder_id) : array();
$holder_name = empty($user_info) ? '' : $user_info['user_name'];
$is_self = $holder_id == $user_id ? 'Y' : 'N';
//隐私显示控制
$show_error = false;
$show_ques = false;
$is_visible = 0;
$show_info = "";
$dbo = new dbex();
dbtarget('r', $dbServs);
if ($user_info) {
    //最后更新心情
    $last_mood_rs = get_last_mood($dbo, $t_mood, $holder_id);
    $last_mood_txt = '';