Joined: May 02, 2003 Posts: 1396 Location: Puerto Rico
Posted:
Sat Jan 03, 2004 12:27 pm
Upon running tests on a stand-alone phpBB forum i noticed avatars get deleted even if they are not uploaded avatars, the avatar type does not get detected by the forum's profile. In the case of PHP-Nuke even while nothing in it causes the avatars to get deleted the avatar type does not get set when a user's info is saved to the database.
fix:
Open modules/Your_Account/index.php:
In function activate find:[/b]
Code:
if ($check_num == $row[check_num]) {
$db->sql_query("INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_password, user_avatar, user_regdate, user_lang) VALUES (NULL, '$row[username]', '$row[user_email]', '$row[user_password]', 'gallery/blank.gif', '$row[user_regdate]', '$language')");
$db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'");
Change to:
Code:
if ($check_num == $row[check_num]) {
$db->sql_query("INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_password, user_avatar, user_avatar_type, user_regdate, user_lang) VALUES (NULL, '$row[username]', '$row[user_email]', '$row[user_password]', 'gallery/blank.gif', 3, '$row[user_regdate]', '$language')");
$db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'");
Joined: May 02, 2003 Posts: 1396 Location: Puerto Rico
Posted:
Sat Jan 03, 2004 12:50 pm
Hiyas and Happy New Year, check out the avatar CP, you might like it, had to change one line just now as i tend to forget not everyone uses the same php version, should be trouble-free now.
Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
Posted:
Sun Jan 04, 2004 12:05 am
chatserv wrote:
Hiyas and Happy New Year, check out the avatar CP, you might like it, had to change one line just now as i tend to forget not everyone uses the same php version, should be trouble-free now.
Well, all I can say is that you've outdone yourself this time!!! I will definitely be incorporating this into my customized version!! Thanks!!
Joined: May 02, 2003 Posts: 1396 Location: Puerto Rico
Posted:
Sun Jan 04, 2004 1:05 pm
I'm working on a few at the time, mostly hacks to existing modules, whichever comes out working ok first will be it, the one for the downloads module might be sidelined or even dropped, too many hacks available already, i may attempt a port but that's still in the drawing board.
I just loaded the control panel, I am using 6.7 and it works like a CHAMP! Thank you very much.
One thing. This works GREAT when you access the avatars from "your account" and it is so nice that the avatars dont get deleted anymore when you switch them.
They do however still get deleted when users change their avatars in the "profile" section of the forum. Is there a fix for this yet? It is so annoying.
I figure between Chatserv and Raven, theres has to be a trick or a fix for it.
Once again, thank you very much for the control panel GREAT WORK!
Joined: May 02, 2003 Posts: 1396 Location: Puerto Rico
Posted:
Mon Jan 05, 2004 2:02 pm
Seems i overlooked something in the avatar CP if they still get deleted, i will check on it and update the pack being distributed but as Raven mentioned what is posted above may help you apply the fix yourself.
lol, when I go to the fron page, and I look at the news post from Chatsrv.
Quote:
Proposed fix - Avatars get auto-deleted
Posted by Raven on Saturday, January 03 @ 11:33:08 MST (0 reads)
Topic Bugs - Fixed
chatserv writes: "When a user uploads an avatar through the forums and later decides to change to a new avatar the previously uploaded avatar gets deleted, by mistake Nuke's default profile manager saves any avatar selected from within it without saving to the users database table its avatar_type value, since no type is defined the type gets set to 0 which is the default value, in forum terms any avatar with a type value of 0 or 1 is presumed to have been uploaded and as such it gets marked as deletable even if it is a gallery avatar hence why any avatar gets deleted when a new one is selected through the forum's profile manager.
For my proposed fix go here."
Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
Posted:
Mon Jan 05, 2004 3:28 pm
You started out talking about the control panel, which is a separate post/news item. So, when you started discussing the deleted avatars, I [mis]assumed that you hadn't been working with the other patch of his.
You have done it!!!! That fix along with the control panel fix corrects the deleted avatar issue in both the "your account" section in nuke, and the "profile" section in the nukebb module.
Thank you very much for this. You have just removed a MAJOR thorn in my side. I have been having to upload the entire avatar directory once a week due to users changing their avartars.
Joined: May 02, 2003 Posts: 1396 Location: Puerto Rico
Posted:
Sat Jan 10, 2004 2:04 pm
Much appreciated, i have been really busy while i have been offline (i still am *sniff*) so be on the lookout for some hacks and fixes that you might find useful.
I have mad the changes and I get this error now after trying to upload an avatar
This is the error I'm getting:
Warning: move_uploaded_file(.//modules/Forums/images/avatars/538736884404e376a27112.jpg): failed to open stream: Permission denied in /home/thesport/public_html/includes/usercp_avatar.php on line 264
Warning: move_uploaded_file(): Unable to move '/tmp/php2uVOmy' to './/modules/Forums/images/avatars/538736884404e376a27112.jpg' in /home/thesport/public_html/includes/usercp_avatar.php on line 264
Raven I'm getting the same error on the new site I have up, what folder do I change and to what permisson?
Is it the usercp_avatar.php folder, and do I change it to 777?
Quote:
Warning: move_uploaded_file(./modules/Forums/images/avatars/18367007504094a0aeb98dd.jpg): failed to open stream: Permission denied in /home/thesport/public_html/thecivic/includes/usercp_avatar.php on line 264
Warning: move_uploaded_file(): Unable to move '/tmp/phpF4MuFi' to './modules/Forums/images/avatars/18367007504094a0aeb98dd.jpg' in /home/thesport/public_html/thecivic/includes/usercp_avatar.php on line 264
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum