View Single Post
  #4  
Old 26th April 2014, 01:26
WhyMe WhyMe is offline
Banned
 
Join Date: Apr 2014
P2P
Posts: 160
Talking
Try this one in staffbox.php


Code:
<?php
// Security Check.
if (!defined('IN_TRACKER'))
{
die("<font face='verdana' size='2' color='darkred'><b>Error!</b> Direct initialization of this file is not allowed.</font>");
}

// BEGIN Plugin: Shoutbox
$lang->load('quick_editor');
require_once(INC_PATH."/functions_quick_editor.php");
require_once($rootpath.'/'.$cache.'/smilies.php'); // Load smilies.
$_shoutbox_smilies = $smilies;
$_shoutbox_defaultsmilies = $_shoutbox_smilies;
$_shoutbox_smilies = '
<div style="display: none;" id="show_TSsmilies">
<table width="100%" border="0"></br></br>
    <tr>';
$count = 0;
foreach ($_shoutbox_defaultsmilies as $_shoutbox_code => $_shoutbox_url)
{
    $_shoutbox_code = addslashes($_shoutbox_code);
    $_shoutbox_url = addslashes($_shoutbox_url);
    $_shoutbox_url = htmlspecialchars_uni($_shoutbox_url);
    if ($count < 59)
    {
        $_shoutbox_smilies .= "<img src=\"{$BASEURL}/{$pic_base_url}smilies/{$_shoutbox_url}\"  class=\"Shighlightit\" alt=\"{$_shoutbox_code}\" onclick=\"SmileIT('{$_shoutbox_code}','shoutbox','shouter_comment');\" style=\"cursor: pointer;\">\n";
        $count++;
    }
}
$_shoutbox_smilies .= '</tr></table></div>';
$shoutbox = '
<!-- begin shoutbox -->
<style type="text/css">
    .Shighlightit
    {
        border: 1px solid #ccc;
    }
    .Shighlightit:hover
    {
        border: 1px solid navy;
    }
    .Shighlightit:hover
    {
        color: red; /* Dummy definition to overcome IE bug */
    }
    .date
    {
        font-size: 7pt;
        font-family: tahoma;
    }
    #TSShoutbox a:link, #TSShoutbox a:visited {
        padding:2px;
        text-decoration:none;
    }
    #TSShoutbox a:hover, #TSShoutbox a:active {
        color:#000;
        position:relative;
    }
    #TSShoutbox a:link span, #TSShoutbox a:visited span {
        background:#FFF;
        display:none;
        z-index:10;
    }
    #TSShoutbox a:hover span, #TSShoutbox a:active span {
    position:absolute;
    top:15px;
    left:0px;
    display:block;
    z-index:10;    
    padding:3px;    
    border:1px solid #444;
    width:105px;
    cursor:pointer;    
}
</style>
<script language="javascript" type="text/javascript">
    //<![CDATA[
    var popupshoutbox = "no";        
    function show_hidden(WhatToShow)
    {
        if (document.getElementByID)
        {
            stdBrowser = true;
        }
        else
        {
            stdBrowser = false;
        }

        if (stdBrowser || navigator.appName != "Microsoft Internet Explorer")
        {
            if (document.getElementById(WhatToShow).style.display == \'none\')
            {
                document.getElementById(WhatToShow).style.display = \'block\';
            }
            else
            {
                document.getElementById(WhatToShow).style.display = \'none\';
            }
        }
        else
        {
            if (document.all[WhatToShow].style.display == \'none\')
            {
                document.all[WhatToShow].style.display = \'block\';
            }
            else
            {
                document.all[WhatToShow].style.display = \'none\';
            }
        }
    }
    //]]>
</script>
<a id="shoutbox"></a>
<form id="shout" name="shoutbox" onSubmit="saveData(); return false;">
<table border="0" cellspacing="0" cellpadding="5" width="100%">            
    <tr>
        <td>
            '.($is_mod ? '<span id="adminarea" align="center"><a href="#" onclick="window.open(\''.$BASEURL.'/staffbox/shoutbox.php?popupshoutbox=yes\',\'shoutbox\',\'toolbar=no, scrollbars=yes, resizable=no, width=880, height=400, top=250, left=250\'); return false;"><b>'.$lang->index['showlast'].'</b></a> - <a href="#" onclick="window.open(\''.$BASEURL.'/shoutbox/shoutbox.php?show_shoutbox_commands=yes\',\'shoutbox\',\'toolbar=no, scrollbars=yes, resizable=no, width=900, height=300, top=250, left=250\'); return false;"><b>Show Shoutbox Commands</b></a><hr /></span>' : '').'
            <span id="errorarea" align="left" class="smalltext" style="display: block;"></span>
            <span id="staffbox_frame" style="padding: 2px; overflow: auto; display: block; height: 490px; width: 99%;"></span>
        </td>
    </tr>
    <tr>
        <td align="left">
            <div id="loading-layer" name="loading-layer" style="float:right; display:none;"><img src="'.$BASEURL.'/'.$pic_base_url.'ajax-loader.gif" border="0" class="inlineimg" /></div>
            '.$_shoutbox_smilies.'
            '.ts_load_colors_shoutbox().'
                     </br></br>            
            <input maxlength="250" name="shouter_comment" type="text" id="shoutbox" size="100" />
            <input type="submit" value="'.$lang->global['buttonshout'].'" class="button" name="submit" />
            <input type="button" value="'.strtolower($lang->global['smilies']).'" onclick="show_hidden(\'show_TSsmilies\');" class="button" />
            <select name=\'color\' size="1" onChange="javascript:bbcolor()">
                     <option selected=\'selected\'>COLOR</option>
                     <option value=skyblue style=color:skyblue>sky blue</option>
                     <option value=royalblue style=color:royalblue>royal blue</option>
                     <option value=blue style=color:blue>blue</option>
                     <option value=darkblue style=color:darkblue>dark-blue</option>
                     <option value=orange style=color:orange>orange</option>
                     <option value=orangered style=color:orangered>orange-red</option>
                     <option value=crimson style=color:crimson>crimson</option>
                     <option value=red style=color:red>red</option>
                     <option value=firebrick style=color:firebrick>firebrick</option>
                     <option value=darkred style=color:darkred>dark red</option>
                     <option value=green style=color:green>green</option>
                     <option value=limegreen style=color:limegreen>limegreen</option>
                     <option value=seagreen style=color:seagreen>sea-green</option>
                     <option value=deeppink style=color:deeppink>deeppink</option>
                     <option value=tomato style=color:tomato>tomato</option>
                     <option value=coral style=color:coral>coral</option>
                     <option value=purple style=color:purple>purple</option>
                     <option value=indigo style=color:indigo>indigo</option>
                     <option value=burlywood style=color:burlywood>burlywood</option>
                     <option value=sandybrown style=color:sandybrown>sandy brown</option>
                     <option value=sienna style=color:sienna>sienna</option>
                     <option value=chocolate style=color:chocolate>chocolate</option>
                     <option value=teal style=color:teal>teal</option>
                     <option value=silver style=color:silver>silver</option>
                     </select>

        </td>
    </tr>
</table>
</form>    
<script type="text/javascript" src="'.$BASEURL.'/staffbox/shoutbox.js?v='.O_SCRIPT_VERSION.'"></script>

<!-- end shoutbox -->';

?>
<script type="text/javascript">
function SmileIT(smile){
    document.forms['shoutbox'].elements['shouter_comment'].value = document.forms['shoutbox'].elements['shouter_comment'].value+" "+smile+" ";  //this non standard attribute prevents firefox' //autofill function to clash with this script
    document.forms['shoutbox'].elements['shouter_comment'].focus();
}
function Popshout(id) {
         newWin=window.open('<?php echo $BASEURL;?>/staffbox/shoutbox.php?do=edit&id='+id,'Edit','height=210,width=500,resizable=yes,scrollbars=yes');
         if (window.focus) {newWin.focus()}
}
</script>
<script type="text/javascript">
<!--
function bbshout(repdeb, repfin) {
  var input = document.forms['shoutbox'].elements['shouter_comment'];
  input.focus();

  if(typeof document.selection != 'undefined') {

    var range = document.selection.createRange();
    var insText = range.text;
    range.text = repdeb + insText + repfin;

    range = document.selection.createRange();
    if (insText.length == 0) {
      range.move('character', -repfin.length);
    } else {
      range.moveStart('character', repdeb.length + insText.length + repfin.length);
    }
    range.select();
  }

  else if(typeof input.selectionStart != 'undefined')
  {

    var start = input.selectionStart;
    var end = input.selectionEnd;
    var insText = input.value.substring(start, end);
    input.value = input.value.substr(0, start) + repdeb + insText + repfin + input.value.substr(end);

    var pos;
    if (insText.length == 0) {
      pos = start + repdeb.length;
    } else {
      pos = start + repdeb.length + insText.length + repfin.length;
    }
    input.selectionStart = pos;
    input.selectionEnd = pos;
  }

  else
  {

    var pos;
    var re = new RegExp('^[0-9]{0,3}$');
    while(!re.test(pos)) {
      pos = prompt("Insertion à la position (0.." + input.value.length + "):", "0");
    }
    if(pos > input.value.length) {
      pos = input.value.length;
    }

    var insText = prompt("Veuillez entrer le texte à formater:");
    input.value = input.value.substr(0, pos) + repdeb + insText + repfin + input.value.substr(pos);
  }
}

function bbcolor() {
    var colorvalue = document.forms['shoutbox'].elements['color'].value;
    bbshout("[color="+colorvalue+"]", "[/color]");
}

function bbfont() {
    var fontvalue = document.forms['shoutbox'].elements['font'].value;
    bbshout("", "");
}

//-->
</script>
Reply With Quote