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 08-06-2010, 09:36 PM
BigJohnny's Avatar
BigJohnny BigJohnny is offline
 
Join Date: Jun 2006
Location: Canada
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Making a variable work everywhere

I have a default avatar plugin installed, which allows me to put $avatarnavbits to display a noavatar.gif where I put it.

It seems to work everywhere until just recently when I installed CMPS, it still shows everywhere, except when on the CMPS index. I can put it in if I hard code the url, but I would prefer to just use the variable already created.

the plugin is set to global_start as it's the only hook where it seems to work.

Any ideas how to make it work on CMPS?
Reply With Quote
  #2  
Old 08-09-2010, 12:25 AM
Hell Bomb Hell Bomb is offline
 
Join Date: Jun 2009
Posts: 385
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We need more details, like CMPS and vBulletin number and Link to the mod
Reply With Quote
  #3  
Old 08-09-2010, 02:46 PM
BigJohnny's Avatar
BigJohnny BigJohnny is offline
 
Join Date: Jun 2006
Location: Canada
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

whoops, my bad, I'm running vB 3.8.3, and CMPS 3.2.2

The mod I have no idea about, it's an old one, default avatar, it's just 2 plugins.

One for default avatar, and one for avatar in navbar.

Default Avatar - postbit_display_complete
Code:
if (!$this->post['avatarurl'])
{
$this->post['avatarurl'] = "$stylevar[imgdir_misc]/noavatar.gif";
}
if ($this->registry->userinfo['showavatars']) 
{
$show['avatar'] = true;
}
Avatar In Navbar - global_start
Code:
// Avatar In NavBar
if ($vbulletin->userinfo['avatarid']) 
{ 
	// using a predefined avatar 
	$avatar = $db->query_first("SELECT avatarpath FROM " . TABLE_PREFIX . "avatar WHERE avatarid = " . $vbulletin->userinfo[avatarid] . ""); 
	$avatarid = $avatar['avatarid']; 
	$navbaravatar = "<img src=\"" . $vbulletin->options[bburl] . "/$avatar[avatarpath]\" alt=\"Your Avatar\" border=\"0\" />"; 
} 
else 
{ 
	// not using a predefined avatar, check for custom 
	if ($avatar = $db->query_first("SELECT dateline, userid FROM " . TABLE_PREFIX . "customavatar WHERE userid = " . $vbulletin->userinfo[userid] . "")) 
	{ 
		// using a custom avatar 
		$navbaravatarurl = ($vbulletin->options['usefileavatar']) ? "" . $vbulletin->options[avatarurl] . "/avatar$avatar[userid]_" . $vbulletin->userinfo[avatarrevision] . ".gif" : "" . $vbulletin->options[bburl] . "/image.php?u=" . $vbulletin->userinfo['userid'] . "&amp;dateline=" . $avatar['dateline'] . "";
		$navbaravatar = "<img src=\"$navbaravatarurl\" alt=\"Your Avatar\" border=\"0\" />";
	} 
	else
	{ 
		// no avatar specified 
		$nouseavatarchecked = HTML_CHECKED; 
		$avatarchecked[0] = ''; 
		$navbaravatar = "<img src=\"$stylevar[imgdir_misc]/noavatar.gif\" alt=\"Your Avatar\" border=\"0\" />"; // "<span class=\"smallfont\">No Avatar<br/ >Specified</span>";
	} 
} 
// Avatar In NavBar
Reply With Quote
  #4  
Old 08-12-2010, 02:35 AM
BigJohnny's Avatar
BigJohnny BigJohnny is offline
 
Join Date: Jun 2006
Location: Canada
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?? this can't be that hard.
Reply With Quote
  #5  
Old 08-12-2010, 02:38 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could try going to vBa CMPS -> Default Settings -> Main Options -> Portal Output Global Variables and entering the variable name there.
Reply With Quote
  #6  
Old 08-12-2010, 06:32 PM
BigJohnny's Avatar
BigJohnny BigJohnny is offline
 
Join Date: Jun 2006
Location: Canada
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

buddy, that's awesome, I had no idea you could do that. it seems to be working fine now. and that's definitely something I should know.

Thanks man
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:50 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.03632 seconds
  • Memory Usage 2,207KB
  • 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)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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