Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: sparkylinked on October 19, 2007, 09:01:02 PM

Title: Avatar - I will upload my own picture:...Error Log
Post by: sparkylinked on October 19, 2007, 09:01:02 PM
Hi, I have been having an on going problem with uploading Avatars. Using the built in avatars, and linking to an avatar works perfect, but when users try to upload their own avatar nothing happens. The person gets no error and it looks as though it worked, but no avatar shows up at all.


I checked the forum error log and got this message:


ttp://www.japanlinked.com/forum/index.php?action=dlattach;attach=334;type=avatar

8: Undefined variable: clean_name
File: /home/content/J/a/s/JasonLinked/html/forum/Sources/Subs.php
Line: 3458


This is my Subs.php file starting from line 3458:


   // Sorry, no spaces, dots, or anything else but letters allowed.
   $clean_name = preg_replace(array('/\s/', '/[^\w_\.\-]/'), array('_', ''), $clean_name);

   $enc_name = $attachment_id . '_' . strtr($clean_name, '.', '_') . md5($clean_name);
   $clean_name = preg_replace('~\.[\.]+~', '.', $clean_name);

   if ($attachment_id == false || ($new && empty($modSettings['attachmentEncryptFilenames'])))
      return $clean_name;
   elseif ($new)
      return $enc_name;

   if (file_exists($modSettings['attachmentUploadDir'] . '/' . $enc_name))
      $filename = $modSettings['attachmentUploadDir'] . '/' . $enc_name;
   else
      $filename = $modSettings['attachmentUploadDir'] . '/' . $clean_name;

   return $filename;
}

Note: I run Japanese OS and all backslashes are YEN symbols. This is true for the code above.

I have no idea how to repair this. Could someone please advise me on how to fix this problem it has persisted way too long.

Thank you in Advance
Title: Re: Avatar - I will upload my own picture:...Error Log
Post by: jerm on October 23, 2007, 10:48:41 PM
SMF Version?
Mods installed?
Theme?
Title: Re: Avatar - I will upload my own picture:...Error Log
Post by: sparkylinked on October 24, 2007, 07:48:23 AM
This has been consistant versions since 1.1 ...1.1.4 is now installed.

I have these mods installed:

SMF 1.1.1 Update Package     1.1.1     [ Uninstall ]
2.    Ad Managment    2.0    [ Uninstall ]
3.    Language Drop    1.1    [ Uninstall ]
4.    Country Flags    1.0.1    [ Uninstall ]
5.    SMF 1.1.2 Update Package    1.1.2    [ Uninstall ]
6.    FlashChat Integration    0.1 Beta    [ Uninstall ]
7.    Gallery 2 Integration    1.0beta3    [ Uninstall ]
8.    SMF Quick Theme Changer    1.0.0    [ Uninstall ]
9.    SMF 1.0.11 / 1.1.3 Update    1.1    [ Uninstall ]
10.    SMF 1.0.12 / 1.1.4 / 2.0 b1.1 Update    1.0

I am currently using the default theme but Leviathan by Bloc is also installed, as well as Dilber Mc
Title: Re: Avatar - I will upload my own picture:...Error Log
Post by: SleePy on October 31, 2007, 11:21:33 PM
Have you tried to remove the few mods you have installed?
It maybe possible one of them is generating this error.

Which line is that exactly? Nothing there looks like it should be returning emtpy or unset so that is quiet odd.
Title: Re: Avatar - I will upload my own picture:...Error Log
Post by: sparkylinked on November 01, 2007, 01:40:34 AM
the first line is giving the error

$clean_name = preg_replace(array('/\s/', '/[^\w_\.\-]/'), array('_', ''), $clean_name);

I guess I will have to try uninstalling mods *sigh*
Title: Re: Avatar - I will upload my own picture:...Error Log
Post by: JayBachatero on November 05, 2007, 01:33:41 PM
Can you post your Subs.php file?