Example #1
0
                $all = explode("\n", $conts);
                /*
                $tabs = new sql;
                $tabs->setquery("SHOW TABLES");
                $del = new sql;
                for($i=0;$i<$tabs->rows;$i++,$tabs->next(),$del->flush()) 
                	if($tabs->getvalue("Tables_in_".$DB[1][NAME]) != "rex_user") 
                		$del->setquery("DROP TABLE ".$tabs->getvalue("Tables_in_".$DB[1][NAME]));
                */
                $add = new sql();
                foreach ($all as $hier) {
                    $add->setquery(Trim(str_replace("||||||+N+||||||", "\n", $hier), ";"));
                    $add->flush();
                }
                $msg = $I18N_ADDON->msg("database_imported") . ". " . $I18N_ADDON->msg("entry_count", count($all)) . "<br>";
                $msg .= generateAll();
            }
            if ($impname == "") {
                @unlink($file_temp);
            }
        } else {
            $msg = $I18N_ADDON->msg("file_could_not_be_uploaded") . " " . $I18N_ADDON->msg("you_have_no_write_permission_in", "addons/{$page}/files/") . " <br>";
        }
    }
} elseif ($function == "fileimport") {
    // ------------------------------ FUNC FILEIMPORT
    if ($_FILES['FORM']['size']['importfile'] < 1 && $impname == "") {
        $msg = $I18N_ADDON->msg("no_import_file_chosen") . "<br>";
    } else {
        if ($impname != "") {
            $file_temp = $REX[INCLUDE_PATH] . "/addons/{$page}/files/{$impname}";
Example #2
0
    fclose($h);
    // echo nl2br(htmlentities($cont));
    $h = @fopen($REX[INCLUDE_PATH] . "/master.inc.php", "w+");
    if (fwrite($h, $cont, strlen($cont)) > 0) {
        $MSG = $I18N->msg("setup_error1");
    } else {
        $MSG = $I18N->msg("setup_error2");
    }
    fclose($h);
} elseif ($func == "copyCategory") {
    // noch nicht fertig
    // $which,$to_cat
    // copyCategory(10,0); // copyCategory(von_category_id,nach_category_id); diese funktion ist schon fertig
} elseif ($func == "generate") {
    // generate all articles,cats,templates,caches
    $MSG = generateAll();
} elseif ($func == "linkchecker") {
    unset($LART);
    for ($j = 1; $j < 11; $j++) {
        $LC = new sql();
        // $LC->debugsql = 1;
        $LC->setQuery("select rex_article_slice.article_id,rex_article_slice.id from rex_article_slice\n\t\t\t\tleft join rex_article on rex_article_slice.link{$j}=rex_article.id\n\t\t\t\twhere\n\t\t\t\trex_article_slice.link{$j}>0 and rex_article.id IS NULL");
        for ($i = 0; $i < $LC->getRows(); $i++) {
            $LART[$LC->getValue("rex_article_slice.article_id")] = 1;
            $LSLI[$LC->getValue("rex_article_slice.article_id")] = $LC->getValue("rex_article_slice.id");
            $LC->next();
        }
    }
    if (count($LART) > 0) {
        reset($LART);
    }