main.php

2018-09-07 14:52

阅读:405

  <?php
/**
*SiteMainPage
*
*@version$Id2003-04-1118:06:20$
*/

tpl_load(index.html,,keep);

//Getulanguage
$G_lang=explode(,,$_SERVER[HTTP_ACCEPT_LANGUAGE]);
switch($G_lang[0]){
casezh-hk:
casezh-tw:
casezh-mo:
casezh-cn:
include(lang.zh.inc.php);
$indexfile=main_zh.htm;
break;
default:
include(lang.en.inc.php);
$indexfile=main_en.htm;
}

$filedate=(int)date(time()-@filemtime($indexfile));

//Iflastupdatelessthanfivehoursthenupdate
if($filedate<18000&&filesize($indexfile)<>0&&empty($_GET[update])){
require($indexfile);
exit();

}else{

//Randtitle
require_oncetitles.inc.php;

$currdate=date(md);

if($title_h[$currdate]){
$title_more=$title_h[$currdate];
}else{
$title_more=$title_o[array_rand($title_o)];
}

//Importtemplate
$tpl->setVar(FILEHEAD,file_head());

/*
$tpl->setVar(FILEPIC,file_pic(phptshirt.gif,国内首款PHPT-shirt火热预定中……,
$tpl->setVar(FILEPIC,file_pic(phpandmore.gif,《PHPMore》创刊号发布,
$tpl->setVar(FILEPIC,file_pic(3.jpg,超越PHP欢迎您,));
$tpl->setVar(FILEPIC,file_pic(show.gif,Show出你的热情活动--点击查看详情,
$tpl->setVar(FILEPIC,file_pic(1year.gif,超越PHP一岁了,
*/

$tpl->setVar(CREATE,date(Y-m-dH:i:s));
$tpl->setVar(DESC,$lang[sitedesc]);
$tpl->setVar(KEYWORDS,$lang[sitekeywork]);
$tpl->setVar(TITLE,$lang[sitetitle].$title_more);

/*
DBInit();
extract($dbinfo,EXTR_OVERWRITE);
$rs=$dbconn->Execute(SHOWTABLES);
while($result=$rs->FetchRow())$tables.=$result[Tables_in_$dbname].,;
$SQL=OPTIMIZETABLE.substr($tables,0,-1);
$dbconn->Execute($SQL);
*/

$indexlogin=<scripttype=text/javascriptlanguage=Javascriptsrc=user_login.php></script>;
$tpl->setVar(INDEXLOGIN,$indexlogin);

$space=<tablewidth=95%border=0align=centercellpadding=0cellspacing=0><tr><td><imgsrc=images/spacer.gifwidth=1height=10alt=></td></tr></table>;

ob_start();
//echoitem_title($lang[stat],98%);
include(index_stat.inc.php);
$tpl->setVar(INDEXCOUNT,ob_get_contents());
ob_end_clean();

ob_start();
//echoitem_title($lang[vote],98%);
include(index_vote.inc.php);
$tpl->setVar(INDEXVOTE,ob_get_contents());
ob_end_clean();

ob_start();
//echoitem_title($lang[links],98%);
include(index_links.inc.php);
$tpl->setVar(INDEXLINK,ob_get_contents());
ob_end_clean();

ob_start();
//echoitem_title($lang[intro],98%);
include(index_intro.inc.php);
$tpl->setVar(INDEXINTRO,ob_get_contents());
ob_end_clean();

ob_start();
//echoitem_title($lang[news]..make_link(/?n=RSS&t=news,(rss),_blank,class=en2),98%);
include(index_news.inc.php);
$tpl->setVar(INDEXNEW,ob_get_contents());
ob_end_clean();

ob_start();
//echoitem_title($lang[articles]..make_link(/?n=RSS&t=articles,(rss),_blank,class=en2),98%);
include(index_article.inc.php);
$tpl->setVar(INDEXARTICLE,ob_get_contents());
ob_end_clean();

ob_start();
//echoitem_title($lang[recommendtopic],98%);
echo
<tablewidth=98%cellpadding=0cellspacing=0border=0>
<tr><tdalign=left>
<scriptlanguage=Javascripttype=text/javascriptsrc=.$Global[bbs].recommend_topic.php?cid=2,6,15,16,18></script>
</td></tr>
<tr><tdbgcolor=#DDDDDDalign=right><ahref=.$Global[bbs].title=More...>更多推荐话题...</a></td></tr>
</table>
;
$tpl->setVar(RECOMMENDTOPIC,ob_get_contents());
ob_end_clean();

ob_start();
echo
<tablewidth=98%cellpadding=0cellspacing=0border=0>
<tr><tdalign=left>
<scriptlanguage=Javascripttype=text/javascriptsrc=.$Global[bbs].recommend_topic.php?cid=13></script>
</td></tr>
<tr><tdbgcolor=#DDDDDDalign=right><ahref=.$Global[bbs].index.php?s=act=SFf=13title=More...>更多招聘信息...</a></td></tr>
</table>
;
$tpl->setVar(HRTOPIC,ob_get_contents());
ob_end_clean();

ob_start();
//echoitem_title($lang[faqs]..make_link(/?n=RSS&t=faqs,(rss),_blank,class=en2),98%);
include(index_faq.inc.php);
$tpl->setVar(INDEXFAQ,ob_get_contents());
ob_end_clean();

ob_start();
//echoitem_title($lang[nav],98%);
include(index_sitenav.inc.php);
$tpl->setVar(INDEXNAV,ob_get_contents());
ob_end_clean();

ob_start();
//echoitem_title($lang[tips],98%);
include(index_tips.inc.php);
$tpl->setVar(INDEXTIPS,ob_get_contents());
ob_end_clean();

/*
ob_start();
echoitem_title($lang[events],98%);
$tpl->setVar(INDEXEVENTS,ob_get_contents());
ob_end_clean();
*/

ob_start();
//echoitem_title($lang[resouce],98%);
include(index_resource.inc.php);
$tpl->setVar(INDEXRESOURCE,ob_get_contents());
ob_end_clean();

ob_start();
//echoitem_title($lang[souwang],98%);
echo
<formaction=/search.htmlmethod=get>
互联网上的php资源<br>
<inputstyle=width:100pxtype=textclass=smallsize=20value=phpname=q>
<inputtype=submitvalue=souwangclass=en1>
</form>
;
$tpl->setVar(INDEXSOUWANG,ob_get_contents());
ob_end_clean();

//$tpl->setVar(INDEXPARTNERS,item_title($lang[partners],98%));

ob_start();
//echoitem_title($lang[calendar],98%);
include_oncecalendar.inc.php;
$c=newCalendar;
echo$c->getCurrentmonthView();
$tpl->setVar(INDEXCALENDAR,ob_get_contents());
ob_end_clean();

ob_start();
//echoitem_title($lang[newtopic],98%);
echo
<tablewidth=95%cellpadding=0cellspacing=0border=0>
<tr><tdalign=left>
<scriptlanguage=Javascripttype=text/javascriptsrc=.$Global[bbs].new_topic.php?cid=2,6,15,16,18></script>
</td></tr>
</table>
;
$tpl->setVar(INDEXFORUM,ob_get_contents());
ob_end_clean();

ob_start();
//echoitem_title($lang[maillist],98%);
echo
<table>
<tr>
<tdalign=center>
<formmethod=postaction=/?n=Maillist>
<fontclass=en1>Jointhemaillist:</font>
<inputstyle=width:100pxname=mtype=textclass=smallsize=20maxlength=100title=加入邮件列表value=EnteryourmailonFocus=if(this.value==\Enteryourmail\)this.value=\\;onBlur=if(this.value==\\)this.value=\Enteryourmail\;><br>
<inputtype=submitvalue=Submitclass=en1>
</form>
</td>
</tr>
</table>
;
$tpl->setVar(INDEXMAIL,ob_get_contents());
ob_end_clean();

//Myname:)
$s_name=index.php;

$tpl->setVar(SPACE,$space);
$tpl->setVar(FILEFOOT,file_foot());

$tpl->parse(output,main);
$output=$tpl->get(output);

//Rwritetofile
wfile($indexfile,$output);
require($indexfile);
}
?>


评论


亲,登录后才可以留言!