Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[04.14][HACK]会员生日 For Discuz 2.5&2.5SP1

[复制链接]
freddy 发表于 2005-4-14 10:12:39 | 显示全部楼层 |阅读模式
Demo:http://www.51happy365.com/bbs
Modify: index.php

Find


  1.         if($discuz_user && $newpm) {
  2.                 require $discuz_root.'./include/pmprompt.php';
  3.         }
复制代码


Add below


  1. //开始
  2. $birthday_today = getdate();
  3. $birthday_month = $birthday_today['mon'];
  4. $birthday_day = $birthday_today['mday'];
  5. $birthday_year = $birthday_today['year'];
  6. $birthday_to_show = 50; //改变这里,可以设置首页显示多少个生日会员名字。
  7. $query = $db->query("SELECT username,bday,$birthday_year-YEAR(bday) as age FROM $table_members where MONTH(bday)='$birthday_month' and DAYOFMONTH(bday)='$birthday_day' ORDER BY bday DESC LIMIT 0,".$birthday_to_show);
  8. $birthday_list = '';
  9. $comma = '';
  10. $birthday_num =0;
  11. while ($temp = $db->fetch_array($query)) {
  12.     if($birthday_num < $birthday_to_show) {
  13.         $birthday_list .= "$comma <a href="viewpro.php?&username=".rawurlencode($temp['username'])."" alt='生日:".$temp['bday']."\r\n虚度:".$temp['age']."年光阴'>".$temp['username']."</a>";
  14.         $comma = ", ";
  15.     }
  16.     $birthday_num ++;
  17. }
  18. if($birthday_num > $birthday_to_show) $birthday_list .= '&nbsp;...';
  19. unset($temp,$birthday_today);
  20. //完毕
复制代码


Modify: index.htm

Find


  1. <!--{if empty($gid) && $whosonlinestatus}-->
复制代码


Add above


  1. <!--{if empty($gid)}-->
  2.         <tr><td colspan="6" class="header">
  3.         <table cellspacing="0" cellpadding="0" border="0" width="100%" align="center">
  4.         <tr class="smalltxt" style="color: {HEADERTEXT}"><td><img src="{IMGDIR}/indexicon.gif" align="absmiddle"> <span class="bold">每日庆典</span> -
  5.                 &nbsp;今天将有 <span class="bold">$birthday_num</span> 人收到
  6. 来自社区的生日祝福</td>
  7.         </tr></table></tr><tr>
  8.         <td bgcolor="{ALTBG1}" width="5%" align="center"><img src="{IMGDIR}/online.gif"></td>
  9.         <td bgcolor="{ALTBG2}" colspan="5" onMouseOver ="this.style.backgroundColor='{ALTBG1}'" onMouseOut ="this.style.backgroundColor='{ALTBG2}'">
  10.         <table cellspacing="0" cellpadding="0" border="0" width="98%" align="center" class="smalltxt">
  11.         <tr><td valign="middle">
  12.         <!--{if $birthday_num>'0' }-->
  13.                 $birthday_list
  14.         <!--{else}-->
  15.                 如果今天的到访给你带来好心情,那么别忘了明天还来啊!        <!--{/if}-->
  16.         </td></tr></table>
  17. <!--{/if}-->
复制代码


OK!!!

All the best!

[ 本帖最后由 freddy 于 2005-7-7 15:46 编辑 ]
sorrow 发表于 2005-4-15 17:12:32 | 显示全部楼层
不错不错
回复

使用道具 举报

lokpui 发表于 2005-4-15 18:27:23 | 显示全部楼层
don't ok
回复

使用道具 举报

61551.com 发表于 2005-4-15 19:52:17 | 显示全部楼层
再顶一下
回复

使用道具 举报

neet 发表于 2005-4-15 21:24:30 | 显示全部楼层
不错,收藏
回复

使用道具 举报

 楼主| freddy 发表于 2005-4-15 22:54:02 | 显示全部楼层
多谢支持啊!
回复

使用道具 举报

lantxl 发表于 2005-4-20 10:59:15 | 显示全部楼层
我的index。php文件里找不到“<!--{if empty($gid) && $whosonlinestatus}-->”怎么办?
回复

使用道具 举报

 楼主| freddy 发表于 2005-4-20 11:06:59 | 显示全部楼层
楼上的,你厉害!
你再看看!!!


Modify: index.htm

Find


  CODE: [Copy to clipboard]   
<!--{if empty($gid) && $whosonlinestatus}-->
回复

使用道具 举报

逍遥大仙 发表于 2005-4-20 12:31:38 | 显示全部楼层
支持~
回复

使用道具 举报

 楼主| freddy 发表于 2005-4-20 12:51:19 | 显示全部楼层
Originally posted by 逍遥大仙 at 2005-4-20 12:31
支持~


thx
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-19 11:07 , Processed in 0.121508 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表