PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   This topic is locked: you cannot edit posts or make replies.
Author Message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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 Visit poster's website AIM Address Yahoo Messenger
blith
Client


Joined: Jul 18, 2003
Posts: 977

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

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
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
blith
Client


Joined: Jul 18, 2003
Posts: 977

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

right, will do. I did a backup of the tables before applying the fix. Thanks.
View user's profile Send private message Visit poster's website
blith
Client


Joined: Jul 18, 2003
Posts: 977

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

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...
View user's profile Send private message Visit poster's website
blith
Client


Joined: Jul 18, 2003
Posts: 977

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

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
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
blith
Client


Joined: Jul 18, 2003
Posts: 977

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

we posted at the same time.... I think my post reflects your worry
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
blith
Client


Joined: Jul 18, 2003
Posts: 977

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

yes.. I redid my avie and it shows up fine now... thank you. I will have everyone redo theirs...
View user's profile Send private message Visit poster's website
blith
Client


Joined: Jul 18, 2003
Posts: 977

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

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)
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

That's really the correct and best way.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
blith
Client


Joined: Jul 18, 2003
Posts: 977

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

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)
View user's profile Send private message Visit poster's website
freeby
New Member
New Member


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

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

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





PostPosted: Tue Sep 23, 2003 7:49 pm Reply with quote Back to top

I have also fought with this problem since Tom ported the first phpBB raven. I'll take a look at your progress..Looks like it should work right with your findings Smile
It sure has driven me nuts and from 6.0 to 7.0 it's still broke Confused

mikem
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

The only thing I still haven't fixed is the broken avatar on new users to the forum. Got a fix for that Laughing
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
sqzdog
Involved
Involved


Joined: Sep 22, 2003
Posts: 252

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

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
Only registered users can see links on this board!
Get registered or login to the forums!
View user's profile Send private message Send e-mail
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
sqzdog
Involved
Involved


Joined: Sep 22, 2003
Posts: 252

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

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!
View user's profile Send private message Send e-mail
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
sharlein
Member Emeritus


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

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

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 Back to top

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
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

You need to change the permissions on modules/Forums/images/avatars to 777 (on each folder, but not the contents)
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
jbutler
New Member
New Member


Joined: Sep 24, 2003
Posts: 3

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

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!
View user's profile Send private message
Display posts from previous:       
Post new topic   This topic is locked: you cannot edit posts or make replies.

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum