News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Avatars @ Index

Started by 4LP3RUZ1, November 08, 2006, 10:12:31 AM

Previous topic - Next topic

4LP3RUZ1

Link to Mod

Avatars @ Index
By alperuzi
version: 1.5

The Avatars at Index modification lets you show the topic starters' avatars next to their name on the message index.

Note: This post may be outdated, for the latest features and news, see the modification page.

Features:

-> You can enable or disable this mod in "Admin > Features and Options > Layout and Options"
-> You ca set the avatar's height and/or width. The avatar will scale to either if the other value is left blank. Setting none of these values will result in full size avatars!

DON'T FORGET TO ENABLE THE MOD FROM THE ADMIN PANEL "Admin > Features and Options > Layout and Options"

If you have any problems, questions or comments, please ask them here.

------------------------------------------------------------------------------------------------

Avatars at Index modifikasyonu mesaj indeksinde konu başlatan üyelerinin isimlerinin yanında avatarlarının çıkmasını sağlar.

Özellikleri:

-> Yönetici panelinden bu modifikasyonu etkinleştirip devre dışı bırakabilirsiniz: "Yönetici Paneli > Forum Seçenekleri > Düzen ve Seçenekler"
-> Gösterilecek avatarların yükseklik ve/veya genişliklerini ayarlayabilirsiniz. Avatar bu iki ayardan biri ile ölçeklenebileceği gibi (diğer değeri boş bırakılırsa), her iki yönde de ölçeklenebilir. Yükseklik veya genişlik belirtilmez ise tam boyutta avatarlar kullanılır!

MODİFİKASYONU YÖNETİCİ PANELİNDEN ETKİNLEŞTİRMEYİ UNUTMAYIN! "Yönetici Paneli > Forum Seçenekleri > Düzen ve Seçenekler"

Problem veya sorularınızı Türkçe olarak dile getirmek istiyorsanız LÜTFEN BU KONUYU KULLANMAYIN! Türkçe bölümündeki bu konuyu kullanın!


If you want to show a default avatar for users without one:

OK, heres what we have to do.
In the modified /Sources/MessageIndex.php file find the following line:
'avatar' => $mini_avatar['avatar'] == '' ? ($mini_avatar['ID_ATTACH'] > 0 ? '<img src="' . (empty($mini_avatar['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $mini_avatar['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $mini_avatar['filename']) . '" alt="" height="'.$modSettings['miniAvatarHeight'] .'px" width="'.$modSettings['miniAvatarWidth'] .'px" align="absmiddle" border="0" />' : '') : (stristr($mini_avatar['avatar'], 'http://') ? '<img src="' . $mini_avatar['avatar'] . '" alt="" height="'.$modSettings['miniAvatarHeight'] .'px" width="'.$modSettings['miniAvatarWidth'] .'px" align="absmiddle" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($mini_avatar['avatar']) . '" alt="" height="'.$modSettings['miniAvatarHeight'] .'px" width="'.$modSettings['miniAvatarWidth'] .'px" align="absmiddle" border="0" />'),  // Avatars at Index By alperuzi

Now we are going to dissect this code very carefully.

See where there are two single quotes in the middle of this code?
Quoteborder="0" />' : '') : (stristr(

you need to add this code in the middle of the single quotes (change the filename from default.gif to anything you want:<img src="'.$modSettings['avatar_url'].'/default.gif" height="'.$modSettings['miniAvatarHeight'] .'px" width="'.$modSettings['miniAvatarWidth'] .'px" align="absmiddle" border="0" />

so the final code looks like this:
'avatar' => $mini_avatar['avatar'] == '' ? ($mini_avatar['ID_ATTACH'] > 0 ? '<img src="' . (empty($mini_avatar['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $mini_avatar['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $mini_avatar['filename']) . '" alt="" height="'.$modSettings['miniAvatarHeight'] .'px" width="'.$modSettings['miniAvatarWidth'] .'px" align="absmiddle" border="0" />' : '<img src="'.$modSettings['avatar_url'].'/default.gif" height="'.$modSettings['miniAvatarHeight'] .'px" width="'.$modSettings['miniAvatarWidth'] .'px" align="absmiddle" border="0" />') : (stristr($mini_avatar['avatar'], 'http://') ? '<img src="' . $mini_avatar['avatar'] . '" alt="" height="'.$modSettings['miniAvatarHeight'] .'px" width="'.$modSettings['miniAvatarWidth'] .'px" align="absmiddle" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($mini_avatar['avatar']) . '" alt="" height="'.$modSettings['miniAvatarHeight'] .'px" width="'.$modSettings['miniAvatarWidth'] .'px" align="absmiddle" border="0" />'),  // Avatars at Index By alperuzi
Note that the default avatar file must be in the same folder as your avatars, traditionally /avatars

If you also want this default avatar to be shown in the members-list, look at this post.


Edits to other Themes:

Frozen frogs are back :(

Carlos Gandra

Well done!

How to install it with other themes? ;) I've open the xml file to find the code, but it returns me an error, maybe some turkish characters that my system don't recognize ???

Thanks,
AC
Carlos Gandra
Mundo dos Animais

4LP3RUZ1

well basically you'll need to add a $topic['first_post']['member']['avatar'] to wherever you think looks nice :)
$topic['first_post']['member']['link']is where the topic starter is written to screen so around that would be a good idea :)
Plus you can (and should) do a check for $modSettings['enable_mini_avatars'] which is the admin panel functionality

The other changes I have added to the default MessageIndex.template.php file is so that the avatar and name go into a "mini table" of two cells, they are in fact optional but makes it look nicer ;)

There are no foreign characters on the source code and variables that I know of, but the tabling part may need to change to fit other themes.
Frozen frogs are back :(

frankeistein


char39

This is an excellent idea!  However, it doesn't work for me.  It said that it downloaded ok, and I have it set in the Layout and Options, but they don't show on the forum.  I am assuming it only works in the default theme?

Arbalot

this is nice alperuzi
thnks :D

S_HA_DO_W


denislici


really great job, thanx... this mod will get our forums more attractive...
Love the Creature for Creator's sake. (English)
Duje Krijesen per hire te Krijuesit. (Albanian)
Yaradılan'ı sev Yaradan'dan ötürü. (Turkish)
Ami la Creatura per ce la creato il Creatore. (Italian)

4LP3RUZ1

Quote from: katers on November 09, 2006, 10:08:22 AM
I am assuming it only works in the default theme?
That is correct.

And thank you people for trying the mod, be sure to post suggestions and improvements etc. They will surely be considered on possible future releases. ;)
Frozen frogs are back :(

char39

Have you ever seen a grown woman cry?  :'(

houston

A wonderful addition to any smf forum.

;D

4LP3RUZ1

#11
Quote from: katers on November 09, 2006, 08:35:48 PM
Have you ever seen a grown woman cry?  :'(
no need to cry, you can edit your theme to have it work with it. It is very briefly explained in the post above :)

I may even integrate functionality with other themes by default since its reasonably simple to do.

edit: to katzenellenbogen about his comment on the review page:

firstly, please post problems over here instead, this way I can reply to them.
secondly, there is absolutely to connection with this mod and Simple ImageShack. However, if you are using a language other than English or Turkish you won't be able to see the text in "Layout and Options" (the check box and the two text fields will still be there at the bottom)

Feel free to translate the three lines in the modification file and send it to me via pm, I'll add it to the next release.
Frozen frogs are back :(

Sessizlik Senfonisi

http://www.kafkasuniversitesi.com

SMF Versiyon : 1.1.1
Kullanılan Tema : Default

ernomo98

@alperuzi
by the members that had'nt chosen one avatar proper and that therefore they have one avatar par default, don't display this default avatar, do you know what is to make in this situation?

4LP3RUZ1

@ernomo98
Yes, I've been notified that it doesn't show automatically assigned avatars. I haven't looked into it yet, but you can expect a fix in the next release.
Frozen frogs are back :(

diegolyanky

Great MOD ... But I can't intall manually, be cause my MessageIndex.template.php is different as the Default theme ( i'm currently using helios_multi as default theme )  :(
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

4LP3RUZ1

hi guys, i uploaded a new file this morning which had a minor correction on the readme file, however somehow the modification was reverted to a pre-release state. If you have downloaded the mod today please uninstall that version and install a fresh copy. For all others, there is no difference in functionality between 1.0 and 1.0.1, it is just some code cleaning so you do not need to update.
Frozen frogs are back :(

heartless bowser

First of all, great mod. Will be very useful on my forum! :)

But I have a little question.

When I try to install it, I get this message:

QuoteType     Action     Description
1.    Execute Modification    ./Sources/ModSettings.php    Test successful
2.    Execute Modification    ./Themes/default/MessageIndex.template.php    Test successful
3.    Execute Modification    ./Sources/MessageIndex.php    Test successful
4.    Execute Modification    ./Themes/default/languages/Modifications.english.php    Test successful
5.    Execute Modification    ./Themes/default/languages/Modifications.turkish.php    File not found

I don't use modifications.turkish.php on my forum because there is no need to, as my forum is pretty much English only, but can I install the mod without worries?

I've had mods before with the same faults and they'd just screw up my forum. =/ I had to install the forums again + all the mods I had installed before were gone and had to install them too, but I don't want to go trough all that again.

But further, I look forward to using it!

4LP3RUZ1

Yes, maybe I'll make this clearer in the description.

Do not worry if the mod cannot find any Turkish files! You will not lose any functionality, nothing else will be effected. You see that only because foreign language support is built into a single file, and because there is no other way to do it :)
Frozen frogs are back :(

progenic

Dostum güzel eklenti ama olmadı :(.Temam default değil ve elle girdim ancak sadece konuyu başkaltanın nick'ini ortaladı.Avatar çıkmadı.

hxxp:www.frpturk.com [nonactive]

Advertisement: