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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

哎,不等了...帖子的副标题 For 6.1.0 080606 GBK V2.0

[复制链接]
barracuda 发表于 2008-7-23 10:42:27 | 显示全部楼层 |阅读模式
插件发布
插件名称: 帖子的副标题 For 6.1.0 080606 GBK
插件来源:
适用版本: Discuz! 6.1
语言编码: GBK简体 
最后更新时间:
插件作者: Barracuda
插件简介: 可以选择性的给帖子添加副标题,限制了副标题最长90个字符, 超出了提示修改
2008年7月24日前修改的请执行以下步骤修正
感谢wxyuan90指出
解决方案:

1.已经安装的请执行一次数据库升级
  1. UPDATE cdb_posts SET exsubject = '';
  2. UPDATE cdb_threads SET exsubject = '';
复制代码
2.修改post.php
查找
  1. require_once './include/common.inc.php';
复制代码
在后面加上
复制内容到剪贴板代码:
  1. $exsubject = dhtmlspecialchars($exsubject);
复制代码
因为找不到人测试,所以这类问题也没太注意.修改了的就注意下吧.

现在我人在外面,回去修正下实验室的问题.

======================我是无奈的分割线========================================

新安装的用户直接从这里往下执行

本来还是想测试一段时间才放出来的,但是没人帮助测试...算了...直接放吧,心凉了...
BTW:没耐心改的朋友可以跳过这个修改了

测试的走这里:
http://www.jx4n.cn/dz/bbs/index.php
随便灌...反正是我个人的实验室,只是不要发布那些违规的信息就可以了,我怕和我一个服务器的兄弟会遭殃

支持的走这里:
http://www.jx4n.com
我自己在运营的站,希望大家多提意见和建议,另外有没有站长群能加下我,教我一些推广的问题...或者我有什么新的想法能够邀请到一些人来测试一下...

下面是正题:
本来对这个不是很感兴趣的...只是看到discuz!里很多人需要,就随手做了个出来...参考了这个地方
https://discuz.dismall.com/viewthread.php?tid=360378
对快速发帖栏的副标题我去掉了,不过快速发帖以后如果需要的话可以在编辑里加上.另外说一句,Discuz!6.1.0和Discuz!4.1.0的代码和实现方式差距还是挺大的.

要修改的地方比较多,所以希望大家先备份以下文件

./topicadmin.php
./include/newthread.inc.php
./include/editpost.inc.php
./templates/default/templates.lang.php
./templates/default/post_newthread.htm
./templates/default/post_editpost.htm
./templates/default/forumdisplay.htm
./templates/default/viewthread.htm
.include/javascript/post_editor.js

为了大家尽量不出错,我把找到标记成了这样,替换为标记成了这样,下面加上标记成了这样...大家注意一下.

备份好以后往下做:
1.升级数据库
  1. ALTER TABLE `cdb_posts` ADD `exsubject` char(90) NOT NULL default '';
  2. ALTER TABLE `cdb_threads` ADD `exsubject` char(90) NOT NULL default '';
复制代码
2.打开./topicadmin.php
找到
  1. $firstpost = $db->fetch_first("SELECT pid, fid, authorid, author, subject, dateline FROM {$tablepre}posts WHERE tid='$tid' AND invisible='0' ORDER BY dateline LIMIT 1");
复制代码
替换成
  1. $firstpost = $db->fetch_first("SELECT pid, fid, authorid, author, subject, exsubject, dateline FROM {$tablepre}posts WHERE tid='$tid' AND invisible='0' ORDER BY dateline LIMIT 1");
复制代码
再找到
  1. $db->query("UPDATE {$tablepre}threads SET authorid='$firstpost[authorid]', author='".addslashes($firstpost['author'])."', subject='".addslashes($firstpost['subject'])."', dateline='$firstpost[dateline]', views=views+$other[views], replies=replies+$other[replies], moderated='1' WHERE tid='$tid'");
复制代码
替换成
  1. $db->query("UPDATE {$tablepre}threads SET authorid='$firstpost[authorid]', author='".addslashes($firstpost['author'])."', subject='".addslashes($firstpost['subject'])."', exsubject='".addslashes($firstpost['exsubject'])."', dateline='$firstpost[dateline]', views=views+$other[views], replies=replies+$other[replies], moderated='1' WHERE tid='$tid'");
复制代码
3.打开./include/newthread.inc.php
找到
  1. $db->query("INSERT INTO {$tablepre}threads (fid, readperm, price, iconid, typeid, author, authorid, subject, dateline, lastpost, lastposter, displayorder, digest, special, attachment, subscribed, moderated)
复制代码
替换为
  1. $db->query("INSERT INTO {$tablepre}threads (fid, readperm, price, iconid, typeid, author, authorid, subject, exsubject, dateline, lastpost, lastposter, displayorder, digest, special, attachment, subscribed, moderated)
复制代码
再找到
  1. VALUES ('$fid', '$readperm', '$price', '$iconid', '$typeid', '$author', '$discuz_uid', '$subject', '$timestamp', '$timestamp', '$author', '$displayorder', '$digest', '$special', '$attachment', '$subscribed', '$moderated')");
复制代码
替换为
  1. VALUES ('$fid', '$readperm', '$price', '$iconid', '$typeid', '$author', '$discuz_uid', '$subject', '$exsubject', '$timestamp', '$timestamp', '$author', '$displayorder', '$digest', '$special', '$attachment', '$subscribed', '$moderated')");
复制代码
再找到
  1. $db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, subject, dateline, message, useip, invisible, anonymous, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment)
复制代码
替换为
  1. $db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, subject, exsubject, dateline, message, useip, invisible, anonymous, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment)
复制代码
再找到
  1. VALUES ('$fid', '$tid', '1', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '$message', '$onlineip', '$pinvisible', '$isanonymous', '$usesig', '$htmlon', '$bbcodeoff', '$smileyoff', '$parseurloff', '$attachment')");
复制代码
替换为
  1. VALUES ('$fid', '$tid', '1', '$discuz_user', '$discuz_uid', '$subject', '$exsubject', '$timestamp', '$message', '$onlineip', '$pinvisible', '$isanonymous', '$usesig', '$htmlon', '$bbcodeoff', '$smileyoff', '$parseurloff', '$attachment')");
复制代码
4.打开./include/editpost.inc.php
找到
  1. $db->query("UPDATE {$tablepre}threads SET iconid='$iconid', typeid='$typeid', subject='$subject', readperm='$readperm', price='$price' $authoradd $polladd ".($auditstatuson && $audit == 1 ? ",displayorder='0', moderated='1'" : '')." WHERE tid='$tid'", 'UNBUFFERED');
复制代码
替换为
  1. $db->query("UPDATE {$tablepre}threads SET iconid='$iconid', typeid='$typeid', subject='$subject', exsubject='$exsubject', readperm='$readperm', price='$price' $authoradd $polladd ".($auditstatuson && $audit == 1 ? ",displayorder='0', moderated='1'" : '')." WHERE tid='$tid'", 'UNBUFFERED');
复制代码
再找到
  1. smileyoff='$smileyoff', subject='$subject' ".($pattachment ? ", attachment='1'" : '')." $anonymousadd ".($auditstatuson && $audit == 1 ? ",invisible='0'" : '')." WHERE pid='$pid'");
复制代码
替换为
  1. smileyoff='$smileyoff', subject='$subject', exsubject='$exsubject' ".($pattachment ? ", attachment='1'" : '')." $anonymousadd ".($auditstatuson && $audit == 1 ? ",invisible='0'" : '')." WHERE pid='$pid'");
复制代码
5.打开./templates/default/templates.lang.php
找到
  1. 'subject' => '标题',
复制代码
下面加上
  1. 'exsubject' => '副标题',
复制代码
再找到
  1. 'post_subject_toolong' => '您的标题超过 80 个字符的限制。',
复制代码
下面加上
  1. 'post_exsubject_toolong' => '您的副标题超过 90 个字符的限制。',
复制代码
6.打开./templates/default/post_newthread.htm
找到
  1. lang['post_subject_toolong'] = '{lang post_subject_toolong}';
复制代码
下面加上
  1. lang['post_exsubject_toolong'] = '{lang post_exsubject_toolong}';
复制代码
再找到
  1.                 <tr>
  2.                         <th style="border-bottom: 0"><label for="subject">{lang subject}</label></th>
  3.                         <td style="border-bottom: 0">
  4.                                 $typeselect
  5.                                 <input type="text" name="subject" id="subject" size="45" value="$subject" tabindex="3" />

  6.                         </td>
  7.                 </tr>
复制代码
下面加上
  1.                 <tr>
  2.                         <th style="border-bottom: 0"><label for="exsubject">{lang exsubject}</label></th>
  3.                         <td style="border-bottom: 0"><input type="text" name="exsubject" id="exsubject" size="56" value="$exsubject" tabindex="3" />

  4.                         </td>
  5.                 </tr>
复制代码
7.打开./templates/default/post_editpost.htm
找到
  1. lang['post_subject_toolong'] = '{lang post_subject_toolong}';
复制代码
下面加上
  1. lang['post_exsubject_toolong'] = '{lang post_exsubject_toolong}';
复制代码
再找到
  1. <input type="hidden" name="origsubject" value="$postinfo[subject]" />
  2. <!--{if $special == 6}-->
  3.         <input type="hidden" name="subjectu8" value="" />
  4.         <input type="hidden" name="tagsu8" value="" />
  5.         <input type="hidden" name="vid" value="1" />
  6. <!--{/if}-->
  7. </td></tr>
复制代码
下面加上
  1. <!--{if $isfirstpost}-->
  2. <tr>
  3. <td class="altbg1" width="20%">{lang exsubject}:</td>
  4. <td class="altbg2">
  5. <input type="text" name="exsubject" size="56" value="$postinfo[exsubject]" tabindex="3">
  6. <input type="hidden" name="origexsubject" value="$postinfo[exsubject]">
  7. </td>
  8. </tr>
  9. <!--{/if}-->
复制代码
8.打开./templates/default/forumdisplay.htm
找到
  1. <!--{if $thread['new']}-->
  2.                                                 <a href="redirect.php?tid=$thread[tid]&goto=newpost$highlight#newpost"

  3. class="new">New</a>
  4.                                         <!--{/if}-->
复制代码
下面加上
  1. <!--{if $thread['exsubject']}--><br><span style="font-size:11px">$thread[exsubject]</span><!--{/if}-->
复制代码
再找到
  1.                 else if(mb_strlen(theform.subject.value) > 80) {
  2.                         alert("{lang post_subject_toolong}");
  3.                         theform.subject.focus();
  4.                         return false;
  5.                 }
复制代码
下面加上
  1.                 else if(mb_strlen(theform.exsubject.value) > 90) {
  2.                         alert("{lang post_exsubject_toolong}");
  3.                         theform.exsubject.focus();
  4.                         return false;
  5.                 }
复制代码
9.打开./templates/default/viewthread.htm
找到
  1.                 <h1>$thread[subject]
  2.                 </h1>
复制代码
替换成
  1. <h1>$thread[subject]<!--{if $thread['exsubject']}--> [ $thread[exsubject] ]<!--{/if}--></h1>
复制代码
10.打开.include/javascript/post_editor.js
找到
  1. else if(mb_strlen(theform.subject.value) > 80) {
  2.                 alert(lang['post_subject_toolong']);
  3.                 theform.subject.focus();
  4.                 return false;
  5.         }
复制代码
后面加上
  1. else if(mb_strlen(theform.exsubject.value) > 90) {
  2.                 alert(lang['post_exsubject_toolong']);
  3.                 theform.exsubject.focus();
  4.                 return false;
  5.         }
复制代码
11.修改post.php
查找
  1. require_once './include/common.inc.php';
复制代码
在后面加上
复制内容到剪贴板代码:
  1. $exsubject = dhtmlspecialchars($exsubject);
复制代码
然后就可以收工了...看了一天代码,眼睛都迷糊了...编辑了一下,好看多了...


如果做好了的话实现不了的话,你可以选择仔细检查一次或者把备份好的文件替换回去,因为这次改的东西实在是太多了.就不会像我以前的那两个东西一样免费提供技术支持和协助安装了,实在是有需求的,但是又不会装的话,我可以考虑收RMB滴= =#还有请不要说这些东西密密麻麻...我改的人还需要从如此多的密密麻麻的东西找出相应的东西,告诉了你方法还不耐烦的话,我觉得你不太适合做这一行...谢谢...

附我的另外俩个玩意
添加wap发帖标记的方法:
https://discuz.dismall.com/thread-970888-1-1.html
类铁血水印添加:
https://discuz.dismall.com/thread-993160-1-1.html

再宣传下我的网站...
http://www.jx4n.com
成天做东西,做到没空去宣传...用了的朋友希望多去支持支持,这样我才有更多的时间来弄一些你们需要的东西.谢谢.

就这样...写帖子真累...

[ 本帖最后由 barracuda 于 2008-7-26 20:33 编辑 ]

评分

3

查看全部评分

 楼主| barracuda 发表于 2008-7-23 10:47:10 | 显示全部楼层
呃...忘记了贴效果了...
这个,那个...反正测试的地方也能看到...自己看吧...

本帖子中包含更多资源

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

x

评分

1

查看全部评分

回复

使用道具 举报

佚辰 发表于 2008-7-23 10:55:26 | 显示全部楼层
哈哈~难得再好插件的帖子里做倒SF,我很需要~谢谢LZ

PS:楼主自己的二楼不叫SF
回复

使用道具 举报

camoro 发表于 2008-7-23 10:57:53 | 显示全部楼层
顶了再看
回复

使用道具 举报

zhenyusen 发表于 2008-7-23 11:02:57 | 显示全部楼层
支持楼主放出
回复

使用道具 举报

67ke 发表于 2008-7-23 11:12:25 | 显示全部楼层
友情帮你顶,修改的东西太多了
回复

使用道具 举报

tanglinkun 发表于 2008-7-23 11:20:16 | 显示全部楼层
好东西  谢谢分享。。。。。。。。。。。。。。
回复

使用道具 举报

 楼主| barracuda 发表于 2008-7-23 12:10:57 | 显示全部楼层
看来需要的人真的不多...
回复

使用道具 举报

67ke 发表于 2008-7-23 13:06:04 | 显示全部楼层
主要修改的东西太多了,不敢使用,真佩服 你的钻研精神(::20::)
回复

使用道具 举报

 楼主| barracuda 发表于 2008-7-23 18:18:10 | 显示全部楼层
原帖由 67ke 于 2008-7-23 13:06 发表
主要修改的东西太多了,不敢使用,真佩服 你的钻研精神(::20::)



我不觉得有多少啊(::22::) (::22::) (::22::) ...也就10来个文件而已,认真修改下最多15分钟搞定...改不好覆盖回备份也快的说...无语...大家都懒了...
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-22 01:25 , Processed in 0.122222 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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