I'm posting here, because I'm kind of lost and pulling my hair out. Anyways, what I'm trying to do is to use the modpack's avatar system with my forum bridged to vBulletin. I want to do this for two reasons 1) vBulletin's avatars are tricky to bridge because everytime a user changes their's it adds a different number to the file-name; and 2) I want to have small avatars on my gallery comments (50x50) as opposed to the 140x140 size my forum has.
Anyways, more to the point, after successfully bridging the modpack, I achieved this successfully as follows:
Added to vbulletin30.inc.php
'avatar_url' => 'userid'
//mod define Avatar path
define('AVATAR_PATH', 'albums/userpics/'.+1000);
define('AVATAR_PIC', ''.+1000);
Changed avatar section in my themes file to:
if ($CONFIG['enable_avatar']){
($row['avatar_url'] != "") ? $avatar_url= AVATAR_PATH.$row["avatar_url"].'/'.'user_'.AVATAR_PIC.$row["avatar_url"].'_avatar.jpg' : $avatar_url = '';
if (file_exists($avatar_url) == TRUE) {
$avatar_pic = $avatar_url;
}
else $avatar_pic = "albums/userpics/noavatar.jpg"; //added to display default avatar if user doesn't have one
}
else $avatar_url="";
I'm not a PHP expert, I kind of "stumble" my way along here and there using pre-existing code to work things out, so I've no idea if it's the best code to work. But I tested it on my local computer which runs PHP 5.1.4 under IIS. Everything worked 100% perfectly. Even for users other than admin which were only in the forum database and not in the CPG users database ... no errors at all when uploading an avatar and displaying it in a comment.
So I upload my files up to my server [development folder, not public as I haven't got everything running the way I want it] and it's not working at all. It basically cannot find the image in the folder [it does exist as I've checked] and instead changes the URL to that of the referring page.
The only thing that I think must be causing a problem is because the server is either running a different version of PHP or is running Apache instead of IIS. [Server: PHP 4.4.3/Apache 1.3/CentOS; Local PC PHP 5.1.4/IIS/Win2000].
In case my method might not have been correct, I tried the one suggested in
this thread for another bridging problem, but the same results ... works perfectly on local PC, doesn't on server.
To make this all even more confusing, I use a similar method [using file_exists to check to see if a file exists and to then display the link to it] to check the existance of wallpaper files that I manually upload by using a hack I found in
this thread. But this works perfectly on the server and always has.
I'm sure it's a setting on the server, or my versions need upgrading, but what I'm really after is just a confirmation of whether I need to ask my server provider to upgrade my software, or whether there's some configuration setting somewhere that is out of whack that I need to change.
Sorry for the long and detailed post ... I can't seem to explain things simply sometimes.
Summoner Yuna...