4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on February 06, 2003, 05:30:43 AM

Title: [Mod] Avatar v2.01
Post by: V@no 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 (#post_attachment) 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.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 08, 2003, 01:07:24 AM
The marked ( * ) code above has been changed.
Title: Re: [Mod] Avatar v2.01
Post by: Jasondavis 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?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 08, 2003, 03:02:31 AM
I dont think my PHP knowlege let me do that...
maybe somebody esle can do? ;)
Title: Re: [Mod] Avatar v2.01
Post by: Jasondavis 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!
Title: Re: [Mod] Avatar v2.01
Post by: Jasondavis 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?
Title: Re: [Mod] Avatar v2.01
Post by: Jasondavis 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?
Title: Re: [Mod] Avatar v2.01
Post by: mantra 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:
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 09, 2003, 01:31:56 AM
Title: Re: [Mod] Avatar v2.01
Post by: V@no 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.
Title: Re: [Mod] Avatar v2.01
Post by: Jasondavis 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....
Title: Re: [Mod] Avatar v2.01
Post by: Jasondavis on February 09, 2003, 02:25:11 AM
....i 4got to chmod the avatar/users folder! i LOVE THIS MOD
Title: Re: [Mod] Avatar v2.01
Post by: V@no 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
Title: Re: [Mod] Avatar v2.01
Post by: Jasondavis 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
Title: Re: [Mod] Avatar v2.01
Post by: V@no 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") {
Title: Re: [Mod] Avatar v2.01
Post by: widgit1981 on February 10, 2003, 12:56:35 PM
Hi

I tried this and I try to upload a image and it dosnt upload into the folders but if I but a image in the ftp manually it works.

I have made sure the permissions are set

Any Ideas?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 10, 2003, 01:12:59 PM
make sure that picture width/height is equal or smaller then size u set from Admin Control Panel -> Settings

P.S. Can u show me your site?
Title: Re: [Mod] Avatar v2.01
Post by: widgit1981 on February 10, 2003, 01:19:17 PM
Hi

Yes I have made sure the sizes all smaller. It even says my profile has been updated.

My site address is:

http://www.highrez.com

Username: demo
Password: demo

Thanks

Steve
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 10, 2003, 01:30:37 PM
yes, thes's right, I had the same problem when was tunning up the script... 8O
u forgot add in top <form> this
Quote
<FORM method="post" action="{url_member}" name="creator" enctype="multipart/form-data">

that will fix two things: upload and image changing.
by the way, dont forget add blank.gif image in /avatars/ folder.  :wink:
Title: Re: [Mod] Avatar v2.01
Post by: widgit1981 on February 10, 2003, 01:36:46 PM
Your a star *******

Now fully working thanks to you. This mod certainly makes my day !

Steve
HighRez.com
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 10, 2003, 02:01:58 PM
I have slightly changed Step 1.4 and Step 8.
now "Custom" option will be showed even if user changed his avatart to blank or any from the list (so he dont need upload his avatar again).
also, now "Custom" word is taken from language pack.
Title: Re: [Mod] Avatar v2.01
Post by: Maweryk on February 10, 2003, 07:30:24 PM
@v@no: GREAT MOD!

I have one question: It is possible to show the avatar in the memberlist powered by Nicky???

Thanks

Markus
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 10, 2003, 10:41:19 PM
sure, in memberlist.php find:
Code: [Select]
   $userlist .= "<td valign=\"top\" align=\"center\">".$user_name."</td>\n";

And replace with:
Code: [Select]
$user_avatar = (!$user_row['user_avatar'] || $user_row['user_avatar'] == "blank.gif") ? "" : "<img src=\"".TEMPLATE_PATH."/avatars/".$user_row['user_avatar']."\">";
    $userlist .= "<td valign=\"top\" align=\"center\">".$user_name."<br/ >".$user_avatar."</td>\n";
Title: Re: [Mod] Avatar v2.01
Post by: mantra on February 11, 2003, 12:39:13 AM
sorry if this out of the topic, Veno can you share to me what code to add in thumbnail alt properti
so when user not login they got message when try to click the thumbnail
that the image only can have detail view when they register.


 :?  :?
Title: Re: [Mod] Avatar v2.01
Post by: Maweryk on February 11, 2003, 12:41:33 AM
@v@no: Another GREAT JOB! Thanks a lot!

@mantra: Good idea. Hope, that v@no can help us again.

Cheers,

Markus
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 11, 2003, 12:46:40 AM
some time ago someone asked that already  :wink:
http://www.4homepages.de/forum/viewtopic.php?t=3304
Title: Re: [Mod] Avatar v2.01
Post by: Maweryk on February 11, 2003, 01:05:43 AM
FANTASTIC!

Thank U very much!

Markus
Title: Re: [Mod] Avatar v2.01
Post by: Jasondavis on February 11, 2003, 06:23:10 AM
Yes, V@no thank you! You have really been making a lot of mods lately keep up the great work!
Title: Re: [Mod] Avatar v2.01
Post by: mantra on February 11, 2003, 10:00:49 AM
Thanks veno ,you make my day :D  :D  :D
If I can sugest maybe  we can put the avatars in root directory so if some one try to change to another  templates we don't have to upload all the same avatars again. :idea:  :idea:
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 11, 2003, 12:43:06 PM
u can do that.
go through the code u modifyed and search for
Code: [Select]
.TEMPLATE_PATHjust delete it.(dont delete the dot at the end of this, if its there)
Title: Re: [Mod] Avatar v2.01
Post by: mantra on February 11, 2003, 02:17:17 PM
BIG Thanks :wink:  :wink:
Title: Re: [Mod] Avatar v2.01
Post by: Stryker on February 13, 2003, 06:56:37 PM
Thank you very much! You have geat job but can you do intergaton for vBulletin Version 2.2.X?

Thanks again!
Title: Re: [Mod] Avatar v2.01
Post by: Jaap12 on February 14, 2003, 01:48:10 PM
Does this mod work with 1.6?

Ihope so... very intresting mod!!!
Title: Re: [Mod] Avatar v2.01
Post by: drhtm on February 22, 2003, 08:33:12 PM
is it possible to add the avatar in the box 'Registered Users' after a member login right after their name and above the link to 'lightbox'?

And if a user hasn't chosen an avatar is it possible to put a default image or text in that space to remind the user to choose an avatar?

thanks
Title: Re: [Mod] Avatar v2.01
Post by: Der_Nick on February 23, 2003, 02:53:21 PM
i have a small problem with this mod!!
after saving my avater,the member.php file jumps back to "none" avater!!
i can choose my avatars, my own and the avatar in the list,but i can't save the it!
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 23, 2003, 03:15:36 PM
Quote from: drhtm
is it possible to add the avatar in the box 'Registered Users' after a member login right after their name and above the link to 'lightbox'?

And if a user hasn't chosen an avatar is it possible to put a default image or text in that space to remind the user to choose an avatar?

thanks
hmmm...I like the idea add avatar under the name :wink:
just did it on my site:open /includes/page_header.php
Find:
Code: [Select]
 "url_upload" => (!empty($url_upload)) ? $site_sess->url($url_upload) : $site_sess->url(ROOT_PATH."member.php?action=uploadform"),Add after:
Code: [Select]
"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" border=\"0\" alt=\"\">" : "",
Then, open user_logininfo.html template. Add this:
Code: [Select]
{user_avatar_current}

About default image - just change blank.gif with image u want.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 23, 2003, 03:18:12 PM
did u run install_avatar.php ?
Title: Re: [Mod] Avatar v2.01
Post by: Der_Nick on February 23, 2003, 03:25:54 PM
yes!at the first time it was ok, but now, i run it again:
DB Error: Bad SQL Query: INSERT INTO 4images_settings () VALUES ('avatar_use', '1')
Duplicate entry 'avatar_use' for key 1

DB Error: Bad SQL Query: INSERT INTO 4images_settings () VALUES ('avatar_user_custom', '1')
Duplicate entry 'avatar_user_custom' for key 1

DB Error: Bad SQL Query: INSERT INTO 4images_settings () VALUES ('avatar_width', '50')
Duplicate entry 'avatar_width' for key 1

DB Error: Bad SQL Query: INSERT INTO 4images_settings () VALUES ('avatar_height', '50')
Duplicate entry 'avatar_height' for key 1

DB Error: Bad SQL Query: ALTER TABLE 4images_users ADD `user_avatar` VARCHAR( 255 ) NOT NULL
Duplicate column name 'user_avatar'

???????
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 23, 2003, 03:54:32 PM
that's ok, u need run it just ones.
well, go over the installation process, I think u missed something or did something wrong.
Title: Re: [Mod] Avatar v2.01
Post by: Der_Nick on February 23, 2003, 11:30:04 PM
shit!
i checked all steps, but i didn't missed anything and i didn't anything wrong?!
wheres my problem? i don't know,sorry
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 23, 2003, 11:48:20 PM
Quote from: Der_Nick
shit!
8O :roll:
did u add this line?
Code: [Select]
$user_avatar = $user_info['user_avatar'];

another thing, if u have access to your database, try to see if user_avatar field under 4images_users table getting updated.
then, add this line just before the code u add in step 1.4.:
Code: [Select]
echo $user_avatar." | ".$user_info['user_avatar']; it should print on TOP-LEFT corner two times filename of your current avatar. if u see only | then it means the code either doesnt read the database or something u missed.
Title: Re: [Mod] Avatar v2.01
Post by: Der_Nick on February 24, 2003, 01:52:53 AM
ok!
i add this line
Quote
$user_avatar = $user_info['user_avatar'];
!!
but i only see this | !! :oops:
but i'm sure, i don't forget to add anything!i checked exactly and found no mistake! :?:
should i check all the files again?  :(
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 24, 2003, 02:25:04 AM
well, I'm pretty much sure u did something wrong.
because when I upload avatar on your site, it gives me a list of avalable avatars like this:
Quote
none
Custom
Custom

yes, two times Custom.
it not supposed to be like that.
Title: Re: [Mod] Avatar v2.01
Post by: Der_Nick on February 24, 2003, 01:28:51 PM
sorry, but it doesn't work!
i do all again with new files from my hd! i do one step to another,slowly, i checked all files two times, i have absolutely no mistake, but it doesn't work!!
i found no mistake?! :(

the same problem with the 2 "custom"!

should i post all my files here?

your mod is great,but i believe,i am too stupid to check this! :!:  :?:


(excuse me for my very bad englisch!!)
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 24, 2003, 02:01:22 PM
if u want, zip your member.php file, and pm it to me.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 24, 2003, 02:31:45 PM
ok, your member.php file seems to be ok.
but here is another thing:
make sure u did step 4
Code: [Select]
$additional_user_fields['user_avatar'] = array($lang['avatar'], "avatar", 0);where did u put this code?

can u enable/disable avatar feature from admin control panel -> settings? does it save settings changes from there?
Title: Re: [Mod] Avatar v2.01
Post by: Der_Nick on February 24, 2003, 02:57:35 PM
ok! i can enable/disable the avatar feature!!
here is my code from the db_field_definitions.php:

Quote
/* ------------------------------------------------------------------------
If you want to add additional fields in order to store more info on
each image or user, set up these fields by inserting a column to the "4images_images"
or "4images_users" table in your database.

If you add an additional image field and allow upload from the gallery,
add the columns to "4images_images_temp" as well.

Add one line for each new column in the following format:

  $additional_image_fields['%column_name%'] = array("%field_description%", "%admin_field_type%", %is_required%);
or
  $additional_user_fields['%column_name%'] = array("%field_description%", "%admin_field_type%", %is_required%);
  $additional_user_fields['user_avatar'] = array($lang['avatar'], "avatar", 0);

At the bottom of this file, you will find examples for adding a new field.

----------
%column_name% string

  Replace %column_name% with name of the table column.
  You can use the tag {%column_name%} in the templates to display the value of the
  database field.
  If you want to add a textfield to the templates, do this such like:

    <input type="text" name="%column_name%" value="{%column_name%}" />

----------
%field_description% string

  Replace %field_description% with a custom name. This name will be displayed in the Control Panel.
  The value can be displayed in the templates with the tag {lang_%column_name%}.
  It is also recommended to add this tag to the language files (main.php) and to replace "%field_description%"
  with $lang['%column_name%'].

----------

and the code from step 4 does exist!
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 24, 2003, 05:11:18 PM
aha!
now I see where is the problem!
in the db_field_definitions.php u add the line in the comments!
u must add it at the END of file, just before ?>
Title: Re: [Mod] Avatar v2.01
Post by: Der_Nick on February 24, 2003, 05:23:40 PM
oh no!! :oops:
ok,thats it!! thank a lot!!
now it works!! :D

very great mod!!
Title: Re: [Mod] Avatar v2.01
Post by: Stryker on March 07, 2003, 11:59:13 PM
PLEASE, moke intergaton for vBulletin Version 2.2.X?

please please please!!!
Title: Re: [Mod] Avatar v2.01
Post by: V@no on March 08, 2003, 01:43:15 PM
Quote from: Stryker
PLEASE, moke intergaton for vBulletin Version 2.2.X?

please please please!!!

what does it have with avatar mod? 8O
another thing, I dont even have vBulletin.
one more thing, I dont even want have vBulletin.
last thing, vBulleting uses database to store templates, right? o-my-god! it s@x, no wonder most of the vBulletin forums I've seen looks the same. I hardly can imaging how it possible edit templates through browser, where u cant even select one letter from a word by using just mouse, because it will select whole word instead... 8O and u have to  pay for it??? :evil:
Title: Re: [Mod] Avatar v2.01
Post by: rustynet on March 14, 2003, 06:32:01 PM
Quote from: Jasondavis
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


I do have the same problem.  :oops:
Title: Re: [Mod] Avatar v2.01
Post by: Clow Read on March 16, 2003, 12:31:11 AM
beautiful mod V@no ^^

i have a question...
i have 4images integrated to phpBB and i want to integrate this mod with phpBB...

in other words...i want 4images to use phpBB's avatar database as well as the upload avatar database

could you help me code???

thanx ^_~
Title: Re: [Mod] Avatar v2.01
Post by: mantra on March 16, 2003, 08:07:06 AM
:wink: sorry I push the button submit two times by mistake
Title: Re: [Mod] Avatar v2.01
Post by: mantra on March 16, 2003, 08:07:27 AM
V@no after I install your new mood v2 . it's work fine on main page. but if I log in admin page I got this error
----------------------------------------------------------------------------------------------------------
Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 167

Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 168

Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 169

Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 170

Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 171

----------------------------------------------------------------------------------
Where did I make wrong [ I change all instruction very carefully ]
and I don't have blank line after ?> in all php page like in FAQ of this forum
 
I search the error line in admin_functions.php
I try remove this code

  header ("Cache-Control: no-store, no-cache, must-revalidate");
  header ("Cache-Control: pre-check=0, post-check=0, max-age=0", false);
  header ("Pragma: no-cache");
  header ("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
  header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");


and the error missing, did I lost some of feature in 4images.

Can help??
Title: Re: [Mod] Avatar v2.01
Post by: Luang on April 19, 2003, 05:09:25 PM
This one can't be too hard to integrate in phpBB I think. Here's a guess by using some code of V@no.

open details.php

repeat this step

Find code:

Code: [Select]
$comment_user_id = $comment_row[$i]['user_id'];

add after

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


then find

Code: [Select]
$comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";

add after

Code: [Select]
$comment_user_avatar = $user_row_comment['user_avatar'];

then find

Code: [Select]
"comment_user_id" => $comment_user_id,

add after

Code: [Select]
"comment_user_avatar" => $comment_user_avatar,

open the comment_bit.html of your template, then add this wherever you like in your user field. For example find

Code: [Select]
{comment_user_info}<br />

add after

Code: [Select]
<img src="{comment_user_avatar}">


Save and close all files. I'm not sure if this works with vbb, but if you know a bit of mysql look up the avatar field in your user table copy the table name and replace the user_avatar string with your avatar field you found in your usertable.

Code: [Select]
$comment_user_avatar = $user_row_comment['user_avatar'];

You could use this trick to add various information from the user table if you understand what I've just written
Title: Re: [Mod] Avatar v2.01
Post by: Lucifix on April 28, 2003, 06:51:34 PM
I have one problem. I think i did mistake when i was changing code. Here its the pic:
http://slo-foto.portal.si/slike/avatars.JPG

See? It shouldnt be there, but under my nickname.

Yeah, its a girl... but i am just testing it  8)
Title: Re: [Mod] Avatar v2.01
Post by: V@no on April 29, 2003, 08:54:17 AM
Quote from: Lucifix1
I have one problem. I think i did mistake when i was changing code. Here its the pic:
http://slo-foto.portal.si/slike/avatars.JPG

See? It shouldnt be there, but under my nickname.

Yeah, its a girl... but i am just testing it  8)

My advice - change my template to fit your lyout, in that case u wont loose anything "important".
Title: Re: [Mod] Avatar v2.01
Post by: Lucifix on April 29, 2003, 09:27:13 PM
Quote
My advice - change my template to fit your lyout, in that case u wont loose anything "important".


Hm... where can i change your template?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on April 30, 2003, 12:40:20 AM
ops, never mind...I posted only edit profile template...:oops:
hope u dont use notepad to change your templates, otherwise HTML editor would show u where is the problem.
Title: Re: [Mod] Avatar v2.01
Post by: Lucifix on April 30, 2003, 06:43:12 AM
so its possible that the problem is in HTML file? Couse avatars works just fine... but the possition of them..
Title: Re: [Mod] Avatar v2.01
Post by: V@no on April 30, 2003, 12:38:27 PM
yes, that's somewhere in template misstake.
Title: Re: [Mod] Avatar v2.01
Post by: Gabi on May 05, 2003, 06:32:38 AM
Quote from: Luang
This one can't be too hard to integrate in phpBB I think. Here's a guess by using some code of V@no.

open details.php

repeat this step

Find code:

Code: [Select]
$comment_user_id = $comment_row[$i]['user_id'];

add after

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


then find

Code: [Select]
$comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";

add after

Code: [Select]
$comment_user_avatar = $user_row_comment['user_avatar'];

then find

Code: [Select]
"comment_user_id" => $comment_user_id,

add after

Code: [Select]
"comment_user_avatar" => $comment_user_avatar,

open the comment_bit.html of your template, then add this wherever you like in your user field. For example find

Code: [Select]
{comment_user_info}<br />

add after

Code: [Select]
<img src="{comment_user_avatar}">


Save and close all files. I'm not sure if this works with vbb, but if you know a bit of mysql look up the avatar field in your user table copy the table name and replace the user_avatar string with your avatar field you found in your usertable.

Code: [Select]
$comment_user_avatar = $user_row_comment['user_avatar'];

You could use this trick to add various information from the user table if you understand what I've just written


Hy,

I have a little problem to include the Code:
In phpbb template is used this {AVATAR_IMG} Code and in mysql table is it users_user_avatar
How must I change the Code you posted bevore to use it ???

Please help my

Gabi
Title: Re: [Mod] Avatar v2.01
Post by: Lucifix on May 05, 2003, 09:01:27 PM
V@no could you be so kind and send me those HTML files to my email address?

I have checked every HTML file and it doesn't seems to work.

Thanks alot!

Lucifix

My e-mail: Lucifix_ND@hotmail.com
Title: Re: [Mod] Avatar v2.01
Post by: HelpMeNow on May 09, 2003, 10:47:05 PM
Quote from: V@no
I have slightly changed Step 1.4 and Step 8.
now "Custom" option will be showed even if user changed his avatart to blank or any from the list (so he dont need upload his avatar again).
also, now "Custom" word is taken from language pack.


First of all, thank you V@no for yet another fantastic MOD. I use the Avatar mod and just LOVE it.

For me, when I do a test, "Custom" shows twice in the list if member changes their custom avatar more than one time in a single session.

This is true unless I refresh the page, then the two "Custom" texts go back to one as they should be!

Another thing is since each user will have their custom pic in the same ID as their usersname, then the computer will read from the custom avatar from it's cache and if they change their custom avatar to some other custom avatar, then the browser reads off of the old cache and they don't see the change in their avatar... Unless the actually refresh their page, which they prob. won't.

Is there anything that can be done?

I did read the other case someone had regarding the two "Custom" text and I checked the db_field_definitions.php file and all is as it should be.

other than this tiny prob. all is working fine. :)
Title: Re: [Mod] Avatar v2.01
Post by: V@no on May 10, 2003, 05:35:47 PM
Quote from: HelpMeNow
For me, when I do a test, "Custom" shows twice in the list if member changes their custom avatar more than one time in a single session.

Yes, I've seen this myself...not sure why is that, I asume it's because of different server types? I only able check it on my Windows machine...


Quote from: HelpMeNow
Another thing is since each user will have their custom pic in the same ID as their usersname, then the computer will read from the custom avatar from it's cache and if they change their custom avatar to some other custom avatar, then the browser reads off of the old cache and they don't see the change in their avatar... Unless the actually refresh their page, which they prob. won't.

that all depence of how their browser handle the cache. I dont know how to fix it.
Title: Re: [Mod] Avatar v2.01
Post by: Xwoman on May 28, 2003, 12:41:28 PM
i have the some problem ------ help pls ........  :cry:  :cry:


Quote from: mantra
V@no after I install your new mood v2 . it's work fine on main page. but if I log in admin page I got this error
----------------------------------------------------------------------------------------------------------
Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 167

Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 168

Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 169

Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 170

Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 171

----------------------------------------------------------------------------------
Where did I make wrong [ I change all instruction very carefully ]
and I don't have blank line after ?> in all php page like in FAQ of this forum
 
I search the error line in admin_functions.php
I try remove this code

  header ("Cache-Control: no-store, no-cache, must-revalidate");
  header ("Cache-Control: pre-check=0, post-check=0, max-age=0", false);
  header ("Pragma: no-cache");
  header ("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
  header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");


and the error missing, did I lost some of feature in 4images.

Can help??
Title: Re: [Mod] Avatar v2.01
Post by: Xwoman on May 29, 2003, 10:21:46 AM
kann   sein das es nur unter windows geht?????? 8O
Title: Re: [Mod] Avatar v2.01
Post by: osprey on May 30, 2003, 02:43:26 AM
I cannot download this file. It always downloads a file called "files"  that I cannot read. Do I need a certain software to read this or am I downloading wrong?
Thanks
Title: Re: [Mod] Avatar v2.01
Post by: V@no on May 30, 2003, 02:52:38 AM
hmmm...what browser do u use?
also, can u download any images? cause I use exact same script that used in download.php

(for now here (http://home.attbi.com/~vanowm/install_avatar.zip) is a mirror)
Title: Re: [Mod] Avatar v2.01
Post by: osprey on May 30, 2003, 12:41:13 PM
Thanks for the quick reply Veno.  The morror does not work so I am lost.  I can download other files and I have even tried "save target as" and still nothing.  It is a small file can soemone email it to me?? I would appreciate it. :wink:
Title: Re: [Mod] Avatar v2.01
Post by: V@no on May 30, 2003, 12:56:46 PM
sorry about that, I posted without checking it...the link is working now.
Title: Re: [Mod] Avatar v2.01
Post by: osprey on May 30, 2003, 01:04:59 PM
That worked.  :D   Thanks
Title: Re: [Mod] Avatar v2.01
Post by: harv_e on May 30, 2003, 07:11:00 PM
Quote from: Xwoman
b]
Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 167

Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 168

Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 169

Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 170

Warning: Cannot add header information - headers already sent by (output started at c:\myserver\scripts\gallery\admin\admin_functions.php:671) in c:\myserver\scripts\gallery\admin\admin_functions.php on line 171
[/b]
----------------------------------------------------------------------------------


[/b]
[/quote]

Same here.  I had this during install and I had to change the CMOD on files. Ive done all that and still get it.
 I also get this when I try to upload a avater.

Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/harv_e/public_html/4images/includes/upload.php on line 336

Fatal error: Cannot instantiate non-existent class: upload in /home/harv_e/public_html/4images/member.php on line 1144

Wow I hope I didnt mess it all up..
Title: Re: [Mod] Avatar v2.01
Post by: V@no on May 30, 2003, 11:00:56 PM
Quote from: harv_e
Same here.  I had this during install and I had to change the CMOD on files. Ive done all that and still get it.
 I also get this when I try to upload a avater.
this covered in FAQ (make sure u dont have any trailing space after closing ?>

Quote from: harv_e
Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/harv_e/public_html/4images/includes/upload.php on line 336

Fatal error: Cannot instantiate non-existent class: upload in /home/harv_e/public_html/4images/member.php on line 1144

Wow I hope I didnt mess it all up..
I guess u did...
Title: Re: [Mod] Avatar v2.01
Post by: harv_e on May 31, 2003, 12:37:06 AM
You where right about the space causing the header error.  It took me three times to find it.  The other error is still there and im trying to resolve.  I may have to start over.
Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/harv_e/public_html/4images/includes/upload.php on line 336

Fatal error: Cannot instantiate non-existent class: upload in /home/harv_e/public_html/4images/member.php on line 546

It happens when you try to upload a image.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on May 31, 2003, 12:47:49 AM
check all closing } in/around the part u edited in member.php
Title: Re: [Mod] Avatar v2.01
Post by: brandkanne on May 31, 2003, 02:10:39 AM
hi,

thanx for this great mod!

but i've 3 problems:

1. there is no check of the image size (width + height) at upload
    (users can upload all sizes, i set it to 50x50 pixel)

2. after upload, there are two "custom" entries

3. how i can remove "none" in menu
    (i set default in database to a picture...)

cu
Title: Re: [Mod] Avatar v2.01
Post by: V@no on May 31, 2003, 02:46:20 AM
Quote from: brandkanne
1. there is no check of the image size (width + height) at upload
    (users can upload all sizes, i set it to 50x50 pixel)
perhaps u missed something during installation.

Quote from: brandkanne
2. after upload, there are two "custom" entries
yes, I've seen this myself on some "sertain" systems. Not sure why this happens, also, its only show twice "custom" when u upload your avatar, but next time u upen control panel, it will be just ones...I dont have an answer for that :(

Quote from: brandkanne
3. how i can remove "none" in menu
    (i set default in database to a picture...)
search for blank.gif
Title: Re: [Mod] Avatar v2.01
Post by: brandkanne on May 31, 2003, 03:14:23 AM
Quote
1. perhaps u missed something during installation.

yes, i found my mistake in step 1.2.
i added it after not above...

Quote
2. yes, I've seen this myself on some "sertain" systems. Not sure why this happens, also, its only show twice "custom" when u upload your avatar, but next time u upen control panel, it will be just ones...I dont have an answer for that  

yes, i realized, i can live with that...

Quote
3. search for blank.gif

already done,

thank you for this great mod !!!
Title: Re: [Mod] Avatar v2.01
Post by: spoiledRHOtten on June 12, 2003, 08:08:14 PM
hi! Can someone please help?
I uploaded this mod. and for some reason, I can see the avatar in the member_editprofile.php . but when I login as another user, i can't see it in the profile. :(

Can someone please help? I have {user_avatar_current} on the profile page. It's just not showing.

THank you for any help!
Title: Re: [Mod] Avatar v2.01
Post by: spoiledRHOtten on June 14, 2003, 08:39:18 PM
can someone please help?
Title: Re: [Mod] Avatar v2.01
Post by: spoiledRHOtten on June 14, 2003, 09:32:57 PM
Quote from: V@no
sure, in memberlist.php find:
Code: [Select]
   $userlist .= "<td valign=\"top\" align=\"center\">".$user_name."</td>\n";

And replace with:
Code: [Select]
$user_avatar = (!$user_row['user_avatar'] || $user_row['user_avatar'] == "blank.gif") ? "" : "<img src=\"".TEMPLATE_PATH."/avatars/".$user_row['user_avatar']."\">";
    $userlist .= "<td valign=\"top\" align=\"center\">".$user_name."<br/ >".$user_avatar."</td>\n";


when i did this...I was able to view the user custom photo in the memberlist...HOWEVER, I'm still not able to see it in the member profile...is anyone around to help?
Title: Re: [Mod] Avatar v2.01
Post by: spoiledRHOtten on June 14, 2003, 11:13:26 PM
Hi! I was wondering if it would be possible to show the avatars on the site as random with the user's name and link to profile just like the random pic mod is.......so I guess this is a Mod Request.

Thank ya!
Title: Re: [Mod] Avatar v2.01
Post by: V@no on June 14, 2003, 11:21:00 PM
Quote from: spoiledRHOtten
Hi! I was wondering if it would be possible to show the avatars on the site as random with the user's name and link to profile just like the random pic mod is.......so I guess this is a Mod Request.

not sure what do u mean, but showing random avatar on home page?
maybe show a random username?
or username with random avatar? avatars belong to users, not that users belong to avatars :lol:
Title: Re: [Mod] Avatar v2.01
Post by: spoiledRHOtten on June 14, 2003, 11:28:49 PM
Quote from: V@no
Quote from: spoiledRHOtten
Hi! I was wondering if it would be possible to show the avatars on the site as random with the user's name and link to profile just like the random pic mod is.......so I guess this is a Mod Request.

not sure what do u mean, but showing random avatar on home page?
maybe show a random username?
or username with random avatar? avatars belong to users, not that users belong to avatars :lol:



okay...let's try this......

What if there was a Random User Mod where we could format it like this:

{user_name}
{user_avatar_current}
{user_joindate}

but it would be on the home.html page
Title: Re: [Mod] Avatar v2.01
Post by: spoiledRHOtten on June 21, 2003, 07:55:07 PM
oaky...I figured out why my user's avatar wasnt showing in their profile. I had put the "lang_user_avatar" in the Edit Profile portion instead of in the show user profile portion. And I didnt figure this out until I was working on showing user's comments and V@no suggested it to someone else.

Anyways.....if anyone cares...problem solved.
Title: Re: [Mod] Avatar v2.01
Post by: insomnoid on March 11, 2005, 12:30:58 PM
hi,

got a small problem:

user has uploaded an avatar - after aving it is shown in the user profile - ok.

but when i try to upload a diferent image, the old one is still shown.

just after logging out an login again the new pic is shown.

can someone help?

thx,

o.
Title: Re: [Mod] Avatar v2.01
Post by: universal on March 11, 2005, 07:15:11 PM
how can I show user image in user_logininfo.html ?
using same code as in comments didn`t work, i see something like that (http://jjj)


and what to do to escape these: http://www.pramoga.net/details.php?image_id=2533
Now all users are with avatar from first user
Title: Re: [Mod] Avatar v2.01
Post by: oswald on March 16, 2005, 01:42:48 PM
Hmmm... guess I somehow messed up something cause the avater option does not really look like what it should look like!?
Some php-tags are visible.... and what is with those two "custom" entries..... I only have the blnak.gif... no other pic in the folders..
(http://www.bigredserver.com/4images.jpg)
What went wrong?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on March 16, 2005, 02:33:47 PM
to fix double "custom" items in the list, redo step 1.4 I just updated it.
the tags are shown only on 4images v1.7.1 and the fix is lost after the hack...we'r working on restoring it.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on March 16, 2005, 02:48:46 PM
made a misstake in step 3.x ?

I havent check this mod after the hack, it might have some bugs...
Title: Re: [Mod] Avatar v2.01
Post by: V@no on March 16, 2005, 02:55:33 PM
the tags are shown only on 4images v1.7.1 and the fix is lost after the hack...we'r working on restoring it.
there u go:
http://www.4homepages.de/forum/index.php?topic=6806.0
Title: Re: [Mod] Avatar v2.01
Post by: oswald on March 16, 2005, 03:05:57 PM
Great, thanx! :)
Title: Re: [Mod] Avatar v2.01
Post by: ascanio on April 05, 2005, 08:56:16 PM
Hi V@no why I don't see the avatar on the coments

This is my comment_bits.html
Code: [Select]
<tr>
  <td class="commentrow{row_bg_number}" valign="top" nowrap="nowrap">
    <b>{comment_user_name}</b><br>{user_avatar_current}<br>
{endif user_avatar_current}<br>{if comment_user_ip}<br/>
{comment_user_info}
{if user_avatar_current} <br /><br /><b>IP:</b> {comment_user_ip}{endif comment_user_ip}
  </td>
  <td width="100%" class="commentrow{row_bg_number}" valign="top">
    </p>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td valign="top"><b>{comment_headline}</b></td>
        <td valign="top" align="right">{if admin_links}{admin_links}{endif admin_links}</td>
      </tr>
    </table>
    <hr size="1" />
    {comment_text}
  </td>
</tr>
<tr>
  <td nowrap="nowrap" bgcolor="#D3DCEB">
    <span class="smalltext">{comment_date}</span>
  </td>
  <td bgcolor="#D3DCEB">
    {comment_user_status_img}
    {comment_user_profile_button}
    {comment_user_email_button}
    {comment_user_homepage_button}
    {comment_user_icq_button}
  </td>
</tr>
<tr>
  <td colspan="2" class="commentspacerrow"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
</tr>

And I also want to show the avatar in the member list how can i do that?
Title: Re: [Mod] Avatar v2.01
Post by: ascanio on April 06, 2005, 04:29:20 AM
Hi V@no How can I put this in the register_form.html
 
Code: [Select]
<TD colspan="2" class="head1">{lang_avatar}</TD>
         </TR>

<TR>
<TD class="row2" valign="top" width="35%">
{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" width="64%">
{if user_avatar_file}
{lang_upload}
             <INPUT type="file" name="avatar_file"  size="30" class="input" />
<p>&nbsp;</p>
<table border="0" width="100%">
<tr>
<td width="50%">{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/'+document.creator.user_avatar.options[document.creator.user_avatar.selectedIndex].value;">{user_avatar_images}</SELECT>
</td>
<td>&nbsp;<TABLE width="100%" height="100" border="0">
<TR>
<TD align="center">
{user_avatar_current}
</TD>
</TR>
</TABLE>
<p>&nbsp;</td>
</tr>
</table>
</TD>
Title: Re: [Mod] Avatar v2.01
Post by: V@no on April 06, 2005, 05:12:52 AM
sorry, u cant without modifying register.php
Title: Re: [Mod] Avatar v2.01
Post by: ascanio on April 07, 2005, 12:41:27 AM
Avatars in Register Form

What this do is to allow the new users selet the avatar they want when they register.

 :arrow: What u have to do is this:

Open register.php:

Find the last:
Code: [Select]
$site_template->register_vars(array(
Replace:
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/");

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'],

Save changes.

Open templates/<your_templates>/register_form.html:

Include:

Code: [Select]
<td colspan="3">{if user_avatar_images}
              <tr>
                <td class="row2" valign="top" colspan="3">{if user_avatar_file} <b>{lang_avatar_file}&nbsp;&nbsp;&nbsp;
                  </b><span class="smalltext"><b>(</b>{lang_avatar_dim}<b>)</b></span>
                </td>
                <td class="row2">{if user_avatar_file} {lang_upload} <input type="file" name="avatar_file" size="30" class="input" />
                 
                </td>
              </tr>
              <tr>
                <td class="row1" colspan="3" >
                  <b><font color="#5CE960">O bien</font></b>  , {endif
                  user_avatar_file} <b>{lang_avatar_select}&nbsp;&nbsp;&nbsp;&nbsp;
                  </b>{endif user_avatar_file} <select name="user_avatar"  onkeypress="if(window.event.keyCode==13){ this.form.submit(); }" onChange="document.images.icons.src='{template_url}/avatars/'+document.creator.user_avatar.options[document.creator.user_avatar.selectedIndex].value;">
                 
                 
                  {user_avatar_images}
                  </select></td>
                <td class="row1">{user_avatar_current}
                 
                </td>
              </tr>
              <tr>
                <td colspan="3">{endif user_avatar_images}
               </td>

If you see some errors tell me. But it does work :) I hope this helpin the future
Title: Re: [Mod] Avatar v2.01
Post by: leedzinh on May 05, 2005, 08:01:23 PM
great mod but i have a problem when
Allow users use their own avatars is "no"
member can upload avatar i dont know why
please help me
thanks
Title: Re: [Mod] Avatar v2.01
Post by: leedzinh on May 07, 2005, 09:14:06 AM
help me please
Title: Re: [Mod] Avatar v2.01
Post by: universal on May 07, 2005, 09:17:30 AM
is these in the place?

Code: [Select]
{if user_avatar_images}

...

{endif user_avatar_images}

I can`t imagine how they can upload...
Title: Re: [Mod] Avatar v2.01
Post by: Joshi on June 06, 2005, 07:48:16 PM
Hi!

Long time since I've been here, didn't really understand wheter there is a way to show the person who is logged in on the front page with an avatar. Next to the user name. Example:

Logged in as: Pete
(image of pete)

anyway to achieve this?

J
Title: Re: [Mod] Avatar v2.01
Post by: V@no on June 06, 2005, 11:59:07 PM
http://www.4homepages.de/forum/index.php?topic=3978.msg17618#msg17618
Title: Re: [Mod] Avatar v2.01
Post by: knuffi on June 13, 2005, 09:58:11 PM
Hallo
Habe alles so installiert.... Es funktioniert soweit auch aber es zeigt mir folgendes an

{if user_avatar_file} Upload avatar:
Max. allowed 50x50px
ODER
{endif user_avatar_file} Select from the list:  {if user_avatar_file} 

{endif user_avatar_file} 

Ich bringe diese  ({if user_avatar_file} und {endif user_avatar_file}) nicht weg ohne dass der Upload nicht mehr funktioniert...
Diese erscheinen gleich 2 mal auf der Seite wo man die Avatar uploaden kann.

Wer weis rat

Danke

Hans-Ruedi
Title: Re: [Mod] Avatar v2.01
Post by: V@no on June 14, 2005, 12:05:48 AM
its in bug fixes
Title: Re: [Mod] Avatar v2.01
Post by: TomYork on July 27, 2005, 05:58:32 PM
Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/httpd/vhosts/chilebuses.cl/httpdocs/galerianueva/includes/upload.php on line 330

the error show in member.php


What happen?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on July 28, 2005, 12:25:26 AM
the error show in member.php
you've made a mistake somewhere. restore backups and try again.
Title: Re: [Mod] Avatar v2.01
Post by: Marquis2000 on July 28, 2005, 01:58:39 PM
Wie bekomme ich das Avatarbild in die user_logininfo.html mit {user_avatar_current} gehts leider nicht wieso???

Gruß Marquis
Title: Re: [Mod] Avatar v2.01
Post by: NTH on July 31, 2005, 08:45:33 AM
Hi!
I have a question.
I installed this mod, but doesen't work.
No error message, but I when upload my avatar, no show it.
Plz help me!
View this site: http://fv.fpn.hu/
Title: Re: [Mod] Avatar v2.01
Post by: jkn on September 08, 2005, 04:11:29 PM

***removed***

sorry guy's .. my mistake!  :oops:
Title: Re: [Mod] Avatar v2.01
Post by: sigma on November 11, 2005, 02:12:25 AM
Is there anyway to give guests a generic avatar when they post comments?
Title: Re: [Mod] Avatar v2.01
Post by: sigma on November 11, 2005, 02:56:59 PM
Ok, Ive installed the mod. Its very cool.

Just a few questions.

1. Is there a way to center the avatar in the comments_bit template. right now it looks odd. I cant figure out how to make it stick to the left. Example: http://cydonian.com/photos/details.php?image_id=1036 (scroll down)

2. For some reason when the user uploads his image the word 'Custom' does not appear in the list box. Its just blank. No text. Where can I fix this? what did i miss?

3. Im going to try and do the uploads.php over again because now I cant upload images to my site. It gives me an error. Has this happened to anyone else?

4. and last, any way I can give a generic avatar to guests when they post comments?
Title: Re: [Mod] Avatar v2.01
Post by: sigma on November 12, 2005, 05:19:52 AM
So...

1. I fixed. You can adjust the width of the space in the comments by editing the hspace=\"0\" field in the details.php. look for the following code.
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=\"0\" alt=\"\">" : "",
2. Still cant get the word 'Custom' to show up in the list when user uploads custom avatar. Still searching for an answer. Anyone?

3. I must of missed a line in upload.php because i redid the edit uploading images works fine.

4. Guest Avatar? Turns out you can just change the blank.gif to a generic avatar.

All i need to do is solve #2

Diggin' this mod.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on November 12, 2005, 05:31:18 AM
Check Step 8 make sure you have this line:
Code: [Select]
$lang['custom'] = "Custom";
Title: Re: [Mod] Avatar v2.01
Post by: sigma on November 12, 2005, 05:41:07 AM
Yea its there.

Strange.
Title: Re: [Mod] Avatar v2.01
Post by: drbier on November 17, 2005, 08:58:03 AM
Hallo Leute!
Wollte mir grad das Mod instalieren und bekomm es nicht zum laufen... :(
bei mir schaut es im kontrollzentrum so aus: (wird alles angezeigt die Klammern sollten ja verborgen sein oder)?

Freiwillige Angaben
Homepage:    
ICQ:    
Avatar:
{if user_avatar_file} Upload avatar:
Max. allowed 50x50px
ODER
{endif user_avatar_file} Select from the list:    {if user_avatar_file}

{endif user_avatar_file}

Bitte um hilfe!
Title: Re: [Mod] Avatar v2.01
Post by: V@no on November 17, 2005, 02:34:26 PM
bug fixes
Title: Re: [Mod] Avatar v2.01
Post by: drbier on November 17, 2005, 02:42:31 PM
Verstehe nicht ganz?
Was meinst Du mit Bug-Fixes?
vlg
Title: Re: [Mod] Avatar v2.01
Post by: GeneT on November 21, 2005, 09:05:08 PM
Hi V@no,

when i use this mod it works great, thanks for that!
But one question:

I have made it so that when a user post a comment, his/her avatar is is also posted, and these avatars stays undependent of who is logged in.
I would like to integrate this feature with my guestbook, link: http://www.4homepages.de/forum/index.php?topic=7409.60

When the user1 has posted his/her contribution in the guestbook, his/her avatar is there while he/she is logged in, but when I log in as a user number 2, all avatars are changed to his/her avatar.
So the avatars displayed in the guestbook are all the one avatar the current logged in person has.

Anyway to fix it?
I did add these two things:

guestbook.php
"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=\"\">" : "",

guestbook_comment_bit.html
{if user_avatar_current}
{user_avatar_current}
{endif user_avatar_current}

Can you tell what is still missing?
Should this post have been posted in the guestbook thread, if so, i am sorry.

Sincerly
GeneT
Title: Re: [Mod] Avatar v2.01
Post by: V@no on November 22, 2005, 01:15:59 AM
1) it seems that you added it in the wrong place
2) even if the line was in the right place it would not work.
3) since the guestbook does not save the user's ID, only name, I see no possibility combine both these mods, exept of do quiet many changes in the guestbook code AND guestbook database table
Title: Re: [Mod] Avatar v2.01
Post by: rulez on November 25, 2005, 11:15:20 PM

Parse error: parse error, unexpected '[' in /Gallery/lang/polish/main.php on line 306






Code: [Select]
//-----------------------------------------------------
//--- Admin Links -------------------------------------
//-----------------------------------------------------
$lang['edit'] = "[Edytuj]";
$lang['delete'] = "[Usun]";
$lang['last_comments'] = "Ostatnie komentarze";
$lang['last_comments_more'] = "Wiecej komentarzy...";
$lang['avatar'] = "Avatar: ";
$lang['avatar_file'] = "Upload avatar:";
$lang['avatar_max_dim'] = "Max. allowed";
$lang['avatar_select'] = "Select from the list:";
$lang['custom'] = "Custom";
?>


What happen?
Title: Re: [Mod] Avatar v2.01
Post by: Acidgod on November 25, 2005, 11:16:54 PM
$lang['edit'] = "[Edytuj]";
$lang['delete'] = "[Usun]";

dont use [ and ]
Title: Re: [Mod] Avatar v2.01
Post by: rulez on November 25, 2005, 11:52:03 PM
I used before installation Avatar and everything there was ok :/
Title: Re: [Mod] Avatar v2.01
Post by: rulez on November 25, 2005, 11:55:26 PM
//-----------------------------------------------------
//--- Admin Links -------------------------------------
//-----------------------------------------------------
$lang['edit'] = "Edytuj";
$lang['delete'] = "Usun";
$lang['last_comments'] = "Ostatnie komentarze";
$lang['last_comments_more'] = "Wiecej komentarzy...";
$lang['avatar'] = "Avatar: ";
$lang['avatar_file'] = "Upload avatar:";
$lang['avatar_max_dim'] = "Max. allowed";
$lang['avatar_select'] = "Select from the list:";
$lang['custom'] = "Custom";




Still not work :(
Title: Re: [Mod] Avatar v2.01
Post by: V@no on November 26, 2005, 01:47:36 AM
did u upload .php files in text mode not in binary?
Title: Re: [Mod] Avatar v2.01
Post by: rulez on November 26, 2005, 09:36:39 AM
So, I have made new files .php and also not working... :(
Title: Re: [Mod] Avatar v2.01
Post by: V@no on November 26, 2005, 10:40:46 AM
What editor do you use? I hope NOT something like Word 2000....wordpad or even notepad would work, only plain text editors (or special for html/php) must be used.
Title: Re: [Mod] Avatar v2.01
Post by: rulez on November 26, 2005, 01:07:07 PM
"Pajączek 5 NxG Professional" is polish product, the best :P

Probably, I fail :((
Title: Re: [Mod] Avatar v2.01
Post by: Ax Slinger on November 30, 2005, 11:23:47 AM
V@no,

Is it possible to add a field to the profile to use an offsite avatar instead of an uploaded one, possibly a php avatar rotator?

Great mod...

Now if I can just figure out where I messed up on the installation and fix the size limits. I checked everything, and they still don't work. I can live with it though. I only use the Gallery on a private family forum so my family can upload images and post them on the forum without having to have a website to host them on, so it isn't like it's a really busy Gallery or anything.
Title: Re: [Mod] Avatar v2.01
Post by: Stoleti on December 02, 2005, 06:15:58 AM
i've a small problem ist all work , on editprofile i upload and that show there the image i've upload, but after on profile that isn't showing the avatar , i've tried with {user_avatar}, {user_avatar_current} and still not showing the avatar on profile ...


any ideia of how can i fix it ?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on December 02, 2005, 07:03:06 AM
My guess would be you did wrong Step 1. perhaps you've changed the wrong lines.

@Ax Slinger:
Sorry, not in this mod...
Title: Re: [Mod] Avatar v2.01
Post by: Stoleti on December 02, 2005, 07:57:37 AM
 :D no i've do all correct, the problem its just you've forgot to added

 "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=\"\">" : "",

for //------- Show Profile --------------


you've just added at edit profile , so this explain all, why this only show at edit, but now added it at show profile this is working fine ;) (member.php)
Title: Re: [Mod] Avatar v2.01
Post by: V@no on December 02, 2005, 02:33:38 PM
:D no i've do all correct, the problem its just you've forgot to added

 "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=\"\">" : "",

for //------- Show Profile --------------
a-a (http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/68.gif)
The Step 1 is for "Show profile" and Step 1.4 is for "Edit profile".
Told ya you added it in the wrong place :P ;)
Title: Re: [Mod] Avatar v2.01
Post by: Stoleti on December 02, 2005, 05:03:49 PM
weird because i've made all correct, following all steps.... :wink: , in correct places !!!

but thats works , now doesn't matter anymore  :mrgreen:
Title: Re: [Mod] Avatar v2.01
Post by: TomYork on December 05, 2005, 02:01:14 AM
Quote
Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/lavander/public_html/ga/includes/upload.php on line 332

I Can't Find the error...

I post my member.php in two parts for anybody can help me please...

Code: [Select]
REMOVED
Title: Re: [Mod] Avatar v2.01
Post by: TomYork on December 05, 2005, 02:05:17 AM
My member.php part 2

Code: [Select]
REMOVED
Title: Re: [Mod] Avatar v2.01
Post by: V@no on December 05, 2005, 06:10:56 AM
and you showing that because....?????

Quote
Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/lavander/public_html/ga/includes/upload.php on line 332
Title: Re: [Mod] Avatar v2.01
Post by: TomYork on December 05, 2005, 01:55:38 PM
remember that you put on this forum when I put the same error that review member.php and put the member.php

So i put right now my upload.php

Code: [Select]
REMOVED
Title: Re: [Mod] Avatar v2.01
Post by: V@no on December 05, 2005, 03:06:49 PM
Just restore backups and try again...
Title: Re: [Mod] Avatar v2.01
Post by: TomYork on December 06, 2005, 05:17:59 AM
Well, these error was fixed in my code, but i have another error

Fatal error: Call to undefined function: set_allowed_filetypes() in /home/lavander/public_html/ga/includes/upload.php on line 82


Title: Re: [Mod] Avatar v2.01
Post by: V@no on December 06, 2005, 05:50:01 AM
Just restore backups and try again...
Repeat untill all errors gone ;)

a little tip: pay attention to the brackets { }
Title: Re: [Mod] Avatar v2.01
Post by: TomYork on December 07, 2005, 03:33:00 AM
jejeje I got it!!

Zend Studio r0x :)
Title: Re: [Mod] Avatar v2.01
Post by: Zyga on December 19, 2005, 04:09:27 PM
THX!
great mod and really easy to install

little tip

pay attention on member.php when you have pm mod  8)
Title: Re: [Mod] Avatar v2.01
Post by: vitara on December 19, 2005, 07:19:32 PM
Und wie mache ich dass ohne englisch kenntnis?
Genau so etwas suche ich schon länger, nur verstehe ich kein englisch oder nur kleine Stücke davon, gibt es dass auch in deutsch oder wie komme ich da weiter?

Danke
Vitara
Title: Re: [Mod] Avatar v2.01
Post by: fgallery on January 09, 2006, 04:16:38 AM
Why do these "{if user_avatar_file}" appear ?
(http://f-gallery.com.ua/avatar.gif)
I've checked the code twice!
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 09, 2006, 05:45:29 AM
bug fixes:
http://www.4homepages.de/forum/index.php?topic=7493.0
http://www.4homepages.de/forum/index.php?topic=6806.0

And please apply every fix for your 4images version:
http://www.4homepages.de/forum/index.php?board=17.0
Title: Re: [Mod] Avatar v2.01
Post by: fgallery on January 09, 2006, 01:02:44 PM
bug fixes:
http://www.4homepages.de/forum/index.php?topic=7493.0
http://www.4homepages.de/forum/index.php?topic=6806.0

And please apply every fix for your 4images version:
http://www.4homepages.de/forum/index.php?board=17.0

It worked after this fix http://www.4homepages.de/forum/index.php?topic=7493.0
I've also applied all available security fixes.
Thanks!
Title: Re: [Mod] Avatar v2.01
Post by: chip on January 09, 2006, 03:12:42 PM
Just wanted to say:

 Thanks V@no.

It works perfect  :D.
Title: Re: [Mod] Avatar v2.01
Post by: Stoleti on January 11, 2006, 07:51:45 PM
Quote from: drhtm
is it possible to add the avatar in the box 'Registered Users' after a member login right after their name and above the link to 'lightbox'?

And if a user hasn't chosen an avatar is it possible to put a default image or text in that space to remind the user to choose an avatar?

thanks
hmmm...I like the idea add avatar under the name :wink:
just did it on my site:open /includes/page_header.php
Find:
Code: [Select]
 "url_upload" => (!empty($url_upload)) ? $site_sess->url($url_upload) : $site_sess->url(ROOT_PATH."member.php?action=uploadform"),Add after:
Code: [Select]
"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" name=\"icons\" border=\"0\" alt=\"\">" : "",
Then, open user_logininfo.html template. Add this:
Code: [Select]
{user_avatar_current}

About default image - just change blank.gif with image u want.

and how make it as profile link too ?

cheers ;)
Title: Re: [Mod] Avatar v2.01
Post by: Edy on January 17, 2006, 08:21:57 PM
Hallo zusammen,
ich habe heute das Avatar-Mod installiert, soweit läuft es ohne Fehlermeldung ABER das
Avatar erscheint nicht an der richtigen Stelle, siehe auch Beispiel-Bild

Woran kann das liegen ?

(http://esc-digital.de/Bilder2/AvatarPlatz.jpg)

__________________________________________________________________________________

english

hello together,
I have installed the avatar mod today it works so far fine, yet... the avatar appears at
the shown above place which is not where it's supposed to be. I want it to be shown under the users name.
Any idea what's wrong ?


Title: Re: [Mod] Avatar v2.01
Post by: fgallery on January 17, 2006, 08:30:33 PM
Hallo zusammen,
ich habe heute das Avatar-Mod installiert, soweit läuft es ohne Fehlermeldung ABER das
Avatar erscheint nicht an der richtigen Stelle, siehe auch Beispiel-Bild

Woran kann das liegen ?

(http://esc-digital.de/Bilder2/AvatarPlatz.jpg)

__________________________________________________________________________________

english

hello together,
I have installed the avatar mod today it works so far fine, yet... the avatar appears at
the shown above place which is not where it's supposed to be. I want it to be shown under the users name.
Any idea what's wrong ?


I guess you've put code from Step 11 in a wrong place ;)
Title: Re: [Mod] Avatar v2.01
Post by: Edy on January 17, 2006, 08:58:32 PM
Could you pls specify ...?

I made step '11' but am not sure where exactly it has to be placed.

Title: Re: [Mod] Avatar v2.01
Post by: fgallery on January 17, 2006, 09:07:27 PM
Could you pls specify ...?

I made step '11' but am not sure where exactly it has to be placed.



Show us code of 'comment_bit.html' from your template, plz.
Title: Re: [Mod] Avatar v2.01
Post by: Edy on January 17, 2006, 10:07:42 PM
Quote
Show us code of 'comment_bit.html' from your template, plz.

<tr>
  <td class="commentrow{row_bg_number}" valign="top" nowrap="nowrap">
    <b>{comment_user_name}</b><br />
        {comment_user_info}
        {if comment_user_ip}<br /><br /><b>IP:</b> {comment_user_ip}{endif comment_user_ip}
  </td>
  <td width="100%" class="commentrow{row_bg_number}" valign="top">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td valign="top"><b>{comment_headline}</b></td>
        <td valign="top" align="right">{if admin_links}{admin_links}{endif admin_links}</td>
      </tr>
    </table>
    <hr size="1" />
    {comment_text}
  </td>
</tr>
<tr>
  <td class="commentrow{row_bg_number}" nowrap="nowrap">
    <span class="smalltext">{comment_date}</span>
  </td>
  <td class="commentrow{row_bg_number}">
    {comment_user_status_img}
    {comment_user_profile_button}
    {comment_user_email_button}
    {comment_user_homepage_button}
    {comment_user_icq_button}
  </td>
</tr>
<tr>
  <td colspan="2" class="commentspacerrow"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
</tr>
{if user_avatar_current}
        {user_avatar_current}
        {endif user_avatar_current}
Title: Re: [Mod] Avatar v2.01
Post by: fgallery on January 17, 2006, 10:56:17 PM
Here's the full code for your 'comment_bit.html':
Code: [Select]
<tr>
  <td class="commentrow{row_bg_number}" valign="top" nowrap="nowrap">
{if user_avatar_current}
{user_avatar_current}
{endif user_avatar_current}<br>
   <b>{comment_user_name}</b><br />
        {comment_user_info}
        {if comment_user_ip}<br /><br /><b>IP:</b> {comment_user_ip}{endif comment_user_ip}
  </td>
  <td width="100%" class="commentrow{row_bg_number}" valign="top">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td valign="top"><b>{comment_headline}</b></td>
        <td valign="top" align="right">{if admin_links}{admin_links}{endif admin_links}</td>
      </tr>
    </table>
    <hr size="1" />
    {comment_text}
  </td>
</tr>
<tr>
  <td class="commentrow{row_bg_number}" nowrap="nowrap">
    <span class="smalltext">{comment_date}</span>
  </td>
  <td class="commentrow{row_bg_number}">
    {comment_user_status_img}
    {comment_user_profile_button}
    {comment_user_email_button}
    {comment_user_homepage_button}
    {comment_user_icq_button}
  </td>
</tr>
<tr>
  <td colspan="2" class="commentspacerrow"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
</tr>

Click here for an example (http://www.f-gallery.com.ua/img1237.htm?l=english")
Title: Re: [Mod] Avatar v2.01
Post by: Edy on January 17, 2006, 11:10:27 PM
Thank you verry much for your help  :D
http://esc-digital.de/4images
Title: Re: [Mod] Avatar v2.01
Post by: fgallery on January 17, 2006, 11:17:01 PM
Thank you verry much for your help  :D
http://esc-digital.de/4images

Nichts zu danken! Nebenbei gesagt, schoene Galerie :)
Title: Re: [Mod] Avatar v2.01
Post by: Alex_Ok on January 21, 2006, 12:58:45 AM
Перечитал всё до буквы, но так и не понял отчего у меня выдаёт:
Parse error: parse error, unexpected T_VARIABLE in z:\home\includes\template.php(80) : eval()'d code on line 146

Подскажите  пожалста...
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 21, 2006, 05:22:08 AM
После установки этого мода??? что-то не верится...ошибка в чём-то другом, возможно даже изменённые файлы были закчены kak BINARY а не kak TEXT (ACSII)
Title: Re: [Mod] Avatar v2.01
Post by: Alex_Ok on January 21, 2006, 12:58:19 PM
Переустановил но аватары не грузятся.... при загрузке они не отображаются.
Title: Re: [Mod] Avatar v2.01
Post by: Alex_Ok on January 21, 2006, 01:29:26 PM
{if user_avatar_file} Upload avatar:
Max. allowed 100x100px
ИЛИ
{endif user_avatar_file} Select from the list:  {if user_avatar_file} 

{endif user_avatar_file} 

Вот это отображается в профиле пользователя в графе аватар...и ни чего не меняется при изменении или загрузке
Title: Re: [Mod] Avatar v2.01
Post by: Alex_Ok on January 21, 2006, 02:59:32 PM
Сделал исправления в includes/templates.php,  Положение исправилось , но аватары всёравно не загружаются. Подскажите пожалуйста почему?
Title: Re: [Mod] Avatar v2.01
Post by: himu on January 22, 2006, 05:37:02 AM
hey v@no,

after installing this mod i am getting following error when a user updates his/her member profile.

Fatal error: Call to undefined function: check_email() in /gallery/member.php on line 1086

Help ??   :(
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 22, 2006, 10:31:25 AM
Most probably you've made a misstake in functions.php...
Title: Re: [Mod] Avatar v2.01
Post by: Alex_Ok on January 22, 2006, 01:35:31 PM
V@no  пожалуйста подскажите почему у меня аватары не загружаются хотя после выбора обзором картинка берётся и говорится что профайл пользователя обновлён. Но картинка не появляется нигде. Только файл blank.gif стоит автоматом у всех пользователей но его не видно т.к. он 1 px
Title: Re: [Mod] Avatar v2.01
Post by: himu on January 22, 2006, 03:40:21 PM
Most probably you've made a misstake in functions.php...
could u please help me ..v@no  :oops:
here's the function.php attached.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 22, 2006, 06:43:03 PM
could u please help me ..v@no :oops:
here's the function.php attached.
There is a big chunk of code missing in your file! I hope you have bakups...
Title: Re: [Mod] Avatar v2.01
Post by: himu on January 22, 2006, 07:20:04 PM
There is a big chunk of code missing in your file! I hope you have bakups...
Thanks! V@no...
got it fixed.. only this was missing:
Code: [Select]
function check_email($email) { :oops:
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 22, 2006, 07:24:35 PM
I think there is more then just that missing..
Title: Re: [Mod] Avatar v2.01
Post by: Alex_Ok on January 24, 2006, 10:46:06 AM
Уважаемый V@no  подскажите почему при запуске инсталятора этого мода получается ошибка:

Warning: fopen(avatar.sql): failed to open stream: No such file or directory in /home/public_html/install_avatar.php on line 34

Warning: fgetcsv(): supplied argument is not a valid stream resource in /home/public_html/install_avatar.php on line 35

Warning: fclose(): supplied argument is not a valid stream resource in /home/public_html/install_avatar.php on line 44

DB Error: Bad SQL Query: ALTER TABLE 4images_users ADD `user_avatar` VARCHAR( 255 ) NOT NULL
Duplicate column name 'user_avatar'
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 24, 2006, 02:49:31 PM
файл avatar.sql не найден в корневой директории галереии, или неправильно установленны аттрибуты файла (permissions)
А последняя ошибка говорит, что база данных уже раньше была обновлена.
Title: Re: [Mod] Avatar v2.01
Post by: Alex_Ok on January 24, 2006, 05:14:32 PM
Во я лохонулся .... Спасибо огромное V@no .
Подскажите пожалуйста какой мод можно прицепить для более полной инфы пользователей, ну чтоб при регистрации была возможност добавить город, день рождения телефон адрес и т.д. или не обязательно при регистрации , а при изменении профиля например.
Если есть такой подкиньте ссылочку пожалста.. :)
Title: Re: [Mod] Avatar v2.01
Post by: Alex_Ok on January 26, 2006, 09:18:09 PM
Во я лохонулся .... Спасибо огромное V@no .
Подскажите пожалуйста какой мод можно прицепить для более полной инфы пользователей, ну чтоб при регистрации была возможност добавить город, день рождения телефон адрес и т.д. или не обязательно при регистрации , а при изменении профиля например.
Если есть такой подкиньте ссылочку пожалста.. :)
Подскажите хоть как он называется
Title: Re: [Mod] Avatar v2.01
Post by: trez on January 27, 2006, 01:58:34 AM
great mod, works perfekt  :!:
Just aquestion, is it possible to autoresize uploadet avatars for being more user-friendly?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 27, 2006, 02:05:08 AM
Just aquestion, is it possible to autoresize uploadet avatars for being more user-friendly?
Sorry, no.
Title: Re: [Mod] Avatar v2.01
Post by: Peterpl on January 27, 2006, 10:19:58 AM
I have problem from this modem.
Upload does not act me and I have something like this how below:

What it can this be.
Where I could make mistake.

I greet.
Title: Re: [Mod] Avatar v2.01
Post by: Vincent on January 27, 2006, 11:00:34 AM
@Peterpl
you edited in a Wysiwyg Software and not the real Code! I belive  :?
sincerly
vincent
Title: Re: [Mod] Avatar v2.01
Post by: Peterpl on January 27, 2006, 01:40:18 PM
How this is not true code do not understand so as exactly did it was in first fast.
Or you would can say where I could make mistake - because alone I be not able to this place find.

Thanks

I greet.
Title: Re: [Mod] Avatar v2.01
Post by: insane on January 27, 2006, 02:33:17 PM
i've got the same problem as peterpl and following error:

Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /usr/export/www/vhosts/funnetwork/hosting/paddygree/4images/includes/upload.php on line 331

how can i fix the problem?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 27, 2006, 02:53:22 PM
@Peterpl:
Two words: Bug Fixes


i've got the same problem as peterpl and following error:
Not quiet sure what is so simular to Petrpl's problem, but in your case the answer is: restore backups and try again.
Title: Re: [Mod] Avatar v2.01
Post by: Alex_Ok on January 27, 2006, 03:31:13 PM
Уважаемый V@no плиз... подкинте ссылочку на дополнение инфы пользователями (город, дата рождения, тел и т.д) А то я скопировал и перевёл уже все странички форума, но так и не увидел того что мне нужно)
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 27, 2006, 03:38:20 PM
http://www.4homepages.de/forum/index.php?topic=10040.0
Title: Re: [Mod] Avatar v2.01
Post by: Peterpl on January 27, 2006, 03:44:07 PM
I do not understand what Bug Fixes.
I did all with instructions with first point peaceably.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 28, 2006, 12:34:19 AM
I do not understand what Bug Fixes.
I did all with instructions with first point peaceably.
:roll:
Look in my signature
Title: Re: [Mod] Avatar v2.01
Post by: Peterpl on January 28, 2006, 08:40:56 AM
And what is in your signature, because nothing special I did not find it walks, about section
Bug Fix ?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 28, 2006, 05:07:38 PM
http://www.4homepages.de/forum/index.php?board=17.0
apply ALL the fixes, ok?
Title: Re: [Mod] Avatar v2.01
Post by: Peterpl on January 28, 2006, 05:28:03 PM
they do not fit to my situation no of these mistakes.
can this something of different be ??
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 28, 2006, 06:15:43 PM
they do not fit to my situation no of these mistakes.
Did you apply ALL of them before you stated that? I dont think so.
These are the fixes for the bugs in 4images, if you dont wish to fix your 4images then dont cry that it doesnt work properly.
Title: Re: [Mod] Avatar v2.01
Post by: Stoleti on January 29, 2006, 06:34:59 PM
Any way to make it work on PMS ? (pms_view.html) ?

would be great see it work there  8)

Note: Show the avatar of the user of who have send  :mrgreen:
Title: Re: [Mod] Avatar v2.01
Post by: crcbad on January 29, 2006, 11:33:31 PM
Hi V@no again! ;) Hope you remember me :P

I've installed this mod, it works fine! Great Mod!

I have installed dreamboard and I would like to put the user's avatar in the showthread.php... I know is an addon you didn't make, but, I suppose you can give me some code to put in order to recover the user's current avatar, and then show it in the php file.

TheOracle tried a few code but the code puts an image in the first post where an user dont have avatar... so I hope you can put a the correct code, actually:

Code: [Select]
         while ($user = mysql_fetch_array($posts)) {
             $post_count = $user['user_posts'];
$user_id = $user['user_id'];
$user_rank = $user['user_level'];
             $date_registered =(isset($user['user_joindate'])) ? format_date($boardconfig['date_format'], $user['user_joindate']) : REPLACE_EMPTY;
             $signature = format_boardtext ($user['user_signature'],$boardconfig['html_board'], $boardconfig['wordwrap_board'], $boardconfig['bb_board'], $boardconfig['bb_image_board'],1);
$user_avatar = $user_info['user_avatar'];
$user_avatar_current = ($config['avatar_use'] && @file_exists(TEMPLATE_PATH."/avatars/".$user_avatar)) ? "<img src=\"".TEMPLATE_PATH."/avatars/".$user_avatar."\">" : get_gallery_image("blank.gif");


          }

But the avatar shown don't correspond to user, any idea?

Many thanks :)
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 30, 2006, 12:24:43 AM
Try use
Code: [Select]
$user_avatar = $user['user_avatar'];instead of
Code: [Select]
$user_avatar = $user_info['user_avatar'];if it doesnt work, then you'll need add user_avatar into the $sql query.
Title: Re: [Mod] Avatar v2.01
Post by: crcbad on January 30, 2006, 12:43:04 AM
Doesn't seem to work :(

What happens: If a post have no replies, the avatar shows ok, if there are replies, for example: USER1 who has no avatar writes a post ME reply, and USER reply again, my avatar shows at the first post, in USER1

The complete sentence is:

Code: [Select]
$posts = mysql_query ("SELECT user_posts,user_id,user_name,user_level,
user_joindate,user_signature,user_avatar
FROM ".USERS_TABLE."  WHERE user_id ='$thrstarter_id' ");
         while ($user = mysql_fetch_array($posts)) {
             $post_count = $user['user_posts'];
$user_id = $user['user_id'];
$user_rank = $user['user_level'];
             $date_registered =(isset($user['user_joindate'])) ? format_date($boardconfig['date_format'], $user['user_joindate']) : REPLACE_EMPTY;
             $signature = format_boardtext ($user['user_signature'],$boardconfig['html_board'], $boardconfig['wordwrap_board'], $boardconfig['bb_board'], $boardconfig['bb_image_board'],1);
$user_avatar = $user_info['user_avatar'];
$user_avatar_current = ($config['avatar_use'] && @file_exists(TEMPLATE_PATH."/avatars/".$user_avatar)) ? "<img src=\"".TEMPLATE_PATH."/avatars/".$user_avatar."\">" : get_gallery_image("blank.gif");


          }

You see something anormal?
Title: Re: [Mod] Avatar v2.01
Post by: TheOracle on January 30, 2006, 12:49:28 AM
I think I was the one who state the $user_avatar string ... this is a dreamboard MOD code ... why is it in the avatar MOD's topic ? ...

The user_avatar field has already been discussed there.

However, change the above with :

Code: [Select]

$posts = "

SELECT ".get_user_table_field("", "user_id"). get_user_table_field(",", "user_name"). get_user_table_field(",", "user_level")." user_posts, user_joindate, user_signature, user_avatar
FROM ".USERS_TABLE." 
WHERE ".get_user_table_field("", "user_id")." = ".$thrstarter_id;

$result = $site_db->query($posts);

while ($user = $site_db->fetch_array($result)) {

$post_count = $user['user_posts'];
$user_id = $user['user_id'];
$user_rank = $user['user_level'];
$date_registered = (isset($user['user_joindate'])) ? format_date($boardconfig['date_format'], $user['user_joindate']) : REPLACE_EMPTY;
$signature = format_boardtext ($user['user_signature'],$boardconfig['html_board'], $boardconfig['wordwrap_board'], $boardconfig['bb_board'], $boardconfig['bb_image_board'], 1);
$user_avatar = $user['user_avatar'];
$user_avatar_current = ($config['avatar_use'] && @file_exists(TEMPLATE_PATH."/avatars/".$user_avatar)) ? "<img src=\"".TEMPLATE_PATH."/avatars/".$user_avatar."\">" : get_gallery_image("blank.gif");

}


Note: Code edited above.
Title: Re: [Mod] Avatar v2.01
Post by: crcbad on January 30, 2006, 12:56:14 AM
Yes, the code is of Dreamboard...

TheOracle I followed all the thread there, and at the end, you will give a solution for the avatar question... By the way, Avatars Mod is from V@no, so, I asked him in order to know his point of view, but sorry, I apologize ;)

About the sql code, doesn't work, know, thre is no picture shown now :(
Title: Re: [Mod] Avatar v2.01
Post by: TheOracle on January 30, 2006, 12:58:59 AM
Quote

About the sql code, doesn't work, know, thre is no picture shown now


I followed V@no's suggestion for switching from $user_info['user_avatar'] to $user['user_avatar'] ... doesn't it show the avatar images for each users (+ the fact the user_avatar field was, indeed, added into the $posts SQL query) ?

In the mean time, please take note the code has been edited above. ;)
Title: Re: [Mod] Avatar v2.01
Post by: crcbad on January 30, 2006, 01:07:23 AM
Doesn't work still, and now with some errors, in order to see the progress, i give you the URL:

http://www.eruben.biz/Galeria/showthread.php?bid=6&threadid=4

In this URL the first person doesn't have avatar, the next user ( ME :p ) yes, and the next, the topic-starte not.

The code that now have is:

Code: [Select]
$posts = "

SELECT ".get_user_table_field(",", "user_id"). get_user_table_field(",", "user_name"). get_user_table_field(",", "user_level")." user_posts, user_joindate, user_signature, user_avatar
FROM ".USERS_TABLE."  
WHERE ".get_user_table_field("", "user_id")." = ".$thrstarter_id;

$result = $site_db->query($posts);

while ($user = $site_db->fetch_array($result)) {

$post_count = $user['user_posts'];
$user_id = $user['user_id'];
$user_rank = $user['user_level'];
$date_registered = (isset($user['user_joindate'])) ? format_date($boardconfig['date_format'], $user['user_joindate']) : REPLACE_EMPTY;
$signature = format_boardtext ($user['user_signature'],$boardconfig['html_board'], $boardconfig['wordwrap_board'], $boardconfig['bb_board'], $boardconfig['bb_image_board'], 1);
$user_avatar = $user['user_avatar'];
$user_avatar_current = ($config['avatar_use'] && @file_exists(TEMPLATE_PATH."/avatars/".$user_avatar)) ? "<img src=\"".TEMPLATE_PATH."/avatars/".$user_avatar."\">" : get_gallery_image("blank.gif");

}
Title: Re: [Mod] Avatar v2.01
Post by: TheOracle on January 30, 2006, 01:09:05 AM
My mistake. I have just corrected a slight mistake above.  :oops:
Title: Re: [Mod] Avatar v2.01
Post by: crcbad on January 30, 2006, 01:12:15 AM
Ok, no errors now, but the problem persist.

The image, what is broken now, it shows in the topic starter, but the avatar must show with my user.  :oops:

Sorry for asking and asking and asking ;)
Title: Re: [Mod] Avatar v2.01
Post by: TheOracle on January 30, 2006, 01:25:35 AM
Another user already reported this error from the dreamboard MOD topic. As I stated, I'm currently trying to find out a solution to fix this. If no one else posts this before I do, I will gladly post the corrections as soon as I find something. ;)

In the mean time, you might want to make the corrections from the quote you posted after mine (right above) to avoid further confusion. ;)
Title: Re: [Mod] Avatar v2.01
Post by: crcbad on January 30, 2006, 01:27:40 AM
Ok then TheOracle... Thank you for the time trying to help me ;)

I'll look tomorrow in the other thread in order to see if you can make the fix :)

On more thanks.
Title: Re: [Mod] Avatar v2.01
Post by: Fragezeichen on January 31, 2006, 12:58:56 PM
Many thanks,it realy works great!
You are my hero of the day

(http://www.smiliemania.de/smilie132/00001376.gif)
Title: Re: [Mod] Avatar v2.01
Post by: insane on February 02, 2006, 03:34:52 PM
(http://img523.imageshack.us/img523/1328/unbenannt6pu.th.jpg) (http://img523.imageshack.us/my.php?image=unbenannt6pu.jpg)
The avatar is at the wrong place, isn't it?

(http://img442.imageshack.us/img442/9977/unbenannt12oy.th.jpg) (http://img442.imageshack.us/my.php?image=unbenannt12oy.jpg)
The { } should not be visible, are they?

How can i fix these things?
Title: Re: [Mod] Avatar v2.01
Post by: TheOracle on February 02, 2006, 10:05:12 PM
@insane:

I wish I could see what you're trying to show but your 4.adbrite.com site kinds of restricting me to see the rest of your site. Perhaps you'd like to remove this link from your header so that I could check these screenshots ?

Another solution would be to attach your image within your next message in this topic so that I could click on the attachment. ;)
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 03, 2006, 02:30:50 AM
insane, so many times you've asked questions that are already answered in the faq or were fixed in our "bug fixes" forum, so how about do it the proper way: you go and apply EVERY SINGLE FIX that you can find in Bug fixes (http://www.4homepages.de/forum/index.php?board=17.0) forum for you 4images version.
Then, if something else come up, you ask. I think its not such a bad idea ;)


P.S. about first screenshot - design is your task, obviously you made a misstake in the template.
Title: Re: [Mod] Avatar v2.01
Post by: insane on February 03, 2006, 07:14:48 AM
i'm scared of destroying my mods which are already installed by putting this fixes up :(
http://img442.imageshack.us/img442/9977/unbenannt12oy.jpg
http://img523.imageshack.us/img523/1328/unbenannt6pu.jpg
Title: Re: [Mod] Avatar v2.01
Post by: getmore on February 03, 2006, 01:18:01 PM
Hello V@ano,

first of all: Thanks for your many nice Mods.  :)

*edit* problem solved.
Title: Re: [Mod] Avatar v2.01
Post by: mawenzi on February 03, 2006, 02:16:34 PM
@ insane
... prinzipiell solltest du die Installationsanweisungen genau befolgen und dann auch im Thema lesen ...  :!:
... denn es wurde bereits alles was du fragst beantwortet ...

zum Bild 1 :
... http://www.4homepages.de/forum/index.php?topic=3978.msg59010#msg59010
... http://www.4homepages.de/forum/index.php?topic=6806.msg29767#msg29767

zum Bild 2 :
... du solltest {user_avatar_current} in die comment_bit.html einfügen, am besten unter {comment_user_level} ...
... und so wie es aussieht steht dieser Tag in der details.html ...
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 03, 2006, 02:37:07 PM
i'm scared of destroying my mods which are already installed by putting this fixes up :(
That's why people invented backups :P
If you are not going to fix your 4images, then you really cant expect much help...
Title: Re: [Mod] Avatar v2.01
Post by: insane on February 03, 2006, 02:46:09 PM
pic 1 funktioniert nun.
{user_avatar_current} hab ich nicht in der details.html und {comment_user_level} kann ich nicht finden in der comment_bit.html:

Code: [Select]
<tr>
  <td class="commentrow{row_bg_number}" valign="top" nowrap="nowrap">
    <b>{comment_user_name}</b><br />
{comment_user_info}
{if comment_user_ip}<br /><br /><b>IP:</b> {comment_user_ip}{endif comment_user_ip}
  </td>
  <td width="100%" class="commentrow{row_bg_number}" valign="top">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td valign="top"><b>{comment_headline}</b></td>
        <td valign="top" align="right">{if admin_links}{admin_links}{endif admin_links}</td>
      </tr>
    </table>
    <hr size="1" />
    {comment_text}

  </td>
</tr>
<tr>
  <td class="commentrow{row_bg_number}" nowrap="nowrap">
    <span class="smalltext">{comment_date}{if user_avatar_current}
{user_avatar_current}
{endif user_avatar_current}</span>
  </td>
  <td class="commentrow{row_bg_number}">
    {comment_user_status_img}
    {comment_user_profile_button}
    {comment_user_email_button}
    {comment_user_homepage_button}
    {comment_user_icq_button}

  </td>
</tr>
<tr>
  <td colspan="2" class="commentspacerrow"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
</tr>
Title: Re: [Mod] Avatar v2.01
Post by: mawenzi on February 03, 2006, 03:23:41 PM
@ insane
... dann nehme in deinem Fall ... {comment_user_info} ...
Title: Re: [Mod] Avatar v2.01
Post by: insane on February 03, 2006, 03:31:49 PM
ok scheint zu funktionieren danke dir.
Title: Re: [Mod] Avatar v2.01
Post by: amoego on February 22, 2006, 01:46:07 AM
hi,
your Mod is really great, but i have few questions.

I want to show the user avatar on the detail.html, just below the User Name.

I have already fixed it on page_header.php but i cannot see it.

Other problem is, that only registered user can see my avatar. But i want that all can see it.

here is my link: www.amoego.de (http://www.amoego.de)

Sorry my bad english, but i hope you can help me...please
Title: Re: [Mod] Avatar v2.01
Post by: awf on March 10, 2006, 01:17:28 PM
Does anybody tryed this MOD on ver. 1.7.2 ?
Title: Re: [Mod] Avatar v2.01
Post by: BartAfterDark on March 10, 2006, 01:39:32 PM
Does anybody tryed this MOD on ver. 1.7.2 ?
Yea. Works fine for me :)
Title: Re: [Mod] Avatar v2.01
Post by: live@ct on March 11, 2006, 09:37:31 PM
Its there a possibility to upload the avatar for a user by the ACP ?!?!?!
or have a different list thant only see the admin to asign a avatar for a user?!?!

thanks for your help!
Title: Re: [Mod] Avatar v2.01
Post by: MMantler on March 14, 2006, 04:29:33 PM
First of all hello to everyone!  :D
As you see this is my first post here.. I already read through this and other topics but unfortunately could not find any solution.. so here is my problem:

I used the mod on page 4 to implement the phpbb2 avatars... in comment_bit.html I added the following line:
{if comment_user_avatar} <img src="../phpbb2/images/avatars/{comment_user_avatar}"> {endif comment_user_avatar}

this works fine but as soon as someone who is not registered adds a comment right after a person who is registered and uses an avatar, the avatar of the registered person is also shown beside the post of the unregistered person..
i assume that I have to add something like "  else <img src="../phpbb2/images/avatars/BLANK.GIF"> " but as I am a php noob I have no idea how to tell the script to link to a blank image as soon as a person is not registered or uses no avatar.. so I need your help  :oops:

Sorry for my bad English.. i hope you understand what the problem is.. THANX
Title: Re: [Mod] Avatar v2.01
Post by: Stoleti on March 28, 2006, 12:17:29 AM
i've one problem with avatars size, i've make in ACP the max of 400 x 300 px , but this still allow users to upload images more larger !!! how fix it ? :?:
Title: Re: [Mod] Avatar v2.01
Post by: V@no on March 28, 2006, 01:29:03 AM
Tripple check Steps 3.x
Title: Re: [Mod] Avatar v2.01
Post by: Stoleti on March 28, 2006, 01:35:28 AM
i must change it :

$this->max_size['avatar'] = 99999999999;

 :?:  :oops:
Title: Re: [Mod] Avatar v2.01
Post by: V@no on March 28, 2006, 02:03:32 AM
Its file size not the dimentions.
Title: Re: [Mod] Avatar v2.01
Post by: Ty on April 19, 2006, 06:51:37 PM
Hi!

I installed this mod, but now I want to uninstall it beacuse of my database's size. How can I do to delete this field from my database?

Please, help me!  :wink:
Title: Re: [Mod] Avatar v2.01
Post by: mawenzi on April 21, 2006, 12:01:58 AM
How can I do to delete this field from my database?

... by using phpMyAdmin ...
Title: Re: [Mod] Avatar v2.01
Post by: Ty on April 26, 2006, 03:33:41 AM
How can I do to delete this field from my database?

... by using phpMyAdmin ...

But how can I do this?? Just deleting de users_avatars field??
Title: Re: [Mod] Avatar v2.01
Post by: V@no on April 26, 2006, 10:05:31 AM
yes, that will do the trick ;)
Title: Re: [Mod] Avatar v2.01
Post by: live@ct on May 04, 2006, 09:59:24 AM
How can I add the avatar selection in the register form?!?!?!

thanks for your help!!
Title: Re: [Mod] Avatar v2.01
Post by: Sir Sky-Walker on May 22, 2006, 08:34:03 PM
Hat jemand eine Anleitung für 1.7.2 ?

Hab die ersten beiden Punkte mal versucht zu machen, hab aber die angeben nie finden können  :x

Bitte helft mir, will unbedingt diesen Mod !
Title: Re: [Mod] Avatar v2.01
Post by: b.o.fan on June 04, 2006, 02:38:09 PM
Hello, v@no and the others...

i ve a problem with this [MOD]  :( :(

I can't upload a avatar...
*edit*
the file is uploded! But not entry in the database :(

the same is with memberphoto [mod] :(

i put my member.php and my db_field_definitions.php on this thread...

the avatar-path has CHMD 777 and user too..

P.S. on www.wartenaufden15.de/neu/ you can test it. with

USER test
PW test
Title: Re: [Mod] Avatar v2.01
Post by: V@no on June 04, 2006, 07:27:02 PM
and did you run the installer? are the new fields added into 4images_users table?
Title: Re: [Mod] Avatar v2.01
Post by: b.o.fan on June 04, 2006, 08:29:38 PM
yes i did...

for a moment this all gone... but then... :(
Title: Re: [Mod] Avatar v2.01
Post by: anderitor on June 21, 2006, 05:06:23 PM
Hallo,

ich bräuchte auch eine Anleitung für 1.7.2, da die Schritte der ersten Seite leider nicht ausführbar sind. Die Textstellen sind nicht zu finden.

______________________________

Hello,
I need instructions for 4images 1.7.2!

Can someone help me, please?


Kann mir bitte jemand helfen?


Vielen Dank
Much Thanks
Title: Re: [Mod] Avatar v2.01
Post by: ded on June 23, 2006, 06:59:24 AM
Privet V@no. Delay MOD kak pokazano. Vse ok. NO avatar ne zalivaytsa zamesto vibrannogo avatara poyavlyaetsa "blank.gif"! v chem prichina?
Title: Re: [Mod] Avatar v2.01
Post by: Icemann71 on June 23, 2006, 01:59:18 PM
Hallo,

ich bräuchte auch eine Anleitung für 1.7.2, da die Schritte der ersten Seite leider nicht ausführbar sind. Die Textstellen sind nicht zu finden.

______________________________

Hello,
I need instructions for 4images 1.7.2!

Can someone help me, please?


Kann mir bitte jemand helfen?


Vielen Dank
Much Thanks

Hallo
wo liegt denn dein Problem bei mir Funzt er einwandfrei nach der Anleitung
schau mal hier (http://www.cover-fun.de)
Title: Re: [Mod] Avatar v2.01
Post by: anderitor on June 23, 2006, 11:39:38 PM
ich weiß leider nicht, wo ich den code in der member.php einfügen soll!

könntest du mir den code deiner member.php vielleicht senden?

Aber du hast auch schon version 1.7.2 installiert? bei 1.7.1 war es bei mir auch kein prob!

danke
Title: Re: [Mod] Avatar v2.01
Post by: ded on June 25, 2006, 09:34:17 AM
ну так мне кто нибудь поможет? или будем на немецком речи толкать? которые я в принцепи не понимаю
Title: Re: [Mod] Avatar v2.01
Post by: 8o8o8.com on June 27, 2006, 04:30:17 PM

Hello can not download the installer files
please anyone upload the files on a new link or attach them with the topic

thankx  :)
Title: Re: [Mod] Avatar v2.01
Post by: V@no on June 28, 2006, 12:44:38 AM
done
Title: Re: [Mod] Avatar v2.01
Post by: waleed on July 01, 2006, 07:01:38 AM
instructions for 4images 1.7.2! plz
Title: Re: [Mod] Avatar v2.01
Post by: kyzer on July 02, 2006, 05:11:38 PM
waleed... the instructions are the same...
I installed it today and it was easy...
just follow the same instructions!
Title: Re: [Mod] Avatar v2.01
Post by: waleed on July 02, 2006, 05:40:25 PM
i cant find the code in step 1.4.

kyzer can u send me the files plz ?
Title: Re: [Mod] Avatar v2.01
Post by: Aleksey on July 28, 2006, 09:48:50 AM
How limit size upload avatar? Like no more 50 kb..
Title: Re: [Mod] Avatar v2.01
Post by: dado supremo on July 30, 2006, 08:44:23 PM
hai V@em   

I am Brazilian and alone I know to say Portuguese, I am using a translator online, I wait that it understands me!   

 I have 4Images Gallery 1.7.3, made all steps as you he described, I made he ties tres times and he happened the same thing.    in the hour to edit profile it appears the table of avatar, but it does not appear no identification of avatr, the unicas things that appear are: a field and one botao of search to the side, one lists blank, and when I make upload of avatar, it appears.  he would like that he helped me in this, and when I give upload in one another different one it only appears when I bring up to date the page!    Do not have a skill of when you to give upload ja to appear the new?    e the list, does not have as when vc to select, to appear the image to the side, to know as is to avatar, before choosing?    Good I would like that you I repondesse in English and later procurase a translator and to place in mine lingua, I would help very   

debtor and great work
Title: Re: [Mod] Avatar v2.01
Post by: V@no on July 30, 2006, 08:48:25 PM
sorry, I didnt quet understand the problem...try make a screenshot or something...
Title: Re: [Mod] Avatar v2.01
Post by: Stoleti on July 30, 2006, 09:03:35 PM
that description makes hard understand... maybe ill be more easy post at portuguese and wait for someone who knows portuguese helps you... (my suggestion)  :wink:
Title: Re: [Mod] Avatar v2.01
Post by: IGC on August 05, 2006, 03:23:42 AM
V@no, great mod.

Just one problem:

When I try to use the [Browse...] button to select my avatar. Nothing happens. The image is not uploaded to the avatars folder, or the users folder. (The permissions are set to 777).
When I click 'Save' I get the 'Profile updated' response but it does not update anything.

I followed all the steps on the post, installed the mod using the files and everything. Only extra thing I did was delete the install_avatar.php and avatar.sql after I used it because I did not want to leave it there.

Do you know what the problem may be?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on August 05, 2006, 04:57:13 AM
are you sure it doesnt update anything? or avatar not updated?
check your member_editprofile.html template and make sure its modifyed correctly as in Step 10

Also, check Step 4 and 12

I bet the misstake in either of these 3 steps.
Title: Re: [Mod] Avatar v2.01
Post by: IGC on August 05, 2006, 07:16:42 AM
I didn't explain myself completely.

The 'SAVE' button works EXCEPT when I use the [Browse...] button to update my avatar.

I can update my info, or update my avatar if I select it from the list of avatars that were uploaded to the server.

However, if I browse for the image and save it does not work at all.

IGC
Title: Re: [Mod] Avatar v2.01
Post by: V@no on August 05, 2006, 09:58:04 AM
Ok, then we narrowed it down to Step 10 or permissions issue.
Title: Re: [Mod] Avatar v2.01
Post by: IGC on August 06, 2006, 04:47:03 AM
Ok, then we narrowed it down to Step 10 or permissions issue.

You were right...

I forgot to add the little modification on the <form ...> line.

I didn't want to copy everything in step 10, because I didn't want to change the modifications I made to my layout. I tried to avoid any changes that were unneccessary, and I completely missed the first line  :oops:

Thanks for your help V@no
Title: Re: [Mod] Avatar v2.01
Post by: V@no on August 06, 2006, 06:18:37 AM
Since you are not the first person experienced this I've highlighted the new added code in Step 10
Title: Re: [Mod] Avatar v2.01
Post by: Aleksey on August 06, 2006, 12:33:28 PM
How set quota size in 50 kilobyte for uload avatar? This possible?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on August 06, 2006, 12:38:14 PM
in includes/upload.php set in bytes:
Code: [Select]
    $this->max_size['avatar'] = 99999999999;
Title: Re: [Mod] Avatar v2.01
Post by: Aleksey on August 07, 2006, 12:51:34 PM
oops) sorry.. Thanks Vano :)
Title: Re: [Mod] Avatar v2.01
Post by: Fastian on September 02, 2006, 10:35:44 AM
Great Mod V@no
I just installed it and it works just perfect :)
However there is one little problem for me. In my settings I have Max avatar width & height as 50 pixels. But for some reason, I was able to upload images of 100 width & 100 height.

I think it’s because of some other mod.
Tell me how I could I correct it.
Where to start digging??

//Edited
Stupid me.  :oops:
I was checking being Admin.
Title: Re: [Mod] Avatar v2.01
Post by: Fastian on September 05, 2006, 09:30:26 PM
Hello V@no

I am having a small issue with this Mod.
I installed the Mod from your first post and every thing was just perfect. It was working the way it should.

Then I applied the changes you posted here
http://www.4homepages.de/forum/index.php?topic=3978.msg17618#msg17618
To show the avatar below the registered user name in Menu (Above Lightbox).

After this, now when I select the avatar from the list, the avatar immediately change from the menu (Above Lightbox) but the avatar below the avatar list remain the same. (It only got changed when save profile and come back again)

Is there a way to solve this small issue??

I hope i was able to clear the point.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on September 06, 2006, 12:33:41 AM
remove name=\"icons\" from page_header.php
Title: Re: [Mod] Avatar v2.01
Post by: Romson on December 05, 2006, 07:48:19 PM
Hi, great mod !

is it possible to display the avatar on the details page under the name of the image uploader ?
Title: Re: [Mod] Avatar v2.01
Post by: desperate_housewif on December 17, 2006, 10:39:33 AM
Wenn ich lediglich ein Avatar im Kontrollzentrum des jeweiligen Mitgliedes haben möchte, welches er selbst hochladen kann, welche der Änderungen sind im Mod erforderlich und welche kann ich weglassen. Oder ist dieser Mod dann gänzlich ungeeignet und es gibt eine andere Möglichkeit?
Title: Re: [Mod] Avatar v2.01
Post by: chudy16 on January 09, 2007, 04:08:53 PM
I have a huge problem with this mod . . .

I have done everything 2 times and when I choose an avatar, in the database there is no change

I may upload some avatar, avatar will be on server but there is still no change in database

In database there is still no number, letter nothin in row user_avatar !!!!

Can someone help mee ? ? ?
Title: Re: [Mod] Avatar v2.01
Post by: Loda on January 10, 2007, 09:48:38 AM
Hi, great mod !

is it possible to display the avatar on the details page under the name of the image uploader ?

very good question.. i want to know that, too...
Title: Re: [Mod] Avatar v2.01
Post by: desperate_housewif on February 10, 2007, 06:20:43 PM
Avatar wird nicht in Kommentaren abgebildet. Braucht auch nicht so zu sein, da ich die hochgeladenen Bilder lediglich als Benutzerfotos nutzen möchte, sollen Sie in dem Profil erscheinen. Dafür habe ich folgenden Code in der member_profil.html eingebunden

Code: [Select]
{if user_avatar_current} {user_avatar_current} {endif user_avatar_current}
Es erscheint kein Bild. Habe ich vorher schon etwas verkehrt gemacht?
Title: Re: [Mod] Avatar v2.01
Post by: keka_u92 on March 04, 2007, 06:35:56 AM
(http://deferoblog.com/fotoclub/templates/default/avatars//image.gif)

Hi, I am able to upload Avatars and see them in Comments. Please help me figure out how to use premade Avatars for users. I have created templates/default/avatars/ and uploaded images there, but as the photo above shows it does nto work, thanks!
Title: Re: [Mod] Avatar v2.01
Post by: shan on March 04, 2007, 07:01:15 PM
Hey, how can we change the max size to 100x100?
Title: Re: [Mod] Avatar v2.01
Post by: keka_u92 on March 04, 2007, 07:29:58 PM
Hey, how can we change the max size to 100x100?


In admin control panel, "Avatar" settings has that option to change size in px.
Title: Re: [Mod] Avatar v2.01
Post by: Jenn on March 16, 2007, 04:31:54 PM
Works perfect in 1.7.4.

Is it possible to have a sample of the preinstalled avatars display so users can see what they look like?

Title: Re: [Mod] Avatar v2.01
Post by: maus on May 29, 2007, 12:25:56 PM
Ich möchte Avatar v2 für 4images v1.7.4 kann aber kein Wort Englisch
also ich habe einiges ausprobiert ich bekomme es mal wieder nicht hin ich bin so blöd!!!!!


Frage: Kann mir da jemand helfen?
Title: Re: [Mod] Avatar v2.01
Post by: maus on June 03, 2007, 07:43:56 AM
Ich möchte Avatar v2 für 4images v1.7.4 kann aber kein Wort Englisch
also ich habe einiges ausprobiert ich bekomme es mal wieder nicht hin ich bin so blöd!!!!!


Frage: Kann mir da jemand helfen?



Hallo,



ich bräuchte auch eine Anleitung für 1.7.4, da die Schritte der ersten Seite leider nicht ausführbar.
Die Textstelle ist nicht zu finden.(member.php)

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



Kann mir bitte jemand helfen?
Title: Re: [Mod] Avatar v2.01
Post by: Fragezeichen on June 10, 2007, 02:19:13 PM
it works with 1.7.4?
i dont know but there´s to bugy mod.
there is no changes on control panel to allow the avatar permission.

also irgendwie bekomm ich das mod auf 1.7.4 nicht zum laufen.
im controlpanel kann man zwar die avatar erlaubnis einstellen aber die änderung lässt sich nicht speicher.
Title: Re: [Mod] Avatar v2.01
Post by: maus on June 22, 2007, 10:21:38 AM
hallo! Kann jemand bitte helfen?


Warning: opendir(./templates/default/avatars/users/) [function.opendir]: failed to open dir: No such file or directory in /www/htdocs/lachla/kot-07/member.php on line 1297

Warning: readdir(): supplied argument is not a valid Directory resource in /www/htdocs/lachla/kot-07/member.php on line 1299

Warning: closedir(): supplied argument is not a valid Directory resource in /www/htdocs/lachla/kot-07/member.php on line 1300

Title: Re: [Mod] Avatar v2.01
Post by: maus on June 27, 2007, 10:58:43 AM
The marked ( * ) code above has been changed.


hallo! Kann jemand bitte helfen?


Warning: opendir(./templates/default/avatars/users/) [function.opendir]: failed to open dir: No such file or directory in /www/htdocs/lachla/kot-07/member.php on line 1297

Warning: readdir(): supplied argument is not a valid Directory resource in /www/htdocs/lachla/kot-07/member.php on line 1299

Warning: closedir(): supplied argument is not a valid Directory resource in /www/htdocs/lachla/kot-07/member.php on line 1300
Title: Re: [Mod] Avatar v2.01
Post by: knsin0 on July 07, 2007, 10:23:18 PM
First question solved, found here the answer: http://www.4homepages.de/forum/index.php?topic=3978.msg17618#msg17618 Thanks again V@no!


Another question, it is possible to add a preview of the avatar in the dropdown menu of selection? i mean something like in phpbb forums.
Title: Re: [Mod] Avatar v2.01
Post by: The Sailor on July 09, 2007, 10:46:09 PM
Thanks alot  :D it work very well with 1.7.4 but i have a small problem when i click on photo
it show error and don't view Avatar anyone can help please?????????
Title: Re: [Mod] Avatar v2.01
Post by: The Sailor on July 10, 2007, 02:43:44 PM
its work well now i make a misstake when adding code to member_editprofile.html file  :lol:


thanks
Title: Re: [Mod] Avatar v2.01
Post by: The Sailor on July 10, 2007, 06:59:33 PM
i have another problem what thats mean????

Quote
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in c:\apache\htdocs\gallery\includes\upload.php on line 333

Fatal error: Cannot instantiate non-existent class: upload in c:\apache\htdocs\gallery\admin\images.php on line 33
Title: Re: [Mod] Avatar v2.01
Post by: matab on July 17, 2007, 01:29:33 PM
Hello there ,

I have saw this subject [Mod] Avatar v2.01
http://www.4homepages.de/forum/index.php?topic=3978.0

and in the end of the subject I tried to file downloads
http://gallery.vano.org/file6dl
files " install_avatar.php and avatar.sql  "
 :cry:
But the link was not working  :cry:

so please upload the files again in this web :

http://www.gigasize.com

or

http://files-upload.com
Title: Re: [Mod] Avatar v2.01
Post by: manurom on July 17, 2007, 01:44:59 PM
Hello;
install_avatar.zip (http://www.4homepages.de/forum/index.php?action=dlattach;topic=3978.0;attach=816)
Title: Re: [Mod] Avatar v2.01
Post by: matab on July 17, 2007, 01:48:26 PM
thnx alot  :P
Title: Re: [Mod] Avatar v2.01
Post by: manurom on July 17, 2007, 01:49:53 PM
You're welcome!
Title: Re: [Mod] Avatar v2.01
Post by: desperate_housewif on July 20, 2007, 06:22:11 PM
Ich habe vor geraumer Zeit schon mal nachgefragt, aber keine Antwort bekommen: Ist dieser Mod dazu geeignet, das Benutzerprofil mit einem Avatarbild zu ergänzen? Und was muß ich hinzufügen oder weglassen?
Title: Re: [Mod] Avatar v2.01
Post by: The Sailor on July 25, 2007, 12:17:04 AM
i have problem !!!!!!!!!!!!!  :!: :!: :!:

when non users  inter the Advanced search theres an error:

Code: [Select]
Notice: Undefined index: user_avatar in /home/localhost/public_html/gallery/includes/page_header.php on line 149

here the code in page_header.php

Code: [Select]
  "user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" border=\"0\" alt=\"\">" : "",
how can i fix it?????
Title: Re: [Mod] Avatar v2.01
Post by: Mr_LovaLove on July 26, 2007, 07:40:13 PM
well thaaaaaaaaaaaanks alot for this MOD

I have small problem ... i really want to solve it :( i tried alot !!

In fact, im using arabic lang ! and whenever then user try to upload a new image ( he/she has to write the name of the image in  English otherwise the image wont be uploaded if the write the image name in arabic )

Plz help me out to solve this

tell ya the truth, i wont ask for this if i didnt try to solve it !

FOR ALL ^_^ HELP PLZ
Title: Re: [Mod] Avatar v2.01
Post by: Mr_LovaLove on July 31, 2007, 03:29:39 AM
Solve it ^_^

the error was from rating mod :P

Title: Re: [Mod] Avatar v2.01
Post by: The Sailor on August 03, 2007, 01:01:22 AM
i have problem !!!!!!!!!!!!!  :!: :!: :!:

when non users  inter the Advanced search theres an error:

Code: [Select]
Notice: Undefined index: user_avatar in /home/localhost/public_html/gallery/includes/page_header.php on line 149

here the code in page_header.php

Code: [Select]
  "user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" border=\"0\" alt=\"\">" : "",
how can i fix it?????

Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 03, 2007, 01:16:46 AM
Quote
Undefined index: user_avatar in /home/localhost/public_html/gallery/includes/page_header.php on line 149

user_avatar field in USERS_TABLE and db_field_definitions.php file ?
Title: Re: [Mod] Avatar v2.01
Post by: The Sailor on August 03, 2007, 02:19:28 PM
Quote
Undefined index: user_avatar in /home/localhost/public_html/gallery/includes/page_header.php on line 149

user_avatar field in USERS_TABLE and db_field_definitions.php file ?

i don't do anything but seem that it work well now (^_^) thats strange
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 03, 2007, 02:20:33 PM
Things not happend like that . Must be reason why.
Title: Re: [Mod] Avatar v2.01
Post by: mathuatden on August 05, 2007, 07:07:25 AM
How I can add this mod for 4images 1.7.4
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 05, 2007, 02:18:13 PM
Quote
How I can add this mod for 4images 1.7.4

Error message ? Source ? URL where no work ?
Title: Re: [Mod] Avatar v2.01
Post by: mathuatden on August 05, 2007, 03:05:58 PM
this is the first I add this mod for 4images 1.7.4 on localhost but uncuessful please help me. thank you (i am vietnamese, please to meet you)
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 05, 2007, 03:27:20 PM
I can help but need to know error message ... what is say for no work ?
Title: Re: [Mod] Avatar v2.01
Post by: Mr_LovaLove on August 06, 2007, 07:51:39 PM
since there is no error msg !!


how can he helps you !!

and its working with me and am using 1.7.4


if thunder said so ! :P that means he ganna help you ! only thing you have to do is explain the probem you have ( show him or us ther error msg )  ! ( have been helped alot by him * thanks * )
Title: Re: [Mod] Avatar v2.01
Post by: The Sailor on August 12, 2007, 02:29:54 PM
i used a New Registered User mod from state.php here is the code:

Code: [Select]
//-----------------------------------------------------
//--- New Member --------------------------------------
//-----------------------------------------------------
$sql = "SELECT *
        FROM ".USERS_TABLE."
        WHERE ".get_user_table_field("", "user_id")." <> ".GUEST."
        ORDER by ".get_user_table_field("", "user_joindate")." DESC";
$row = $site_db->query_firstrow($sql);

$new_member = "Welcome to our new registered user, ".(($row[$user_table_fields['user_id']]) ? " <a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&user_id=".$row[$user_table_fields['user_id']])."\"><B>".$row[$user_table_fields['user_name']]."</B></a>\n" : "<B>".$row[$user_table_fields['user_name']]."</B>");
$site_template->register_vars("new_member", $new_member);
unset($new_member);

and i use {new_member} it show the new registered member just fine but how can i show his Avatar ???? :oops:
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 20, 2007, 12:23:37 AM
SQL Query start with guest level ... avatar can no show for GUEST ... no use for this.
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 28, 2007, 07:42:01 PM

Maybe somebody could give a code how to show avatars in users online list?

P.S. so far MOD runs great on my site with 1.4.7 version.

Thanks!
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 28, 2007, 08:05:31 PM
Quote
Maybe somebody could give a code how to show avatars in users online list?

Which one ? Is possible post topic of users online list ?

Quote
P.S. so far MOD runs great on my site with 1.4.7 version.

Hope mean v1.7.4 and not 1.4.7 ... if so ... run in fix now !!   :| ... 8O
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 28, 2007, 08:17:38 PM
If I understand you correct:

I just want in default whois_online template show user avatar near his nickname.  :wink:

Sorry for mistake.  :lol:
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 28, 2007, 08:19:39 PM
Is MOD from icecream for whos online dropdown ... no find ... I use search but no result. :(
userpic with whos online and think avatar. ;)
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 28, 2007, 08:28:50 PM
So its no way I can show user's avatar near user nickname using this MOD?
In MOD Member Personal photo it was done with sessions.php.....

http://www.4homepages.de/forum/index.php?topic=6797.165 (http://www.4homepages.de/forum/index.php?topic=6797.165)


Maybe it's possible???
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 28, 2007, 09:22:04 PM
Ok so this:

http://www.4homepages.de/forum/index.php?topic=6797.msg60455#msg60455

?

In includes/sessions.php file,

find:

Quote
$sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible").", userpic

replace:

Quote
$sql = "SELECT s.session_user_id, s.session_lastaction, s.session_ip".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_invisible").", u.userpic, u.user_avatar

Find:

Quote
$user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];

add after:

Quote
$avatar_img = (isset($config['avatar_use']) && $config['avatar_use'] && @file_exists(TEMPLATE_PATH."/avatars/".$user_row['user_avatar']/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row['user_avatar'] == "") ? "blank.gif" : $user_row['user_avatar'])."\" name=\"icons\" border=\"0\" hspace=\"15\" alt=\"\">" : "";

Find:

Quote
$user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\"><center>".$whos_online_userpic."<br />".$username."</a>".$invisibleuser."</center>".REPLACE_EMPTY. REPLACE_EMPTY;     

replace:

Quote
$user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\"><center>".$avatar_img."<br />".$username."</a>".$invisibleuser."</center>".REPLACE_EMPTY. REPLACE_EMPTY;
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 28, 2007, 09:48:07 PM
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/boxel.id.lv/includes/sessions.php on line 445  :(


And my sessions.php looks like this.
When changing code I found some difference between yours and mine code.
Are you using some other version???
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 28, 2007, 09:48:54 PM
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
............................
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 28, 2007, 10:05:45 PM
Please no need post ful file ...  :?

Quote
in /home/www/boxel.id.lv/includes/sessions.php on line 445

Post from line 440 and line 450 from includes/sessions.php file.
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 28, 2007, 10:22:01 PM
Ok, think I fix ... try again.
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 29, 2007, 06:52:13 PM
Sorry,not working, it's a mistake somewhere between line 440 and 445.
Are you using Personal Photo Mod or a later version of 4images???
Because i found big difference between your and mine sessions.php.
Maybe there is a mistake.
I havent modified sessions.php and using default.  :roll:
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 29, 2007, 06:56:11 PM
Quote
Are you using Personal Photo Mod

No for avatar but picture in profile yes.

Quote
a later version of 4images???

Fresh.

Quote
Because i found big difference between your and mine sessions.php.

No mine ... I find old post of MOD but, yes, possible thing change from old to new ...

Quote
I havent modified sessions.php and using default.

I use default and no extra query ... same SQL query by Jan in sessions ...
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 29, 2007, 07:14:24 PM
So please could you do a modifications to new sessions.php from 1.7.4,
because this isnt working, and I cant find a mistake.
Post it here please!
Thanks! :)
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 29, 2007, 07:19:08 PM
Quote
because this isnt working

Is say ? is do ?  :roll:
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 29, 2007, 07:21:17 PM
 :oops:
Cant understand what youmean with that  :oops:
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 29, 2007, 07:23:31 PM
What is say on screen ? What is do ?? What affect ??
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 29, 2007, 09:13:16 PM
The same error as before :(
on this line : $avatar_img=........
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 29, 2007, 09:16:01 PM
Quote
on this line : $avatar_img=........

What is exac error  :?:
How '......' help ?
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 30, 2007, 06:14:02 PM
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/boxel.id.lv/includes/sessions.php on line 445  Sad
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 30, 2007, 10:27:58 PM
Quote
on line 445

Ok so post your includes/sessions.php file from line 440 to line 450. I look.
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 31, 2007, 06:53:35 PM
Here goes my sessions.php line 440-450
 :arrow:
        $username = (isset($row[$user_table_fields['user_level']]) && $row[$user_table_fields['user_level']] == ADMIN && $config['highlight_admin'] == 1) ? sprintf("<b>%s</b>", $row[$user_table_fields['user_name']]) : $row[$user_table_fields['user_name']];
        if (!$is_invisible || $user_info['user_level'] == ADMIN) {
          $user_online_list .= ($user_online_list != "") ? ", " : "";
          $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
         $avatar_img = (isset($config['avatar_use']) && $config['avatar_use'] && @file_exists(TEMPLATE_PATH."/avatars/".$user_row['user_avatar']/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row['user_avatar'] == "") ? "blank.gif" : $user_row['user_avatar'])."\" name=\"icons\" border=\"0\" hspace=\"15\" alt=\"\">" : "";
        $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\"><center>".$avatar_img."<br />".$username."</a>".$invisibleuser."</center>".REPLACE_EMPTY. REPLACE_EMPTY;
        }
        (!$is_invisible) ? $num_visible_online++ : $num_invisible_online++;
        $num_registered_online++;
      }
      $prev_user_ids[$row['session_user_id']] = 1;
  :arrow:
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 31, 2007, 07:04:47 PM
Find:

Quote
$avatar_img = (isset($config['avatar_use']) && $config['avatar_use'] && @file_exists(TEMPLATE_PATH."/avatars/".$user_row['user_avatar']/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row['user_avatar'] == "") ? "blank.gif" : $user_row['user_avatar'])."\" name=\"icons\" border=\"0\" hspace=\"15\" alt=\"\">" : "";

replace:

Quote
$avatar_img = (isset($config['avatar_use']) && $config['avatar_use'] && @file_exists(TEMPLATE_PATH."/avatars/".$user_row['user_avatar']."/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row['user_avatar'] == "") ? "blank.gif" : $user_row['user_avatar'])."\" name=\"icons\" border=\"0\" hspace=\"15\" alt=\"\">" : "";
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 31, 2007, 07:37:36 PM
When I login I got an error:
 :arrow:

DB Error: Bad SQL Query: SELECT s.session_user_id, s.session_lastaction, s.session_ip, u.user_id, u.user_level, u.user_name, u.user_invisible, u.userpic, u.user_avatar FROM gl_sessions s LEFT JOIN gl_users u ON (u.user_id = s.session_user_id) WHERE s.session_lastaction >= 1188581385 ORDER BY u.user_id ASC, s.session_ip ASC
Unknown column 'u.userpic' in 'field list'
 :arrow:
And I am not showed in online list as logged in.
 :arrow:
When I am not logged in it shows an error: an unexcepted error ocuured.please try agan later.
 :arrow:
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 31, 2007, 07:53:29 PM
Quote
Unknown column 'u.userpic' in 'field list'

See in phpmyadmin, column no exist in USERS_TABLE table.
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 31, 2007, 09:12:07 PM
So if it doesnt exists,should I make it?
Or should I remove variable u.userpic from code????  :?
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 31, 2007, 09:14:23 PM
Quote
Or should I remove variable u.userpic from code????

If no use userpic MOD, remove u.userpic ... :?
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 31, 2007, 10:43:36 PM
OMG, at last I can see avatar near my nickname!!! Thanks for help so far!!! :wink:  :wink:  :wink:
But its got some bugs.
1.  :arrow: Even I choose different avatar, it shows my nickname with default avatar- blank.gif.
Should I change something in templates whois_online or mistake is in sessions.php???
2. I can see avatar in top of nickname,but should be in front, like that--->>>>  avatar| Nickname1
3. I want see users in vertical row not horizontal like that:

avatar| Nickname1
avatar| Nickname2
avatar| Nickname3
avatar| Nickname4

Where can I make that?


Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 31, 2007, 10:47:11 PM
One more mistake:

When I am not logged in I cant see avatars from other users.
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 31, 2007, 11:06:54 PM
Quote
When I am not logged in I cant see avatars from other users.

Find:

Quote
$avatar_img = (isset($config['avatar_use']) && $config['avatar_use'] && @file_exists(TEMPLATE_PATH."/avatars/".$user_row['user_avatar']."/".$row['userpic']) && $user_info['user_level'] >= USER) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_row['user_avatar'] == "") ? "blank.gif" : $user_row['user_avatar'])."\" name=\"icons\" border=\"0\" hspace=\"15\" alt=\"\">" : "";

with:

Quote
$avatar_img = (isset($config['avatar_use']) && $config['avatar_use'] && @file_exists(TEMPLATE_PATH."/avatars/".$row['user_avatar'])) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($row['user_avatar'] == "") ? "blank.gif" : $row['user_avatar'])."\" name=\"icons\" border=\"0\" hspace=\"15\" alt=\"\">" : "";

Quote
avatar| Nickname1
avatar| Nickname2
avatar| Nickname3
avatar| Nickname4

Use Icecream MOD for whos online list. Can edit this. ;)
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 31, 2007, 11:15:17 PM
ok, but what about my default avatar???
It doesn shows my real avatar,just default.... :(
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on August 31, 2007, 11:20:05 PM
NO,it doesn helps, can not see avatar,sorry :( :( :(
And it shows my default avatar,not real one!!! :( :(
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on August 31, 2007, 11:56:03 PM
Quote
And it shows my default avatar,not real one!!!

Ok so please post icecream topic. I look. ;)
Title: Re: [Mod] Avatar v2.01
Post by: Gstyleris on September 01, 2007, 10:26:29 AM
ok,thanks.
Can you give link to Icecream topic please? :wink:
Title: Re: [Mod] Avatar v2.01
Post by: knsin0 on September 13, 2007, 09:02:18 PM
have the same error: http://www.4homepages.de/forum/index.php?topic=3978.msg96499#msg96499


"Notice: Undefined index: user_avatar in /home/site/page_header.php on line 116"

This error only appear when a non-registered user search something, with member work perfectly, could somebody help me?  :|
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on September 13, 2007, 10:28:22 PM
Quote
"Notice: Undefined index: user_avatar in /home/site/page_header.php on line 116"

Please post from line 110 to line 120. I look ...
Title: Re: [Mod] Avatar v2.01
Post by: knsin0 on September 14, 2007, 01:28:27 AM
Quote
"Notice: Undefined index: user_avatar in /home/site/page_header.php on line 116"

Please post from line 110 to line 120. I look ...

Thanks a lot thunder, here it is:  :D
Code: [Select]
"url_categories" => $site_sess->url(ROOT_PATH."categories.php"),
  "url_home" => $site_sess->url(ROOT_PATH."index.php"),
  "url_login" => (!empty($url_login)) ? $site_sess->url($url_login) : $site_sess->url(ROOT_PATH."login.php"),
  "url_logout" => (!empty($url_logout)) ? $site_sess->url($url_logout) : $site_sess->url(ROOT_PATH."logout.php"),
  "url_member" => (!empty($url_member)) ? $site_sess->url($url_member) : $site_sess->url(ROOT_PATH."member.php"),
  "url_upload" => (!empty($url_upload)) ? $site_sess->url($url_upload) : $site_sess->url(ROOT_PATH."member.php?action=uploadform"),
"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" border=\"0\" alt=\"\">" : "",
  "url_lost_password" => (!empty($url_lost_password)) ? $site_sess->url($url_lost_password) : $site_sess->url(ROOT_PATH."member.php?action=lostpassword"),
  "url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),
  "has_rss" => false,
  "rss_title" => "",
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on September 14, 2007, 01:34:00 AM
Change:

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

for:

Code: [Select]
"user_avatar_current" => (isset($config['avatar_use']) && $config['avatar_use'] && isset($user_info['user_avatar'])) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" border=\"0\" alt=\"\">" : "",
Title: Re: [Mod] Avatar v2.01
Post by: knsin0 on September 14, 2007, 04:14:52 AM
working perfectly, thanks a lot man  :D
Title: Re: [Mod] Avatar v2.01
Post by: Marquis2000 on October 14, 2007, 08:31:16 PM
Hallo hoffentlich spricht hier jemand Deutsch :)

Ich würde gerne den Avatar im Template: user_logininfo.html angezeigt haben. Dazu habe ich folgendes probiert, die Zeilen

{if_user_avatar_current}
{user_avatar_current}
{endif_user_avatar_current}

in das user_logininfo.html Template an entsprechender Stelle geschrieben. Leider zeigt er den Avatar aber nicht an. KAnn mir jemand helfen?? Danke schon mal!

Gruß Marquis
Title: Re: [Mod] Avatar v2.01
Post by: Marquis2000 on October 25, 2007, 03:39:06 PM
Weiß das echt keiner ??
Title: Re: [Mod] Avatar v2.01
Post by: Icemann71 on October 25, 2007, 11:56:14 PM
Weiß das echt keiner ??

versuche mal

includes/page_header.php
suche
 
Code: [Select]
"url_lost_password" => (!empty($url_lost_password)) ? $site_sess->url($url_lost_password) : $site_sess->url(ROOT_PATH."member.php?action=lostpassword"),
dadrüber einfügen
 
Code: [Select]
"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" name=\"icons\" border=\"0\" alt=\"\">" : "",
Title: Re: [Mod] Avatar v2.01
Post by: glitzer on October 26, 2007, 09:17:59 AM
Hi all

i installed this mod for a long time ago and it works great.
I have the old 4image version 1.7.1
I have now read all 24 sites of this mod, but i can´t found the answer for my only bug:

A user has uploaded his own avatar it is working great, but when he upload another avatar again, it shows the same avatar like before.
He has to refresh the site..to show the new one.
Is there a solution?

greetings,
glitzer
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on October 26, 2007, 12:06:13 PM
Hi all

i installed this mod for a long time ago and it works great.
I have the old 4image version 1.7.1
I have now read all 24 sites of this mod, but i can´t found the answer for my only bug:

A user has uploaded his own avatar it is working great, but when he upload another avatar again, it shows the same avatar like before.
He has to refresh the site..to show the new one.
Is there a solution?

greetings,
glitzer

Yes. In member.php file,

find:

Quote
$update_process = 1;
  }
  $action = "editprofile";

replace:

Code: [Select]
$update_process = 1;
  }
  redirect("member.php?action=editprofile");
Title: Re: [Mod] Avatar v2.01
Post by: glitzer on October 26, 2007, 12:14:49 PM
Hi V@no.

now i get this error when i what to upload an avatar

Fatal error: Call to undefined function: redirect() in /www/htdocs/ekarten/pics01/member.php on line 1369
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on October 26, 2007, 12:19:24 PM
V@no ? I post this ... no V@no ... :?

For redirect error, you use old version of 4images. Please install all patch and upgrade from here:

http://www.4homepages.de/forum/index.php?board=17.0

Title: Re: [Mod] Avatar v2.01
Post by: glitzer on October 26, 2007, 12:25:58 PM
ooh no sorry thunderstrike   :oops:

Yes i use the old one 1.7.1 because i have so many mods included..i don´t want to loose them with the upgrade.

I hope the bug fixed help me to use this mod!

Thank you very much
Title: Re: [Mod] Avatar v2.01
Post by: glitzer on October 26, 2007, 03:09:05 PM
Hi Thunderstrike,

me once again  :lol:

I checked now all bug fixes..but it still does not work. (the avatar function, after uploading an avatar again, i have to refresh the site manually to see the new avatar)

Do you have another idea?

greets,
glitzer
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on October 27, 2007, 12:38:15 AM
Quote
Do you have another idea?

Yes, download last 4images version and go to includes/functions.php file. Copy & paste redirect function in your includes/functions.php file on top of ?> tag and try again.
Title: Re: [Mod] Avatar v2.01
Post by: glitzer on October 27, 2007, 08:42:17 AM

Hi Thunderstrike!

Good Idea, but it also doesn´t work.  :roll:

Perhaps you could take a look on my function file?
perhaps you can find mistakes or the problem.

Thank you very much for your help!

Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on October 27, 2007, 02:13:11 PM
Quote
but it also doesn´t work.

And please read step 6 of my signature. You install code but then ?
Title: Re: [Mod] Avatar v2.01
Post by: glitzer on October 27, 2007, 02:17:35 PM
Hi Thunderstrike.

its the same like before...the new avatar is not to see..i have to refresh the site..to see it.

greets glitzer
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on October 27, 2007, 02:25:51 PM
Sigh - ok change to this:

Code: [Select]
$update_process = 1;
  }
  header("Location: " . $site_sess->url(ROOT_PATH . "member.php?action=editprofile"));
Title: Re: [Mod] Avatar v2.01
Post by: glitzer on October 27, 2007, 04:02:45 PM

hi Thunderstrike,

thank you for trying help me, but i think i let it be.
With your last code, it is always the same..the avatar is not refreshed.

I can live with this little problem ;-)
Thanks a lot for your quick support  :D
Title: Re: [Mod] Avatar v2.01
Post by: scorpi1 on December 17, 2007, 10:31:51 PM
http://gallery.vano.org/file20dl

not working link
Title: Re: [Mod] Avatar v2.01
Post by: Nicky on December 18, 2007, 07:21:11 PM
install_avatar.zip attached to the 1st post
Title: Re: [Mod] Avatar v2.01
Post by: Daniel on December 18, 2007, 07:52:13 PM
Dieses

onkeypress="if(window.event.keyCode==13){ this.form.submit(); }" onchange="document.images.icons.src='{template_url}/avatars/'+document.creator.user_avatar.options[document.creator.user_avatar.selectedIndex].value;

Was soll den das machen?
Soll das das jeweils angeklickte Bild zeigen?
Title: Re: [Mod] Avatar v2.01
Post by: skiemor on December 26, 2007, 02:05:24 AM
Thanks you for the great MOD V@no! It works perfect! :thumbup:
Is there a way to get the avatar in DreamBoard too?

Chris.
Title: Re: [Mod] Avatar v2.01
Post by: thunderstrike on December 26, 2007, 05:08:59 PM
Thanks you for the great MOD V@no! It works perfect! :thumbup:
Is there a way to get the avatar in DreamBoard too?

Chris.

There is problem for add avatar in dreamboard for topic creator. Is no show right.
Title: Re: [Mod] Avatar v2.01
Post by: skiemor on December 26, 2007, 05:38:15 PM
Ok, thank you, thunderstrike, for anwer. It's not really important, to see an avatar in board.
In gallery it works and that is good and enough. ;-)

Chris.
Title: Re: [Mod] Avatar v2.01
Post by: sanko86 on April 14, 2008, 03:37:49 PM
copy and paste

kopyalarken hatalı kopyalama yapmışsın" syntax error" bu demek.

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 -----
?>
Title: Re: [Mod] Avatar v2.01
Post by: robertx on April 16, 2008, 10:54:07 AM
Hello for version 1.7.6 doesn t work :(

i have this error

Parse error: syntax error, unexpected $end in /home/robertx/public_html/photos/member.php on line 1389

I look and this is end of file :

"
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "content" => $content,
  "msg" => $msg,
  "clickstream" => $clickstream,
  "lang_control_panel" => $lang['control_panel']
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>        <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< this is 1389 line
"

thanks
Title: Re: [Mod] Avatar v2.01
Post by: Sunny C. on June 17, 2008, 02:51:54 PM
Die Mod läuft zu 100% in der aktuellen Version 1.7.6 !!!!!!
Habe diese gerade in meiner priv. Gallery eingebaut und ich habe schon sämtliche Mods installiert!

Man muss nur GANZ genau darauf achten wo es eingebunden werden soll, bzw. wo welcher Code hin soll! Ich habe selber keine Ahnung von PHP daher kann ich nur sagen, dass wenn man ganz genau schaut, dass es auch klappt und es hat beim ersten mal geklappt.

Was aber in der Anleitung fehlt ist, dass in dem Ordner "templates/< your template>/avatars" ein Ordner namens "users" noch rein muss, sonnst sagt er das es fehler in der member.php gibt!

So läuft die Mod 100%!

Was mich interessieren würde ist, dass ich dies ja nicht als Avatar nutzen möchte, sondern das die user dort ihr Foto hochladen können, davon abgesehen, ist das möglich das dies auch wären des Upload verkleinert wird?

Edit:
ist es auch möglich, dass wenn das avatar aus der liste ausgewählt hat, dass es direkt angezeigt wird? So das der user sich eines auch aussuchen kann, ohne das er erst auf absenden klicken muss um es erst zu sehen? Denn das nervt ja wenn ich eines aussuchen, es nicht sehen kann, dann auf absenden klicke und dann ist es das falsche!

Der Code der editprofile
Code: [Select]
    {if user_avatar_images}
    <tr>
      <td colspan="2" class="head1"><span class="Stil3">&raquo; {lang_avatar}</span></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 />
        {endif user_avatar_file}</td>
      <td class="row2"> {if user_avatar_file}
        Upload vom Computer:<br />
        <input type="file" name="avatar_file"  size="30" class="input" />
        <br />
        {endif user_avatar_file}
        <br />Oder wähle eins aus der Liste aus:<br />
        <select name="user_avatar" class="input" size="6" onkeypress="if(window.event.keyCode==13){ this.form.submit(); }" onchange="document.images.icons.src='{template_url}/avatars/'+document.creator.user_avatar.options[document.creator.user_avatar.selectedIndex].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}

Geht das nicht mit sonnem reload oderso?
Title: Re: [Mod] Avatar v2.01
Post by: Sunny C. on June 17, 2008, 05:30:02 PM
Ich habe es geschafft das wenn ein User sein Bild (Avatar) Uploaden will, dass dieses dann verkleinert wird.

Der Code ist folgender:
Code: [Select]
// Filename to store image as
$FILENAME="test";

// Width to reszie image to
$RESIZEWIDTH=100;

// Width to reszie image to
$RESIZEHEIGHT=75;

function ResizeImage($im,$maxwidth,$maxheight,$name){
$width = imagesx($im);
$height = imagesy($im);
if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight)){
if($maxwidth && $width > $maxwidth){
$widthratio = $maxwidth/$width;
$RESIZEWIDTH=true;
}
if($maxheight && $height > $maxheight){
$heightratio = $maxheight/$height;
$RESIZEHEIGHT=true;
}
if($RESIZEWIDTH && $RESIZEHEIGHT){
if($widthratio < $heightratio){
$ratio = $widthratio;
}else{
$ratio = $heightratio;
}
}elseif($RESIZEWIDTH){
$ratio = $widthratio;
}elseif($RESIZEHEIGHT){
$ratio = $heightratio;
}
$newwidth = $width * $ratio;
$newheight = $height * $ratio;
if(function_exists("imagecopyresampled")){
$newim = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
}else{
$newim = imagecreate($newwidth, $newheight);
imagecopyresized($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
}
ImageJpeg ($newim,$name . ".jpg");
ImageDestroy ($newim);
}else{
ImageJpeg ($im,$name . ".jpg");
}
}

if($_FILES['image']['size']){
if($_FILES['image']['type'] == "image/pjpeg" || $_FILES['image']['type'] == "image/jpeg"){
$im = imagecreatefromjpeg($_FILES['image']['tmp_name']);
}elseif($_FILES['image']['type'] == "image/x-png" || $_FILES['image']['type'] == "image/png"){
$im = imagecreatefrompng($_FILES['image']['tmp_name']);
}elseif($_FILES['image']['type'] == "image/gif"){
$im = imagecreatefromgif($_FILES['image']['tmp_name']);
}
if($im){
if(file_exists("data/avatars/$FILENAME.jpg")){
unlink("data/avatars/$FILENAME.jpg");
}
ResizeImage($im,$RESIZEWIDTH,$RESIZEHEIGHT,$FILENAME);
ImageDestroy ($im);
}
}

Ich habs zunächst in der member.php eingebaut!

Öffne: member.php
Suche:
Code: [Select]
$main_template = "member";

define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/page_header.php');

if ($action == "") {
  $action = "lostpassword";
}

Danach einfügen:
Code: [Select]
// Filename to store image as
$FILENAME="test";

// Width to reszie image to
$RESIZEWIDTH=100;

// Width to reszie image to
$RESIZEHEIGHT=75;

function ResizeImage($im,$maxwidth,$maxheight,$name){
$width = imagesx($im);
$height = imagesy($im);
if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight)){
if($maxwidth && $width > $maxwidth){
$widthratio = $maxwidth/$width;
$RESIZEWIDTH=true;
}
if($maxheight && $height > $maxheight){
$heightratio = $maxheight/$height;
$RESIZEHEIGHT=true;
}
if($RESIZEWIDTH && $RESIZEHEIGHT){
if($widthratio < $heightratio){
$ratio = $widthratio;
}else{
$ratio = $heightratio;
}
}elseif($RESIZEWIDTH){
$ratio = $widthratio;
}elseif($RESIZEHEIGHT){
$ratio = $heightratio;
}
$newwidth = $width * $ratio;
$newheight = $height * $ratio;
if(function_exists("imagecopyresampled")){
$newim = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
}else{
$newim = imagecreate($newwidth, $newheight);
imagecopyresized($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
}
ImageJpeg ($newim,$name . ".jpg");
ImageDestroy ($newim);
}else{
ImageJpeg ($im,$name . ".jpg");
}
}

if($_FILES['image']['size']){
if($_FILES['image']['type'] == "image/pjpeg" || $_FILES['image']['type'] == "image/jpeg"){
$im = imagecreatefromjpeg($_FILES['image']['tmp_name']);
}elseif($_FILES['image']['type'] == "image/x-png" || $_FILES['image']['type'] == "image/png"){
$im = imagecreatefrompng($_FILES['image']['tmp_name']);
}elseif($_FILES['image']['type'] == "image/gif"){
$im = imagecreatefromgif($_FILES['image']['tmp_name']);
}
if($im){
if(file_exists("data/avatars/$FILENAME.jpg")){
unlink("data/avatars/$FILENAME.jpg");
}
ResizeImage($im,$RESIZEWIDTH,$RESIZEHEIGHT,$FILENAME);
ImageDestroy ($im);
}
}

Öffne: templates/dein template/members_editprofil.html
Suche:
Code: [Select]
              {lang_upload}
              <INPUT type="file" name="avatar_file"  size="30" class="input" />

Ersetze mit:
Code: [Select]
        Upload vom Computer:<br />
        <input type="file" name="image" size="35" class="input"><br /><input type="submit" value="upload" class="button">

Man kann es auch extra zu dem normalen Upload hinzufügen!

Das klappt wunderbar.

Aber nun zu ein paar kleinen dingen die mich stören!

Wie bekomme ich das hin, dass ich in diesem code:
Code: [Select]
// Filename to store image as
$FILENAME="test";

Den Username als Filename nehmen kann? Also ich habe da z.B Test genommen, aber ich möchte sowas in der Art "user_name", also das dieses Bild dann quasi als "Phisker.jpg" erstellt wird. Ich habe keine Ahnung davon, das mit diesem Code war auch nur Zufall das es klappte.

Dann kommt nich eines, ich habe angegeben:
Code: [Select]
if(file_exists("data/avatars/$FILENAME.jpg")){
unlink("data/avatars/$FILENAME.jpg");

Aber das hochgeladene Bild wird nicht im data/avatars erstellt, sondern immer nur im root Verzeichnis!
Bitte um Hilfe!

Gruß
Phisker
Title: Re: [Mod] Avatar v2.01
Post by: KurtW on June 17, 2008, 07:21:23 PM
hallo,

sollte klappen:
Code: [Select]
$FILENAME="test";=>
Code: [Select]
$FILENAME = $user_info['user_name'];

Kurt
Title: Re: [Mod] Avatar v2.01
Post by: Sunny C. on June 19, 2008, 10:53:04 AM
Hy,

das klappt wirklich gut!

2 andere fragen!

1) Er lädt als nun das bild als Phisker.jpg hoch, aber wenn ich ein zweites hochlade, dann überschreibt er das andere, kann man was dagegen tun?

2) Ist es möglich einen ordner anzugeben? Weil er läd es immer im root hoch, obwohl ich ja angegeben habe unten data/avatars
Code: [Select]
if($im){
if(file_exists("data/avatars/$FILENAME.jpg")){
unlink("data/avatars/$FILENAME.jpg");
}
ResizeImage($im,$RESIZEWIDTH,$RESIZEHEIGHT,$FILENAME);
ImageDestroy ($im);
}
}

Danke, weiterhin!
Title: Re: [Mod] Avatar v2.01
Post by: autofolie on June 25, 2008, 10:29:22 PM
Hello,

I installed this MOD, but only the registered member sees its avatar, we do not see the avatar of the other members in comments is it normal ?

thank you.
Title: Re: [Mod] Avatar v2.01
Post by: Sunny C. on June 26, 2008, 12:33:20 AM
Hy,

das klappt wirklich gut!

2 andere fragen!

1) Er lädt als nun das bild als Phisker.jpg hoch, aber wenn ich ein zweites hochlade, dann überschreibt er das andere, kann man was dagegen tun?

2) Ist es möglich einen ordner anzugeben? Weil er läd es immer im root hoch, obwohl ich ja angegeben habe unten data/avatars
Code: [Select]
if($im){
if(file_exists("data/avatars/$FILENAME.jpg")){
unlink("data/avatars/$FILENAME.jpg");
}
ResizeImage($im,$RESIZEWIDTH,$RESIZEHEIGHT,$FILENAME);
ImageDestroy ($im);
}
}

Danke, weiterhin!

Diesen Fehler habe ich bis heute nicht beheben können, auch das es in einem Extra Ordner gespeichert wird, klappt einfach nicht!
Title: Re: [Mod] Avatar v2.01
Post by: autofolie on June 26, 2008, 11:22:39 AM
Hello,

I installed this MOD, but only the registered member sees its avatar, we do not see the avatar of the other members in comments is it normal ?

thank you.


it is only the administrator who sees the avatars, not the members, nor the guests. ???
Title: Re: [Mod] Avatar v2.01
Post by: Sunny C. on June 26, 2008, 11:23:25 AM
No, its for all users!
Title: Re: [Mod] Avatar v2.01
Post by: autofolie on June 26, 2008, 11:29:43 AM
No, its for all users!


then, I have a problem ...   :?

As you a solution or an explanation?
Title: Re: [Mod] Avatar v2.01
Post by: Sunny C. on June 26, 2008, 11:43:27 AM
No, I am really sorry. I cannot English very well either, you anyway then would not understand this. Excuse me.
Title: Re: [Mod] Avatar v2.01
Post by: autofolie on June 26, 2008, 11:49:14 AM
no problem ... I am french and not good in English ... thank you anyway. 

but if someone has an explanation for my problem ...
Title: Re: [Mod] Avatar v2.01
Post by: † manurom on June 26, 2008, 12:05:02 PM
Hello, all;
many thanks to the German and Turkish teams, for their beautiful foot-ball (soccer) match. I really spent a good afternoon. But sport is sport, and it maybe only one winner. For that I saw, turkish team is not definitively a looser. Many thanks to them all for the pleasure they gave us. Hey, Phisker B, I know that you are pleased. Just wait for the result from Russia vs Spain. Maybe we'll all get an enormous surprise.  :D

Bonjour, autofolie;
si je comprends bien, les avatars ne sont visibles que par les membres connectés ou les administrateurs...
Quelque chose doit mal se passer, surtout au niveau du template, pour que des tags du type {if..} et {endif...} gênent l'affichage de ces fameux avatars.
Ce n'est qu'une piste. Merci d'avance de me dire comment, et avec quels fichiers vous avez modifié votre script (de quelle version s'agit'il?).

Salutations.
Best regards.
Title: Re: [Mod] Avatar v2.01
Post by: autofolie on June 26, 2008, 12:10:56 PM
Bonjour manurom,

J'utilise la version 1.7.6 de 4images... après installation de ce MOD, je suis le seul (admin) à voir les avatars, les invités et les membres ne les voient pas...

J'ai modifié le script en suivant les indications présentes au début de ce sujet.

Merci pour ton aide,
Pascal
Title: Re: [Mod] Avatar v2.01
Post by: † manurom on June 26, 2008, 01:40:16 PM
Vu, merci;
mais j'ai repéré ce matin deux brochets de presque 90 cm. Je m'en vais me coltiner avec eux.
Cependant, adepte du "no-kill", je relâcherai quelque prise que je prenne.

Je tenterai de mettre en place le MOD, grâce à mon programme 4images Mobile Server. Je vous tiens au courant de mes éventuels échecs ou réussites.

Bien à vous, et gardez espoir.

manurom
Title: Re: [Mod] Avatar v2.01
Post by: autofolie on June 26, 2008, 02:00:23 PM
OK, merci,

Bonne journée au soleil... et taquinez bien les brochets   :D
Title: Re: [Mod] Avatar v2.01
Post by: autofolie on June 26, 2008, 08:25:42 PM
Dans member.php je ne trouve pas les lignes suivantes...

In member.php I do not find following lines...


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

Replace with:
Code:
//-----------------------
//------ Avatar ---------
//-----------------------
etc....


Ou doit on mettre le paragraphe "replace with" ?

where to put the paragraph " replace with " ?
Title: Re: [Mod] Avatar v2.01
Post by: Sunny C. on June 26, 2008, 08:34:15 PM
Wie bekomme ich ein Refresh hier rein?

Code: [Select]
<select name="user_avatar" size="6" onkeypress="if(window.event.keyCode==13){ this.form.submit(); }" onchange="document.images.icons.src='{template_url}/avatars/'+document.creator.user_avatar.options[document.creator.user_avatar.selectedIndex].value;">
          {user_avatar_images}
        </select>

Überlegung 1

Also wenn ich was ausgewählt habe, dass die Seite ein refresh, aber zu der Tabelle rutscht? Ich habe alle Tabellenstücke mit id="tabellenname" versehen. Also wie gesagt, wenn ich ein Avatar ausgewählt habe, dass die Seite refresht und direkt zu der ID rutscht?

Überlegung 2

Oder ist das möglich, dass wenn ich ein Avatar auswähle, dass kein Refresh stattfindet, aber das man das Avatar direkt begutachten kann? Damit der user nicht immer erst auswählen muss und dann auf absenden und dann ist das nicht das gewollte Avatar und dann muss der user wieder Auswählen -> Absenden, so das dies halt dann nicht der Fall ist! Quasi eine Vorschauansicht!

Title: Re: [Mod] Avatar v2.01
Post by: † manurom on June 27, 2008, 04:10:41 PM
Dans member.php je ne trouve pas les lignes suivantes...

In member.php I do not find following lines...


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

Replace with:
Code:
//-----------------------
//------ Avatar ---------
//-----------------------
etc....


Ou doit on mettre le paragraphe "replace with" ?

where to put the paragraph " replace with " ?

Dans "member.php" version 1.7.6, il faut chercher:
Code: [Select]
  $site_template->register_vars(array(
    "user_name" => format_text(stripslashes($user_name), 2),

Dans le fichier "includes/page_header.php", chercher:
Code: [Select]
  "url_upload" => (!empty($url_upload)) ? $site_sess->url($url_upload) : $site_sess->url(ROOT_PATH."member.php?action=uploadform"),
et ajouter juste après:
Code: [Select]
  "user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" border=\"0\" alt=\"\">" : "",
Ne pas oublier d'affecter un CHMOD777 au dossier avatars/users.
Title: Re: [Mod] Avatar v2.01
Post by: autofolie on June 27, 2008, 09:44:55 PM
Merci pour ton aide manurom  :D

J'ai fais la modif. dans  le fichier  "includes/page_header.php"... et modifié le fichier  /templates/<yourtemplate>/comment_bit.html ou j'avais mal placé le code...  :?

Maintenant, ça a l'air de fonctionner !

extra.

encore merci,
Pascal

Title: Re: [Mod] Avatar v2.01
Post by: Sunny C. on July 06, 2008, 08:04:52 PM
Hy,

das klappt wirklich gut!

2 andere fragen!

1) Er lädt als nun das bild als Phisker.jpg hoch, aber wenn ich ein zweites hochlade, dann überschreibt er das andere, kann man was dagegen tun?

2) Ist es möglich einen ordner anzugeben? Weil er läd es immer im root hoch, obwohl ich ja angegeben habe unten data/avatars
Code: [Select]
if($im){
if(file_exists("data/avatars/$FILENAME.jpg")){
unlink("data/avatars/$FILENAME.jpg");
}
ResizeImage($im,$RESIZEWIDTH,$RESIZEHEIGHT,$FILENAME);
ImageDestroy ($im);
}
}

Danke, weiterhin!

Wie ist das möglich das man dort den Ordner Pfad angeben kann?
Title: Re: [Mod] Avatar v2.01
Post by: Daniel on July 11, 2008, 07:52:54 AM
Es ist etwas tricki mit den htmlspecialchars aber der MOD funktioniert unter 1.7.6 ausgezeichnet!
Danke / Thanks
Title: Re: [Mod] Avatar v2.01
Post by: flota_chilena on July 25, 2008, 05:36:13 PM
Hola, miren e buscado y buscado y no puedo encontrar los codigos, etc. para crear un avatar para los usuarios de mi web. Como es el codigo y donde se instala es mi pregunta. de antemano gracias.
Title: Re: [Mod] Avatar v2.01
Post by: Sunny C. on October 13, 2008, 12:03:24 AM
Es ist etwas tricki mit den htmlspecialchars aber der MOD funktioniert unter 1.7.6 ausgezeichnet!
Danke / Thanks

Ja das stimmt!
Habe diese mal an die Version 1.7.6 angepasst und eingedeutscht!

[Mod] Avatar v2 (by V@no) - 1.7.6 - Deutsch (http://www.4homepages.de/forum/index.php?topic=23012.0)
Title: Re: [Mod] Avatar v2.01
Post by: Lunat on October 21, 2008, 09:59:53 PM
in this topic already be question about:
How to make so that avatars of the user it was deduced under the loaded photo

But the answer has not been received. Well so, who can help?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on October 22, 2008, 06:43:30 AM
Sorry, I don't understand the question. Where do you want show the avatar?
Title: Re: [Mod] Avatar v2.01
Post by: Lunat on October 23, 2008, 04:40:53 PM
Under photo, near to a name of the author
Title: Re: [Mod] Avatar v2.01
Post by: Lunat on October 24, 2008, 04:37:15 PM
so, who can help?

How to make so that avatars was Under photo, near to a name of the author
Title: Re: [Mod] Avatar v2.01
Post by: Cocker on November 25, 2008, 09:26:37 PM
Fast alles funktioniert !!! :D
Bei den Kommentaren, in der Memberliste passt alles, upload auch ok !!

nur im member_profile.html und in der user_logininfo.html bring ich kein Avatar zustande !
Da erscheint nur ein weises feld mit einem roten Kreuz.

Wenn ich in der page_haeder.php folgenden code einfüge:
Code: [Select]
  "user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" border=\"0\" alt=\"\">" : "",
bekomme ich folgenden Fehler!!

Code: [Select]
Parse error: syntax error, unexpected $end in /home/.sites/715/site780/web/4images/includes/template.php(101) : eval()'d code on line 52
Kann mir jemend helfen!!!!

MfG Cocker


Title: Re: [Mod] Avatar v2.01
Post by: V@no on November 25, 2008, 11:38:08 PM
http://www.4homepages.de/forum/index.php?topic=23072.0
Title: Re: [Mod] Avatar v2.01
Post by: Cocker on November 26, 2008, 08:11:19 AM
Besten Dank für den Link, jetzt läuft fast alles wie es gehört !!!


Nur bei der SUCHE erhalte ich noch einen Fehler, ganz oben im Template, noch über dem Banner!

Code: [Select]
Notice: Undefined index: user_avatar in /home/.sites/715/site780/web/4images/includes/page_header.php on line 120
??? Wie bekomme ich den noch weg!! Der Fehler kommt aber nur wenn ich als GAST auf der Seite bin.
Eingeloggt kommt kein Fehler !!!

Kann wer helfen ?

MfG Ernst
Title: Re: [Mod] Avatar v2.01
Post by: V@no on November 26, 2008, 03:05:14 PM
Original installation instructions has no changes in includes/page_header.php
Title: Re: [Mod] Avatar v2.01
Post by: exploracje on November 29, 2008, 01:07:57 PM
I have problem with some avatar (is displayng and discharging) on the web member_editprofile.html  - when I click on some image. If You want to see it, please look on the page http://www.wrp.exploracje.pl (http://www.wrp.exploracje.pl) & http://www.wrp.exploracje.pl/member.php?action=editprofile (http://www.wrp.exploracje.pl/member.php?action=editprofile) (Polish: Panel kontrolny)  login: demo , pass: demo      4images 1.7.6
Title: Re: [Mod] Avatar v2.01
Post by: V@no on November 29, 2008, 06:50:03 PM
In step 10 replace
Code: [Select]
              <SELECT name="user_avatar" size="6" onkeypress="if(window.event.keyCode==13){ this.form.submit(); }" onChange="document.images.icons.src='{template_url}/avatars/'+document.creator.user_avatar.options[document.creator.user_avatar.selectedIndex].value;">{user_avatar_images}</SELECT>

With:
Code: [Select]
              <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>
Title: Re: [Mod] Avatar v2.01
Post by: sanko86 on January 25, 2009, 10:30:09 AM
thanks
good mod

the turkey hello
Title: Re: [Mod] Avatar v2.01
Post by: Namless on February 15, 2009, 04:47:47 PM
how can i download the installer file?????
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 15, 2009, 08:22:54 PM
Welcome to 4images forum.

The file is attached to the original post.
Title: Re: [Mod] Avatar v2.01
Post by: Namless on February 16, 2009, 07:39:31 PM
thanks
Title: Re: [Mod] Avatar v2.01
Post by: AntiNSA2 on March 01, 2009, 05:25:29 PM
Hi V@no... happy to see you are still here...

I dont know whats up.. Im using 1.7.6

and getting this:

Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/lifephotography/htdocs/member.php on line 1352
which is:

"user_email" => format_text(stripslashes($user_email), 2),


together with code that looks like this:


  $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)), 2),
    "user_email" => format_text(stripslashes($user_email), 2),
    "user_email2" => format_text(stripslashes($user_email2), 2),
    "user_homepage" => format_text(stripslashes($user_homepage), 2),
    "user_icq" => $user_icq,
    "user_showemail_yes" => $user_showemail_yes,
    "user_showemail_no" => $user_showemail_no,
    "user_allowemails_yes" => $user_allowemails_yes,
    "user_allowemails_no" => $user_allowemails_no,
    "user_invisible_yes" => $user_invisible_yes,
    "user_invisible_no" => $user_invisible_no,
    "lang_profile_of" => $lang['profile_of'],
    "lang_email" => $lang['email'],


Is there something I am doing wrong?

Thanks always

thelifephotography.com  -  4images
www.thecenterofthenet.com  - drupal

Title: Re: [Mod] Avatar v2.01
Post by: AntiNSA2 on March 02, 2009, 12:02:19 AM
Ah sorry.. working 140 hours a week and trying to do site in between. I found my mistake, but I switched to the member pic instead ::)
Title: Re: [Mod] Avatar v2.01
Post by: Fastian on March 14, 2009, 08:50:09 AM
Quote from: drhtm
is it possible to add the avatar in the box 'Registered Users' after a member login right after their name and above the link to 'lightbox'?

And if a user hasn't chosen an avatar is it possible to put a default image or text in that space to remind the user to choose an avatar?

thanks
hmmm...I like the idea add avatar under the name :wink:
just did it on my site:open /includes/page_header.php
Find:
Code: [Select]
 "url_upload" => (!empty($url_upload)) ? $site_sess->url($url_upload) : $site_sess->url(ROOT_PATH."member.php?action=uploadform"),Add after:
Code: [Select]
"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" border=\"0\" alt=\"\">" : "",
Then, open user_logininfo.html template. Add this:
Code: [Select]
{user_avatar_current}

About default image - just change blank.gif with image u want.
@V@no
After this modification, I am getting following error message on Search page.
Notice: Undefined index: user_avatar in xxxx\includes\page_header.php on line 204
And on line 204 I have this
Code: [Select]
"user_avatar_current" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" border=\"0\" alt=\"\">" : "",When I view Search page as Admin, I don't get this error.
Can you please help.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on March 14, 2009, 09:07:38 AM
Did steps 4 and 12?
Title: Re: [Mod] Avatar v2.01
Post by: Fastian on March 14, 2009, 09:20:29 AM
Did steps 4 and 12?
Yes. I am pretty sure I followed your instructions completely. Infect, I double checked everything just now.
Addition user filed is there in db_field_definitions.php and in my DB, I can see "user_avatar" under 4images_users table.

Also, this error comes in Search page only when I view as a Guest. When logged in as Admin/User, I don't see this error message.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on March 14, 2009, 09:38:53 AM
Bug fixes -> [1.7 - 1.7.6] Additional user fields not being used for guests (http://www.4homepages.de/forum/index.php?topic=22727.0)
Title: Re: [Mod] Avatar v2.01
Post by: Fastian on March 14, 2009, 11:34:48 AM
Bug fixes -> [1.7 - 1.7.6] Additional user fields not being used for guests (http://www.4homepages.de/forum/index.php?topic=22727.0)
Sorry  :oops:
I missed it. I should have looked there.
It works perfect now  :)
Title: Re: [Mod] Avatar v2.01
Post by: maus on March 27, 2009, 11:23:31 AM
Avatarbild in die user_logininfo.html ist auch zu sehen aber ist man in profil von ein andern erscheint das Avatarbild von mir.
Title: Re: [Mod] Avatar v2.01
Post by: 4ella on April 20, 2009, 02:01:46 AM
Hello can anybody help me I have 1.7.6 version , 4times reinstalled member.php and for this reason also downloaded new 1.7.6 and I always get this error when entering to control panel :
I also tried this thread and I get always the same error: http://www.4homepages.de/forum/index.php?topic=23012.0
I m not able to upload avatar at all , I dont  see no avatar in members profile so I dont know what to do anymore, before posting anything Im always trying 2days to make it myself but right now I give it up . Is first post updated for 1.7.6 ?
member.php I made 3x times from the beginning so I dont believe it would be my fault , pls help  :cry:

Warning: opendir(./templates/default/avatars/users/) [function.opendir]: failed to open dir: No such file or directory in /home2/dancersr/public_html/pictures/member.php on line 1292

Warning: readdir(): supplied argument is not a valid Directory resource in /home2/dancersr/public_html/pictures/member.php on line 1294

Warning: closedir(): supplied argument is not a valid Directory resource in /home2/dancersr/public_html/pictures/member.php on line 1295

Warning: opendir(./templates/default/avatars/) [function.opendir]: failed to open dir: No such file or directory in /home2/dancersr/public_html/pictures/member.php on line 1304

Warning: readdir(): supplied argument is not a valid Directory resource in /home2/dancersr/public_html/pictures/member.php on line 1306

Warning: closedir(): supplied argument is not a valid Directory resource in /home2/dancersr/public_html/pictures/member.php on line 1307
Title: Re: [Mod] Avatar v2.01
Post by: V@no on April 20, 2009, 02:29:04 AM
Looks like you didn't do step 12 properly. Make sure you created the new folders and set persmissions to CHMOD 777
Title: Re: [Mod] Avatar v2.01
Post by: 4ella on April 20, 2009, 06:17:47 PM
Thanks V@no for very quick respond , right now I will try it

Man you are amazing , Thanks a lot  :D , compliments , you know perfectly what to do , I'm really stupid , I was controling only members.php but problem was like you 've said step 12. I made folder - *avatar *- instead *avatars *, permission were ok , I see everything now , now I will control the rest and will try to upload some avatars if everything works .
Title: Re: [Mod] Avatar v2.01
Post by: Anarchology on April 27, 2009, 06:00:27 AM
For some reason, I'm noticing that the avatars don't show to anyone logged out. Has anyone else had this problem, or has it been addressed already somewhere else in this thread?

Thanks in advance!
Title: Re: [Mod] Avatar v2.01
Post by: V@no on April 27, 2009, 09:08:56 AM
This should not be happening. Did you double check all the steps?
Any example where we can see this?
Title: Re: [Mod] Avatar v2.01
Post by: Anarchology on April 28, 2009, 09:55:26 PM
This should not be happening. Did you double check all the steps?
Any example where we can see this?

I backed up my database, and ran an older one before the Avatar add. Then re-ran the install for it. Now I am able to see the avatars ONLY when I am logged in under Admin, but not when logged in under a normal Member or as a Guest. I'm guessing there is a string I need to switch around in the modified scripts. I'll look through it all and see if I could find it myself. If anyone finds it before me, please post it up! Thanks!

Oh, and here is a direct link to my test site image page where the comments are at the bottom. If you guys see solid light-blue boxes under the user names, then I figured it out!

http://www.savegasforums.com/img-slum-7.htm

This is a screen cap of what it looks like for me being logged in as an admin...
http://www.savegasforums.com/img-this-is-what-the-admin-sees-9.htm

EDIT: Alright, I narrowed it down to being related to the database changes. When I grabbed the user database backup from my old site, and uploaded it, the Avatars didn't show at all. Then I reinstalled the install_avatars.php file (got the usual "double" message). Then, the avatars still just are able to be seen by the admin when in comments. Oddly, when looking at the member profiles, you can see the avatar whether guest, member, or admin. This is just weird.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on April 29, 2009, 05:14:40 AM
To be sure
1) if you login as regular member, can you see the avatars?
2) did you install ALL Bug Fixes & Patches (http://www.4homepages.de/forum/index.php?board=17.0) for your version of 4images?
Title: Re: [Mod] Avatar v2.01
Post by: Sunny C. on May 29, 2009, 08:25:37 AM
In the member_editprofile.htm is the Avatar showing up

But in member_profile.html, not work:

Code: [Select]
{if user_avatar_current}
<div id="userProfileOptionsAvatar">
        <div class="border">
          <div class="containerHead">
            <div class="containerIcon"><img src="{template_url}/images/icon/avatarM.png" alt=""></div>
            <h3 class="containerContent">{lang_avatar}</h3>
          </div>
          <div class="pageMenu">
            <ul>
              <li>{user_avatar_current}</li>
            </ul>
          </div>
        </div>
      </div>
{endif user_avatar_current}
Title: Re: [Mod] Avatar v2.01
Post by: neverkas on May 31, 2009, 10:51:03 PM
ENGLISH
With this MOD, uploading an avatar does not resize according to the pixels that get in the administrator control panel.
I can give a solution?
And if you ask me, I applied the latest update

Ex
I am in the Admin Panel measures 150x100
But if a user upload a 500x300 image, the image is 500x300 and not SIGE resizes to 150x100



SPANISH
Con este MOD, al subir un avatar no se redimensiona según los pixeles que pongo en el panel de control de Administrador.
Me pueden dar una solución?
Y por si me preguntan, apliqué la última actualización

Ej.
Yo tengo en el Panel de Administrador como medidas 150x100
Pero si un usuario sube una foto 500x300, la imagen sige siendo 500x300 y no se redimensiona a 150x100
Title: Re: [Mod] Avatar v2.01
Post by: V@no on June 01, 2009, 07:05:55 AM
This mod does not resize avatars, and should give error message if avatar is bigger certain size, UNLESS uploaded by administrator.

Did you try upload it as regular member?
Title: Re: [Mod] Avatar v2.01
Post by: neverkas on June 02, 2009, 05:47:12 PM
This mod does not resize avatars, and should give error message if avatar is bigger certain size, UNLESS uploaded by administrator.

Did you try upload it as regular member?

If I tried to upload it as a member, and I went anyway. Skipping any errors.
Verify that the codes are good, 4 times.
You can make a code to resize images that exceed the dimensions that apply?
Title: Re: [Mod] Avatar v2.01
Post by: Sunny C. on June 02, 2009, 09:59:49 PM
ENGLISH
With this MOD, uploading an avatar does not resize...

Look here: http://www.4homepages.de/forum/index.php?topic=3978.msg119398#msg119398
Title: Re: [Mod] Avatar v2.01
Post by: neverkas on June 03, 2009, 02:40:07 AM
Quote
Look here: http://www.4homepages.de/forum/index.php?topic=3978.msg119398#msg119398

But is not complete, saying such a repetitive yet got that error code.
What would the code work?

EDIT:   
I applied and I do not work.
Why?
Title: Re: [Mod] Avatar v2.01
Post by: GaYan on June 28, 2009, 08:22:16 PM
images are not being uploaded >>> ??? no error message appears..even the image gets uploaded...but it isnt stored in the server ...

what can i for this ?? even i checked with the ermision..even those are okay :)
Title: Re: [Mod] Avatar v2.01
Post by: V@no on June 28, 2009, 10:06:06 PM
check permissions on /templates/<yourtemplate>/avatars/users/ (should be CHMOD 777)
Title: Re: [Mod] Avatar v2.01
Post by: GaYan on June 30, 2009, 07:28:31 AM
V@no ... sir...i check them .,.. evrything seems to be right....  8O

ill try to install it again from the begining ....

thanks fot the reply sir !
Title: Re: [Mod] Avatar v2.01
Post by: daymos on July 05, 2009, 06:03:51 PM
Hi All!
How to display user_avatar_current in last_comments_bit.html on front page?
Title: Re: [Mod] Avatar v2.01
Post by: Damebi on July 13, 2009, 06:56:23 PM
Hell Yeah !!

Vielen vielen Dank für diesen Mod.

War zwar eine Sache von 2 Stunden alles reinzubasteln und nebenbei
gleich anzupassen aber es hat sich gelohnt.

1.7.7 - Guest User Admin, alle sehen alle Avatars, eine pure Avatarparty ;)

watch it --> http://www.damebi.at/4images (http://www.damebi.at/4images)
Title: Re: [Mod] Avatar v2.01
Post by: crs on July 29, 2009, 12:52:06 AM
Folgendes Problem, habe bereits alles versucht.

Wie kann ich den Randabstand von Avatar zu Rand komplett entfernen, sodass das Avatar den "Kasten" komplett ausfüllt.
Rechts und Links sind jeweils etwa 25px Platz zum Rand, das würde ich gerne entfernen, kann mir da jemand helfen? Bild habe ich angehängt.
Meine comment_bit.html habe ich auch nochmal als .txt angehängt.

Danke
Title: Re: [Mod] Avatar v2.01
Post by: clubsociety on August 08, 2009, 12:08:52 AM
Hi v@no,

it's me again.

Some user tried to change their avatars. But I got feedback that it doesn't work. The old picture is still in and there's no entry of a 2nd custom avatar in the list box.  :(

I checked the source code two times but can not find a mistake. Do you have any idea where to search for a solution?

Regards clubsociety
Title: Re: [Mod] Avatar v2.01
Post by: V@no on August 08, 2009, 02:01:47 AM
can you reproduce it yourself? what browser your using is using?
Title: Re: [Mod] Avatar v2.01
Post by: GaYan on August 13, 2009, 07:00:27 AM
is this compatible with 1.7.6 ? i did as the same .... but the image is not uploading :( !
i uploaded some via ftp..it is being displayed in the list but the usr cant upload a Avatar ? :S

i dont get any error messages ! ! i tried setting up new permision (777) to that folder..but it ddnt work ,Any Ideas ?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on August 13, 2009, 07:37:23 AM
Please re-do step 10, there were some extra BBCode tags, I've removed them.
Title: Re: [Mod] Avatar v2.01
Post by: GaYan on August 13, 2009, 09:18:24 AM
Please re-do step 10, there were some extra BBCode tags, I've removed them.

Thanks Sir !
Title: Re: [Mod] Avatar v2.01
Post by: clubsociety on August 25, 2009, 09:09:59 PM
Hi V@no,

I'm using firefox latest release.

The users take different bowsers.

My understandig is: I can upload several avatars. They will be listed in the box and I can choose from. Am I right?

Regards
Title: Re: [Mod] Avatar v2.01
Post by: V@no on August 26, 2009, 02:34:23 AM
Yes, that's correct.
Title: Re: [Mod] Avatar v2.01
Post by: edonai on August 28, 2009, 06:15:08 PM
Hello,
   
I want to show the avatar of the member in the description.

I put this in my page detail.html :

Code: [Select]
<tr>
<td colspan="3" class="commentUnderline">
<div class="commentTitle">
Description
</div>
</td>
</tr>

<tr>
<td colspan="3">
        <div align="center">
<div class="blg"><div class="brg"><div class="tlg"><div class="trg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td rowspan="2" width="50"><div class="imageDescriptionUser" style="margin-left:7px">{if user_avatar_current}
  <span class="avatar">{user_avatar_current}</span>
  {endif user_avatar_current}</div></td>
    <td><div style="text-align: left; width:100%; padding-left: 13px; float:left"><h2 style="font: bold 1.8em Trebuchet MS, Arial, sans-serif; color: #333333; padding:0; margin:0">{image_name}</h2></div>
    </td>
  </tr>
  <tr>

But it displays the avatar of the member connected, and not the owner....
Title: Re: [Mod] Avatar v2.01
Post by: V@no on August 29, 2009, 03:23:35 AM
did you try use {user_avatar} instead?

(sorry, don't have this mod installed to test it)
Title: Re: [Mod] Avatar v2.01
Post by: edonai on August 29, 2009, 11:33:26 AM
if i use {user_avatar}, no avatar is displayed
Title: Re: [Mod] Avatar v2.01
Post by: clubsociety on August 29, 2009, 09:59:19 PM
But any time I only get one avatar to choose from with the second option 'none'. If I upload more avatars ther's still only one in the box. I don't understand why. I can not find a mistake in the source code.

Any other ideas?

Regards
Title: Re: [Mod] Avatar v2.01
Post by: AKIN on September 24, 2009, 11:17:40 AM
I like this mod.
but
I install this mod > http://www.4homepages.de/forum/index.php?topic=23866.0
and install paging class comment..


it displays at first page but second page doesnt


Title: Re: [Mod] Avatar v2.01
Post by: V@no on September 24, 2009, 03:53:02 PM
you must do steps 2 and 2.2 in ajaxcomments.php too.
Title: Re: [Mod] Avatar v2.01
Post by: AKIN on September 24, 2009, 04:32:05 PM
it's ok.
this mod 1.7.7 work...
Title: Re: [Mod] Avatar v2.01
Post by: apaunganhote on October 17, 2009, 04:20:11 AM
I don't know why, i got this error when i accessing control panel.

Code: [Select]
Parse error: parse error in C:\wamp\www\4images\includes\template.php(101) : eval()'d code on line 107
I attached my member.php . Please kindly check it for me.
Title: Re: [Mod] Avatar v2.01
Post by: V@no on October 17, 2009, 04:38:55 AM
Problem is in template files you've edited.
Title: Re: [Mod] Avatar v2.01
Post by: apaunganhote on October 17, 2009, 05:17:39 AM
Problem is in template files you've edited.

Thank you so much V@no. I got it now. Only one problem, I tried to upload .png file. But it's says invalid extension. Where can i choose to accept png file, my default extensions for uploading png image is accpted. I can only png image for my gallery. Just that I can't upload for your avatar. Any idea?

And one more thing, for feature request, can you add auto image resize function for avatar ? Because,  currently whenever user want to upload the avatar, they have to resize by theirself first. It's pretty troublesome nowadays. If you can hack the module from your auto resize image to avatar. It will be very nice. I'm looking forward to get this new feature from you.

Thank you very much indeed!

With Regards,
Title: Re: [Mod] Avatar v2.01
Post by: Kaliha on October 25, 2009, 11:30:08 AM
Привет, когда пытаюсь заинсталить в БД вываливаются ошибки:
Code: [Select]
DB Error: Bad SQL Query: INSERT INTO 4images_settings () VALUES ('avatar_use', '1')
Duplicate entry 'avatar_use' for key 1

DB Error: Bad SQL Query: INSERT INTO 4images_settings () VALUES ('avatar_user_custom', '1')
Duplicate entry 'avatar_user_custom' for key 1

DB Error: Bad SQL Query: INSERT INTO 4images_settings () VALUES ('avatar_width', '50')
Duplicate entry 'avatar_width' for key 1

DB Error: Bad SQL Query: INSERT INTO 4images_settings () VALUES ('avatar_height', '50')
Duplicate entry 'avatar_height' for key 1
Таблицы не создаются, и их нет в БД
Title: Re: [Mod] Avatar v2.01
Post by: V@no on October 25, 2009, 06:33:21 PM
ого, не пойму как это у меня всё работало когда я делал этот инсталер...

всё исправил, ещё раз сделайте Step 12.
Title: Re: [Mod] Avatar v2.01
Post by: Kaliha on October 25, 2009, 09:55:57 PM
помогло, спасибо
Title: Re: [Mod] Avatar v2.01
Post by: Habi86 on November 09, 2009, 08:50:43 PM
Super Mod ^_^ bei mir funktioniert alles bestens  :)

Hab nur ein Problemchen  8O
Im Profil wird PN an dieses Mitglied nicht mehr angezeigt - und das gilt nur für den Admin
bei den Member ist es sichtbar - irgendwo muss ich was entfernt haben :(

Kann mir jemand bitte dabei helfen  :thumbup:

Liebe Grüße,
Habi
Title: Re: [Mod] Avatar v2.01
Post by: Bommel on January 03, 2010, 02:14:48 AM
Hallo allerseits,

ich möchte mich hier für diese tolle Unterstützung bedanken. Sauber und ordentlich beschrieben - selbst für einen weniger versierten Menschen. Das verdient ein großes Dankeschön! Die Einbindung des Mods hat auf Anhieb geklappt. :D

Ich wünsche allen ein gesundes und erfolgreiches Jahr 2010.

Gruß Bommel
Title: Re: [Mod] Avatar v2.01
Post by: zakaria666 on August 07, 2010, 12:03:31 AM
hello Vano i have a problem please help,

in include/upload.php

i have the error Parse error: syntax error, unexpected ';', expecting T_FUNCTION

whenever i try to upload some avatars. Any ideas?? this error tells me that its on line 336 on upload.php and line 336 is the closing php tag ?>..

an ideas sir???
Title: Re: [Mod] Avatar v2.01
Post by: V@no on August 07, 2010, 01:21:57 AM
Probably made a mistake doing steps 3.2 and/or 3.3

Count { and }, they must match
Title: Re: [Mod] Avatar v2.01
Post by: zakaria666 on August 07, 2010, 07:57:47 PM
Helo Vano

Im sorry and thank u for ur reply,

However i have a question previously i made a topic and u locked it  :( :( :( :( :( :( :( :( :( :( :( :( :( :(

it was actually a reallly valid topic about the PMv2 and how that it is hard to modify as i have put ur media site MOD and the smilie MOD and so not alot of explanation is done and no one is maintaining the PMv2 to tell us what we should comment out as the MOD that u made (media site) has certain codes inside the code in which we are being told to comment out and this is why i made that topic for help :(, im sorry vano but did i do something wrong?

I dont know what i should do if i make another topic u maybe lock it again but i have another request it is please if u can let members have option to make there images or videos downloadable or not, when they proceed to upload something.

:( i hope i havent done anything wrong. im sorry again
Title: Re: [Mod] Avatar v2.01
Post by: V@no on August 07, 2010, 08:26:45 PM
5) Reply to the appropriate thread if you have questions regarding MODs (http://www.4homepages.de/forum/index.php?topic=3914.0#post_rule5)
You already replied to the mod in question, then you started a new topic, that's why it was locked.
Title: Re: [Mod] Avatar v2.01
Post by: zakaria666 on September 08, 2010, 05:54:08 PM
Ok i have a very good question.

why does this only allow avatars and not actual photo image?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on September 09, 2010, 12:44:10 AM
Say, what? You can use a photo image as avatar...

the question was not understood
Title: Re: [Mod] Avatar v2.01
Post by: zakaria666 on September 09, 2010, 02:47:56 AM
Hello vano,

Im sorry please forgive me. What I meant was that can a person upload an actual image of themselves rather than an avatar (cartoon). When I think of avatar i think of the little cartoon images that are on xbox 360  :) :). Or does this modification actually can do both? because i read in some thread inside this topic that you said that you cannot find out how to make it so that a user can upload image profile picture, http://www.4homepages.de/forum/index.php?topic=3978.msg16408#msg16408 (http://www.4homepages.de/forum/index.php?topic=3978.msg16408#msg16408) so i was wondering why. Im very sorry vano.
Title: Re: [Mod] Avatar v2.01
Post by: V@nо on September 09, 2010, 06:42:09 AM
yes, users are able upload their own avatars.
Quote
New features in v2:
1. users can upload their own avatars.
Title: Re: [Mod] Avatar v2.01
Post by: zakaria666 on September 09, 2010, 11:34:50 PM
Hello vano,


Also for some reason users cannot seem to upload there own avatrs or pictures? it doesnt seem to work, ive set it 100 x 100  and i open image thats 100 x100 click save and it doesnt work

thanks
Title: Re: [Mod] Avatar v2.01
Post by: V@no on September 10, 2010, 03:02:36 AM
"doesn't work" - not helpful at all. Need more details.
Title: Re: [Mod] Avatar v2.01
Post by: zakaria666 on September 10, 2010, 02:47:46 PM
@Vano,

thanks for reply

This is the problem i think some members had some time ago i was browsing throgh and came across this thread u made
http://www.4homepages.de/forum/index.php?topic=3978.msg16549#msg16549 (http://www.4homepages.de/forum/index.php?topic=3978.msg16549#msg16549)

I changed it to this but then i get an error saying unexpected ';', inside of the upload form. When i removed it and then everything was normal but it still didnt upload. I upload an avatar click save page refreshes but no image.

:(

thanks sir
Title: Re: [Mod] Avatar v2.01
Post by: V@no on September 10, 2010, 03:09:20 PM
In that case you've changed something else, because what you were supposed to change is a HTML template, it could not possibly cause the error you've mentioned. Without that extra data inside <form> tag, you won't be able upload files through that form.

[EDIT]
The error you've mentioned doesn't show inside a form, it shows when you submit the form (save profile), it comes from incorrect modification of includes/upload.php
Title: Re: [Mod] Avatar v2.01
Post by: zakaria666 on September 10, 2010, 03:55:06 PM
@Vano,

What i did is deleted my /upload.php  and replaced it with original upload.php and installed again very carefully the upload.php part modification. And i am still recieving problems regarding the fact it says parse error: syntax error, unexpected ';', expecting T_FUNCTION in /home/globa122/public_html/xxxxx/includes/upload.php on line 334

Code is below sir, When i add that part to the form tag <form> i seem to get that error above :( when 1 thing goes right 100 thing goes wrong for me i hate it

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: upload.php                                           *
 *        Copyright: (C) 2002-2009 Jan Sorgalla                           *
 *            Email: jan@4homepages.de                                    * 
 *              Web: http://www.4homepages.de                             * 
 *    Scriptversion: 1.7.7                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die(
"Security violation");
}

if (!
function_exists("is_uploaded_file")) {
  function 
is_uploaded_file($file_name) {
    if (!
$tmp_file = @get_cfg_var('upload_tmp_dir')) {
      
$tmp_file tempnam('','');
      
$deleted = @unlink($tmp_file);
      
$tmp_file dirname($tmp_file);
    }
    
$tmp_file .= '/'.get_basefile($file_name);
    return (
ereg_replace('/+''/'$tmp_file) == $file_name) ? 0;
  }

  function 
move_uploaded_file($file_name$destination) {
    return (
is_uploaded_file($file_name)) ? ((copy($file_name$destination)) ? 0) : 0;
  }
}

class 
Upload {

  var 
$upload_errors = array();
  var 
$accepted_mime_types = array();
  var 
$accepted_extensions = array();
  var 
$upload_mode 3;

  var 
$image_type "";
  var 
$max_width = array();
  var 
$max_height = array();
  var 
$max_size = array();
  var 
$upload_path = array();

  var 
$field_name;
  var 
$file_name;
  var 
$extension;

  var 
$image_size 0;
  var 
$image_size_ok 0;
  var 
$lang = array();

  function 
Upload() {
    global 
$config$lang;

    
$this->max_width['thumb'] = $config['max_thumb_width'];
    
$this->max_width['media'] = $config['max_image_width'];
    
$this->max_height['thumb'] = $config['max_thumb_height'];
    
$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;

    
$this->upload_mode $config['upload_mode'];
    
$this->lang $lang;

    
$this->set_allowed_filetypes();
  }

  function 
check_image_size() {
    
$this->image_size = @getimagesize($this->upload_file);
    
$ok 1;
    if (
$this->image_size[0] > $this->max_width[$this->image_type]) {
      
$ok 0;
      
$this->set_error($this->lang['invalid_image_width']);
    }

    if (
$this->image_size[1] > $this->max_height[$this->image_type]) {
      
$ok 0;
      
$this->set_error($this->lang['invalid_image_height']);
    }
    return 
$ok;
  }

  function 
copy_file() {
   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{

    switch (
$this->upload_mode) {
    case 
1// overwrite mode
      
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);
      break;
    case 
2// create new with incremental extention
      
$n 2;
      
$copy "";
      while (
file_exists($this->upload_path[$this->image_type]."/".$this->name.$copy.".".$this->extension)) {
        
$copy "_".$n;
        
$n++;
      }
      
$this->file_name $this->name.$copy.".".$this->extension;
      
$ok move_uploaded_file($this->upload_file$this->upload_path[$this->image_type]."/".$this->file_name);
      break;
    case 
3// do nothing if exists, highest protection
    
default:
      if (
file_exists($this->upload_path[$this->image_type]."/".$this->file_name)) {
       
$this->set_error($this->lang['file_already_exists']);
       
$ok 0;
      }
      else {
        
$ok move_uploaded_file($this->upload_file$this->upload_path[$this->image_type]."/".$this->file_name);
      }
      break;
     }
    @
chmod($this->upload_path[$this->image_type]."/".$this->file_nameCHMOD_FILES);

    return 
$ok;
  }

  function 
check_max_filesize() {
    if (
$this->HTTP_POST_FILES[$this->field_name]['size'] > $this->max_size[$this->image_type]) {
      return 
false;
    }
    else {
      return 
true;
    }
  }

  function 
save_file() {
    global 
$user_info;

    
$this->upload_file $this->HTTP_POST_FILES[$this->field_name]['tmp_name'];
    
$ok 1;
    if (empty(
$this->upload_file) || $this->upload_file == "none") {
      
$this->set_error($this->lang['no_image_file']);
      
$ok 0;
    }

    if (
$user_info['user_level'] != ADMIN) {
      if (!
$this->check_max_filesize()) {
        
$this->set_error($this->lang['invalid_file_size']);
        
$ok 0;
      }
      if (
eregi("image"$this->HTTP_POST_FILES[$this->field_name]['type'])) {
        if (!
$this->check_image_size()) {
          
$ok 0;
        }
      }
    }

    if (!
$this->check_file_extension() || !$this->check_mime_type()) {
      
$this->set_error($this->lang['invalid_file_type']. " (".$this->extension.", ".$this->mime_type.")");
      
$ok 0;
    }
    if (
$ok) {
      if (!
$this->copy_file()) {
        if (isset(
$this->lang['file_copy_error'])) {
          
$this->set_error($this->lang['file_copy_error']);
        }
        
$ok 0;
      }
    }
    return 
$ok;
  }

  function 
upload_file($field_name$image_type$cat_id 0$file_name "") {
    global 
$HTTP_COOKIE_VARS$HTTP_POST_VARS$HTTP_GET_VARS$HTTP_POST_FILES;

    
// Bugfix for: http://www.securityfocus.com/archive/1/80106
    
if (isset($HTTP_COOKIE_VARS[$field_name]) || isset($HTTP_POST_VARS  [$field_name]) || isset($HTTP_GET_VARS   [$field_name])) {
      die(
"Security violation");
    }

    
$this->HTTP_POST_FILES $HTTP_POST_FILES;
    
$this->image_type $image_type;
    
$this->field_name $field_name;

    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") {
      
ereg("(.+)\.(.+)"$file_name$regs);
      
$this->name $regs[1];
      
ereg("(.+)\.(.+)"$this->HTTP_POST_FILES[$this->field_name]['name'], $regs);
      
$this->extension $regs[2];
      
$this->file_name $this->name.".".$this->extension ;
    }
    else {
      
$this->file_name $this->HTTP_POST_FILES[$this->field_name]['name'];
      
$this->file_name ereg_replace(" ""_"$this->file_name);
      
$this->file_name ereg_replace("%20""_"$this->file_name);
      
$this->file_name preg_replace("/[^-\._a-zA-Z0-9]/"""$this->file_name);

      
ereg("(.+)\.(.+)"$this->file_name$regs);
      
$this->name $regs[1];
      
$this->extension $regs[2];
    }

 if (
$this->image_type == "avatar") {
    
$this->file_name $file_name.".".$this->extension;
  }

    
$this->mime_type $this->HTTP_POST_FILES[$this->field_name]['type'];
    
preg_match("/([a-z]+\/[a-z\-]+)/"$this->mime_type$this->mime_type);
    
$this->mime_type $this->mime_type[1];

    if (
$this->save_file()) {
      return 
$this->file_name;
    }
    else {
      return 
false;
    }
  }

  function 
check_file_extension($extension "") {
    if (
$extension == "") {
      
$extension $this->extension;
    }
    if (!
in_array(strtolower($extension), $this->accepted_extensions[$this->image_type])) {
      return 
false;
    }
    else {
      return 
true;
    }
  }

  function 
check_mime_type() {
    if (!isset(
$this->accepted_mime_types[$this->image_type])) {
      return 
true;
    }
    if (!
in_array($this->mime_type$this->accepted_mime_types[$this->image_type])) {
      return 
false;
    }
    else {
      return 
true;
    }
  }

  function 
set_allowed_filetypes() {
    global 
$config;
    
//Thumbnails
    
$this->accepted_mime_types['thumb'] = array(
      
"image/jpg",
      
"image/jpeg",
      
"image/pjpeg",
      
"image/gif",
      
"image/x-png"
    
);
    
$this->accepted_extensions['thumb'] = array(
      
"jpg",
      
"jpeg",
      
"gif",
      
"png"
    
);

 
//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"
    
);


    
//Media
    
$this->accepted_extensions['media'] = $config['allowed_mediatypes_array'];

    
$mime_type_match = array();
    include(
ROOT_PATH.'includes/upload_definitions.php');

    foreach (
$mime_type_match as $key => $val) {
      if (
in_array($key$this->accepted_extensions['media'])) {
        if (
is_array($val)) {
          foreach (
$val as $key2 => $val2) {
            
$this->accepted_mime_types['media'][] = $val2;
          }
        }
        else {
          
$this->accepted_mime_types['media'][] = $val;
        }
      }
    }
  }

  function 
get_upload_errors() {
    if (empty(
$this->upload_errors[$this->file_name])) {
      return 
"";
    }
    
$error_msg "";
    foreach (
$this->upload_errors[$this->file_name] as $msg) {
      
$error_msg .= "<b>".(($this->image_type == "avatar") ? $this->HTTP_POST_FILES[$this->field_name]['name'] : $this->file_name).":</b> ".$msg."<br />";
    }
    return 
$error_msg;
  }

  function 
set_error($error_msg) {
    
$this->upload_errors[$this->file_name][] = $error_msg;
  }
//end of class
?>

Title: Re: [Mod] Avatar v2.01
Post by: haider512 on December 12, 2010, 10:00:42 AM
Help Help Help Needed...

Im having this error when i upload a file in avatar..??

Code: [Select]
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /home/haider/public_html/directory/includes/upload.php on line 289
I checked the line 289 it was of this coding
Code: [Select]
$this->accepted_mime_types['avatar'] = array(??

the whole code is

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"
    );

This is the whole code of includes/upload.php

Code: [Select]
attached

Please help what to do??? :!: :!: :!: :?: :?: :?: :?: :?:
Looking forward to your help...
Title: Re: [Mod] Avatar v2.01
Post by: haider512 on December 12, 2010, 11:40:26 AM
In which file i need to do the settings to show the avatar..

please see the attach file i have boxed the area i want to show the avatar..

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


ok i found the file now i guess its "user_logininfo" the the problem is i cant set the avatar..

but i dont know what to do to show avatar there..

i did put this in that code

Code: [Select]
{user_avatar_current}
so that current avatar shows up..but no use.. avatar is still not showing up??


Code: [Select]
{lang_loggedin_msg}<br /><br />
{user_avatar_current}
<br /><br />

<ul>
<li><a href="{url_lightbox}">{lang_lightbox}</a></li>
<li><a href="{url_control_panel}">{lang_control_panel}</a></li>
<li><a href="{url_logout}">{lang_logout}</a></li>
</ul>

can you or anyone help me set this avatar there...
Title: Re: [Mod] Avatar v2.01
Post by: V@no on December 12, 2010, 06:38:08 PM
Im having this error when i upload a file in avatar..??
You've made a mistake in step 3.6

In which file i need to do the settings to show the avatar..
http://www.4homepages.de/forum/index.php?topic=3978.msg17618;topicseen#msg17618
Title: Re: [Mod] Avatar v2.01
Post by: haider512 on December 12, 2010, 07:57:44 PM
Im having this error when i upload a file in avatar..??
You've made a mistake in step 3.6

In which file i need to do the settings to show the avatar..
http://www.4homepages.de/forum/index.php?topic=3978.msg17618;topicseen#msg17618

but you can see my code of upload.php..

i dont understand what did i do wrong..please tell me what did i do wrong in 3.6..it looks to i did exactly what was written in 3.6 and i doubled checked but i cant seem to figure out where did i do wrong....im not a good programmer i guess..
please tell what to do?? what did i do wrong in 3.6??

and many thanks the for second one solution..the avatar is now showing in registered user place..

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

.......


Hi..i tried your procedure..and yes a drop down list came up in the registration form..but problem is that when i choose a avatar from a drop down list it dont change..only the default image is appearing..

how to make it auto change..like in user edit profile..

when user edit profile and user click the avatar name in the dropdown list the avatar automatically changes..but here in registration form it dosent automatically changes..

you can see my site..

apnadigitalscope.com/directory

what to do??
Title: Re: [Mod] Avatar v2.01
Post by: V@no on December 12, 2010, 09:17:10 PM
i dont understand what did i do wrong..please tell me what did i do wrong in 3.6..it looks to i did exactly what was written in 3.6 and i doubled checked but i cant seem to figure out where did i do wrong....im not a good programmer i guess..
please tell what to do?? what did i do wrong in 3.6??

Move
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"
    );

above:above::
Code: [Select]
    //Thumbnails
    $this->accepted_extensions['thumb'] = array(
(I've updated the original instructions so it's less confusing)

Hi..i tried your procedure..and yes a drop down list came up in the registration form..but problem is that when i choose a avatar from a drop down list it dont change..only the default image is appearing..

how to make it auto change..like in user edit profile..

when user edit profile and user click the avatar name in the dropdown list the avatar automatically changes..but here in registration form it dosent automatically changes..

you can see my site..

apnadigitalscope.com/directory

what to do??
Replace
Code: [Select]
                  </b>{endif user_avatar_file} <select name="user_avatar"  onkeypress="if(window.event.keyCode==13){ this.form.submit(); }" onChange="document.images.icons.src='{template_url}/avatars/'+document.creator.user_avatar.options[document.creator.user_avatar.selectedIndex].value;">

with this:
Code: [Select]
                  </b>{endif user_avatar_file} <select name="user_avatar"  onkeypress="if(window.event.keyCode==13){ this.form.submit(); }" onChange="document.images.icons.src='{template_url}/avatars/'+this.value;">
Title: Re: [Mod] Avatar v2.01
Post by: haider512 on December 12, 2010, 10:52:49 PM
...


Gosh!!!! Dude how you do these stuff..you are genius.. wanna Give you a big hug...And wanna say you Big big thank you..

i dont know how do you figure out where is the problem..

i mean how would any one know that avatar coding should b up and the thumbnail should b down..its just different functions..they should b working where ever i put them in that file.. i dont understand why they need to be aligned to work..

i mean 2+3=5 then 3+2=5 ..answer should b the same and both different functions are in same file they should have worked..

but yaar..im not the creater and programmer so dont understand on these stuffs much..

But really you are superb man.. i dont know how do you figure out the problem..but Many Many thanks..

Long Live 4images..superb..
Title: Re: [Mod] Avatar v2.01
Post by: V@no on December 12, 2010, 11:25:40 PM
they should b working where ever i put them in that file.. i dont understand why they need to be aligned to work..
Inside the function it would not make any difference up or down, but you put it outside function, inside a class it's not permitted.
This mod originally was created for 4images v1.7, since then the source of the gallery has changed, that's why you couldn't find the exact lines and put it as you thought was close to.
The updated instructions should now eliminate this confusion and be more universal regardless of 4images version (I hope)
Title: Re: [Mod] Avatar v2.01
Post by: tutton on January 04, 2011, 06:05:52 PM
is there a modification that adds this code to the member.php script:

htmlspecialchars($user_row['user_name']) : REPLACE_EMPTY,

because i cant find it in a clean version of 1.7.7

specifically the, htmlspecialchars part

or is it not possible to use this modification with version 1.7.7?

thanks so much
Title: Re: [Mod] Avatar v2.01
Post by: V@no on January 04, 2011, 06:50:50 PM
I've updated step 1
Title: Re: [Mod] Avatar v2.01
Post by: tutton on January 04, 2011, 07:32:15 PM
Fantastic!!!!!!! Worked like a charm.  :D

Step 1.4 should also be updated if you feel like it.

Thanks again.
Title: Re: [Mod] Avatar v2.01
Post by: haider512 on January 05, 2011, 07:40:33 AM
hi v@no.
 can you also add feature which auto resize avatar when uploaded by user?
actually most users when upload avatar..they dont care for height and width and when they get error..then they dont upload..and choose from given..

cuz most users in my country dont know much about resizing of images throgh photoshop or any other tool..

can you please also make a mod..which auto resize the avatar when uploaded..like you did for thumnail and images.?
Title: Re: [Mod] Avatar v2.01
Post by: MrAndrew on February 05, 2011, 02:00:10 PM
I have this error, but my safe mod is turned off, and upload pictures to the gallery work`s fine too!!! I have same errors on my host, and my local server too. Permissions on "avatars" and "users" are set 777! Any ideas or desicions? :-)

Quote
Warning: move_uploaded_file(/templates/default/avatars/users/20.gif) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\Users\***\Desktop\Server\root\includes\upload.php on line 105

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\Windows\Temp\php78A2.tmp' to '/templates/default/avatars/users/20.gif' in C:\Users\***\Desktop\Server\root\includes\upload.php on line 105
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 05, 2011, 05:43:10 PM
Looks like you've altered something related to template paths in your gallery. There shouldn't be any / infront of templates/default/

You could try play with this line in includes/upload.php
    $this->upload_path['avatar'] = TEMPLATE_DIR."/".$cat_id."/avatars/users";
Title: Re: [Mod] Avatar v2.01
Post by: MrAndrew on February 06, 2011, 12:45:36 AM
Hmm, any ideas in what file? Maybe i changed somewhere, but where???
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 06, 2011, 02:58:40 AM
global.php maybe
Title: Re: [Mod] Avatar v2.01
Post by: MrAndrew 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?
Title: Re: [Mod] Avatar v2.01
Post by: haider512 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..
Title: Re: [Mod] Avatar v2.01
Post by: V@no 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;">
Title: Re: [Mod] Avatar v2.01
Post by: MrAndrew 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=\"\">",

:(
Title: Re: [Mod] Avatar v2.01
Post by: haider512 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..

Title: Re: [Mod] Avatar v2.01
Post by: MrAndrew 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;">
Title: Re: [Mod] Avatar v2.01
Post by: haider512 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??
Title: Re: [Mod] Avatar v2.01
Post by: MrAndrew on February 16, 2011, 01:03:51 PM
{user_avatar_current} - Is it show avatar in your header or no?
Title: Re: [Mod] Avatar v2.01
Post by: haider512 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;'>
Title: Re: [Mod] Avatar v2.01
Post by: MrAndrew 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=\"\">" : "",
Title: Re: [Mod] Avatar v2.01
Post by: haider512 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??
Title: Re: [Mod] Avatar v2.01
Post by: haider512 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.
(http://i341.photobucket.com/albums/o377/pakistanihaider/screen.jpg) (http://i341.photobucket.com/albums/o377/pakistanihaider/screen.jpg)

Please Help Suggest what to do??
Title: Re: [Mod] Avatar v2.01
Post by: V@no 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.
Title: Re: [Mod] Avatar v2.01
Post by: haider512 on February 17, 2011, 07:33:46 PM
i added that to page_header..  but it only shows default avatar i mean blank.gif.. it dont show the avatar in use??

i added in

$site_template->register_vars(array(

is there something im missing?
Title: Re: [Mod] Avatar v2.01
Post by: V@no on February 17, 2011, 07:36:51 PM
Oh, my bad, I missed another thing you need to change: replace $user_row with $user_info
Title: Re: [Mod] Avatar v2.01
Post by: haider512 on February 17, 2011, 07:48:28 PM
  "user_avatar_header" => ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($user_info['user_avatar'] == "") ? "blank.gif" : $user_info['user_avatar'])."\" name=\"new\" width=\"100\" height=\"100\" border=\"0\" alt=\"\">" : "",


Awesome..its working great sir..Many thanks.. just needed to change the name too cuz when in control panel i did selected a avatar the change was appearing on top..so i changed the name field from icons to new.. and its working fine..

Many Many Many THanks..you are the boss..Superb Thanks..

Kind Regards
Haider
Title: Re: [Mod] Avatar v2.01
Post by: MrAndrew on February 18, 2011, 10:31:06 AM
I`m too have a little Modification for this MOD. With this modification you will be possible to show image owner avatar, on details page or somewhere else!

1. In details.php find first SQL:

$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description,

Replace it with:

$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, u.user_avatar

1.1 Find below:

$cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;

Insert below:

$user_avatar_image = ($config['avatar_use']) ? "<img src=\"".TEMPLATE_PATH."/avatars/".(($image_row['user_avatar'] == "") ? "blank.jpg" : $image_row['user_avatar'])."\" name=\"new\" width=\"50\" border=\"0\" alt=\"\">" : "";
$site_template->register_vars(array(
"user_avatar_image" => $user_avatar_image,
));

2. Open details.html and insert this {user_avatar_image} where you want!

That`s All!
Title: Re: [Mod] Avatar v2.01
Post by: haider512 on March 03, 2011, 10:37:32 PM
Hello V@no sir.

Please can you do little modifications in this Mod.. that when user upload avatar , it automatically resizes the avatar..

if it is not possible..so is it possible a pop up appears to show user that he/she must upload the avatar to the defined width and height??

Sir.. having very much issue with avatar..  Please find a way to solve the resizing problem..if resizing not possible ..then please tell how to show user the popup error of avatar..

Looking forward to your response.

Kind Regards,
Haider
Title: Re: [Mod] Avatar v2.01
Post by: lisandru on March 14, 2011, 03:36:25 AM
tnx v@no it really works on me .
Title: Re: [Mod] Avatar v2.01
Post by: Hugo27 on May 31, 2011, 08:37:19 AM
Hello

can I have since built a mod now I have the problem that when an avatar wants upladen is a white page what are the

mfg
Title: Re: [Mod] Avatar v2.01
Post by: Hawkeye1975 on July 20, 2011, 07:56:45 PM
Hallo,

zum einen funktioniert bei mir irgendwie die Pixelbeschränkung nicht. Und zum anderen hätte ich die Avatar-Vorschau gerne neben der Leiste und nicht darunter.
Kann mir vielleicht jemand sagen, was ich da ändern muss?
Vielen Dank.

Gruß,
Olli
Title: Re: [Mod] Avatar v2.01
Post by: Rembrandt on July 20, 2011, 10:47:33 PM
.....
zum einen funktioniert bei mir irgendwie die Pixelbeschränkung nicht. Und zum anderen hätte ich die Avatar-Vorschau gerne neben der Leiste und nicht darunter.
...
zu der Vorschau, suche im Code  step 10.):
Code: [Select]
              <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>
ersetze es mit:
Code: [Select]
              <table width="100%" height="100" border="0">
                <tr>
                  <td align="left" width="130">
                    <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>
                  </td>
                  <td align="left">
                    {user_avatar_current}
                  </td>
                </tr>
              </table>

zur Beschränkung, hast du das als User oder Admin getestet, als Admin gibt es keine Beschränkung.

mfg Andi
Title: Re: [Mod] Avatar v2.01
Post by: Hawkeye1975 on July 20, 2011, 10:59:26 PM
Hi,

das mit dem Layout habe ich, danke!
Ich habe es tatsächlich als Admin getestet. Habe aber jetzt komischerweise auch eine Beschränkung als Admin?!
Wie bekomme ich die jetzt wieder raus? ^^

Gruß,
Olli
Title: Re: [Mod] Avatar v2.01
Post by: Rembrandt on July 21, 2011, 05:18:10 AM
...Wie bekomme ich die jetzt wieder raus? ^^
..
so gar nicht, ganz ehrlich wozu auch?
Title: Re: [Mod] Avatar v2.01
Post by: haider512 on July 25, 2011, 09:28:59 AM
Hello SIr.
   Im using your Mod.. its really nice feature in 4images. But i just want to ask from you please can you add one more feature in this mod, i mean user cant add image if its not the right size they need to use photoshop or other software to resize their image.
so is there any chance you add auto resize in this mod to like you added for images uploads.

Please it will be really Helpful.


Kind Regards
Haider
Title: Re: [Mod] Avatar v2.01
Post by: marcinos on December 17, 2011, 10:11:02 PM
I have a question how to add an avatar in details.html information so that the one who added the picture wrote:

username: Admin [avatar.gif 50x50]
Title: Re: [Mod] Avatar v2.01
Post by: V@no on December 18, 2011, 01:01:06 AM
Do you want just the text or see actual avatar like this?

username: Admin (http://www.4homepages.de/forum/index.php?action=dlattach;attach=3678;type=avatar)
Title: Re: [Mod] Avatar v2.01
Post by: marcinos on December 18, 2011, 12:15:16 PM
He wants to rewrite the file details.html so that it looked
Photo: for example, 500x500 and next to the right

Avatar 50x50 |  avatar adding picture (no viewer)

just like the picture number. 1

or picture 2
Title: Re: [Mod] Avatar v2.01
Post by: SweD on July 24, 2012, 10:29:34 AM
miss line change password
Title: Re: [Mod] Avatar v2.01
Post by: SweD on July 25, 2012, 10:28:01 PM
После установки данного мода в редактирование профиля editprofile пропала графа изменить пароль.
Я верннул эту графУ, но когда нажимаю на кнопку "Изменить пароль" ничего не происходит
Title: Re: [Mod] Avatar v2.01
Post by: toonks on March 15, 2013, 08:51:58 PM
Hi!

I'm having issues after installing this MOD. The problem seems to be with this code that goes into member.php

//-----------------------
//------ 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)),

The issue is ONLY on my editprofile.php page and this is the error:

Parse error: syntax error, unexpected $end in /home/xxxxxx/public_html/includes/template.php(101) : eval()'d code on line 244

I know it's got something to do with my template but I can't figure out how to fix it. If I remover the code entirely from members.php everything seems to be fine so it's obviously something wrong there.

Anyone know how to fix this problem? I've already looked through this (http://"http://www.4homepages.de/forum/index.php?topic=23072.msg125968#msg125968") but as I don't know where to look, I don't know how to fix it. Line 244 in template is this so it can't be the reason for the error:

$footer = $this->parse_template("footer");

Any help would be highly appreciated!
Title: Re: [Mod] Avatar v2.01
Post by: kirkslater on June 20, 2013, 08:58:02 PM
Hi

Noticed a little bug, admin users are about to upload their own avatar, but a registered user can't

You can fill in the form and save the profile, the page refreshes with "Error uploading image file:" at the top of the page with no report underneath

Any ideas? Is it a restrictions issue?
Title: Re: [Mod] Avatar v2.01
Post by: Aleksey on May 29, 2020, 01:29:32 AM
This Mod ready for gallery 1.8 and php 7+, but need this changes:

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

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" => format_text(stripslashes($user_name), 2),

New step 3.6.
Find:
Code: [Select]
    //Thumbnails
    $this->accepted_extensions['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"
    );

Enjoy!  :)
Title: Re: [Mod] Avatar v2.01
Post by: Jan-Lukas on May 29, 2020, 08:44:35 PM
 :thumbup: