Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 03-15-2002, 01:05 PM
Sharg Sharg is offline
 
Join Date: Jan 2002
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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,
Reply With Quote
  #2  
Old 03-18-2002, 02:21 PM
Sharg Sharg is offline
 
Join Date: Jan 2002
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Sharg
Reply With Quote
  #3  
Old 03-26-2002, 12:06 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 03-26-2002, 05:01 PM
Sharg Sharg is offline
 
Join Date: Jan 2002
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

{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
Reply With Quote
  #5  
Old 04-03-2002, 07:50 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 04-03-2002, 09:07 AM
Sharg Sharg is offline
 
Join Date: Jan 2002
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thanks,
Sharg
Reply With Quote
  #7  
Old 04-05-2002, 07:30 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:50 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04248 seconds
  • Memory Usage 2,219KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete