Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Bug Fixes
Author Message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Thu Sep 18, 2003 11:12 pm Reply with quote

After playing with this all night and figuring out the patterns, I believe the following will fix all avatar broken images and pathing issues. The main problems stems from the way the forums store the avatar paths and nuke stores, or doesn't store them. I believe that this fixes all scenarios.

First of all BACKUP your users table and your Your_Account/index.php file!!!!

Then, in Forum Configuration, set the 2 avatar settings to
modules/Forums/images/avatars

Then, modify modules/Your_Account/index.php as follows.

Find and change all instances of
/gallery/$userinfo
to
/$userinfo

Then on or about line 771 comment out this line
$userinfo[user_avatar] = ereg_replace("gallery/","",$userinfo[user_avatar]);
so it should look like this
//$userinfo[user_avatar] = ereg_replace("gallery/","",$userinfo[user_avatar]);

Then on or about linee 998 and also 1010, find this code
user_avatar='$user_avatar'
and change it to
user_avatar='gallery/$user_avatar'

If this breaks some user's avatars, then it's probably because the avatar had been saved w/o the gallery prefix in the path. Or some other work-around had been attempted. There could be many scenarios based on each site. If you run into that problem, contact me back here and I will try to help you.

Note that I tested this on 6.8 an 6.9. It should work on 6.5 also, but 'buyer beware' Laughing
 
View user's profile Send private message
blith
Client



Joined: Jul 18, 2003
Posts: 977

PostPosted: Fri Sep 19, 2003 7:36 am Reply with quote

Raven, after applying your fix. I had a broken avatar still with this path.
Code:
http://www.gamersroam.com/modules/Forums/images/avatars/079.gif

The ones that work look like this.
Code:
http://www.gamersroam.com/modules/Forums/images/avatars/gallery/107.gif

How can I add the gallery to the paths of those who do not have it? Thanks.
 
View user's profile Send private message Visit poster's website
Raven







PostPosted: Fri Sep 19, 2003 7:44 am Reply with quote

First test that that is the problem by manually updating that users record in the users_table using phpMyAdmin. Correct the user_avatar to gallery/079.gif.

If that works, then you could try running this query

UPDATE nuke_users
set user_avatar = 'gallery/'||user_avatar
where user_avatar not like 'gallery%';

Be sure to back up your users table before attempting this. I have not tested the SQL but it should work.
 
blith







PostPosted: Fri Sep 19, 2003 9:17 am Reply with quote

right, will do. I did a backup of the tables before applying the fix. Thanks.
 
blith







PostPosted: Fri Sep 19, 2003 9:28 am Reply with quote

Well I edited the one record and it shows up properly so I ran the query and it said it affected 408 rows so... I hope we have it...
 
blith







PostPosted: Fri Sep 19, 2003 9:31 am Reply with quote

After checking the forums all the offsite avatars have been killed they all have red xs now.... Sad any suggestions? The records that had offsite links to avatars all have 0 in the user_avatar field


Last edited by blith on Fri Sep 19, 2003 9:31 am; edited 1 time in total 
Raven







PostPosted: Fri Sep 19, 2003 9:31 am Reply with quote

The only unknown is uploaded avatars. Those are encoded and they may end up with a broken image with a gallery/gallery/ path. Hope not.
 
blith







PostPosted: Fri Sep 19, 2003 9:33 am Reply with quote

we posted at the same time.... I think my post reflects your worry
 
Raven







PostPosted: Fri Sep 19, 2003 9:34 am Reply with quote

Laughing You may just have to have the people reload them. Remeber that we are trying to remediate an error in the original coding, not work around it. Since the path is encoded in the md5'd name, there is no way to modify that programatically.
 
Raven







PostPosted: Fri Sep 19, 2003 9:39 am Reply with quote

As a test, remove the gallery/ from in front of one of the uploaded avatars and see if it functions correctly. If so, I may be able to write another SQL query.
 
blith







PostPosted: Fri Sep 19, 2003 9:40 am Reply with quote

yes.. I redid my avie and it shows up fine now... thank you. I will have everyone redo theirs...
 
blith







PostPosted: Fri Sep 19, 2003 9:41 am Reply with quote

Raven wrote:
As a test, remove the gallery/ from in front of one of the uploaded avatars and see if it functions correctly. If so, I may be able to write another SQL query.

There was no longer a path it just showed up as a zero (0)
 
Raven







PostPosted: Fri Sep 19, 2003 9:41 am Reply with quote

That's really the correct and best way.
 
blith







PostPosted: Fri Sep 19, 2003 9:47 am Reply with quote

Just in case you didn't see it becasue we posted at the ame time again...

Raven wrote:
As a test, remove the gallery/ from in front of one of the uploaded avatars and see if it functions correctly. If so, I may be able to write another SQL query.

Blith wrote:
There was no longer a path it just showed up as a zero (0)
 
freeby
New Member
New Member



Joined: Aug 25, 2003
Posts: 20
Location: UK

PostPosted: Fri Sep 19, 2003 1:02 pm Reply with quote

Just applied the fix on my 6.5 and it works great, thanks once more Very Happy
 
View user's profile Send private message
Raven







PostPosted: Tue Sep 23, 2003 7:52 pm Reply with quote

The only thing I still haven't fixed is the broken avatar on new users to the forum. Got a fix for that Laughing
 
sqzdog
Involved
Involved



Joined: Sep 22, 2003
Posts: 252

PostPosted: Tue Sep 23, 2003 7:58 pm Reply with quote

I can't get any avatars to display in the forums or Ravens site info block. Is this what fixes that avatars on the site info block? See the site info block on my site so you can see what I am talking about www.fluvannaonline.com
 
View user's profile Send private message Send e-mail
Raven







PostPosted: Tue Sep 23, 2003 8:05 pm Reply with quote

It may. Try it and see. Back up your files as I prescribe and you may have to resave your avatar after applying the fix.
 
sqzdog







PostPosted: Tue Sep 23, 2003 8:47 pm Reply with quote

Well Raven, this was my first time really getting in and altering code. Been playing with my phpnuke site for 2 months now. No experience whatsoever with web stuff before. Your directions to fix this problem were clear and concise and it worked like a charm. Thanks so much for all the help you have provided!
 
Raven







PostPosted: Tue Sep 23, 2003 8:50 pm Reply with quote

Thanks for the feedback! I am so glad we are a little closer to getting these pesky bugs resolved. Now it remains to be seen if this fix makes it into the next release. Don't hold your breath Laughing
 
sharlein
Member Emeritus



Joined: Nov 19, 2002
Posts: 322
Location: On the Road

PostPosted: Wed Sep 24, 2003 7:50 am Reply with quote

Raven, I applied this fix and it worked great. the only problem that I ran into was
Quote:
Then on or about linee 998 and also 1010, find this code
user_avatar='$user_avatar'
and change it to
user_avatar='gallery/$user_avatar'
I didn't have that code at or near line 1010, but it still fixed my problems. Thanx, Steve
 
View user's profile Send private message
jbutler
New Member
New Member



Joined: Sep 24, 2003
Posts: 3

PostPosted: Wed Sep 24, 2003 7:16 pm Reply with quote

When I attempt to upload an avatar, after making these mods, I get the following error msg:

Code:
Warning: copy(./modules/Forums/images/avatars/443e7d7f3f723f0010229.gif) [function.copy]: failed to create stream: Permission denied in /www/html/ss/includes/usercp_avatar.php on line 267


Weird thing is, there is no line 267 in usercp_avatar.php.

Any thought as to what's going on?

Thanks for the assistance!
 
View user's profile Send private message
Raven







PostPosted: Wed Sep 24, 2003 7:26 pm Reply with quote

You need to change the permissions on modules/Forums/images/avatars to 777 (on each folder, but not the contents)
 
jbutler







PostPosted: Wed Sep 24, 2003 7:32 pm Reply with quote

Permissions! Ain't they a bear?

I checked the permissions on the directory into which the avatar was supposed to upload and found that it was NOT writeable by the Web server user. Changed it so it was and bada-bing! My avatars are uploading!

Thanks for your very useful mod!
 
jbutler







PostPosted: Wed Sep 24, 2003 7:33 pm Reply with quote

Raven wrote:
You need to change the permissions on modules/Forums/images/avatars to 777 (on each folder, but not the contents)

Very Happy
You're too quick for me!

As I was typing my permissions note, you posted the fix.

Now, that's service!
 
Display posts from previous:       
Post new topic   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> Bug Fixes

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©