Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: How do I add more smiles?  (Read 13138 times)

0 Members and 1 Guest are viewing this topic.

gazon_zaseyan

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
How do I add more smiles?
« on: January 14, 2004, 04:13:32 pm »

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.
« Last Edit: June 07, 2005, 06:32:55 am by GauGau »
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
[FAQ]: How do I add more smiles?
« Reply #1 on: January 14, 2004, 06:23:18 pm »

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

Find this code,
Code: [Select]
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;

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


Now find the 2nd array, starting with this code;
Code: [Select]
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;
Code: [Select]
//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;
Code: [Select]
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.
Logged
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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
[FAQ]: How do I add more smiles?
« Reply #2 on: January 14, 2004, 08:51:59 pm »

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 :)
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
[FAQ]: How do I add more smiles?
« Reply #3 on: January 14, 2004, 09:11:35 pm »

you are welcome  :wink:
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
[FAQ]: How do I add more smiles?
« Reply #4 on: April 07, 2004, 01:39:20 pm »

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


Code: [Select]

$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
Logged

macnyc

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 27
Re: [FAQ]: How do I add more smiles?
« Reply #5 on: July 05, 2004, 09:48:17 pm »

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?
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: [FAQ]: How do I add more smiles?
« Reply #6 on: July 05, 2004, 09:55:56 pm »

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

Code: [Select]
<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.
Logged
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
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 22 queries.