Example #1
0
function init()
{
    global $MayBeDuplicate;
    if (get_magic_quotes_gpc()) {
        bw_error("The software is not meant to work with PHP magic_quotes_gpc = On. Please turn it Off (probably in php.ini).");
    }
    $phpexts = get_loaded_extensions();
    if (!in_array("gd", $phpexts)) {
        bw_error("Install GD module in PHP before going on.");
    }
    if (isset($_SERVER["SERVERNAME"])) {
        // This is only to be done for interactive session (typically mailbot.php, run by a cron gives an error for this)
        $apacheexts = apache_get_modules();
        if (!in_array("mod_rewrite", $apacheexts)) {
            bw_error("Install mod_rewrite module in Apache before going on.");
        }
    }
    if (version_compare(phpversion(), "5.0.0") < 0) {
        bw_error("PHP version is lower than 5.0.0. Please update. ");
    }
    SetupSession();
    DBConnect();
    // a duplicate use by several users has been detected
    if (!empty($MayBeDuplicate)) {
        LogStr($MayBeDuplicate);
    }
    LanguageChangeTest();
    // evaluate the events (messages received, keep uptodate whoisonline ...)
    EvaluateMyEvents();
    // Check if the navigation of the user must be logged
    if (HasFlag("RecordLogs")) {
        $url = $_SERVER['PHP_SELF'];
        if (!empty($_SERVER['QUERY_STRING'])) {
            $url .= "?" . $_SERVER['QUERY_STRING'];
        }
        LogStr("url=" . $url, "RecordLogs");
    }
}
Example #2
0
function ComputeSpamCheck($IdMess)
{
    $Mes = LoadRow("select * from messages where id=" . $IdMess);
    if (isset($Mes->id)) {
        $CheckerComment = $Mes->CheckerComment;
        // Case NeverCheckSendMail
        if (HasFlag("NeverCheckSendMail", "", $Mes->IdSender)) {
            $Status = 'ToSend';
            $SpamInfo = "NotSpam";
            $CheckerComment .= "Sent by member with NeverCheckSendMail \n";
            $str = "update messages set Status='" . $Status . "',CheckerComment='" . $CheckerComment . "',SpamInfo='" . $SpamInfo . "' where id=" . $Mes->id . " and Status!='Sent'";
            sql_query($str);
            LogStr("NeverCheckSendMail for message #" . $IdMess . " from <b>" . fUsername($Mes->IdSender) . "</b> to <b>" . fUsername($Mes->IdReceiver) . "</b>", "AutoSpamCheck");
            return $Status;
        }
        // Test what the Spam mark should be
        $SpamInfo = "NotSpam";
        // By default its not a Spam
        $tt = explode(";", wwinlang("MessageBlackWord", 0));
        $max = count($tt);
        for ($ii = 0; $ii < $max; $ii++) {
            if (strstr($Mes->Message, $tt[$ii]) != "" and $tt[$ii] != "") {
                $SpamInfo = "SpamBlkWord";
                $CheckerComment .= "Has BlackWord <b>" . $tt[$ii] . "</b>\n";
            }
        }
        $tt = explode(";", wwinlang("MessageBlackWord", GetDefaultLanguage($Mes->IdSender)));
        $max = count($tt);
        for ($ii = 0; $ii < $max; $ii++) {
            if (strstr($Mes->Message, $tt[$ii]) != "" and $tt[$ii] != "") {
                $SpamInfo = "SpamBlkWord";
                $CheckerComment .= "Has BlackWord (in sender language)<b>" . $tt[$ii] . "</b>\n";
            }
        }
        // End of Test what the Spam mark should be
        // Case AlwayCheckSendMail
        if (HasFlag("AlwayCheckSendMail", "", $Mes->IdSender)) {
            $Status = 'ToCheck';
            $CheckerComment .= "Sent by member with AlwayCheckSendMail \n";
            $str = "update messages set Status='" . $Status . "',CheckerComment='" . $CheckerComment . "',SpamInfo='" . $SpamInfo . "' where id=" . $Mes->id . " and Status!='Sent'";
            sql_query($str);
            LogStr("AlwayCheckSendMail for message #" . $IdMess . " from <b>" . fUsername($Mes->IdSender) . "</b> to <b>" . fUsername($Mes->IdReceiver) . "</b>", "AutoSpamCheck");
            return $Status;
        }
        // Case if receiver has preference PreferenceCheckMyMail set to "Yes"  : mail is always set to toCheck
        $rPrefCheckMyMail = LoadRow("select *  from memberspreferences where IdMember=" . $Mes->IdReceiver . " and IdPreference=4");
        // PreferenceCheckMyMail --> IdPref=4
        if (isset($rPrefCheckMyMail->Value) and $rPrefCheckMyMail->Value == 'Yes') {
            // if member has choosen CheckMyMail
            $Status = 'ToCheck';
            $CheckerComment .= "Member has asked for checking\n";
            $str = "update messages set Status='" . $Status . "',CheckerComment='" . $CheckerComment . "',SpamInfo='" . $SpamInfo . "' where id=" . $Mes->id . " and Status!='Sent'";
            sql_query($str);
            LogStr("PreferenceCheckMyMail for message #" . $IdMess . " from <b>" . fUsername($Mes->IdSender) . "</b> to <b>" . fUsername($Mes->IdReceiver) . "</b>", "AutoSpamCheck");
            return $Status;
        }
        // Default case
        $Status = 'ToSend';
        $str = "update messages set Status='" . $Status . "',CheckerComment='" . $CheckerComment . "',SpamInfo='" . $SpamInfo . "' where id=" . $Mes->id . " and Status!='Sent'";
        sql_query($str);
        return $Status;
    }
}
Example #3
0
     echo "{$locale['pick']}<br />";
 } elseif ($bind == 2) {
     echo "{$locale['equiped']}<br />";
 } elseif ($bind == 3) {
     echo "{$locale['used']}<br />";
 } elseif ($bind == 4) {
     echo "{$locale['quest']}<br />";
 }
 if ($unique == 1) {
     echo "{$locale['unique']}<br />";
 } else {
     if ($unique > 1) {
         echo "{$locale['unique']} ({$unique})<br />";
     }
 }
 if (HasFlag($flag, 524288)) {
     echo "{$locale['uniqueeq']}<br />";
 }
 if ($slots != 0) {
     echo "{$slots} {$locale['bag']}<br />";
 }
 ParseItemType($class, $subclass, $invtype);
 $dps = 0;
 //damage
 if ($dmg1min > 0) {
     if ($class == 6) {
         $dam = ($dmg1min + $dmg1max) / 2;
         echo "<span style='float:left;'>{$locale['ammo1']} {$dam} {$locale['ammo2']}</span><br />";
     } else {
         $str = ParseDamage($dmg1type);
         echo "<span style='float:left;'>{$dmg1min} - {$dmg1max} {$str}{$locale['damage']}</span><span style='float:right;'>{$locale['speed']} ";