public function index()
 {
     $user = $this->api->user_getInfo($this->uid, 'name,active,sex');
     //用户检查
     $this->__checkUser($user);
     //黑名单
     $black = $this->api->privacy_black($this->mid, $this->uid);
     if ($black) {
         $this->redirect("black");
     }
     //空间主人的好友
     $fuids = $this->__showUserFriends($this->uid);
     //访客记录
     if ($this->__footPrivacy($this->uid, $this->mid, $fuids)) {
         D("Visitor")->foot($this->uid, $this->mid, $this->my_name);
     }
     //用户信息
     $userInfo = $this->__getUserInfo($this->mid, $this->uid);
     $this->assign("userInfo", $userInfo);
     //应用的计数
     $apps_num = $this->api->space_getCount($this->uid);
     $this->assign("apps_num", $apps_num);
     //自动判断他,她还是我
     $show_sex = $this->__getUserSex($this->mid, $this->uid, $user);
     $this->assign('show_sex', $show_sex);
     //这个空间的主人是否对你设置隐藏了
     $privacyInfo = $this->__checkPrivacy($this->mid, $this->uid);
     $credit = getCredit($this->uid, $this->api);
     $rank = getUserRank($this->uid);
     $this->assign('rank', $rank);
     $this->assign('credit', $credit);
     //判断和主人是否是好友
     if ($this->mid != $this->uid) {
         setScore($this->uid, 'user_visited');
         setScore($this->mid, 'visit_space');
         $this->__spaceNotFrends($fuids);
     }
     //将留言板新条数设置为空
     if ($this->uid == $this->mid) {
         $this->__spaceAreFrends();
     }
     //        if(!($privacyInfo['the_mini']['content'] == '什么都没做' || empty($privacyInfo))){
     //            $title = $user['name'].'的个人空间'.':'.$privacyInfo['the_mini']['content'];
     //        }else{
     //            $title = $user['name'].'的个人空间';
     //        }
     $title = $user['name'] . '的个人空间';
     $this->setTitle($title);
     $this->display();
 }
 public function userInfo()
 {
     $uid = $_GET['uid'];
     $out['rank'] = getUserRank($uid);
     $out['credit'] = getCredit($uid, $this->api);
     $user = $this->api->user_getInfo($uid, 'name,id,cTime');
     $user['mini'] = $this->__getOneMini($uid);
     $userSearch = D('UserSearch');
     $user['friends'] = $this->api->friend_areFriends($uid, $this->mid);
     $data = $userSearch->getGroupInfo($this->mid, $this->uid);
     $login = $this->api->LoginRecord_getUserLogin($uid);
     $user['login_time'] = $login['login_time'];
     $this->assign($data);
     $this->assign($out);
     $this->assign('user', $user);
     $this->display('userinfo');
 }
Example #3
0
<?php

require_once "models/config.php";
if (!securePage($_SERVER['PHP_SELF'])) {
    die;
}
//Prevent the user visiting the logged in page if he is not logged in
if (!isUserLoggedIn()) {
    header("Location: login.php");
    die;
}
require_once "models/header.php";
// Build User Dashboard...
$userId = $_GET['user_id'];
letsBuildUserProfile($userId);
$userRank = getUserRank($userId);
echo 'Rank = ' . $userRank;
Example #4
0
<?php

require_once "models/config.php";
if (!securePage($_SERVER['PHP_SELF'])) {
    die;
}
//Prevent the user visiting the logged in page if he is not logged in
if (!isUserLoggedIn()) {
    header("Location: login.php");
    die;
}
require_once "models/header.php";
// Build User Dashboard...
letsBuildUserDashboard($loggedInUser->user_id);
$userRank = getUserRank($loggedInUser->user_id);
echo 'Rank = ' . $userRank;
Example #5
0
				<?php 
menuButton('', 'Dashboard', true);
menuButton('schemes', 'Schemes');
menuButton('scheme_parts', 'Scheme parts');
menuButton('food', 'My food');
?>
				<span class="break"></span>
				<?php 
menuButton('coaches', 'Coaches');
menuButton('clients', 'Clients');
?>
			</div>
			<div id="main_nav-sub">
				<span class="break"></span>
				<?php 
menuButton('settings', 'Settings');
if (getUserRank() === 'admin') {
    menuButton('admin', 'Admin');
}
menuButton('action/login/logout', 'Logout');
?>
			</div>
		</nav>
		<section id="main_content">
			<?php 
if ($title) {
    echo '<h1 class="page_title">' . $title . '</h1>';
}
if ($page_controls) {
    $this->output('page_controls', $page_controls);
}
Example #6
0
<?php

/*
Create custom events for the All Seeing Eye (ASE) class here.
*/
$Ase->see('route_found', function ($route) {
    if (!empty($route['action']) && $route['action'] === 'admin' && getUserRank() !== 'admin') {
        setRedirect(get('website_url') . 'error/403');
        exit;
    }
});
$Ase->see('cache_update', function (\Odf\Cache $Cache, $event_name = null, $extra_data = array()) {
    switch ($event_name) {
        case 'scheme_parts':
            $Cache->clear('scheme_parts', getDefaultUniqueCacheData($extra_data));
            $Cache->clear('schemes', getDefaultUniqueCacheData($extra_data));
            break;
        case 'food':
            $Cache->clear('food', getDefaultUniqueCacheData($extra_data));
            $Cache->clear('scheme_parts', getDefaultUniqueCacheData($extra_data));
            $Cache->clear('schemes', getDefaultUniqueCacheData($extra_data));
            break;
        case 'clients':
            break;
        case 'client_requests':
    }
}, array($Cache));
        <div class="bdr-bot-red">
        <div class="col-md-1 nopad-right">
          <img src="user_images/<?php 
        echo $u_info['photo'];
        ?>
" width="39" height="39" alt=""> </div>
          <div class="col-md-3 nopad-left">
          <h4 class="hcname"><?php 
        echo $u_info['user_name'];
        ?>
</h4>
          </div>
          <div class="col-md-4">
          <h4 class="hcrank">RANK: <span>
          <?php 
        $user_rank = getUserRank($_SESSION['user_loged_id'], $game_detail['game_id']);
        echo $user_rank;
        ?>
</span></h4>
          </div>
          <div class="col-md-4">
          <h4 class="hcscore">SCORE: <span><?php 
        echo $user_current_score['game_score'];
        ?>
</span></h4>
          </div>
          </div>
            <?php 
    }
}
?>
Example #8
0
     $count_com[$userid] = getUserPosts($userid);
 }
 $user = cs_secure($data['thread']['users_nick']);
 $data['thread_desc']['country'] = $data['thread']['users_country'];
 $data['thread_desc']['users_link'] = cs_user($data['thread']['users_id'], $data['thread']['users_nick'], $data['thread']['users_active'], $data['thread']['users_delete']);
 $key = array_search($userid, $mods);
 if (!empty($key)) {
     $data['if']['moderator'] = true;
     $f_user = "******" . $userid . "'";
     $boardmod = cs_sql_select(__FILE__, 'boardmods', 'categories_id, users_id', $f_user);
     $f_cat = "categories_id = '" . $boardmod['categories_id'] . "'";
     $bm_cat = cs_sql_select(__FILE__, 'categories', 'categories_id, categories_name', $f_cat);
     $data['thread_desc']['boardmod'] = $bm_cat['categories_name'];
 } else {
     $data['if']['no_moderator'] = true;
     $data['thread_desc']['users_rank'] = getUserRank($count_com[$userid], $ranks);
     $data['thread_desc']['users_title'] = getRankTitle($count_com[$userid], $ranks);
 }
 $data['thread_desc']['avatar'] = getUserAvatar($data['thread']['users_avatar']);
 $content = cs_secure($data['thread']['users_place']);
 $hidden = explode(',', $data['thread']['users_hidden']);
 if (in_array('users_place', $hidden)) {
     $content = ($account['access_users'] > 4 or $data['thread']['users_id'] == $account['users_id']) ? cs_html_italic(1) . $content . cs_html_italic(0) : '';
 }
 $data['thread_desc']['place'] = empty($content) ? '' : $cs_lang['place'] . ': ' . $content;
 $data['thread_desc']['posts'] = $count_com[$userid];
 $data['thread_desc']['date'] = cs_date('unix', $data['thread']['threads_time'], 1);
 $data['thread_desc']['text'] = cs_secure($data['thread']['threads_text'], 1, 1);
 //Files Start
 if (!empty($loop_files)) {
     $data['if']['thread_desc_files'] = true;
Example #9
0
        ?>
        <div class="bdr-bot-red">
        <div class="col-md-1 nopad-right">
          <img src="user_images/<?php 
        echo $u_info['photo'];
        ?>
" width="39" height="39" alt=""> </div>
          <div class="col-md-3 nopad-left">
          <h4 class="hcname"><?php 
        echo $u_info['user_name'];
        ?>
</h4>
          </div>
          <div class="col-md-4">
          <h4 class="hcrank">RANK: <span> <?php 
        $user_rank = getUserRank($_SESSION['user_loged_id'], $game_id);
        echo $user_rank;
        ?>
</span></h4>
          </div>
          <div class="col-md-4">
          <h4 class="hcscore">SCORE: <span><?php 
        echo $user_current_score['game_score'];
        ?>
</span></h4>
          </div>
          </div>
             <?php 
    }
}
?>
Example #10
0
<div id="navigation">
<ul>
<li><a href="{$LEVELFLAG}/index.php?page=home">Home</a></li>
<li><a href="{$LEVELFLAG}/index.php?page=contact">Contact</a></li>
<li><a href="http://www.pragyan.org/10/forum/digitalfortress">Forum</a></li>
HEAD;
if ($USERLOGGEDIN == true) {
    $HEAD .= <<<HEAD
\t\t<li><a href="{$LEVELFLAG}/index.php?page=challenges">Challenges</a></li>
\t\t<li><a href="{$LEVELFLAG}/index.php?page=logout">Logout</a></li>
HEAD;
}
$HEAD .= "</div>";
if ($USERLOGGEDIN == true) {
    $score = getUserScore();
    $rank = getUserRank($score);
    $HEAD .= "<div style='float : right;padding-top:10px;'>Your Score : {$score} Your Rank : {$rank}</div>";
}
$HEAD .= <<<HEAD
<div style="clear: both;"> </div>
<div style="clear: both;"> </div>
HEAD;
$FOOT = <<<FOOT
<div id="footer">
<div style="float: right;">
<a href="{$LEVELFLAG}/index.php?page=contact"><img src="contact.gif" alt="Contact" /></a>
</div>
&copy; 2010 Digital Fortress, <a href="http://www.pragyan.org">Pragyan `10</a>. All rights reserved.
</div>
</div>
Example #11
0
//------ Start the session. This helps identify the user who is viewing the page by storing the information on their computer in the form of cookie.
global $validation;
//------ Globalize the variable
include_once "database.inc";
//------ Include the database module
include_once "interface.inc";
//------ Include the interface module
include_once "template.inc";
//------ Include the template module
include_once "functions.inc";
//------ Include the functions module
if (!isActiveProfile($_SESSION[profileID]) && $_SESSION[profileID] != "xxxxxx") {
    //------ If the user is not suspended and the user is not an administrator, reset the profile ID to blank.
    $_SESSION[profileID] = "";
}
$_SESSION[userRank] = getUserRank($_SESSION[profileID]);
//------ Get the rank of the user depending on the profile ID.
$validation[AlphaNumeric] = "^[A-Za-z0-9]{1,}\$";
//------ alphabets and numbers
$validation[Alphabets] = "^[A-Za-z]{1,}\$";
//------ albhabets
$validation[Numbers] = "^[0-9]{1,}\$";
//------ numbers
$validation[AlphaNumericWithSpaces] = "^[A-Za-z0-9 ]{1,}\$";
//alphabets and numbers
$validation[Name] = "^[A-Za-z -]{1,}\$";
//alphabets, spaces and hyphens
$validation[Telephone] = "^0[0-9]{10}\$";
//telephone number starting with 0 and 11 digits long
$validation[EmailAddress] = "^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})\$";
//standard email address format