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

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

0 Members and 3 Guests are viewing this topic.

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
[Mod] Avatar v2.01
« on: February 06, 2003, 05:30:43 AM »
Avatar v2

Some people were interesting in such a mod.
This mod will let users select an avatar for their profiles.
The avatars will be displayed in comments. ( can be added somewhere else, if needed )

New features in v2:
1. users can upload their own avatars.
2. administrator can anable/disable: using avatars, upload avatars, change alowed width/height.


This MOD was writen and tested on Windows system with 4images v1.7
---------------------------------------------------------------------------------------------------------------
Changes in following files:


/member.php
/details.php
/includes/upload.php
/includes/db_field_definitions.php
/admin/settings.php
/admin/admin_functions.php
/lang/<yourlanguage>/admin.php
/lang/<yourlanguage>/main.php
/templates/<yourtemplate>/member_profile.html
/templates/<yourtemplate>/member_editprofile.html
/templates/<yourtemplate>/comment_bit.html


---------------------------------------------------------------------------------------

Step 1.
Open member.php

Find:
Code: [Select]
      "user_email_save" => $user_email_save,
Insert below:
Code: [Select]
    "lang_avatar" => $lang['avatar'],
     "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=\"\">" : "",


1.2.
Find:
Code: [Select]
  if (!$error) {
   $additional_sql = "";
    if (!empty($additional_user_fields)) {
      $table_fields = $site_db->get_table_fields(USERS_TABLE);
      foreach ($additional_user_fields as $key => $val) {
        if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
          $additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
        }
      }
    }

    $sql = "UPDATE ".USERS_TABLE."
            SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'".$additional_sql."
            WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id'];
    $site_db->query($sql);
    $msg_color = 1;
    $msg .= $lang['update_profile_success'];
    if (!empty($new_email_msg)) {
      $msg .= "<br />".$new_email_msg;
    }
    $user_info = $site_sess->load_user_info($user_info['user_id']);
  }
  else {
    $update_process = 1;
  }
  $action = "editprofile";
}

Add above it:
Code: [Select]
// Upload Avatar file
  if (!$error) {
     if (!empty($HTTP_POST_FILES['avatar_file']['tmp_name']) && $HTTP_POST_FILES['avatar_file']['tmp_name'] != "none") {
    include(ROOT_PATH.'includes/upload.php');
    $site_upload = new Upload();
    $new_name = $site_upload->upload_file("avatar_file", "avatar", $config['template_dir'], $user_info['user_id']);
     if (!$new_name) {
     $msg .= (($msg != "") ? "<br />" : "")."<b>".$lang['file_upload_error'].": ".$new_name."</b><br />".$site_upload->get_upload_errors();
     $error = 1;
     }else{
    $HTTP_POST_VARS['user_avatar'] = "users/".$new_name;
    $avatars_dir = TEMPLATE_DIR."/".$config['template_dir']."/avatars/users/";
    $dir = opendir($avatars_dir);
    $contents = array();
    while ($contents[] = readdir($dir)){;}
    closedir($dir);
    foreach ($contents as $line){
      $filename = substr($line,0,(strlen($line)-strlen(strrchr($line,"."))));
      $extension = substr(strrchr($line,"."), 1);
      $filename2 = substr($new_name,0,(strlen($new_name)-strlen(strrchr($new_name,"."))));
      $extension2 = substr(strrchr($new_name,"."), 1);
      if ($filename == $filename2 && $extension != $extension2) {
      unlink($avatars_dir.$line);
      }
    }

     }
    }
  }
// End Avatar file


1.3.
Find:
Code: [Select]
   $user_icq = $user_info['user_icq'];

Add after:
Code: [Select]
 $user_avatar = $user_info['user_avatar'];


1.4.
Few lines below find:
Code: [Select]
 $site_template->register_vars(array(
    "user_name" => htmlspecialchars(stripslashes($user_name)),

Replace with:
Code: [Select]
//-----------------------
//------ Avatar ---------
//-----------------------
  if ($config['avatar_use']){
   $images = "";
  $checked = ($user_avatar == "blank.gif" || $user_avatar == "") ? " selected" : "";
  $images .= "\n<option value=\"blank.gif\"$checked>none</option>\n";
  $dir = opendir(TEMPLATE_PATH."/avatars/users/");
  $contents = array();
  while ($contents[] = readdir($dir)){;}
  closedir($dir);
  natcasesort ($contents);
  foreach ($contents as $line){
   $filename = substr($line,0,(strlen($line)-strlen(strrchr($line,"."))));
   if ($filename == $user_info['user_id']) {
     $checked = (stristr($user_avatar, "users/")) ? " selected" : "";
     $images .= "\n<option value=\"users/$line\"$checked>".$lang['custom']."</option>\n";
   }
  }
   $dir = opendir(TEMPLATE_PATH."/avatars/");
   $contents = array();
   while ($contents[] = readdir($dir)){;}
   closedir($dir);
   natcasesort ($contents);
   $checked = "";
   foreach ($contents as $line){
      $filename = substr($line,0,(strlen($line)-strlen(strrchr($line,"."))));
      $extension = substr(strrchr($line,"."), 1);
      $checked = "";
      if ($line == $user_avatar) { $checked = " selected"; }
      if (strcasecmp($extension,"gif")==0 || strcasecmp($extension,"jpg")==0 || strcasecmp($extension,"jpeg")==0 || strcasecmp($extension,"png")==0 ){
         if ($line != "blank.gif") {
        $filename = str_replace("_", " ", $filename);
        $images .= "<option value=\"$line\"$checked>$filename</option>\n";
       }
      }
   }
  }
//----------------------
//----- End Avatar -----
//----------------------

  $site_template->register_vars(array(
   "lang_avatar" => $lang['avatar'],
   "lang_avatar_file" => $lang['avatar_file'],
   "lang_avatar_dim" => $lang['avatar_max_dim']." ".$config['avatar_width']."x".$config['avatar_height'].$lang['px'],
   "lang_avatar_select" => $lang['avatar_select'],
   "user_avatar_images" => $images,
   "user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_avatar == "") ? "blank.gif" : $user_avatar)."\" name=\"icons\" border=\"0\" alt=\"\">" : "",
   "lang_or" => $lang['or'],
   "user_avatar_file" => $config['avatar_user_custom'],
    "user_name" => htmlspecialchars(stripslashes($user_name)),



Step 2.
Open details.php
Find:
Code: [Select]
     $comment_user_id = $comment_row[$i]['user_id'];

Add after:
Code: [Select]
   $user_row_comment = get_user_info($comment_user_id);


2.2.
Find:
Code: [Select]
       "comment_id" => $comment_row[$i]['comment_id'],

Add after:
Code: [Select]
   "user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row_comment['user_avatar'] == "") ? "blank.gif" : $user_row_comment['user_avatar'])."\" name=\"icons\" border=\"0\" hspace=\"15\" alt=\"\">" : "",




Step 3.
Open /includes/upload.php
Find:
Code: [Select]
   $this->max_height['media'] = $config['max_image_height'];

    $this->max_size['thumb'] = $config['max_thumb_size'] * 1024;
    $this->max_size['media'] = $config['max_media_size'] * 1024;

Replace with:
Code: [Select]
   $this->max_height['media'] = $config['max_image_height'];
  $this->max_width['avatar'] = $config['avatar_width'];
  $this->max_height['avatar'] = $config['avatar_height'];

    $this->max_size['thumb'] = $config['max_thumb_size'] * 1024;
    $this->max_size['media'] = $config['max_media_size'] * 1024;
    $this->max_size['avatar'] = 99999999999;



3.2.
Find:
Code: [Select]
 function copy_file() {

Add after:
Code: [Select]
 if ($this->image_type == "avatar") {
    if (file_exists($this->upload_path[$this->image_type]."/".$this->file_name)) {
        @unlink($this->upload_path[$this->image_type]."/".$this->file_name);
      }
      $ok = move_uploaded_file($this->upload_file, $this->upload_path[$this->image_type]."/".$this->file_name);
  }else{

3.3.
At the end of this function find:
Code: [Select]
   @chmod($this->upload_path[$this->image_type]."/".$this->file_name, CHMOD_FILES);
Replace with:
Code: [Select]
 }
    @chmod($this->upload_path[$this->image_type]."/".$this->file_name, CHMOD_FILES);


3.4.
Find:
Code: [Select]
   if ($cat_id) {
      $this->upload_path['thumb'] = THUMB_PATH."/".$cat_id;
      $this->upload_path['media'] = MEDIA_PATH."/".$cat_id;
    }
    else {
      $this->upload_path['thumb'] = THUMB_TEMP_PATH;
      $this->upload_path['media'] = MEDIA_TEMP_PATH;
    }

    if ($file_name != "") {

Replace with:
Code: [Select]
   if ($cat_id) {
      $this->upload_path['thumb'] = THUMB_PATH."/".$cat_id;
      $this->upload_path['media'] = MEDIA_PATH."/".$cat_id;
    $this->upload_path['avatar'] = TEMPLATE_DIR."/".$cat_id."/avatars/users";
    }
    else {
      $this->upload_path['thumb'] = THUMB_TEMP_PATH;
      $this->upload_path['media'] = MEDIA_TEMP_PATH;
    }

    if ($file_name != "" && $this->image_type != "avatar") {


3.5.
Find:
Code: [Select]
   $this->mime_type = $this->HTTP_POST_FILES[$this->field_name]['type'];

Replace with:
Code: [Select]
if ($this->image_type == "avatar") {
    $this->file_name = $file_name.".".$this->extension;
  }

    $this->mime_type = $this->HTTP_POST_FILES[$this->field_name]['type'];


3.6.
Find:
Code: [Select]
   //Thumbnails
    $this->accepted_mime_types['thumb'] = array(

Insert above:
Code: [Select]
 //Avatar
    $this->accepted_mime_types['avatar'] = array(
      "image/jpeg",
      "image/pjpeg",
      "image/gif",
      "image/x-png"
    );
    $this->accepted_extensions['avatar'] = array(
      "jpg",
      "jpeg",
      "gif",
      "png"
    );


3.7. *new
Find:
Code: [Select]
     $error_msg .= "<b>".$this->file_name.":</b> ".$msg."<br />";

Replace with:
Code: [Select]
     $error_msg .= "<b>".(($this->image_type == "avatar") ? $this->HTTP_POST_FILES[$this->field_name]['name'] : $this->file_name).":</b> ".$msg."<br />";




Step 4.
Open /includes/db_field_definitions.php file.
Add this line:
Code: [Select]
$additional_user_fields['user_avatar'] = array($lang['avatar'], "avatar", 0);




Step 5.
Open /admin/settings.php
Find:
Code: [Select]
 show_setting_row("highlight_admin", "radio");

Add after:
Code: [Select]
 show_table_separator($setting_group[8], 2, "#setting_group_8");
  show_setting_row("avatar_use", "radio");
  show_setting_row("avatar_user_custom", "radio");
  show_setting_row("avatar_width");
  show_setting_row("avatar_height");
If u installed some other MOD for example "Annotation by SLL" then u probably will need change $setting_group[8], 2, "#setting_group_8");




Step 6. *updated
Open /admin/admin_functions.php
Find:
Code: [Select]
     case "text":
      default:
        show_input_row($val[0], $field_name, $value);
    
      } // end switch
    }
  }
}
?>

Replace with:
Code: [Select]
  case "avatar":
    show_avatar_row($val[0], $field_name, $value);
    break;
      case "text":
      default:
        show_input_row($val[0], $field_name, $value);
    
      } // end switch
    }
  }
}
//-----------------------
//------ Avatar ---------
//-----------------------
function show_avatar_row($title, $name, $value = "blank.gif"){
  global $config;
  if ($config['avatar_use']){
  $dir = opendir(TEMPLATE_PATH."/avatars/");
  $contents = array();
  while ($contents[] = readdir($dir)){;}
  closedir($dir);
  natcasesort ($contents);
  echo "<tr width=\"50%\"class=\"".get_row_bg()."\" valign='top'>\n<td><p class=\"rowtitle\">".$title."</p></td>\n";
  echo "<td width=\"50%\" height=\"115\" valign=\"middle\">\n<table>\n<tr>\n<td>\n<SELECT name=\"$name\" size=\"6\" onkeypress=\"if(window.event.keyCode==13){this.form.submit();}\" onChange=\"document.form.icons_$name.src='".TEMPLATE_PATH."/avatars/'+document.form.$name.options[document.form.$name.selectedIndex].value;\">";
   if ($value == "blank.gif" || $value == "") {
   $checked = " selected";
   }else{
   $checked = "";
   }
   echo "<option value=\"blank.gif\"$checked>none</option>\n";
  foreach ($contents as $line){
     $filename = substr($line,0,(strlen($line)-strlen(strrchr($line,"."))));
     $extension = substr(strrchr($line,"."), 1);
     $checked = "";
     if ($line == $value) { $checked = " selected"; }
     if (strcasecmp($extension,"gif")==0 || strcasecmp($extension,"jpg")==0 || strcasecmp($extension,"jpeg")==0 || strcasecmp($extension,"png")==0 ){
      if ($line != "blank.gif") {
      $filename = str_replace("_", " ", $filename);
      echo "<option value=\"$line\"$checked>$filename</option>\n";
      }
     }
  }
  echo "</select>\n</td>\n<td valign='middle' align='left'>\n<img align='center' src=\"".TEMPLATE_PATH."/avatars/".(($value == "") ? "blank.gif" : $value)."\" name=\"icons_$name\" border=\"0\" alt=\"\">\n</td>\n</tr>\n</table>\n</td>\n";
  }
}
//----- End Avatar -----
?>




Step 7.
Open /lang/<yourlanguage>/admin.php
Add at the end of the file, just before <? :
Code: [Select]
/*-- Setting-Group 8 --*/
$setting_group[8]="Avatar";
$setting['avatar_use'] = "Use avatars";
$setting['avatar_user_custom'] = "Allow users use their own avatars";
$setting['avatar_width'] = "Max. avatar width in pixel";
$setting['avatar_height'] = "Max. avatar height in pixel";
Change $setting_group[8]="Avatar"; to the number u set in /admin/settings.php




Step 8.
Open /lang/<yourlanguage>/main.php
Add at the end of the file, just before <? :
Code: [Select]
$lang['avatar'] = "Avatar: ";
$lang['avatar_file'] = "Upload avatar:";
$lang['avatar_max_dim'] = "Max. allowed";
$lang['avatar_select'] = "Select from the list:";
$lang['custom'] = "Custom";




Step 9.
Open /templates/<yourtemplate>/member_profile.html
Add this:
Code: [Select]
       {if user_avatar_current}
        <TR>
          <TD class="row2"><B>{lang_avatar}</B></TD>
          <TD class="row2">{user_avatar_current}</TD>
        </TR>
        {endif user_avatar_current}




Step 10.
Open /templates/<yourtemplate>/member_editprofile.html
Change top form to this:
Code: [Select]
<FORM method="post" action="{url_member}" name="creator" enctype="multipart/form-data">
  <TABLE width="100%" border="0" cellspacing="0" cellpadding="1">
    <TR>
      <TD valign="top" class="head1">
        <TABLE width="100%" border="0" cellpadding="4" cellspacing="0">
          <TR>
            <TD colspan="2" valign="top" class="head1">{lang_profile_of} {user_name}</TD>
          </TR>
          <TR>
            <TD class="row1"><B>{lang_email}</B></TD>
            <TD class="row1"><INPUT type="text" name="user_email"  size="30" value="{user_email}" class="input" /></TD>
          </TR>
          <TR>
            <TD class="row2"><B>{lang_email_confirm}</B></TD>
            <TD class="row2"><INPUT type="text" name="user_email2"  size="30" value="{user_email2}" class="input" /></TD>
          </TR>
          <TR>
            <TD class="row1"><B>{lang_show_email}</B></TD>
            <TD class="row1">
              <INPUT type="radio" name="user_showemail" value="1"{user_showemail_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <INPUT type="radio" name="user_showemail" value="0"{user_showemail_no} />
              {lang_no}</TD>
          </TR>
      <TR>
            <TD class="row2"><B>{lang_allow_emails}</B></TD>
            <TD class="row2">
              <INPUT type="radio" name="user_allowemails" value="1"{user_allowemails_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <INPUT type="radio" name="user_allowemails" value="0"{user_allowemails_no} />
              {lang_no}
      </TD>
          </TR>
          <TR>
            <TD class="row1"><B>{lang_invisible}</B></TD>
            <TD class="row1">
              <INPUT type="radio" name="user_invisible" value="1"{user_invisible_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <INPUT type="radio" name="user_invisible" value="0"{user_invisible_no} />
              {lang_no}
      </TD>
          </TR>
          <TR>
            <TD colspan="2" class="head1">{lang_optional_infos}</TD>
          </TR>
          <TR>
            <TD class="row1"><B>{lang_homepage}</B></TD>
            <TD class="row1"><INPUT type="text" name="user_homepage"  size="30" value="{user_homepage}" class="input" /></TD>
          </TR>
          <TR>
            <TD class="row2"><B>{lang_icq}</B></TD>
            <TD class="row2"><INPUT type="text" name="user_icq"  size="30" value="{user_icq}" class="input" /></TD>
          </TR>
                   {if user_avatar_images}
          <TR>
            <TD colspan="2" class="head1">{lang_avatar}</TD>
          </TR>

          <TR>
            <TD class="row2" valign="top">
            {if user_avatar_file}
              <B>{lang_avatar_file}</B><BR />
              <SPAN class="smalltext">
              <B>{lang_avatar_dim}</B>
              </SPAN>
              <BR>
              <b>{lang_or}</b><BR>
              {endif user_avatar_file}
              <B>
              {lang_avatar_select}
              </B>
            </TD>
            <TD class="row2">
            {if user_avatar_file}
              {lang_upload}
              <INPUT type="file" name="avatar_file"  size="30" class="input" />
              <BR />
              <BR />
              {endif user_avatar_file}
              <SELECT name="user_avatar" size="6" onkeypress="if(window.event.keyCode==13){ this.form.submit(); }" onChange="document.images.icons.src='{template_url}/avatars/'+this.value;">{user_avatar_images}</SELECT>
              <TABLE width="100%" height="100" border="0">
                <TR>
                  <TD align="center">
                    {user_avatar_current}
                  </TD>
                </TR>
              </TABLE>
            </TD>
          </TR>
          {endif user_avatar_images}
        </TABLE>
      </TD>
    </TR>
  </TABLE>
  <INPUT type="hidden" name="action" value="updateprofile" />
  <P align="center">
    <INPUT type="submit" value="{lang_save}" class="button" />
    <INPUT type="reset" value="{lang_reset}" class="button" />
  </P>
</FORM>



Step 11.
Open /templates/<yourtemplate>/comment_bit.html
Add this:
Code: [Select]
{if user_avatar_current}
  {user_avatar_current}
  {endif user_avatar_current}




Step 12.
Download attached package
Upload  install_avatar.php into your 4images root folder, and blank.gif into new /templates/<yourtemplate>/avatars
Start the installation by http://yourhost.com/your4images/install_avatar.php


Now, create two folders:
/templates/<yourtemplate>/avatars/users/
Upload your avatars in /avatars/

Now users can sellect their avatar from control panel.

P.S. Thank SLL for the installer :)
P.P.S. This MOD probably wont work if u have integrated 4images with some boards.
« Last Edit: January 04, 2011, 06:49:50 PM by V@no »
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 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 #1 on: February 08, 2003, 01:07:24 AM »
The marked ( * ) code above has been changed.
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 Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #2 on: February 08, 2003, 01:54:44 AM »
Hey this is very cool....it would be cool if the user can upload there pic for the avator...think this is possible?

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 #3 on: February 08, 2003, 03:02:31 AM »
I dont think my PHP knowlege let me do that...
maybe somebody esle can do? ;)
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 Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #4 on: February 08, 2003, 04:10:57 AM »
You did a great job, its just that would be the reason for me having avators is to let them have there own pic u know.  Like I think it would be possible, especially since you made it that far....just has to be a way to let them upload there pic to a folder then call it to be there avator somehow...lol here I am with my dreams i dont know ANY PHP, you did an awsome job!

Offline Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #5 on: February 08, 2003, 07:45:26 PM »
Does anyone know of a good Upload script I could possibly use have it upload to my avator folder....Im looking for a script that will resize the image also to like 200x200  or so...or would it be possible to alter the code above to only show the images @ a certain pixel?

Offline Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #6 on: February 09, 2003, 12:46:23 AM »
Just realized its not working. When Im logged in with my admin name I can see the the avatars in the comments and in the profiles....when I logged in as just a member...I can see the avatars in the profiles but they dont show up in the comments when Im not logged in under admin....any ideas on whats going on?

Offline mantra

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
    • DREAM WITH MANTRA
Re: [Mod] Avatar v2.01
« Reply #7 on: February 09, 2003, 01:05:05 AM »
After I install the mood avatars, the mood run without error.

my question is . How to add avatars in other page like in who is online or in my index gallery.
why avatars only show when the current user after log in ?? but when the current user log out the avatars missing   :wink:  :wink:

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 #8 on: February 09, 2003, 01:31:56 AM »
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 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 #9 on: February 09, 2003, 01:41:07 AM »
Quote from: mantra

why avatars only show when the current user after log in ?? but when the current user log out the avatars missing   :wink:  :wink:


Do u mean avatars missing in already posted comments?
GUEST dont have an avatar.
I'm not sure why they are missing, I can see avatars even when I'm not logged in.
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 Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #10 on: February 09, 2003, 02:23:15 AM »
Quote from: V@no
Quote from: mantra

why avatars only show when the current user after log in ?? but when the current user log out the avatars missing   :wink:  :wink:


Do u mean avatars missing in already posted comments?
GUEST dont have an avatar.
I'm not sure why they are missing, I can see avatars even when I'm not logged in.



Yeah I notice that on your site that I can see them ....But for some reason if I wasnt logged in on my main Admin account it wouldn't show them....I tried signing on with to other names on my gallery and they didnt show...just on my admin name....

Offline Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #11 on: February 09, 2003, 02:25:11 AM »
....i 4got to chmod the avatar/users folder! i LOVE THIS MOD

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 #12 on: February 09, 2003, 02:30:28 AM »
Ah, I forgot to mention, /users/ folder must set CMOD 777
basicaly the same as /data/media/ folder.

but can u see avatars on my site?
http://come.no-ip.com/details.php?image_id=7570
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 Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #13 on: February 09, 2003, 03:26:49 AM »
I can see the avatars opn your site when im logged in or logged out....on my site I can only see them when Im logged in under my admin name still...weird

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 #14 on: February 09, 2003, 07:08:29 AM »
added new Step 3.7.
now when error in file dimensions it shows uploaded filename, instead of renamed one (less confusion for users ;) )
if u want do check picture's size when logged in as admin, need change in /includes/upload.php line:
Code: [Select]
   if ($user_info['user_level'] != ADMIN) {with this:
Code: [Select]
   if ($user_info['user_level'] != ADMIN || $this->image_type == "avatar") {
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)