当前位置: 首页>>代码示例>>PHP>>正文


PHP DB_getItem函数代码示例

本文整理汇总了PHP中DB_getItem函数的典型用法代码示例。如果您正苦于以下问题:PHP DB_getItem函数的具体用法?PHP DB_getItem怎么用?PHP DB_getItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DB_getItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: MG_editUser

function MG_editUser($uid)
{
    global $_CONF, $_MG_CONF, $_TABLES, $_USER, $LANG_MG00, $LANG_MG01;
    $retval = '';
    $active = 0;
    $quota = 0;
    $username = DB_getItem($_TABLES['users'], 'username', "uid=" . $uid);
    $result = DB_query("SELECT active,quota FROM {$_TABLES['mg_userprefs']} WHERE uid=" . $uid);
    $nRows = DB_numRows($result);
    if ($nRows > 0) {
        $row = DB_fetchArray($result);
        $active = $row['active'];
        $quota = $row['quota'] / 1048576;
    } else {
        $active = 1;
        $quota = $_MG_CONF['member_quota'] / 1048576;
    }
    $T = new Template($_MG_CONF['template_path'] . '/admin');
    $T->set_file('admin', 'useredit.thtml');
    $T->set_var('site_url', $_CONF['site_url']);
    $T->set_var('site_admin_url', $_CONF['site_admin_url']);
    $active_select = '<input type="checkbox" name="active" value="1" ' . ($active ? ' CHECKED' : '') . '/>';
    $T->set_var(array('s_form_action' => $_MG_CONF['admin_url'] . 'edituser.php', 'lang_user_edit' => $LANG_MG01['edit_user'], 'lang_username' => $LANG_MG01['username'], 'lang_active' => $LANG_MG01['active'], 'lang_quota' => $LANG_MG01['quota'], 'lang_save' => $LANG_MG01['save'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_reset' => $LANG_MG01['reset'], 'lang_unlimited' => $LANG_MG01['zero_unlimited'], 'uid' => $uid, 'active' => $active_select, 'quota' => $quota, 'username' => $username));
    $T->parse('output', 'admin');
    $retval .= $T->finish($T->get_var('output'));
    return $retval;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:27,代码来源:edituser.php

示例2: polls_upgrade

function polls_upgrade()
{
    global $_TABLES, $_CONF, $_PO_CONF;
    $currentVersion = DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='polls'");
    switch ($currentVersion) {
        case '2.0.0':
        case '2.0.1':
        case '2.0.2':
        case '2.0.3':
        case '2.0.4':
        case '2.0.5':
        case '2.0.6':
        case '2.0.7':
        case '2.0.8':
        case '2.0.9':
        case '2.1.0':
            $c = config::get_instance();
            $c->add('displayblocks', 0, 'select', 0, 0, 13, 85, true, 'polls');
        case '2.1.1':
            DB_query("ALTER TABLE {$_TABLES['pollanswers']} CHANGE `pid` `pid` VARCHAR(128) NOT NULL DEFAULT '';", 1);
            DB_query("ALTER TABLE {$_TABLES['pollquestions']} CHANGE `pid` `pid` VARCHAR(128) NOT NULL;", 1);
            DB_query("ALTER TABLE {$_TABLES['polltopics']} CHANGE `pid` `pid` VARCHAR(128) NOT NULL;", 1);
            DB_query("ALTER TABLE {$_TABLES['pollvoters']} CHANGE `pid` `pid` VARCHAR(128) NOT NULL DEFAULT '';", 1);
        default:
            DB_query("UPDATE {$_TABLES['plugins']} SET pi_version='" . $_PO_CONF['pi_version'] . "',pi_gl_version='" . $_PO_CONF['gl_version'] . "' WHERE pi_name='polls' LIMIT 1");
            break;
    }
    if (DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='polls'") == $_PO_CONF['pi_version']) {
        return true;
    } else {
        return false;
    }
}
开发者ID:JohnToro,项目名称:glfusion,代码行数:33,代码来源:upgrade.php

示例3: selectHTML_forum

function selectHTML_forum($selected = '')
{
    global $_CONF, $_TABLES;
    $selectHTML = '';
    $asql = DB_query("SELECT * FROM {$_TABLES['forum_categories']} ORDER BY cat_order ASC");
    while ($A = DB_fetchArray($asql)) {
        $firstforum = true;
        $bsql = DB_query("SELECT * FROM {$_TABLES['forum_forums']} WHERE forum_cat='{$A['id']}' ORDER BY forum_order ASC");
        while ($B = DB_fetchArray($bsql)) {
            $groupname = DB_getItem($_TABLES['groups'], 'grp_name', "grp_id='{$B['grp_id']}'");
            if (SEC_inGroup($groupname)) {
                if ($firstforum) {
                    $selectHTML .= '<option value="-1">-------------------</option>';
                    $selectHTML .= '<option value="-1">' . $A['cat_name'] . '</option>';
                }
                $firstforum = false;
                if ($B['forum_id'] == $selected) {
                    $selectHTML .= LB . '<option value="' . $B['forum_id'] . '" selected="selected">&nbsp;&#187;&nbsp;&nbsp;' . $B['forum_name'] . '</option>';
                } else {
                    $selectHTML .= LB . '<option value="' . $B['forum_id'] . '">&nbsp;&#187;&nbsp;&nbsp;' . $B['forum_name'] . '</option>';
                }
            }
        }
    }
    return $selectHTML;
}
开发者ID:ivywe,项目名称:forum,代码行数:26,代码来源:messages.php

示例4: staticpages_upgrade

function staticpages_upgrade()
{
    global $_TABLES, $_CONF, $_SP_CONF;
    $currentVersion = DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='staticpages'");
    require_once $_CONF['path_system'] . 'classes/config.class.php';
    $c = config::get_instance();
    switch ($currentVersion) {
        case '1.5.0':
            $rc = update_150_to_151();
        case '1.5.1':
        case '1.5.2':
        case '1.5.3':
            DB_query("ALTER TABLE {$_TABLES['staticpage']} ADD sp_search tinyint(4) NOT NULL default '1' AFTER postmode", 1);
        case '1.5.4':
            DB_query("ALTER TABLE {$_TABLES['staticpage']} ADD sp_status tinyint(3) NOT NULL DEFAULT '1' AFTER sp_id");
            // static pages configuration options
            $c->add('include_search', 1, 'select', 0, 0, 0, 95, true, 'staticpages');
            $c->add('comment_code', -1, 'select', 0, 0, 17, 97, true, 'staticpages');
            $c->add('status_flag', 1, 'select', 0, 0, 13, 99, true, 'staticpages');
        case '1.6.0':
            DB_query("ALTER TABLE {$_TABLES['staticpage']} CHANGE `sp_tid` `sp_tid` VARCHAR(128) NOT NULL DEFAULT 'none';", 1);
        default:
            DB_query("UPDATE {$_TABLES['plugins']} SET pi_version='" . $_SP_CONF['pi_version'] . "',pi_gl_version='" . $_SP_CONF['gl_version'] . "' WHERE pi_name='staticpages' LIMIT 1");
            break;
    }
    if (DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='staticpages'") == $_SP_CONF['pi_version']) {
        return true;
    } else {
        return false;
    }
}
开发者ID:NewRoute,项目名称:glfusion,代码行数:31,代码来源:upgrade.php

示例5: zero_upgrade

function zero_upgrade()
{
    global $_TABLES, $_CONF, $_ZZ_CONF, $_DB_table_prefix;
    $currentVersion = DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='zero'");
    switch ($currentVersion) {
        case '0.0.5':
            $_SQL['widgets'] = "CREATE TABLE IF NOT EXISTS {$_TABLES['widgets']} (\n                widget_id mediumint(8) NOT NULL auto_increment,\n                widget_desc varchar(64) NOT NULL default '',\n                PRIMARY KEY (widget_id)\n                ) TYPE=MyISAM;";
            DB_query($_SQL['widgets'], 1);
        case '0.0.6':
            $_SQL['gadgets'] = "CREATE TABLE IF NOT EXISTS {$_TABLES['gadgets']} (\n                gadget_id mediumint(8) NOT NULL auto_increment,\n                gadget_desc varchar(64) NOT NULL default '',\n                PRIMARY KEY (gadget_id)\n                ) TYPE=MyISAM;";
            DB_query($_SQL['gadgets'], 1);
            // you should really list a case for each version you release, however
            // the default case is the catch-all, which just updates pi_version to
            // match the current code version
        // you should really list a case for each version you release, however
        // the default case is the catch-all, which just updates pi_version to
        // match the current code version
        case '1.0.0':
        case '1.1.0':
        case '1.1.1':
        case '1.1.2':
        default:
            DB_query("UPDATE {$_TABLES['plugins']} SET pi_version='{$_ZZ_CONF['pi_version']}',pi_gl_version='{$_ZZ_CONF['pi_gl_version']}' WHERE pi_name='zero' LIMIT 1");
            break;
    }
    // clear the template cache because this plugin may create changes
    CTL_clearCache();
    // if upgrade succeeded, the plugin version in the plugins table will match
    // the version of the currently installed plugin
    return DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='zero'") == $_ZZ_CONF['pi_version'];
}
开发者ID:glFusion,项目名称:zero,代码行数:31,代码来源:upgrade.php

示例6: calendar_upgrade

function calendar_upgrade()
{
    global $_TABLES, $_CONF, $_CA_CONF;
    $currentVersion = DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='calendar'");
    switch ($currentVersion) {
        case '1.0.2':
            // add new configuration option
            $c = config::get_instance();
            $c->add('only_admin_submit', 0, 'select', 0, 0, 0, 15, true, 'calendar');
        case '1.0.3':
        case '1.0.4':
        case '1.0.5':
            DB_query("ALTER TABLE {$_TABLES['eventsubmission']} ADD  owner_id MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '1' AFTER url");
        case '1.0.6':
            $c = config::get_instance();
            $c->add('displayblocks', 0, 'select', 0, 0, 13, 115, true, 'calendar');
            // allow events to be enabled/disabled
            DB_query("ALTER TABLE {$_TABLES['events']} ADD status tinyint(3) NOT NULL DEFAULT '1' AFTER eid");
            DB_query("ALTER TABLE {$_TABLES['eventsubmission']} ADD status tinyint(3) NOT NULL DEFAULT '1' AFTER eid");
            DB_query("ALTER TABLE {$_TABLES['personal_events']} ADD status tinyint(3) NOT NULL DEFAULT '1' AFTER eid");
        default:
            DB_query("UPDATE {$_TABLES['plugins']} SET pi_version='" . $_CA_CONF['pi_version'] . "',pi_gl_version='" . $_CA_CONF['gl_version'] . "' WHERE pi_name='calendar' LIMIT 1");
            break;
    }
    if (DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='calendar'") == $_CA_CONF['pi_version']) {
        return true;
    } else {
        return false;
    }
}
开发者ID:spacequad,项目名称:glfusion,代码行数:30,代码来源:upgrade.php

示例7: CUSTOM_multilangstory

/**
 * sidに対応する多言語記事が存在する場合はその記事へのリンクを作成し返す関数
 *   $sid : story id
 *   --------------
 *   return : 多言語記事へのリンク
**/
function CUSTOM_multilangstory($sid)
{
    global $_CONF, $_TABLES;
    $retval = '';
    if (empty($_CONF['languages']) || empty($_CONF['language_files']) || count($_CONF['languages']) != count($_CONF['language_files'])) {
        return $retval;
    }
    $work = split('_', $sid);
    $cur_lang = array_pop($work);
    if (empty($cur_lang) || !array_key_exists($cur_lang, $_CONF['languages'])) {
        return $retval;
    }
    $entries = array();
    $mini_sid = implode('_', $work);
    foreach ($_CONF['languages'] as $key => $value) {
        if ($cur_lang != $key) {
            $mul_sid = DB_getItem($_TABLES['stories'], 'sid', 'sid="' . $mini_sid . '_' . $key . '"');
            if (!empty($mul_sid)) {
                $url = COM_buildUrl($_CONF['site_url'] . '/article.php?story=' . $mul_sid);
                $entries[] = '<a href="' . $url . '">' . $value . '</a>';
            }
        }
    }
    if (sizeof($entries) > 0) {
        $retval .= COM_makeList($entries);
    }
    return $retval;
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:34,代码来源:custom_multilangstory.php

示例8: __construct

 /**
  * Constructor
  *
  * @param $options   array
  */
 public function __construct($options = array())
 {
     global $_TABLES;
     parent::__construct($options);
     $pi_version = DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name = 'staticpages'");
     $this->_isSP162 = version_compare($pi_version, '1.6.2') >= 0;
 }
开发者ID:milk54,项目名称:geeklog-japan,代码行数:12,代码来源:staticpages.class.php

示例9: polls_update_ConfValues_2_1_3

function polls_update_ConfValues_2_1_3()
{
    global $_CONF, $_PO_DEFAULT, $_PO_CONF, $_GROUPS, $_TABLES;
    require_once $_CONF['path_system'] . 'classes/config.class.php';
    $c = config::get_instance();
    require_once $_CONF['path'] . 'plugins/polls/install_defaults.php';
    $c->add('tab_poll_block', NULL, 'tab', 0, 20, NULL, 0, true, 'polls', 20);
    $c->add('fs_block_settings', NULL, 'fieldset', 0, 10, NULL, 0, true, 'polls', 20);
    $c->add('block_enable', $_PO_DEFAULT['block_enable'], 'select', 0, 10, 0, 10, true, 'polls', 20);
    $c->add('block_isleft', $_PO_DEFAULT['block_isleft'], 'select', 0, 10, 0, 20, true, 'polls', 20);
    $c->add('block_order', $_PO_DEFAULT['block_order'], 'text', 0, 10, 0, 30, true, 'polls', 20);
    $c->add('block_topic_option', $_PO_DEFAULT['block_topic_option'], 'select', 0, 10, 15, 40, true, 'polls', 20);
    $c->add('block_topic', $_PO_DEFAULT['block_topic'], '%select', 0, 10, NULL, 50, true, 'polls', 20);
    $c->add('fs_block_permissions', NULL, 'fieldset', 0, 20, NULL, 0, true, 'polls', 20);
    $new_group_id = 0;
    if (isset($_GROUPS['Polls Admin'])) {
        $new_group_id = $_GROUPS['Polls Admin'];
    } else {
        $new_group_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Polls Admin'");
        if ($new_group_id == 0) {
            if (isset($_GROUPS['Root'])) {
                $new_group_id = $_GROUPS['Root'];
            } else {
                $new_group_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Root'");
            }
        }
    }
    $c->add('block_group_id', $new_group_id, 'select', 0, 20, NULL, 10, TRUE, 'polls', 20);
    $c->add('block_permissions', $_PO_DEFAULT['block_permissions'], '@select', 0, 20, 14, 20, true, 'polls', 20);
    return true;
}
开发者ID:milk54,项目名称:geeklog-japan,代码行数:31,代码来源:install_updates.php

示例10: spamx_upgrade

function spamx_upgrade()
{
    global $_TABLES, $_CONF, $_SPX_CONF;
    $currentVersion = DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='spamx'");
    switch ($currentVersion) {
        case '1.1.0':
        case '1.1.1':
        case '1.1.2':
        case '1.1.3':
        case '1.1.4':
        case '1.1.5':
        case '1.1.6':
        case '1.1.7':
        case '1.1.8':
        case '1.1.9':
        case '1.2.0':
            $c = config::get_instance();
            $c->add('fs_sfs', NULL, 'fieldset', 0, 1, NULL, 0, true, 'spamx');
            $c->add('sfs_username_check', false, 'select', 0, 1, 1, 10, true, 'spamx');
            $c->add('sfs_email_check', true, 'select', 0, 1, 1, 20, true, 'spamx');
            $c->add('sfs_ip_check', true, 'select', 0, 1, 1, 30, true, 'spamx');
            $c->add('sfs_username_confidence', '99.00', 'text', 0, 1, 1, 40, true, 'spamx');
            $c->add('sfs_email_confidence', '50.00', 'text', 0, 1, 1, 50, true, 'spamx');
            $c->add('sfs_ip_confidence', '25.00', 'text', 0, 1, 1, 60, true, 'spamx');
        default:
            DB_query("UPDATE {$_TABLES['plugins']} SET pi_version='" . $_SPX_CONF['pi_version'] . "',pi_gl_version='" . $_SPX_CONF['gl_version'] . "' WHERE pi_name='spamx' LIMIT 1");
            break;
    }
    if (DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='spamx'") == $_SPX_CONF['pi_version']) {
        return true;
    } else {
        return false;
    }
}
开发者ID:NewRoute,项目名称:glfusion,代码行数:34,代码来源:upgrade.php

示例11: nf_check4files

function nf_check4files($projectid, $taskid, $fieldname)
{
    global $_FILES, $_CONF, $_TABLES, $_USER, $CONF_NF, $LANG_GF00;
    $errmsg = '';
    $uploadfile = $_FILES[$fieldname];
    // Check if there is a request to delete any attachments
    if (isset($_POST['chk_removeattachment'])) {
        foreach ($_POST['chk_removeattachment'] as $id) {
            $filename = DB_getItem($_TABLES['nf_projectattachments'], 'filename', "id={$id}");
            $parts = explode(':', $filename);
            COM_errorLog("{$CONF_NF['uploadpath']}/{$parts[0]}");
            DB_query("DELETE FROM {$_TABLES['nf_projectattachments']} WHERE id={$id}");
            @unlink("{$CONF_NF['uploadpath']}/{$parts[0]}");
        }
    }
    if ($uploadfile['name'] != '') {
        $uploadfilename = ppRandomFilename();
        $pos = strrpos($uploadfile['name'], '.') + 1;
        $ext = strtolower(substr($uploadfile['name'], $pos));
        $filename = "{$uploadfilename}.{$ext}";
        COM_errorlog("Workflow file upload: Original file: {$uploadfile['name']} and new filename: {$filename}");
        $filestore_path = $CONF_NF['uploadpath'];
        if (nf_uploadfile($filename, $uploadfile, $CONF_NF['allowablefiletypes'], $filestore_path)) {
            // Store both the created filename and the real file source filename
            $filename = "{$filename}:{$uploadfile['name']}";
            DB_query("INSERT INTO {$_TABLES['nf_projectattachments']} (project_id,task_id,fieldname,filename)\r\n                    VALUES ({$projectid},{$taskid},'{$fieldname}','{$filename}')");
        } else {
            COM_errorlog("upload error:" . $GLOBALS['nf_errmsg']);
            $errmsg = $GLOBALS['nf_errmsg'];
        }
    }
    return $errmsg;
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:33,代码来源:libuploadfiles.php

示例12: MG_displaySessions

function MG_displaySessions()
{
    global $_CONF, $_MG_CONF, $_TABLES, $_USER, $LANG_MG00, $LANG_MG01;
    $retval = '';
    $T = new Template($_MG_CONF['template_path'] . '/admin');
    $T->set_file(array('sessions' => 'sessions.thtml', 'empty' => 'sess_noitems.thtml', 'sessitems' => 'sessitems.thtml'));
    $T->set_var(array('site_url' => $_CONF['site_url'], 'lang_select' => $LANG_MG01['select'], 'lang_checkall' => $LANG_MG01['check_all'], 'lang_uncheckall' => $LANG_MG01['uncheck_all']));
    $sql = "SELECT * FROM {$_TABLES['mg_sessions']} WHERE session_status=1";
    $result = DB_query($sql);
    $numRows = DB_numRows($result);
    $rowclass = 0;
    if ($numRows == 0) {
        // we have no active sessions
        $T->set_var(array('lang_no_sessions' => $LANG_MG01['no_sessions']));
        $T->parse('noitems', 'empty');
    } else {
        $totalSess = $numRows;
        $T->set_block('sessitems', 'sessRow', 'sRow');
        for ($x = 0; $x < $numRows; $x++) {
            $row = DB_fetchArray($result);
            $res2 = DB_query("SELECT COUNT(id) FROM {$_TABLES['mg_session_items']} WHERE session_id='" . $row['session_id'] . "' AND status=0");
            list($count) = DB_fetchArray($res2);
            $T->set_var(array('row_class' => $rowclass % 2 ? '1' : '2', 'session_id' => $row['session_id'], 'session_owner' => DB_getItem($_TABLES['users'], 'username', "uid={$row['session_uid']}"), 'session_description' => $row['session_description'], 'session_continue' => $_MG_CONF['site_url'] . '/batch.php?mode=continue&amp;sid=' . $row['session_id'], 'count' => $count));
            $T->parse('sRow', 'sessRow', true);
            $rowclass++;
        }
        $T->parse('sessitems', 'sessitems');
    }
    $T->set_var(array('s_form_action' => $_MG_CONF['admin_url'] . 'sessions.php', 'mode' => 'sessions', 'lang_category_manage_help' => $LANG_MG01['category_manage_help'], 'lang_catid' => $LANG_MG01['cat_id'], 'lang_cat_name' => $LANG_MG01['cat_name'], 'lang_cat_description' => $LANG_MG01['cat_description'], 'lang_save' => $LANG_MG01['save'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_delete' => $LANG_MG01['delete'], 'lang_select' => $LANG_MG01['select'], 'lang_checkall' => $LANG_MG01['check_all'], 'lang_uncheckall' => $LANG_MG01['uncheck_all'], 'lang_session_id' => $LANG_MG01['cat_id'], 'lang_session_description' => $LANG_MG01['description'], 'lang_session_owner' => $LANG_MG01['owner'], 'lang_session_count' => $LANG_MG01['count'], 'lang_action' => $LANG_MG01['action']));
    $T->parse('output', 'sessions');
    $retval .= $T->finish($T->get_var('output'));
    return $retval;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:33,代码来源:sessions.php

示例13: links_upgrade

function links_upgrade()
{
    global $_TABLES, $_CONF, $_LI_CONF;
    $currentVersion = DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='links'");
    switch ($currentVersion) {
        case '2.0.0':
        case '2.0.1':
            $c = config::get_instance();
            $c->add('target_blank', FALSE, 'select', 0, 1, 0, 55, true, 'links');
        case '2.0.2':
        case '2.0.3':
        case '2.0.4':
        case '2.0.5':
        case '2.0.6':
        case '2.0.7':
        case '2.0.8':
        case '2.0.9':
        case '2.1.0':
        case '2.1.1':
        case '2.1.2':
            $c = config::get_instance();
            $c->add('displayblocks', 0, 'select', 0, 0, 13, 60, true, 'links');
        case '2.1.3':
        case '2.1.4':
        default:
            DB_query("UPDATE {$_TABLES['plugins']} SET pi_version='" . $_LI_CONF['pi_version'] . "',pi_gl_version='" . $_LI_CONF['gl_version'] . "' WHERE pi_name='links' LIMIT 1");
            break;
    }
    if (DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name='links'") == $_LI_CONF['pi_version']) {
        return true;
    } else {
        return false;
    }
}
开发者ID:NewRoute,项目名称:glfusion,代码行数:34,代码来源:upgrade.php

示例14: upgrade_plugins_141

function upgrade_plugins_141()
{
    global $_TABLES;
    if (DB_count($_TABLES['plugins'], 'pi_name', 'links') == 1) {
        DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '1.0.1', pi_gl_version = '1.4.1' WHERE pi_name = 'links'");
    }
    // add remarks-field to polls
    if (DB_count($_TABLES['plugins'], 'pi_name', 'polls') == 1) {
        DB_query("ALTER TABLE {$_TABLES['pollanswers']} ADD remark varchar(255) NULL AFTER votes");
        DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '1.1.0', pi_gl_version = '1.4.1' WHERE pi_name = 'polls'");
    }
    if (DB_count($_TABLES['plugins'], 'pi_name', 'spamx') == 1) {
        // delete MT-Blacklist entries from Spam-X plugin
        DB_query("DELETE FROM {$_TABLES['spamx']} WHERE name = 'MTBlacklist'");
        // the count of deleted spams was introduced in 1.4.0 but not added
        // when upgrading from an older database, so add it now if it's missing
        $val = DB_getItem($_TABLES['vars'], 'value', "name = 'spamx.counter'");
        if (empty($val)) {
            DB_save($_TABLES['vars'], 'name,value', "'spamx.counter','0'");
        }
        DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '1.1.0', pi_gl_version = '1.4.1' WHERE pi_name = 'spamx'");
    }
    // add field to support advanced editor and a help link in staticpages
    if (DB_count($_TABLES['plugins'], 'pi_name', 'staticpages') == 1) {
        DB_query("ALTER TABLE {$_TABLES['staticpage']} ADD postmode varchar(16) DEFAULT 'html' NOT NULL AFTER sp_inblock");
        DB_query("ALTER TABLE {$_TABLES['staticpage']} ADD sp_help varchar(255) default '' AFTER sp_centerblock");
        DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '1.4.3', pi_gl_version = '1.4.1' WHERE pi_name = 'staticpages'");
    }
}
开发者ID:Geeklog-Core,项目名称:geeklog,代码行数:29,代码来源:mysql_1.4.0_to_1.4.1.php

示例15: plugin_load_configuration_classifieds

/**
*   Loads the configuration records for the Online Config Manager.
*
*   @return boolean     True = proceed with install, false = an error occured
*/
function plugin_load_configuration_classifieds()
{
    global $_CONF, $_CONF_ADVT, $_TABLES;
    require_once CLASSIFIEDS_PI_PATH . '/install_defaults.php';
    // Get the admin group ID that was saved previously.
    $group_id = (int) DB_getItem($_TABLES['groups'], 'grp_id', "grp_name='{$_CONF_ADVT['pi_name']} Admin'");
    return plugin_initconfig_classifieds($group_id);
}
开发者ID:NewRoute,项目名称:classifieds,代码行数:13,代码来源:autoinstall.php


注:本文中的DB_getItem函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。