Bulletin VBulletin HACK----Show topic size and open new Window on Forum index page

Source: Internet
Author: User
Tags vbulletin
VBulletin HACK
----Show topic size and open new Window on Forum index page
Author: gogosoft
"Show topic Size"
Reason: 1.1. This feature is not available in version 4, and some users use it as a reference for viewing the topic.
Pros: Just add a few lines of code to it.
Cons: Because each time a forum index page is displayed, all of the topics on the page need to be sized, which can have a number of effects on the server.
Self-Assessment: 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 later"
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 later"
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;
⒉ Open the Forumdisplay template in Control Panel and look for "
reply

popularity

", add in later"
size

", find"

", replace with"

Save Open the Forumdisplaybit template and look for "

$replies


$views

", add in later"

$size

", open the forumdisplay_announcement template, look for"

-


-

", add in later"

$size

", save. Complete!
"Open new Window"
Why: This is useful for browsing a frequently updated forum where users can easily open up a lot of different topics.
Pros: Very simple, just need to change the template to achieve-it seems to be not too hack. :)
Cons: You can only open a new window on the first page of the topic, and the other pages, or hold down shift.
Step: Edit the template, Control Panel, open Forumdisplaybit, find "

$gotonew $threadtitle
", add"

"after $gotonew ($gotonew is the" new post "icon), of course, you have to open a new window for this The connection prepares a small icon and uploads it to the images directory. Complete!
Example: http://gogosoft.oso.com.cn/forum/forumdisplay.php?forumid=4
"This article is owned by the author and the house Orso near network, if you want to reprint, please specify the author and source"

The above describes the Bulletin VBulletin HACK----Display the topic size and open a new window on the Forum index page, including bulletin content, and hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.