VBulletinHACK ---- display the topic size and open a new window on the forum index page

Source: Internet
Author: User
VBulletinHACK-show the topic size and open a new window on the forum index page by gogosoft

VBulletin HACK
---- Display the topic size and open a new window on the forum index page
By gogosoft

Show topic size
Cause: This feature is not available in version 1.1.4, and some users use this feature as a reference for viewing topics.
Advantage: you only need to add a few lines of code.
Disadvantage: each time a Forum Index page is displayed, the topic size of the page must be calculated, which may affect the server.
Self-evaluation: this is a small function that is dispensable and practical.

Steps:
Then open forumdisplay. php and 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"
// 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/, 1). "K", $ size );
// End Hack thread size
", Find"
While ($ thread = $ DB_site-> fetch_array ($ threads )){
", Add"
// 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/, 1). "K", $ size );
// End Hack thread size
", Save and exit;

In control panel, open the forumdisplay template and find
Reply

Popularity

", Add"
Size

", Find"

", Replace with"

"Save. Open the forumdisplaybit template and find"

$ Replies



$ Views

", Add"

$ Size

", Open the forumdisplay_announcement template and find"

-



-

", Add"

$ Size

", Save. Done!


Open new window
Cause: this is very useful for browsing a frequently updated forum. you can easily open a window for many different topics.
Advantage: it is very simple. you only need to modify the template to implement it-it seems that it is not too HACK. :)
Disadvantage: you can only open a new window on the first page of the topic, while you still need to hold down Shift on other pages.

Step: Control Panel-> Template-> Edit, open forumdisplaybit and find"

$ Gotonew $ threadtitle
", Add" after or before $ gotonew ($ gotonew is the "new post" icon)

", Of course, you have to prepare a small icon for the connection to open a new window and upload it to the images directory. Done!

Example: http://gogosoft.oso.com.cn/forum/forumdisplay.php? Forumid = 4


[This article is copyrighted by the author and osuo. if you need to reprint it, please indicate the author and its source]

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.