News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Add More Post Icons

Started by Oldiesmann, October 21, 2004, 09:29:18 PM

Previous topic - Next topic

Oldiesmann

SMF has several fun message icons, but you've probably wondered how you can add your own. Turns out, it's really simple.

Step 1. Find any icons you want to add (preferably about the same size as the ones already used) and upload them to Themes/themename/images/post for every theme on your board.

Step 2. (optional) If you have multiple languages on your board and want to have the icon name translated for each language, add text strings to languages/Modification.language.php for every language in every theme where that file exists. If you don't care about having a properly translated icon name for each language or English is the only language on your board, you can skip this step. I recommend naming the strings something like $txt['file'] or $txt['icon_file'] just to make them easier to remember.

Step 3. Open up Sources/Post.php in a text editor and search for $context['icons'] - you should see the following array:

$context['icons'] = array(
array('value' => 'xx', 'name' => $txt[281]),
array('value' => 'thumbup', 'name' => $txt[282]),
array('value' => 'thumbdown', 'name' => $txt[283]),
array('value' => 'exclamation', 'name' => $txt[284]),
array('value' => 'question', 'name' => $txt[285]),
array('value' => 'lamp', 'name' => $txt[286]),
array('value' => 'smiley', 'name' => $txt[287]),
array('value' => 'angry', 'name' => $txt[288]),
array('value' => 'cheesy', 'name' => $txt[289]),
array('value' => 'grin', 'name' => $txt[293]),
array('value' => 'sad', 'name' => $txt[291]),
array('value' => 'wink', 'name' => $txt[292])
);


Just follow the pattern, like so:
$context['icons'] = array(
array('value' => 'xx', 'name' => $txt[281]),
array('value' => 'thumbup', 'name' => $txt[282]),
array('value' => 'thumbdown', 'name' => $txt[283]),
array('value' => 'exclamation', 'name' => $txt[284]),
array('value' => 'question', 'name' => $txt[285]),
array('value' => 'lamp', 'name' => $txt[286]),
array('value' => 'smiley', 'name' => $txt[287]),
array('value' => 'angry', 'name' => $txt[288]),
array('value' => 'cheesy', 'name' => $txt[289]),
array('value' => 'grin', 'name' => $txt[293]),
array('value' => 'sad', 'name' => $txt[291]),
array('value' => 'wink', 'name' => $txt[292]),
array('value' => 'icon', 'name' => 'My custom icon'),
array('value' => 'anothericon', 'name' => $txt['anothericon'])
);


Just remember that "value" must be the same as the filename (without the .gif extension).

Upload the modified Post.php to your Sources directory and enjoy.
Michael Eshom
Christian Metal Fans

A.M.A

Great tip .. it will surely solve lots of requests.
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Oldiesmann

There are also a couple mods on Grudge's package server to add an interface to do this... :)
Michael Eshom
Christian Metal Fans

seenitall

Hi have tried to add post icons as discribed in earlier posts , but I only got the first icon addition working , it adds the name of the icon to the drop down list but the image won't appear , any suggestions.

$context['icons'] = array(
      array('value' => 'xx', 'name' => $txt[281]),
      array('value' => 'thumbup', 'name' => $txt[282]),
      array('value' => 'thumbdown', 'name' => $txt[283]),
      array('value' => 'exclamation', 'name' => $txt[284]),
      array('value' => 'question', 'name' => $txt[285]),
      array('value' => 'lamp', 'name' => $txt[286]),
      array('value' => 'smiley', 'name' => $txt[287]),
      array('value' => 'angry', 'name' => $txt[288]),
      array('value' => 'cheesy', 'name' => $txt[289]),
      array('value' => 'grin', 'name' => $txt[293]),
      array('value' => 'sad', 'name' => $txt[291]),
      array('value' => 'wink', 'name' => $txt[292]),
                                array('value' => 'blushing', 'name' => 'blushing'),
                                array('value' => 'cowboy', 'name' => 'cowboy'),
                                array('value' => 'crying', 'name' => 'crying'

odradeck

Hi Seenitall,

when I modified the icon list, i first added a record to the <prefix>_message_icons table, where the ID, Title, filename and iconOrder is given relative to the standard icon folder.
This way worked for me.

Vinspire

#5
Quote from: Oldiesmann on October 25, 2004, 10:26:02 AM
There are also a couple mods on Grudge's package server to add an interface to do this... :)

Whats the mod name ? I am interested in having the same "solve" icon like SMF Forum.

Tried the modified instruction and it is working great  ;D ;D ;D

Vinspire

Is it possible to edit this code ?


$context['icons'] = array(
array('value' => 'xx', 'name' => $txt[281]),
array('value' => 'thumbup', 'name' => $txt[282]),
array('value' => 'thumbdown', 'name' => $txt[283]),
array('value' => 'exclamation', 'name' => $txt[284]),
array('value' => 'question', 'name' => $txt[285]),
array('value' => 'lamp', 'name' => $txt[286]),
array('value' => 'smiley', 'name' => $txt[287]),
array('value' => 'angry', 'name' => $txt[288]),
array('value' => 'cheesy', 'name' => $txt[289]),
array('value' => 'grin', 'name' => $txt[293]),
array('value' => 'sad', 'name' => $txt[291]),
array('value' => 'wink', 'name' => $txt[292])
);


I dont really use the cheesy, grin, wink icons. wanted to replace with other icons. tried renaming it but end up having an error.

Stuart

This works great, thanks a lot as I just added 3 Post Icons :D

Spidy

is it possible to do similar to this to add more smiley's to the existing ones?

there arent many and the forum i've put up is an offshoot of an already established 'wap' site and we'd loke to put the same smile's on the forum as the wap version...

any help would be appreciated thanks...

Stuart

Quote from: Spidy on August 03, 2006, 09:02:06 AM
is it possible to do similar to this to add more smiley's to the existing ones?

there arent many and the forum i've put up is an offshoot of an already established 'wap' site and we'd loke to put the same smile's on the forum as the wap version...

any help would be appreciated thanks...

Basically it's a lot easier to add smilies to the existing ones. If you're logged in as an Admin you just go to: Admin ==> Smileys and Smiley Sets ==> Add Smiley  ;D

RebelRose

You can change or add to your post icons the same way, by going into the admin area and clicking on

Smileys and Message Icons


1.1 RC2

Vinspire

Uses this codes on SMF 1.1.4 and it work like charms ! :)

ilovegames

I can not for the life of me add new post icons. Keeps saying
not found make sure it's in default. It is!

Any suggestions?

1.1.4

Sarge

Quote from: ilovegames on April 09, 2008, 06:01:30 PM
I can not for the life of me add new post icons. Keeps saying
not found make sure it's in default. It is!

Can you tell us what you have done so far, step by step? Have you modified the code for $context['icons'] in Post.php?

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

ilovegames

Quote from: Sarge on April 20, 2008, 02:47:24 AM
Quote from: ilovegames on April 09, 2008, 06:01:30 PM
I can not for the life of me add new post icons. Keeps saying
not found make sure it's in default. It is!

Can you tell us what you have done so far, step by step? Have you modified the code for $context['icons'] in Post.php?

Thanks Sarge, I figured it out. I was a goof! lol

jhfc

post icons can be added/modified in the admin panel isn't it? under Smileys and Message Icons. Or is it another post icon you guys are referring to?

DistantJ

Quote from: Oldiesmann on October 25, 2004, 10:26:02 AM
There are also a couple mods on Grudge's package server to add an interface to do this... :)

Where can I find this package server?

Sarge

Quote from: DistantJ on June 19, 2008, 09:42:00 AM
Quote from: Oldiesmann on October 25, 2004, 10:26:02 AM
There are also a couple mods on Grudge's package server to add an interface to do this... :)

Where can I find this package server?

The reply you quoted is almost 4 years old... Grudge's package server is not available anymore.

You need to know how to write mods in order to package this tip/trick as a mod.

    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

Stuart

I have been adding various post icons for a couple of years now and was actually wondering if I can put restrictions on them? E.g. the 'solved' icon on our forum is only used by crew members. How can we stop making some of these visible for all members? Cheers!

Eliana Tamerin

Quote from: Stuart on November 29, 2008, 11:31:46 AM
I have been adding various post icons for a couple of years now and was actually wondering if I can put restrictions on them? E.g. the 'solved' icon on our forum is only used by crew members. How can we stop making some of these visible for all members? Cheers!

I think that would be more of a mod request.
Do NOT PM me for support.

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

Advertisement: