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

 找回密码
 立即注册
搜索

[经验] 細節修改+調用

[复制链接]
edo.ki 发表于 2008-6-12 15:07:24 | 显示全部楼层 |阅读模式
算是仿wowo後的一點完善
1.好友列表加入:解除好友關係
顯示位置1
  1. <span id="friend_group_$value[uid]"><a href="cp.php?ac=friend&op=changegroup&uid=$value[uid]" id="a_group_$key" onclick="ajaxmenu(event, this.id, 99999)">$value[group]</a></span>
复制代码
後++
  1. &nbsp;&nbsp;[<a href="cp.php?ac=friend&op=ignore&uid=$value[uid]" id="a_ignore" onclick="ajaxmenu(event,
  2. this.id, 99999)">解除好友關係</a>]
复制代码
顯示位置2
  1. <li><a href="space.php?uid=$value[uid]&do=friend">查看好友列表</a></li>
复制代码
  1. 後++
  2. <li><a href="cp.php?ac=friend&op=ignore&uid=$value[uid]" id="a_ignore" onclick="ajaxmenu(event, this.id, 99999)">解除好友關係</a></li>
复制代码
no1.gif
回复

使用道具 举报

 楼主| edo.ki 发表于 2008-6-12 15:08:17 | 显示全部楼层
好朋友的朋友調用+單身男性和女性調用
沒caches和優化,不是太好ha...提供後台調用

space_feed.php
  1. include_once template("space_feed");
复制代码
前+++

  1.                 $maxnum = 5;
  2.         //myfd and fd
  3.         $nouids = $space['frienduid']?($space['frienduid'].','.$space['uid']):$space['uid'];
  4.         $friendlist = array();
  5.         if($space['frienduid']) {
  6.                 $query = $_SGLOBAL['db']->query("SELECT DISTINCT fuid AS uid, fusername AS username

  7. FROM ".tname('friend')."
  8.                         WHERE uid IN (".$space['frienduid'].") AND fuid NOT IN ($nouids) LIMIT

  9. 0,$maxnum");
  10.                 while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  11.                         $friendlist[] = $value;
  12.                 }
  13.         }
  14.        
  15.        
  16.         //singleboys
  17.         $sexlistb = array();
  18.         $warr = array();
  19.         if(empty($space['marry']) || $space['marry'] < 2) {
  20.                 $warr[] = "sf.marry='1'";
  21.         }
  22.         $warr[] = "sf.sex='1'";
  23.         if($warr) {
  24.                 $query = $_SGLOBAL['db']->query("SELECT s.uid,s.username FROM ".tname('spacefield')." sf
  25.                         LEFT JOIN ".tname('space')." s ON s.uid=sf.uid
  26.                         WHERE ".implode(' AND ', $warr)." AND sf.uid NOT IN ($nouids)
  27.                         LIMIT 0,$maxnum");
  28.                 while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  29.                         $sexlistb[] = $value;
  30.                 }
  31.         }
  32.        
  33.         //singlegirls
  34.         $sexlistg = array();
  35.         $warr = array();
  36.         if(empty($space['marry']) || $space['marry'] < 2) {
  37.                 $warr[] = "sf.marry='1'";
  38.         }
  39.         $warr[] = "sf.sex='2'";
  40.         if($warr) {
  41.                 $query = $_SGLOBAL['db']->query("SELECT s.uid,s.username FROM ".tname('spacefield')." sf
  42.                         LEFT JOIN ".tname('space')." s ON s.uid=sf.uid
  43.                         WHERE ".implode(' AND ', $warr)." AND sf.uid NOT IN ($nouids)
  44.                         LIMIT 0,$maxnum");
  45.                 while ($value = $_SGLOBAL['db']->fetch_array($query)) {
  46.                         $sexlistg[] = $value;
  47.                 }
  48.         }
复制代码
space_feed.htm
頂上++

  1. <script language="javascript">
  2. function view(a) {
  3. document.getElementById('top1').style.display='none';
  4. document.getElementById('top2').style.display='none';


  5. document.getElementById('top'+a).style.display='block';

  6. document.getElementById('tab1').className='';
  7. document.getElementById('tab2').className='';


  8. document.getElementById('tab'+a).className='current';
  9. }
  10. </script>
复制代码
================
再找

  1. <div class="side_right">
  2.        
  3. <div class="wide">
复制代码
後+++

  1.                            <!-- note for find fds begin. -->
  2.                 <div id="welcomeblock" class="welcome">
  3.                         <div class="welcometitle">
  4.                                 <h3>歡迎來到窩窩</h3>
  5.                                 <p>看看有沒有您認識的窩友?</p>
  6.                                 <div class="welcomebgarrow"></div>

  7.                         </div>                               
  8.                         <!--{if $friendlist}-->
  9. <table cellspacing="0" cellpadding="0" class="formtable">
  10. <tr><td style="font-weight:bold;">您的好友的好友:</td></tr>
  11. </table>
  12.                         <ul class="avatar_list">
  13.                                 <!--{loop $friendlist $key $value}-->
  14.                                         <li>
  15.                                                 <div class="avatarshadow left">
  16.                                                         <a href="space.php?uid=$value[uid]"

  17. title="$value[username]" target="_blank">
  18.                                                                 <img src="<!--{avatar($value

  19. [uid],small)}-->" alt="$value[username]" class="avatar" />
  20.                                                         </a>
  21.                                                 </div>
  22.                                                 <h4><a href="space.php?uid=$value[uid]" title="$value

  23. [username]" target="_blank">$value[username]</a></h4>
  24.                                                 <br><p> <a href="cp.php?

  25. ac=friend&op=add&uid=$value[uid]" id="a_friend_$value[uid]" onclick="ajaxmenu(event, this.id, 99999, '', -1)">加

  26. 為好友</a></p>
  27.                                         </li>
  28.                                                                         <!--{/loop}-->
  29.                         </ul>
  30.                 <!--{/if}-->
  31.                
  32.                                         <p style="text-align:right"><a href="#" onclick="toggle

  33. ('welcomeblock');">關閉</a></p>
  34.    </div>
  35.                                            <ul class="tabs">
  36.                 <li id="tab1" class="current" ><div onMouseOver="javascript:view(1);">
  37.                 <img border="0" src="../template/default/image/boys.jpg" width="14" height="13"></div></li>
  38.                 <li id="tab2" class="" ><div onMouseOver="javascript:view(2);">
  39.                 <img border="0" src="../template/default/image/girls.jpg" width="14" height="13"></div></li>

  40.                                   </ul>
  41.                                   <div id="top1" style="display:block;">
  42.                                                   <!--{if $sexlistb}-->
  43. <table cellspacing="0" cellpadding="0" class="formtable">
  44.                 <tr><td style="font-weight:bold;">
  45.                 <!--{if empty($space['marry']) || $space['marry'] < 2}-->單身<!--{/if}-->
  46. <font color="#0066FF">男</font>性 好友推薦:
  47.                 </td></tr>
  48. </table>
  49.                                 <ul class="avatar_list">
  50.                                 <!--{loop $sexlistb $key $value}-->
  51.                                         <li>
  52.                                                 <div class="avatarshadow left">
  53.                                                         <a href="space.php?uid=$value[uid]"

  54. title="$value[username]" target="_blank">
  55.                                                                 <img src="<!--{avatar($value

  56. [uid],small)}-->" alt="$value[username]" class="avatar" />
  57.                                                         </a>
  58.                                                 </div>
  59.                                                 <h4><a href="space.php?uid=$value[uid]" title="$value

  60. [username]" target="_blank">$value[username]</a></h4>
  61.                                                 <br><p> <a href="cp.php?

  62. ac=friend&op=add&uid=$value[uid]" id="a_friend_$value[uid]" onclick="ajaxmenu(event, this.id, 99999, '', -1)">加

  63. 為好友</a></p>
  64.                                         </li>
  65.                                 <!--{/loop}-->
  66.                                 </ul>
  67.                 <!--{/if}-->
  68. </div>
  69. <div id="top2" style="display:none;">
  70.                 <!--{if $sexlistg}-->
  71. <table cellspacing="0" cellpadding="0" class="formtable">
  72.                 <tr><td style="font-weight:bold;">
  73.                 <!--{if empty($space['marry']) || $space['marry'] < 2}-->單身<!--{/if}-->
  74. <font color="#FF0000">女</font>性 好友推薦:
  75.                 </td></tr>
  76. </table>
  77.                                 <ul class="avatar_list">
  78.                                 <!--{loop $sexlistg $key $value}-->
  79.                                         <li>
  80.                                                 <div class="avatarshadow left">
  81.                                                         <a href="space.php?uid=$value[uid]"

  82. title="$value[username]" target="_blank">
  83.                                                                 <img src="<!--{avatar($value

  84. [uid],small)}-->" alt="$value[username]" class="avatar" />
  85.                                                         </a>
  86.                                                 </div>
  87.                                                 <h4><a href="space.php?uid=$value[uid]" title="$value

  88. [username]" target="_blank">$value[username]</a></h4>
  89.                                                 <br><p> <a href="cp.php?

  90. ac=friend&op=add&uid=$value[uid]" id="a_friend_$value[uid]" onclick="ajaxmenu(event, this.id, 99999, '', -1)">加

  91. 為好友</a></p>
  92.                                         </li>
  93.                                 <!--{/loop}-->
  94.                                 </ul>
  95.                 <!--{/if}-->
  96. </div>
  97. <!-- note for find fds end. -->
复制代码
=================================

default/common.css
加上安裝過仿wowo的不用加: https://discuz.dismall.com/thread-956859-1-2.html)

  1. .welcome{ overflow:hidden; margin-bottom:15px; padding:9px; border-bottom:1px solid #DDD;

  2. background:#F5F5F5; }
  3.         .welcometitle{ position:relative; margin-bottom:25px; padding:9px; border-bottom:1px solid #EBAE7F;

  4. background:#FEFFCF; }
  5.                 .welcometitle h3{ color:#FFA200; }
  6.                 .welcomebgarrow{ position:absolute; top:51px; left:50px; width:13px; height:14px;

  7. background:url('image/bg_welcome_arrow.gif') no-repeat; }
  8.         .avatarshadow{ margin-right:5px; width:53px; height:53px; background:url('image/bg_avatar.gif') no-

  9. repeat;; padding-left:4px; padding-right:0; padding-top:5px; padding-bottom:0 }
  10.                 .avatarshadow a:hover{ text-decoration:none; }
复制代码
附件圖片:

顯示:
no4.gif

no2.gif

no3.gif

no5.gif

[ 本帖最后由 edo.ki 于 2008-6-12 19:12 编辑 ]
bg_avatar.gif
bg_welcome_arrow.gif
boys.jpg
girls.jpg
回复

使用道具 举报

 楼主| edo.ki 发表于 2008-6-12 15:14:03 | 显示全部楼层

其他相關調用

留位位

[ 本帖最后由 edo.ki 于 2008-6-12 15:15 编辑 ]
回复

使用道具 举报

luring 发表于 2008-6-12 15:19:28 | 显示全部楼层
回复

使用道具 举报

litaowan 发表于 2008-6-12 15:19:42 | 显示全部楼层
抢位啊 哈哈哈哈
回复

使用道具 举报

alou520 发表于 2008-6-12 17:08:33 | 显示全部楼层
占住位置先
回复

使用道具 举报

m1010c5a1 发表于 2008-6-12 19:16:10 | 显示全部楼层
看贴要回
回复

使用道具 举报

superwyh 发表于 2008-6-12 19:26:21 | 显示全部楼层
好东西……
回复

使用道具 举报

hb163 发表于 2008-6-12 20:23:58 | 显示全部楼层
强帖要留名。
回复

使用道具 举报

island520 发表于 2008-6-13 13:58:27 | 显示全部楼层
额,我的会员头像不显示怎么搞?
图片路径为http://daxue.yn.cn/home/{avatar(Array[uid],small)}
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-9-11 01:05 , Processed in 0.136871 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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