PDA

View Full Version : Bug -- Clicking on profile in last post column


bigmattyh
Mon 5th Aug '02, 7:09pm
When I click on the user's name in the last post column of the main forumdisplay page, I get sent to the same profile every time -- the profile for a user named KuraFire. Isn't that odd? It doesn't matter what the name is in that column.

Anyway, check it out!

bigmattyh
Mon 5th Aug '02, 7:10pm
Okay, slight correction -- it's not taking me to the SAME profile every time, but it is taking me to the WRONG profile.


EDIT: It seems to be taking me to the profile of whoever posted last in the forum... not whoever post last in the thread, as intended.

Bungee
Wed 7th Aug '02, 6:33pm
Yep - was just about to post this one myself.

Mike Sullivan
Wed 7th Aug '02, 7:10pm
Fixed.

bigmattyh
Wed 7th Aug '02, 8:26pm
Hey Mike (Ed),

I noticed that the link to go to the last poster actually calls a particular function within the member.php file:

http://beta.vbulletin.com/vb3/member.php?find=lastposter&threadid=569

and it occurred to me that to do it that way might open the door for some mistakes. For instance, if someone posts to that thread between the time that the page was originally loaded and the link was clicked, you would have someone thinking that they'd be seeing Member X's profile, when they'd actually be taken to Member Y's profile. Would it not make sense, then, to have a link such as this:

http://beta.vbulletin.com/vb3/member.php?username=Member+X

to ensure that the user will get to see the profile he thinks he's about to see? It wouldn't require any additional queries or any other bits of information that forumhome.php doesn't already use -- only that the name be urlencoded before being inserted into the querystring.

filburt1
Wed 7th Aug '02, 9:48pm
That happens in vB2 also, it made me think it was a bug for a while too. I guess it saves queries though.

bigmattyh
Wed 7th Aug '02, 11:28pm
Originally posted by filburt1
That happens in vB2 also, it made me think it was a bug for a while too. I guess it saves queries though. Well, what saves queries is the database design (which is very efficient, BTW). The name of the last poster is stored in the row containing data about a particular thread, and it is updated every time that a new post is made. You don't have to left join the thread table to the post table to the user table to find out what the name of the user is who made the last post -- it's there already, and that info is used when it prints out "Last post by bigmattyh".

That's why I suggested that the profile info be passed to member.php via the user's name. No extra queries -- or any revisions of queries -- would be necessary. Just to urlencode the name before making it part of the link. Anyway, I think it's a good idea. It's clean and efficient and leaves no room for error.