The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#2
|
|||
|
|||
Shows within the last 30 days.
Code:
<? require("global.php"); $foruminfo=$DB_site->query("SELECT forumid, title FROM forum ORDER BY categoryid,displayorder"); while ($forum=$DB_site->fetch_array($foruminfo)) { echo ("<a href=\"forumdisplay.php?forumid=".$forum[forumid]."\">".$forum[title]."</a><br>"); $threadinfo=$DB_site->query_first("SELECT threadid,title,replycount,views FROM thread WHERE forumid=$forum[forumid] and dateline > UNIX_TIMESTAMP(curdate()-30) ORDER BY views DESC LIMIT 1"); echo (" <a href=\"showthread.php?threadid=".$threadinfo[threadid]."\">".htmlspecialchars($threadinfo[title])."</a> [views: ".$threadinfo[views]."] [replies: ".$threadinfo[replycount]."]<br>"); } ?> Demo: http://sitepointforums.com/mostviewed.php If you want to exclude certain forums. i.e. moderator forums, then add a WHERE clause to $foruminfo... For example: WHERE forumid<>1 |
#3
|
|||
|
|||
thanks.. is can be modified to slow the top X or 5 viewed threads per forum ?
forum 1 1. - mostviewedthread - [views: xx] [replies: xx] 2. - 2ndmostviewedthread - [views: xx] [replies: xx] 3. - 3rdmostviewedthread - [views: xx] [replies: xx] 4. - 4thmostviewedthread - [views: xx] [replies: xx] 5. - 5thmostviewedthread - [views: xx] [replies: xx] forum 2 1. - mostviewedthread - [views: xx] [replies: xx] 2. - 2ndmostviewedthread - [views: xx] [replies: xx] 3. - 3rdmostviewedthread - [views: xx] [replies: xx] 4. - 4thmostviewedthread - [views: xx] [replies: xx] 5. - 5thmostviewedthread - [views: xx] [replies: xx] all most forgot where forum is listed in order of diplay on forumhome page thanks [Edited by eva2000 on 01-12-2001 at 09:41 AM] |
#4
|
|||
|
|||
The forums should already be listed in the order they are displayed in forumhome. It orders them by categoryid and then by displayorder to get the same sequence.
Here is the code where you can change the number of threads shown. Just change the LIMIT on the second Query to modify the amount. Code:
<? require("global.php"); $foruminfo=$DB_site->query("SELECT forumid, title FROM forum ORDER BY categoryid,displayorder"); while ($forum=$DB_site->fetch_array($foruminfo)) { echo ("<a href=\"forumdisplay.php?forumid=".$forum[forumid]."\">".$forum[title]."</a><br>"); $threadinfo=$DB_site->query("SELECT threadid,title,replycount,views FROM thread WHERE forumid=$forum[forumid] AND dateline > UNIX_TIMESTAMP(curdate()-30) ORDER BY views DESC LIMIT 5"); while ($thread=$DB_site->fetch_array($threadinfo)) { echo (" <a href=\"showthread.php?threadid=".$thread[threadid]."\">".htmlspecialchars($thread[title])."</a> [views: ".$thread[views]."] [replies: ".$thread[replycount]."]<br>"); } } ?> |
#5
|
|||
|
|||
thanks.. it works perfectly
http://animeboards.net/forums/mostviewed.php although for some reason the last recent forums i added, are old of the sort and display order i have on my forums ? |
#6
|
|||
|
|||
There seems to be a problem with your global.php file...
Warning: Cannot add header information - headers already sent by (output started at /home/animeboa/public_html/forums/mostviewed.php:7) in /home/animeboa/public_html/forums/global.php on line 756 Warning: Cannot add header information - headers already sent by (output started at /home/animeboa/public_html/forums/mostviewed.php:7) in /home/animeboa/public_html/forums/global.php on line 763 |
#7
|
|||
|
|||
btw, this is OT, but i figure its not a *bad* spot to suggest it. my board has a few threads that have over 2^16-1 views, and the counter stops there.
might wanna fix that for v2.0 |
#8
|
|||
|
|||
Quote:
|
#9
|
|||
|
|||
Nice addon but any way i can stop it displying private section posts?
thanks cya trin |
#10
|
|||
|
|||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|