您的位置:首页 > 其它

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

2008-07-28 23:10 1756 查看
都是在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());
//$result=mysql_query("SELECT obookid,obookname,lastchapterid,lastchapter,lastupdate,author,sortid,baoyuedateline FROM jieqi_obook_obook where display=0 order by obookid desc limit $offset,$pagesize") or die("查询".$database."数据库出错".mysql_error());
//echo "document.write('<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">');";
$iii=0;
function getchapter($dateline,$oid){
$sql="select chaptername,lastupdate,ochapterid from jieqi_obook_ochapter where obookid=".$oid." order by lastupdate desc limit 1";
$oresult=mysql_query($sql);
$orow=mysql_fetch_array($oresult);
$dxyarr=array();
$dxyarr[]=$orow['chaptername'];
$dxyarr[]=$orow['ochapterid'];
$dxyarr[]=$orow['lastupdate'];
return $dxyarr;
mysql_free_result($oresult);
}
while($row=mysql_fetch_array($result)){
    $iii++;
$obookname=$row['obookname'];
$theid=$row['obookid'];
//$chapid=$row['lastchapterid'];
$lastchapter=$row['lastchapter'];
$baoyuedateline=$row['baoyuedateline'];
$lastchapters=getchapter($baoyuedateline,$theid);
//var_dump($lastchapters);
$lastchapter2=$lastchapters[0];
$chapid=$lastchapters[1];
$artid=$row['articleid'];
$ml=floor($artid/1000);
$articleurl="http://yc.xhxsw.com/files/article/info/".$ml."/".$artid.".htm";
$artm="http://yc.xhxsw.com/modules/article/articlemanage.php?id=".$artid;
$vipm="http://yc.xhxsw.com/modules/obook/obookmanage.php?id=".$theid;
$url_obookinfo="http://yc.xhxsw.com/modules/obook/reader.php?aid=".$theid."&cid=".$chapid."";
$obookinfo="http://yc.xhxsw.com/modules/obook/obookinfo_baoyue.php?id=".$theid;
if ($lastchapter2==''){
$lastchapter2="此书暂时不支持包月";
$url_obookinfo=$obookinfo;
}
$lastupdate=date("m-d",$row['lastupdate']);
//$lastupdate=date("m-d",$lastchapters[2]);
$author=$row['author'];
$leibie=$row['sortid'];
?>
              <tr>
                <td height="17" bgcolor="#FFFFFF" align="center"><a href="<?=$artcleurl?>" target="_blank"><?=$obookname?></a></td>
<td bgcolor="#FFFFFF"><a href="<?=$url_obookinfo?>" target="_blank"><?=$lastchapter2?></a></td>
                <td bgcolor="#FFFFFF" align="center"><?=$lastupdate?></td>
                <td bgcolor="#FFFFFF"><a href="<?=$artm?>" target="_blank"><?=$obookname?>[公众]</a></td>
                <td bgcolor="#FFFFFF"><a href="<?=$vipm?>" target="_blank"><?=$obookname?>[<font color="red">vip</font>]</a></td>
              </tr>
              <?php
}
mysql_free_result($result);
mysql_close();
//echo "document.write('</table>');";
function mygb2big5($s)
{
    //return $s; 
    //var_dump($s);
    $s = iconv('gb2312','big5',$s);
    //var_dump($s);
    return $s; 
}
?>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  杰奇 session