4images Modifications / Modifikationen > Mods & Plugins (Releases & Support)

[Mod] Avatar v2.01

<< < (100/101) > >>

SweD:
miss line change password

SweD:
После установки данного мода в редактирование профиля editprofile пропала графа изменить пароль.
Я верннул эту графУ, но когда нажимаю на кнопку "Изменить пароль" ничего не происходит

toonks:
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 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!

kirkslater:
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?

Aleksey:
This Mod ready for gallery 1.8 and php 7+, but need this changes:

New step 1.4.
Few lines below find:

--- Code: ---  $site_template->register_vars(array(
    "user_name" => format_text(stripslashes($user_name), 2),

--- End code ---

Replace with:

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

--- End code ---

New step 3.6.
Find:

--- Code: ---    //Thumbnails
    $this->accepted_extensions['thumb'] = array(

--- End code ---

Insert above:

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

--- End code ---

Enjoy!  :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version