Commits

Alan Wynn  committed 69932fc

updates applied, ready for testing

  • Participants
  • Parent commits 32cf799

Comments (0)

Files changed (1)

File ForumAvatar.php

    IPB FORUM AVATAR by ALAN WYNN                            (v2) | Sat, 10 Dec 11
    
    https://bitbucket.org/djekl/ipb-forumavatar/
-   
+
    ------------------------------------------------------------------------------
    
    Copyright (c) 2011/2012, djekl Developments
 
 $path = "./"; //Path to your forum relative to this PHP file, only change if this file is not in your forum folder.
     
-	## DEFAULT AVATAR ##
-	$DefaultAvatar = "http://".$_SERVER["HTTP_HOST"].str_replace("avatar.php", "", $_SERVER["SCRIPT_NAME"])."unknown.gif";
+## DEFAULT AVATAR ##
+$DefaultAvatar = "http://".$_SERVER["HTTP_HOST"].str_replace("avatar.php", "", $_SERVER["SCRIPT_NAME"])."unknown.gif";
 
 $UserName = addslashes(str_replace("%20", " ", $_SERVER['QUERY_STRING']));
 	
-		$UsersID = UserID($UserName);
-		$UsersAvatar = AvatarUrl($UsersID);
+$UsersID = UserID($UserName);
+$UsersAvatar = AvatarUrl($UsersID);
 	
 echo $UsersAvatar;
 
 		return "0";
 	}
 	
-	$row = @mysql_fetch_row($result);
+	$row = @mysql_fetch_array($result, MYSQL_ASSOC);# or die(mysql_error());
 	
-	$UserID = $row[0];
+	$UserID = $row['member_id'];
 	
 	if($UserID == null or ""){
 		$UserID = "00";
 	$profile_portal = @mysql_query("SELECT * FROM `".$INFO['sql_tbl_prefix']."profile_portal` WHERE `pp_member_id` = '".$User."'");# or die(mysql_error());	
 	$pp_row = @mysql_fetch_array($profile_portal, MYSQL_ASSOC);# or die(mysql_error());
 
-	$AvatarUrl = $pp_row['avatar_location'];
+	$AvatarUrl = $pp_row['pp_main_photo'];
 
 	if($AvatarUrl == null){
 		$AvatarUrl = $DefaultAvatar;