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

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

0 Members and 1 Guest are viewing this topic.

Offline SweD

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #495 on: July 24, 2012, 10:29:34 AM »
miss line change password

Offline SweD

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #496 on: July 25, 2012, 10:28:01 PM »
После установки данного мода в редактирование профиля editprofile пропала графа изменить пароль.
Я верннул эту графУ, но когда нажимаю на кнопку "Изменить пароль" ничего не происходит

Offline toonks

  • Pre-Newbie
  • Posts: 8
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #497 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")==|| strcasecmp($extension,"jpg")==|| strcasecmp($extension,"jpeg")

==
|| strcasecmp($extension,"png")==){ 
         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 errorsyntax errorunexpected $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 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!

Offline kirkslater

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #498 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?

Offline Aleksey

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [Mod] Avatar v2.01
« Reply #499 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!  :)

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.297
    • View Profile
    • Discover the New World of Kindersurprise
Re: [Mod] Avatar v2.01
« Reply #500 on: May 29, 2020, 08:44:35 PM »
 :thumbup:
Danke Harald