vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Total number of messages on a non vb page (https://vborg.vbsupport.ru/showthread.php?t=36168)

Sharg 03-15-2002 01:05 PM

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,

Sharg 03-18-2002 02:21 PM

C'mon please, two views on this request !!!

Sharg

Logician 03-26-2002 12:06 PM

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.

Sharg 03-26-2002 05:01 PM

{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

Logician 04-03-2002 07:50 AM

Quote:

Originally posted by Sharg
Well this is in fact exactly what I want to do thanks.
Do you know how I could do it ?

Well you have to code the script in PHP. ;)

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. ;)

Sharg 04-03-2002 09:07 AM

Well I think its not a whole script but just a line or two of codes....

Thanks,
Sharg

Logician 04-05-2002 07:30 AM

Quote:

Originally posted by Sharg
Well I think its not a whole script but just a line or two of codes....

Thanks,
Sharg

Every program is just a few lines code but it takes time not to write it down but to "code" it and debug it.

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..


All times are GMT. The time now is 05:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01002 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete