CommunityAdmins.com - Need more help with another mod
Rate your favorite (and least favorite) sodas at SodaRatings.com
Add Us:   MySpace   Facebook   StumbleUpon
Username:    Password:
Remember Me?    
Need more help with another mod

 
Post new topic   Reply to topic    CommunityAdmins.com Forum Index -> Technical Issues
 See a User Guidelines violation? Please contact us.
Author Message

~HG~

Joined: 25 Sep 2005
Posts: 423
Location: Australia

PostPosted: 2/5/2006, 4:57 am    Post subject: Need more help with another mod Reply with quote

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

PostPosted: 2/5/2006, 5:03 am    Post subject: Reply with quote

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

PostPosted: 2/5/2006, 1:33 pm    Post subject: Reply with quote

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

PostPosted: 2/5/2006, 3:03 pm    Post subject: Reply with quote

I have fixed the problem now with viewtopic after finding some strange code that should not have been there.

Further testing has now reveals a white page with view profile and loss of avatars when you select the avatar gallery.

I have copied both my usercp_viewprofile and usercp_avatar files as txt docs and uploaded them to as well as the constants.php file which may or may not play a part in the problem. usercp_registered appears to be OK

http://www.galahscorner.com/forum/includes/constants.txt

http://www.galahscorner.com/forum/includes/usercp_avatar.txt

http://www.galahscorner.com/forum/includes/usercp_viewprofile.txt
_________________
~HG~

|| Click here to view all my phpBB Communities ||
Back to top
Display posts from previous:   
Post new topic   Reply to topic    CommunityAdmins.com Forum Index -> Technical Issues All times are GMT - 5 Hours
Page 1 of 1
Jump to:  
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



Links: Programming Forum

Network: iFroggy Network Blog - iFroggy Hosting - SportsForums.net - KarateForums.com - YanksBlog.com - phpBBHacks.com - PhotoshopForums.com - DeveloperCube - Managing Online Forums - ManagingCommunities.com - DrGregHouse.com - Bad Boy Blog - BadBoyForums.com - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact - Staff - User Guidelines>

We Support phpBBHacks.com. Forum Buttons by Daz. Privacy Policy. Powered by phpBB © phpBB Group. phpBB SEO.
Copyright © 2005-2008. CommunityAdmins.com, iFroggy Network. All Rights Reserved.