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 08-01-2007, 04:33 PM
Pc 1203 Pc 1203 is offline
 
Join Date: May 2007
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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]
Reply With Quote
  #2  
Old 08-01-2007, 06:12 PM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you trying to display this information on a page within vBulletin or are you using it outside of vBulletin?
Reply With Quote
  #3  
Old 08-01-2007, 06:15 PM
Pc 1203 Pc 1203 is offline
 
Join Date: May 2007
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A page outside of vBulletin.

- Pc1203
Reply With Quote
  #4  
Old 08-01-2007, 06:25 PM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This might of use to you: https://vborg.vbsupport.ru/showthread.php?t=108026
Reply With Quote
  #5  
Old 08-01-2007, 06:31 PM
Pc 1203 Pc 1203 is offline
 
Join Date: May 2007
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 08-01-2007, 06:35 PM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 08-01-2007, 06:38 PM
Pc 1203 Pc 1203 is offline
 
Join Date: May 2007
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 08-01-2007, 06:44 PM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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);
Reply With Quote
  #9  
Old 08-01-2007, 06:46 PM
Pc 1203 Pc 1203 is offline
 
Join Date: May 2007
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #10  
Old 08-02-2007, 07:55 PM
Pc 1203 Pc 1203 is offline
 
Join Date: May 2007
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump

- Pc1203
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 06:31 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.06242 seconds
  • Memory Usage 2,249KB
  • 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
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete