How do I add more smiles? How do I add more smiles?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

How do I add more smiles?

Started by gazon_zaseyan, January 14, 2004, 04:13:32 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

gazon_zaseyan

Hi,
I want to add and remove couple of smiles on my photoalbum (the commenting part).

So I uploaded smiles (.gif files) in smile directory, what do I do next? which file do I need to edit to add, change or remove smiles?

Thank you.

Casper

Hi, you need to edit the file smilies.inc.php, which is in the include folder.

Find this code,
function get_smilies_table1()
{
    global $lang_smilies_inc_php;

    return array(


and add your own smilies to the array.  There is no need to comment out the existing one you are deleting, unless they have the same name as one of your smilies.

example;

array(':pony:', 'pony.gif', $lang_smilies_inc_php['pony']),


Now find the 2nd array, starting with this code;
function get_smilies_table2()
{
    global $lang_smilies_inc_php;

    return array(


First comment out the smilies you don't want any more, witha double slash // at the start of the line.

Now add your own, example;
//array(':kiss:', 'kiss.gif', $lang_smilies_inc_php['kiss']),
  array(':pony:', 'pony.gif', $lang_smilies_inc_php['pony']),


If you are keeping it at the same number of smilies, that's it.

But if you are increasing the number of smilies, there is one more change.
Find this code;
foreach($smilies as $smiley) {
        $caption = $smiley[2] . " " . $smiley[0];
        $html .= '                <td width="5%"><a href="javascript:emoticon_' . $form . '(\'' . $smiley[0] . '\')"><img src="images/smiles/' . $smiley[1] . '" alt="' . $caption . '" width="15" height="15" border="0" title="' . $caption . '"></a></td>' . "\n";
    }


and change the  <td width="5%"> to <td>.  

Thats it, you can get about 30 smilies on the line without it getting too crowded.

I havn't been able to get a 2nd line of smilies, which is what I wanted.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

gazon_zaseyan

Quote from: "casper"Hi, you need to edit the file smilies.inc.php, which is in the include folder.

THANK YOU VERY MUCH, my friend :)

That really helped... Thanks :)

Casper

It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

t3r0

Hi,
To add more than one row of smileys replace the old foreach with this:



$Cnt = "0";
$Row = "18";
foreach($smilies as $smiley) {
if ($Cnt % $Row == "0" && $Cnt != "0") { $html .= '</tr><tr align="center" valign="middle">'; }

$caption = $smiley[2] . " " . $smiley[0];

$html .= '<td width="5%"><a href="javascript:emoticon_' . $form . '(\'' .
$smiley[0] . '\')"><img src="images/smiles/' . $smiley[1] . '" alt="' .
$caption . '" border="0" title="' . $caption . '"></a></td>' . "\n";
       
$Cnt++;
}


$Row = number of pics per row

macnyc

Currently if you add smilies that are more than 15 pixels wide - you get a distorted smiley image - it works fine - but looks bad.  How can you set the formatting so it will handle images of a size such as 15 pixels high by 30 pixels wide?

Casper

I find it works fine for my smilies, because I have reduced the number of smilies per row, and changing this code;

<td width="5%">

You will need to experiment a little to get it right for your smilies.  Start by trying with 7%, with 14 per row.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here