Login
Oyunlar  

Avatar Bug on Portal

Re: Avatar Bug on Portal

Postby Yoris on Mon Jun 18, 2007 6:07 pm

does not work..... no it shows "no image" image it user menu... it does not work with firefox 2.x nor with IE 6 and above..... i can see avatars in your portal are not working either.... you have deactivated "upload avatar" option too... big bug here...
www.yorisvirtual.com.ar
Yoris
User avatar
 
Posts: 22
Joined: Thu May 31, 2007 4:54 am
Location: Far, Far away

Re: Avatar Bug on Portal

Postby fiorefrank on Sun Jun 24, 2007 7:42 am

it works with your fix
nice
thanks
fiorefrank
 
Posts: 9
Joined: Sun Jun 24, 2007 7:22 am

Re: Avatar Bug on Portal

Postby spollin on Mon Jun 25, 2007 6:20 pm

stanleyhsieh wrote:This is the image phpbb normally shows on your site (the adress which you can see images)
http://www.yorisvirtual.com.ar/phpbb/do ... 812202.png

While this is the image the portal try accessing.
http://www.yorisvirtual.com.ar/phpbb/im ... 812202.png


this is the problem i have noticed. only seems to effect uploaded avatars. gallery and hotlinked avatars appear correctly. none of the fixes posted in this thread seem to help.
spollin
 
Posts: 20
Joined: Sat Jun 02, 2007 5:55 pm

Re: Avatar Bug on Portal

Postby Yoris on Fri Jun 29, 2007 7:38 pm

there is no future fix for this bug, as angelside doesn´t really apply this phpbb3 function in his forums... i have personally seen he only uses 3rd party avatars for his boards.. so...
this bug is eternall..
i think it would be a good idea to give some support to this project, it seems no one is interested in developing it, as there are a few better portals on the net....
too bad... this looked promissing
www.yorisvirtual.com.ar
Yoris
User avatar
 
Posts: 22
Joined: Thu May 31, 2007 4:54 am
Location: Far, Far away

Re: Avatar Bug on Portal

Postby ozental on Sun Aug 05, 2007 10:47 pm

I think I've managed to work out a fix.

In \bb3portal\block\user_menu.php

REPLACE:

Code: Select all
while ($row = $db->sql_fetchrow($result))
{      
/*
$rank_title = $rank_img = '';
get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src);
*/
   if ($row['user_avatar'] && $user->optionget('viewavatars'))
   {
      $avatar_img = '';
      
      switch ($row['user_avatar_type'])
      {
         case AVATAR_UPLOAD:
            $avatar_img = $config['avatar_path'] . '/';
         break;

         case AVATAR_GALLERY:
            $avatar_img = $config['avatar_gallery_path'] . '/';
         break;
      }
      
      $avatar_img .= $row['user_avatar'];
      $avatar_img = '<img src="' . $avatar_img . '" width="' . $row['user_avatar_width'] . '" height="' . $row['user_avatar_height'] . '" alt="' . $username . '" title="' . $username . '" />';
      $user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : '';         
   }
}
$db->sql_freeresult($result);


WITH:

Code: Select all
while ($row = $db->sql_fetchrow($result))
{      
/*
$rank_title = $rank_img = '';
get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src);
*/
   if ($row['user_avatar'] && $user->optionget('viewavatars'))
   {
      $avatar_img = '';
      
      switch ($row['user_avatar_type'])
      {

//
// Modded by TJW 05 Aug 2007
//

         case AVATAR_UPLOAD:
            $avatar_img = '<img src="./download.php?avatar=' . $row['user_avatar'] . '" width="' . $row['user_avatar_width'] . '" height="' . $row['user_avatar_height'] . '" alt="' . $username . '" title="' . $username . '" />';
         break;

         case AVATAR_GALLERY:
            $avatar_img = '<img src="./' . $config['avatar_gallery_path'] . "/" . $row['user_avatar'] . '" width="' . $row['user_avatar_width'] . '" height="' . $row['user_avatar_height'] . '" alt="' . $username . '" title="' . $username . '" />';
         break;

         case AVATAR_REMOTE:
            $avatar_img = '<img src="' . $row['user_avatar'] . '" width="' . $row['user_avatar_width'] . '" height="' . $row['user_avatar_height'] . '" alt="' . $username . '" title="' . $username . '" />';
         break;

      }
      
      $user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : '';         
   }
}
$db->sql_freeresult($result);

Let me know you guys/gals if it works for you... certainly seems to do for me, whether the avatar is via a gallery, off-site link or uploaded, or nul.
ozental
 
Posts: 8
Joined: Sun Aug 05, 2007 8:59 pm

Re: Avatar Bug on Portal

Postby jruiz on Tue Aug 07, 2007 1:00 pm

Perfect!! (using RC4).


Thanks..
:D
jruiz
 
Posts: 5
Joined: Mon Jul 16, 2007 7:30 pm

Re: Avatar Bug on Portal

Postby ozental on Tue Aug 07, 2007 10:59 pm

jruiz wrote:Perfect!! (using RC4).


Thanks..
:D

Hey man! It's totally my pleasure... I just hope others will benefit too!
ozental
 
Posts: 8
Joined: Sun Aug 05, 2007 8:59 pm

Re: Avatar Bug on Portal

Postby

angelside
on Wed Aug 08, 2007 3:04 pm

No, No, I have very easy way... Use quick function for avatars, ranks, user colors... get_user_avatar(), get_user_rank(), get_username_string().

please see CVS: http://canverportal.cvs.sourceforge.net ... iew=markup


And many codes, like this:

Code: Select all
$sql = 'SELECT *
   FROM ' . USERS_TABLE . '
   WHERE ' . (($username) ? "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'" : "user_id = $user_id");
$result = $db->sql_query($sql);
$member = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
      
$avatar_img = get_user_avatar($member['user_avatar'], $member['user_avatar_type'], $member['user_avatar_width'], $member['user_avatar_height']);

$rank_title = $rank_img = '';
get_user_rank($member['user_rank'], $member['user_posts'], $rank_title, $rank_img, $rank_img_src);



Code: Select all
$username = $member['username'];
$user_id = (int) $member['user_id'];
$colour = $member['user_colour'];

// Assign specific vars
$template->assign_vars(array(
   'USERNAME_FULL'      => get_username_string('full', $user_id, $username, $colour),
   'USERNAME'         => get_username_string('username', $user_id, $username, $colour),
   'USER_COLOR'      => get_username_string('colour', $user_id, $username, $colour),
   'U_VIEW_PROFILE'   => get_username_string('profile', $user_id, $username, $colour),
...
signature
angelside

Developer

User avatar
 
Posts: 226
Joined: Wed May 09, 2007 8:33 pm

Re: Avatar Bug on Portal

Postby khestral on Wed Aug 08, 2007 7:06 pm

are the get_avatar functions already defined in function.php?
You take your chances with a red haired girl
khestral
User avatar
 
Posts: 4
Joined: Tue Jul 31, 2007 7:45 pm
Location: Alabama

Re: Avatar Bug on Portal

Postby

angelside
on Fri Aug 10, 2007 9:48 am

No defined, includes/functions.php

Ahh, sorry; I added this function on portal/includes/functions.php

Code: Select all
/**
* Get user avatar  / barroved from RC3
*
* @param string $avatar Users assigned avatar name
* @param int $avatar_type Type of avatar
* @param string $avatar_width Width of users avatar
* @param string $avatar_height Height of users avatar
* @param string $alt Optional language string for alt tag within image, can be a language key or text
*
* @return string Avatar image
*/
function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR')
{
   global $user, $config, $phpbb_root_path, $phpEx;

   if (empty($avatar) || !$avatar_type)
   {
      return '';
   }

   $avatar_img = '';

   switch ($avatar_type)
   {
      case AVATAR_UPLOAD:
         $avatar_img = $phpbb_root_path . "download.$phpEx?avatar=";
      break;

      case AVATAR_GALLERY:
         $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
      break;
   }

   $avatar_img .= $avatar;
   return '<img src="' . $avatar_img . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
}


/**
* Get user rank title and image / barroved from RC3
*
* @param int $user_rank the current stored users rank id
* @param int $user_posts the users number of posts
* @param string &$rank_title the rank title will be stored here after execution
* @param string &$rank_img the rank image as full img tag is stored here after execution
* @param string &$rank_img_src the rank image source is stored here after execution
*
*/
function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
{
   global $ranks, $config;

   if (empty($ranks))
   {
      global $cache;
      $ranks = $cache->obtain_ranks();
   }

   if (!empty($user_rank))
   {
      $rank_title = (isset($ranks['special'][$user_rank]['rank_title'])) ? $ranks['special'][$user_rank]['rank_title'] : '';
      $rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
      $rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : '';
   }
   else
   {
      if (!empty($ranks['normal']))
      {
         foreach ($ranks['normal'] as $rank)
         {
            if ($user_posts >= $rank['rank_min'])
            {
               $rank_title = $rank['rank_title'];
               $rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
               $rank_img_src = (!empty($rank['rank_image'])) ? $config['ranks_path'] . '/' . $rank['rank_image'] : '';
               break;
            }
         }
      }
   }
}
signature
angelside

Developer

User avatar
 
Posts: 226
Joined: Wed May 09, 2007 8:33 pm

PreviousNext

Return to [1.0.x] Error Reports



Who is online

Users browsing this forum: No registered users



cron