Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-07-2001, 08:13 PM
Sharg Sharg is offline
 
Join Date: Jan 2002
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I will include these vb elements into my site's main page:

-Number of users
-Currently online (just number, not the name)
-Guests currently online
-Total messages
-Last registered member.

How do you do this ? Do you create separate php file for each of these elements and then include them in your php page ?

Of do you set a global value for them all and them include the all the codes right in your page ?

Do you know good threads here that will tell me how to include all these elements ?

Even if all these existing integration 1.x codes will work with 2.0 (as stated) will there be different more efficient way to do it with 2.0 ?

Thanks,
Reply With Quote
  #2  
Old 02-07-2001, 09:01 PM
Guest
 
Posts: n/a
Default

i just put each of the codes in a .php.inc file and then included them on the page. but included global.php on the page i wanted the info to appear so it wouldnt need to be included in all the .php.inc files.
Reply With Quote
  #3  
Old 02-07-2001, 09:07 PM
Guest
 
Posts: n/a
Default

Ok thanks.
Can you tell me here exactly the line you put in your main file to call the global php that will be used for all the little files to include ?

Thanks,
Reply With Quote
  #4  
Old 02-07-2001, 10:54 PM
Guest
 
Posts: n/a
Default

Yes, im really interested in the same think.
Reply With Quote
  #5  
Old 02-08-2001, 12:25 AM
Guest
 
Posts: n/a
Default

me too
Reply With Quote
  #6  
Old 02-08-2001, 09:39 PM
Guest
 
Posts: n/a
Default

put this code before the <html> tag.
Code:
<?php include("/direct/path/to/global.php") ?>
Reply With Quote
  #7  
Old 02-08-2001, 10:43 PM
Guest
 
Posts: n/a
Default

Here is the hack for showing the top posters on a page, im positive it can be edtited to show other things, I'll do that later , but for now its only top 10 posters:

Code:
<?php
require("path/to/global.php");

print("<table><tr><td colspan=\"2\">Top Posters</td></tr>
<tr><td><b>Username</b></td><td><b>Posts</b></td></tr>");

$db_link = @mysql_pconnect("$dbservername", "$dbusername", "$dbpassword");
mysql_select_db ("$dbname", $db_link);

$query = mysql_query("SELECT posts, username FROM user ORDER BY user.posts DESC, user.username DESC LIMIT 0, 10");

while($row = mysql_fetch_array($query))
          {
          $username = $row["username"];
          $posts = $row["posts"];

          print("<tr><td>$username</td><td>$posts</td></tr>");
          }

print("</table>");

?>
You need to rename the page from .HTML (or whatever you have it as) to .PHP or this wont work! If you have SSI elements they may not work in .PHP pages (depending on how you have them set up) so you will need the script im posting later here to fix that.

snyx
Reply With Quote
  #8  
Old 02-08-2001, 11:03 PM
Guest
 
Posts: n/a
Default

<a href="http://www.vbulletin.com/forum/showthread.php?s=&threadid=8017" target="_blank">http://www.vbulletin.com/forum/showt...&threadid=8017</a>
Reply With Quote
Reply


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 11:26 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.06180 seconds
  • Memory Usage 2,206KB
  • 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_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_onlinestatus
  • (8)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