vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How Would I pull Information From vBulletin? (https://vborg.vbsupport.ru/showthread.php?t=154021)

Pc 1203 08-01-2007 04:33 PM

How Would I pull Information From vBulletin?
 
Hi All,
I'm wondering how would I pull information from vBulletin? I would like to pull:

Username
Posts
And Some Additional Information

- Pc1203

[EDIT]Sorry, the pages are outside of vBulletin.[/EDIT]

Kirk Y 08-01-2007 06:12 PM

Are you trying to display this information on a page within vBulletin or are you using it outside of vBulletin?

Pc 1203 08-01-2007 06:15 PM

A page outside of vBulletin.

- Pc1203

Kirk Y 08-01-2007 06:25 PM

This might of use to you: https://vborg.vbsupport.ru/showthread.php?t=108026

Pc 1203 08-01-2007 06:31 PM

Well, that really isn't what I wanted. I wanted to pull a users posts into an external page. And, yes I checked, vBExternal doesn't do what I'm thinking of.

- Pc1203

Kirk Y 08-01-2007 06:35 PM

What are you trying to do specifically, because I've used a modified vBExternal in the past to display trimmed posts, with the Author's Username, and date of posting on an external page.

Pc 1203 08-01-2007 06:38 PM

Ok, this is what I'm trying to do. I'm trying to create a small profile system for my website. In it somewhere, it says the users posts, join date, username, and some custom profile fields. Hope this is better.

- Pc1203

Kirk Y 08-01-2007 06:44 PM

Well it's really just a matter of querying the database for the relevant information.

Place the following at the very top of the pages you're displaying information on; make sure they're PHP files as well.

Code:

<?php
chdir('/path/to/forum');
require_once('/path/to/global.php');
?>

Then you're free to use the DB class to retrieve information.

Example:
Code:

$stats = $db->query_read("SELECT threadcount, replycount FROM " . TABLE_PREFIX . "forum");
while ($forum = $db->fetch_array($stats))
{
    $threads += $forum['threadcount'];
    $posts += $forum['replycount'];
}
$threads = vb_number_format($threads);
$posts = vb_number_format($posts);


Pc 1203 08-01-2007 06:46 PM

Ok, Thanks alot!

// I would add rep but I guess it's disabled.

- Pc1203

EDIT: I get a blank page after trying this code:

Code:

<?php
chdir('/home/penguink/public_html/forums');
require_once('/home/penguink/public_html/forums/global.php');
?>
<html>
<head>
</head>
<body>
Test
<?php
$stats = $db->query_read("SELECT threadcount, replycount FROM " . TABLE_PREFIX . "forum");
while ($forum = $db->fetch_array($stats))
{
    $threads += $forum['threadcount'];
    $posts += $forum['replycount'];
}
$threads = vb_number_format($threads);
$posts = vb_number_format($posts);

$stats
?>
</body>
</html>

EDIT2: Uh-Oh. I guess I miss-lead you. I want to display a USERS posts/join date/if online/not, ect. Sorry.

- Pc1203

Pc 1203 08-02-2007 07:55 PM

Bump

- Pc1203


All times are GMT. The time now is 05:57 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.01012 seconds
  • Memory Usage 1,728KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete