main.php_php instance
Last Update:2017-01-18
Source: Internet
Author: User
<?php
/**
* Site Main Page
*
* @author Avenger <avenger@php.net>
* @version $Id 2003-04-11 18:06:20 $
*/
Require_once ' header.inc.php ';
Tpl_load ("index.html", ', ' keep ');
Get U language
$G _lang = Explode (', ', $_server[' http_accept_language ']);
Switch ($G _lang[0]) {
Case ' ZH-HK ':
Case ' ZH-TW ':
Case ' Zh-mo ':
Case ' ZH-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));
If Lastupdate less than five hours then update
if ($filedate <18000 && filesize ($indexfile) <>0 && empty ($_get[' Update ')) {
Require ($indexfile);
Exit ();
} else {
Rand Title
Require_once ' titles.inc.php ';
$currdate = Date (' MD ');
if ($title _h[$currdate]) {
$title _more = $title _h[$currdate];
} else {
$title _more = $title _o[array_rand ($title _o)];
}
Import Template
$tpl->setvar ("Filehead", File_head ());
/*
$tpl->setvar ("Filepic", File_pic (' phptshirt.gif ', ' the first domestic PHP T-shirt hot book ... ', ' http://www.phpe.net/t-shirt '));
$tpl->setvar ("Filepic", File_pic (' phpandmore.gif ', ' Php&more ' issued the inaugural issue, ' http://www.phpe.net/news/34.shtml ') );
$tpl->setvar ("Filepic", File_pic (' 3.jpg ', ' beyond PHP Welcome ', '));
$tpl->setvar ("Filepic", File_pic (' Show.gif ', ' show out your passionate activity--click to view Details ', ' Http://www.phpe.net/club/index.php?act=ST &f=2&t=1416 '));
$tpl->setvar ("Filepic", File_pic (' 1year.gif ', ' beyond PHP one year old ', ' Http://www.phpe.net/club/index.php?s=&act=ST &f=7&t=2419 '));
*/
$tpl->setvar ("CREATE", Date (' y-m-d h: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 (' show TABLES ');
while ($result = $rs->fetchrow ()) $tables. = $result ["Tables_in_$dbname"]. ",";
$SQL = ' OPTIMIZE TABLE '. substr ($tables, 0,-1);
$dbconn->execute ($SQL);
*/
$indexlogin = ' <script type= ' text/javascript ' language= ' javascript ' src= ' user_login.php ' ></script> ';
$tpl->setvar ("Indexlogin", $indexlogin);
$space = ' <table width= ' border= "0" align= "center" cellpadding= "0" cellspacing= "0" ><tr><td>< IMG src= "Images/spacer.gif" width= "1" "height=" "alt=" "></td></tr></table>";
Ob_start ();
Echo item_title ($lang [' Stat '], ' 98% ');
Include ("index_stat.inc.php");
$tpl->setvar ("Indexcount", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
Echo item_title ($lang [' vote '], ' 98% ');
Include ("index_vote.inc.php");
$tpl->setvar ("Indexvote", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
Echo item_title ($lang [' Links '], ' 98% ');
Include ("index_links.inc.php");
$tpl->setvar ("Indexlink", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
Echo item_title ($lang [' intro '], ' 98% ');
Include ("index_intro.inc.php");
$tpl->setvar ("Indexintro", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
Echo item_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 ();
Echo item_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 ();
Echo item_title ($lang [' recommendtopic '], ' 98% ');
Echo '
<table width= "98%" cellpadding= "0" cellspacing= "0" border= "0" >
<TR><TD align= "Left" >
<script language= "Javascript" type= "Text/javascript" src= "". $Global [' BBS ']. ' recommend_topic.php?cid=2,6,15,16,18 "></script>
</td></tr>
<TR><TD bgcolor= "#DDDDDD" align= "right" ><a href= "'. $Global [' BBS ']. "title=" more ... "> more recommended Topics ...</a> </td></tr>
</table>
';
$tpl->setvar ("Recommendtopic", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
Echo '
<table width= "98%" cellpadding= "0" cellspacing= "0" border= "0" >
<TR><TD align= "Left" >
<script language= "Javascript" type= "Text/javascript" src= "". $Global [' BBS ']. ' Recommend_topic.php?cid=13 "></script>
</td></tr>
<TR><TD bgcolor= "#DDDDDD" align= "right" ><a href= "'. $Global [' BBS ']. ' Index.php?s=&act=sf&f=13 "title=" more ... "> more recruitment information ...</a> </td></tr>
</table>
';
$tpl->setvar ("Hrtopic", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
Echo item_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 ();
Echo item_title ($lang [' nav '], ' 98% ');
Include ("index_sitenav.inc.php");
$tpl->setvar ("Indexnav", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
Echo item_title ($lang [' tips '], ' 98% ');
Include ("index_tips.inc.php");
$tpl->setvar ("Indextips", ob_get_contents ());
Ob_end_clean ();
/*
Ob_start ();
Echo item_title ($lang [' Events '], ' 98% ');
$tpl->setvar ("Indexevents", ob_get_contents ());
Ob_end_clean ();
*/
Ob_start ();
Echo item_title ($lang [' resouce '], ' 98% ');
Include ("index_resource.inc.php");
$tpl->setvar ("Indexresource", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
Echo item_title ($lang [' Souwang '], ' 98% ');
Echo '
<form action= "/search.html" method= "get" target= "_blank" >
PHP resources on the Internet <br>
<input style= "width:100px" type= "text" class= "small" size= "" value= "php" name= "Q" >
<input type= "Submit" value= "Souwang" class= "EN1" >
</form>
';
$tpl->setvar ("Indexsouwang", ob_get_contents ());
Ob_end_clean ();
$tpl->setvar ("Indexpartners", Item_title ($lang [' the ']], ' 98% ');
Ob_start ();
Echo item_title ($lang [' Calendar '], ' 98% ');
Include_once "calendar.inc.php";
$c = new Calendar;
echo $c->getcurrentmonthview ();
$tpl->setvar ("Indexcalendar", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
Echo item_title ($lang [' newtopic '], ' 98% ');
Echo '
<table width= "cellpadding=" 0 "cellspacing=" 0 "border=" 0 ">
<TR><TD align= "Left" >
<script language= "Javascript" type= "Text/javascript" src= "". $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 ();
Echo item_title ($lang [' maillist '], ' 98% ');
Echo '
<table>
<tr>
<TD align= "center" >
<form method= "POST" action= "/?n=maillist" >
<font class= "EN1" >join The Mail list:</font>
<input style= "width:100px" Name= "M" type= "text" class= "small" size= "maxlength=" "title=" Add mailing List "value=" Enter Your mail "onfocus=" if (this.value==\ ' Enter your mail\ ') this.value=\ '; ' onblur= ' if (this.value==\ ' \ ') this.value=\ ' Enter your mail\ '; ' ><br>
<input type= "Submit" value= "Submit" class= "EN1" >
</form>
</td>
</tr>
</table>
';
$tpl->setvar ("Indexmail", ob_get_contents ());
Ob_end_clean ();
My name:)
$s _name= ' index.php ';
$tpl->setvar ("Space", $space);
$tpl->setvar ("Filefoot", File_foot ());
$tpl->parse (' Output ', ' main ');
$output = $tpl->get ("output");
Rwrite to File
Wfile ($indexfile, $output);
Require ($indexfile);
}
?>