Advanced search  

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

Pages: [1]   Go Down

Author Topic: Smileys problem  (Read 7748 times)

0 Members and 1 Guest are viewing this topic.

heavensportal

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 259
    • The Fantasy Attic
Smileys problem
« on: March 10, 2016, 12:27:11 am »

 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';


Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Smileys problem
« Reply #1 on: March 10, 2016, 08:21:38 am »

HOW TO ADD MORE SMILES

In includes/smilies.inc.php

1) function get_smilies_table1() :

AFTER the last item in the array PASTE
Code: [Select]
,
and then PASTE:

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

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

PASTE

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

Code: [Select]
// ------------------------------------------------------------------------- //
// 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 
Code: [Select]
}
PASTE

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

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

« Last Edit: March 10, 2016, 08:46:52 am by allvip »
Logged

heavensportal

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 259
    • The Fantasy Attic
Re: Smileys problem
« Reply #2 on: March 10, 2016, 08:31:30 am »

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

Logged

heavensportal

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 259
    • The Fantasy Attic
Re: Smileys problem
« Reply #3 on: March 10, 2016, 10:33:29 am »

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

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Smileys problem
« Reply #4 on: March 10, 2016, 10:39:25 am »

Please post a link to your gallery.
Logged

heavensportal

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 259
    • The Fantasy Attic
Re: Smileys problem
« Reply #5 on: March 10, 2016, 11:02:27 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.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Smileys problem
« Reply #6 on: March 10, 2016, 11:07:11 am »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Smileys problem
« Reply #7 on: March 10, 2016, 11:55:07 am »

Small annotation: there's also a plugin hook to add/remove smilies: http://documentation.coppermine-gallery.net/en/dev_plugin_hooks.htm#plugin_hooks_smilies_display
Logged

heavensportal

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 259
    • The Fantasy Attic
Re: Smileys problem
« Reply #8 on: March 10, 2016, 12:12:43 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Smileys problem
« Reply #9 on: March 10, 2016, 12:20:42 pm »

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

heavensportal

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 259
    • The Fantasy Attic
Re: Smileys problem
« Reply #10 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, 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Smileys problem
« Reply #11 on: March 10, 2016, 01:48:58 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 ::)


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

heavensportal

  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 259
    • The Fantasy Attic
Re: Smileys problem
« Reply #12 on: March 10, 2016, 02:08:28 pm »

oops sorry...will return them
Logged
Pages: [1]   Go Up
 

Page created in 0.03 seconds with 21 queries.