修改方法:
修改文件:source/include/post/post_newthread.php
修改方法:
1、 查找:
- DB::query("INSERT INTO ".DB::table('forum_thread')." (fid, posttableid, readperm, price, typeid, sortid, author, authorid, subject, dateline, lastpost, lastposter, displ
- VALUES ('$_G[fid]', '0', '$readperm', '$price', '$typeid', '$sortid', '$author', '$_G[uid]', '$subject', '$_G[timestamp]', '$_G[timestamp]', '$author', '$display
- $tid = DB::insert_id();
复制代码
2、在这段代码上一行添加代码:
- if ((substr($subject,1,2) != date("m",time())) && (substr($subject,1,1) != date("n",time()))){
- $newdate="[".date("m",time()).".".date("j",time())."]";
- $subject=$newdate.$subject; }
复制代码
修改完成。
ps: 1、此功能可以自动给主题贴标题添加例如[08.29]这样格式的日期标志,美化贴子列表显示,并让会员更容易了解贴子时效。
2、此功能可能会造成贴子标题过长,会自动丢失标题末尾超过长度的字符,请发贴时注意题标长度。
|