2004-10-16 19:29
1.修改 index.php 文件。
查找
在其..上...面增加以下内容
2.修改index模板
查找
增加
查找
代码:
include template('index');
在其..上...面增加以下内容
代码:
$month_names =array("","01","02","03","04","05","06","07","08","09","10","11","12");
$now = time() + ($timeoffset * 3600);
$today = $month_names[gmdate("n",$now)]."-".gmdate("d",$now);
$query = $db->query("SELECT username FROM $table_members WHERE bday LIKE'%$today'");
if($db->num_rows($query) != 0) {
while($happy = mysql_fetch_array($query)) {
$memlink = "<a href='viewpro.php?username=$happy[username]'>$happy[username]</a>";
if ($happybday == "")
{
$happybday = "$memlink";
}else{
$happybday .= "$comma$memlink";
}
$comma = ", ";
}
}elseif ($happy == "") {
$happybday = "";
}
2.修改index模板
查找
代码:
<!--{else}-->
{lang online_only_guests}
<!--{/if}-->
<!--{/if}-->
</td></tr></table></td></tr>
<!--{/if}-->
增加
代码:
<!-- {if $happybday} -->
<!-- happy birthday HACK -->
<tr><td colspan="6" class="header">
<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center">
<tr class="smalltxt" style="color: {HEADERTEXT}"><td><img src="{IMGDIR}/indexicon.gif" align="absmiddle"> <span class="bold">Happy Birthday to:</span>
</td></tr></table></tr>
<tr>
<td bgcolor="{ALTBG2}" colspan="6" onMouseOver ="this.style.backgroundColor='{ALTBG1}'" onMouseOut ="this.style.backgroundColor='{ALTBG2}'">
<table cellspacing="0" cellpadding="0" border="0" width="98%" align="center" class="smalltxt">
<tr>
<td colspan="6" valign="middle">
<img src="{IMGDIR}/happybirthday.gif" align=left width=32 height=32> $happybday
</td>
</tr></table></td></tr>
<!-- happybirthday HACK -->
<!-- {/if} -->