Smileys problem Smileys problem
 

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]

Main Menu

Smileys problem

Started by heavensportal, March 10, 2016, 12:27:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

heavensportal

 I wanted to change some smileys for some we use in the forum but they won't behave. Is there somewhere else that this needs to be changed or what did I do wrong.

When they get used they appear in the comments as: s/thud.gif" alt="thud" />

For now I have replaced the smilies back as they were.

In includes/smilies.inc.php I did them like this:

function get_smilies_table1()

Old: array(':!:', 'exclaim.gif', $lang_smilies_inc_php['Exclamation']),

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


function get_smilies_table2()

Old:  array(':lol:', 'lol.gif', $lang_smilies_inc_php['Laughing']),

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


lang/english.php

$lang_smilies_inc_php['thud'] = 'thud';



allvip

#1
HOW TO ADD MORE SMILES

In includes/smilies.inc.php

1) function get_smilies_table1() :

AFTER the last item in the array PASTE ,

and then PASTE:


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


Note: it does not matter the order in the array. Is better to put them at the end so you will always now
that the last ones are added by you.

2) function get_smilies_table2()

BEFORE


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


PASTE


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


Note: Only here it matters the order in the array. You add it where you need it to show.

In lang/english.php FIND


// ------------------------------------------------------------------------- //
// File include/smilies.inc.php
// ------------------------------------------------------------------------- //
if (defined('SMILIES_PHP')) {
$lang_smilies_inc_php['Exclamation'] = 'Exclamation';
$lang_smilies_inc_php['Question'] = 'Question';
$lang_smilies_inc_php['Very Happy'] = 'Very Happy';
$lang_smilies_inc_php['Smile'] = 'Smile';
$lang_smilies_inc_php['Sad'] = 'Sad';
$lang_smilies_inc_php['Surprised'] = 'Surprised';
$lang_smilies_inc_php['Shocked'] = 'Shocked';
$lang_smilies_inc_php['Confused'] = 'Confused';
$lang_smilies_inc_php['Cool'] = 'Cool';
$lang_smilies_inc_php['Laughing'] = 'Laughing';
$lang_smilies_inc_php['Mad'] = 'Mad';
$lang_smilies_inc_php['Razz'] = 'Razz';
$lang_smilies_inc_php['Embarrassed'] = 'Embarrassed'; // cpg1.5
$lang_smilies_inc_php['Crying or Very sad'] = 'Crying or Very sad';
$lang_smilies_inc_php['Evil or Very Mad'] = 'Evil or Very Mad';
$lang_smilies_inc_php['Twisted Evil'] = 'Twisted Evil';
$lang_smilies_inc_php['Rolling Eyes'] = 'Rolling Eyes';
$lang_smilies_inc_php['Wink'] = 'Wink';
$lang_smilies_inc_php['Idea'] = 'Idea';
$lang_smilies_inc_php['Arrow'] = 'Arrow';
$lang_smilies_inc_php['Neutral'] = 'Neutral';
$lang_smilies_inc_php['Mr. Green'] = 'Mr. Green';
}


and at the end BEFORE  }

PASTE

$lang_smilies_inc_php['thud'] = 'thud';

Note: it does not matter the order in the array. Is better to put them at the end so you will always now
that the last ones are added by you.

DONT'T FORGET to put the new smiley in images/smiles folder.

If you want to have the smiles in your theme folder:

Quote from: Αndré on December 12, 2013, 02:45:34 PM
Just create a directory "smiles" in your theme folder (e.g. /your_theme/smiles/) and Coppermine will automatically use images from that folder for configured smileys. That feature seems to be undocumented yet.
Note: paste all the images from images/smiles folder to the directory "smiles" in your theme folder.

If you want to have the comments images in your theme folder:
http://documentation.coppermine-gallery.net/en/theme_graphics.htm#theme_graphics_comment


heavensportal

Thank you I will try to do that and then get back with you with results.


heavensportal

All right, I did exactly as you said to edit the files and they still do not show up in the comments area as the smile vs this s/congratz.gif" alt="congratz" />

I tried adding the smiles folder in the default "the one chosen in admin/configuration area" adding all the smiles and still the text and no smile

I have removed all the original smiles from both the default smiles folder and the templates smile folder to no avail because the text still shows but not the smile in the comment that is posted.

If needed I can provide a test account for someone to go see exactly what it is doing. It is integrated into the forum so the forum would need to be accessed in order to log in.

allvip

Please post a link to your gallery.

heavensportal

Quote from: allvip on March 10, 2016, 10:39:25 AM
Please post a link to your gallery.

Well I can be like a dog with a bone and just keep gnawing away.

I figured since the smilies show in the section of the others then it must be something still in the code. I removed the smiles folder from my theme. Then I re-opened all the files that were edited. I checked for duplicates (still not adding the original smiles) and checked the  array(':sad:', ...... seems some did not get the : before and after the name, I changed the one that had :D to read :grin: and the end to read [Grin])

after doing those edits to the 3 files I refreshed the page and glory be, there was a smile greeting me I tested each one by going to my own image and commenting with nothing but all the smiles and they are all working now....needless to say I am doing the happy dance.

Thank you for your help as to where the codes proper placement, without you I would have gone bald.

allvip

You still can copy the smiles folder to your theme if you like.
Will work this way too.
Anyway, I'm glad it worked.

Αndré


heavensportal

 ::) count on me to try the hard way first, thank I will go get it too, just in case.

Then it is alright to remove the original smiles permanently, how about removing the original codes and leaving only the edited ones.

Αndré

I don't see a reason to do that. In the worst case they're needed somewhere in the code and you'll get error messages. I recommend not to touch the core files and instead either use the theme engine or plugin engine to modify the available smileys.

heavensportal

Oh I don't edit the original files, I add a ~ after the .php, then upload a fresh one and iedit it, so if something goes wrong or error messages attack me I can just delet the new one and remove the ~ to make the original active again.

But I don't need to get rid of them, I just moved them into a subfolder of the smiles also just in case.

Thank you

Αndré

Quote from: heavensportal on March 10, 2016, 01:43:51 PM
Oh I don't edit the original files, I add a ~ after the .php, then upload a fresh one and iedit it

Well, you still edit core files ::)


Quote from: heavensportal on March 10, 2016, 01:43:51 PM
But I don't need to get rid of them, I just moved them into a subfolder of the smiles also just in case.

The result is the same. If the files aren't in their place, you get error messages if they're required somewhere in the code (I haven't checked that). It's your decision.

heavensportal

oops sorry...will return them