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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-22-2004, 02:03 PM
culthero culthero is offline
 
Join Date: Sep 2004
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default global variables?

that's probably a stupid question, but i'm a beginner in modding...
i've just integrated that welcome panel mod and expanded it with the "currently active users" part - it works fine on the forum index, but on the other pages it doesn't show the numbers. i guess those variables need to be set as global somewhere, to be available on all pages? could you explain me how to do this?
the code-bit with those variables is part of the navbar, and the url is http://www.musicportal.org/forum/

Code:
<!-- logged-in users -->
	<td class="alt2" valign="top">
		<a href="online.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="$vbphrase[view_whos_online]" border="0" /></a></td>
	<td class="alt1" style="padding-right:10px">
		<div class="smallfont">
			<strong>$vbphrase[currently_active_users]:</strong> $totalonline<br />(<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)<br />
			<div>$activeusers</div>
			<phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase>
		</div>
	</td>
<!-- end logged-in users -->
Reply With Quote
  #2  
Old 09-22-2004, 05:31 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Questions about modifying vBulletin's default behaviour and asking about modifications in general, should be posted in General vBulletin Questions. Please read the forum descriptions more carefully in future. I've moved your thread there for you

Thanks,
- Dean
Reply With Quote
  #3  
Old 09-23-2004, 11:52 AM
culthero culthero is offline
 
Join Date: Sep 2004
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

at least i found out how to add it to all pages by editing each php-file.
have to fetch the navbar-template in every php-file, and add some more code-lines to each php-file to get the name of the newest member.
but there surely is some file that is automatically included everywhere, so i don't have to modify each file. how can i do that?

would be nice to get an answer...


for the newest member i had to add 'userstats' to the specialtemplates-array, and
Code:
$userstats = unserialize($datastore['userstats']);
$newusername = $userstats['newusername'];
$newuserid = $userstats['newuserid'];
eval('$navbar = "' . fetch_template('navbar') . '";');
Reply With Quote
  #4  
Old 09-24-2004, 03:21 AM
Tekton Tekton is offline
 
Join Date: Jun 2004
Location: Wisconsin
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well you could add something to your php include template, eh?
Reply With Quote
  #5  
Old 09-24-2004, 10:15 AM
culthero culthero is offline
 
Join Date: Sep 2004
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Tekton
Well you could add something to your php include template, eh?
ok, and what exactly shall i add there?
for showthread and forumdisplay it worked to move that codebit i posted above, but $specialtemplates = array('userstats'); or similiar doesn't work in there.
and in other pages except those two nothing works at all.
can't you explain me in more detail what to do, or tell me where to find a guide how to do such things?
thanks.

edit: i now got the online users stuff to work by moving all that logged in users code from index.php to global.php, but the newest member isn't shown anywhere except the index page. any idea what's missing?
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 12:33 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.03419 seconds
  • Memory Usage 2,195KB
  • 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_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • 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