You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 37 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Help with ldisplaying avatar in header [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
implodeme
Nuke Soldier
Nuke Soldier


Joined: Apr 23, 2003
Posts: 13


PostPosted: Sun Jul 13, 2003 9:31 pm Reply with quoteBack to top

creating a new theme and need some help displaying
the anonymous / user avatar in the header of the site.
Not sure how to code it. I have looked at some similar code
within the forums, but it seems to call variables differently.

Can anyone help me get started, pointed in the right direction?
Is this process similar to coding the avatar in Blocks?

Test site / Theme is located @ http://pdx.jenncargile.com

If you look at it, you will notice a pasty green box in the
header, this is where I want the avatar to go.

Side note: How do you like my first theme?
still working on the forum part.

_________________
~Implosion at it's best!
Find all posts by implodemeView user's profileSend private messageSend e-mailVisit poster's websiteAIM AddressYahoo MessengerMSN Messenger
disgruntledtech
Site Admin
Site Admin


Joined: Apr 14, 2003
Posts: 991

Location: Tulsa, OK

PostPosted: Mon Jul 14, 2003 12:02 am Reply with quoteBack to top

theme looks good -keep in mind users with big avatars could break that header -either hardcode the height/width into the img tag or make that table resizeable Smile

heres a bit of code that'll do the trick
Code:

    global $user, $cookie, $prefix;
    //get username
    cookiedecode($user);
    $username = $cookie[1];
    if ($username == "") {
        $userinfo[user_avatar] = 'blank.gif';
        $userinfo[user_avatar_type] = 1;
    } else {
   $sql = "SELECT user_avatar, user_avatar_type FROM ".$user_prefix."_users WHERE username='$username'";
   if( !($result = $db->sql_query($sql)) ) {
      //query was not successfull - set avatar to blank and report error in a html comment for debug purposes   
      $userinfo[user_avatar] = 'blank.gif';
      $userinfo[user_avatar_type] = 1;
      echo "<!--";
      message_die(CRITICAL_ERROR, "Could not query user information", "", __LINE__, __FILE__, $bbsql);
      echo "-->";
   }
   $num = $db->sql_numrows($result);
   $userinfo = $db->sql_fetchrow($result);
    }
   //get avatar path info
   $bbsql = "SELECT avatar_path, avatar_gallery_path FROM ".$prefix."_bbconfig";
   if( !($bbresult = $db->sql_query($bbsql)) ) {
      //query was not successfull - set paths to default and report error in a html comment for debug purposes   
      $board_config[avatar_path] = 'modules/Forums/images/avatars';
      $board_config[avatar_gallery_path] = 'modules/Forums/images/avatars/gallery';
      echo "<!--";
      message_die(CRITICAL_ERROR, "Could not query avatar path information", "", __LINE__, __FILE__, $bbsql);
      echo "-->";
   }
   while ( $row = $db->sql_fetchrow($bbresult) ) {
    $board_config[$row['config_name']] = $row['config_value'];
   }

   switch ($userinfo[user_avatar_type]) {
      case 1:
      $display_avatar = $board_config[avatar_path]."/".$userinfo[user_avatar];
      break;
      case 2:
      $display_avatar = $userinfo[user_avatar];
      break;
      case 3:
      $display_avatar = $board_config[avatar_gallery_path]."/".$userinfo[user_avatar];
      break;
   }

echo "<img src='".$display_avatar."' border='0'>;
Find all posts by disgruntledtechView user's profileSend private messageSend e-mailVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.174 Seconds - 203 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::