User Avatar Module
Posted by CH
Re: User Avatar Module September 23, 2007 01:51PM |
Registered: 17 years ago Posts: 38 |
YES! YES! YES!
Great tip - now it works! I changed in "read_thread.tpl" the "MESSAGES" to "MESSAGE".
But one more question:
when using firefox or opera, the avatar is positioned in the message-box at the right side (default is left, I changed it). That is working. But when using IE, the avatar is between the navigation bar and the message-box, positioned at the left side:
My read_threads.tpl looks like this:
Is the avatar-code in the wrong position (now in line 9-11)?
The code was in the module-download listet here: user_avatar_2.2.0. Maybe someone will change this code?
Thanx in advance!
Great tip - now it works! I changed in "read_thread.tpl" the "MESSAGES" to "MESSAGE".
But one more question:
when using firefox or opera, the avatar is positioned in the message-box at the right side (default is left, I changed it). That is working. But when using IE, the avatar is between the navigation bar and the message-box, positioned at the left side:
My read_threads.tpl looks like this:
<div class="PhorumNavBlock" style="text-align: left;"> <span class="PhorumNavHeading PhorumHeadingLeft">{LANG->Goto}:</span> {IF URL->INDEX}<a class="PhorumNavLink" href="{URL->INDEX}">{LANG->ForumList}</a>•{/IF}<a class="PhorumNavLink" href="{URL->TOP}">{LANG->MessageList}</a>•<a class="PhorumNavLink" href="{URL->POST}">{LANG->NewTopic}</a>•<a class="PhorumNavLink" href="{URL->SEARCH}">{LANG->Search}</a>•{IF LOGGEDIN true}<a class="PhorumNavLink" href="{URL->MARKTHREADREAD}">{LANG->MarkThreadRead}</a>•<a class="PhorumNavLink" href="{URL->LOGINOUT}">{LANG->LogOut}</a>{ELSE}<a class="PhorumNavLink" href="{URL->LOGINOUT}">{LANG->LogIn}</a>{/IF} </div> {IF MESSAGE->is_unapproved} <div class="PhorumStdBlock"> <div class="PhorumReadBodyHead"><strong>{LANG->UnapprovedMessage}</strong></div> </div> {/IF} {IF MESSAGE->mod_user_avatar} <img src="{MESSAGE->mod_user_avatar}" alt="" align="right" style="border: 0px; padding: 5px;"/> {/IF} <div class="PhorumStdBlock"> ...
Is the avatar-code in the wrong position (now in line 9-11)?
The code was in the module-download listet here: user_avatar_2.2.0. Maybe someone will change this code?
Thanx in advance!
Re: User Avatar Module September 23, 2007 02:24PM |
Admin Registered: 20 years ago Posts: 8,532 |
Try putting it right in front of the {MESSAGE->subject}.
I presume that this is right after the <div class="PhorumStdBlock"> that is visible in your code now.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
I presume that this is right after the <div class="PhorumStdBlock"> that is visible in your code now.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: User Avatar Module September 23, 2007 02:59PM |
Registered: 17 years ago Posts: 38 |
Re: User Avatar Module September 23, 2007 03:03PM |
Admin Registered: 20 years ago Posts: 8,532 |
Try a floating span:
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
<span style="float:right"> <img ... /> </span>At the same spot in the code as your current image.
Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: User Avatar Module September 23, 2007 03:23PM |
Registered: 17 years ago Posts: 38 |
Some additional infos September 23, 2007 03:50PM |
Registered: 17 years ago Posts: 38 |
This module works fine with my 5.1.22-installation. BUT...
1)
In "read_threads.tpl" you have to change MESSAGES to MESSAGE. If not, the avatar will not be shown in thread-view, only in flat-view.
2)
I testet this module with several browsers. Firefox and Opera will display the avatar correctly, IE does not. As you can see above, I want to stick my avatar at the right side of my message-box. IE ignores this command in flatview, threadview and also in your profile totally and sticks it on the left side. To fix this, just add this (in read_threads.tpl, read.tpl and profile.tpl):
Special thanks to Maurice Makaay (mmakaay). His tips were very useful! ;)
1)
In "read_threads.tpl" you have to change MESSAGES to MESSAGE. If not, the avatar will not be shown in thread-view, only in flat-view.
<img src="{MESSAGE->mod_user_avatar}" alt="" align="right" style="border: 0px; padding: 5px;"/>
2)
I testet this module with several browsers. Firefox and Opera will display the avatar correctly, IE does not. As you can see above, I want to stick my avatar at the right side of my message-box. IE ignores this command in flatview, threadview and also in your profile totally and sticks it on the left side. To fix this, just add this (in read_threads.tpl, read.tpl and profile.tpl):
{IF MESSAGE->mod_user_avatar} <span style="float:right"> <img src="{MESSAGE->mod_user_avatar}" alt="" align="right" style="border: 0px; padding: 5px;"/> </span> {/IF}
Special thanks to Maurice Makaay (mmakaay). His tips were very useful! ;)
Re: User Avatar Module September 29, 2007 05:16AM |
Registered: 20 years ago Posts: 65 |
Hi phorum !
I suggest you a little modification for the fonction "mod_user_avatar_check_dimensions" in the file : controlcenter/mod_user_avatar.php
after the comment : // check if it's really an image just to make sure once again (security?)
function mod_user_avatar_check_dimensions($fileid)
{
$PHORUM=$GLOBALS["PHORUM"];
//error_reporting(0); // I don't mind what I don't see ;-)
// getimagesize() requires a filename or a url, but we can cheat a little bit
// admittadly, if url fopen is disabled, this will not work out very well
$filename = phorum_get_url(PHORUM_FILE_URL, "file=" . $fileid);
$imagedata = getimagesize($filename);
// check if it's really an image just to make sure once again (security?)
if ($imagedata[2] && ($imagedata[2] == 1 || $imagedata[2] == 2 || $imagedata[2] == 3 || $imagedata[2] == 4 || $imagedata[2] == 6)) {
return ($imagedata[0] <= $PHORUM["mod_user_avatar"]["max_width"] && $imagedata[1] <= $PHORUM["mod_user_avatar"]["max_height"]);
}
else
return false;
}
I suggest you a little modification for the fonction "mod_user_avatar_check_dimensions" in the file : controlcenter/mod_user_avatar.php
after the comment : // check if it's really an image just to make sure once again (security?)
function mod_user_avatar_check_dimensions($fileid)
{
$PHORUM=$GLOBALS["PHORUM"];
//error_reporting(0); // I don't mind what I don't see ;-)
// getimagesize() requires a filename or a url, but we can cheat a little bit
// admittadly, if url fopen is disabled, this will not work out very well
$filename = phorum_get_url(PHORUM_FILE_URL, "file=" . $fileid);
$imagedata = getimagesize($filename);
// check if it's really an image just to make sure once again (security?)
if ($imagedata[2] && ($imagedata[2] == 1 || $imagedata[2] == 2 || $imagedata[2] == 3 || $imagedata[2] == 4 || $imagedata[2] == 6)) {
return ($imagedata[0] <= $PHORUM["mod_user_avatar"]["max_width"] && $imagedata[1] <= $PHORUM["mod_user_avatar"]["max_height"]);
}
else
return false;
}
Re: User Avatar Module October 16, 2007 05:36PM |
Registered: 17 years ago Posts: 14 |
In "cc_mod_user_avatar.tpl", it sure looks to me like there are two big HTML bugs:
1) The <table> tag appears to be opened once and closed twice.
2) The third <div> seems to be left unclosed.
No?
I don't know if these actually cause problems yet, because I've apparently got a PHP problem to resolve first. I'm trying to use this mod in a 5.1.25 forum. When I turn the mod "on" in Admin, I get blank screens. Does anyone else have this problem? (I haven't figured out how to check my web server's error log yet...)
1) The <table> tag appears to be opened once and closed twice.
2) The third <div> seems to be left unclosed.
No?
I don't know if these actually cause problems yet, because I've apparently got a PHP problem to resolve first. I'm trying to use this mod in a 5.1.25 forum. When I turn the mod "on" in Admin, I get blank screens. Does anyone else have this problem? (I haven't figured out how to check my web server's error log yet...)
Re: User Avatar Module October 17, 2007 01:12PM |
Registered: 17 years ago Posts: 14 |
Has anyone gotten the 2.2.0 version of this mod to work in Phorum 5.1.25?
I'm new to PHP debugging, and this mod is giving me fits!
My server keeps logging an "unexpected T_IF" error in user_avatar.php along with a bunch of "unexpected character in input" warnings. The only thing fishy I see in user_avatar.php is that the last line appears to be missing. (There's no "?>" tag, but adding one didn't help.)
Another symptom is that the "settings" link in Admin (enabled after I turn the module on) ALWAYS brings a blank screen. I don't understand why. It's as if ./mods/user_avatar/settings.php were an empty file.
Any advice?
I'm new to PHP debugging, and this mod is giving me fits!
My server keeps logging an "unexpected T_IF" error in user_avatar.php along with a bunch of "unexpected character in input" warnings. The only thing fishy I see in user_avatar.php is that the last line appears to be missing. (There's no "?>" tag, but adding one didn't help.)
Another symptom is that the "settings" link in Admin (enabled after I turn the module on) ALWAYS brings a blank screen. I don't understand why. It's as if ./mods/user_avatar/settings.php were an empty file.
Any advice?
Re: User Avatar Module October 17, 2007 07:42PM |
Registered: 17 years ago Posts: 14 |
Well... I've got this avatar module up and running okay now, but not without some suffering.
I think the settings.php file must have some "gremlin characters" in it, and I don't understand why they apparently confused my server/installation and no one else's. I basically had to re-type that file to make it work.
There were some other difficulties too... I think I had to add "require_once('./include/controlcenter/mod_user_avatar.php');" one or two places, and also I had to hack the "{IF mod_user_avatar->enabled}" command back out of cc_menu.tpl (contrary to the readme document). It's all a blur to me now... but perhaps these notes will help/warn the next user.
Cheers!
I think the settings.php file must have some "gremlin characters" in it, and I don't understand why they apparently confused my server/installation and no one else's. I basically had to re-type that file to make it work.
There were some other difficulties too... I think I had to add "require_once('./include/controlcenter/mod_user_avatar.php');" one or two places, and also I had to hack the "{IF mod_user_avatar->enabled}" command back out of cc_menu.tpl (contrary to the readme document). It's all a blur to me now... but perhaps these notes will help/warn the next user.
Cheers!
Sorry, only registered users may post in this forum.