1 (edited by bingiman 2007-11-03 02:22)

Topic: Using different smilies for different themes

If you're interested in using a different set of smilies for each of your themes, then follow the instructions below:

NOTE: You *MUST* be using Rickard's Easy_BBcode MOD.

Step 1:
Open include/parser.php and look for the following line:

global $smiley_text, $smiley_img;

replace with:

global $smiley_text, $smiley_img, $pun_user;

look for:

        $text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);

replace with:

        $text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/'.$pun_user['style'].'/smilies/'.$smiley_img[$i].'" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);

Step 2:
Open mod_easy_bbcode.php and look for:

        echo "\t\t\t\t\t\t\t".'<a href="javascript:insert_text(\''.$smiley_text[$i].'\', \'\');"><img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.$smiley_text[$i].'" /></a>'."\n";

replace with:

            echo "\t\t\t\t\t\t\t".'<a style="cursor: pointer;" onclick="insert_text(\''.$smiley_text[$i].'\', \'\');"><img src="img/'.$pun_user['style'].'/smilies/'.$smiley_img[$i].'" title="'.$smiley_img[$i].'" alt="'.$smiley_text[$i].'" /></a>'."\n";

Step 3:

Create a new folder in your /img/THEME/ directory and call it smilies. Simply copy your new smilies in there that suits your theme and away you go.

Something to keep in mind: Remember that the smiley names are all listed in parser.php so therefor all your smiley image names must be the same as listed in there.