当前位置: 首页>>代码示例>>PHP>>正文


PHP user_info函数代码示例

本文整理汇总了PHP中user_info函数的典型用法代码示例。如果您正苦于以下问题:PHP user_info函数的具体用法?PHP user_info怎么用?PHP user_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了user_info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _initialize

 /**
  * 权限控制,默认为查看 view
  */
 public function _initialize()
 {
     parent::_initialize();
     //权限判断
     if (user_info('roleid') != 1 && strpos(ACTION_NAME, 'public_') === false) {
         $category_priv_db = M('category_priv');
         $tmp = explode('_', ACTION_NAME, 1);
         $action = strtolower($tmp[0]);
         unset($tmp);
         $auth = dict('auth', 'Category');
         //权限列表
         if (!in_array($action, array_keys($auth))) {
             $action = 'view';
         }
         $catid = I('get.catid', 0, 'intval');
         $roleid = user_info('roleid');
         $info = $category_priv_db->where(array('catid' => $catid, 'roleid' => $roleid, 'action' => $action))->count();
         if (!$info) {
             //兼容iframe加载
             if (IS_GET && strpos(ACTION_NAME, '_iframe') !== false) {
                 exit('<style type="text/css">body{margin:0;padding:0}</style><div style="padding:6px;font-size:12px">您没有权限操作该项</div>');
             }
             //普通返回
             if (IS_AJAX && IS_GET) {
                 exit('<div style="padding:6px">您没有权限操作该项</div>');
             } else {
                 $this->error('您没有权限操作该项');
             }
         }
     }
 }
开发者ID:easytp,项目名称:easytp,代码行数:34,代码来源:ContentController.class.php

示例2: friend_pagesetup

function friend_pagesetup()
{
    // register links --
    global $profile_id;
    global $PAGE;
    global $CFG;
    global $metatags;
    require_once dirname(__FILE__) . "/default_template.php";
    require_once dirname(__FILE__) . "/lib/friends_config.php";
    $metatags .= "<link rel=\"stylesheet\" href=\"" . $CFG->wwwroot . "mod/friend/css.css\" type=\"text/css\" media=\"screen\" />";
    $page_owner = $profile_id;
    if (isloggedin()) {
        if (defined("context") && context == "network" && $page_owner == $_SESSION['userid']) {
            $PAGE->menu[] = array('name' => 'friends', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/friends/\" class=\"selected\" >" . __gettext("Contacts") . '</a></li>');
        } else {
            $PAGE->menu[] = array('name' => 'friends', 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/friends/\" >" . __gettext("Contacts") . '</a></li>');
        }
    }
    if (defined("context") && context == "network") {
        if (user_type($page_owner) == "person" || user_type($page_owner) == "external") {
            $friends_username = user_info('username', $page_owner);
            $PAGE->menu_sub[] = array('name' => 'friend', 'html' => a_href("{$CFG->wwwroot}{$friends_username}/friends/", __gettext("My friends")));
            /*$PAGE->menu_sub[] = array( 'name' => 'friend:of',
              'html' => a_href( "{$CFG->wwwroot}{$friends_username}/friendsof/",
                                 __gettext("Friend of")));*/
            if (isloggedin() && $page_owner == $_SESSION['userid']) {
                $PAGE->menu_sub[] = array('name' => 'friend:requests', 'html' => a_href("{$CFG->wwwroot}{$friends_username}/friends/requests", __gettext("Friendship requests")));
            }
            if (FRIENDS_FOAF) {
                $PAGE->menu_sub[] = array('name' => 'friend:foaf', 'html' => a_href("{$CFG->wwwroot}{$friends_username}/foaf/", __gettext("FOAF")));
            }
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:34,代码来源:lib.php

示例3: messages_pagesetup

function messages_pagesetup()
{
    // register links --
    global $profile_id, $PAGE, $CFG, $metatags, $function, $USER;
    $pgowner = $profile_id;
    require_once $CFG->dirroot . "mod/messages/lib/messages_config.php";
    require_once $CFG->dirroot . "mod/messages/default_template.php";
    if (isloggedin() && user_info("user_type", $_SESSION['userid']) != "external") {
        // Add the JavaScript functions
        // Lose the trailing slash
        $url = substr($CFG->wwwroot, 0, -1);
        $metatags .= "<script language=\"javascript\" type=\"text/javascript\" src=\"{$url}/mod/messages/messages.js\"></script>";
        $metatags .= "<link rel=\"stylesheet\" href=\"" . $CFG->wwwroot . "mod/messages/css.css\" type=\"text/css\" media=\"screen\" />";
        $messages = count_records_select('messages', 'to_id=' . $USER->ident . " AND status='unread'");
        if (defined("context") && context == "messages" && $pgowner == $_SESSION['userid']) {
            $PAGE->menu[] = array('name' => 'messages', 'html' => '<li><a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/" class="selected">' . __gettext("Messages") . " ({$messages})" . '</a></li>');
        } else {
            $PAGE->menu[] = array('name' => 'messages', 'html' => '<li><a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/">' . __gettext("Messages") . " ({$messages})" . '</a></li>');
        }
        if (profile_permissions_check("profile") && defined("context") && context == "messages") {
            if (user_type($pgowner) == "person") {
                $PAGE->menu_sub[] = array('name' => 'messages:list', 'html' => '<a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/">' . __gettext("View Messages") . '</a>');
                $PAGE->menu_sub[] = array('name' => 'messages:compose', 'html' => '<a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/compose">' . __gettext("Compose") . '</a>');
                $PAGE->menu_sub[] = array('name' => 'messages:sent', 'html' => '<a href="' . $CFG->wwwroot . $_SESSION['username'] . '/messages/sent">' . __gettext("Sent Messages") . '</a>');
            }
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:28,代码来源:lib.php

示例4: newsclient_pagesetup

function newsclient_pagesetup()
{
    // register links --
    global $profile_id;
    global $PAGE;
    global $CFG;
    $page_owner = $profile_id;
    $rss_username = user_info('username', $page_owner);
    if (isloggedin()) {
        /*if (defined("context") && context == "resources" && $page_owner == $_SESSION['userid']) {
              $PAGE->menu[] = array( 'name' => 'feeds',
                                     'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/feeds/\" class=\"selected\" >" .__gettext("Your Resources").'</a></li>');
          } else {
              $PAGE->menu[] = array( 'name' => 'feeds',
                                     'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/feeds/\" >" .__gettext("Your Resources").'</a></li>');
          }*/
    }
    if (defined("context") && context == "resources") {
        if ($page_owner != -1) {
            $PAGE->menu_sub[] = array('name' => 'newsfeed:subscription', 'html' => a_href($CFG->wwwroot . $rss_username . "/feeds/", __gettext("Feeds")));
            if (permissions_check("profile", $page_owner) && isloggedin()) {
                $PAGE->menu_sub[] = array('name' => 'newsfeed:subscription:publish:blog', 'html' => a_href($CFG->wwwroot . "_rss/blog.php?profile_name=" . user_info("username", $page_owner), __gettext("Publish to blog")));
            }
            $PAGE->menu_sub[] = array('name' => 'newsclient', 'html' => a_href($CFG->wwwroot . $rss_username . "/feeds/all/", __gettext("View aggregator")));
        }
        $PAGE->menu_sub[] = array('name' => 'feed', 'html' => a_href($CFG->wwwroot . "_rss/popular.php", __gettext("Popular Feeds")));
        /*
        $PAGE->menu_sub[] = array( 'name' => 'feed',
                                   'html' => a_href( $CFG->wwwroot."help/feeds_help.php",
                                                      "Page help"));
        */
    }
}
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:33,代码来源:lib.php

示例5: GZ_user_info

function GZ_user_info($user_id)
{
    global $db, $ecs;
    $user_info = user_info($user_id);
    $collection_num = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('collect_goods') . " WHERE user_id='{$user_id}' ORDER BY add_time DESC");
    $await_pay = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('order_info') . " WHERE user_id = '{$user_id}'" . GZ_order_query_sql('await_pay'));
    $await_ship = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('order_info') . " WHERE user_id = '{$user_id}'" . GZ_order_query_sql('await_ship'));
    $shipped = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('order_info') . " WHERE user_id = '{$user_id}'" . GZ_order_query_sql('shipped'));
    $finished = $db->getOne("SELECT COUNT(*) FROM " . $ecs->table('order_info') . " WHERE user_id = '{$user_id}'" . GZ_order_query_sql('finished'));
    // include_once(ROOT_PATH .'includes/lib_clips.php');
    // $rank = get_rank_info();
    // print_r($rank);exit;
    /* 取得用户等级 */
    if ($user_info['user_rank'] == 0) {
        // 非特殊等级,根据等级积分计算用户等级(注意:不包括特殊等级)
        $sql = 'SELECT rank_id, rank_name FROM ' . $GLOBALS['ecs']->table('user_rank') . " WHERE special_rank = '0' AND min_points <= " . intval($user_info['rank_points']) . ' AND max_points > ' . intval($user_info['rank_points']);
    } else {
        // 特殊等级
        $sql = 'SELECT rank_id, rank_name FROM ' . $GLOBALS['ecs']->table('user_rank') . " WHERE rank_id = '{$user_info['user_rank']}'";
    }
    if ($row = $GLOBALS['db']->getRow($sql)) {
        $user_info['user_rank_name'] = $row['rank_name'];
    } else {
        $user_info['user_rank_name'] = '非特殊等级';
    }
    $sql = 'SELECT * FROM ' . $GLOBALS['ecs']->table('user_rank') . " WHERE special_rank = '0' AND min_points = '0'";
    $row = $GLOBALS['db']->getRow($sql);
    if ($user_info['user_rank_name'] == $row['rank_name']) {
        $level = 0;
    } else {
        $level = 1;
    }
    return array('id' => $user_info['user_id'], 'name' => $user_info['user_name'], 'rank_name' => $user_info['user_rank_name'], 'rank_level' => $level, 'collection_num' => $collection_num, 'email' => $user_info['email'], "order_num" => array('await_pay' => $await_pay, 'await_ship' => $await_ship, 'shipped' => $shipped, 'finished' => $finished));
}
开发者ID:blowfishJ,项目名称:galaxyCode,代码行数:34,代码来源:function.php

示例6: getToolBar

 /**
  * 获取工具栏按钮
  * @param $id
  * @return array
  */
 public function getToolBar($id)
 {
     $roleid = user_info('roleid');
     $result = $this->where(array('parentid' => $id, 'display' => 1, 'toolbar' => 1))->order('listorder ASC')->limit(1000)->select();
     //菜单图标
     foreach ($result as &$info) {
         $info['icon'] = menu_icon($info['level'], $info['icon']);
     }
     //权限检查
     if ($roleid == 1) {
         return $result ? $result : array();
     }
     $admin_role_priv_db = M('admin_role_priv');
     $array = array();
     foreach ($result as $v) {
         $action = $v['a'];
         if (preg_match('/^public_/', $action)) {
             $array[] = $v;
         } else {
             if (preg_match('/^ajax_(\\w+)_/', $action, $_match)) {
                 $action = $_match[1];
             }
             $r = $admin_role_priv_db->where(array('c' => $v['c'], 'a' => $action, 'roleid' => $roleid))->find();
             if ($r) {
                 $array[] = $v;
             }
         }
     }
     return $array;
 }
开发者ID:easytp,项目名称:easytp,代码行数:35,代码来源:MenuModel.class.php

示例7: user_link

function user_link($id = false, $blank = false)
{
    $data = user_info($id);
    if (!$data) {
        return '<span class="user_link">Гость</span>';
    }
    return '<span class="user_link"><img src="' . URL . '/tpl/img/icons/user.png" alt="" style="vertical-align:middle;"/> <a href="' . URL . '/user/' . $id . '/"' . ($blank ? ' target="_blank"' : '') . '>' . $data['name'] . '</a></span>';
}
开发者ID:petrows,项目名称:Upload-service,代码行数:8,代码来源:internal.php

示例8: init

 function init()
 {
     # Okay, init user session with it's login & password
     $login = @$_COOKIE['login'];
     $passw = @$_COOKIE['passw'];
     $uid = user_password($login, $passw, true);
     if (!$uid) {
         return $this->error('LOGIN_ERROR', 'Invalid login or password');
     }
     $uinfo = user_info($uid);
     $this->make_sid($uid);
     # Generate SID
     echo '<user>';
     echo '<sid>' . $this->sid . '</sid>';
     echo '<lk>' . $this->lk . '</lk>';
     echo '<uid>' . $uid . '</uid>';
     echo '<name>' . htmlspecialchars($uinfo['name']) . '</name>';
     echo '<seed>' . mt_rand() . '</seed>';
     echo '</user>' . "\n";
     # Version info
     if (@$_COOKIE['v'] && @$_COOKIE['os']) {
         $ver = explode('.', $_COOKIE['v']);
         $ver = sprintf('%02d%02d%02d', @$ver[0], @$ver[1], @$ver[2]);
         $ver = intval($ver);
         $os = preg_replace('/[^a-z0-9]/', '', strtolower($_COOKIE['os']));
         # Check version
         $lastv = ldb_select('client_version', array('ver', 'veri', 'tms_publish'), '`veri`>' . $ver . ' AND `os_' . $os . '`=\'Y\' AND `published`=\'Y\' ORDER BY `veri` DESC LIMIT 1');
         $lastv = @$lastv[0];
         if ($lastv) {
             echo '<newversion ver="' . $lastv['ver'] . '" tms_publish="' . $lastv['tms_publish'] . '"/>' . "\n";
         }
     }
     include_once CORE_PATH . '/ttl.php';
     echo '<ttl default="' . $GLOBALS['ttl_def'] . '">' . "\n";
     foreach ($GLOBALS['ttl'] as $k => $v) {
         echo '<rec name="' . htmlspecialchars($v) . '" value="' . $k . '"' . ($k == $GLOBALS['ttl'] ? ' default="default"' : '') . '/>' . "\n";
     }
     echo '</ttl>' . "\n";
     # Get file list...
     $u_list = ldb_select('upload', '*', '`uid`=' . $uid . ' ORDER BY `tms_upload` ASC');
     echo '<uploads>' . "\n";
     for ($x = 0; $x < count($u_list); $x++) {
         echo '<upload id="' . $u_list[$x]['id'] . '" code="' . $u_list[$x]['code'] . '" ph="' . $u_list[$x]['ph'] . '" comment="' . htmlspecialchars($u_list[$x]['comment']) . '" tms_upload="' . $u_list[$x]['tms_upload'] . '" tms_last="' . $u_list[$x]['tms_last'] . '" ttl="' . $u_list[$x]['ttl'] . '" tms_delete="' . $u_list[$x]['tms_delete'] . '" prolong="' . ($u_list[$x]['prolong'] == 'Y' ? 1 : 0) . '">';
         echo '<files>';
         $f_list = ldb_select('file', '*', '`upid`=' . $u_list[$x]['id'] . ' ORDER BY `tms_add` ASC');
         for ($f = 0; $f < count($f_list); $f++) {
             echo '<file id="' . $f_list[$f]['id'] . '" n="' . $f_list[$f]['upn'] . '" dh="' . $f_list[$f]['dh'] . '" name="' . htmlspecialchars($f_list[$f]['file_name']) . '" size="' . $f_list[$f]['file_size'] . '" tms_add="' . $f_list[$f]['tms_add'] . '"/>';
         }
         echo '</files>';
         echo '</upload>';
     }
     echo '</uploads>' . "\n";
     # Save data
     return;
 }
开发者ID:petrows,项目名称:Upload-service,代码行数:55,代码来源:mod_api.php

示例9: Weblog

 /**
  * Weblog class constructor
  *
  * <p>Will set all weblog properties, if the provided weblog id exist 
  * (which effectively will be a user id, regardless if one is dealing 
  * with a person or a community - for Elgg both are users).</p>
  * 
  * @param int $user_id The user id.
  * @param int $blog_id The weblog id.
  */
 function Weblog($user_id, $blog_id)
 {
     $this->community = false;
     // dealing with community or not
     // username/id conversions
     if (is_numeric($user_id)) {
         $this->user_id = $user_id;
     } elseif (is_string($user_id)) {
         $this->user_id = user_info_username('ident', $user_id);
     }
     if (is_numeric($blog_id)) {
         $this->ident = $blog_id;
     } elseif (is_string($blog_id)) {
         $this->ident = user_info_username('ident', $blog_id);
     }
     // Are we dealing with a person or a community?
     if (user_type($this->ident) == "person") {
         if ($result = get_record('users', 'ident', $this->user_id)) {
             $this->user_name = $result->name;
             $this->user_username = $result->username;
         }
         $posts = get_records_select('weblog_posts', "owner = ? AND weblog = ?", array($this->user_id, $this->user_id), 'posted DESC');
         $this->blog_name = $this->user_name;
         $this->blog_username = $this->user_username;
         $this->owner = $this->user_id;
     } else {
         // It's a community
         $this->community = true;
         // Get the owner
         $this->owner = user_info('owner', $this->ident);
         // Inject an SQL restriction if the user is not owner
         $sql_insert = "";
         if ($this->owner != $this->user_id) {
             $sql_insert = " and owner = {$this->user_id} ";
         }
         if ($result = get_record('users', 'ident', $this->ident)) {
             $this->blog_name = $result->name;
             $this->blog_username = $result->username;
         }
         $posts = get_records_select('weblog_posts', "weblog = {$this->ident} {$sql_insert}", null, 'posted DESC');
         $user = run('users:instance', array('user_id' => $this->user_id));
         $this->user_name = $user->getName();
         $this->user_username = $user->getUserName();
     }
     $this->posts = array();
     if (is_array($posts) && sizeof($posts) > 0) {
         foreach ($posts as $post) {
             $this->posts[] = $post->ident;
         }
     } else {
     }
 }
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:62,代码来源:class_weblog.php

示例10: login

 /**
  * 登录验证
  */
 public function login($username, $password)
 {
     $times_db = M('times');
     //查询帐号
     $info = $this->where(array('username' => $username, 'status' => 1))->find();
     if (!$info) {
         $this->error = '用户不存在!';
         return false;
     }
     //密码错误剩余重试次数
     $rtime = $times_db->where(array('username' => $username, 'type' => '0'))->find();
     if ($rtime['times'] >= C('MAX_LOGIN_TIMES')) {
         $minute = C('LOGIN_WAIT_TIME') - floor((time() - $rtime['time']) / 60);
         if ($minute > 0) {
             $this->error = "密码重试次数太多,请过{$minute}分钟后重新登录!";
             return false;
         } else {
             $times_db->where(array('username' => $username, 'type' => '0'))->delete();
         }
     }
     $password = md5(md5($password) . $info['encrypt']);
     $ip = get_client_ip(0, true);
     if ($info['password'] != $password) {
         if ($rtime && $rtime['times'] < C('MAX_LOGIN_TIMES')) {
             $times = C('MAX_LOGIN_TIMES') - intval($rtime['times']);
             $times_db->where(array('username' => $username, 'type' => '0'))->save(array('ip' => $ip));
             $times_db->where(array('username' => $username, 'type' => '0'))->setInc('times');
         } else {
             $times_db->where(array('username' => $username, 'type' => '0'))->delete();
             $times_db->add(array('username' => $username, 'ip' => $ip, 'type' => '0', 'time' => time(), 'times' => 1));
             $times = C('MAX_LOGIN_TIMES');
         }
         $this->error = "密码错误,您还有{$times}次尝试机会!";
         return false;
     }
     $times_db->where(array('username' => $username, 'type' => '0'))->delete();
     $this->where(array('userid' => $info['userid']))->save(array('lastloginip' => $ip, 'lastlogintime' => time()));
     //登录日志
     $admin_log_db = M('admin_log');
     $admin_log_db->add(array('userid' => $info['userid'], 'username' => $username, 'httpuseragent' => $_SERVER['HTTP_USER_AGENT'], 'ip' => $ip, 'time' => date('Y-m-d H:i:s'), 'type' => 'login', 'sessionid' => session_id()));
     $admin_role_db = D('AdminRole');
     $roleInfo = $admin_role_db->field(array('rolename', 'roleid'))->where(array('roleid' => $info['roleid'], 'status' => 1))->find();
     if (!$roleInfo) {
         $this->error = '用户已被冻结!';
         return false;
     }
     $info['rolename'] = $roleInfo['rolename'];
     user_info('', $info);
     //登录信息更新
     S('USER_LOGIN_INFO_' . $info['userid'], array('sessid' => session_id(), 'time' => date('Y-m-d H:i:s'), 'useragent' => $_SERVER['HTTP_USER_AGENT'], 'ip' => $ip, 'identity' => cookie('identity')));
     return true;
 }
开发者ID:easytp,项目名称:easytp,代码行数:55,代码来源:AdminModel.class.php

示例11: template_pagesetup

function template_pagesetup()
{
    // register links --
    global $profile_id;
    global $PAGE;
    global $CFG;
    $page_owner = $profile_id;
    if (defined("context") && context == "account" && !$CFG->disable_templatechanging && user_info("user_type", $_SESSION['userid']) != "external") {
        if ($page_owner == $_SESSION['userid'] && $page_owner != -1) {
            $PAGE->menu_sub[] = array('name' => 'template:change', 'html' => a_href("{$CFG->wwwroot}mod/template/", __gettext("Change theme")));
        }
    }
    $CFG->templates->variables_substitute['templatesroot'][] = "templates_root";
}
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:14,代码来源:lib.php

示例12: a_home_pagesetup

function a_home_pagesetup()
{
    // register links --
    global $profile_id;
    global $PAGE;
    global $CFG;
    $page_owner = $profile_id;
    $rss_username = user_info('username', $page_owner);
    define("home", $context);
    if (isloggedin()) {
        if (defined("context") && context == "home" && $page_owner == $_SESSION['userid']) {
            $PAGE->menu[] = array('name' => 'home', 'html' => "<li><a href=\"{$CFG->wwwroot}/ \" class=\"selected\" >" . __gettext("Home") . '</a></li>');
        } else {
            $PAGE->menu[] = array('name' => 'home', 'html' => "<li><a href=\"{$CFG->wwwroot} \" >" . __gettext("Home") . '</a></li>');
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:17,代码来源:lib.php

示例13: display_wad_table

 function display_wad_table($limit = 0)
 {
     echo "\n<table>\n\t<tr>\n\t\t<th></th>\n\t\t<th>File</th>\n\t\t<th>Size</th>\n\t\t<th>Uploaded by</th>\n\t\t<th>Date and time</th>\n\t\t<th>MD5</th>\n\t</tr>\n";
     $db = getsql();
     $limitstring = '';
     if ($limit > 0) {
         $limitstring = " LIMIT {$limit}";
     }
     $q = $db->query("SELECT * FROM `wads` ORDER BY `time` DESC {$limitstring}");
     if ($q->num_rows < 1) {
         echo "\n<div id='serversbox'>\n\t<div style='width: 100%; text-align: center'>\n\t\tThere are no WADs uploaded yet.\n\t\t";
         if (is_authed()) {
             echo "\n\t\t<br />\n\t\tFeel free to upload one from the main WADs page.\n\t\t";
         }
         echo "\n\t</div>\n</div>\n\t\t\t\t\t";
     } elseif ($q->num_rows > 0) {
         while ($o = $q->fetch_object()) {
             $id = $o->id;
             $size = human_filesize(filesize(disciple_json()->serverdata . '/wads/' . $o->filename));
             $filename = $o->filename;
             $uploader = $o->uploader;
             $uploader_name = user_info($uploader)->username;
             $time = date('Y-m-d \\a\\t H:i:s', $o->time);
             echo "\n<tr id='wadrow-{$id}'>\n\t<td>\n";
             if (is_authed()) {
                 if (user_info()->userlevel >= UL_ADMINISTRATOR || $uploader == $_SESSION['id']) {
                     echo "<a href='javascript:deleteWad({$id});' title='Delete'><i class='material-icons'>delete</i></a>";
                 }
                 if (user_info()->userlevel >= UL_ADMINISTRATOR) {
                     if ($db->query("SELECT * FROM `wadbans` WHERE `md5`='" . $o->md5 . "'")->num_rows == 0) {
                         echo "<a href='javascript:banWad({$id});' title='Ban'><i class='material-icons'>not_interested</i></a>";
                     } else {
                         echo "<a href='javascript:unbanWad({$id});' title='Unban'><i class='material-icons'>done</i></a>";
                     }
                 }
             }
             echo "\n</td>\n<td><a href='/wads/{$filename}'>{$filename}</a></td>\n<td>{$size}</td>\n<td>{$uploader_name}</td>\n<td>{$time}</td>\n<td id='wadmd5-{$id}'><a href='javascript:wadMd5({$id});'>Show</a></td>\n</tr>\n";
         }
         echo "</table>";
     }
 }
开发者ID:csnxs,项目名称:disciple,代码行数:41,代码来源:wads.php

示例14: view

 function view()
 {
     global $data;
     global $page_owner;
     global $CFG;
     /*$run_result = '';
             $usertype = user_type($page_owner);
     
             $icon = user_info('icon',$page_owner);
             $username = user_info('username',$page_owner);
             $icon_url = $CFG->wwwroot.'_icon/user/'.$icon.'/w/240';
     
             // $first_column_fields = array('biography','likes','dislikes');
             // $id_block_fields = array('gender','town','country','birth_date');
     
     
             // Cycle through all defined profile detail fields and display them
     
             $allvalues = get_records('profile_data','owner',$this->id);
             $first_column_fields = array();
             $second_column_fields = array();
             $firstcol = "";
             $secondcol = "";
             foreach($data['profile:details'] as $field) {
                 if (is_array($field)) {
                     $flabel = !empty($field[0]) ? $field[0] : '';
                     $fname  = !empty($field[1]) ? $field[1] : '';
                     $ftype  = !empty($field[2]) ? $field[2] : '';
                     $fblurb = !empty($field[3]) ? $field[3] : '';
                     $fusertype = !empty($field[4]) ? $field[4] : '';
                     $finvisible = false;
                     $frequired = false;
                     $fcat = __gettext("Main");
                 // Otherwise map things the new way!
                 } else {
                     $flabel = $field->name;
                     $fname = $field->internal_name;
                     $ftype = $field->field_type;
                     $fblurb = $field->description;
                     $fusertype = $field->user_type;
                     $finvisible = $field->invisible;
                     $frequired = $field->required;
                     if (!isset($field->col1)) {
                         $col1 = false;
                     } else {
                         $col1 = $field->col1;
                         $first_column_fields[] = $fname;
                     }
                     if (!isset($field->col2)) {
                         $col2 = false;
                     } else {
                         $col2 = $field->col2;
                         $second_column_fields[] = $fname;
                     }
                     if (!empty($field->category)) {
                         $fcat = $field->category;
                     } else {
                         $fcat = __gettext("Main");
                     }
                 }
                 if (empty($fusertype) || $usertype == $fusertype) {
                 // $field is an array, with the name
                 // of the field in $field[0]
                     if (in_array($fname,$first_column_fields)) {
                         $firstcol .= $this->field_display($field,$allvalues);
                     } else if (in_array($fname,$second_column_fields)) {
                         $secondcol .= $this->field_display($field,$allvalues);
                     }
                 }
             }*/
     // $other_fields = array_merge($first_column_fields,$second_column_fields);
     //$run_result .= '<div class="profile_main">'."\n";
     //$run_result .= '<div class="profile_primary">'."\n";
     // $run_result .= '<div class="profile_icon"><img src="'.$icon_url.'"></div>'."\n";
     //$run_result .= $firstcol;
     /*$run_result .= templates_draw(array(
                               'context' => 'databox1',
                               'name' => __gettext("Extended profile"),
                               'column1' => "<a href=\"{$CFG->wwwroot}profile/extended.php?profile_name={$username}\">" . __gettext("Click here to view extended profile") . "</a>"
                               )
       );*/
     //$run_result .= '</div>'."\n";
     //$run_result .= '<div class="profile_secondary">'."\n";
     //$run_result .= $secondcol;
     //$run_result .= "</div>\n";
     //$run_result .= '<div class="profile_main_bottom"></div>'."</div>\n";
     /*//Pruebas con el perfil extendido
     
     		$profile_name = optional_param('profile_name', '', PARAM_ALPHANUM);
     		if (!empty($profile_name)) {
         		$profile_id = user_info_username('ident', $profile_name);
     		}
     		if (empty($profile_id)) {
         		$profile_id = optional_param('profile_id', -1, PARAM_INT);
     		}
     		// and the page_owner naturally
     		$page_owner = $profile_id;
     
     		define("context", "profile");
     		//templates_page_setup();
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:tulipan-svn,代码行数:101,代码来源:index.php

示例15: include

<?
//TODO: Redo html
if (!check_perms('admin_manage_permissions')) { error(403); }
if(!isset($_REQUEST['userid']) || !is_number($_REQUEST['userid'])){ error(404); }

include(SERVER_ROOT."/classes/permissions_form.php");

list($UserID, $Username, $PermissionID) = array_values(user_info($_REQUEST['userid']));

$DB->query("SELECT 
		p.Values,
		u.CustomPermissions 
	FROM users_main AS u 
	LEFT JOIN permissions AS p ON u.PermissionID=p.ID 
	WHERE u.ID='$UserID'");

list($Defaults,$Customs)=$DB->next_record(MYSQLI_NUM, array(0,1));


$Defaults = unserialize($Defaults);

$Delta=array();
if (isset($_POST['action'])) {
	foreach ($PermissionsArray as $Perm => $Explaination) {
		$Setting = (isset($_POST['perm_'.$Perm]))?1:0;
		$Default = (isset($Defaults[$Perm]))?1:0;
		if ($Setting != $Default) {
			$Delta[$Perm] = $Setting;
		}
	}
	$Cache->begin_transaction('user_info_heavy_'.$UserID);
开发者ID:4play,项目名称:gazelle2,代码行数:31,代码来源:permissions.php


注:本文中的user_info函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。