Results 1 to 7 of 7

Thread: Global Avatars?

  1. #1
    New Pligger McBoniosb's Avatar
    Joined
    Feb 2010
    Posts
    8

    Global Avatars?

    Hi Folks!

    I have been working on a sidebar module which shows the users avatar, their name and profil and logout buttons.

    I used:

    PHP Code:
    <img src="{$Avatar_ImgSrc}" alt="Avatar"/> 
    To display the avatar which works great on the user pages, but on the main pages, story pages etc... its a broken link and when I view source I see

    PHP Code:
    <img src="" alt="Avatar"/> 
    Do I have to add/alter something to allow the avatars to be called from anywhere on the site?

    Thanks in advance

  2. #2
    Pligg Developer chuckroast's Avatar
    Joined
    Jun 2006
    Posts
    5,478
    This should work for you.

    Code:
    {if $user_authenticated eq true}
    <img  src="{$my_base_url}{$my_pligg_base}/avatars/user_uploaded/{$user_logged_in}_30.jpg" alt="Avatar" align="absmiddle" border="0" onerror="this.src='{$my_base_url}{$my_pligg_base}/avatars/Gravatar_30.gif'; this.title='Loading...';"/>
    {/if}

  3. #3
    New Pligger McBoniosb's Avatar
    Joined
    Feb 2010
    Posts
    8
    awesome stuff, thanks chuck!

    I added the code and changed my default avatar in there too, it works for default and user uploaded avatars but I get a default avatar for gravatar too?

  4. #4
    New Pligger McBoniosb's Avatar
    Joined
    Feb 2010
    Posts
    8
    awesome stuff, thanks chuck!

    I added the code and changed my default avatar in there too, it works for default and user uploaded avatars but I get a default avatar for gravatar too?

  5. #5
    New Pligger McBoniosb's Avatar
    Joined
    Feb 2010
    Posts
    8
    What might be worth a mention is I use the gravatar module: Gravatar for Social Web CMS v0.3 for my gravatars...

  6. #6
    Pligg Developer chuckroast's Avatar
    Joined
    Jun 2006
    Posts
    5,478
    Quote Originally Posted by McBoniosb View Post
    What might be worth a mention is I use the gravatar module: Gravatar for Social Web CMS v0.3 for my gravatars...
    That is not compatible with Pligg

  7. #7
    New Pligger McBoniosb's Avatar
    Joined
    Feb 2010
    Posts
    8
    ok the readme says: Gravatar for Social Web CMS v0.3

    but the description says: Gravatar v.0.2

    Anyways it works fine with pligg and I have it full operational in the rest of the site.

    In the readme the main code is html1.php is:

    PHP Code:
    // use the user uploaded avatars ? if(Enable_User_Upload_Avatar == true && $avatarsource == "useruploaded"){ $imgsrc = my_pligg_base . User_Upload_Avatar_Folder . "/" . $user_name . "_" . $imgsize . ".jpg"; return $imgsrc; } elseif(Enable_User_Upload_Avatar == true && $avatarsource == "gravatar"){ $vars = array('userid' => $user_id, 'username' => $user_name, 'imgsize' => $imgsize, 'imgsrc' => ''); check_actions('gravatar', $vars); $imgsrc = $vars['imgsrc']; if($imgsrc != '') { return $imgsrc; } } 
    It works everwhere except my new module. It works in the online users module too which is present in the sidebar....

Similar Threads

  1. SFS Global Antispam
    By chuckroast in forum Free Modules
    Replies: 37
    Last Post: 04-02-2012, 08:43 AM
  2. SFS Global Antispam
    By chuckroast in forum Free Modules
    Replies: 8
    Last Post: 12-20-2010, 01:59 PM
  3. Global Ad Posting
    By typ1247 in forum Questions & Comments
    Replies: 0
    Last Post: 02-06-2008, 02:09 AM
  4. Global Ad Posting
    By typ1245 in forum Questions & Comments
    Replies: 2
    Last Post: 12-08-2007, 08:05 AM
  5. Global Footer
    By zea in forum Questions & Comments
    Replies: 6
    Last Post: 02-21-2006, 10:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Donate to Pligg CMS Dreamhost Web Hosting Host Gator Web Hosting