AvatarOnBoard

Started by Bulakbol, February 18, 2008, 10:39:03 PM

Previous topic - Next topic

Eliana Tamerin

Hey JohnyB, I was wondering if it would be at all possible to resize these with GD? Or maybe that would be too much of a server load, since they'd have to be resized on the fly, right? I don't want to complicate your mod, but instead of having HUGE image sizes to accommodate the larger avatars (which stretches the smaller ones), the mod could resize them with GD and stick them into a cache for later use, reducing the server load.

On that note, however, though unrelated, would it be possible to check if an avatar is under the sizes input in the admin CP and leave it in its natural size? Or resize the avatar proportionally, so that longer/wider avatars don't get squeezed or distorted.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

humbleworld

Quote from: JohnyB on February 24, 2008, 11:57:12 AM
Quote from: humbleworld on February 24, 2008, 09:06:03 AM
Yes, great MOD. I'm using Dilber Theme but I got error in installation. All files were okay except:

10.     Execute Modification     ./Themes/dilbermc/BoardIndex.template.php     Test failed

What to do now?

There must be other mod that edited your BoardIndex.template.php. You can edit it manually using the package parser and if you can't figure it out, attach your BoardIndex.template.php and I'll look at it.



Quote from: jackregan on February 24, 2008, 09:12:16 AM
May I just say that this mod is excellent.

Well done

Thanks Jackregan. Thank you too for trying this mod.  :)

Hi John,

My board.index.php has shoutbox. Is it causing the problem?

humbleworld

Hi Johny,

The MOD works perfectly now. Thanks a lot. Where is your Paypal page?

Bulakbol

Quote from: kaburan on February 24, 2008, 07:51:25 PM
Ok its all good, everything looks good. Thanks for your help :)

No worries kaburan. You are welcome.  8)
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Bulakbol

Quote from: humbleworld on February 25, 2008, 12:51:23 AM
Hi Johny,

The MOD works perfectly now. Thanks a lot. Where is your Paypal page?

ahaha save it for the next mod bud.  :D Thanks for trying this mod.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Bulakbol

#65
Hi Eliana, sorry for the delay.

Quote from: Eliana Tamerin on February 24, 2008, 08:14:34 PM
Hey JohnyB, I was wondering if it would be at all possible to resize these with GD? Or maybe that would be too much of a server load, since they'd have to be resized on the fly, right? I don't want to complicate your mod, but instead of having HUGE image sizes to accommodate the larger avatars (which stretches the smaller ones), the mod could resize them with GD and stick them into a cache for later use, reducing the server load.

Sorry, I don't know anything about GD.  :P

Quote
On that note, however, though unrelated, would it be possible to check if an avatar is under the sizes input in the admin CP and leave it in its natural size? Or resize the avatar proportionally, so that longer/wider avatars don't get squeezed or distorted.

I am thinking about checking the size entered in the admin cp.

if width is zero - use the size set in Admin -> Attachments and avatars -> Avatars Settings : External Avatars max width and height.

if width is not zero but the height is zero, use only the width so it will proportionally adjust the height.

otherwise, use the entered width and height. Will that be okay?

In Sources/BoarIndex.php, look for

if (!$modSettings['board_avatar_width'] || !$modSettings['board_avatar_height'])
$board_avatar = $row_board['avatar'] == '' ? ($row_board['ID_ATTACH'] > 0 ? '<img src="' . (empty($row_board['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row_board['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />');
else
$board_avatar = $row_board['avatar'] == '' ? ($row_board['ID_ATTACH'] > 0 ? '<img src="' . (empty($row_board['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row_board['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />');


and replace with

if ($modSettings['board_avatar_width'] == 0)
$board_avatar = $row_board['avatar'] == '' ? ($row_board['ID_ATTACH'] > 0 ? '<img src="' . (empty($row_board['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row_board['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />');
elseif ($modSettings['board_avatar_height'] == 0)
$board_avatar = $row_board['avatar'] == '' ? ($row_board['ID_ATTACH'] > 0 ? '<img src="' . (empty($row_board['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row_board['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['board_avatar_width'].'" align="center" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['board_avatar_width'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" align="center" border="0" />');
else
$board_avatar = $row_board['avatar'] == '' ? ($row_board['ID_ATTACH'] > 0 ? '<img src="' . (empty($row_board['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row_board['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />');


In admincp, enter zero as the height.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

humbleworld

#66
Quote from: JohnyB on February 25, 2008, 12:56:15 AM
Quote from: humbleworld on February 25, 2008, 12:51:23 AM
Hi Johny,

The MOD works perfectly now. Thanks a lot. Where is your Paypal page?

ahaha save it for the next mod bud.  :D Thanks for trying this mod.

Johny, I'm excited to see the release of the 2.0 version. Hope all your MODs would have the same power and vibrancy. :)

Bulakbol

Quote from: humbleworld on February 25, 2008, 01:35:16 AM
Quote from: JohnyB on February 25, 2008, 12:56:15 AM
Quote from: humbleworld on February 25, 2008, 12:51:23 AM
Hi Johny,

The MOD works perfectly now. Thanks a lot. Where is your Paypal page?

ahaha save it for the next mod bud.  :D Thanks for trying this mod.

Johny, I'm excited to see the release of the 2.0 version. Hope all your MODs would the same power and vibrancy. :)

I am excited too.  :) This mod might survive but my other mods might be thrown in archive storage because it's built-in in version 2.0.  :(
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Bulakbol

#68
Apologies. I forgot to update the Message index. The last 10 who downloaded version 1.2, please redownload again. Or edit the file yourself. In Sources/MessageIndex.php, find

if (!$modSettings['board_avatar_width'] || !$modSettings['board_avatar_height'])
$board_avatar = $row_board['avatar'] == '' ? ($row_board['ID_ATTACH'] > 0 ? '<img src="' . (empty($row_board['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row_board['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />');
else
$board_avatar = $row_board['avatar'] == '' ? ($row_board['ID_ATTACH'] > 0 ? '<img src="' . (empty($row_board['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row_board['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />');




and replace with

if ($modSettings['board_avatar_width'] == 0)
$board_avatar = $row_board['avatar'] == '' ? ($row_board['ID_ATTACH'] > 0 ? '<img src="' . (empty($row_board['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row_board['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="center" border="0" />');
elseif ($modSettings['board_avatar_height'] == 0)
$board_avatar = $row_board['avatar'] == '' ? ($row_board['ID_ATTACH'] > 0 ? '<img src="' . (empty($row_board['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row_board['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['board_avatar_width'].'" align="center" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['board_avatar_width'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" align="center" border="0" />');
else
$board_avatar = $row_board['avatar'] == '' ? ($row_board['ID_ATTACH'] > 0 ? '<img src="' . (empty($row_board['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $row_board['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="center" border="0" />');


I changed the default setting for the height from 35 to 0 because of the update.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Kimmie

ok I havent tried to manually install this yet after our conversation - however I just noticed something...

To give you a small update so you dont have to go back and re-read - I was having some errors come up with using this mod and the avatar@index mod and also a few issues such as the avatars not showing up on a few child boards.

Well what I noticed is since I uninstalled this mod. the latest post (when its in a child board) no longer shows up on the main forum page over on the right. The only latest post it will show is if the post was done in that main topic area.

Since this mod affects child boards, could this mod have left behind some sort of code that is causing this to happen? 

Bulakbol

Hi Kimmie. Did you get any errors when you installed/uninstalled this mod? Not sure if this mod is the cause of your problem but I can take a look at your files if you don't have a backup. Attach both BoardIndex.template.php and MessageIndex.template.php and I'll take alook at them.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Kimmie

#71
there were no errors in install or uninstall..those errors I got in my log were after it was already installed. The issues I had after it was installed is there were 3-4 boards that the avatar did not show on (on the main page) and it appeared that 1 of the errors was due to it conflicting with the avatar@index mod. The 2nd error in my log happened when someone hadnt chosen an avatar at all yet (I think was due to the fact that with this mod - it installed a "noavatar" - which made two in there bacause there is already one that is an SMF default.

I would really love to use this mod but I am afraid to manually install it as I have never done that before.   :(. I dont want to mess up my forum.

My files are attached.


Thanks for the help. :)

Bulakbol

#72
Understood Kimmie. No problem. Looking at the filename of the files that you attached, they are backups. There's tilde (~) at the end. Can you attach the ones that are giving you problem?

This mod will only display avatar in BoardIndex and Childboard index but not in topic. The Avatar@Index display avatar of topic starter.

<EDIT> I have your files and they are the one that I want to look at. I'll get back to you.</EDIT>

<EDIT2>I can't find anything wrong with your files Kimmie. This mod was perfectly installed. I think you are confused. This mod will not display avatar in topic.  When you say some avatars won't display, it is because you were looking at topics. Show me a screen shot of the missing avatar. <EDIT2>
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Kimmie

yes I understand about where the icons are supposed to appear with this one.. when the mod was installed and I would be looking at the main forum page, there would be a few boards that the avatar was not showing up at all no matter who posted inside that area.

I dont have it currently installed right now. I will reinstall it and see if I can re- create the problem and get you a ss.

(I would like to make sure I did show you the right files though because there are 2 of most of those when I am in there... they both have the same name - but only one says its a php file which is the one I gave you). Its confusing to know which one that needs edits and all that..lol.

diegolyanky

Worked fine on 1.1.4 with Helio_multi theme and with more than 56 MODS installed.

Thanks ;)
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

Shean

Turkish language did you like the assistant :P

Bulakbol

Quote from: Kimmie on February 27, 2008, 02:35:51 AM
yes I understand about where the icons are supposed to appear with this one.. when the mod was installed and I would be looking at the main forum page, there would be a few boards that the avatar was not showing up at all no matter who posted inside that area.

I dont have it currently installed right now. I will reinstall it and see if I can re- create the problem and get you a ss.

(I would like to make sure I did show you the right files though because there are 2 of most of those when I am in there... they both have the same name - but only one says its a php file which is the one I gave you). Its confusing to know which one that needs edits and all that..lol.

Hi Kimmie. If you think this mod will screw up your board, leave it uninstalled.

Just to clarify things though on what this mod will do, look at the attached screenshot so you will know what is topic and what is childboards inside the childboard. It might help others too.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Bulakbol

Quote from: diegolyanky on February 27, 2008, 06:05:13 AM
Worked fine on 1.1.4 with Helio_multi theme and with more than 56 MODS installed.

Thanks ;)

Thanks diegolyanky.  ;)


Quote from: FrondaL on February 27, 2008, 06:55:55 AM<br />Turkish language did you like the assistant<img src="http://www.simplemachines.org/community/Smileys/simple/tongue.gif" border="0" alt="" title="" onresizestart="return false;" id="smiley_1_tongue.gif" style="padding-left: 6px;" /><br />

Thanks too for the translation FrondaL.   8)
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

ampedm

#78
on a fresh installation of smf 1.1.4 when i try to uninstall it i get:

Database Error
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE FROM smf_settings WHERE variable='disable_avatar' LIMIT
File: /homepages/24/d180708773/htdocs/ph/departments/Packages/temp/AvatarOnBoardDB.php
Line: 8

i installed this mod first followed by these then tried to uninstall it and got this.

Top 10 Posters Today And This Week Stats
Add Domaintools to TrackIP
Custom Profile Field Mod

Bulakbol

Hi Ampedm. Not sure what causes it. Just ignore it.  Maybe it's not there anymore.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Advertisement: