View Full Version : NOAVATAR image not showing up
veenuisthebest
03-26-2008, 10:17 AM
hii,
I was quite successful in setting up everything except the noavatar image.
Here is the link (http://www.tech555.com/forums/images/misc/noavatar.gif) to my noavatar image.
It simply does not display, but the users WITH avatars display just fine.
When I checked the source code of the page that supposed to contain the noavatar image link, there was simply no link to any noavatar image.
What could be the problem, where I'm going wrong..The path is absolutely correct !!
Also, if you View My Profile in MENU, you would see the NOAVATAR image, only my vbadvanced page isn't showing it up.
Note:- My cmps_index.php page is renamed portal.php
If you wish, you can login with this test user a/c
Login at: www.tech555.com
Username: test
Password: testing
thankss
bridges
03-26-2008, 10:49 AM
You have the URL set For "No Avatar" Image? In default settings, Welcome Block Options section.
veenuisthebest
03-26-2008, 10:59 AM
oh yes... its already set !! the same link as provided above.. infact its this :-
{$vbulletin->options[bburl]}/images/misc/noavatar.gif
i also changed it to direct URL as above, still doesn't work !!
Brian
03-26-2008, 11:10 AM
There shouldn't be any reason it wouldn't be displayed if you have that option set. Have you perhaps modified your 'adv_portal_welcomeblock_expanded' template at all?
veenuisthebest
03-26-2008, 11:14 AM
yes.. have modified it but not the avatar part ...
veenuisthebest
03-26-2008, 11:15 AM
here are the first few lines of adv_portal_welcomeblock_expanded:-
<tr>
<td class="$bgclass">
<if condition="!$show['guest']">
<if condition="$avatarurl">
<a href="$vboptions[bburl]/profile.php?$session[sessionurl]do=editavatar"><img src="$avatarurl" border="0" alt="$vbphrase[edit_avatar]" /></a>
</td>
<td class="$altbgclass" valign="top" width="100%">
</if>
veenuisthebest
03-26-2008, 11:18 AM
and I have this set in URL For "No Avatar" Image:-
{$vbulletin->options[bburl]}/images/misc/noavatar.gif
I even tried:-
http://www.tech555.com/forums/images/misc/noavatar.gif still no good..
Brian
03-26-2008, 11:51 AM
There's not really anything else I can think of that would prevent the image from being displayed, but if you would like to submit a support ticket via the Members' Area here I'll be glad to take a look at things for you.
veenuisthebest
03-26-2008, 02:40 PM
Hello sir,
A strange thing happened.. I was just creating a temp. admin a/c and was about to submit the ticket. Then, I noticed that the noavatar.gif displayed fine for the new admin a/c.
Actually, it was all an issue of "Can Upload Custom Avatars" setting in Registered Usergroups.
I initially had it disabled, but when I enabled it, it showed up the noavatar.gif for registered usergroup too..
BUT I do not want to allow custom avatars instead let users choose from predefined avatars, is there a way to keep it disabled and still show up noavatar.gif ??
Thanks in advance.. !!
Brian
03-27-2008, 11:55 AM
Ahhh, now I see how that's happening. Looks like there needs to be an additional check that can display the "no avatar" image for those who do not have permission to upload avatars. If you'll look in your modules/welcomeblock.php file for this code:
$lastvisitdate = vbdate($mod_options['portal_welcome_lastvisit_date'], $vbulletin->userinfo['lastvisit'], '', '');
And add this just Above it:
else if ($vbulletin->options['avatarenabled'])
{
eval('$mod_options[\'portal_noavatarurl\'] = "' . addslashes($mod_options['portal_noavatarurl']) . '";');
$avatarurl = $mod_options['portal_noavatarurl'];
}
Then that should take care of the problem.
veenuisthebest
03-28-2008, 08:27 AM
hello sir,
I did what you said, but it still doesnt work !! I disabled "Can upload custom avatars" setting for a specific usergroup, then modified the code for welcomeblock.php. This is how it looks now:-
<?php
if (!$show['guest'])
{
$mods['title'] = $vbphrase['user_cp'];
$mods['formcode'] = '';
// Avatar
if ($mod_options['portal_welcome_avatar']
AND $vbulletin->userinfo['showavatars']
AND ($vbulletin->userinfo['avatarid']
OR ($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canuseavatar'])
OR $vbulletin->userinfo['adminavatar']
)
)
{
require_once(DIR . '/includes/functions_user.php');
$avatarurl = fetch_avatar_url($vbulletin->userinfo['userid']);
if ($avatarurl[0])
{
$avatarurl = $vbulletin->options['bburl'] . '/' . $avatarurl[0];
}
else if ($mod_options['portal_noavatarurl'])
{
eval('$mod_options[\'portal_noavatarurl\'] = "' . addslashes($mod_options['portal_noavatarurl']) . '";');
$avatarurl = $mod_options['portal_noavatarurl'];
}
}
else if ($vbulletin->options['avatarenabled'])
{
eval('$mod_options[\'portal_noavatarurl\'] = "' . addslashes($mod_options['portal_noavatarurl']) . '";');
}
$lastvisitdate = vbdate($mod_options['portal_welcome_lastvisit_date'], $vbulletin->userinfo['lastvisit'], '', '');
$lastvisittime = vbdate($mod_options['portal_welcome_lastvisit_time'], $vbulletin->userinfo['lastvisit'], '', '');
// Reputation
if ($mod_options['portal_welcome_rep'])
{
require_once(DIR . '/includes/functions_reputation.php');
fetch_reputation_image($vbulletin->userinfo, $permissions);
$reppower = vb_number_format(fetch_reppower($vbulletin->userinfo, $permissions));
}
if ($mod_options['portal_welcome_rank'])
{
$vbulletin->userinfo['rank'] = str_replace('src="', 'src="' . $vbulletin->options['bburl'] . '/', $vbulletin->userinfo['rank']);
}
// New posts
if ($mod_options['portal_welcome_newposts'])
{
if (strlen($vbulletin->session->vars['newposts']) > 0 AND !$vbulletin->options['threadmarking'])
{
$newposts = number_format($vbulletin->session->vars['newposts']);
}
else
{
$getnewposts = $db->query_first("
SELECT COUNT(*) AS count
FROM " . TABLE_PREFIX . "post AS post
" . iif($vbulletin->options['threadmarking'],
'LEFT JOIN ' . TABLE_PREFIX . 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' . $vbulletin->userinfo['userid'] . ')') . "
WHERE dateline >= " . $vbulletin->userinfo['lastvisit'] .
iif($vbulletin->options['threadmarking'],
' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)') . "
AND visible = 1
");
if (!$vbulletin->options['threadmarking'])
{
$db->query_write("UPDATE " . TABLE_PREFIX . "session SET newposts = '$getnewposts[count]' WHERE userid = " . $vbulletin->userinfo['userid']);
}
$newposts = vb_number_format($getnewposts['count']);
}
}
$vbulletin->userinfo['pmtotal'] = vb_number_format($vbulletin->userinfo['pmtotal']);
$permissions['pmquota'] = vb_number_format($permissions['pmquota']);
$vbulletin->userinfo['pmunread'] = vb_number_format($vbulletin->userinfo['pmunread']);
}
else
{
$mods['title'] = $vbphrase['log_in'];
$mods['link'] = '';
}
$welcome_tempname = ($mod_options['portal_welcome_expanded'] == 1 OR ($mod_options['portal_welcome_expanded'] == 2 AND $vba_colwidths[$vba_modcols[$modcol]] >= 300)) ? 'expanded' : 'lean';
($hook = vBulletinHook::fetch_hook('vba_cmps_module_welcomeblock')) ? eval($hook) : false;
eval('$home["$mods[modid]"][\'content\'] = "' . fetch_template('adv_portal_welcomeblock_' . $welcome_tempname) . '";');
?>
Brian
03-28-2008, 12:47 PM
Bleh, sorry about that. Looks like I missed a line in the code. Try this instead:
<?php
if (!$show['guest'])
{
$mods['title'] = $vbphrase['user_cp'];
$mods['formcode'] = '';
// Avatar
if ($mod_options['portal_welcome_avatar']
AND $vbulletin->userinfo['showavatars']
AND ($vbulletin->userinfo['avatarid']
OR ($vbulletin->userinfo['permissions']['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canuseavatar'])
OR $vbulletin->userinfo['adminavatar']
)
)
{
require_once(DIR . '/includes/functions_user.php');
$avatarurl = fetch_avatar_url($vbulletin->userinfo['userid']);
if ($avatarurl[0])
{
$avatarurl = $vbulletin->options['bburl'] . '/' . $avatarurl[0];
}
else if ($mod_options['portal_noavatarurl'])
{
eval('$mod_options[\'portal_noavatarurl\'] = "' . addslashes($mod_options['portal_noavatarurl']) . '";');
$avatarurl = $mod_options['portal_noavatarurl'];
}
}
else if ($vbulletin->options['avatarenabled'])
{
eval('$mod_options[\'portal_noavatarurl\'] = "' . addslashes($mod_options['portal_noavatarurl']) . '";');
$avatarurl = $mod_options['portal_noavatarurl'];
}
$lastvisitdate = vbdate($mod_options['portal_welcome_lastvisit_date'], $vbulletin->userinfo['lastvisit'], '', '');
$lastvisittime = vbdate($mod_options['portal_welcome_lastvisit_time'], $vbulletin->userinfo['lastvisit'], '', '');
// Reputation
if ($mod_options['portal_welcome_rep'])
{
require_once(DIR . '/includes/functions_reputation.php');
fetch_reputation_image($vbulletin->userinfo, $permissions);
$reppower = vb_number_format(fetch_reppower($vbulletin->userinfo, $permissions));
}
if ($mod_options['portal_welcome_rank'])
{
$vbulletin->userinfo['rank'] = str_replace('src="', 'src="' . $vbulletin->options['bburl'] . '/', $vbulletin->userinfo['rank']);
}
// New posts
if ($mod_options['portal_welcome_newposts'])
{
if (strlen($vbulletin->session->vars['newposts']) > 0 AND !$vbulletin->options['threadmarking'])
{
$newposts = number_format($vbulletin->session->vars['newposts']);
}
else
{
$getnewposts = $db->query_first("
SELECT COUNT(*) AS count
FROM " . TABLE_PREFIX . "post AS post
" . iif($vbulletin->options['threadmarking'],
'LEFT JOIN ' . TABLE_PREFIX . 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' . $vbulletin->userinfo['userid'] . ')') . "
WHERE dateline >= " . $vbulletin->userinfo['lastvisit'] .
iif($vbulletin->options['threadmarking'],
' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)') . "
AND visible = 1
");
if (!$vbulletin->options['threadmarking'])
{
$db->query_write("UPDATE " . TABLE_PREFIX . "session SET newposts = '$getnewposts[count]' WHERE userid = " . $vbulletin->userinfo['userid']);
}
$newposts = vb_number_format($getnewposts['count']);
}
}
$vbulletin->userinfo['pmtotal'] = vb_number_format($vbulletin->userinfo['pmtotal']);
$permissions['pmquota'] = vb_number_format($permissions['pmquota']);
$vbulletin->userinfo['pmunread'] = vb_number_format($vbulletin->userinfo['pmunread']);
}
else
{
$mods['title'] = $vbphrase['log_in'];
$mods['link'] = '';
}
$welcome_tempname = ($mod_options['portal_welcome_expanded'] == 1 OR ($mod_options['portal_welcome_expanded'] == 2 AND $vba_colwidths[$vba_modcols[$modcol]] >= 300)) ? 'expanded' : 'lean';
($hook = vBulletinHook::fetch_hook('vba_cmps_module_welcomeblock')) ? eval($hook) : false;
eval('$home["$mods[modid]"][\'content\'] = "' . fetch_template('adv_portal_welcomeblock_' . $welcome_tempname) . '";');
?>
veenuisthebest
03-28-2008, 12:59 PM
its perfect now .....
thanks a lot !!
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.