Пример #1
0
function ww($code, $p1 = NULL, $p2 = NULL, $p3 = NULL, $p4 = NULL, $p5 = NULL, $p6 = NULL, $p7 = NULL, $p8 = NULL, $p9 = NULL, $pp10 = NULL, $pp11 = NULL, $pp12 = NULL, $pp13 = NULL)
{
    global $Params;
    // If no language set default language
    if (!isset($_SESSION['IdLanguage'])) {
        SwitchToNewLang();
    }
    if (!isset($_SESSION['IdLanguage'])) {
        bw_error("Lang select internal failure");
    }
    return wwinlang($code, $_SESSION['IdLanguage'], $p1, $p2, $p3, $p4, $p5, $p6, $p7, $p8, $p9, $pp10, $pp11, $pp12, $pp13);
}
Пример #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;
    }
}
Пример #3
0
function DisplayEditFaq($Faq, $TCategory)
{
    global $title;
    $title = ww('FaqPage');
    include "header.php";
    Menu1("faq.php", ww('FaqPage'));
    // Displays the top menu
    Menu2("aboutus.php", ww('GetAnswers'));
    // Displays the second menu
    echo "\n";
    echo "    <div id=\"main\">\n";
    echo "      <div id=\"teaser_bg\">\n";
    echo "      <div id=\"teaser\">\n";
    echo "        <h1>Editing FAQ#", $Faq->id, " (", $Faq->QandA, ") </h1>\n";
    echo "      </div>\n";
    //menugetanswers("faq.php", $title); // Display the generic header
    echo "      </div>\n";
    // Content with just two columns
    echo "\n";
    echo "      <div id=\"col3\" class=\"twocolumns\">\n";
    echo "        <div id=\"col3_content\" class=\"clearfix\">\n";
    echo "<center>\n<b>Beware</b> edit Faq only apply to english Faq. For other languages, use AdminWords<br/><br/>\n";
    echo "<form method=post action=faq.php>\n";
    echo "<table width=\"90%\">\n";
    echo "<input type=hidden Name=\"IdFaq\" value=", $Faq->id, ">\n";
    echo "<input type=hidden Name=action value=update>\n";
    echo "<tr><td colspan=2>";
    echo "Category  ";
    echo "<select Name=\"IdCategory\">\n";
    for ($ii = 0; $ii < count($TCategory); $ii++) {
        echo "<option value=" . $TCategory[$ii]->id;
        if ($TCategory[$ii]->id == $Faq->IdCategory) {
            echo " selected ";
        }
        echo ">", ww($TCategory[$ii]->Description), "</option>\n";
    }
    echo "</select>\n";
    echo "\nStatus :<select name=\"Status\">\n";
    echo "<option value=\"Active\" ";
    if ($Faq->Active == "Active") {
        echo " selected ";
    }
    echo ">Active</option>\n";
    echo "<option value=\"Not Active\" ";
    if ($Faq->Active == "Not Active") {
        echo " selected ";
    }
    echo ">Not Active</otpion>\n";
    echo "</select>\n";
    echo "</td>\n";
    echo "<tr><td>";
    if ($Faq->QandA == "") {
        echo "You must create a name for this Faq like <i>AbuseCaseWhatToDo</i>  -->";
    } else {
        echo "Faq associated root word ";
    }
    echo "</td><td><input type=text size=30 name=QandA value=\"", $Faq->QandA, "\">";
    echo " SortOrder <input name=SortOrder Value=\"" . $Faq->SortOrder . "\" type=text size=1>";
    echo "</td>\n";
    echo "<tr><td>Question</td><td>";
    echo "<textarea cols=60 rows=1 name=Question>";
    if ($Faq->QandA == "") {
        echo "  - to complete - ";
    } else {
        echo wwinlang("FaqQ_" . $Faq->QandA, 0);
    }
    echo "</textarea></td>\n";
    echo "<tr><td>Answer</td><td>";
    echo "<textarea cols=60 rows=6 name=Answer>";
    if ($Faq->QandA == "") {
        echo "  - to complete - ";
    } else {
        echo wwinlang("FaqA_" . $Faq->QandA, 0);
    }
    echo "</textarea></td>\n";
    echo "<tr><td colspan=2 align=center><input type=submit value=update></td>\n";
    echo '<tr><td>What kind of change is this?</td>
            <td><input type="radio" name="changetype" value="minor" /> Minor change - old translations remain valid<br />
                <input type="radio" name="changetype" value="major" /> Major change - old translations are invalidated
            </td></tr>';
    echo "</form>\n";
    echo "</table>\n</center>\n";
    include "footer.php";
}