看到大家喜欢:我现在提供大家方法:
俺不提供修改后的文件,如果喜欢这效果,请自行修改。
修改有风险,备份最关键!如有不侧,请自行承担后果。
------------------------------------------------------------------------
----------- 步骤一 ---------------------修改数据库-------------
------------------------------------------------------------------------
表`***_spacefield`中添加字段:nongli,类型 tinyint(1) <<<===不修改这一条,千万别去修改其它的。
------------------------------------------------------------------------
----------- 步骤二 -------------------生日修改------------------
------------------------------------------------------------------------
index.php 120行(加下面代码2)
source/network_index.php 192 (加下面代码2)
source/space_index.php 93行(加下面代码1)
source/space_feed.php 167 (加下面代码1)
source/space_friend.php 150行,(见代码3
source/cp_profile.php 25行,在提交检查中,加入 'nongli' => intval($_POST['nongli']),
///////////////////////////////////////
//代码1
//载入生日列表1
include_once(S_ROOT.'./shengri/czf_get_shengri.php');
czf_shengri();
//代码2
//载入生日列表2
include_once(S_ROOT.'./shengri/czf_get_shengri.php');
czf_shengri(28,1,1);
///////////////////////////////////////
//代码3
在150行,查找:if($space['friendnum']) {中的while前后各加一行。如下:
//载入生日列表
include_once(S_ROOT.'./shengri/czf_shengri.php');
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$value["shengri"]=isset($czf_sr[$value['uid']])?$czf_sr[$value['uid']]["days"]:"";
------------------------------------------------------------------------
----------- 步骤三 -------------------模板修改------------------
------------------------------------------------------------------------
/template/default/index.htm 77行
<!--{template czf_shengri}-->
<div class="m_box">
<div class="left_box">
<!--{if $_SCONFIG['my_status']}-->
<h3 class="title">好玩的应用</h3>
/template/default/network_index.htm 78行
<!--{template czf_shengri}-->
<div class="searchfirend">
<div class="ye_r_t"><div class="ye_l_t"><div class="ye_r_b"><div class="ye_l_b">
<h3>寻找好友</h3>
/template/default/space_index.htm 218行 250行
<li>生日:$space[birthday]<!--{if $space[xing12]}--> {$space[xing12]}<!--{/if}--></li>
----------------------
<!--{template czf_shengri}-->
<!--{if $feedlist}-->
<div id="space_feed" class="feed">
<h3 class="feed_header">
<span class="r_option">
<a href="space.php?uid=$space[uid]&do=feed&view=me" class="action">全部</a>
</span>
<span class="entry-title">个人动态</span>
/template/default/space_feed.htm 50行
<!--{template czf_shengri}-->
<div class="tabs_header" style="padding-top:10px;">
<!--{if $_SCONFIG['my_status']}-->
<div class="r_option">
<a href="space.php?do=home&view=we"$actives[we]>好友</a><span class="pipe">|</span>
/template/default/space_friend.htm 78行
<div class="avatar48"><a href="space.php?uid=$value[uid]"><img src="<!--{avatar($value[uid],small)}-->" alt="{$_SN[$value[uid]]}" width="48" height="48" /></a></div>
<!--{if $value[shengri]!=""}-->
<img src="image/shengri.gif"/>
<a href="space.php?uid=$value[uid]&do=wall&view=me">
<!--{if $value[shengri]==0}--><font color=blue>今天生日,现在去祝福他!</font>
<!--{else}--><font color=blue>{$value[shengri]}天后生日,提前祝福他!</font>
<!--{/if}-->
</a>
<!--{/if}-->
/template/default/cp_profile.htm 90行
<th>生日</th>
<td>
<select id="marry" name="nongli">
<option value="1" style="background:#00f;color:#fff">农历生日</option>
<option value="2" style="background:#f00;color:#fff"<!--{if $space['nongli']==2}--> selected<!--{/if}-->>农历生日-闰月</option>
<option value="0" style="background:#00f;color:#fff"<!--{if $space['nongli']==0}--> selected<!--{/if}-->>阳历生日</option>
</select>
<select id="birthyear" name="birthyear">
<option value="0">无</option>
$birthyeayhtml
</select> 年
<select id="birthmonth" name="birthmonth">
<option value="0">无</option>
$birthmonthhtml
</select> 月
<select id="birthday" name="birthday">
<option value="0">无</option>
$birthdayhtml
</select> 日
<p>正确填写生日,以便好友及时祝福您生日快乐!</p>
</td>
新加模板文件:/template/default/czf_shengri.htm
<!--{if $czf_sr}-->
<!--{if $czf_sr[0][mb]==0}-->
<div class="feed">
<h3 class="feed_header"><a class="r_option" href="space.php?do=friend">查看更多..</a>好友生日榜</h3>
<ul class="avatar_list">
<!--{loop $czf_sr $value}-->
<li>
<div class="avatar48"><a href="space.php?uid=$value[uid]&do=wall&view=me" title="现在就去祝{$value[username]}生日"><img src="<!--{avatar($value[uid],small)}-->" /></a></div>
<p><a href="space.php?uid=$value[uid]">{$value[username]}</a></p>
<p class="gray">
<!--{if $value[days]==0}--><font color=red>今天</font>
<!--{elseif $value[days]==1}--><font color=red>明天</font>
<!--{elseif $value[days]==2}--><font color=red>后天</font>
<!--{else}-->{$value[days]}天后
<!--{/if}--><img src="image/shengri.gif"/>
</p>
</li>
<!--{/loop}-->
</ul>
</div>
<!--{elseif $czf_sr[0][mb]==1}-->
<div class="userbox">
<h3 class="feed_header">
<a class="r_option" href="space.php?do=friend">查看过生日的好友</a>
{$czf_yang} {$czf_yin}
</h3>
<ul class="avatar_list">
<!--{loop $czf_sr $key $value}-->
<li>
<div class="avatar48"><a href="space.php?uid=$value[uid]&do=wall&view=me" title="现在就去祝{$value[username]}生日"><img src="<!--{avatar($value[uid],small)}-->" /></a></div>
<p><a href="space.php?uid=$value[uid]">{$value[username]}</a></p>
<p class="gray">
<!--{if $value[days]==0}--><font color=red>今天</font>
<!--{elseif $value[days]==1}--><font color=red>明天</font>
<!--{elseif $value[days]==2}--><font color=red>后天</font>
<!--{else}-->{$value[days]}天后
<!--{/if}--><img src="image/shengri.gif"/>
</p>
</li>
<!--{/loop}-->
</ul>
</div>
<!--{/if}-->
<!--{/if}-->
本压缩包(shengri)文件夹,放在根目录下。 |