|
|
2#

楼主 |
发表于 2007-9-30 14:46:09
|
只看该作者

PHP新闻信息自动更新代码实例(二)
include('Qindex/'.EIDADD.'.php');
$phpuptime=date("Y-m-d H:i:s");
$timeinfo_d=get_ms($htmluptime,$phpuptime);
if($timeinfo_d>1000 or !$htmluptime)
{
########################################################################
$jobinfohtml.="<table width=\"496\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
$jobinfohtml.=" <tr>";
$jobinfohtml.=" <td background=\"15hrimages/15hr_zpinfo_4.gif\"><img src=\"15hrimages/15hr_zpinfo_7.gif\" width=\"105\" height=\"29\"></td>";
$jobinfohtml.=" <td background=\"15hrimages/15hr_zpinfo_4.gif\"><a href=\"Search_machine.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Image70','','15hrimages/15hr_weburl_2_1.gif',1)\"><img src=\"15hrimages/15hr_zpinfo_2.gif\" name=\"Image70\" width=\"83\" height=\"29\" border=\"0\"></a></td>";
$jobinfohtml.=" <td background=\"15hrimages/15hr_zpinfo_4.gif\"><a href=\"Seek_login.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('Image71','','15hrimages/15hr_weburl_3_1.gif',1)\"><img src=\"15hrimages/15hr_zpinfo_3.gif\" name=\"Image71\" width=\"82\" height=\"29\" border=\"0\"></a></td>";
$jobinfohtml.=" <td background=\"15hrimages/15hr_zpinfo_4.gif\"><div align=\"right\"><a href=\"Info_invite.php\"><img src=\"15hrimages/15hr_zpinfo_5.gif\" width=\"144\" height=\"29\" border=\"0\"></a></div></td>";
$jobinfohtml.=" </tr>";
$jobinfohtml.=" <tr>";
$jobinfohtml.=" <td colspan=\"4\" background=\"15hrimages/15hr_zpinfo_6.gif\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">";
$Register_date=date("Y-m-d");
$strdo="select Bem_id,companyName from $job_bem where zpvip>$Register_date ".REGINFOSQL." order by adminuptime desc,Register_date desc limit 0,14";
$result=mysql_query($strdo,$myconn);
$jishu=1;
while($rownew=mysql_fetch_row($result)) {
list($Bem_id,$companyName)=$rownew;
if ($jishu==1 || $jishu % 2 == 1) {
$jobinfohtml.=" <tr>";
$jobinfohtml.=" <td width=\"50%\" height=\"22\">?<a href=\"Info_invite_show.php?id="."$Bem_id"."\" target=\"_blank\" class=\"web\"><font color=\"#000000\">".cnsubstr($companyName,34)."</font></a></td>";
}else{
$jobinfohtml.=" <td width=\"50%\" height=\"22\">?<a href=\"Info_invite_show.php?id="." $Bem_id"."\" target=\"_blank\" class=\"web\"><font color=\"#000000\">".cnsubstr($companyName,34)."</font></a></td>";
}
if ($jishu % 2==0) $jobinfohtml.="</tr>";
$jishu++;
}
$jobinfohtml.=" </table></td>";
$jobinfohtml.=" </tr>";
$jobinfohtml.=" <tr>";
$jobinfohtml.=" <td colspan=\"4\" bgcolor=\"#CCCCCC\"><img name=\"\" src=\"images/kb.gif\" width=\"1\" height=\"1\" alt=\"\" style=\"background-color: #CCCCCC\"></td>";
$jobinfohtml.=" </tr>";
$jobinfohtml.=" </table>";
$jobinfohtml.=" <table width=\"100\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
$jobinfohtml.=" <tr>";
$jobinfohtml.=" <td> </td>";
$jobinfohtml.=" </tr>";
$jobinfohtml.=" </table>";
$jobinfohtml.=" <table width=\"496\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
$jobinfohtml.=" <tr>";
$jobinfohtml.=" <td background=\"15hrimages/15hr_zpinfo_4.gif\"><img src=\"15hrimages/15hr_zpinfo_1.gif\" width=\"105\" height=\"29\"></td>";
$jobinfohtml.=" <td background=\"15hrimages/15hr_zpinfo_4.gif\"><a href=\"Search_machine.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('999','','15hrimages/15hr_weburl_2_1.gif',1)\"><img src=\"15hrimages/15hr_zpinfo_2.gif\" name=\"Image70\" width=\"83\" height=\"29\" border=\"0\"></a></td>";
$jobinfohtml.=" <td background=\"15hrimages/15hr_zpinfo_4.gif\"><a href=\"Seek_login.php\" onMouseOut=\"MM_swapImgRestore()\" onMouseOver=\"MM_swapImage('999','','15hrimages/15hr_weburl_3_1.gif',1)\"><img src=\"15hrimages/15hr_zpinfo_3.gif\" name=\"Image71\" width=\"82\" height=\"29\" border=\"0\"></a></td>";
$jobinfohtml.=" <td background=\"15hrimages/15hr_zpinfo_4.gif\"><div align=\"right\"><a href=\"Info_invite.php\"><img src=\"15hrimages/15hr_zpinfo_5.gif\" width=\"144\" height=\"29\" border=\"0\"></a></div></td>";
$jobinfohtml.=" </tr>";
$jobinfohtml.=" <tr>";
$jobinfohtml.=" <td colspan=\"4\" background=\"15hrimages/15hr_zpinfo_6.gif\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">";
$Register_date=date("Y-m-d");
$strdo="select t1.Bem_id,t1.companyName from $job_bem t1,$pass_time t2 where t1.Bem_id=t2.user_id ".REGINFOSQL." order by t2.Register_date desc limit 0,$new_d";
$result=mysql_query($strdo,$myconn);
$jishu=1;
while($rownew=mysql_fetch_row($result)) {
list($Bem_id,$companyName)=$rownew;
if ($jishu==1 || $jishu % 2 == 1) {
$jobinfohtml.=" <tr>";
$jobinfohtml.=" <td width=\"50%\" height=\"22\">?<a href=\"Info_invite_show.php?id="."$Bem_id"."\" target=\"_blank\" class=\"web\"><font color=\"#000000\">".cnsubstr($companyName,34)."</font></a></td>";
}else{
$jobinfohtml.=" <td width=\"50%\" height=\"22\">?<a href=\"Info_invite_show.php?id="."$Bem_id"."\" target=\"_blank\" class=\"web\"><font color=\"#000000\">".cnsubstr($companyName,34)."</font></a></td>";
}
if ($jishu % 2==0) $jobinfohtml.="</tr>";
$jishu++;
}
$jobinfohtml.=" </table></td>";
$jobinfohtml.=" </tr>";
$jobinfohtml.=" <tr>";
$jobinfohtml.=" <td colspan=\"4\" bgcolor=\"#CCCCCC\"><img name=\"\" src=\"images/kb.gif\" width=\"1\" height=\"1\" alt=\"\" style=\"background-color: #CCCCCC\"></td>";
$jobinfohtml.=" </tr>";
$jobinfohtml.=" </table>";
#################################################################
$jobinfohtml.="<? \$htmluptime=\"$phpuptime\";?>";//将更新时间以php变量写入文件
$file=fopen('Qindex/'.EIDADD.'.php','w'); //打开文件
fwrite($file,$jobinfohtml); //写入信息
fclose($file); //关闭文件
if(!$htmluptime) echo"<meta http-equiv=\"refresh\" content=\"1\" /> 正在加载数据...";
} |
|