The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Comments |
#62
|
|||
|
|||
This took a little figgerin' so I thought I'd post it so others wouldn't have to. This snippet is for non-VB pages, it will show the thread posted within the last 24 hours that has the most views.
If you change $daysback to something else, you can pull from the last week, etc. Code:
require("/full/path/to/admin/config.php"); $db=mysql_connect($servername,$dbusername,$dbpassword); mysql_select_db($dbname); $daysback=1; $datecut=time()-($daysback * 86400); $query = "SELECT threadid,title,views,dateline FROM thread WHERE dateline > '".$datecut."' ORDER BY views DESC LIMIT 1"; $resultlatest = mysql_query($query,$db_connection); $latest_array = mysql_fetch_array($resultlatest); $mvtitle = $latest_array[title]; $mvid = $latest_array[threadid]; |
#63
|
|||
|
|||
Oh yea.. I also run this piece of code on any thread title I pull-- if it's too long it will truncate it and add ...
Code:
if (strlen($latest_array["title"]) > 40) { $mvtitle = substr($latest_array["title"],0,37) . "..."; } |
#64
|
|||
|
|||
Hi,
I'm sorry to bring this up now, but I need help. I want to display the ten latest topics on mymessage boards automatically. I read many of the above posts and didn't find exactly what I'm looking for, that's why I'm posting here. I have little knowledge of PHP and MySQL, so don't confuse me too much. I want to exclude posts from a few boards and I just wanted to list them on my main page. It is my assumption that if I use a PHP code, I can modify my .htaccess file to read the PHP on my main page and make it not require the .shtml extension to be changed to .php3. Any help would be appreciated. |
#65
|
|||
|
|||
Quote:
Code:
AddType application/x-httpd-php3 .shtml Script for Active topics, anumber of people have worked on this including Dark_Wizard. BTW... Has anyone added vB templates to this script, if so could you share or tell me how to do it. Code:
<? require("config.php"); // number of active topics to show $num_active = 5; // number of pagetext characters to show $num_chars = 70; $db=mysql_connect($servername,$dbusername,$dbpassword); mysql_select_db($dbname); // Remove the forums you don't want listed $querylatest="select * from thread where forumid='1' or forumid='2' or forumid='3' or forumid='4' or forumid='5' or forumid='6' or forumid='7' or forumid='8' or forumid='10' or forumid='11' or forumid='12' or forumid='13' or forumid='14' or forumid='15' or forumid='16' or forumid='17' or forumid='18' or forumid='19' or forumid='20' or forumid='22' or forumid='23' or forumid='25' or forumid='26' or forumid='27' or forumid='28' or forumid='29' or forumid='30' or forumid='31' or forumid='32' or forumid='34' or forumid='35' or forumid='36' or forumid='37' or forumid='38' order by lastpost desc limit $num_active"; $resultlatest = mysql_query($querylatest,$db); print("<center><table width=\"100%%\" cellspacing=\"0\" cellpadding=\"2\">"); while ($latest_array = mysql_fetch_array($resultlatest)) { // Get Forum Infomation $query_forum = "select * from forum where forumid='$latest_array[forumid]'"; $result_forum = mysql_query($query_forum,$db); $forum_info_array = mysql_fetch_array($result_forum); // split the date up a bit $datestr1 = substr($latest_array["dateline"],0,10); $datetime = substr($latest_array["dateline"],11,8); printf("<tr><td align=\"left\"><b><font color=\"#FFFFCC\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">%s: %s</font></b></td></tr>",$forum_info_array["title"],$latest_array["title"]); $querythread="select * from post where threadid='$latest_array[threadid]' order by dateline asc limit 1"; $result_thread_text= mysql_query($querythread,$db); $result_thread_array = mysql_fetch_array($result_thread_text); printf ("<td width=\"100%%\"><font color=\"#FFCC66\" face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><img src=\"images/icons/icon%s.gif\"> Started By: %s Last Post By: %s<br><font color=\"#FFFFFF\">%s...<a href=\"showthread.php?threadid=%s\"> (Click here for more)</font></a><hr color=\"#003366\"></td></tr>",$result_thread_array["iconid"],$latest_array["postusername"],$latest_array["lastposter"],substr(strip_tags($result_thread_array["pagetext"]),0,$num_chars),$latest_array["threadid"]); printf ("<tr><td width=\"100%%\"> </td></tr>"); } printf ("</table></center>"); ?> |
#66
|
|||
|
|||
Is there a way to use an SSI to include this script? Does it have to be called with a php include?
|
#67
|
|||
|
|||
Can anyone post the code for displaying currently logged on members in a non-vb page?
Thanks a lot, Jeff Croft newBeetle.org |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|