Пример #1
0
function update_70x_to_706($type = '')
{
    global $sql, $ns, $pref, $e107info, $admin_log, $emessage;
    $just_check = $type == 'do' ? FALSE : TRUE;
    if (!$sql->db_Field("plugin", 5)) {
        if ($just_check) {
            return update_needed();
        }
        $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "plugin` ADD `plugin_addons` TEXT NOT NULL ;");
        catch_error($sql);
    }
    //rename plugin_rss field
    if ($sql->db_Field("plugin", 5) == "plugin_rss") {
        if ($just_check) {
            return update_needed();
        }
        $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "plugin` CHANGE `plugin_rss` `plugin_addons` TEXT NOT NULL;");
        catch_error($sql);
    }
    if ($sql->db_Field("dblog", 5) == "dblog_query") {
        if ($just_check) {
            return update_needed();
        }
        $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "dblog` CHANGE `dblog_query` `dblog_title` VARCHAR( 255 ) NOT NULL DEFAULT '';");
        catch_error($sql);
        $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "dblog` CHANGE `dblog_remarks` `dblog_remarks` TEXT NOT NULL;");
        catch_error($sql);
    }
    if (!$sql->db_Field("plugin", "plugin_path", "UNIQUE")) {
        if ($just_check) {
            return update_needed();
        }
        if (!$sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "plugin` ADD UNIQUE (`plugin_path`);")) {
            $mesg = LAN_UPDATE_12 . " : <a href='" . e_ADMIN . "db.php?plugin'>" . ADLAN_145 . "</a>.";
            //$ns -> tablerender(LAN_ERROR,$mes);
            $emessage->add($mesg, E_MESSAGE_ERROR);
            catch_error($sql);
        }
    }
    if (!$sql->db_Field("online", 6)) {
        if ($just_check) {
            return update_needed();
        }
        $sql->db_Select_gen("ALTER TABLE " . MPREFIX . "online ADD online_active INT(10) UNSIGNED NOT NULL DEFAULT '0'");
        catch_error($sql);
    }
    if ($sql->db_Query("SHOW INDEX FROM " . MPREFIX . "tmp")) {
        $row = $sql->db_Fetch();
        if (!in_array('tmp_ip', $row)) {
            if ($just_check) {
                return update_needed();
            }
            $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "tmp` ADD INDEX `tmp_ip` (`tmp_ip`);");
            $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "upload` ADD INDEX `upload_active` (`upload_active`);");
            $sql->db_Select_gen("ALTER TABLE `" . MPREFIX . "generic` ADD INDEX `gen_type` (`gen_type`);");
        }
    }
    if (!$just_check) {
        // update new fields
        require_once e_HANDLER . "plugin_class.php";
        $ep = new e107plugin();
        $ep->update_plugins_table('update');
        $ep->save_addon_prefs('update');
    }
    if (!isset($pref['displayname_maxlength'])) {
        if ($just_check) {
            return update_needed();
        }
        $pref['displayname_maxlength'] = 15;
        save_prefs();
    }
    // If we get to here, in checking mode no updates are required. In update mode, all done.
    if ($just_check) {
        return TRUE;
    }
    e107::getLog()->add('UPDATE_02', LAN_UPDATE_14 . $e107info['e107_version'], E_LOG_INFORMATIVE, '');
    // Log result of actual update
    return $just_check;
    // TRUE if no updates needed, FALSE if updates needed and completed
}
Пример #2
0
<?php

include_once $_SERVER['DOCUMENT_ROOT'] . '/202-config/connect.php';
AUTH::require_user();
//check if its the latest verison
$_SESSION['update_needed'] = update_needed();
//check to see if this user has stats202 enabled
$_SESSION['stats202_enabled'] = AUTH::is_valid_app_key('stats202', $_SESSION['user_api_key'], $_SESSION['user_stats202_app_key']);
template_top();
?>

<div class="slim">
		<div class="welcome">
			<table cellspacing="0" cellpadding="0" class="section">
				<tr>
					<td class="left" ><h2>Sponsor <a href="http://prosper202.com/advertise/" style="font-size: 10px;">(advertise)</span></h2></td>
					<td><hr></td>
				</tr> 
			</table>
			<p><iframe class="advertise" src="http://prosper202.com/ads/prosper202/" scrolling="no" frameborder="0"></iframe></p> 
			
			<table cellspacing="0" cellpadding="0" class="section">
				<tr>
					<td class="left" ><h2>Prosper202 Development Blog</h2></td>
					<td><hr></td>
				</tr>
			</table><?php 
$rss = fetch_rss('http://prosper202.com/blog/rss/');
if (isset($rss->items) && 0 != count($rss->items)) {
    $rss->items = array_slice($rss->items, 0, 5);
    foreach ($rss->items as $item) {