• [Mod] Avatar v2.01 5 0 5 1
Currently:  

Author Topic: [Mod] Avatar v2.01  (Read 495011 times)

0 Members and 1 Guest are viewing this topic.

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: [Mod] Avatar v2.01
« Reply #465 on: February 06, 2011, 12:45:36 AM »
Hmm, any ideas in what file? Maybe i changed somewhere, but where???

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Avatar v2.01
« Reply #466 on: February 06, 2011, 02:58:40 AM »
global.php maybe
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: [Mod] Avatar v2.01
« Reply #467 on: February 07, 2011, 11:50:36 AM »
Ok, i want to show avatar of image owner on my details.html through something like this,

//-----------------------------------------------------
//--- USERS AVATARS -----------------------------------
//-----------------------------------------------------

$user_ava "";

        
        
$sql "SELECT u.user_avatar as name
        FROM "
.USERS_TABLE." u, ".IMAGES_TABLE." i
        WHERE u.user_id = i.user_id"
;


$result $site_db->query($sql);

   
   while (
$row $site_db->fetch_array($result)) {

$user_ava '<img src="'.ROOT_PATH.'templates/default/avatars/'.$row['name'].'">';

}

$site_template->register_vars(array(
"user_ava" => $user_ava,
));
unset(
$user_ava);


Very strange, but nothing result! No errors, no results! What`s wrong?
« Last Edit: February 09, 2011, 09:35:27 AM by MrAndrew »

Offline haider512

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #468 on: February 11, 2011, 03:05:21 AM »
Hello sir i want to know.. how to have different avatar size in different pages..

i tried like this..but it didnt worked out.

<img src="{user_avatar_current}" width="80px" height="80px">

but it didnt worked.. please sir tell how can we set different size of avatar in different pages..or a specific page..


i mean to set specific width and height of avatar for only only that specific field..

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Avatar v2.01
« Reply #469 on: February 11, 2011, 04:57:50 AM »
Very strange, but nothing result! No errors, no results! What`s wrong?
Because you forgot specify image_id in the mysql query ;)
Anyhow, I'd recommend instead of creating whole new query, modify this line:
Code: [Select]
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email")."Add at the end of the line , u.user_avatar (note the comma)

After that you can register template tag with this:
Code: [Select]
"user_ava" => "<img src=\"".TEMPLATE_PATH."/avatars/".(($image_row['user_avatar'] == "") ? "blank.gif" : $image_row['user_avatar'])."\" border=\"0\" hspace=\"15\" alt=\"\">",
i tried like this..but it didnt worked out.
<img src="{user_avatar_current}" width="80px" height="80px">
you are using HTML attributes width and height, they only accept numbers:

<img src="{user_avatar_current}" width="80" height="80">

"px" can only be used in CSS style:

<img src="{user_avatar_current}" style="width:80px; height:80px;">
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: [Mod] Avatar v2.01
« Reply #470 on: February 11, 2011, 08:48:09 AM »
Nothing result.

I`ve added this path , u.user_avatar at the end of this line:

$sql "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.""user_level").get_user_table_field(", u.""user_name").get_user_table_field(", u.""user_email").get_user_table_field(", u.""user_showemail").get_user_table_field(", u.""user_invisible").get_user_table_field(", u.""user_joindate").get_user_table_field(", u.""user_lastaction").get_user_table_field(", u.""user_comments").get_user_table_field(", u.""user_homepage").get_user_table_field(", u.""user_icq").$additional_sql.get_user_table_field(", u.""user_skype").", u.user_avatar

Then below register thi line:

"user_ava" => "<img src=\"".TEMPLATE_PATH."/avatars/".(($image_row['user_avatar'] == "") ? "blank.gif" $image_row['user_avatar'])."\" border=\"0\" hspace=\"15\" alt=\"\">",

:(

Offline haider512

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #471 on: February 16, 2011, 12:34:58 PM »

you are using HTML attributes width and height, they only accept numbers:

<img src="{user_avatar_current}" width="80" height="80">

"px" can only be used in CSS style:

<img src="{user_avatar_current}" style="width:80px; height:80px;">


Sir im still not able to make the image size smaller??

i used both but still image not resizing..infact image dont even appear??  how to resize image for a particular page or for some specific place??

Actually im trying to add avatar top on header of page.. but i want it smaller on header then normal size on pages..

still trying to fix it..but couldnt find any thing..please suggest me what to do..


Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: [Mod] Avatar v2.01
« Reply #472 on: February 16, 2011, 12:51:29 PM »
Did you try to do same this?

<img src="{user_avatar_current}" style="width:50px; height:50px;">

Offline haider512

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #473 on: February 16, 2011, 12:58:28 PM »
Did you try to do same this?

<img src="{user_avatar_current}" style="width:50px; height:50px;">

yes but its not working..

the only thing in header.html works is {user_avatar_current}

even if i dont put the height and with or any attribute , it will not work..??
so how to resize it..

i also tried to make another one like {user_avatar_header)

but got no success?

what to do??

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: [Mod] Avatar v2.01
« Reply #474 on: February 16, 2011, 01:03:51 PM »
{user_avatar_current} - Is it show avatar in your header or no?

Offline haider512

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #475 on: February 16, 2011, 01:12:48 PM »
{user_avatar_current} - Is it show avatar in your header or no?

yes avatar shows up on header with {user_avatar_current}

but i want to resize the avatar for my header place..

so im using img tag

but that tag i guess is not working..

isnt is there any way to have two different sizes like

{user_avatar_current}

which already is global one

but add another one

{user_avatar_header} with my custom size so i can use it in template anywhere i want?

i tried this..

in member.php

i added.

"user_avatar_header" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row['user_avatar'] == "") ? "blank.gif" $user_row['user_avatar'])."\" name=\"icons\" width=\"50\" height=\"50\" border=\"0\" alt=\"\">" "",

under

"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row['user_avatar'] == "") ? "blank.gif" $user_row['user_avatar'])."\" name=\"icons\" border=\"0\" alt=\"\">" "",


and added

"user_avatar_header" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_avatar == "") ? "blank.gif" $user_avatar)."\" name=\"icons\" width=\"50\" height=\"50\" border=\"0\" alt=\"\">" "",

under
"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_avatar == "") ? "blank.gif" $user_avatar)."\" name=\"icons\" border=\"0\" alt=\"\">" "",

then i tried using the {user_avatar_header} in my template page..but it didn't worked..

is there any way to achive two different sized??


also in template i tried this too..its also not working

<img src='{user_avatar_current}' style=' width:50px; height:50px;'>

Offline MrAndrew

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
    • Aviation PhotoBase
Re: [Mod] Avatar v2.01
« Reply #476 on: February 16, 2011, 01:19:44 PM »
{user_avatar_header} - this code will work only on member.php template pages.

Also try to use this:

"user_avatar_header" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_avatar == "") ? "blank.gif" $user_avatar)."\" name=\"icons\" width=\"50px\" height=\"50px\" border=\"0\" alt=\"\">" "",

Offline haider512

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #477 on: February 16, 2011, 01:29:12 PM »

Also try to use this:

"user_avatar_header" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_avatar == "") ? "blank.gif" $user_avatar)."\" name=\"icons\" width=\"50px\" height=\"50px\" border=\"0\" alt=\"\">" "",

No mate its not working..??? :(

any more suggestions??

@ V@no
where are you sir..really need your help here.. cant figure it out that how to make it possible??

Offline haider512

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #478 on: February 17, 2011, 07:25:28 AM »
Hello.. im using avatar mod.. its working perfectly fine..
but i want to add avatar on header with my defined size ( different from other avatars on main}

i mean i want to have one more tag like {user_avatar_current}
i want to have {user_avatar_header)

i did copied and did little bit changes in

"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row['user_avatar'] == "") ? "blank.gif" $user_row['user_avatar'])."\" name=\"icons\" border=\"0\" alt=\"\">" "",

and made it like

"user_avatar_header" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row['user_avatar'] == "") ? "blank.gif" $user_row['user_avatar'])."\" name=\"icons\" width=\"i50\" height=\"80\" border=\"0\" alt=\"\">" "",

did this only in member.php and in details.php..

so now it only works if i visit the member profile page or control panel or some.

i mean with {user_avatar_header} the avatar shows of my defined size but only if i visit the control panel page..??

what to do please tell.??

i want it to work in every page of template {user_avatar_header}

Please Reply..


==================================

Here is the screenshot of my page.. im working on localhost..i mean wamp..so thats why cant give link of this..

The normal site link is
www.cusitlibrary.com

but working on header thing on my pc, that when it will be completed will upload it..

Ok here is the screenshot.


Please Help Suggest what to do??
« Last Edit: February 17, 2011, 01:01:49 PM by haider512 »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Avatar v2.01
« Reply #479 on: February 17, 2011, 03:33:28 PM »
you need add that line into includes/page_header.php

(sorry I don't have access to source code at the moment, can't tell exactly where to add it, but you'll figure it out, I'm sure ;))

P.S.
you have an extra "i" in width value.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

 

Post your comments here