|
| Author |
Message |
~HG~
Joined: 25 Sep 2005
Posts: 423
Location: Australia
|
Posted: 2/5/2006, 4:57 am Post subject: Need more help with another mod |
|
|
As I cant access phpbbhacks.com I need further help now with the Random avatar hack by Mosheen
The problem appears to be in viewtopic.php as when I upload the edited page, I get the dreaded white page of death.
The edits are as follows for viewtopic.php
| Code: |
#-----[ OPEN ]---------------------------------
#
viewtopic.php
#
#-----[ FIND ]---------------------------------
#
$sql = "SELECT u.username,
FROM " . POSTS_TABLE
WHERE p.topic_id = $topic_id
#
#-----[ BEFORE, ADD ]---------------------------------
#
// Modified By Random Avatars Mod //
#
#-----[ IN-LINE FIND ]---------------------------------
#
u.user_avatar_type,
#
#-----[ IN-LINE AFTER, ADD ]---------------------------------
#
u.user_randomavatars, u.admin_randomavatars,
#
#-----[ FIND ]---------------------------------
#
$poster_avatar = '';
#
#-----[ AFTER, ADD ]---------------------------------
#
// Random Avatars Mod //
if ( $postrow[$i]['user_randomavatars'] == 1 && $postrow[$i]['admin_randomavatars'] == 1 )
{
$sql = "SELECT * FROM " . AVATARS_TABLE . " WHERE user_id = '$poster_id' ORDER BY RAND() LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user avatar status', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$image_name = $row['user_avatar'];
$cnt_chrs = strlen( $board_config['avatar_gallery_path'] );
if ( substr($image_name, 0, 4) == "http" )
{
$poster_avatar = "<img src=\"" . $image_name . "\" border=0 />";
}
else if ( substr($image_name, 0, $cnt_chrs) == $board_config['avatar_gallery_path'] )
{
$poster_avatar = "<img src=\"" . $image_name . "\" border=0 />";
}
else
{
$poster_avatar = "<img src=\"" . $board_config['avatar_path'] . "/" . $image_name . "\" border=0 />";
}
}
//---------END---------//
//
// Note: the following 'else if' was formerly 'if' > Modified By Random Avatars Mod
//
#
#-----[ FIND ]---------------------------------
#
if ( $postrow[$i]['user_avatar_type'] &&
#
#-----[ IN-LINE FIND ]---------------------------------
#
if
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------
#
else
# |
Now it could well be this line that is causing the problem:
if ( $postrow[$i]['user_avatar_type'] &&
as in 2.0.19 it actually reads:
if ( $userdata['session_logged_in'] && $postrow[$i]['user_avatar_type'] && $poster_id != ANONYMOUS && $postrow[$i]['user_allowavatar'] )
if you add the else to the front of it you get a white page and if you dont add the else, you still get a white page.
Derrrrrr, then maybe it is not that line at all that is causing the problem so I will go away and read the rest of the edit though it seems straight forward to me.
If anyone can see a problem in the edits can you please let me know thanks. _________________ ~HG~
|| Click here to view all my phpBB Communities || |
|
| Back to top |
|
 |
~HG~
Joined: 25 Sep 2005
Posts: 423
Location: Australia
|
Posted: 2/5/2006, 5:03 am Post subject: |
|
|
If anyone has this mod or have tried it before can you please let me know.
Now I was of the opinion reading what it does, is that members can upload multple avatars and then select them to rotate in random.
From what I can work out, that is not exactly the case as there is nowhere for them to upload avatars to other than the members directory and that being the case, all avatars in that directory would be shown at random no matter who they belonged to.
Am I right in thinking that ??? _________________ ~HG~
|| Click here to view all my phpBB Communities || |
|
| Back to top |
|
 |
Thoul
Joined: 14 Sep 2005
Posts: 169
|
Posted: 2/5/2006, 1:33 pm Post subject: |
|
|
It looks like the user > avatar relationship is tracked in the database. The biggest edit above selects a random avatar that is related to the user in a new db table. Since it's stored in the DB, probably by filename, the files can be uploaded anywhere (well, they'll have to be a specific place, but you probably get the point).
I don't see anything obviously wrong in the code; can you post a copy of your viewtopic.php? _________________ Phantasy Star: The Fringes of Algo | phpBB Smith |
|
| Back to top |
|
 |
~HG~
Joined: 25 Sep 2005
Posts: 423
Location: Australia
|
|
| Back to top |
|
 |
|
|
|
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
|
|