Home php教程 php手册 vBulletin HACK----显示话题大小和打开新窗口于论坛索引页

vBulletin HACK----显示话题大小和打开新窗口于论坛索引页

Jun 13, 2016 pm 12:37 PM
vbulletin big Open new window show window index forum

vBulletin HACK
----显示话题大小和打开新窗口于论坛索引页
作者:gogosoft

《显示话题大小》
原因:1.1.4版本中没有此功能,而部分用户会以此作为是否查看话题的参考因素。
优点:只需要增加几行代码就可以。
缺点:因为每次显示论坛索引页都需要对该页的话题全部计算大小,所以可能会对服务器造成若干的影响。
自评:这是一个小功能,可有可无,实用与否见仁见智。

步骤:
⒈打开 forumdisplay.php ,查找“
if ($announcement=$DB_site->query_first("SELECT announcementid,userid,startdate,title FROM announcement WHERE startdate=$datenow AND (forumid=$forumid OR forumid=-1) ORDER BY startdate DESC LIMIT 1")) {
”,在后面加入“
  // Hack thread size
  $size=0;
  $announcements=$DB_site->query("SELECT pagetext FROM announcement WHERE startdate=$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
”,查找“
while ($thread=$DB_site->fetch_array($threads)) {
”,在后面加入“
  // 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
”,保存退出;

⒉在《控制面板》打开 forumdisplay 模板,查找“

回复

人气

”,在后面加入“
大小

”,查找“

”,替换为“

”保存。打开 forumdisplaybit 模板,查找“

$replies



$views

”,在后面加入“

$size

”,打开 forumdisplay_announcement 模板,查找“

-



-

”,在后面加入“

$size

”,保存。完成!


《打开新窗口》
原因:这对于浏览一个经常更新的论坛来说,是很有用的,用户可以很简单地就打开了很多不同话题的窗口。
优点:很简单,只需要改动模板就实现了——好象也不是太属于HACK。:)
缺点:只能对话题的第一页打开新的窗口,而其它页,还是要按住Shift。

步骤:控制面板->模板->编辑,打开 forumdisplaybit ,查找“

$gotonew $threadtitle
”,在 $gotonew 后面或前面($gotonew 是那个“有新帖子”的图标)加入“
vBulletin HACK----显示话题大小和打开新窗口于论坛索引页
”,当然了,你得为这个打开新窗口的连接准备一个小图标,并上载到 images 目录下。完成!

范例:http://gogosoft.oso.com.cn/forum/forumdisplay.php?forumid=4


【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】    


Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to open iso file on mobile phone How to open iso file on mobile phone Feb 24, 2024 pm 05:33 PM

With the development of technology, more and more people are now starting to use ISO files. An ISO file is a format of a disc file that usually contains all the contents of the disc, including operating system, software, games, etc. Opening an ISO file on your computer is relatively simple, just use virtual optical drive software. However, when we want to open ISO files on our mobile phones, it may be more troublesome. Well, this article will introduce some methods for you to easily open ISO files on your phone. 1. Using the virtual optical drive application First, we can install

How to set Google Chrome to open a new window every time How to set Google Chrome to open a new window every time Mar 06, 2024 pm 06:19 PM

How to set Google Chrome to open a new window every time? Vicious users like to use Google Chrome for work or study. This browser is safe, fast, and convenient. Different users have different preferences for using browsers. Some users like to open Google Chrome as a new window to facilitate quick searches. , so how to set it up. Next, the editor will bring you a tutorial on setting up a new window every time you open Google Chrome. Friends who are interested can come and learn it. Tutorial on setting up a new window every time Google Chrome opens 1. Double-click Google Chrome on your computer desktop to open it, then click on the [three dots] icon in the upper right corner. 2. Find the [Settings] option and enter the page (as shown in the picture). 3. Go to Google Chrome

How to open torrent files How to open torrent files Feb 24, 2024 pm 05:20 PM

Torrent seed files can be opened with software, so what software can be used to open them? Users need to open it with download tools such as Thunder, BitComet, qBittorrent, etc., and then download. This introduction to how to open torrent files can tell you the specific content. The following is a detailed introduction, take a look! How to open a torrent seed file? Answer: Use Thunder, BitComet, qBittorrent and other download tools to open it. Detailed introduction: 1. Torrent is a BT seed file that can be opened with various download software. 2. The more people download this software, the faster the download speed will be. 3. In order to ensure accuracy, the software will calculate Ha every time it downloads a block.

Where can I open the Douyin mini game? Two ways to open Douyin mini games Where can I open the Douyin mini game? Two ways to open Douyin mini games Mar 15, 2024 am 09:30 AM

Douyin is a popular short video social application. Users can not only watch and share various types of short video content, but also provide a series of mini games for you to play. So where can I get into Douyin mini-games? Where is the entrance to Douyin mini game? Let’s take a look at the detailed tutorial below. Method 1: Open the mini program 1. Click the My option. After entering the homepage of Douyin, click the My option to enter. 2. Click the three horizontal lines. After entering the My interface, click the three horizontal lines button above. 3. Click on the mini program. After opening the three horizontal lines option, click on the mini program inside. 4. Click on the Douyin Mini Game. After entering the mini program interface, click on the Douyin Mini Game option to open it. Method 2: Search and open 1. Click the magnifying glass to enter

How to open caj file How to open caj file on computer How to open caj file How to open caj file on computer Feb 22, 2024 pm 04:37 PM

Select the file in the word converter and click Start Conversion to open it. Analysis 1. Open the CAJ to Word converter and select CAJ to Word on the left side of the software. 2Then select the file you want to convert and click Open. 3Finally, click Start Conversion and you can open the caj file in Word. Supplement: What is the format of caj? 1CAJ is a format of electronic journals. You can use the CAJ full-text browser to read. Supports CAJ, NH, KDH and PDF format files of China Journal Network. You can read the original text of China Journal Network online, or you can read the full text of China Journal Network downloaded to your local hard drive. Its printing effect can be consistent with the original display. Summary/Notes CAJ is a Chinese academic journal

How to open WeChat while writing and translating How to open WeChat while writing and translating Feb 24, 2024 pm 02:55 PM

There is a function in WeChat that allows you to translate while writing, so how do you enable the function of translating while writing? Users need to press and hold the input method, click to translate while writing, and then enter other languages ​​to translate. This article is written and translated at the same time. The opening method introduction can tell you the specific operation method. The following is a detailed introduction, hurry up and take a look! WeChat usage tutorial How to open WeChat Translate while writing? Answer: Long press the chat box, click Translate while writing to open this function. Specific methods: 1. Click on a chat interface, long press in the input box, click Write while translating Translated. 2. Then enter Chinese and it will be automatically translated into English. 3. Click the a icon on the left to switch to other languages.

Discuz Forum Permission Management: Read Permission Setting Guide Discuz Forum Permission Management: Read Permission Setting Guide Mar 10, 2024 pm 05:33 PM

Discuz forum permission management: Read the permission setting guide In Discuz forum management, permission setting is a crucial part. Among them, the setting of reading permissions is particularly important, as it determines the scope of content that different users can see in the forum. This article will introduce in detail the reading permission settings of the Discuz forum and how to flexibly configure it for different needs. 1. Basic concepts of reading permissions In the Discuz forum, reading permissions mainly include the following concepts that need to be understood: Default reading permissions: Default after new user registration

How to open Minesweeper? -How to mark small flags in Minesweeper? How to open Minesweeper? -How to mark small flags in Minesweeper? Mar 18, 2024 pm 10:46 PM

How to open Minesweeper? Minesweeper is a classic single-player game in which the player's goal is to uncover numbers within squares in order to determine which squares contain mines. If the revealed square contains no mines, the game will continue; if the revealed square contains mines, the game will end immediately. Next, we will introduce in detail how to enter the Minesweeper game. Step 1: Turn on the computer First, you need to turn on the computer. Minesweeper is a computer game that can only be played on a computer. If you haven't turned on the computer yet, press and hold the power button until the computer turns on and displays the desktop. Step 2: Find the Minesweeper game. Look for the Minesweeper game icon on the desktop. If Minesweeper is already installed, it should appear on the desktop. If not, search for Minesweeper game in your computer's start menu

See all articles