".($nowtime-86400); } if($type == "weekvisit" ) { $typename = "周排行榜";$orderby = "weekvisit";$where = "where lastvisit > ".($nowtime-604800); } if($type == "monthvisit" ){ $typename = "月排行榜";$orderby = "monthvisit";$where = "where lastvisit > ".($nowtime-2592000); } if($type == "allvisit" ) { $typename = "总排行榜";$orderby = "allvisit";$where = ""; } if($type == "allvote" ) { $typename = "总推荐榜";$orderby = "allvote";$where = ""; } if($type == "goodnum" ){ $typename = "总收藏榜";$orderby = "goodnum";$where = "where goodnum > 0"; } if( $type == "size" ){ $typename = "字数排行";$orderby = "size";$where = ""; } if( $type == "postdate" ){ $typename = "最新入库";$orderby = "postdate";$where = ""; } if( $type == "lastupdate") { $typename = "最近更新";$orderby = "lastupdate";$where = ""; } $query_all = @mysql_query("select articleid from jieqi_article_article ".$where) or die(mysql_error()."sql error 2"); $numall = mysql_num_rows($query_all); $pagecount = ceil( $numall / $pagenum ) ; $numbegin = ( $pageid - 1 ) * $pagenum ; $numend = $pagenum ; //处理上一页和下一页页码 if($pageid != 1){ $previd = $pageid - 1; } if($pageid != $pagecount){ $nextid = $pageid + 1; } else{ $nextid = $pagecount; } $query = @mysql_query("select articleid,articlename,author,sortid from jieqi_article_article ".$where." order by ".$orderby." desc limit ".$numbegin.",".$numend) or die("sql error 3"); if($num = mysql_num_rows($query)){ $content .= '
';//开始 while($row = mysql_fetch_array($query)){ $sortname = substr($jieqiSort['article'][$row[sortid]][caption],0,4); //x-x-s-s $content .= '

['.$sortname.']'.$row[articlename].'/'.$row[author].'

'; } //页码处理 $shouye = '首页'; $preview = '上页'; $next = '下页'; $weiye = '尾页'; //第一页 if($pageid == 1 ){ $shouye = '';$preview = ''; } //最后一页 if($pageid == $pagecount){ $weiye = '';$next = ''; } if($pageid == 1 && $pageid == $pagecount){ $next = '下页'; $weiye = '尾页'; } $content .='
'.$shouye.$preview.$next.$weiye.'
输入页数
(第'.$pageid.'/'.$pagecount.'页)当前'.$pagenum.'条/页
'; $content .='
';//结束 } else{ $content = "
此页无数据!
"; } } else{ die("1-".$type); } } /*******************请在此设置具体排行榜页面 标题、关键词、描述 *******************/ /*标题*/ $title = $typename.'-小说排行榜-'.$sitename.'手机阅读'; /*关键词*/ $ky = $typename.',推荐排行榜,排行榜,小说排行榜'; /*描述*/ $des = '小说排行榜是'.$sitename.'用户推举的小说排行榜,本页为'.$typename; /*******************设置具体排行榜页面 标题、关键词、描述 结束*******************/ } else{ /************再此设置总排行榜页面标题****************/ $title = '排行榜-'.$sitename.'手机阅读'; } ?> <?php echo $title;?>
返回

首页
function page(){ var p = document.getElementById("pageinput").value; if(isPositiveNum(p)){window.open("/top-'.$type.'-"+p+"/","_self");} function isPositiveNum(s){ var re = /^[0-9]*[1-9][0-9]*$/ ; return re.test(s) } } document.getElementById("'.$type.'").style.cssText = "background-color:#CCCCCC"; ';} ?>