• Welcome to Simple Machines Community Forum. Please login or sign up.
November 27, 2021, 10:33:05 AM

News:

Wondering if this will always be free?  See why free is better.


Add More Post Icons

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

Previous topic - Next topic

Oldiesmann

October 21, 2004, 09:29:18 PM Last Edit: October 21, 2004, 09:55:51 PM by 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
Cincy Space - now open!

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
Cincy Space - now open!

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

May 20, 2006, 01:33:01 PM #5 Last Edit: May 20, 2006, 10:45:21 PM by Vinspire
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!

mgk

I love icons, I'll give it a try. Thanks for the post and explaining.

DVC

April 14, 2011, 07:40:11 PM #21 Last Edit: April 14, 2011, 07:43:46 PM by DVC
Quote from: Oldiesmann on October 21, 2004, 09:29:18 PM
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.

I'm trying to add 8 new icons that I have made, as an alternative to having 8 separate low use forums. As too many forums just means we can never remember where a post was made. However, I'm stuck on Step 1. Exactly how do I upload the icons?

p.s. It would be so much easier if we could add icons the same way we add smileys. I don't really get why no one has made this mod after Grudge's one stopped being available.

DVC

April 17, 2011, 07:59:58 AM #22 Last Edit: April 17, 2011, 09:00:43 AM by DVC
Quote from: DVC on April 14, 2011, 07:40:11 PM
Quote from: Oldiesmann on October 21, 2004, 09:29:18 PM
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.

I'm trying to add 8 new icons that I have made, as an alternative to having 8 separate low use forums. As too many forums just means we can never remember where a post was made. However, I'm stuck on Step 1. Exactly how do I upload the icons?

p.s. It would be so much easier if we could add icons the same way we add smileys. I don't really get why no one has made this mod after Grudge's one stopped being available.

Ok I've added the icons to the right directory, but now I'm stuck again. I can't find the specified code in Post.php And when I try to add icons through the web menu all I get is an error that they can't be found. But they are in the same directory as the icons that are already there! Please help.

Edit: The error I am getting when I try and add new Icons is "An Error Has Occurred!
The icon image could not be found in the default theme - please ensure the image has been uploaded and try again."

But I've uploaded the image. It's in /Themes/default/images/post


MrNicotine

This is a great link, Abraamz, and I just used it. Great!

But when I try to enter it again, I can't find it in admin?
I'm in Admin->Forum->smiley's and Icons, but I can't find this option.

I now have the link as a favorite in my browser, that works offcourse, but this is not how it should be.
Anyone a tip?

Advertisement: