查看完整版本: 个人信息栏显示星座 FOR DZ6.0

结缘猫 2007-11-17 02:16

个人信息栏显示星座 FOR DZ6.0

[color=#008000][b][size=4]演示地址: [/size][/b][/color][url=http://www.nzyule.com/][b][size=4]http://www.nzyule.com[/size][/b][/url]

[color=blue]注意: 请在修改前备份你的文件. 安装不设计到数据库改动.[/color]

建议先安装个人信息栏美化, 具体可去看:

[url=http://www.discuz.net/viewthread.php?tid=783730]http://www.discuz.net/viewthread.php?tid=783730[/url]

[color=red][b]安装方法:[/b][/color]

1. 把附件里面的图片解压到根目录下, 附件里面也附有安装方法.

2. 打开viewthread.php文件,

打开viewthread.php, 找到下面这一行
$query = $db->query("SELECT p.*,


在上面的那代码后面加上
m.bday,



然后找到
return $post;


再前面加入下面代码
/*************************************/
// 个人信息栏显示星座 By Ricky_Yahoo
/************************************/

        $post['astro'] = "<font color=#666666>未指定生日</font>";
        $post['astro_img'] = '';

        $bday_stamp = strtotime($post['bday']);

        $bmonth = date('n',$bday_stamp);

        $bday = date('j', $bday_stamp);

switch ($bmonth) {
        case 1:
                $post['astro'] = "魔竭座";$post['astro_img'] = "mojie.gif";
                if ($bday >=21) {$post['astro'] = "水瓶座";$post['astro_img'] = "shuiping.gif";}
                break;
        case 2:
                $post['astro'] = "水瓶座";$post['astro_img'] = "shuiping.gif";
                if ($bday >=20) {$post['astro'] = "双鱼座";$post['astro_img'] = "shuangyu.gif";}
                break;
        case 3:
                $post['astro'] = "双鱼座";$post['astro_img'] = "shuangyu.gif";
                if ($bday >=21) {$post['astro'] = "白羊座";$post['astro_img'] = "baiyang.gif";}
                break;
        case 4:
                $post['astro'] = "白羊座";$post['astro_img'] = "baiyang.gif";
                if ($bday >=21) {$post['astro'] = "金牛座";$post['astro_img'] = "jinniu.gif";}
                break;
        case 5:
                $post['astro'] = "金牛座";$post['astro_img'] = "jinniu.gif";
                if ($bday >=22) {$post['astro'] = "双子座";$post['astro_img'] = "shuangzi.gif";}
                break;
        case 6:
                $post['astro'] = "双子座";$post['astro_img'] = "shuangzi.gif";
                if ($bday >=22) {$post['astro'] = "巨蟹座";$post['astro_img'] = "juxie.gif";}
                break;
        case 7:
                $post['astro'] = "巨蟹座";$post['astro_img'] = "juxie.gif";
                if ($bday >=23) {$post['astro'] = "狮子座";$post['astro_img'] = "shizi.gif";}
                break;
        case 8:
                $post['astro'] = "狮子座";$post['astro_img'] = "shizi.gif";
                if ($bday >=24) {$post['astro'] = "处女座";$post['astro_img'] = "chunv.gif";}
                break;
        case 9:
                $post['astro'] = "处女座";$post['astro_img'] = "chunv.gif";
                if ($bday >=24) {$post['astro'] = "天秤座";$post['astro_img'] = "tiancheng.gif";}
                break;
        case 10:
                $post['astro'] = "天秤座";$post['astro_img'] = "tiancheng.gif";
                if ($bday >=24) {$post['astro'] = "天蝎座";$post['astro_img'] = "tianxie.gif";}
                break;
        case 11:
                $post['astro'] = "天蝎座";$post['astro_img'] = "tianxie.gif";
                if ($bday >=23) {$post['astro'] = "射手座";$post['astro_img'] = "sheshou.gif";}
                break;
        case 12:
                $post['astro'] = "射手座";$post['astro_img'] = "sheshou.gif";
                if ($bday >=22) {$post['astro'] = "魔竭座";$post['astro_img'] = "mojie.gif";}
                break;
}


/*************************************/
// 个人信息栏显示星座 END
/************************************/

3. 打开你的个人信息栏美化的那个模版文件snshow.htm,(每个人用的不一样版本,也可能是show.htm), 找到
<!--{if $post['msn'] || $post['qq'] || $post['icq'] || $post['yahoo'] || $post['taobao']}-->


在前面加入
<img src="./images/sn-post/icon_2.gif" border="0"> 星座: <font color=#FF3300>{$post['astro']}</font><!--{if $post[astro_img] != ''}-->
<div align=center><img src="images/xinzuo/{$post[astro_img]}"></div><!--{/if}-->
4. 更新缓存.

5. 大功告成.

[[i] 本帖最后由 结缘猫 于 2007-11-17 02:35 编辑 [/i]]

aaa669 2007-11-24 21:35

支持[`C;5] [`C;5]

ltcjtc 2008-1-22 09:33

[`D;2] 谢谢``````1`1`1`11111111111

ltcjtc 2008-1-22 09:33

[`C;3] 支持`1``1``1`1`
页: [1]
查看完整版本: 个人信息栏显示星座 FOR DZ6.0