免費論壇 繁體 | 簡體
Sclub交友聊天~加入聊天室當版主
分享

楼中楼【点评】特效

本文来自:★flash之路-flash技术交流★ 转帖请注明出处! 作者:flashroad 您是第3258个浏览者

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
flashroad友情提示:
“点评”不是“回帖”!
【版权声明】爱秀社区 已废
其新站名为 爱秀代码
http://icode.258club.com/thread-42-1-1.html
站长将本特效放入了上贴。
本帖分享的代码是原爱秀社区分享的,因为点评发出去后,对话框不自动关闭,所以在上贴的基础上又重新修改了postinner模板【在本帖的4楼】。



所需的素材:
1


2



3



4



5



6
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
附件: 您需要登录才可以下载或查看附件。没有帐号?注册

获得 小恶魔卡 一张

卡片说明:flashroad被风吹乱了秀发,花费了5金币请理发师整理了一个酷炫发型

卡片效果:-5

友情提示:单击下列任意一个表情,即可瞬间自动回复本帖!

好贴......
郁闷......
开心......
擦汗......
鄙视......
狂怒
谢谢
爱你呦
拜托了
嗯嗯
OMG
求关注
伤心......
无奈.....
无奈.....
无奈.....
无奈.....
无奈.....
哈哈哈
NO
OK
what
我来了

最近访问本帖者列表:

flashroad
访问时间:2020-11-01 12:28
阿么
访问时间:2019-05-03 04:17
中文名字
访问时间:2018-10-24 16:43
麻城生活网
访问时间:2018-09-13 12:11
无界
访问时间:2018-08-28 16:48
天使小小
访问时间:2018-08-18 16:48

打赏

取消

感谢您的支持,我会继续努力的!

扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

Powered by 爱秀代码,分享从这里开始,精彩与您同在

点评
B Color Smilies

您还可以输入:个字符
X

X

1、升级数据库[后台-工具-数据库-升级]

  1. CREATE TABLE  `zy_postinner` (
  2. `uid` INT( 8 ) NOT NULL ,
  3. `name` CHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
  4. `pid` INT( 15 ) NOT NULL ,
  5. `ptid` INT( 15 ) NOT NULL ,
  6. `msg` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
  7. `time` INT( 10 ) NOT NULL
  8. ) ENGINE = MYISAM ;
  9. ALTER TABLE  `cdb_posts` ADD  `zy_postinner` INT( 5 ) NOT NULL ;
复制
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

2、新建aa_zyhome_postinner模版

  1. {eval $zyhome=$_GET['zyhome'];}
  2. <!--{if ($zyhome=="postinner")}-->
  3.         {eval $zyshowpd=0;}
  4.         {eval require_once './include/discuzcode.func.php';}
  5.         {eval $zyact=$_GET['zyact'];}
  6. <!--{if ($zyact=="delete")}-->
  7.         <!--{if ($_GET[ptid] && $_GET[pid])}-->
  8.         {eval $q2 = $db->query("SELECT p.zy_postinner,p.authorid,t.subject,p.tid,p.fid FROM cdb_posts p LEFT JOIN cdb_threads t ON t.tid=p.tid WHERE p.pid = " . $_GET[pid]);}
  9.         {eval $asdfgh = $db->fetch_array($q2);}
  10.         {eval $q2=$db->fetch_array($db->query("SELECT * FROM zy_postinner WHERE pid=".$_GET[pid]." and ptid=".$_GET[ptid]));}
  11.         <!--{if ($q2[uid] ==$discuz_uid || $discuz_uid == 1)}-->
  12. <!--{if ($asdfgh[zy_postinner] > 0 )}-->
  13.         {eval $q2=$db->query("UPDATE cdb_posts SET zy_postinner = " . ($asdfgh[zy_postinner]-1) . " WHERE pid = " . $_GET[pid]);}
  14. <!--{/if}-->
  15.         {eval $q2=$db->query("DELETE FROM zy_postinner WHERE pid=".$_GET[pid]." and ptid=".$_GET[ptid]);}   
  16.           <!--{/if}-->
  17.                 {eval $zyact="get";}
  18.         <!--{/if}-->
  19.         <!--{/if}-->
  20.         <!--{if ($zyact=="post")}-->
  21.                 {eval $msg=$_POST["msg"];}
  22.                 {eval $msgt = str_replace(Chr(10), "", $msg);}
  23.                 {eval $msgt = str_replace(" ", "", $msgt);}
  24.                 <!--{if ($msgt=="")}-->
  25.                         不能只含有空格或回车
  26.                 <div class="zypi_postbox_btn"><a href="javascript:void 0" onclick="zypi_togglebox(this)" id="gtrf_$pid" style="display:none;">我也说一句</a></div>
  27.                         {eval die;}
  28.                 <!--{/if}-->
  29.                 {eval $msg=str_replace(Chr(10), " ", $msg);}
  30.                 <!--{if ($discuz_uid==0)}-->
  31.                         你还没登录
  32.                         {eval die;}
  33.                 <!--{/if}-->
  34.                 {eval $pid=$_POST["pid"];}
  35.                 {eval $toptid=$_POST["ptid"];}
  36.                 {eval $q2 = $db->query("SELECT ptid FROM zy_postinner ORDER BY ptid DESC LIMIT 1");}
  37.                 {eval $ptid = $db->fetch_array($q2);}

  38.                 {eval $q2 = $db->query("SELECT p.zy_postinner,p.authorid,t.subject,p.tid,p.fid FROM cdb_posts p LEFT JOIN cdb_threads t ON t.tid=p.tid WHERE p.pid = " . $pid);}
  39.                 {eval $asdfgh = $db->fetch_array($q2);}

  40.                 <!--{if $toptid>0}-->
  41.                         {eval $q2=$db->query("SELECT uid,name FROM zy_postinner WHERE ptid = " . $toptid);}
  42.                         {eval $c=$db->fetch_array($q2);}
  43.                         <!--{if $c[uid]>0}-->
  44.                                 {eval $q2=$db->query("SELECT id FROM cdb_promptmsgs ORDER BY id DESC LIMIT 1");}
  45.                                 {eval $a=$db->fetch_array($q2);}
  46.                                 {eval $q2=$db->query("INSERT INTO cdb_promptmsgs VALUES(" . ($a[id]+1) . ",6," . $c[uid] . ",0,1," . $GLOBALS[timestamp] . ",'<div class=\"f_thread\"><a href=\"space.php?uid=" . $discuz_uid . "\">" . $discuz_userss . "</a>回复了你在帖子<a href=\"redirect.php?goto=findpost&ptid=" . $asdfgh[tid] . "&pid=" . $pid . "\">" . $asdfgh[subject] . "</a>中的回复的回复</div>',0)");}
  47.                                 {eval $q2=$db->query("SELECT number FROM cdb_prompt WHERE uid = " . $c[uid] . " AND typeid = 6");}
  48.                                 {eval $a=$db->fetch_array($q2);}
  49.                                 <!--{if $a[number]>0}-->
  50.                                         {eval $q2=$db->query("UPDATE cdb_prompt SET number=" . ($a[number]+1) . " WHERE uid = " . $c[uid] . " AND typeid = 6");}
  51.                                 <!--{else}-->
  52.                                         {eval $q2=$db->query("INSERT INTO cdb_prompt VALUES(" . $c[uid] . ",6,1)");}
  53.                                 <!--{/if}-->
  54.                                 {eval $msg="回复 " . $c[name] . " :" . $msg;}
  55.                         <!--{/if}-->
  56.                 <!--{/if}-->
  57.                 {eval $q2 = $db->query("INSERT INTO zy_postinner VALUES('$discuz_uid','$discuz_userss','$pid','" . ($ptid[ptid]+1) . "','$msg'," . $GLOBALS[timestamp] . ")");}
  58.                 {eval $q2=$db->query("UPDATE cdb_posts SET zy_postinner = " . ($asdfgh[zy_postinner]+1) . " WHERE pid = " . $pid);}
  59.                 {eval $q2=$db->query("UPDATE cdb_threads SET lastpost = " . $GLOBALS[timestamp] . " , lastposter = '" . $discuz_userss . "' WHERE tid = " . $asdfgh[tid]);}
  60.                 {eval $q2=$db->query("SELECT todayposts FROM cdb_forums WHERE fid=" . $asdfgh[fid]);}
  61.                 {eval $b=$db->fetch_array($q2);}
  62.                 {eval $q2=$db->query("UPDATE cdb_forums SET todayposts = " . $b[todayposts] . ",lastpost='" . $asdfgh[tid] . "\t" . $asdfgh[subject] . "\t" . $GLOBALS[timestamp] . "\t" . $discuz_userss . "' WHERE fid=" . $asdfgh[fid]);}
  63.                 <!--{if ($discuz_uid!=$asdfgh[authorid] && $c[uid]<=0)}-->
  64.                         {eval $q2=$db->query("SELECT id,new FROM cdb_promptmsgs WHERE uid=" . $asdfgh[authorid] . " AND typeid = 6 AND actor = '" . $pid . "\tpostinner'");}
  65.                         {eval $a=$db->fetch_array($q2);}
  66.                         {eval $newnotice=0;}
  67.                         <!--{if $a[id]>0}-->
  68.                                 {eval $q2=$db->query("UPDATE cdb_promptmsgs SET dateline = " . $GLOBALS[timestamp] . ",new = 1 WHERE uid=" . $asdfgh[authorid] . " AND typeid = 6 AND actor = '" . $pid . "\tpostinner'");}
  69.                                 <!--{if $a[new]==0}-->
  70.                                         {eval $newnotice=1;}
  71.                                 <!--{/if}-->
  72.                         <!--{else}-->
  73.                                 {eval $q2=$db->query("SELECT id FROM cdb_promptmsgs ORDER BY id DESC LIMIT 1");}
  74.                                 {eval $a=$db->fetch_array($q2);}
  75.                                 {eval $q2=$db->query("INSERT INTO cdb_promptmsgs VALUES(" . ($a[id]+1) . ",6," . $asdfgh[authorid] . ",0,1," . $GLOBALS[timestamp] . ",'<div class=\"f_thread\">你在帖子<a href=\"redirect.php?goto=findpost&ptid=" . $asdfgh[tid] . "&pid=" . $pid . "\">" . $asdfgh[subject] . "</a>中的回复有了新回复</div>','" . $pid . "\tpostinner')");}
  76.                                 {eval $newnotice=1;}
  77.                         <!--{/if}-->
  78.                         <!--{if $newnotice==1}-->
  79.                                 {eval $q2=$db->query("SELECT number FROM cdb_prompt WHERE uid = " . $asdfgh[authorid] . " AND typeid = 6");}
  80.                                 {eval $a=$db->fetch_array($q2);}
  81.                                 <!--{if $a[number]>0}-->
  82.                                         {eval $q2=$db->query("UPDATE cdb_prompt SET number=" . ($a[number]+1) . " WHERE uid = " . $asdfgh[authorid] . " AND typeid = 6");}
  83.                                 <!--{else}-->
  84.                                         {eval $q2=$db->query("INSERT INTO cdb_prompt VALUES(" . $asdfgh[authorid] . ",6,1)");}
  85.                                 <!--{/if}-->
  86.                         <!--{/if}-->
  87.                 <!--{/if}-->
  88.                 {eval $zyact="get";}
  89.         <!--{/if}-->

  90.         <!--{if ($zyact=="get")}-->
  91.                 {eval $pid=$_GET["pid"];}
  92.                 {eval $page=$_GET["page"];}
  93.                 {eval $upper=5*$page-5;}
  94.                 {eval $q2=$db->query("SELECT * FROM zy_postinner WHERE pid = $pid ORDER BY ptid DESC LIMIT $upper,5");}
  95.                 {eval $zyhomeshow=Array();}
  96.                 {eval $i=0;}
  97.                 {eval while ($asdfgh=$db->fetch_array($q2)) $zyhomeshow[$i++] = $asdfgh ; }
  98.                 {eval $q2 = $db->query("SELECT zy_postinner FROM cdb_posts WHERE pid = " . $pid);}
  99.                 {eval $asdfgh = $db->fetch_array($q2);}
  100.                <!--{if ($asdfgh[zy_postinner] != 0)}-->                <h3><span class="icon_ring vm"></span>点评</h3><!--{/if}-->
  101.                 {eval $maxpage=ceil($asdfgh[zy_postinner]/5);}
  102.                 <!--{loop $zyhomeshow $thing}-->
  103.                         <div id="zypostinner_<!--{echo $thing[ptid]}-->" class="zypi_in" onmouseover="zypi_showover(this)" onmouseout="zypi_showout(this)" style="clear: left;
  104. padding: 0.5em 0;">
  105.                                 <div class="zypi_in1"><img src="uc_server/avatar.php?uid=<!--{echo $thing[uid]}-->&size=small" /></div>
  106.                                 <div class="zypi_in2">
  107. <p class="zypi_in2_in1">
  108. <span style="float: left;">
  109. <a href="space.php?uid=<!--{echo $thing[uid]}-->"><!--{echo $thing[name]}--></a>
  110.   
  111. </span>
  112. <div style="margin-left: 100px;">
  113. <em class="zypi_in2_in2"><!--{echo discuzcode(preg_replace("/\s?\[at\](.+?)\[\/at\]\s?/ies", "", $thing[msg]), 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0);}--></em>
  114.   
  115. <span style="color: #999;">{eval $postime=dgmdate("$dateformat $timeformat", $thing[time] + $timeoffset * 3600);}发表于 <!--{echo $postime;}--> {eval $lastip = $db->fetch_array($db->query("SELECT * FROM cdb_members WHERE uid=".$thing[uid]));}<!--{if $discuz_uid && $adminid >= 1}-->IP:$lastip[lastip]<!--{/if}--></span>
  116. <!--{if ($thing[uid] ==$discuz_uid || $discuz_uid == 1)}-->
  117. <a onclick="zypi_delete($thing[ptid],$pid);" style="cursor: pointer;color:#999;">删除</a>
  118. <!--{/if}-->
  119. </div>
  120. </p>                                   
  121.                                 </div>
  122.                                 <div class="zypi_in3"></div>
  123.                                 <div class="zypi_in4"><button onclick="zypi_reply(this)">回复</button></div>
  124.                         </div>
  125.                 <!--{/loop}-->
  126.         <div class="zypi_btmbar">
  127.                 <div class="zypi_pages pages">
  128.                 <!--{if $maxpage>1}-->
  129.                 <!--{if ($page>1 && $maxpage>1)}-->
  130.                         <a href="javascript:void 0" onclick="zypi_gotopage(this,1)">首页</a>
  131.                         <a href="javascript:void 0" onclick="zypi_gotopage(this,<!--{echo ($page-1);}-->)">上一页</a>
  132.                 <!--{/if}-->
  133.                 {eval $i=0;}
  134.                 {eval while ($i<$maxpage) echo("<a href='javascript:void 0' " . (++$i==$page?"":"onclick='zypi_gotopage(this," . $i . ")'") . ">" . ($i==$page?"<b>" . $i . "</b>":$i) . "</a>") ; }
  135.                 <!--{if $page<$maxpage}-->
  136.                         <a href="javascript:void 0" onclick="zypi_gotopage(this,<!--{echo ($page+1);}-->)">下一页</a>
  137.                         <a href="javascript:void 0" onclick="zypi_gotopage(this,<!--{echo ($maxpage);}-->)">尾页</a>
  138.                 <!--{/if}-->
  139.                 <!--{/if}-->
  140.                 </div>
  141.                 <div class="zypi_postbox_btn"><a href="javascript:void 0" onclick="zypi_togglebox(this)" id="gtrf_$pid" style="display:none;">我也说一句</a></div>
  142.         </div>

  143.                 {eval die;}
  144.         <!--{/if}-->
  145. {eval die;}
  146. {echo $GLOBALS[timestamp];}
  147. <!--{/if}-->
复制
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.

获得 小恶魔卡 一张

卡片说明:flashroad不小心破坏了公物,被警察叔叔扣掉5金钱

卡片效果:-5

点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

3、新建postinner模版

注意,这里有两个版本的模板。

第一个版本:写完点评发送时,点评的对话框会自动关闭【推荐该版本】
第二个版本:写完点评发送时,点的评对话框不会关闭
两者取其一即可。不要两者都用

版本一:
  1. var zhangyupostinner = ["#header", "<div id='zyco'></div>", ".zypi_postbox", "display", "none", "textarea", "class", "zypi_postbox_btn_hover", "class", "zypi_postbox_btn", "button", "click", "textarea", ".zypi_postbox", "display", "none", ".zypi_postbox_btn", "class", "zypi_postbox_btn_hover", "textarea", "button", "click", "textarea", "id", "zypostinner_", "", ".zypi_in2 .zypi_in2_in1 span a", "span:eq(0)", "回复: ", "span.zypi_ptid_hide", "a", "span", "", "", "不能发送空信息!", "id", "zypi_", "", "button,textarea", "disabled", ".zypi_ptid_hide", ".zypi_pages a b", "POST", "faq.php?zyhome=postinner&zyact=post&pid=", "&page=", ".zypi_show", ".zypi_postbox_btn", "class", "zypi_postbox_btn_hover", "button,textarea", "disabled", "", "span", "", "a", "button,textarea", "disabled", "网络错误!", "id", "zypi_", "", "faq.php?zyhome=postinner&zyact=get&pid=", "&page=", "disabled", "true", "网络错误!", ".zypi_in4", ".zypi_in4"];
  2. $jq(document).ready(function() {
  3.         $jq(zhangyupostinner[0]).after(zhangyupostinner[1])
  4. });

  5. function zypi_togglebox(obj) {
  6.         var obj = $jq(obj);
  7.         var pbox = obj.parent().parent().parent().parent().find(zhangyupostinner[2]);
  8.         if (pbox.css(zhangyupostinner[3]) == zhangyupostinner[4]) {
  9.                 pbox.show().find(zhangyupostinner[5]).focus();
  10.                 obj.parent().attr(zhangyupostinner[6], zhangyupostinner[7])
  11.         } else {
  12.                 pbox.hide();
  13.                 obj.parent().attr(zhangyupostinner[8], zhangyupostinner[9])
  14.         };
  15.         pbox.find(zhangyupostinner[10]).unbind(zhangyupostinner[11]).click(function() {
  16.                 zypi_post($jq(this).parent().parent().find(zhangyupostinner[12]))
  17.         })
  18. };

  19. function zypi_reply(obj) {
  20.         obj = $jq(obj);
  21.         var pbox = obj.parent().parent().parent().parent().find(zhangyupostinner[13]);
  22.         if (pbox.css(zhangyupostinner[14]) == zhangyupostinner[15]) {
  23.                 pbox.show();
  24.                 obj.parent().parent().parent().parent().find(zhangyupostinner[16]).attr(zhangyupostinner[17], zhangyupostinner[18])
  25.         };
  26.         pbox.find(zhangyupostinner[19]).focus();
  27.         pbox.find(zhangyupostinner[20]).unbind(zhangyupostinner[21]).click(function() {
  28.                 zypi_post($jq(this).parent().parent().find(zhangyupostinner[22]))
  29.         });
  30.         var ptid = obj.parent().parent().attr(zhangyupostinner[23]).replace(zhangyupostinner[24], zhangyupostinner[25]);
  31.         var pauthor = obj.parent().parent().find(zhangyupostinner[26]).html();
  32.         pbox.find(zhangyupostinner[27]).html(zhangyupostinner[28] + pauthor);
  33.         pbox.find(zhangyupostinner[29]).html(ptid);
  34.         pbox.find(zhangyupostinner[30]).show()
  35. };

  36. function zypi_unreply(obj) {
  37.         obj = $jq(obj).hide().parent().parent();
  38.         obj.find(zhangyupostinner[31]).html(zhangyupostinner[32])
  39. };

  40. function zypi_post(txtobj) {
  41.         var txtobj = $jq(txtobj);
  42.         if (txtobj.val() == zhangyupostinner[33]) {
  43.                 showDialog(zhangyupostinner[34]);
  44.                 return
  45.         };
  46.         var txtpid = txtobj.parent().parent().parent().attr(zhangyupostinner[35]).replace(zhangyupostinner[36], zhangyupostinner[37]);
  47.         $jq(txtobj).parent().parent().find(zhangyupostinner[38]).attr(zhangyupostinner[39], true);
  48.         var ptid = txtobj.parent().parent().find(zhangyupostinner[40]).html();
  49.         var pgb = $jq(txtobj).parent().parent().parent().find(zhangyupostinner[41]);
  50.         if (pgb.length > 0x0) {
  51.                 pgb = pgb.html()
  52.         } else {
  53.                 pgb = 0x1
  54.         };
  55.         $jq.ajax({
  56.                 type: zhangyupostinner[42],
  57.                 url: zhangyupostinner[43] + txtpid + zhangyupostinner[44] + pgb,
  58.                 data: {
  59.                         pid: txtpid,
  60.                         msg: txtobj.val(),
  61.                         ptid: ptid
  62.                 },
  63.                 success: function(msg) {
  64.                         $jq(txtobj).parent().parent().parent().find(zhangyupostinner[45]).html(msg).find(zhangyupostinner[46]).attr(zhangyupostinner[47], zhangyupostinner[48]);
  65.                         $jq(txtobj).parent().parent().find(zhangyupostinner[49]).attr(zhangyupostinner[50], false);
  66.                         $jq(txtobj).val(zhangyupostinner[51]);
  67. $jq(".zypi_postbox.dialog").hide();

  68.                         txtobj.parent().parent().find(zhangyupostinner[52]).html(zhangyupostinner[53]);
  69.                         txtobj.parent().parent().find(zhangyupostinner[54]).hide()
  70.                 },
  71.                 error: function() {
  72.                         $jq(txtobj).parent().parent().find(zhangyupostinner[55]).attr(zhangyupostinner[56], false);
  73.                         showDialog(zhangyupostinner[57])
  74.                 }
  75.         })
  76. };

  77. function zypi_showall(obj) {
  78.         zypi_gotopage(obj, 2)
  79. };

  80. function zypi_gotopage(obj, page) {
  81.         obj = $jq(obj);
  82.         var pid = obj.parent().parent().parent().parent().attr(zhangyupostinner[58]).replace(zhangyupostinner[59], zhangyupostinner[60]);
  83.         $jq.ajax({
  84.                 url: zhangyupostinner[61] + pid + zhangyupostinner[62] + page,
  85.                 success: function(msg) {
  86.                         obj.parent().parent().parent().html(msg)
  87.                 },
  88.                 error: function() {
  89.                         obj.attr(zhangyupostinner[63], zhangyupostinner[64]);
  90.                         showDialog(zhangyupostinner[65])
  91.                 }
  92.         })
  93. };

  94. function zypi_showover(obj) {
  95.         $jq(obj).find(zhangyupostinner[66]).show()
  96. };

  97. function zypi_showout(obj) {
  98.         $jq(obj).find(zhangyupostinner[67]).hide()
  99. }



  100. function zypi_delete(ptid,pid) {
  101.         $jq.ajax({
  102.                 url:"faq.php?zyhome=postinner&zyact=delete&ptid="+ptid+"&pid="+pid+"&page=1",
  103.                 success: function(msg) {
  104. $jq("#zypi_"+pid+" .zypi_show").html(msg)
  105.                 },
  106.                 error: function() {
  107.                         showDialog("删除失败")
  108.                 }
  109.         })
  110. };
复制
版本二:
  1. var zhangyupostinner = ["#header", "<div id='zyco'></div>", ".zypi_postbox", "display", "none", "textarea", "class", "zypi_postbox_btn_hover", "class", "zypi_postbox_btn", "button", "click", "textarea", ".zypi_postbox", "display", "none", ".zypi_postbox_btn", "class", "zypi_postbox_btn_hover", "textarea", "button", "click", "textarea", "id", "zypostinner_", "", ".zypi_in2 .zypi_in2_in1 span a", "span:eq(0)", "回复: ", "span.zypi_ptid_hide", "a", "span", "", "", "不能发送空信息!", "id", "zypi_", "", "button,textarea", "disabled", ".zypi_ptid_hide", ".zypi_pages a b", "POST", "faq.php?zyhome=postinner&zyact=post&pid=", "&page=", ".zypi_show", ".zypi_postbox_btn", "class", "zypi_postbox_btn_hover", "button,textarea", "disabled", "", "span", "", "a", "button,textarea", "disabled", "网络错误!", "id", "zypi_", "", "faq.php?zyhome=postinner&zyact=get&pid=", "&page=", "disabled", "true", "网络错误!", ".zypi_in4", ".zypi_in4"];
  2. $jq(document).ready(function() {
  3.         $jq(zhangyupostinner[0]).after(zhangyupostinner[1])
  4. });

  5. function zypi_togglebox(obj) {
  6.         var obj = $jq(obj);
  7.         var pbox = obj.parent().parent().parent().parent().find(zhangyupostinner[2]);
  8.         if (pbox.css(zhangyupostinner[3]) == zhangyupostinner[4]) {
  9.                 pbox.show().find(zhangyupostinner[5]).focus();
  10.                 obj.parent().attr(zhangyupostinner[6], zhangyupostinner[7])
  11.         } else {
  12.                 pbox.hide();
  13.                 obj.parent().attr(zhangyupostinner[8], zhangyupostinner[9])
  14.         };
  15.         pbox.find(zhangyupostinner[10]).unbind(zhangyupostinner[11]).click(function() {
  16.                 zypi_post($jq(this).parent().parent().find(zhangyupostinner[12]))
  17.         })
  18. };

  19. function zypi_reply(obj) {
  20.         obj = $jq(obj);
  21.         var pbox = obj.parent().parent().parent().parent().find(zhangyupostinner[13]);
  22.         if (pbox.css(zhangyupostinner[14]) == zhangyupostinner[15]) {
  23.                 pbox.show();
  24.                 obj.parent().parent().parent().parent().find(zhangyupostinner[16]).attr(zhangyupostinner[17], zhangyupostinner[18])
  25.         };
  26.         pbox.find(zhangyupostinner[19]).focus();
  27.         pbox.find(zhangyupostinner[20]).unbind(zhangyupostinner[21]).click(function() {
  28.                 zypi_post($jq(this).parent().parent().find(zhangyupostinner[22]))
  29.         });
  30.         var ptid = obj.parent().parent().attr(zhangyupostinner[23]).replace(zhangyupostinner[24], zhangyupostinner[25]);
  31.         var pauthor = obj.parent().parent().find(zhangyupostinner[26]).html();
  32.         pbox.find(zhangyupostinner[27]).html(zhangyupostinner[28] + pauthor);
  33.         pbox.find(zhangyupostinner[29]).html(ptid);
  34.         pbox.find(zhangyupostinner[30]).show()
  35. };

  36. function zypi_unreply(obj) {
  37.         obj = $jq(obj).hide().parent().parent();
  38.         obj.find(zhangyupostinner[31]).html(zhangyupostinner[32])
  39. };

  40. function zypi_post(txtobj) {
  41.         var txtobj = $jq(txtobj);
  42.         if (txtobj.val() == zhangyupostinner[33]) {
  43.                 showDialog(zhangyupostinner[34]);
  44.                 return
  45.         };
  46.         var txtpid = txtobj.parent().parent().parent().attr(zhangyupostinner[35]).replace(zhangyupostinner[36], zhangyupostinner[37]);
  47.         $jq(txtobj).parent().parent().find(zhangyupostinner[38]).attr(zhangyupostinner[39], true);
  48.         var ptid = txtobj.parent().parent().find(zhangyupostinner[40]).html();
  49.         var pgb = $jq(txtobj).parent().parent().parent().find(zhangyupostinner[41]);
  50.         if (pgb.length > 0x0) {
  51.                 pgb = pgb.html()
  52.         } else {
  53.                 pgb = 0x1
  54.         };
  55.         $jq.ajax({
  56.                 type: zhangyupostinner[42],
  57.                 url: zhangyupostinner[43] + txtpid + zhangyupostinner[44] + pgb,
  58.                 data: {
  59.                         pid: txtpid,
  60.                         msg: txtobj.val(),
  61.                         ptid: ptid
  62.                 },
  63.                 success: function(msg) {
  64.                         $jq(txtobj).parent().parent().parent().find(zhangyupostinner[45]).html(msg).find(zhangyupostinner[46]).attr(zhangyupostinner[47], zhangyupostinner[48]);
  65.                         $jq(txtobj).parent().parent().find(zhangyupostinner[49]).attr(zhangyupostinner[50], false);
  66.                         $jq(txtobj).val(zhangyupostinner[51]);
  67.                         txtobj.parent().parent().find(zhangyupostinner[52]).html(zhangyupostinner[53]);
  68.                         txtobj.parent().parent().find(zhangyupostinner[54]).hide()
  69.                 },
  70.                 error: function() {
  71.                         $jq(txtobj).parent().parent().find(zhangyupostinner[55]).attr(zhangyupostinner[56], false);
  72.                         showDialog(zhangyupostinner[57])
  73.                 }
  74.         })
  75. };

  76. function zypi_showall(obj) {
  77.         zypi_gotopage(obj, 2)
  78. };

  79. function zypi_gotopage(obj, page) {
  80.         obj = $jq(obj);
  81.         var pid = obj.parent().parent().parent().parent().attr(zhangyupostinner[58]).replace(zhangyupostinner[59], zhangyupostinner[60]);
  82.         $jq.ajax({
  83.                 url: zhangyupostinner[61] + pid + zhangyupostinner[62] + page,
  84.                 success: function(msg) {
  85.                         obj.parent().parent().parent().html(msg)
  86.                 },
  87.                 error: function() {
  88.                         obj.attr(zhangyupostinner[63], zhangyupostinner[64]);
  89.                         showDialog(zhangyupostinner[65])
  90.                 }
  91.         })
  92. };

  93. function zypi_showover(obj) {
  94.         $jq(obj).find(zhangyupostinner[66]).show()
  95. };

  96. function zypi_showout(obj) {
  97.         $jq(obj).find(zhangyupostinner[67]).hide()
  98. }function zypi_delete(ptid,pid) {        $jq.ajax({                url:"faq.php?zyhome=postinner&zyact=delete&ptid="+ptid+"&pid="+pid+"&page=1",                success: function(msg) {$jq("#zypi_"+pid+" .zypi_show").html(msg)                },                error: function() {                        showDialog("删除失败")                }        })};
复制
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.

获得 花仙子卡 一张

卡片说明:flashroad照顾了失踪的小狗,主人付出了6金钱以作感谢

卡片效果:+6

点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

4、新建dp_move模版

  1. var Dragging=function(validateHandler){ //参数为验证点击区域是否为可移动区域,如果是返回欲移动元素,负责返回null
  2.                 var draggingObj=null; //dragging Dialog
  3.                 var diffX=0;
  4.                 var diffY=0;

  5.                 function mouseHandler(e){
  6.                     switch(e.type){
  7.                         case 'mousedown':
  8.                             draggingObj=validateHandler(e);//验证是否为可点击移动区域
  9.                             if(draggingObj!=null){
  10.                                 diffX=e.clientX-draggingObj.offsetLeft;
  11.                                 diffY=e.clientY-draggingObj.offsetTop;
  12.                             }
  13.                             break;

  14.                         case 'mousemove':
  15.                             if(draggingObj){
  16.                                 draggingObj.style.left=(e.clientX-diffX)+'px';
  17.                                 draggingObj.style.top=(e.clientY-diffY)+'px';
  18.                             }
  19.                             break;

  20.                         case 'mouseup':
  21.                             draggingObj =null;
  22.                             diffX=0;
  23.                             diffY=0;
  24.                             break;
  25.                     }
  26.                 };

  27.                 return {
  28.                     enable:function(){
  29.                         document.addEventListener('mousedown',mouseHandler);
  30.                         document.addEventListener('mousemove',mouseHandler);
  31.                         document.addEventListener('mouseup',mouseHandler);
  32.                     },
  33.                     disable:function(){
  34.                         document.removeEventListener('mousedown',mouseHandler);
  35.                         document.removeEventListener('mousemove',mouseHandler);
  36.                         document.removeEventListener('mouseup',mouseHandler);
  37.                     }
  38.                 }
  39.             }

  40.             function getDraggingDialog(e){
  41.                 var target=e.target;
  42.                 while(target && target.className.indexOf('dialog-title')==-1){
  43.                     target=target.offsetParent;
  44.                 }
  45.                 if(target!=null){
  46.                     return target.offsetParent;
  47.                 }else{
  48.                     return null;
  49.                 }
  50.             }

  51.             Dragging(getDraggingDialog).enable();
复制
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.

获得 大怪兽卡 一张

卡片说明:flashroad被风吹乱了秀发,花费了7金币请理发师整理了一个酷炫发型

卡片效果:-7

点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

5、修改css_common模版

新增如下内容:将里面的图片1到图片6替换为一楼的6张图片的网址
  1. /*----------点评---------------*/
  2. .dialog{position:absolute; margin:10px;}
  3. .dialog-title {width: 450px;margin-bottom: -30px;position: relative;height: 30px;cursor: move;}
  4. .zypi .zypi_in{position:relative;}
  5. .icon_ring:hover{border: 2px solid rgb(225, 244, 221);background: rgb(242, 108, 79);}
  6. .icon_ring {background: rgb(255, 244, 221);border-radius: 10px;border: 2px solid rgb(242, 108, 79);border-image: none;width: 8px;height: 8px;overflow: hidden;margin-right: 5px;display: inline-block;box-shadow: 0px 0px 1px rgba(0,0,0,0.2);-moz-border-radius: 10px;-webkit-border-radius: 10px;}
  7. .vm {vertical-align: middle;}
  8. .bar_cm {height: 25px;line-height: 25px;background: #F2F2F2;}
  9. .nxt {background-image: url(图片1);background-position: 90% 50%;line-height: 26px;float: left;display: inline;padding: 0 20px 0 8px;height: 26px;border: 1px solid;border-color: #C2D5E3;background-color: #FFF;background-repeat: no-repeat;color: #333;cursor: pointer;}
  10. .cmmnt {background: url(图片2) no-repeat 0 50%;}
  11. .psti {margin-left: 120px;line-height: 24px;}
  12. .flbc {float: left;width: 20px;height: 20px;overflow: hidden;text-indent: -9999px;background: url(图片3) no-repeat 0 0;cursor: pointer;}
  13. #return_comment {float: left;font-size: 14px;font-weight: 700;color: #369;margin-top: 10px;margin-left: 10px;}
  14. .zypi h3{padding: 5px;background-color: #FFF4DD;color: #F26C4F;background-position: 100% 50%;margin: 2em 0 2em -20px;padding: 5px 45px 5px 20px;width: 240px;background: #FFF4DD url(图片4) no-repeat 100% 50%;color: #F26C4F;font-size: 14px;}
  15. .zypi .zypi_in3{clear:both;}
  16. .zypi .zypi_in1{float:left;}
  17. .zypi .zypi_in1 img{width: 24px;height: 24px;}
  18. .zypi .zypi_in2 .zypi_in2_in1 span a{color:#369;font-weight: 700;}
  19. .zypi .zypi_in2 .zypi_in2_in1 span em{color: #333;margin-left: 55px;}
  20. .zypi .zypi_in2 .zypi_in2_in1{color:#cacaca;}
  21. .zypi .zypi_in2{margin-left: 30px;line-height: 24px;}
  22. .zypi_in2_in2 img {max-height: 24px;max-width: 24px;margin-bottom: -7px;}
  23. .zypi .zypi_in .zypi_in4{position:absolute;right:5px;bottom:5px;display:none;}
  24. .zypi .zypi_showevery,.zypi .zypi_pages{margin:8px;float:left;}
  25. .zypi .zypi_pages a{display:inline-block;margin: 0 4px 0 0;}
  26. .zypi .zypi_postbox{width: 620px;z-index: 99;height: 170px;border: #cacaca 8px solid;margin: -6px 5px 0 5px;display:none;background-color: #fff;border-radius: 9px;}
  27. .zypi .zypi_postbox textarea {width: 596px;height: 55px;margin-left: 8px;margin-bottom: 5px;}
  28. .zypi .zypi_ptid_hide{display:none;}
  29. .zypi .zypi_pages a{color:#333;}
  30. .zypi .zypi_pages b{color:#000000;}
  31. .zypi{margin:10px 0 20px 0;}
  32. .fpd cite {float: left;margin: 2px 5px 0 0;width: 20px;height: 20px;background: url(图片5) no-repeat;text-indent: -9999px;line-height: 20px;overflow: hidden;cursor: pointer;}
  33. .fpd cite.tb_color {background-position: -60px 0;}
  34. .float_close_a {width: 20px;margin-top: -118px;margin-right: -148px;height: 20px;overflow: hidden;text-indent: -9999px;background: url(../../images/default/newclose.gif) no-repeat 0 0;}
  35. .float_close_a:hover { background-position: 0 -20px; }
  36. .fpd cite.tb_smilies {background-position: -20px -20px;}
  37. .dp_num {border: none;background: none;color: #369;font-weight: 700;width: 20px;padding-left: 5px;}
  38. .dp_shuru {float: right;margin: 10px;}
  39. .dp_fb{vertical-align: middle;overflow: hidden;margin-right: 3px;border: 1px solid #999;background: #E5E5E5 url(图片6) repeat-x 0 0;cursor: pointer;-moz-box-shadow: 0 1px 0 #E5E5E5;-webkit-box-shadow: 0 1px 0 #E5E5E5;box-shadow: 0 1px 0 #E5E5E5;border-color: #235994;background-color: #06C;background-position: 0 -48px;color: #FFF !important;width: 45px;}
复制
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

6、编辑viewthread_node模版

【一】查找:<td class="postcontent postbottom">
在其下面添加:
  1. <!-- 仿X3点评 -->
  2. {eval $q2=$db->query("SELECT * FROM zy_postinner WHERE pid = " . $post[pid] . " ORDER BY ptid DESC LIMIT 5");}
  3. {eval $zyhomeshow=Array();}
  4. {eval $i=0;}
  5. {eval while ($asdfgh=$db->fetch_array($q2)) $zyhomeshow[$i++] = $asdfgh ; }
  6. <div id="zypi_$post[pid]" class="zypi">
  7. <div class="zypi_show">
  8. <!--{if ($post[zy_postinner] != 0)}-->
  9.         <h3><span class="icon_ring vm"></span>点评</h3>
  10. <!--{/if}-->
  11.         <!--{loop $zyhomeshow $thing}-->
  12.                 <div id="zypostinner_<!--{echo $thing[ptid]}-->" class="zypi_in" onmouseover="zypi_showover(this)" onmouseout="zypi_showout(this)" style="clear: left;
  13. padding: 0.5em 0;">
  14.                         <div class="zypi_in1"><img src="uc_server/avatar.php?uid=<!--{echo $thing[uid]}-->&size=small" /></div>
  15.                         <div class="zypi_in2">


  16. <p class="zypi_in2_in1">
  17. <span style="float: left;">
  18. <a href="space.php?uid=<!--{echo $thing[uid]}-->"><!--{echo $thing[name]}--></a>
  19.   
  20. </span>
  21. <div style="margin-left: 100px;">
  22. <em class="zypi_in2_in2"><!--{echo discuzcode(preg_replace("/\s?\[at\](.+?)\[\/at\]\s?/ies", "", $thing[msg]), 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0);}--></em>
  23.   
  24. <span style="color: #999;">{eval $postime=dgmdate("$dateformat $timeformat", $thing[time] + $timeoffset * 3600);}发表于 <!--{echo $postime;}--> {eval $lastip = $db->fetch_array($db->query("SELECT * FROM cdb_members WHERE uid=".$thing[uid]));}<!--{if $discuz_uid && $adminid >= 1}-->IP:$lastip[lastip]<!--{/if}--></span><!--{if ($thing[uid] ==$discuz_uid || $discuz_uid == 1)}--><a onclick="zypi_delete($thing[ptid],$post[pid]);" style="cursor: pointer;color:#999;">删除</a><!--{/if}--></div>
  25. </p>


  26.                         </div>
  27.                         <div class="zypi_in3"></div>
  28.                        <div class="zypi_in4"><button onclick="zypi_reply(this)">回复</button></div>
  29.                 </div>
  30.         <!--{/loop}-->
  31.         <div class="zypi_btmbar">
  32.                 <!--{if $post[zy_postinner]>5}--><div class="zypi_showevery"><a class="nxt" onclick="zypi_showall(this)">下一页</a></div><!--{/if}-->
  33. <!--{if ($discuz_uid)}-->
  34.                 <div class="zypi_postbox_btn"><a href="javascript:void 0" onclick="zypi_togglebox(this)" id="gtrf_$post[pid]" style="display:none;">我也说一句</a></div>
  35. <!--{/if}-->
  36.         </div>
  37.         </div>
  38. <div class="s_clear"></div>
  39. <div class="zypi_postbox dialog">
  40. <div class="dialog-title" style="width: 580px!important;"></div>
  41. <em id="return_comment" fwin="comment">点评</em>
  42. <div style="width: 600px;  border: 1px solid;  border-color: #999 #CCC #CCC #999;margin: 35px 0 0 8px;">
  43. <div class="bar_cm">
  44. <div class="fpd">
  45. <cite href="javascript:;" title="{lang e_bold}" class="tb_bold" onclick="seditor_insertunit('gtrf_$post[pid]', '[b]', '[/b]')">B</cite>
  46. <cite href="javascript:;" title="{lang e_forecolor}"  class="tb_color" id="gtrf_$post[pid]forecolor" onclick="showColorBox(this.id, 2, 'gtrf_$post[pid]')">Color</cite>
  47. <cite href="javascript:;" class="tb_smilies" id="gtrf_$post[pid]smilies" onclick="showMenu({'ctrlid':this.id,'evt':'click','layer':2});return false">Smilies</cite>
  48. <script type="text/javascript" src="forumdata/cache/smilies_var.js?{VERHASH}" reload="1"></script>
  49. <script type="text/javascript" reload="1">smilies_show('gtrf_$post[pid]smiliesdiv', $smcols, 'gtrf_$post[pid]');</script>
  50. </div>
  51. </div>
  52. </div>

  53. <SCRIPT LANGUAGE="JavaScript">   
  54.    function textCounter(field, countfield, maxlimit) {   
  55.    if (field.value.length > maxlimit)  
  56.    field.value = field.value.substring(0, maxlimit);  
  57.    else   
  58.    countfield.value = maxlimit - field.value.length;  
  59.    }  
  60. </SCRIPT>

  61. <p>
  62. <form name=myform action="">
  63. <textarea name="message" cols="28" rows="5" onKeyDown="textCounter(message,remLen,80);" onKeyUp="textCounter(message,remLen,80);" id="gtrf_$post[pid]message"></textarea>
  64. <div class="dp_shuru">您还可以输入:<input class="dp_num" name="remLen" type="text" value="80" size="5" readonly="readonly">个字符</div>
  65. </form>
  66. <a href="javascript:void 0" class="float_close_a" onclick="document.getElementById('gtrf_$post[pid]').click();" style="float:right;display:block!important;">X</a></p>
  67. <p style="padding: 8px 10px;  height: 26px;border-top: 1px solid #CCC;  background: #F2F2F2;"><button class="dp_fb">发布</button><span></span><span class="zypi_ptid_hide"></span> <a href="javascript:void 0" onclick="zypi_unreply(this)" style="display:none">X</a></p>
  68. </div>
  69. </div>
  70. <!-- 仿X3点评end -->
复制
【二】查找:
<!--{if $allowpostreply}-->
在其上面添加:
  1. <!--{if $discuz_uid}--><a class="zypi_postbox_btn cmmnt" href="javascript:;" onclick="document.getElementById('gtrf_$post[pid]').click();">点评</a><!--{/if}-->
复制
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

7、编辑faq模版

在其最上边加:
{subtemplate aa_zyhome_postinner}
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

8、其他头部[后台直接搜索 头部] 内 添加

  1. <script src="templates/default/postinner.htm"></script>
  2. <script src="templates/default/dp_move.htm"></script>
复制


这是编辑默认模板的情况。如果你是在其他模板内修改,需要将上述代码中的default替换为自己模板的名字
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

大功告成
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.

点评

flashroad

13楼有补充。现在的评论效果是“降序”的,不符合实际情况。13楼告诉你如何“升序” 发表于 2018-8-29 13:06

点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

本帖最后由 麻城生活网 于 2018-8-29 09:37 编辑
新增如下内容:将里面的图片1到图片6替换为一楼的6张图片的网址
flashroad 发表于 2018-4-12 08:46



    放什么位置你不说明一下?

我替你说一下吧,放 css_common模板最下面
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

回复 11# 麻城生活网


    放在最上面也是可以的,其实只要不破坏原模板的语法规则,放在任意位置都可以。只不过,学习一门语言需要时间,所以都说放在最下面
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

想造如何升序排列吗?
原理在“[sql代码]乱七八糟”一文8楼。
点我直接打开观看吧!

如果不想知道原理,仅仅想要实现效果,so easy,具体操作是:
【1】本帖3楼 也就是步骤2 新建的aa_zyhome_postinner模版
找到
WHERE pid = $pid ORDER BY ptid DESC LIMIT $upper,5"
去掉里面的DESC即可,去掉后酱紫:
WHERE pid = $pid ORDER BY ptid  LIMIT $upper,5"

【2】本帖7楼 也就是步骤6 修改的 viewthread_node模版
找到
ORDER BY ptid DESC LIMIT 5
去掉里面的DESC即可,去掉后酱紫:
ORDER BY ptid  LIMIT 5
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

本帖最后由 麻城生活网 于 2018-9-10 09:30 编辑
想造如何升序排列吗?
原理在“[sql代码]乱七八糟”一文8楼。


如果不想知道原理,仅仅想要实现效果,so e ...
flashroad 发表于 2018-8-29 13:05



   

升降序只要修改13楼说到的DESC,把DESC全部改为ASC即可!!!!1
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.

点评

flashroad

不行了,瞬间抓到了一个错别字,请修正过来,否则我帮你改过来了 发表于 2018-9-7 14:15

麻城生活网

回复 flashroad :已经修改了 发表于 2018-9-10 09:32

点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

 

B Color Image Link Quote Code Smilies
高级模式 | 发新话题

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

快速
返回顶部
返回首页