<? Php
/**
* Site Main Page
*
* @ Author Avenger <avenger@php.net>
* @ Version $ Id 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-m ':
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 schedule ...... ', 'HTTP: // www.phpe.net/t-shirt '));
$ Tpl-> setVar ("FILEPIC", file_pic('phpandmore.gif ', 'publication of the PHP & More account', 'HTTP: // www.phpe.net/news/34.shtml '));
$ Tpl-> setVar ("FILEPIC", file_pic('3.jpg ', 'Welcome to PHP ',''));
$ Tpl-> setVar ("FILEPIC", file_pic('show.gif ', 'show your enthusiastic activities-click to View Details', 'HTTP: // www.phpe.net/club/index.php? Act = ST & f = 2 & t = 1416 '));
$ Tpl-> setVar ("FILEPIC", file_pic('1year.gif ', 'One year older than PHP', '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 = "95%" border = "0" align = "center" cellpadding = "0" cellspacing = "0"> <tr> <td> </td> </tr> </table> ';
Ob_start ();
// Echo item_title ($ lang ['STAT'], '123 ');
Include ("index_stat.inc.php ");
$ Tpl-> setVar ("INDEXCOUNT", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
// Echo item_title ($ lang ['Vote'], '123 ');
Include ("index_vote.inc.php ");
$ Tpl-> setVar ("INDEXVOTE", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
// Echo item_title ($ lang ['link'], '123 ');
Include ("index_links.inc.php ");
$ Tpl-> setVar ("INDEXLINK", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
// Echo item_title ($ lang ['intro'], '123 ');
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"'), '123 ');
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"'), '123 ');
Include ("index_article.inc.php ");
$ Tpl-> setVar ("INDEXARTICLE", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
// Echo item_title ($ lang ['recommendtopic '], '123 ');
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"'), '123 ');
Include ("index_faq.inc.php ");
$ Tpl-> setVar ("INDEXFAQ", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
// Echo item_title ($ lang ['nav'], '20140901 ');
Include ("index_sitenav.inc.php ");
$ Tpl-> setVar ("INDEXNAV", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
// Echo item_title ($ lang ['tids'], '123 ');
Include ("index_tips.inc.php ");
$ Tpl-> setVar ("INDEXTIPS", ob_get_contents ());
Ob_end_clean ();
/*
Ob_start ();
Echo item_title ($ lang ['events'], '123 ');
$ Tpl-> setVar ("INDEXEVENTS", ob_get_contents ());
Ob_end_clean ();
*/
Ob_start ();
// Echo item_title ($ lang ['resouce '], '123 ');
Include ("index_resource.inc.php ");
$ Tpl-> setVar ("INDEXRESOURCE", ob_get_contents ());
Ob_end_clean ();
Ob_start ();
// Echo item_title ($ lang ['souwang'], '123 ');
Echo'
<Form action = "/search.html" method = "get" target = "_ blank">
Php resources on the Internet <br>
<Input style = "width: 100px" type = "text" class = "small" size = "20" 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 ['partners'], '123 '));
Ob_start ();
// Echo item_title ($ lang ['calendar '], '123 ');
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 '], '123 ');
Echo'
<Table width = "95%" 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'], '123 ');
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 =" 20 "maxlength =" 100 "title =" add to email 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 );
}
?>