MyBB Community Forums

Full Version: trouble with getting post icons to be clickable.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am on latest mybb version 1.24

I add this into posticons template before {$iconlist}

<script type="text/Javascript">
function addsmiley(text) {
var comment = document.getElementsByName('message')[0];
comment.value = comment.value + text;
comment.focus();
}
</script>



-------------------------------------------------

I changed get_post_icons() function in inc/functions.php

to

PHP Code:
function get_post_icons()
{
    global 
$mybb$db$icon$theme$templates$lang;

    
$listed 0;
    if(
$mybb->input['icon'])
    {
        
$icon $mybb->input['icon'];
    }
    
$no_icons_checked " checked=\"checked\"";
    
$query $db->query("
        SELECT *
        FROM "
.TABLE_PREFIX."icons
        ORDER BY name DESC
    "
);
    while(
$dbicon $db->fetch_array($query))
    {
        if(
$icon == $dbicon['iid'])
        {

            
$iconlist .= "<input type=\"radio\" name=\"icon\" value=\"".$dbicon['iid']."\" checked=\"checked\" /> <a href=\"javascript:addsmiley(':$dbicon[name]:');\"><img src=\"".$dbicon['path']."\" alt=\":".$dbicon['name'].":\" /></a>";

      
$no_icons_checked "";
        }
        else
        {


            
$iconlist .= "<input type=\"radio\" name=\"icon\" value=\"".$dbicon['iid']."\" /> <a href=\"javascript:addsmiley(':$dbicon[name]:');\"><img src=\"".$dbicon['path']."\" alt=\":".$dbicon['name'].":\" /></a>";


        }
        
$listed++;
        if(
$listed == 9)
        {
            
$iconlist .= "<br />";
            
$listed 0;
        }
    }
    eval(
"\$posticons = \"".$templates->get("posticons")."\";");
    return 
$posticons;




-------------------------------------------

I open admin/icons.php

this is important because smilies codes are case sensitive.

FIND THIS:

$name = ucfirst($find);

REPLACE THIS WITH:

$name = $find;

---------------------------

I deleted all icons and readded them back in.

----------------------------

It wont put smilie text into message box as it should.

can someone play with this mod and see what need to be done to fix it?
Reference URL's