[MOD] Smiles in two lines or more [MOD] Smiles in two lines or more
 

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

[MOD] Smiles in two lines or more

Started by Makc666, November 19, 2007, 04:53:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Makc666

##############################################################
## MOD Title: Smiles in two lines or more
## MOD Author: Makc666 < makc666  :P newmail  :-\ ru > (Maxim) http://makc666.com/
## MOD Description: This one code will help you to divide smiles into several lines (for example on page displayimage.php)
## MOD Version: 1.0.0
##
## Installation Level: (Easy)
## Installation Time: 2 Minute
## Files To Edit:
## theme.php
## Included Files: (n/a)
##############################################################

Makc666

[MOD] Smiles in two lines or more - in briefly

Open file:
themes/classic/theme.php
or
themes/YOUR_THEAME/theme.php

Search if there already functions:

  • function get_smilies_table3()
  • function theme_generate_smilies($smilies, $form)

If no, add the following code:
function get_smilies_table3()
{
    global $lang_smilies_inc_php;

    return array(
        array(':lol:', 'icon_lol.gif', $lang_smilies_inc_php['Laughing']),
        array(':-P', 'icon_razz.gif', $lang_smilies_inc_php['Razz']),
        array(':-D', 'icon_biggrin.gif', $lang_smilies_inc_php['Very Happy']),
        array(':-)', 'icon_smile.gif', $lang_smilies_inc_php['Smile']),
        array(':-|', 'icon_neutral.gif', $lang_smilies_inc_php['Neutral']),
        array('<br />', '', ''),
        array(':-(', 'icon_sad.gif', $lang_smilies_inc_php['Sad']),
        array(':cry:', 'icon_cry.gif', $lang_smilies_inc_php['Crying or Very sad']),
        array('8-)', 'icon_cool.gif', $lang_smilies_inc_php['Cool']),
        array(':-o', 'icon_surprised.gif', $lang_smilies_inc_php['Surprised']),
        array(':-?', 'icon_confused.gif', $lang_smilies_inc_php['Confused']),
        array('<br />', '', ''),
        array(':oops:', 'icon_redface.gif', $lang_smilies_inc_php['Embarassed']),
        array(':shock:', 'icon_eek.gif', $lang_smilies_inc_php['Shocked']),
        array(':-x', 'icon_mad.gif', $lang_smilies_inc_php['Mad']),
        array(':roll:', 'icon_rolleyes.gif', $lang_smilies_inc_php['Rolling Eyes']),
        array(';-)', 'icon_wink.gif', $lang_smilies_inc_php['Wink']),
        array('<br />', '', ''),
        array(':idea:', 'icon_idea.gif', $lang_smilies_inc_php['Idea']),
        array(':!:', 'icon_exclaim.gif', $lang_smilies_inc_php['Exclamation']),
        array(':?:', 'icon_question.gif', $lang_smilies_inc_php['Question'])
        );
}

function theme_generate_smilies($smilies, $form)
{

    global $THEME_DIR;
    $smilies = get_smilies_table3();
    $paths = array($THEME_DIR.'/smiles/','images/smiles/');

        $html = '<table width="100%" border="0" cellspacing="2" cellpadding="2">' . "\n" . '        <tr align="center" valign="middle">' . "\n";

        foreach($smilies as $smiley) {
            $smile_path = (file_exists($paths[0].$smiley[1]))?($paths[0]):($paths[1]);
            $caption = $smiley[2] . " " . $smiley[0];
if ( $smiley[0] == "<br />" OR $smiley[0] == "<br>" )
{
            $html .= '                </tr><tr align="center" valign="middle">' . "\n";
}
else
{
            $html .= '                <td width="5%"><img src="images/smiles/' . $smiley[1] . '" alt="' . $caption . '" width="15" height="15" border="0" style="cursor:pointer;" title="' . $caption . '" onclick="javascript:emoticon_' . $form . '(\'' . $smiley[0] . '\')" /></td>' . "\n";
}
        }

        $html .= '        </tr>' . "\n" . '</table>' . "\n";

        return $html;
}


You can dividó smiles by adding line:
        array('<br />', '', ''),

in fucntion (look at the above code):
function get_smilies_table3()

After what smile you will add this line after that smile a new line will be started.
You can enter this line multi-time.