VBulletin HACK
----Display the topic size and open a new window on the Forum index page
Author: gogosoft
"Show topic Size"
Cause: 1.1.4 does not have this feature, and some users will use this as a reference to whether to view the topic.
Advantages: Just add a few lines of code to it.
Disadvantage: Because every time you display the Forum index page, you need to calculate the total size of the topic on the page, so you may have some impact on the server.
Self-evaluation: This is a small function, dispensable, practical or not a matter of opinion.
Steps:
⒈ Open forumdisplay.php, find "
if ($announcement = $DB _site->query_first ("Select Announcementid,userid,startdate,title from Announcement WHERE startdate<= $datenow and enddate>= $datenow and (forumid= $forumid OR forumid=-1) Order by StartDate DESC LIMIT 1 ")) {
", add in the back"
Hack Thread Size
$size = 0;
$announcements = $DB _site->query ("Select Pagetext from announcement WHERE startdate<= $datenow and enddate>=$ Datenow and (forumid= $forumid OR forumid=-1) ");
while ($announce = $DB _site->fetch_array ($announcements)) $size +=strlen ($announce [Pagetext]);
$size =iif ($size >1024,number_format ($size/1024,1). " K ", $size);
End Hack Thread Size
", find"
while ($thread = $DB _site->fetch_array ($threads)) {
", add in the back"
Hack Thread Size
$size = 0;
$posts = $DB _site->query ("Select Pagetext from Post WHERE threadid=". $thread [ThreadID]);
while ($post = $DB _site->fetch_array ($posts)) $size +=strlen ($post [Pagetext]);
$size =iif ($size >1024,number_format ($size/1024,1). " K ", $size);
End Hack Thread Size
", Save the exit;
⒉ opens the Forumdisplay template in Control Panel to find the
<TD Align=center><smallfont color= "{tableheadtextcolor}" ><B> reply </B></smallfont>
</td>
<TD Align=center><smallfont color= "{tableheadtextcolor}" ><B> popularity </B></smallfont>
</td>
", add in the back"
<TD Align=center><smallfont color= "{tableheadtextcolor}" ><B> size </B></smallfont>
</td>
", find"
<TD valign= "Middle" width= "100%" colspan= "7" >
", replace with"
<TD valign= "Middle" width= "100%" colspan= "8" >
Save Open the Forumdisplaybit template to find the
<TD align=center bgcolor= "{Firstaltcolor}" >
<normalfont> $replies </normalfont>
</td>
"Open a new Window"
Reason: This is useful for browsing a frequently updated forum, where users can easily open a wide range of different topics of the window.
Advantage: It's simple, just change the template to achieve it-it doesn't seem to belong to hack. :)
Disadvantage: You can only open a new window on the first page of the topic, and other pages, or hold down shift.
Steps: Control Panel-> Template-> Edit, open forumdisplaybit, find "
<td bgcolor= "{firstaltcolor}" width= "100%" ><normalfont>
$gotonew <a href= "showthread.php?threadid= $threadid" > $threadtitle </a>
", behind or in front of the $gotonew ($gotonew is the" new post "icon) joins"
<a href= "showthread.php?threadid= $threadid" target= "_blank" ></a>
"Of course, you have to prepare a small icon for this connection to open a new window and upload it to the images directory." Complete!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.