The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Total number of messages on a non vb page
Hi, i'm looking for a way to include ONLY the total number of messages on a non vb page.
If you know how, please tell me or maybe you could redirect me to a hack that already does it. (I couldn't find one). Thanks, |
#2
|
|||
|
|||
C'mon please, two views on this request !!!
Sharg |
#3
|
||||
|
||||
You can do that with WebTemplate Hack if you create a WebQuery for this. (Check my sig.)
If you need a simple solution (and non-hack solution), you have to create your non-vb page in PHP and then add a SQL query to count db messages and post it in the relevant part of your page. This will be no hack, just another script which makes queries in your vb. db. |
#4
|
|||
|
|||
{quote]If you need a simple solution (and non-hack solution), you have to create your non-vb page in PHP and then add a SQL query to count db messages and post it in the relevant part of your page. This will be no hack, just another script which makes queries in your vb. db.
[/quote] Well this is in fact exactly what I want to do thanks. Do you know how I could do it ? Thanks, Sharg |
#5
|
||||
|
||||
Quote:
If you need help in a certain part just ask, but besides writing the whole script for you how can someone help you else? :knockedout: This is the best part of using a hack. You dont need to code it yourself, someelse already coded for you. |
#6
|
|||
|
|||
Well I think its not a whole script but just a line or two of codes....
Thanks, Sharg |
#7
|
||||
|
||||
Quote:
Anyway I dont like people leaving unanswered so here you go -- cut -- <table width="100%" border="0" cellspacing="1" cellpadding="00"> <?php ## Hostname or IP of your server where MYSQL database resides. $servername='localhost'; ## Username and password to log onto your MYSQL database server $dbusername='aaaa'; //MYSQL username $dbpassword='pppp'; //MYSQL password ## Name of the MYSQL database that vbulletin data exits. $dbname='dddd'; ## Location of your forum. Dont forget the trailing / $forumlocation="http://www.yourdomain.com/forum/"; mysql_connect("$servername", "$dbusername", "$dbpassword") or die("Couldnt find MYSQL!"); mysql_select_db("$dbname") or die ("Couldnt find DB!"); $cekilen_mesleki=mysql_query(" select threadid, title, postusername, postuserid, dateline from thread WHERE visible= '1' AND forumid='15' order by dateline DESC LIMIT 10 "); if (mysql_error()) {echo "mySQL error:"; echo mysql_error(); exit;} $mesleki_number=mysql_numrows($cekilen_mesleki); //number of news fetched if ($mesleki_number<=0) {echo "<tr><td bgcolor=\"#000000\">No New Threads!</td></tr>";}//no news on database! else { $ii=1; while ($gelen= mysql_fetch_row($cekilen_mesleki)) { if ($ii % 2) {$tdcolor="#FFFFFF";} else {$tdcolor="#eeeeee";} echo '<td><td bgcolor="'.$tdcolor.'">'.date("Y-m-d", $gelen[4]).' : <a href="'.$forumlocation.'showthread.php?s=&threadid ='.$gelen[0].'">'.$gelen[1]."</a> - ".$gelen[2]."</td></tr>"; $ii++; } } //else kapa parantez ?> </table> -- cut -- This is a sample which gets latest 10 threads of a specific forum and list it in a table. By changing the query you can list/get any result you want.. Enjoy.. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|