首页 > 网站 > 建站经验 > 正文

杰奇登录后的东西都是在session里面的

2019-11-02 17:03:56
字体:
来源:转载
供稿:网友
都是在session里面的

$_SESSION['jieqiUserId'] = $user->getVar('uid', 'n');

    $_SESSION['jieqiUserUname'] = $user->getVar('uname', 'n');

    $_SESSION['jieqiUserName'] = (strlen($user->getVar('name', 'n')) > 0) ? $user->getVar('name', 'n') : $user->getVar('uname', 'n');

    $_SESSION['jieqiUserGroup'] = $user->getVar('groupid', 'n');

    $_SESSION['jieqiUserEmail'] = $user->getVar('email', 'n');

    $_SESSION['jieqiUserAvatar'] = $user->getVar('avatar', 'n');

    $_SESSION['jieqiUserScore'] = $user->getVar('score', 'n');

    $_SESSION['jieqiUserExperience'] = $user->getVar('experience', 'n');

    $_SESSION['jieqiUserVip'] = $user->getVar('isvip', 'n');

    $_SESSION['jieqiUserEgold'] = ($user->getVar('egold', 'n')>0 || $user->getVar('esilver', 'n')>0) ? 1 : 0;

    jieqi_getconfigs('system', 'honors'); //头衔

    $honorid=intval(jieqi_gethonorid($user->getVar('score'), $jieqiHonors));

    $_SESSION['jieqiUserHonorid'] = $honorid;

    $_SESSION['jieqiUserHonor'] = isset($jieqiHonors[$honorid]['name'][intval($user->getVar('workid', 'n'))]) ? $jieqiHonors[$honorid]['name'][intval($user->getVar('workid', 'n'))] : $jieqiHonors[$honorid]['caption'];

具体的应用

<?php

require_once('global.php');

include_once( JIEQI_ROOT_PATH."/class/users.php" );

$users_handler =& jieqiusershandler::getinstance( "JieqiUsersHandler" );

$jieqiUsers = $users_handler->get($_SESSION['jieqiUserId']);

$charset=$_GET['charset'];

if(!$charset) {

    $charset="gb2312";

}else{

}

$checkit=$_GET['checkit'];

include("configs/obook/sort.php");

include("modules/obook/baoyuedata.php");

?>

<?php

$flag=intval($_GET['flag']);

$pagesize=intval($_GET['pagesize']);

$link=mysql_connect("localhost","username","password")

or die("无法连接到mysql数据库".mysql_error());

mysql_select_db("ycxhxswcom",$link);

mysql_query("SET NAMES 'gb2312'",$link);

$day30=time()-60*60*24*30;

$day3=time()-60*60*24*3;

$offset=0;

if(!$pagesize) $pagesize=19;

//echo $idall;

$result=mysql_query("SELECT articleid,obookid,obookname,lastchapterid,lastchapter,lastupdate,author,sortid,baoyuedateline FROM jieqi_obook_obook where obookid in (".$baoyuebooksid.") and display=0 order by obookid desc limit $offset,$pagesize") or die("查询".$database."数据库出错".mysql_error());
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表