• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Addon] Smileys in News-Comments

Newbie Spellweaver
Joined
Jan 10, 2017
Messages
76
Reaction score
32
Hello,
Ive made a small addon for BrainCMS that adds smileys support to the news-comments.
Feedback is welcome.

Screen:

Setup
1) Download the zip and replace the files
2) In system/brain-config.php add this code at the bottom of the file (above ?>)

Code:
[LIST=1]
[*][COLOR=darkgoldenrod]/**[/COLOR]
[*][COLOR=darkgoldenrod] * Smiley Addon[/COLOR]
[*][COLOR=darkgoldenrod] */[/COLOR]
[*][COLOR=blue]$config[/COLOR][COLOR=green][[/COLOR][COLOR=red]'smileys'[/COLOR][COLOR=green]] = [[/COLOR]
[*][COLOR=darkgoldenrod]/**[/COLOR]
[*][COLOR=darkgoldenrod]     * Enable / disable the smileys[/COLOR]
[*][COLOR=darkgoldenrod]     */[/COLOR]
[*][COLOR=red]'enabled' [/COLOR][COLOR=green]=> [/COLOR][COLOR=blue]true[/COLOR][COLOR=green],[/COLOR]
[*][COLOR=darkgoldenrod]/**[/COLOR]
[*][COLOR=darkgoldenrod]     * Directory where the smileys are stored.[/COLOR]
[*][COLOR=darkgoldenrod]     */[/COLOR]
[*][COLOR=red]'directory' [/COLOR][COLOR=green]=> [/COLOR][COLOR=red]'/templates/brain/style/images/smileys'[/COLOR][COLOR=green],[/COLOR]
[*][COLOR=darkgoldenrod]/**[/COLOR]
[*][COLOR=darkgoldenrod]     * Add your own replacements[/COLOR]
[*][COLOR=darkgoldenrod]     */[/COLOR]
[*][COLOR=red]'replacements' [/COLOR][COLOR=green]=> [[/COLOR]
[*][COLOR=red]':)'     [/COLOR][COLOR=green]=> [/COLOR][COLOR=red]'smiling.svg'[/COLOR][COLOR=green],[/COLOR]
[*][COLOR=red]':('     [/COLOR][COLOR=green]=> [/COLOR][COLOR=red]'sad.svg'[/COLOR][COLOR=green],[/COLOR]
[*][COLOR=red]';)'     [/COLOR][COLOR=green]=> [/COLOR][COLOR=red]'wink.svg'[/COLOR][COLOR=green],[/COLOR]
[*][COLOR=red]':P'     [/COLOR][COLOR=green]=> [/COLOR][COLOR=red]'tongue-out-1.svg'[/COLOR][COLOR=green],[/COLOR]
[*][COLOR=red]':D'     [/COLOR][COLOR=green]=> [/COLOR][COLOR=red]'happy-1.svg'[/COLOR][COLOR=green],[/COLOR]
[*][COLOR=red]':\'('   [/COLOR][COLOR=green]=> [/COLOR][COLOR=red]'unhappy.svg'[/COLOR][COLOR=green],[/COLOR]
[*][COLOR=red]'>:(' [/COLOR][COLOR=green]=> [/COLOR][COLOR=red]'angry.svg'[/COLOR][COLOR=green],[/COLOR]
[*][COLOR=red]':*'     [/COLOR][COLOR=green]=> [/COLOR][COLOR=red]'kissing.svg'[/COLOR][COLOR=green],[/COLOR]
[*][COLOR=green]    ],[/COLOR]
[*][COLOR=green]];[/COLOR]
[/LIST]

If done correctly, you now have smileys in the next comment someone posts.
Sorry for my english, im swiss
 

Attachments

You must be registered for see attachments list
Last edited: