vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Including VB elements into external page, best way to do it ? (https://vborg.vbsupport.ru/showthread.php?t=7930)

Sharg 02-07-2001 08:13 PM

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,

02-07-2001 09:01 PM

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.

02-07-2001 09:07 PM

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,

02-07-2001 10:54 PM

Yes, im really interested in the same think.

02-08-2001 12:25 AM

me too

02-08-2001 09:39 PM

put this code before the <html> tag.
Code:

<?php include("/direct/path/to/global.php") ?>

02-08-2001 10:43 PM

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 :D , but for now its only top 10 posters: :p

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

02-08-2001 11:03 PM

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


All times are GMT. The time now is 03:47 PM.

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.00979 seconds
  • Memory Usage 1,721KB
  • 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_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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