$i++;
        if ($i < $num_rows) {
            $output .= ",\n";
        } else {
            $output .= "\n";
        }
    }
    $output .= ");\n\n";
    $output .= "\$" . "category_plain = array(\n0 => ''";
    $output .= search_cats(0, 0);
    $output .= ");\n?>";
    $handle = fopen($main_path . 'language/' . $language . '/categories.inc.php', 'w');
    fputs($handle, $output);
    fclose($handle);
}
if (isset($_POST['categories'])) {
    rebuild_cat_file($_POST['categories']);
    include 'util_cc1.php';
}
include $main_path . 'language/' . $language . '/categories.inc.php';
$query = "SELECT cat_id, cat_name FROM " . $DBPrefix . "categories ORDER BY cat_name";
$db->direct_query($query);
$bg = '';
while ($row = $db->fetch()) {
    // set category data
    $template->assign_block_vars('cats', array('CAT_ID' => $row['cat_id'], 'CAT_NAME' => $system->uncleanvars($row['cat_name']), 'TRAN_CAT' => $category_names[$row['cat_id']], 'BG' => $bg));
    $bg = $bg == '' ? 'class="bg"' : '';
}
$template->assign_vars(array('ERROR' => isset($ERR) ? $ERR : '', 'SITEURL' => $system->SETTINGS['siteurl']));
$template->set_filenames(array('body' => 'categoriestrans.tpl'));
$template->display('body');
Example #2
0
        echo '<b>' . $query[$i] . '</b><br>';
    }
    if ($myversion == $thisversion) {
        echo 'Complete, now to <b><a href="?step=3">step 3</a></b>';
    } else {
        echo '<script type="text/javascript">window.location = "?step=2";</script>';
        echo '<noscript>Javascript is disabled please <a href="?step=2">refresh the page</a></noscript>';
    }
}
if ($step == 3) {
    $check = check_installation();
    $thisversion = this_version();
    $myversion = check_version();
    if (!$check) {
        echo print_header(true);
        echo '<p>It seems you don\'t currently have a version of WeBid installed we recommend you do a <b><a href="install.php">fresh install</a></b></p>';
        exit;
    }
    include $main_path . 'common.php';
    echo print_header(true);
    include $include_path . 'functions_rebuild.inc.php';
    echo '<p>Rebuilding membertypes...</p>';
    rebuild_table_file('membertypes');
    echo '<p>Rebuilding countries...</p>';
    rebuild_html_file('countries');
    echo '<p>Rebuilding categories...</p>';
    $catscontrol = new MPTTcategories();
    rebuild_cat_file();
    include $main_path . 'admin/util_cc1.php';
    echo '<p>Update almost complete, remove the install folder from your server to complete the upgrade</p>';
}