Add more Emoticons

Have you ever wondered how you get more Emoticons into Web Wiz Forums? This tutorial is designed to answer just that.

To start with, Web Wiz Forum has a file that lists all of the emoticons in an Array. This is like storing them in a database table but it doesn't use as much server resources, meaning your forum runs faster.

This file is called 'emoticons_inc.asp', this file is located in the folder 'includes' which resides in the main folder for the forum (commonly '/forum/includes/emoticons_inc.asp').

An example of this file is shown below:

Emoticons_Inc.asp Example

'Dimension variables
Dim saryEmoticons(38,3)

saryEmoticons(1,1) = "Smile"
saryEmoticons(1,2) = "[:)]"
saryEmoticons(1,3) = "smileys/smiley1.gif"

saryEmoticons(2,1) = "Tongue"
saryEmoticons(2,2) = "[:P]"
saryEmoticons(2,3) = "smileys/smiley17.gif"

saryEmoticons(3,1) = "Wink"
saryEmoticons(3,2) = "[;)]"
saryEmoticons(3,3) = "smileys/smiley2.gif"


Each of the 'Blocks' are different Emoticons, each emoticon has 3 fields of information stored to it.

First is the name of the smiley, this is used for members to identify it in the Emoticon list.

Second is the code which members can type into a post to make it appear. If you use an Instant Messenger you will be used to typing :) and a smiley face taking its place.

Third is the location of where the image is located on the server.

saryEmoticons(1,1) = "Smile"
saryEmoticons(1,2) = "[:)]"
saryEmoticons(1,3) = "smileys/smiley1.gif"

The above is an example of what one emoticon block should look like.

Red repersents the emoticons 'ID'. Each emoticons ID should increase by 1 as your adding them, if your adding new emoticons to the existing file your ID should start with 39.

Green repersents the Emoticons field, this ranges from 1 to 3. and is explained futher up the page.

Blue repersents the part you need to edit with your own data. You only need to edit the part which is quoted and nothing more otherwise you will get errors.

Once you have finished adding your new emoticons you need to tell the Array how many you have. You can usually figure this out by looking at the last emoticons ID. The number of emoticons you have should be entered below which is highlighted in red.

Dim saryEmoticons(38,3)

And thats all there is to it. Upload your 'emoticon_inc.asp' file and your new Emoticons are ready to use.

Written By: S2H, 26th January 2007

Share This Page