Example #1
0
</table>
</div>
<?php 
        }
    }
}
if ($_POST['act'] == "editgroup" && $_POST['update'] == "now" && $_GET['act'] == "editgroup" && isset($_POST['id'])) {
    $_POST['GroupName'] = stripcslashes(htmlspecialchars($_POST['GroupName'], ENT_QUOTES, $Settings['charset']));
    //$_POST['GroupName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GroupName']);
    $_POST['GroupName'] = remove_spaces($_POST['GroupName']);
    $_POST['NamePrefix'] = stripcslashes(htmlspecialchars($_POST['NamePrefix'], ENT_QUOTES, $Settings['charset']));
    //$_POST['NamePrefix'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['NamePrefix']);
    $_POST['NamePrefix'] = remove_spaces($_POST['NamePrefix']);
    $_POST['NameSuffix'] = stripcslashes(htmlspecialchars($_POST['NameSuffix'], ENT_QUOTES, $Settings['charset']));
    //$_POST['NameSuffix'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['NameSuffix']);
    $_POST['NameSuffix'] = remove_spaces($_POST['NameSuffix']);
    $name_check = 0;
    $prequery = sql_pre_query("SELECT * FROM \"" . $Settings['sqltable'] . "groups\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
    $preresult = sql_query($prequery, $SQLStat);
    $prenum = sql_num_rows($preresult);
    if ($prenum == 0) {
        redirect("location", $rbasedir . url_maker($exfile['admin'], $Settings['file_ext'], "act=view", $Settings['qstr'], $Settings['qsep'], $prexqstr['admin'], $exqstr['admin'], false));
        sql_free_result($preresult);
        ob_clean();
        header("Content-Type: text/plain; charset=" . $Settings['charset']);
        $urlstatus = 302;
        gzip_page($Settings['use_gzip'], $GZipEncode['Type']);
        session_write_close();
        die;
    }
    if ($prenum >= 1) {
    $firstname = isset($_POST['firstname']) ? $_POST['firstname'] : null;
    $surname = isset($_POST['surname']) ? $_POST['surname'] : null;
    $card_number = isset($_POST['card_number']) ? $_POST['card_number'] : null;
    $cvc_number = isset($_POST['cvc_number']) ? $_POST['cvc_number'] : null;
    /* Printing out the results from the form once validated */
    /* Supply extra information about that information */
    echo "Firstname =" . " " . $firstname . "</br>";
    echo "Surname =" . " " . $surname . "</br>";
    echo "CVC number =" . " " . $cvc_number . "</br>";
    /* This is a function which will remove all of the white spaces between that the user inputs into the card number field */
    function remove_spaces($text)
    {
        return str_replace(" ", "", $text);
    }
    /* Applying the remove_spaces function to the card number string */
    $cardnumber_spaceless = remove_spaces($card_number);
    /* This will split the the new spaceless card number into 4 numbers */
    $split_cardnumber = str_split($cardnumber_spaceless, 4);
    /* We will then fill the spaces between each 4 numbers with a - to comply with form requirements */
    $full_cardnumber = implode("-", $split_cardnumber);
    /* Now printing out the card number in the format we want it i.e. no spaces and - between ever 4 numbers*/
    echo "Cardnumber =" . " " . $full_cardnumber;
}
/* This is the beginning of a better method to output this data */
$required_fields = array('firstname' => 'firstname', 'surname' => 'surname', 'cardnumber' => 'cardnumber', 'cvc_number' => 'cvc number');
/* This is a foreach statment that will determine that what ever required_field is empty it will header redirect back to the index.php file and echo a specfic error */
foreach ($required_fields as $required_field) {
    if (empty($_POST[$required_field])) {
        /* If empty Header redirect back to index.php file */
        header("Location: http://192.168.33.10/vagrant-project/index.php?required_fields");
    } else {
Example #3
0
                        $NewPassword = b64e_hmac($_POST['Password'], $OldJoined, $NewSalt, "joaat");
                    }
                    $_SESSION['UserPass'] = $NewPassword;
                    if ($cookieDomain == null) {
                        setcookie("SessPass", $NewPassword, time() + 7 * 86400, $cbasedir);
                    }
                    if ($cookieDomain != null) {
                        if ($cookieSecure === true) {
                            setcookie("SessPass", $NewPassword, time() + 7 * 86400, $cbasedir, $cookieDomain, 1);
                        }
                        if ($cookieSecure === false) {
                            setcookie("SessPass", $NewPassword, time() + 7 * 86400, $cbasedir, $cookieDomain);
                        }
                    }
                }
                $_POST['Email'] = remove_spaces($_POST['Email']);
                if ($_POST['Password'] != "") {
                    $querynewuserinfo = sql_pre_query("UPDATE \"" . $Settings['sqltable'] . "members\" SET \"UserPassword\"='%s',\"HashType\"='%s',\"Email\"='%s',\"LastActive\"=%i,\"IP\"='%s',\"Salt\"='%s' WHERE \"id\"=%i", array($NewPassword, $iDBHash, $_POST['Email'], $NewDay, $NewIP, $NewSalt, $_SESSION['UserID']));
                    sql_query($querynewuserinfo, $SQLStat);
                }
                if ($_POST['Password'] == "") {
                    echo $querynewuserinfo = sql_pre_query("UPDATE \"" . $Settings['sqltable'] . "members\" SET \"Email\"='%s',\"LastActive\"=%i,\"IP\"='%s' WHERE \"id\"=%i", array($_POST['Email'], $NewDay, $NewIP, $_SESSION['UserID']));
                    sql_query($querynewuserinfo, $SQLStat);
                }
            }
        }
    }
}
if ($_POST['update'] == "now" && $_GET['act'] != null) {
    $profiletitle = " " . $ThemeSet['TitleDivider'] . " Updating Settings";
    ?>
Example #4
0
    $_POST['board_name'] = str_replace("\\&#039;", "&#039;", $_POST['board_name']);
    if ($_POST['board_name'] != $Settings['board_name'] && $Settings['SQLThemes'] == "on") {
        $logoquery = sql_pre_query("UPDATE \"" . $Settings['sqltable'] . "themes\" SET \"Logo\"='%s' WHERE \"Logo\"='%s'", array($_POST['board_name'], $Settings['board_name']));
        sql_query($logo, $SQLStat);
    }
    $_POST['Author'] = htmlspecialchars($_POST['Author'], ENT_QUOTES, $Settings['charset']);
    $_POST['Author'] = fixbamps($_POST['Author']);
    $_POST['Author'] = remove_spaces($_POST['Author']);
    $_POST['Author'] = str_replace("\\&#039;", "&#039;", $_POST['Author']);
    $_POST['Keywords'] = htmlspecialchars($_POST['Keywords'], ENT_QUOTES, $Settings['charset']);
    $_POST['Keywords'] = fixbamps($_POST['Keywords']);
    $_POST['Keywords'] = remove_spaces($_POST['Keywords']);
    $_POST['Keywords'] = str_replace("\\&#039;", "&#039;", $_POST['Keywords']);
    $_POST['Description'] = htmlspecialchars($_POST['Description'], ENT_QUOTES, $Settings['charset']);
    $_POST['Description'] = fixbamps($_POST['Description']);
    $_POST['Description'] = remove_spaces($_POST['Description']);
    $_POST['Description'] = str_replace("\\&#039;", "&#039;", $_POST['Description']);
    $BoardSettings = $pretext2[0] . "\nrequire('settings.php');\n" . "\$Settings['sqltable'] = " . null_string($Settings['sqltable']) . ";\n" . "\$Settings['board_name'] = " . null_string($_POST['board_name']) . ";\n" . "\$Settings['weburl'] = " . null_string($Settings['weburl']) . ";\n" . "\$Settings['SQLThemes'] = " . null_string($Settings['SQLThemes']) . ";\n" . "\$Settings['GuestGroup'] = " . null_string($Settings['GuestGroup']) . ";\n" . "\$Settings['MemberGroup'] = " . null_string($Settings['MemberGroup']) . ";\n" . "\$Settings['ValidateGroup'] = " . null_string($Settings['ValidateGroup']) . ";\n" . "\$Settings['AdminValidate'] = " . null_string($Settings['AdminValidate']) . ";\n" . "\$Settings['TestReferer'] = " . null_string($Settings['TestReferer']) . ";\n" . "\$Settings['DefaultTheme'] = " . null_string($Settings['DefaultTheme']) . ";\n" . "\$Settings['DefaultTimeZone'] = " . null_string($Settings['DefaultTimeZone']) . ";\n" . "\$Settings['DefaultDST'] = " . null_string($Settings['DefaultDST']) . ";\n" . "\$Settings['start_date'] = " . null_string($Settings['start_date']) . ";\n" . "\$Settings['idb_time_format'] = " . null_string($Settings['idb_time_format']) . ";\n" . "\$Settings['idb_date_format'] = " . null_string($Settings['idb_date_format']) . ";\n" . "\$Settings['use_hashtype'] = " . null_string($Settings['use_hashtype']) . ";\n" . "\$Settings['max_posts'] = " . null_string($Settings['max_posts']) . ";\n" . "\$Settings['max_topics'] = " . null_string($Settings['max_topics']) . ";\n" . "\$Settings['max_memlist'] = " . null_string($Settings['max_memlist']) . ";\n" . "\$Settings['max_pmlist'] = " . null_string($Settings['max_pmlist']) . ";\n" . "\$Settings['hot_topic_num'] = " . null_string($Settings['hot_topic_num']) . ";\n" . "\$Settings['enable_rss'] = " . null_string($Settings['enable_rss']) . ";\n" . "\$Settings['enable_search'] = " . null_string($Settings['enable_search']) . ";\n" . "\$Settings['board_offline'] = " . null_string($Settings['board_offline']) . ";\n" . "\$Settings['VerCheckURL'] = " . null_string($Settings['VerCheckURL']) . ";\n" . "\$Settings['IPCheckURL'] = " . null_string($Settings['IPCheckURL']) . ";\n" . "\$Settings['log_http_request'] = " . null_string($Settings['log_http_request']) . ";\n" . "\$Settings['log_config_format'] = " . null_string($Settings['log_config_format']) . ";\n" . "\$Settings['BoardUUID'] = " . null_string(base64_encode($Settings['BoardUUID'])) . ";\n" . "\$Settings['KarmaBoostDays'] = " . null_string($Settings['KarmaBoostDays']) . ";\n" . "\$Settings['KBoostPercent'] = " . null_string($Settings['KBoostPercent']) . ";\n" . $pretext2[1] . "\n" . "\$SettInfo['board_name'] = " . null_string($_POST['board_name']) . ";\n" . "\$SettInfo['Author'] = " . null_string($_POST['Author']) . ";\n" . "\$SettInfo['Keywords'] = " . null_string($_POST['Keywords']) . ";\n" . "\$SettInfo['Description'] = " . null_string($_POST['Description']) . ";\n?>";
    $BoardSettingsBak = $pretext . $settcheck . $BoardSettings;
    $BoardSettings = $pretext . $settcheck . $BoardSettings;
    $fp = fopen($_GET['board'] . "_settings.php", "w+");
    fwrite($fp, $BoardSettings);
    fclose($fp);
    //	cp("settings.php","settingsbak.php");
    $fp = fopen($_GET['board'] . "_settingsbak.php", "w+");
    fwrite($fp, $BoardSettingsBak);
    fclose($fp);
}
if ($_POST['update'] == "now" && $_GET['act'] != null && $_GET['act'] != "delete") {
    $profiletitle = " " . $ThemeSet['TitleDivider'] . " Updating Settings";
    ?>
function splitCheckText($text, $lid, $id)
{
    // $id = -1     => Check, return protocol
    // $id = -2     => Only return sentence array
    // $id = TextID => Split: insert sentences/textitems entries in DB
    global $tbpref;
    $r = '';
    $sql = "select * from " . $tbpref . "languages where LgID=" . $lid;
    $res = do_mysql_query($sql);
    $record = mysql_fetch_assoc($res);
    if ($record == FALSE) {
        my_die("Language data not found: {$sql}");
    }
    $removeSpaces = $record['LgRemoveSpaces'];
    $splitEachChar = $record['LgSplitEachChar'];
    $splitSentence = $record['LgRegexpSplitSentences'];
    $noSentenceEnd = $record['LgExceptionsSplitSentences'];
    $termchar = $record['LgRegexpWordCharacters'];
    $replace = explode("|", $record['LgCharacterSubstitutions']);
    $rtlScript = $record['LgRightToLeft'];
    mysql_free_result($res);
    $s = prepare_textdata($text);
    $s = str_replace("\n", " ¶ ", $s);
    $s = str_replace("\t", " ", $s);
    $s = trim($s);
    if ($splitEachChar) {
        $s = preg_replace('/([^\\s])/u', "\$1 ", $s);
    }
    $s = preg_replace('/\\s{2,}/u', ' ', $s);
    if ($id == -1) {
        $r .= "<div style=\"margin-right:50px;\"><h4>Text</h4><p " . ($rtlScript ? 'dir="rtl"' : '') . ">" . str_replace("¶", "<br /><br />", tohtml($s)) . "</p>";
    }
    $s = str_replace('{', '[', $s);
    // because of sent. spc. char
    $s = str_replace('}', ']', $s);
    foreach ($replace as $value) {
        $fromto = explode("=", trim($value));
        if (count($fromto) >= 2) {
            $s = str_replace(trim($fromto[0]), trim($fromto[1]), $s);
        }
    }
    $s = trim($s);
    if ($noSentenceEnd != '') {
        $s = preg_replace('/(' . $noSentenceEnd . ')\\s/u', '$1‧', $s);
    }
    $s = preg_replace('/([' . $splitSentence . '¶])\\s/u', "\$1\n", $s);
    $s = str_replace(" ¶\n", "\n¶\n", $s);
    $s = str_replace('‧', ' ', $s);
    if ($s == '') {
        $textLines = array($s);
    } else {
        $s = explode("\n", $s);
        $l = count($s);
        for ($i = 0; $i < $l; $i++) {
            $s[$i] = trim($s[$i]);
            if ($s[$i] != '') {
                $pos = strpos($splitSentence, $s[$i]);
                while ($pos !== false && $i > 0) {
                    $s[$i - 1] .= " " . $s[$i];
                    for ($j = $i + 1; $j < $l; $j++) {
                        $s[$j - 1] = $s[$j];
                    }
                    array_pop($s);
                    $l = count($s);
                    $pos = strpos($splitSentence, $s[$i]);
                }
            }
        }
        $l = count($s);
        $textLines = array();
        for ($i = 0; $i < $l; $i++) {
            $zz = trim($s[$i]);
            if ($zz != '') {
                $textLines[] = $zz;
            }
        }
    }
    if ($id == -2) {
        ////////////////////////////////////
        // Only return sentence array
        return $textLines;
    }
    $lineWords = array();
    if ($id == -1) {
        ////////////////////////////////////
        // Check, return protocol
        $wordList = array();
        $wordSeps = array();
        $r .= "<h4>Sentences</h4><ol>";
        $sentNumber = 0;
        foreach ($textLines as $value) {
            $r .= "<li " . ($rtlScript ? 'dir="rtl"' : '') . ">" . tohtml(remove_spaces($value, $removeSpaces)) . "</li>";
            $lineWords[$sentNumber] = preg_split('/([^' . $termchar . ']{1,})/u', $value, -1, PREG_SPLIT_DELIM_CAPTURE);
            $l = count($lineWords[$sentNumber]);
            for ($i = 0; $i < $l; $i++) {
                $term = mb_strtolower($lineWords[$sentNumber][$i], 'UTF-8');
                if ($term != '') {
                    if ($i % 2 == 0) {
                        if (array_key_exists($term, $wordList)) {
                            $wordList[$term][0]++;
                            $wordList[$term][1][] = $sentNumber;
                        } else {
                            $wordList[$term] = array(1, array($sentNumber));
                        }
                    } else {
                        $ww = remove_spaces($term, $removeSpaces);
                        if (array_key_exists($ww, $wordSeps)) {
                            $wordSeps[$ww]++;
                        } else {
                            $wordSeps[$ww] = 1;
                        }
                    }
                }
            }
            $sentNumber += 1;
        }
        $r .= "</ol><h4>Word List <span class=\"red2\">(red = already saved)</span></h4><ul>";
        ksort($wordList);
        $anz = 0;
        foreach ($wordList as $key => $value) {
            $trans = get_first_value("select WoTranslation as value from " . $tbpref . "words where WoLgID = " . $lid . " and WoTextLC = " . convert_string_to_sqlsyntax($key));
            if (!isset($trans)) {
                $trans = "";
            }
            if ($trans == "*") {
                $trans = "";
            }
            if ($trans != "") {
                $r .= "<li " . ($rtlScript ? 'dir="rtl"' : '') . "><span class=\"red2\">[" . tohtml($key) . "] — " . $value[0] . " - " . tohtml(repl_tab_nl($trans)) . "</span></li>";
            } else {
                $r .= "<li " . ($rtlScript ? 'dir="rtl"' : '') . ">[" . tohtml($key) . "] — " . $value[0] . "</li>";
            }
            $anz++;
        }
        $r .= "</ul><p>TOTAL: " . $anz . "</p><h4>Non-Word List</h4><ul>";
        if (array_key_exists('', $wordSeps)) {
            unset($wordSeps['']);
        }
        ksort($wordSeps);
        $anz = 0;
        foreach ($wordSeps as $key => $value) {
            $r .= "<li>[" . str_replace(" ", "<span class=\"backgray\">&nbsp;</span>", tohtml($key)) . "] — " . $value . "</li>";
            $anz++;
        }
        $r .= "</ul><p>TOTAL: " . $anz . "</p></div>";
        return $r;
    }
    ////////////////////////////////////
    // Split: insert sentences/textitems entries in DB
    $sentNumber = 0;
    $lfdnr = 0;
    foreach ($textLines as $value) {
        $dummy = runsql('INSERT INTO ' . $tbpref . 'sentences (SeLgID, SeTxID, SeOrder, SeText) VALUES (' . $lid . ',' . $id . ',' . ($sentNumber + 1) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($value . ' ', $removeSpaces)) . ')', ' ');
        $sentid = get_last_key();
        $lineWords[$sentNumber] = preg_split('/([^' . $termchar . ']+)/u', $value . ' ', null, PREG_SPLIT_DELIM_CAPTURE);
        $l = count($lineWords[$sentNumber]);
        $sqltext = 'INSERT INTO ' . $tbpref . 'textitems (TiLgID, TiTxID, TiSeID, TiOrder, TiWordCount, TiText, TiTextLC, TiIsNotWord) VALUES ';
        $lfdnr1 = 0;
        for ($i = 0; $i < $l; $i++) {
            $term = mb_strtolower($lineWords[$sentNumber][$i], 'UTF-8');
            $rest2 = '';
            $rest3 = '';
            $rest4 = '';
            $rest5 = '';
            $rest6 = '';
            $rest7 = '';
            $rest8 = '';
            $rest9 = '';
            $restlc2 = '';
            $restlc3 = '';
            $restlc4 = '';
            $restlc5 = '';
            $restlc6 = '';
            $restlc7 = '';
            $restlc8 = '';
            $restlc9 = '';
            if ($term != '') {
                if ($i % 2 == 0) {
                    $isnotwort = 0;
                    $rest = $lineWords[$sentNumber][$i];
                    $cnt = 0;
                    for ($j = $i + 1; $j < $l; $j++) {
                        if ($lineWords[$sentNumber][$j] != '') {
                            $rest .= $lineWords[$sentNumber][$j];
                            $cnt++;
                            if ($cnt == 2) {
                                $rest2 = $rest;
                                $restlc2 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 4) {
                                $rest3 = $rest;
                                $restlc3 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 6) {
                                $rest4 = $rest;
                                $restlc4 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 8) {
                                $rest5 = $rest;
                                $restlc5 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 10) {
                                $rest6 = $rest;
                                $restlc6 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 12) {
                                $rest7 = $rest;
                                $restlc7 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 14) {
                                $rest8 = $rest;
                                $restlc8 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 16) {
                                $rest9 = $rest;
                                $restlc9 = mb_strtolower($rest, 'UTF-8');
                                break;
                            }
                        }
                    }
                } else {
                    $isnotwort = 1;
                }
                $lfdnr++;
                $lfdnr1++;
                if ($lfdnr1 > 1) {
                    $sqltext .= ',';
                }
                $sqltext .= '(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 1, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($lineWords[$sentNumber][$i], $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($term, $removeSpaces)) . ',' . $isnotwort . ')';
                if ($isnotwort == 0) {
                    if ($rest2 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 2, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest2, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc2, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest3 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 3, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest3, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc3, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest4 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 4, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest4, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc4, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest5 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 5, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest5, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc5, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest6 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 6, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest6, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc6, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest7 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 7, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest7, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc7, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest8 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 8, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest8, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc8, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest9 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 9, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest9, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc9, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                }
            }
        }
        if ($lfdnr > 0) {
            $dummy = runsql($sqltext, '');
        }
        $sentNumber += 1;
    }
}
Example #6
0
<tr class="TableMenuRow4">
<td class="TableMenuColumn4">&nbsp;</td>
</tr>
</table>
</div>
<?php 
        }
    }
}
if ($_POST['act'] == "editcategory" && $_POST['update'] == "now" && $_GET['act'] == "editcategory" && isset($_POST['id'])) {
    $_POST['CategoryName'] = stripcslashes(htmlspecialchars($_POST['CategoryName'], ENT_QUOTES, $Settings['charset']));
    //$_POST['CategoryName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['CategoryName']);
    $_POST['CategoryName'] = remove_spaces($_POST['CategoryName']);
    $_POST['CategoryDesc'] = stripcslashes(htmlspecialchars($_POST['CategoryDesc'], ENT_QUOTES, $Settings['charset']));
    //$_POST['CategoryDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['CategoryDesc']);
    $_POST['CategoryDesc'] = remove_spaces($_POST['CategoryDesc']);
    $prequery = sql_pre_query("SELECT * FROM \"" . $Settings['sqltable'] . "categories\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
    $preresult = sql_query($prequery, $SQLStat);
    $prenum = sql_num_rows($preresult);
    if ($prenum == 0) {
        redirect("location", $rbasedir . url_maker($exfile['admin'], $Settings['file_ext'], "act=view", $Settings['qstr'], $Settings['qsep'], $prexqstr['admin'], $exqstr['admin'], false));
        sql_free_result($preresult);
        ob_clean();
        header("Content-Type: text/plain; charset=" . $Settings['charset']);
        $urlstatus = 302;
        gzip_page($Settings['use_gzip'], $GZipEncode['Type']);
        session_write_close();
        die;
    }
    if ($prenum >= 1) {
        $OldID = sql_result($preresult, 0, "id");
Example #7
0
            $Error = "Yes";
            ?>
<tr>
	<td><span class="TableMessage">
	<br />Sorry the referering url dose not match our host name.<br />
	</span>&nbsp;</td>
</tr>
<?php 
        }
    }
    $_POST['EventName'] = stripcslashes(htmlspecialchars($_POST['EventName'], ENT_QUOTES, $Settings['charset']));
    //$_POST['EventName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['EventName']);
    $_POST['EventName'] = remove_spaces($_POST['EventName']);
    $_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES, $Settings['charset']));
    //$_POST['GuestName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
    $_POST['GuestName'] = remove_spaces($_POST['GuestName']);
    $_POST['EventText'] = stripcslashes(htmlspecialchars($_POST['EventText'], ENT_QUOTES, $Settings['charset']));
    //$_POST['EventText'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['EventText']);
    $_POST['EventText'] = remove_bad_entities($_POST['EventText']);
    //$_POST['EventText'] = remove_spaces($_POST['EventText']);
    if ($_SESSION['UserGroup'] == $Settings['GuestGroup']) {
        if (isset($_POST['GuestName']) && $_POST['GuestName'] != null) {
            if ($cookieDomain == null) {
                setcookie("GuestName", $_POST['GuestName'], time() + 7 * 86400, $cbasedir);
            }
            if ($cookieDomain != null) {
                if ($cookieSecure === true) {
                    setcookie("GuestName", $_POST['GuestName'], time() + 7 * 86400, $cbasedir, $cookieDomain, 1);
                }
                if ($cookieSecure === false) {
                    setcookie("GuestName", $_POST['GuestName'], time() + 7 * 86400, $cbasedir, $cookieDomain);
Example #8
0
 if (!isset($_POST['iDBHTTPLogger'])) {
     $_POST['iDBHTTPLogger'] = "off";
 }
 if (isset($_POST['iDBHTTPLogger']) && $_POST['iDBHTTPLogger'] != "on" && $_POST['iDBHTTPLogger'] != "off") {
     $_POST['iDBHTTPLogger'] = "off";
 }
 if (!isset($_POST['iDBLoggerFormat'])) {
     $_POST['iDBLoggerFormat'] = "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"";
 }
 $Settings['idb_time_format'] = $_POST['iDBTimeFormat'];
 $Settings['idb_date_format'] = $_POST['iDBDateFormat'];
 $NewPassword = b64e_hmac($_POST['AdminPasswords'], $YourDate, $YourSalt, $_POST['usehashtype']);
 //$Name = stripcslashes(htmlspecialchars($AdminUser, ENT_QUOTES, $Settings['charset']));
 //$YourWebsite = "http://".$Settings['idburl'].$this_dir."index.php?act=view";
 $_POST['WebURL'] = htmlentities($_POST['WebURL'], ENT_QUOTES, $Settings['charset']);
 $_POST['WebURL'] = remove_spaces($_POST['WebURL']);
 $YourWebsite = $_POST['WebURL'];
 $UserIP = $_SERVER['REMOTE_ADDR'];
 $PostCount = 2;
 $Email = "admin@" . $Settings['idburl'];
 $AdminTime = $_POST['YourOffSet'] . ":" . $_POST['MinOffSet'];
 $GEmail = "guest@" . $Settings['idburl'];
 $grand = rand(6, 16);
 $i = 0;
 $gpass = "";
 while ($i < $grand) {
     $csrand = rand(1, 3);
     if ($csrand != 1 && $csrand != 2 && $csrand != 3) {
         $csrand = 1;
     }
     if ($csrand == 1) {
Example #9
0
 function __construct($name, $type, $isOptional)
 {
     $this->name = $name;
     $this->type = remove_spaces($type);
     $this->isOptional = $isOptional;
 }
Example #10
0
<?php 
            }
        }
        $_POST['ReplyDesc'] = stripcslashes(htmlspecialchars($_POST['ReplyDesc'], ENT_QUOTES, $Settings['charset']));
        //$_POST['ReplyDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyDesc']);
        $_POST['ReplyDesc'] = remove_spaces($_POST['ReplyDesc']);
        $_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES, $Settings['charset']));
        //$_POST['GuestName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
        $_POST['GuestName'] = remove_spaces($_POST['GuestName']);
        $_POST['ReplyPost'] = stripcslashes(htmlspecialchars($_POST['ReplyPost'], ENT_QUOTES, $Settings['charset']));
        //$_POST['ReplyPost'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ReplyPost']);
        $_POST['ReplyPost'] = remove_bad_entities($_POST['ReplyPost']);
        if ($ShowEditTopic === true) {
            $_POST['TopicName'] = stripcslashes(htmlspecialchars($_POST['TopicName'], ENT_QUOTES, $Settings['charset']));
            //$_POST['TopicName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['TopicName']);
            $_POST['TopicName'] = remove_spaces($_POST['TopicName']);
        }
        /*    <_<  iWordFilter  >_>      
           by Kazuki Przyborowski - Cool Dude 2k */
        $katarzynaqy = sql_pre_query("SELECT * FROM \"" . $Settings['sqltable'] . "wordfilter\"", array(null));
        $katarzynart = sql_query($katarzynaqy, $SQLStat);
        $katarzynanm = sql_num_rows($katarzynart);
        $katarzynas = 0;
        while ($katarzynas < $katarzynanm) {
            $Filter = sql_result($katarzynart, $katarzynas, "FilterWord");
            $Replace = sql_result($katarzynart, $katarzynas, "Replacement");
            $CaseInsensitive = sql_result($katarzynart, $katarzynas, "CaseInsensitive");
            if ($CaseInsensitive == "on") {
                $CaseInsensitive = "yes";
            }
            if ($CaseInsensitive == "off") {
Example #11
0
<tr class="TableMenuRow4">
<td class="TableMenuColumn4">&nbsp;</td>
</tr>
</table>
</div>
<?php 
        }
    }
}
if ($_POST['act'] == "editforum" && $_POST['update'] == "now" && $_GET['act'] == "editforum" && isset($_POST['id'])) {
    $_POST['ForumName'] = stripcslashes(htmlspecialchars($_POST['ForumName'], ENT_QUOTES, $Settings['charset']));
    //$_POST['ForumName'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ForumName']);
    $_POST['ForumName'] = remove_spaces($_POST['ForumName']);
    $_POST['ForumDesc'] = stripcslashes(htmlspecialchars($_POST['ForumDesc'], ENT_QUOTES, $Settings['charset']));
    //$_POST['ForumDesc'] = preg_replace("/&amp;#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['ForumDesc']);
    $_POST['ForumDesc'] = remove_spaces($_POST['ForumDesc']);
    $prequery = sql_pre_query("SELECT * FROM \"" . $Settings['sqltable'] . "forums\" WHERE \"id\"=%i LIMIT 1", array($_POST['id']));
    $preresult = sql_query($prequery, $SQLStat);
    $prenum = sql_num_rows($preresult);
    if ($prenum == 0) {
        redirect("location", $rbasedir . url_maker($exfile['admin'], $Settings['file_ext'], "act=view", $Settings['qstr'], $Settings['qsep'], $prexqstr['admin'], $exqstr['admin'], false));
        sql_free_result($preresult);
        ob_clean();
        header("Content-Type: text/plain; charset=" . $Settings['charset']);
        $urlstatus = 302;
        gzip_page($Settings['use_gzip'], $GZipEncode['Type']);
        session_write_close();
        die;
    }
    if ($prenum >= 1) {
        $OldID = sql_result($preresult, 0, "id");
Example #12
0
function splitText($text, $lid, $id)
{
    $sql = "select * from languages where LgID=" . $lid;
    $res = mysql_query($sql);
    if ($res == FALSE) {
        die("Invalid Query: {$sql}");
    }
    $record = mysql_fetch_assoc($res);
    if ($record == FALSE) {
        die("No results: {$sql}");
    }
    $removeSpaces = $record['LgRemoveSpaces'];
    $splitEachChar = $record['LgSplitEachChar'];
    $splitSentence = $record['LgRegexpSplitSentences'];
    $noSentenceEnd = $record['LgExceptionsSplitSentences'];
    $termchar = $record['LgRegexpWordCharacters'];
    $replace = explode("|", $record['LgCharacterSubstitutions']);
    mysql_free_result($res);
    $s = str_replace("\r\n", "\n", $text);
    $s = str_replace("\n", " ¶ ", $s);
    $s = str_replace("\t", " ", $s);
    $s = trim($s);
    if ($splitEachChar) {
        $s = preg_replace('/([^\\s])/u', "\$1 ", $s);
    }
    $s = preg_replace('/\\s{2,}/u', ' ', $s);
    $s = str_replace('{', '[', $s);
    // because of sent. spc. char
    $s = str_replace('}', ']', $s);
    foreach ($replace as $value) {
        $fromto = explode("=", trim($value));
        if (count($fromto) >= 2) {
            $s = str_replace(trim($fromto[0]), trim($fromto[1]), $s);
        }
    }
    $s = trim($s);
    if ($noSentenceEnd != '') {
        $s = preg_replace('/(' . $noSentenceEnd . ')\\s/u', '$1‧', $s);
    }
    $s = preg_replace('/([' . $splitSentence . '¶])\\s/u', "\$1\n", $s);
    $s = str_replace(" ¶\n", "\n¶\n", $s);
    $s = str_replace('‧', ' ', $s);
    if ($s == '') {
        $textLines = array($s);
    } else {
        $s = explode("\n", $s);
        $l = count($s);
        for ($i = 0; $i < $l; $i++) {
            $s[$i] = trim($s[$i]);
            if ($s[$i] != '') {
                $pos = strpos($splitSentence, $s[$i]);
                while ($pos !== false && $i > 0) {
                    $s[$i - 1] .= " " . $s[$i];
                    for ($j = $i + 1; $j < $l; $j++) {
                        $s[$j - 1] = $s[$j];
                    }
                    array_pop($s);
                    $l = count($s);
                    $pos = strpos($splitSentence, $s[$i]);
                }
            }
        }
        $l = count($s);
        $textLines = array();
        for ($i = 0; $i < $l; $i++) {
            $zz = trim($s[$i]);
            if ($zz != '') {
                $textLines[] = $zz;
            }
        }
    }
    $lineWords = array();
    $wordList = array();
    $wordIndex = array();
    $wordSeps = array();
    $sentNumber = 0;
    $lfdnr = 0;
    foreach ($textLines as $value) {
        $dummy = runsql('INSERT INTO sentences (SeLgID, SeTxID, SeOrder, SeText) VALUES (' . $lid . ',' . $id . ',' . ($sentNumber + 1) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($value . ' ', $removeSpaces)) . ')', ' ');
        $sentid = get_last_key();
        /**** Speichern Sätze Ende ***/
        $lineWords[$sentNumber] = preg_split('/([^' . $termchar . ']+)/u', $value . ' ', null, PREG_SPLIT_DELIM_CAPTURE);
        $l = count($lineWords[$sentNumber]);
        $sqltext = 'INSERT INTO textitems (TiLgID, TiTxID, TiSeID, TiOrder, TiWordCount, TiText, TiTextLC, TiIsNotWord) VALUES ';
        $lfdnr1 = 0;
        for ($i = 0; $i < $l; $i++) {
            $term = mb_strtolower($lineWords[$sentNumber][$i], 'UTF-8');
            $rest2 = '';
            $rest3 = '';
            $rest4 = '';
            $rest5 = '';
            $rest6 = '';
            $rest7 = '';
            $rest8 = '';
            $rest9 = '';
            $restlc2 = '';
            $restlc3 = '';
            $restlc4 = '';
            $restlc5 = '';
            $restlc6 = '';
            $restlc7 = '';
            $restlc8 = '';
            $restlc9 = '';
            if ($term != '') {
                if ($i % 2 == 0) {
                    $isnotwort = 0;
                    $rest = $lineWords[$sentNumber][$i];
                    $cnt = 0;
                    for ($j = $i + 1; $j < $l; $j++) {
                        if ($lineWords[$sentNumber][$j] != '') {
                            $rest .= $lineWords[$sentNumber][$j];
                            $cnt++;
                            if ($cnt == 2) {
                                $rest2 = $rest;
                                $restlc2 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 4) {
                                $rest3 = $rest;
                                $restlc3 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 6) {
                                $rest4 = $rest;
                                $restlc4 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 8) {
                                $rest5 = $rest;
                                $restlc5 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 10) {
                                $rest6 = $rest;
                                $restlc6 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 12) {
                                $rest7 = $rest;
                                $restlc7 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 14) {
                                $rest8 = $rest;
                                $restlc8 = mb_strtolower($rest, 'UTF-8');
                            }
                            if ($cnt == 16) {
                                $rest9 = $rest;
                                $restlc9 = mb_strtolower($rest, 'UTF-8');
                                break;
                            }
                        }
                    }
                } else {
                    $isnotwort = 1;
                }
                $lfdnr++;
                $lfdnr1++;
                if ($lfdnr1 > 1) {
                    $sqltext .= ',';
                }
                $sqltext .= '(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 1, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($lineWords[$sentNumber][$i], $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($term, $removeSpaces)) . ',' . $isnotwort . ')';
                if ($isnotwort == 0) {
                    if ($rest2 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 2, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest2, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc2, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest3 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 3, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest3, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc3, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest4 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 4, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest4, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc4, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest5 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 5, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest5, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc5, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest6 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 6, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest6, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc6, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest7 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 7, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest7, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc7, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest8 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 8, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest8, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc8, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                    if ($rest9 != '') {
                        $sqltext .= ',(' . $lid . ',' . $id . ',' . $sentid . ',' . $lfdnr . ', 9, ' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($rest9, $removeSpaces)) . ',' . convert_string_to_sqlsyntax_notrim_nonull(remove_spaces($restlc9, $removeSpaces)) . ',' . $isnotwort . ')';
                    }
                }
            }
        }
        if ($lfdnr > 0) {
            $dummy = runsql($sqltext, '');
        }
        $sentNumber += 1;
    }
}