Advertisement:

Author Topic: Add More Post Icons  (Read 76139 times)

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Add More Post Icons
« on: October 21, 2004, 09:29:18 PM »
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:

Code: [Select]
$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:
Code: [Select]
$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.
« Last Edit: October 21, 2004, 09:55:51 PM by Oldiesmann »
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline A.M.A

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,133
  • Gender: Male
  • ..
Re: Add More Post Icons
« Reply #1 on: October 22, 2004, 11:17:24 AM »
Great tip .. it will surely solve lots of requests.
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Add More Post Icons
« Reply #2 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... :)
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline seenitall

  • Newbie
  • *
  • Posts: 1
Re: Add More Post Icons
« Reply #3 on: January 04, 2006, 08:57:19 PM »
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'

Offline odradeck

  • Newbie
  • *
  • Posts: 1
Re: Add More Post Icons
« Reply #4 on: February 21, 2006, 05:06:07 AM »
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.

Offline Vinspire

  • Sr. Member
  • ****
  • Posts: 852
  • Gender: Male
    • The Box Of Heart Forum
Re: Add More Post Icons
« Reply #5 on: May 20, 2006, 01:33:01 PM »
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
« Last Edit: May 20, 2006, 10:45:21 PM by Vinspire »

Offline Vinspire

  • Sr. Member
  • ****
  • Posts: 852
  • Gender: Male
    • The Box Of Heart Forum
Re: Add More Post Icons
« Reply #6 on: May 27, 2006, 12:20:08 AM »
Is it possible to edit this code ?

Code: [Select]
$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.

Offline Stuart

  • Full Member
  • ***
  • Posts: 421
Re: Add More Post Icons
« Reply #7 on: July 08, 2006, 07:56:58 PM »
This works great, thanks a lot as I just added 3 Post Icons :D

Offline Spidy

  • Semi-Newbie
  • *
  • Posts: 38
Re: Add More Post Icons
« Reply #8 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...

Offline Stuart

  • Full Member
  • ***
  • Posts: 421
Re: Add More Post Icons
« Reply #9 on: August 04, 2006, 11:53:17 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

Offline RebelRose

  • Jr. Member
  • **
  • Posts: 356
  • Gender: Female
Re: Add More Post Icons
« Reply #10 on: August 05, 2006, 11:44:42 PM »
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

Offline Vinspire

  • Sr. Member
  • ****
  • Posts: 852
  • Gender: Male
    • The Box Of Heart Forum
Re: Add More Post Icons
« Reply #11 on: April 07, 2008, 12:10:58 AM »
Uses this codes on SMF 1.1.4 and it work like charms ! :)

ilovegames

  • Guest
Re: Add More Post Icons
« Reply #12 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!

Any suggestions?

1.1.4

Offline Sarge

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,209
  • Gender: Male
    • Zëri YT!
Re: Add More Post Icons
« Reply #13 on: April 20, 2008, 02:47:24 AM »
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

  • Guest
Re: Add More Post Icons
« Reply #14 on: April 20, 2008, 10:57:30 AM »
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

Offline jhfc

  • Semi-Newbie
  • *
  • Posts: 15
Re: Add More Post Icons
« Reply #15 on: June 14, 2008, 11:16:51 PM »
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?

Offline DistantJ

  • Semi-Newbie
  • *
  • Posts: 94
Re: Add More Post Icons
« Reply #16 on: June 19, 2008, 09:42:00 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?

Offline Sarge

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,209
  • Gender: Male
    • Zëri YT!
Re: Add More Post Icons
« Reply #17 on: July 05, 2008, 07:03:03 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

Offline Stuart

  • Full Member
  • ***
  • Posts: 421
Re: Add More Post Icons
« Reply #18 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!

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: Add More Post Icons
« Reply #19 on: December 25, 2008, 09:49:11 PM »
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!