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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-31-2012, 07:11 PM
sakuduku sakuduku is offline
 
Join Date: Apr 2012
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [ASK] vBulletin PHP Code

hi all,

i have a few questions about vbulletin php code,,

what is the php code for :
  • total post
  • total thread
  • total users
  • users online
  • latest threads
  • hot threads

thank

--------------- Added [DATE]1343768558[/DATE] at [TIME]1343768558[/TIME] ---------------

somebody please help me
Reply With Quote
  #2  
Old 07-31-2012, 08:58 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In vbulletin options (settings for vb4) set the SHOW HTML COMMENTS to yes (this will show you which templates are called and closed, then put your forum in to debug mode https://www.vbulletin.com/docs/html/config.php and check what templates are called and look at the code in them!
Reply With Quote
  #3  
Old 05-25-2013, 02:12 PM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I also wanted to know the answers to the original question since vbulletin doesn't provide any support for coding ...
Reply With Quote
  #4  
Old 05-25-2013, 05:06 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The answer remains the same, this is how we all learnt, look at where you want to change something and check the templates called for that area, then investigate the code that looks like it does what you want in that area, when you get stuck post your particular question in these forums and someone who has experience with that will answer
Reply With Quote
2 благодарности(ей) от:
nerbert, tbworld
  #5  
Old 05-25-2013, 05:24 PM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, well said.

The problem is that we have no idea what variables to start with. for example, what variable is use for latest threads, hottest threads, latest replies...

It is easy to modify a custom page, but not really when it comes to variables ...

is there a list of variables that we can play with to get to the start ...?

Thanks
Reply With Quote
  #6  
Old 05-25-2013, 05:41 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Unfortunately theres nio list of variables although this will help http://www.vbulletin.com/docs/html?m...rsion=30807603 and maybe more so this one https://members.vbulletin.com/api/index.html it contains all the api's...etc thats in the vbulletin product.

As i said though, turn on debugging and look at the templates and hooks called, thjat will give you a much better idea.
Reply With Quote
  #7  
Old 05-25-2013, 08:58 PM
nerbert nerbert is offline
 
Join Date: May 2008
Posts: 784
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Make a plugin with this code:

PHP Code:
if($vbulletin->userinfo['username'] == 'Dr. Ben Dover')
{
    echo 
'<pre>';
    
print_r($show);
    echo 
'<br><br><br>';
    
print_r($vbulletin->options);
    echo 
'</pre>';

Put in your real name in the first line, of course.

This will show a lot of settings. Look through the various php files and find other arrays too and print_r them
Reply With Quote
  #8  
Old 05-25-2013, 10:24 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nerbert View Post
Make a plugin with this code:

PHP Code:
if($vbulletin->userinfo['username'] == 'Dr. Ben Dover')
{
    echo 
'<pre>';
    
print_r($show);
    echo 
'<br><br><br>';
    
print_r($vbulletin->options);
    echo 
'</pre>';

Put in your real name in the first line, of course.

This will show a lot of settings. Look through the various php files and find other arrays too and print_r them
Whilst that will show some things it wont be of any use as all it will show is the settings in vbulletin options and their variable name, it wont show any template variables, conditionals or logic, this can only be done by studying the documentation, looking at which templates are called and which php files they belong to then searching those for your particular variables that you think you might use.

Sorry it seems so hard but that really is the only way
Reply With Quote
Благодарность от:
fxdigi-cash
  #9  
Old 05-26-2013, 02:17 AM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, sounds like things are clear. I believe the shortest way is to go through some plugin such as vsa advanced state to break it into pieces and see how to use such codes in a custom page though trial and error tests...

Thanks, I guess that will do.
Reply With Quote
  #10  
Old 05-26-2013, 02:26 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep, study their plugins, it will call a php file, look at that file for the particular section that contains the variable you're looking at. Unfortunately trial and error is the only way to go unless you're a php guru
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 01:16 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.09492 seconds
  • Memory Usage 2,266KB
  • Queries Executed 11 (?)
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_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (3)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (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_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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete