代码如下:
$shipingtpmain = '';
$query = $db->query("SELECT t . fid , f . fup , f . name ,t.author,t.views, t . tid , t . subject ,t . dateline FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f . fid =t . fid where t . fid =1 ORDER BY `t` . `dateline` DESC LIMIT 0, 16");
while($shipingtp = $db->fetch_array($query)) {
$shipingtp[subject]=cutstr($shipingtp[subject],26);
$times=gmdate("$dateformat ", $shipingtp[dateline] + $timeoffset * 3600);
$shipingtpmain.="
$shipingtp[subject] |
代码如下:
//IT数码
$itshuomamain = '';
$query = $db->query("SELECT t . fid , f . fup , f . name ,t.author,t.views, t . tid , t . subject ,t . dateline FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f . fid =t . fid where f . fup =21 ORDER BY `t` . `dateline` DESC LIMIT 0, 10");
while($itshuoma = $db->fetch_array($query)) {
$itshuoma[subject]=cutstr($itshuoma[subject],30);
$itshuomamain.="
【$itshuoma[name]】$itshuoma[subject] |
代码如下:
$hotmember1 = '';
$query = $db->query("SELECT username, uid, posts FROM {$tablepre}members ORDER BY posts DESC LIMIT 0, 10");
while($member = $db->fetch_array($query)) {
$hotmember1.="
|
代码如下:
//社区精华TOP
$jingthreads = '';
$query = $db->query("SELECT * FROM {$tablepre}threads t LEFT JOIN {$tablepre}forums f ON f . fid =t . fid where digest ORDER BY `t` . `lastpost` DESC LIMIT 0, 7");
while($thread = $db->fetch_array($query)) {
$thread[subject] = cutstr($thread[subject], 35);
$jingthreads.="
·$thread[subject] |
代码如下:
//最新文章
$replythreads = '';
$query = $db->query("SELECT author, views, tid, subject, lastpost FROM {$tablepre}threads ORDER BY dateline DESC LIMIT 0, 10");
while($thread = $db->fetch_array($query)) {
$thread[subject] = cutstr($thread[subject], 27);
$thread[lastpost] = gmdate("Y-m-j g:i", $thread[lastpost] + $timeoffset * 3600);
$replythreads.="
代码如下:
$tightlink_text = $tightlink_logo = '';
$query = $db->query("SELECT * FROM {$tablepre}forumlinks ORDER BY displayorder");
while($flink = $db->fetch_array($query)) {
if($flink['note']) {
if($flink['logo']) {
$forumlink['type'] = 1;
$forumlink['logo'] = $flink['logo'];
} else {
$forumlink['type'] = 2;
}
$data[] = $forumlink;
} else {
if($flink['logo']) {
$tightlink_logo .= "target=\"_blank\" class='mainlink1'>[name]\" alt=\"$flink[content]\"> ";
} else {
$tightlink_text .= "target=\"_blank\" class='mainlink1'>[$flink[name]] ";
}
}
}
if($tightlink_logo || $tightlink_text) {
$tightlink_logo .= $tightlink_logo ? '
' : '';
$data[] = array('type' => 3, 'content' =>
$tightlink_logo.$tightlink_text);
}
代码如下:
/*$discuz_action = 1;
把上面的所有代码(不包括这句)替换为
[Copy to clipboard] [ - ]CODE:
if(file_exists("main.html"))
{
$time=time();
//文件修改时间和现在时间相差?的话,直接导向html文件,否则重新生成html
if($time-filemtime("main.html")< 600)
{
header("Location:main.html");
}
}
//在你的开始处加入ob_start();
ob_start();
define('CURRSCRIPT', 'main');
require './include/common.inc.php';
require DISCUZ_ROOT.'./include/forum.func.php';
代码如下:
include template('bbs_all');
代码如下:
//在结尾加入ob_end_clean(),并把本页输出到一个变量中
$temp=ob_get_contents();
ob_end_clean();
//写入文件
$fp=fopen('main.html','w');
fwrite($fp,$temp) or die('写文件错误');
//echo"生成HTML完成!";
header("Location:main.html");
?>