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: [MOD] Smiles in two lines or more  (Read 10109 times)

0 Members and 1 Guest are viewing this topic.

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
[MOD] Smiles in two lines or more
« on: November 19, 2007, 04:53:42 pm »

##############################################################
## 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)
##############################################################
« Last Edit: November 21, 2007, 09:11:27 am by GauGau »
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1614
  • Русский (ISO-8859-1) - Russian - Ðóññêèé (Windows)
    • Makc's home page
[MOD] Smiles in two lines or more - in briefly
« Reply #1 on: November 19, 2007, 05:11:48 pm »

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

Page created in 0.024 seconds with 19 queries.