Example #1
0
            ?>
">Go back</a> <a class="submit" href="index.php?step=<?php 
            echo $step;
            ?>
">Refresh</a></div>
			<?php 
        } else {
            $act = array(3 => array('table has been deleted and recreated', 'tables have been deleted and recreated'), 2 => array('table has not been changed', 'tables have not been changed'), 1 => array('table has been cleared', 'tables have been cleared'), 0 => array('table has been recreated', 'tables have been recreated'));
            $done = array_fill(0, 4, 0);
            foreach ($action as $table => $value) {
                $t = $db->pre . $table;
                $file = 'install/package/' . $package . '/db/' . $table . '.sql';
                if ($value == 0) {
                    $sql = implode('', file($file));
                    $sql = str_replace('{:=DBPREFIX=:}', $db->pre, $sql);
                    $db->multi_query($sql);
                } elseif ($value == 1) {
                    $db->query("TRUNCATE TABLE `{$t}`");
                } elseif ($value == 3) {
                    $sql = implode('', file($file));
                    $sql = str_replace('{:=DBPREFIX=:}', $db->pre, $sql);
                    $drop = "DROP TABLE IF EXISTS `{$t}`;\n";
                    $db->multi_query($drop . $sql);
                } else {
                    $value = 2;
                    // Do nothing with tables!
                }
                $done[$value]++;
            }
            if (isset($_REQUEST['sample_d1']) && $_REQUEST['sample_d1'] == 1) {
                $sql = implode('', file('install/package/install/db/sample1.dat'));
Example #2
0
$d = dir($dir);
while (false !== ($entry = $d->read())) {
    if (is_dir($dir . $entry) && preg_match('/^\\d{1,}$/', $entry) && $entry != '.' && $entry != '..') {
        $tplids[] = $entry;
    }
}
$d->close();
foreach ($tplids as $id) {
    $tpldir = $dir . $id;
    $filesystem->unlink($tpldir . '/edit.html');
}
// install / sql
$file = 'package/' . $package . '/db/forums.sql';
$sql = implode('', file($file));
$sql = str_replace('{:=DBPREFIX=:}', $db->pre, $sql);
$db->multi_query($sql, false);
// Transfer old data - START
function forumtree_array($temp, $sub)
{
    foreach ($temp as $cid => $boards) {
        foreach ($boards as $bid => $arr) {
            if (isset($sub[$bid])) {
                $sub[$bid] = forumtree_array($sub[$bid], $sub);
                $temp[$cid][$bid] = $sub[$bid];
            }
        }
    }
    return $temp;
}
$parent = $sub = $empty = $full = $data = array();
$result = $db->query("SELECT b.id, b.bid, b.cid FROM {$db->pre}cat AS b LEFT JOIN {$db->pre}categories AS c ON c.id = b.cid ORDER BY c.c_order, c.id, b.c_order, b.id", __LINE__, __FILE__);
Example #3
0
            $filesystem->file_put_contents($path . 'standard.css', $file);
        }
        if ($path . 'ie.css') {
            $file = file_get_contents($path . 'ie.css');
            $file .= "\r\n* html .tooltip {\r\n\twidth: 300px;\r\n}\r\n";
            $filesystem->file_put_contents($path . 'ie.css', $file);
        }
    }
}
$dir->close();
echo "- Stylesheets updated.<br />";
// MySQL
$file = 'package/' . $package . '/db/db_changes.sql';
$sql = file_get_contents($file);
$sql = str_ireplace('{:=DBPREFIX=:}', $db->prefix(), $sql);
$db->multi_query($sql);
echo "- Database tables updated.<br />";
// Languages
$ini = array('settings' => array('language' => array('compatible_version' => VISCACHA_VERSION), 'language_de' => array('compatible_version' => VISCACHA_VERSION)), 'global' => array('language' => array('upload_error_default' => null, 'upload_error_fileexists' => null, 'upload_error_maxfilesize' => null, 'upload_error_maximagesize' => null, 'upload_error_noaccess' => null, 'upload_error_noupload' => null, 'upload_error_wrongfiletype' => null, 'ats_select9' => null, 'ats_choose' => 'No Status', 'ats_choose_standard_a' => 'Use default setting (Article)', 'ats_choose_standard_n' => 'Use default setting (News)', 'profile_never' => 'Never'), 'language_de' => array('upload_error_default' => null, 'upload_error_fileexists' => null, 'upload_error_maxfilesize' => null, 'upload_error_maximagesize' => null, 'upload_error_noaccess' => null, 'upload_error_noupload' => null, 'upload_error_wrongfiletype' => null, 'ats_select9' => null, 'ats_choose' => 'Kein Status', 'ats_choose_standard_a' => 'Standardeinstellung nutzen (Artikel)', 'ats_choose_standard_n' => 'Standardeinstellung nutzen (News)', 'editprofile_about_longdesc' => 'Hier können Sie sich eine persönliche "Forenseite" erstellen.<br /><br />Sie können BB-Codes und maximal <em>{$chars}</em> Zeichen für die Seite nutzen.', 'profile_about' => 'Persönliche Seite', 'profile_never' => 'Nie')));
$c = new manageconfig();
$codes = array();
$keys = array('language', 'language_de');
$codes = getLangCodesByKeys($keys);
$langcodes = getLangCodes();
foreach ($langcodes as $code => $lid) {
    $ldat = explode('_', $code);
    if (isset($codes[$ldat[0]])) {
        $count = count($codes[$ldat[0]]);
        if (in_array('', $codes[$ldat[0]])) {
            $count--;
        }