coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: tiptipon on September 15, 2006, 12:32:48 PM

Title: smiles in pictur view q2
Post by: tiptipon on September 15, 2006, 12:32:48 PM
hello agine
thenk you for youre last answer ;D it help me a lot :D

i have edit some of my smiles/icons in the coppermine/include/smilies.inc.php
and they all appear in one row :'(.
were and how can i edit the file to split the icons to more rows like evry 18 icons per a row?

tiptipon
;D
Title: Re: smiles in pictur view q2
Post by: tiptipon on September 17, 2006, 07:14:40 AM
hey gismo

still need help for that topic

please help me

tiptipon
Title: Re: smiles in pictur view q2
Post by: Sami on September 17, 2006, 07:37:00 AM
You need to edit your smiles.inc.php and add a counter to foreach statment to add a <tr> after 18 smiles
Title: Re: smiles in pictur view q2
Post by: tiptipon on September 17, 2006, 08:19:17 AM
hello bmossavari

i am sorry but i didnt anderstand you at all

if you be abel to put youre answer in deatails and exampls so i can do what needs to be done

thenks

tiptipon

Title: Re: smiles in pictur view q2
Post by: Sami on September 17, 2006, 08:51:28 AM
Use this new generate_smilies function  instead of yours under smilies.inc.php

function generate_smilies($form = 'post', $field = 'message')
{
    global $THEME_DIR;
    $smilies = get_smilies_table2();
    $paths = array($THEME_DIR.'/smiles/','images/smiles/');

    if (function_exists('theme_generate_smilies'))
    {
        $html = theme_generate_smilies($smilies, $form);
    }
    else
    {

        $html = '<table width="100%" border="0" cellspacing="0" cellpadding="0">' . "\n" . '        <tr align="center" valign="middle">' . "\n";
        $c=0;
        foreach($smilies as $smiley) {
            $c=$c+1;
            $smile_path = (file_exists($paths[0].$smiley[1]))?($paths[0]):($paths[1]);
            $caption = $smiley[2] . " " . $smiley[0];
            if($c >= 19){
                $html .= '</tr><tr>' . "\n";
                $c=0;
             }
           
$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";
    }

    $html .= <<<EOT

<script language="JavaScript" type="text/javascript">
<!--
function emoticon_$form(text) {
        text = ' ' + text + ' ';
        if (document.$form.$field.createTextRange && document.post.message.caretPos) {
                var caretPos = document.$form.$field.caretPos;
                caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
                document.$form.$field.focus();
        } else {
                document.$form.$field.value  += text;
                document.$form.$field.focus();
        }
}

I don't test it cause I don't have my test bed , report back the result...
Title: Re: smiles in pictur view q2
Post by: tiptipon on September 17, 2006, 09:11:17 AM
i copy that to the file and got blank page
i replaced it and still got blank page
Title: Re: smiles in pictur view q2
Post by: Sami on September 17, 2006, 09:22:17 AM
I've changed some code on my post try it again with the new code
sorry as I said before I don't have my test bed so I can't debug my code now
Title: Re: smiles in pictur view q2
Post by: tiptipon on September 17, 2006, 09:30:27 AM
no no i am very so sory

it works!

i copy before and i copy it the wrong way

it work fantastic just as i wonted

thankyou very mach

tiptipon
Title: Re: smiles in pictur view q2
Post by: Sami on September 17, 2006, 09:33:29 AM
Happy for you :)