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


PHP DB_delete函数代码示例

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


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

示例1: plugin_install_captcha

function plugin_install_captcha()
{
    global $pi_name, $pi_version, $gl_version, $pi_url, $NEWTABLE, $DEFVALUES, $NEWFEATURE;
    global $_TABLES, $_CONF, $LANG_CP00, $_DB_dbms;
    COM_errorLog("Attempting to install the {$pi_name} Plugin", 1);
    $_SQL['cp_config'] = "CREATE TABLE {$_TABLES['cp_config']} ( " . "  `config_name` varchar(255) NOT NULL default '', " . "  `config_value` varchar(255) NOT NULL default '', " . "   PRIMARY KEY  (`config_name`) " . " );";
    $_SQL['cp_sessions'] = "CREATE TABLE {$_TABLES['cp_sessions']} ( " . "  `session_id` varchar(40) NOT NULL default '', " . "  `cptime`  INT(11) NOT NULL default 0, " . "  `validation` varchar(40) NOT NULL default '', " . "  `counter`    TINYINT(4) NOT NULL default 0, " . "  PRIMARY KEY (`session_id`) " . " );";
    foreach ($_SQL as $table => $sql) {
        COM_errorLog("Creating {$table} table", 1);
        DB_query($sql, 1);
        if (DB_error()) {
            COM_errorLog("Error Creating {$table} table", 1);
            plugin_uninstall_captcha();
            return false;
            exit;
        }
        COM_errorLog("Success - Created {$table} table", 1);
    }
    $SQL_DEFAULTS = "INSERT INTO `{$_TABLES['cp_config']}` (`config_name`, `config_value`) VALUES " . " ('anonymous_only', '1'), " . " ('remoteusers','0'), " . " ('debug', '0'), " . " ('enable_comment', '0'), " . " ('enable_contact', '0'), " . " ('enable_emailstory', '0'), " . " ('enable_forum', '0'), " . " ('enable_registration', '0'), " . " ('enable_story', '0'), " . " ('gfxDriver', '2'), " . " ('gfxFormat', 'jpg'), " . " ('gfxPath', '');";
    DB_query($SQL_DEFAULTS, 1);
    // Register the plugin with Geeklog
    COM_errorLog("Registering {$pi_name} plugin with Geeklog", 1);
    DB_delete($_TABLES['plugins'], 'pi_name', 'captcha');
    DB_query("INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_homepage, pi_enabled) " . "VALUES ('{$pi_name}', '{$pi_version}', '{$gl_version}', '{$pi_url}', 1)");
    if (DB_error()) {
        COM_errorLog("Failure registering plugin with Geeklog");
        plugin_uninstall_captcha();
        return false;
        exit;
    }
    // Create initial log entry
    CAPTCHA_errorLog("CAPTCHA Plugin Successfully Installed");
    COM_errorLog("Successfully installed the {$pi_name} Plugin!", 1);
    return true;
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:35,代码来源:install.php

示例2: display

 /**
  * Constructor
  */
 function display()
 {
     global $_CONF, $_TABLES, $LANG_SX00;
     $action = '';
     if (isset($_GET['action'])) {
         $action = $_GET['action'];
     } elseif (isset($_POST['paction'])) {
         $action = $_POST['paction'];
     }
     if ($action == 'delete' && SEC_checkToken()) {
         $entry = $_GET['entry'];
         if (!empty($entry)) {
             $dbentry = addslashes($entry);
             DB_delete($_TABLES['spamx'], array('name', 'value'), array('HTTPHeader', $dbentry));
         }
     } elseif ($action == $LANG_SX00['addentry'] && SEC_checkToken()) {
         $entry = '';
         $name = COM_applyFilter($_REQUEST['header-name']);
         $n = explode(':', $name);
         $name = $n[0];
         $value = $_REQUEST['header-value'];
         if (!empty($name) && !empty($value)) {
             $entry = $name . ': ' . $value;
         }
         $dbentry = addslashes($entry);
         if (!empty($entry)) {
             $result = DB_query("INSERT INTO {$_TABLES['spamx']} VALUES ('HTTPHeader','{$dbentry}')");
         }
     }
     $token = SEC_createToken();
     $display = '<hr' . XHTML . '>' . LB . '<p><b>';
     $display .= $LANG_SX00['headerblack'];
     $display .= '</b></p>' . LB . '<ul>' . LB;
     $result = DB_query("SELECT value FROM {$_TABLES['spamx']} WHERE name='HTTPHeader' ORDER BY value");
     $nrows = DB_numRows($result);
     for ($i = 0; $i < $nrows; $i++) {
         list($e) = DB_fetchArray($result);
         $display .= '<li>' . COM_createLink(htmlspecialchars($e), $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=EditHeader&amp;action=delete&amp;entry=' . urlencode($e) . '&amp;' . CSRF_TOKEN . '=' . $token) . '</li>' . LB;
     }
     $display .= '</ul>' . LB . '<p>' . $LANG_SX00['e1'] . '</p>' . LB;
     $display .= '<p>' . $LANG_SX00['e2'] . '</p>' . LB;
     $display .= '<form method="post" action="' . $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=EditHeader">' . LB;
     $display .= '<table border="0" width="100%">' . LB;
     $display .= '<tr><td align="right"><b>Header:</b></td>' . LB;
     $display .= '<td><input type="text" size="40" name="header-name"' . XHTML . '> e.g. <tt>User-Agent</tt></td></tr>' . LB;
     $display .= '<tr><td align="right"><b>Content:</b></td>' . LB;
     $display .= '<td><input type="text" size="40" name="header-value"' . XHTML . '> e.g. <tt>Mozilla</tt></td></tr>' . LB;
     $display .= '</table>' . LB;
     $display .= '<p><input type="submit" name="paction" value="' . $LANG_SX00['addentry'] . '"' . XHTML . '>';
     $display .= '<input type="hidden" name="' . CSRF_TOKEN . "\" value=\"{$token}\"" . XHTML . '></p>' . LB;
     $display .= '</form>' . LB;
     return $display;
 }
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:56,代码来源:EditHeader.Admin.class.php

示例3: display

 /**
  * Constructor
  */
 function display()
 {
     global $_CONF, $_TABLES, $LANG_SX00;
     $action = '';
     if (isset($_GET['action'])) {
         $action = $_GET['action'];
     } elseif (isset($_POST['paction'])) {
         $action = $_POST['paction'];
     }
     $entry = '';
     if (isset($_GET['entry'])) {
         $entry = COM_stripslashes($_GET['entry']);
     } elseif (isset($_POST['pentry'])) {
         $entry = COM_stripslashes($_POST['pentry']);
     }
     if ($action == 'delete' && SEC_checkToken()) {
         $entry = DB_escapeString($entry);
         DB_delete($_TABLES['spamx'], array('name', 'value'), array('Personal', $entry));
     } elseif ($action == $LANG_SX00['addentry'] && SEC_checkToken()) {
         if (!empty($entry)) {
             $entry = DB_escapeString($entry);
             $result = DB_query("INSERT INTO {$_TABLES['spamx']} VALUES ('Personal', '{$entry}')");
         }
     } elseif ($action == $LANG_SX00['addcen'] && SEC_checkToken()) {
         foreach ($_CONF['censorlist'] as $entry) {
             $entry = DB_escapeString($entry);
             $result = DB_query("INSERT INTO {$_TABLES['spamx']} VALUES ('Personal', '{$entry}')");
         }
     }
     $token = SEC_createToken();
     $display = '<hr' . XHTML . '>' . LB . '<p><b>';
     $display .= $LANG_SX00['pblack'];
     $display .= '</b></p>' . LB . '<ul>' . LB;
     $result = DB_query("SELECT value FROM {$_TABLES['spamx']} WHERE name = 'Personal'");
     $nrows = DB_numRows($result);
     for ($i = 0; $i < $nrows; $i++) {
         $A = DB_fetchArray($result);
         $e = $A['value'];
         $display .= '<li>' . COM_createLink(htmlspecialchars($e), $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=EditBlackList&amp;action=delete&amp;entry=' . urlencode($e) . '&amp;' . CSRF_TOKEN . '=' . $token) . '</li>' . LB;
     }
     $display .= '</ul>' . LB . '<p>' . $LANG_SX00['e1'] . '</p>' . LB;
     $display .= '<p>' . $LANG_SX00['e2'] . '</p>' . LB;
     $display .= '<form method="post" action="' . $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=EditBlackList">' . LB;
     $display .= '<div><input type="text" size="30" name="pentry"' . XHTML . '>&nbsp;&nbsp;&nbsp;';
     $display .= '<input type="submit" name="paction" value="' . $LANG_SX00['addentry'] . '"' . XHTML . '>' . LB;
     $display .= '<p>' . $LANG_SX00['e3'] . '</p>&nbsp;&nbsp;&nbsp;';
     $display .= '<input type="submit" name="paction" value="' . $LANG_SX00['addcen'] . '"' . XHTML . '>' . LB;
     $display .= '<input type="hidden" name="' . CSRF_TOKEN . "\" value=\"{$token}\"" . XHTML . '>' . LB;
     $display .= '</div></form>' . LB;
     return $display;
 }
开发者ID:NewRoute,项目名称:glfusion,代码行数:54,代码来源:EditBlackList.Admin.class.php

示例4: update_ConfValues

/**
 * Add new config options
 *
 */
function update_ConfValues()
{
    global $_CONF, $_TABLES;
    require_once $_CONF['path_system'] . 'classes/config.class.php';
    // remove pdf_enabled option; this also makes room for new search options
    DB_delete($_TABLES['conf_values'], 'name', 'pdf_enabled');
    // move num_search_results options
    DB_query("UPDATE {$_TABLES['conf_values']} SET sort_order = 651 WHERE sort_order = 670");
    // change default for num_search_results
    $thirty = addslashes(serialize(30));
    DB_query("UPDATE {$_TABLES['conf_values']} SET value = '{$thirty}', default_value = '{$thirty}' WHERE name = 'num_search_results'");
    // fix censormode dropdown
    DB_query("UPDATE {$_TABLES['conf_values']} SET selectionArray = 18 WHERE name = 'censormode'");
    $c = config::get_instance();
    // new options
    $c->add('jpeg_quality', 75, 'text', 5, 23, NULL, 1495, FALSE);
    $c->add('advanced_html', array('img' => array('width' => 1, 'height' => 1, 'src' => 1, 'align' => 1, 'valign' => 1, 'border' => 1, 'alt' => 1)), '**placeholder', 7, 34, NULL, 1721, TRUE);
    // squeeze search options between 640 (lastlogin) and 680 (loginrequired)
    $c->add('fs_search', NULL, 'fieldset', 0, 6, NULL, 0, TRUE);
    $c->add('search_style', 'google', 'select', 0, 6, 19, 644, TRUE);
    $c->add('search_limits', '10,15,25,30', 'text', 0, 6, NULL, 647, TRUE);
    // see above: $c->add('num_search_results',30,'text',0,6,NULL,651,TRUE);
    $c->add('search_show_limit', TRUE, 'select', 0, 6, 1, 654, TRUE);
    $c->add('search_show_sort', TRUE, 'select', 0, 6, 1, 658, TRUE);
    $c->add('search_show_num', TRUE, 'select', 0, 6, 1, 661, TRUE);
    $c->add('search_show_type', TRUE, 'select', 0, 6, 1, 665, TRUE);
    $c->add('search_separator', ' &gt; ', 'text', 0, 6, NULL, 668, TRUE);
    $c->add('search_def_keytype', 'phrase', 'select', 0, 6, 20, 672, TRUE);
    $c->add('search_use_fulltext', FALSE, 'hidden', 0, 6);
    // 675
    // filename mask for db backup files
    $c->add('mysqldump_filename_mask', 'geeklog_db_backup_%Y_%m_%d_%H_%M_%S.sql', 'text', 0, 5, NULL, 185, TRUE);
    // DOCTYPE declaration, for {doctype} in header.thtml
    $c->add('doctype', 'html401strict', 'select', 2, 10, 21, 195, TRUE);
    // new comment options
    $c->add('comment_edit', 0, 'select', 4, 21, 0, 1680, TRUE);
    $c->add('commentsubmission', 0, 'select', 4, 21, 0, 1682, TRUE);
    $c->add('comment_edittime', 1800, 'text', 4, 21, NULL, 1684, TRUE);
    $c->add('article_comment_close_days', 30, 'text', 4, 21, NULL, 1686, TRUE);
    $c->add('comment_close_rec_stories', 0, 'text', 4, 21, NULL, 1688, TRUE);
    $c->add('allow_reply_notifications', 0, 'select', 4, 21, 0, 1689, TRUE);
    // cookie to store name of anonymous commenters
    $c->add('cookie_anon_name', 'anon_name', 'text', 7, 30, NULL, 577, TRUE);
    // enable/disable clickable links
    $c->add('clickable_links', 1, 'select', 7, 31, 1, 1753, TRUE);
    // experimental: compress output before sending it to the browser
    $c->add('compressed_output', 0, 'select', 7, 31, 1, 1756, TRUE);
    // for the X-FRAME-OPTIONS header (Clickjacking protection)
    $c->add('frame_options', 'DENY', 'select', 7, 31, 22, 1758, TRUE);
    return true;
}
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:55,代码来源:mysql_1.5.2_to_1.6.0.php

示例5: MG_batchDeleteSession

function MG_batchDeleteSession()
{
    global $_MG_CONF, $_CONF, $_TABLES;
    if (!empty($_POST['sel'])) {
        $numItems = count($_POST['sel']);
        for ($i = 0; $i < $numItems; $i++) {
            DB_delete($_TABLES['mg_session_items'], 'session_id', $_POST['sel'][$i]);
            if (DB_error()) {
                COM_errorLog("Media Gallery Error: Error removing session items");
            }
            DB_delete($_TABLES['mg_sessions'], 'session_id', $_POST['sel'][$i]);
            if (DB_error()) {
                COM_errorLog("Media Gallery Error: Error removing session");
            }
        }
    }
    echo COM_refresh($_MG_CONF['admin_url'] . 'sessions.php');
    exit;
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:19,代码来源:sessions.php

示例6: update_ConfValues_1_6_0

/**
* Handle update to plugin version 1.6.0: introduce meta tags option
*
*/
function update_ConfValues_1_6_0()
{
    global $_CONF, $_TABLES, $_SP_DEFAULT;
    require_once $_CONF['path_system'] . 'classes/config.class.php';
    $c = config::get_instance();
    require_once $_CONF['path'] . 'plugins/staticpages/install_defaults.php';
    // meta tag config options.
    $c->add('meta_tags', $_SP_DEFAULT['meta_tags'], 'select', 0, 0, 0, 120, true, 'staticpages');
    // check for wrong Admin group name
    $wrong_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Static Pages Admin'");
    // wrong name
    if (!empty($wrong_id)) {
        $grp_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Static Page Admin'");
        // correct name
        if (empty($grp_id)) {
            // correct name not found - probably a fresh install: rename
            DB_query("UPDATE {$_TABLES['groups']} SET grp_name = 'Static Page Admin' WHERE grp_name = 'Static Pages Admin'");
        } else {
            // both names exist: delete wrong group & assignments
            DB_delete($_TABLES['access'], 'acc_grp_id', $wrong_id);
            DB_delete($_TABLES['group_assignments'], 'ug_grp_id', $wrong_id);
            DB_delete($_TABLES['group_assignments'], 'ug_main_grp_id', $wrong_id);
            DB_delete($_TABLES['groups'], 'grp_name', 'Static Pages Admin');
        }
    }
    // move Default Permissions fieldset
    DB_query("UPDATE {$_TABLES['conf_values']} SET fieldset = 3 WHERE (group_name = 'staticpages') AND (fieldset = 1)");
    // What's New Block
    $c->add('fs_whatsnew', NULL, 'fieldset', 0, 1, NULL, 0, true, 'staticpages');
    $c->add('newstaticpagesinterval', $_SP_DEFAULT['new_staticpages_interval'], 'text', 0, 1, NULL, 10, TRUE, 'staticpages');
    $c->add('hidenewstaticpages', $_SP_DEFAULT['hide_new_staticpages'], 'select', 0, 1, 0, 20, TRUE, 'staticpages');
    $c->add('title_trim_length', $_SP_DEFAULT['title_trim_length'], 'text', 0, 1, NULL, 30, TRUE, 'staticpages');
    $c->add('includecenterblocks', $_SP_DEFAULT['include_centerblocks'], 'select', 0, 1, 0, 40, TRUE, 'staticpages');
    $c->add('includephp', $_SP_DEFAULT['include_PHP'], 'select', 0, 1, 0, 50, TRUE, 'staticpages');
    // Search Results
    $c->add('fs_search', NULL, 'fieldset', 0, 2, NULL, 0, true, 'staticpages');
    $c->add('includesearch', $_SP_DEFAULT['include_search'], 'select', 0, 2, 0, 10, true, 'staticpages');
    $c->add('includesearchcenterblocks', $_SP_DEFAULT['include_search_centerblocks'], 'select', 0, 2, 0, 20, TRUE, 'staticpages');
    $c->add('includesearchphp', $_SP_DEFAULT['include_search_PHP'], 'select', 0, 2, 0, 30, TRUE, 'staticpages');
    return true;
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:45,代码来源:mssql_updates.php

示例7: deleteTopic

/**
* Delete a topic
*
* @param    string  $tid    Topic ID
* @return   string          HTML redirect
*
*/
function deleteTopic($tid)
{
    global $_CONF, $_TABLES, $_USER;
    $result = DB_query("SELECT owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['topics']} WHERE tid ='{$tid}'");
    $A = DB_fetchArray($result);
    $access = SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']);
    if ($access < 3) {
        COM_accessLog("User {$_USER['username']} tried to illegally delete topic {$tid}.");
        return COM_refresh($_CONF['site_admin_url'] . '/topic.php');
    }
    // don't delete topic blocks - assign them to 'all' and disable them
    DB_query("UPDATE {$_TABLES['blocks']} SET tid = 'all', is_enabled = 0 WHERE tid = '{$tid}'");
    // same with feeds
    DB_query("UPDATE {$_TABLES['syndication']} SET topic = '::all', is_enabled = 0 WHERE topic = '{$tid}'");
    // delete comments, trackbacks, images associated with stories in this topic
    $result = DB_query("SELECT sid FROM {$_TABLES['stories']} WHERE tid = '{$tid}'");
    $numStories = DB_numRows($result);
    for ($i = 0; $i < $numStories; $i++) {
        $A = DB_fetchArray($result);
        STORY_deleteImages($A['sid']);
        DB_delete($_TABLES['comments'], array('sid', 'type'), array($A['sid'], 'article'));
        DB_delete($_TABLES['trackback'], array('sid', 'type'), array($A['sid'], 'article'));
    }
    // delete these
    DB_delete($_TABLES['stories'], 'tid', $tid);
    DB_delete($_TABLES['storysubmission'], 'tid', $tid);
    DB_delete($_TABLES['topics'], 'tid', $tid);
    // update feed(s) and Older Stories block
    COM_rdfUpToDateCheck('article');
    COM_olderStuff();
    return COM_refresh($_CONF['site_admin_url'] . '/topic.php?msg=14');
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:39,代码来源:topic.php

示例8: INSTALLER_install

 function INSTALLER_install($A)
 {
     global $_TABLES;
     COM_errorLog("AutoInstall: **** Start Installation ****");
     if (!isset($A['installer']) or $A['installer']['version'] != INSTALLER_VERSION) {
         COM_errorLog('AutoInstall: Invalid or Unknown installer version');
         COM_errorLog("AutoInstall: **** END Installation ****");
         return 2;
     }
     if (!isset($A['plugin'])) {
         COM_errorLog("AutoInstall: Missing plugin description!");
         COM_errorLog("AutoInstall: **** END Installation ****");
         return 1;
     }
     if (!isset($A['plugin']['name'])) {
         COM_errorLog("AutoInstall: Missing plugin name!");
         COM_errorLog("AutoInstall: **** END Installation ****");
         return 1;
     }
     if (!COM_checkVersion(GVERSION, $A['plugin']['gl_ver'])) {
         COM_errorLog("AutoInstall: Plugin requires glFusion v" . $A['plugin']['gl_ver'] . " or greater");
         COM_errorLog("AutoInstall: **** END Installation ****");
         return 1;
     }
     $pluginName = $A['plugin']['name'];
     $vars = array('__groups' => array(), '__features' => array(), '__blocks' => array());
     $reverse = array();
     foreach ($A as $meta => $step) {
         if ($meta === 'installer') {
             // must use === when since 0 == 'anystring' is true
         } elseif ($meta === 'plugin') {
             if (!isset($step['name'])) {
                 COM_errorLog("AutoInstall: Missing plugin name!");
                 INSTALLER_fail($pluginName, $reverse);
                 COM_errorLog("AutoInstall: **** END Installation ****");
                 return 1;
             }
         } else {
             $function = "INSTALLER_install_{$step['type']}";
             if (function_exists($function)) {
                 $result = $function($step, $vars);
                 if (is_numeric($result)) {
                     INSTALLER_fail($pluginName, $reverse);
                     COM_errorLog("AutoInstall: **** END Installation ****");
                     return $result;
                 } else {
                     if (!empty($result)) {
                         $reverse[] = $result;
                     }
                 }
             } else {
                 $dump = var_dump($step);
                 COM_errorLog('Can\'t process step: ' . $dump);
                 INSTALLER_fail($pluginName, $reverse);
                 COM_errorLog("AutoInstall: **** END Installation ****");
                 return 1;
             }
         }
     }
     $plugin = $A['plugin'];
     $cfgFunction = 'plugin_load_configuration_' . $plugin['name'];
     // Load the online configuration records
     if (function_exists($cfgFunction)) {
         if (!$cfgFunction()) {
             COM_errorLog("AutoInstall: Failed to load the default configuration");
             INSTALLER_fail($pluginName, $reverse);
             COM_errorLog("AutoInstall: **** END Installation ****");
             return 1;
         }
     } else {
         COM_errorLog("AutoInstall: No default config found: " . $cfgFunction);
     }
     // Finally, register the plugin with glFusion
     COM_errorLog("AutoInstall: Registering {$plugin['display']} plugin with glFusion", 1);
     // silently delete an existing entry
     DB_delete($_TABLES['plugins'], 'pi_name', $plugin['name']);
     DB_query("INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_homepage, pi_enabled) " . "VALUES ('{$plugin['name']}', '{$plugin['ver']}', '{$plugin['gl_ver']}', '{$plugin['url']}', 1)", 1);
     // run any post install routines
     $postInstallFunction = 'plugin_postinstall_' . $plugin['name'];
     if (function_exists($postInstallFunction)) {
         $postInstallFunction();
     } else {
         COM_errorLog("AutoInstall: No post installation routine found.");
     }
     COM_errorLog("AutoInstall: **** END Installation ****");
     CTL_clearCache();
     return 0;
 }
开发者ID:NewRoute,项目名称:glfusion,代码行数:88,代码来源:lib-install.php

示例9: MG_mediaResetRating

function MG_mediaResetRating($album_id, $media_id, $mqueue)
{
    global $_MG_CONF, $_TABLES;
    DB_change($_TABLES['mg_media'], 'media_rating', 0, 'media_id', addslashes($media_id));
    DB_change($_TABLES['mg_media'], 'media_votes', 0, 'media_id', addslashes($media_id));
    DB_delete($_TABLES['mg_rating'], 'media_id', addslashes($media_id));
    $retval = MG_mediaEdit($album_id, $media_id, $_MG_CONF['site_url'] . '/admin.php?mode=media&amp;album_id=' . $album_id, $mqueue);
    return $retval;
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:9,代码来源:mediamanage.php

示例10: deletePoll

/**
* Delete a poll
*
* @param    string  $pid    ID of poll to delete
* @return   string          HTML redirect
*
*/
function deletePoll($pid)
{
    global $_CONF, $_TABLES, $_USER;
    $pid = addslashes($pid);
    $result = DB_query("SELECT owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['polltopics']} WHERE pid = '{$pid}'");
    $Q = DB_fetchArray($result);
    $access = SEC_hasAccess($Q['owner_id'], $Q['group_id'], $Q['perm_owner'], $Q['perm_group'], $Q['perm_members'], $Q['perm_anon']);
    if ($access < 3) {
        COM_accessLog("User {$_USER['username']} tried to illegally delete poll {$pid}.");
        return COM_refresh($_CONF['site_admin_url'] . '/plugins/polls/index.php');
    }
    DB_delete($_TABLES['polltopics'], 'pid', $pid);
    DB_delete($_TABLES['pollanswers'], 'pid', $pid);
    DB_delete($_TABLES['pollquestions'], 'pid', $pid);
    DB_delete($_TABLES['comments'], array('sid', 'type'), array($pid, 'polls'));
    PLG_itemDeleted($pid, 'polls');
    return COM_refresh($_CONF['site_admin_url'] . '/plugins/polls/index.php?msg=20');
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:25,代码来源:index.php

示例11: elseif

 } elseif (empty($version)) {
     $display .= INST_getAlertMsg($LANG_MIGRATE[45]);
     // TBD: add a link back to the install script, preferrably a direct
     //      link to the upgrade screen
     $upgrade_error = true;
 } elseif ($version != VERSION) {
     $use_innodb = false;
     $db_engine = DB_getItem($_TABLES['vars'], 'value', "name = 'database_engine'");
     if ($db_engine == 'InnoDB') {
         // we've migrated, probably to a different server
         // - so check InnoDB support again
         if (INST_innodbSupported()) {
             $use_innodb = true;
         } else {
             // no InnoDB support on this server
             DB_delete($_TABLES['vars'], 'name', 'database_engine');
         }
     }
     if (!INST_doDatabaseUpgrades($version)) {
         $display .= INST_getAlertMsg(sprintf($LANG_MIGRATE[47], $version, VERSION));
         $upgrade_error = true;
     }
 }
 if ($upgrade_error) {
     $display .= INST_getFooter();
     echo $display;
     exit;
 }
 /**
  * Let's assume that the paths that were imported from the backup are
  * incorrect and update them with the current paths.
开发者ID:Geeklog-Core,项目名称:geeklog,代码行数:31,代码来源:migrate.php

示例12: deleteTopic

/**
 * Delete a topic
 *
 * @param    string $tid Topic ID
 * @return   string          HTML redirect
 */
function deleteTopic($tid)
{
    global $_CONF, $_TABLES, $_USER, $_TOPICS;
    $result = DB_query("SELECT owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['topics']} WHERE tid ='{$tid}'");
    $A = DB_fetchArray($result);
    $access = SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']);
    if ($access < 3) {
        COM_accessLog("User {$_USER['username']} tried to illegally delete topic {$tid}.");
        COM_redirect($_CONF['site_admin_url'] . '/topic.php');
    }
    // Update any child topics to root and un hide them
    DB_query("UPDATE {$_TABLES['topics']} SET parent_id = '" . TOPIC_ROOT . "', hidden = 0 WHERE parent_id = '{$tid}'");
    // same with feeds
    DB_query("UPDATE {$_TABLES['syndication']} SET topic = '::all', is_enabled = 0 WHERE topic = '{$tid}'");
    // Need to cycle through stories from topic
    // Only delete story if only this one topic
    // Make sure to check if this topic is default for story. If is make another topic default.
    $object_tables[] = $_TABLES['stories'];
    $object_tables[] = $_TABLES['storysubmission'];
    $object_tables[] = $_TABLES['blocks'];
    $object_tables_id[$_TABLES['stories']] = 'sid';
    $object_tables_id[$_TABLES['storysubmission']] = 'sid';
    $object_tables_id[$_TABLES['blocks']] = 'bid';
    $object_type[$_TABLES['stories']] = 'article';
    $object_type[$_TABLES['storysubmission']] = 'article';
    $object_type[$_TABLES['blocks']] = 'block';
    foreach ($object_tables as $object_table) {
        $sql = "SELECT {$object_tables_id[$object_table]}, ta.tdefault\n            FROM {$object_table}, {$_TABLES['topic_assignments']} ta\n            WHERE ta.type = '{$object_type[$object_table]}' AND ta.id = CAST({$object_tables_id[$object_table]} AS CHAR) AND ta.tid = '{$tid}'";
        $result = DB_query($sql);
        $numStories = DB_numRows($result);
        for ($i = 0; $i < $numStories; $i++) {
            $A = DB_fetchArray($result);
            // Now check if another topic exists for this story
            $sql = "SELECT {$object_tables_id[$object_table]}, ta.tid\n                FROM {$object_table}, {$_TABLES['topic_assignments']} ta\n                WHERE ta.type = '{$object_type[$object_table]}' AND ta.id = {$object_tables_id[$object_table]}\n                AND ta.tid <> '{$tid}' AND {$object_tables_id[$object_table]} = '{$A[$object_tables_id[$object_table]]}'";
            $resultB = DB_query($sql);
            $numTopics = DB_numRows($resultB);
            if ($numTopics == 0) {
                // Delete comments, trackbacks, images associated with stories in this topic since only topic
                if ($object_table == $_TABLES['stories'] || $object_table == $_TABLES['storysubmission']) {
                    STORY_deleteImages($A['sid']);
                    DB_delete($_TABLES['comments'], array('sid', 'type'), array($A['sid'], 'article'));
                    DB_delete($_TABLES['trackback'], array('sid', 'type'), array($A['sid'], 'article'));
                    if ($object_table == $_TABLES['stories']) {
                        PLG_itemDeleted($A['sid'], 'article');
                    }
                }
                DB_delete($object_table, $object_tables_id[$object_table], $A[$object_tables_id[$object_table]]);
            } else {
                // Story still exists for other topics so make sure one is default
                if ($object_table == $_TABLES['stories'] || $object_table == $_TABLES['storysubmission']) {
                    if ($A['tdefault'] == 1) {
                        $B = DB_fetchArray($resultB);
                        $sql = "UPDATE {$_TABLES['topic_assignments']} SET tdefault = 1 WHERE type = 'article' AND tid = '{$B['tid']}' AND id = '{$B['sid']}'";
                        DB_query($sql);
                    }
                }
            }
        }
    }
    // Notify of Delete topic so other plugins can deal with their items without topics
    PLG_itemDeleted($tid, 'topic');
    // delete these
    DB_delete($_TABLES['topic_assignments'], 'tid', $tid);
    DB_delete($_TABLES['topics'], 'tid', $tid);
    // Reorder Topics, Delete topic cache and reload topic tree
    reorderTopics();
    // update feed(s)
    COM_rdfUpToDateCheck('article');
    COM_redirect($_CONF['site_admin_url'] . '/topic.php?msg=14');
}
开发者ID:mystralkk,项目名称:geeklog,代码行数:76,代码来源:topic.php

示例13: migrate_deletestory

function migrate_deletestory($sid)
{
    global $_TABLES, $_CONF;
    $result = DB_query("SELECT ai_filename FROM {$_TABLES['article_images']} WHERE ai_sid='" . DB_escapeString($sid) . "'");
    $nrows = DB_numRows($result);
    for ($i = 1; $i <= $nrows; $i++) {
        $A = DB_fetchArray($result);
        $filename = $_CONF['path_html'] . 'images/articles/' . $A['ai_filename'];
        if (!@unlink($filename)) {
            // log the problem but don't abort the script
            COM_errorLog('Unable to remove the following image from the article: ' . $filename);
        }
        // remove unscaled image, if it exists
        $lFilename_large = substr_replace($A['ai_filename'], '_original.', strrpos($A['ai_filename'], '.'), 1);
        $lFilename_large_complete = $_CONF['path_html'] . 'images/articles/' . $lFilename_large;
        if (file_exists($lFilename_large_complete)) {
            if (!@unlink($lFilename_large_complete)) {
                // ;og the problem but don't abort the script
                COM_errorLog('Unable to remove the following image from the article: ' . $lFilename_large_complete);
            }
        }
    }
    DB_delete($_TABLES['article_images'], 'ai_sid', DB_escapeString($sid));
    DB_delete($_TABLES['comments'], 'sid', DB_escapeString($sid));
    DB_delete($_TABLES['stories'], 'sid', DB_escapeString($sid));
    // update RSS feed and Older Stories block
    COM_rdfUpToDateCheck();
    COM_olderStuff();
    return;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:30,代码来源:migrate.php

示例14: deleteRoute

/**
 * Delete a route
 *
 * @param    int $rid id of block to delete
 * @return   string  HTML redirect or error message
 */
function deleteRoute($rid)
{
    global $_CONF, $_TABLES;
    $rid = intval($rid, 10);
    DB_delete($_TABLES['routes'], 'rid', $rid);
    reorderRoutes();
    return COM_refresh($_CONF['site_admin_url'] . '/router.php?msg=123');
}
开发者ID:mystralkk,项目名称:geeklog,代码行数:14,代码来源:router.php

示例15: LIB_Deleteconfig

function LIB_Deleteconfig($pi_name, $config)
{
    COM_errorLog("[" . strtoupper($pi_name) . "] configuration delete");
    global $_TABLES;
    $group = $pi_name;
    DB_delete($_TABLES['conf_values'], 'group_name', $group);
    unset($config->config_array[$group]);
    $box_conf = "_" . strtoupper($pi_name) . "_CONF";
    global ${$box_conf};
    ${$box_conf} = array();
    $display .= "..........{$pi_name} Config Delete" . "<br>";
    return $display;
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:13,代码来源:lib_configuration.php


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