get_row("select * from ".$qs_db_pre."system_users where uname = '".$username."' and uid = '".$uid."'");
$user_pass = $_COOKIE[$cookmd5];
$sql_pass = $user->pass;
$passmd5 = md5($sql_pass.$qs_user_code);
if($_COOKIE[$cookmd5] == $passmd5){
$login_true = '1';
//echo '验证成功,已登录';
}else{
//echo '验证失败';
header('Location: /login.html');
die();
}
}else{
header('Location: /login.html');
die();
}
if($login_true == '1'){
$article = $db->get_results("select * from ".$qs_db_pre."article_bookcase where userid = '".$uid."' order by joindate desc");
if($article){
$k = 0;
foreach($article as $v){
$aid = $v->articleid;
$lastchapter = $db->get_row("select lastchapterid,lastchapter,author from ".$qs_db_pre."article_article where articleid = '".$aid."'");
$arr[$k]['articleid'] = $aid + $qs_group_id;
$arr[$k]['articleid2'] = $aid;
$arr[$k]['author'] = $lastchapter->author;
$arr[$k]['author16'] = urlencode($arr[$k]['author']);
$arr[$k]['shortid'] = intval(($v->articleid + $qs_group_id) / 1000);
$arr[$k]['articlename'] = $v->articlename;
$arr[$k]['bookmarkid'] = $v->chapterid == 0 ? "" : $v->chapterid + $qs_group_id;
$arr[$k]['bookmark'] = $v->chaptername;
$arr[$k]['lastchapter'] = $lastchapter->lastchapter;
$arr[$k]['lastchapterid'] = $lastchapter->lastchapterid + $qs_group_id;
$arr[$k]['info_url'] = str_replace('{aid}',aid_09az($arr[$k]['articleid']), $info_rewrite);
$arr[$k]['info_url'] = str_replace('{bid}',aid_09az($arr[$k]['shortid']), $arr[$k]['info_url']);
$arr[$k]['author_url'] = str_replace('{author}',$arr[$k]['author16'], $author_rewrite);
$arr[$k]['read_url'] = str_replace('{aid}',aid_09az($arr[$k]['articleid']), $read_rewrite);
$arr[$k]['read_url'] = str_replace('{bid}',aid_09az($arr[$k]['shortid']), $arr[$k]['read_url']);
$arr[$k]['lastchapterid_url'] = str_replace('{cid}',cid_09az($arr[$k]['lastchapterid']), $arr[$k]['read_url']);
$arr[$k]['bookmarkid_url'] = str_replace('{cid}',cid_09az($arr[$k]['bookmarkid']), $arr[$k]['read_url']);
$k++;
}
$tpl->assign('num',$k);
$tpl->assign('articlerows',$arr);
}
else{
$tpl->assign("tips"," 啥也没有,啥也不是~~ -_- 书架里空空如也!去书库挑几本书看看吧!");
}
}
$index_body ='mybook';
$tpl->assign("index_body",$index_body);
$cachedir = str_replace('\\','/',$tpl->cache_dir).$qs_theme_name.'/'.$qs_theme_name.'/index/';
$tpl->cache_dir = $cachedir;
$tpl->display('mybook.qs','mybook');
unset($db);
die();