View Full Version : Making a variable work everywhere
BigJohnny
08-06-2010, 09:36 PM
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?
Hell Bomb
08-09-2010, 12:25 AM
We need more details, like CMPS and vBulletin number and Link to the mod
BigJohnny
08-09-2010, 02:46 PM
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
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
// 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'] . "&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
BigJohnny
08-12-2010, 02:35 AM
anyone?? this can't be that hard.
You could try going to vBa CMPS -> Default Settings -> Main Options -> Portal Output Global Variables and entering the variable name there.
BigJohnny
08-12-2010, 06:32 PM
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
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.