Esempio n. 1
0
<?php

// Slashes ' and " characters
function SpecialSlash(&$Str)
{
    return str_replace("\"", "&quot;", str_replace("'", "&#39;", $Str));
}
//if ($status == "a" || $status == "t") // use this line if you only want administrators to be able to use this.
if ($status == "m" || $status == "t" || $status == "a") {
    if (trim($Cmd[3]) != "") {
        $Mess = SpecialSlash($Cmd[3]);
        if (C_USE_SMILIES) {
            include "./lib/smilies.lib.php";
            $ss = Check4Smilies($Mess, $SmiliesTbl);
            if (C_EN_STATS && $ss > 0) {
                $DbLink->query("UPDATE " . C_STS_TBL . " SET smilies_posted=smilies_posted+{$ss} WHERE stat_date=FROM_UNIXTIME(last_in,'%Y-%m-%d') AND room='{$R}' AND username='******'");
            }
            unset($SmiliesTbl, $ss);
        }
        if (C_NO_SWEAR && $R != C_NO_SWEAR_ROOM1 && $R != C_NO_SWEAR_ROOM2 && $R != C_NO_SWEAR_ROOM3 && $R != C_NO_SWEAR_ROOM4) {
            include "./lib/swearing.lib.php";
            $Mess = " " . checkwords($Mess, false, $Charset);
            if (C_EN_STATS && isset($Found) && $b > 0) {
                $DbLink->query("UPDATE " . C_STS_TBL . " SET swears_posted=swears_posted+{$b} WHERE stat_date=FROM_UNIXTIME(last_in,'%Y-%m-%d') AND room='{$R}' AND username='******'");
            }
            unset($Found, $b);
        }
        $Mess .= " ...BUZZER...";
    }
    #	if (eregi("~",$Cmd[2]))
    if (strpos($Cmd[2], "~") !== false) {
function DisplaySmilies(&$ToDisplay, &$Table, &$TblSize, $Target)
{
    global $MaxWidth, $MaxHeight;
    $i = 1;
    $j = 0;
    $Str1 = "";
    $Str2 = "";
    $PerLines = floor(600 / $MaxWidth);
    while (list($key, $prop) = each($Table)) {
        if (!file_exists("images/smilies/{$prop}")) {
            $Str1 .= "";
            $Str2 .= "";
            $i--;
            $j++;
        } else {
            if ($Target == "help" || $Target == "input") {
                $Str1 .= "\t\t<TD ALIGN=\"CENTER\" NOWRAP=\"NOWRAP\">" . stripslashes($key) . "</TD>\n";
                $Str2 .= "\t\t<TD ALIGN=\"CENTER\" VALIGN=\"TOP\"><A HREF=\"#\" onClick=\"smiley2Input('" . SpecialSlash($key) . "'); return false\" onMouseOver=\"window.status='" . sprintf(L_CLICK, L_LINKS_5) . ".'; return true\" title=\"" . str_replace("\"", "&quot;", stripslashes($key)) . "\"><IMG SRC=\"images/smilies/{$prop}\" BORDER=0 ALT=\"" . str_replace("\"", "&quot;", stripslashes($key)) . "\" TITLE=\"" . str_replace("\"", "&quot;", stripslashes($key)) . "\"></A></TD>\n";
            } elseif ($Target == "popup") {
                $Str1 .= "\t\t<TD ALIGN=\"CENTER\" VALIGN=\"TOP\"><A HREF=\"#\" onClick=\"smiley2Input('" . SpecialSlash($key) . "'); return false\" onMouseOver=\"window.status='" . sprintf(L_CLICK, L_LINKS_5) . ".'; return true\" title=\"" . str_replace("\"", "&quot;", stripslashes($key)) . "\"><IMG SRC=\"images/smilies/{$prop}\" BORDER=0 ALT=\"" . str_replace("\"", "&quot;", stripslashes($key)) . "\" TITLE=\"" . str_replace("\"", "&quot;", stripslashes($key)) . "\"></A></TD>\n";
            } else {
                // Automatic smilie files info for uploader handling - by Ciprian
                $Str1 .= "\t\t<TD ALIGN=\"CENTER\" NOWRAP=\"NOWRAP\">" . stripslashes($key) . "</TD>\n";
                $Str2 .= "\t\t<TD ALIGN=CENTER VALIGN=\"TOP\" WIDTH={$MaxWidth} HEIGHT={$MaxHeight}><IMG SRC=\"images/smilies/{$prop}\" BORDER=0 ALT=\"" . str_replace("\"", "&quot;", stripslashes($key)) . "\" TITLE=\"" . str_replace("\"", "&quot;", stripslashes($key)) . "\"></TD>\n";
            }
        }
        //   Set SMILEY_COLS in config.lib.php.
        if ($Target == "input") {
            // for compatibility with input.php modifications by RD
            if (is_integer($i / $PerLines) || $i + $j == $TblSize) {
                //				$ToDisplay[] = $Str1;
                $ToDisplay[] = $Str2;
                $Str1 = "";
                $Str2 = "";
            }
        } elseif ($Target == "popup") {
            if ($i % SMILEY_COLS_POP == 0 || $i + $j == $TblSize) {
                $ToDisplay[] = $Str1;
                $Str1 = "";
            }
        } else {
            if ($i % SMILEY_COLS == 0 || $i + $j == $TblSize) {
                $ToDisplay[] = $Str1;
                $ToDisplay[] = $Str2;
                $Str1 = "";
                $Str2 = "";
            }
        }
        $i++;
    }
}