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


PHP delete_lang函数代码示例

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


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

示例1: save_config

 /**
  * Standard pointstore item configuration save function.
  */
 function save_config()
 {
     $i = 0;
     $rows = list_to_map('id', $GLOBALS['SITE_DB']->query_select('pstore_customs', array('*')));
     while (array_key_exists('custom_' . strval($i), $_POST)) {
         $id = post_param_integer('custom_' . strval($i));
         $title = post_param('custom_title_' . strval($i));
         $description = post_param('custom_description_' . strval($i));
         $enabled = post_param_integer('custom_enabled_' . strval($i), 0);
         $cost = post_param_integer('custom_cost_' . strval($i));
         $one_per_member = post_param_integer('custom_one_per_member_' . strval($i), 0);
         $delete = post_param_integer('delete_custom_' . strval($i), 0);
         $_title = $rows[$id]['c_title'];
         $_description = $rows[$id]['c_description'];
         if ($delete == 1) {
             delete_lang($_title);
             delete_lang($_description);
             $GLOBALS['SITE_DB']->query_delete('pstore_customs', array('id' => $id), '', 1);
         } else {
             $GLOBALS['SITE_DB']->query_update('pstore_customs', array('c_title' => lang_remap($_title, $title), 'c_description' => lang_remap($_description, $description), 'c_enabled' => $enabled, 'c_cost' => $cost, 'c_one_per_member' => $one_per_member), array('id' => $id), '', 1);
         }
         $i++;
     }
     $title = post_param('custom_title', NULL);
     if (!is_null($title)) {
         $description = post_param('custom_description');
         $enabled = post_param_integer('custom_enabled', 0);
         $cost = post_param_integer('custom_cost');
         $one_per_member = post_param_integer('custom_one_per_member', 0);
         $GLOBALS['SITE_DB']->query_insert('pstore_customs', array('c_title' => insert_lang($title, 2), 'c_description' => insert_lang($description, 2), 'c_enabled' => $enabled, 'c_cost' => $cost, 'c_one_per_member' => $one_per_member));
     }
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:35,代码来源:custom.php

示例2: ocf_delete_multi_moderation

/**
 * Delete a multi moderation.
 *
 * @param  AUTO_LINK  The ID of the multi moderation we are deleting.
 */
function ocf_delete_multi_moderation($id)
{
    $_name = $GLOBALS['FORUM_DB']->query_value('f_multi_moderations', 'mm_name', array('id' => $id));
    $name = get_translated_text($_name, $GLOBALS['FORUM_DB']);
    $GLOBALS['FORUM_DB']->query_delete('f_multi_moderations', array('id' => $id), '', 1);
    delete_lang($_name, $GLOBALS['FORUM_DB']);
    log_it('DELETE_MULTI_MODERATION', strval($id), $name);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:13,代码来源:ocf_moderation_action2.php

示例3: delete_flagrant

/**
 * Delete a flagrant text message.
 *
 * @param  AUTO_LINK		The ID of the flagrant text message to delete
 */
function delete_flagrant($id)
{
    $message = $GLOBALS['SITE_DB']->query_value('text', 'the_message', array('id' => $id));
    $_message = get_translated_text($message);
    log_it('DELETE_FLAGRANT', strval($id), $_message);
    $GLOBALS['SITE_DB']->query_delete('text', array('id' => $id), '', 1);
    delete_lang($message);
    persistant_cache_delete('FLAGRANT');
    // In case it was active
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:15,代码来源:flagrant.php

示例4: seo_meta_erase_storage

/**
 * Erase a seo entry... as these shouldn't be left hanging around once content is deleted.
 *
 * @param  ID_TEXT		The type of resource (e.g. download)
 * @param  ID_TEXT		The ID of the resource
 */
function seo_meta_erase_storage($type, $id)
{
    $rows = $GLOBALS['SITE_DB']->query_select('seo_meta', array('meta_keywords', 'meta_description'), array('meta_for_type' => $type, 'meta_for_id' => $id), '', 1);
    if (!array_key_exists(0, $rows)) {
        return;
    }
    delete_lang($rows[0]['meta_keywords']);
    delete_lang($rows[0]['meta_description']);
    $GLOBALS['SITE_DB']->query_delete('seo_meta', array('meta_for_type' => $type, 'meta_for_id' => $id), '', 1);
    if (function_exists('persistant_cache_delete')) {
        persistant_cache_delete(array('seo', $type, $id));
    }
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:19,代码来源:seo2.php

示例5: ocf_delete_forum

/**
 * Delete a forum.
 *
 * @param  AUTO_LINK		The ID of the forum we are deleting.
 * @param  AUTO_LINK		The ID of the forum that topics will be moved to.
 * @param  BINARY			Whether to delete topics instead of moving them to the target forum.
 */
function ocf_delete_forum($forum_id, $target_forum_id, $delete_topics = 0)
{
    if ($forum_id == db_get_first_id()) {
        warn_exit(do_lang_tempcode('CANNOT_DELETE_ROOT_FORUM'));
    }
    require_code('ocf_topics_action');
    require_code('ocf_topics_action2');
    if ($delete_topics == 0) {
        ocf_move_topics($forum_id, $target_forum_id);
    } else {
        $rows = $GLOBALS['FORUM_DB']->query_select('f_topics', array('id'), array('t_forum_id' => $forum_id));
        foreach ($rows as $row) {
            ocf_delete_topic($row['id'], '');
        }
    }
    $forum_info = $GLOBALS['FORUM_DB']->query_select('f_forums', array('*'), array('id' => $forum_id), '', 1);
    if (!array_key_exists(0, $forum_info)) {
        warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
    }
    delete_lang($forum_info[0]['f_description'], $GLOBALS['FORUM_DB']);
    delete_lang($forum_info[0]['f_intro_question'], $GLOBALS['FORUM_DB']);
    $name = $GLOBALS['FORUM_DB']->query_value('f_forums', 'f_name', array('id' => $forum_id));
    $GLOBALS['FORUM_DB']->query_update('f_multi_moderations', array('mm_move_to' => NULL), array('mm_move_to' => $forum_id));
    $GLOBALS['FORUM_DB']->query_update('f_forums', array('f_parent_forum' => db_get_first_id()), array('f_parent_forum' => $forum_id));
    $GLOBALS['FORUM_DB']->query_delete('f_forums', array('id' => $forum_id), '', 1);
    $GLOBALS['FORUM_DB']->query_delete('group_category_access', array('module_the_name' => 'forums', 'category_name' => strval($forum_id)));
    $GLOBALS['FORUM_DB']->query_delete('gsp', array('module_the_name' => 'forums', 'category_name' => strval($forum_id)));
    require_code('notifications');
    delete_all_notifications_on('ocf_topic', 'forum:' . strval($forum_id));
    $GLOBALS['FORUM_DB']->query_delete('f_forum_intro_member', array('i_forum_id' => $forum_id));
    $GLOBALS['FORUM_DB']->query_delete('f_forum_intro_ip', array('i_forum_id' => $forum_id));
    log_it('DELETE_FORUM', strval($forum_id), $name);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:40,代码来源:ocf_forums_action2.php

示例6: module_do_upload

 /**
  * The actualiser for uploading a file.
  *
  * @return tempcode	The UI.
  */
 function module_do_upload()
 {
     if (!has_specific_permission(get_member(), 'upload_filedump')) {
         access_denied('I_ERROR');
     }
     $title = get_page_title('FILEDUMP_UPLOAD');
     if (function_exists('set_time_limit')) {
         @set_time_limit(0);
     }
     // Slowly uploading a file can trigger time limit, on some servers
     $place = filter_naughty(post_param('place'));
     require_code('uploads');
     if (!is_swf_upload(true) && (!array_key_exists('file', $_FILES) || !is_uploaded_file($_FILES['file']['tmp_name']))) {
         $attach_name = 'file';
         $max_size = get_max_file_size();
         if (isset($_FILES[$attach_name]) && ($_FILES[$attach_name]['error'] == 1 || $_FILES[$attach_name]['error'] == 2)) {
             warn_exit(do_lang_tempcode('FILE_TOO_BIG', integer_format($max_size)));
         } elseif (isset($_FILES[$attach_name]) && ($_FILES[$attach_name]['error'] == 3 || $_FILES[$attach_name]['error'] == 6 || $_FILES[$attach_name]['error'] == 7)) {
             warn_exit(do_lang_tempcode('ERROR_UPLOADING_' . strval($_FILES[$attach_name]['error'])));
         } else {
             warn_exit(do_lang_tempcode('ERROR_UPLOADING'));
         }
     }
     $file = $_FILES['file']['name'];
     if (get_magic_quotes_gpc()) {
         $file = stripslashes($file);
     }
     if (!has_specific_permission(get_member(), 'upload_anything_filedump') || get_file_base() != get_custom_file_base()) {
         check_extension($file);
     }
     $file = str_replace('.', '-', basename($file, '.' . get_file_extension($file))) . '.' . get_file_extension($file);
     if (!file_exists(get_custom_file_base() . '/uploads/filedump' . $place . $file)) {
         $max_size = get_max_file_size();
         if ($_FILES['file']['size'] > $max_size) {
             warn_exit(do_lang_tempcode('FILE_TOO_BIG', integer_format(intval($max_size))));
         }
         $full = get_custom_file_base() . '/uploads/filedump' . $place . $file;
         if (is_swf_upload(true)) {
             @rename($_FILES['file']['tmp_name'], $full) or warn_exit(do_lang_tempcode('FILE_MOVE_ERROR', escape_html($file), escape_html('uploads/filedump' . $place)));
         } else {
             @move_uploaded_file($_FILES['file']['tmp_name'], $full) or warn_exit(do_lang_tempcode('FILE_MOVE_ERROR', escape_html($file), escape_html('uploads/filedump' . $place)));
         }
         fix_permissions($full);
         sync_file($full);
         $return_url = build_url(array('page' => '_SELF', 'place' => $place), '_SELF');
         $test = $GLOBALS['SITE_DB']->query_value_null_ok('filedump', 'description', array('name' => $file, 'path' => $place));
         if (!is_null($test)) {
             delete_lang($test);
         }
         $GLOBALS['SITE_DB']->query_delete('filedump', array('name' => $file, 'path' => $place), '', 1);
         $description = post_param('description');
         $GLOBALS['SITE_DB']->query_insert('filedump', array('name' => $file, 'path' => $place, 'the_member' => get_member(), 'description' => insert_lang_comcode($description, 3)));
         require_code('notifications');
         $subject = do_lang('FILEDUMP_NOTIFICATION_MAIL_SUBJECT', get_site_name(), $file, $place);
         $mail = do_lang('FILEDUMP_NOTIFICATION_MAIL', comcode_escape(get_site_name()), comcode_escape($file), array(comcode_escape($place), comcode_escape($description)));
         dispatch_notification('filedump', $place, $subject, $mail);
         log_it('FILEDUMP_UPLOAD', $file, $place);
         if (has_actual_page_access($GLOBALS['FORUM_DRIVER']->get_guest_id(), get_page_name(), get_zone_name())) {
             syndicate_described_activity('filedump:ACTIVITY_FILEDUMP_UPLOAD', $place . '/' . $file, '', '', '', '', '', 'filedump');
         }
         return redirect_screen($title, $return_url, do_lang_tempcode('SUCCESS'));
     } else {
         warn_exit(do_lang_tempcode('OVERWRITE_ERROR'));
     }
     return new ocp_tempcode();
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:71,代码来源:filedump.php

示例7: mass_delete_lang

/**
 * Deletes all language codes linked to by the specified table and attribute identifiers, if they exist.
 *
 * @param  ID_TEXT		The table
 * @param  array			The attributes
 * @param  ?object		The database connection to use (NULL: standard site connection)
 */
function mass_delete_lang($table, $attrs, $connection)
{
    if (count($attrs) == 0) {
        return;
    }
    if (is_null($connection)) {
        $connection = $GLOBALS['SITE_DB'];
    }
    $rows = $connection->query_select($table, $attrs, NULL, '', NULL, NULL, true);
    if (!is_null($rows)) {
        foreach ($rows as $row) {
            foreach ($attrs as $attr) {
                delete_lang($row[$attr], $connection);
            }
        }
    }
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:24,代码来源:database_action.php

示例8: cedi_delete_page

/**
 * Delete a CEDI page
 *
 * @param  AUTO_LINK		The page ID
 */
function cedi_delete_page($id)
{
    if (function_exists('set_time_limit')) {
        @set_time_limit(0);
    }
    $start = 0;
    do {
        $posts = $GLOBALS['SITE_DB']->query_select('seedy_posts', array('id'), array('page_id' => $id), '', 500, $start);
        foreach ($posts as $post) {
            cedi_delete_post($post['id']);
        }
        $start += 500;
    } while (array_key_exists(0, $posts));
    $pages = $GLOBALS['SITE_DB']->query_select('seedy_pages', array('*'), array('id' => $id), '', 1);
    if (!array_key_exists(0, $pages)) {
        warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
    }
    $page = $pages[0];
    $_description = $page['description'];
    $_title = $page['title'];
    delete_lang($_description);
    delete_lang($_title);
    $GLOBALS['SITE_DB']->query_delete('seedy_pages', array('id' => $id), '', 1);
    $GLOBALS['SITE_DB']->query_delete('seedy_children', array('parent_id' => $id));
    $GLOBALS['SITE_DB']->query_delete('seedy_children', array('child_id' => $id));
    $GLOBALS['SITE_DB']->query_delete('seedy_changes', array('the_page' => $id));
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:32,代码来源:cedi.php

示例9: ocf_delete_welcome_email

/**
 * Delete a Welcome E-mail.
 *
 * @param  AUTO_LINK		The ID
 */
function ocf_delete_welcome_email($id)
{
    $_subject = $GLOBALS['SITE_DB']->query_value('f_welcome_emails', 'w_subject', array('id' => $id));
    $_text = $GLOBALS['SITE_DB']->query_value('f_welcome_emails', 'w_text', array('id' => $id));
    log_it('DELETE_WELCOME_EMAIL', strval($id), get_translated_text($_subject));
    $GLOBALS['SITE_DB']->query_delete('f_welcome_emails', array('id' => $id), '', 1);
    delete_lang($_subject);
    delete_lang($_text);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:14,代码来源:ocf_general_action2.php

示例10: __editor

 /**
  * The actualiser to edit a zone (via zone editor).
  *
  * @return tempcode		The UI
  */
 function __editor()
 {
     $title = get_page_title('ZONE_EDITOR');
     $lang = choose_language($title, true);
     if (is_object($lang)) {
         return $lang;
     }
     $id = get_param('id', '');
     // Edit settings
     $_title = post_param('title');
     $default_page = post_param('default_page');
     $header_text = post_param('header_text');
     $theme = post_param('theme');
     $wide = post_param_integer('wide');
     if ($wide == -1) {
         $wide = NULL;
     }
     $require_session = post_param_integer('require_session', 0);
     $displayed_in_menu = post_param_integer('displayed_in_menu', 0);
     actual_edit_zone($id, $_title, $default_page, $header_text, $theme, $wide, $require_session, $displayed_in_menu, $id);
     if ($id != '') {
         $this->set_permissions($id);
     }
     // Edit pages
     foreach (array('panel_left', 'start', 'panel_right') as $for) {
         $redirect = post_param('redirect_' . $for, NULL);
         if (!is_null($redirect)) {
             if (addon_installed('redirects_editor')) {
                 $GLOBALS['SITE_DB']->query_delete('redirects', array('r_from_page' => $for, 'r_from_zone' => $id), '', 1);
                 if ($redirect != $id) {
                     $GLOBALS['SITE_DB']->query_insert('redirects', array('r_from_page' => $for, 'r_from_zone' => $id, 'r_to_page' => $for, 'r_to_zone' => $redirect, 'r_is_transparent' => 1), false, true);
                     // Avoid problem when same key entered twice
                 } else {
                     $redirect = NULL;
                 }
             } else {
                 $redirect = NULL;
             }
         }
         $comcode = post_param($for, NULL);
         if (!is_null($comcode)) {
             // Where to save to
             $fullpath = zone_black_magic_filterer(get_custom_file_base() . ((is_null($redirect) ? $id : $redirect) == '' ? '' : '/') . (is_null($redirect) ? $id : $redirect) . '/pages/comcode_custom/' . $lang . '/' . $for . '.txt');
             // Make dir if needed
             if (!file_exists(dirname($fullpath))) {
                 if (@mkdir(dirname($fullpath), 0777) === false) {
                     warn_exit(do_lang_tempcode('WRITE_ERROR_DIRECTORY_REPAIR', escape_html(basename(dirname($fullpath))), escape_html(dirname(dirname($fullpath)))));
                 }
                 fix_permissions(dirname($fullpath), 0777);
                 sync_file(dirname($fullpath));
             }
             // Store revision
             if (file_exists($fullpath) && get_option('store_revisions') == '1') {
                 $time = time();
                 @copy($fullpath, $fullpath . '.' . strval($time)) or intelligent_write_error($fullpath . '.' . strval($time));
                 fix_permissions($fullpath . '.' . strval($time));
                 sync_file($fullpath . '.' . strval($time));
             }
             // Save
             $myfile = @fopen($fullpath, 'wt') or intelligent_write_error($fullpath);
             if (fwrite($myfile, $comcode) < strlen($comcode)) {
                 warn_exit(do_lang_tempcode('COULD_NOT_SAVE_FILE'));
             }
             fclose($myfile);
             fix_permissions($fullpath);
             sync_file($fullpath);
             // De-cache
             $caches = $GLOBALS['SITE_DB']->query_select('cached_comcode_pages', array('string_index'), array('the_zone' => is_null($redirect) ? $id : $redirect, 'the_page' => $for));
             foreach ($caches as $cache) {
                 delete_lang($cache['string_index']);
             }
             $GLOBALS['SITE_DB']->query_delete('cached_comcode_pages', array('the_zone' => is_null($redirect) ? $id : $redirect, 'the_page' => $for));
         }
     }
     persistant_cache_empty();
     // Redirect
     $url = get_param('redirect');
     return redirect_screen($title, $url, do_lang_tempcode('SUCCESS'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:84,代码来源:admin_zones.php

示例11: delete_all_chatrooms

/**
 * Delete all chatrooms.
 */
function delete_all_chatrooms()
{
    if (function_exists('set_time_limit')) {
        @set_time_limit(0);
    }
    do {
        $c_welcomes = $GLOBALS['SITE_DB']->query_select('chat_rooms', array('id', 'c_welcome'), array('is_im' => 0), '', 400);
        foreach ($c_welcomes as $c_welcome) {
            delete_lang($c_welcome['c_welcome']);
            $GLOBALS['SITE_DB']->query_delete('chat_rooms', array('id' => $c_welcome['id']));
            delete_chat_messages(array('room_id' => $c_welcome['id']));
        }
    } while ($c_welcomes != array());
    decache('side_shoutbox');
    log_it('DELETE_ALL_ROOMS');
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:19,代码来源:chat2.php

示例12: __ed


//.........这里部分代码省略.........
     if (!file_exists($fullpath) || $new != file_get_contents($fullpath, FILE_TEXT)) {
         $myfile = @fopen($fullpath, 'wt');
         if ($myfile === false) {
             intelligent_write_error($fullpath);
         }
         final_attachments_from_preview($zone . ':' . $file);
         if (fwrite($myfile, $new) < strlen($new)) {
             warn_exit(do_lang_tempcode('COULD_NOT_SAVE_FILE'));
         }
         fclose($myfile);
         sync_file($fullpath);
         $file_changed = true;
     } else {
         $file_changed = false;
     }
     require_code('seo2');
     $new_keywords = post_param('meta_keywords', '');
     $new_description = post_param('meta_description', '');
     if ($new_keywords == '' && $new_description == '') {
         seo_meta_set_for_implicit('comcode_page', $zone . ':' . $file, array($new), $new);
     } else {
         seo_meta_set_for_explicit('comcode_page', $zone . ':' . $file, $new_keywords, $new_description);
     }
     $completion_text = $validated == 0 ? do_lang_tempcode('SUBMIT_UNVALIDATED') : do_lang_tempcode('SUCCESS');
     // Update cache  NO WE CAN'T - THEY'RE MULTI-THEME NOW
     /*	$string_index=$GLOBALS['SITE_DB']->query_value_null_ok('cached_comcode_pages','string_index',array('the_zone'=>$zone,'the_page'=>$file));
     		if (!is_null($string_index))
     		{
     			lang_remap_comcode($string_index,$new);
     		} else
     		{
     			$string_index=insert_lang_comcode($new,1,NULL,false,NULL,NULL,false,NULL,NULL,60,true,true);
     			$GLOBALS['SITE_DB']->query_insert('cached_comcode_pages',array('the_zone'=>$zone,'the_page'=>$file,'string_index'=>$string_index));
     		}*/
     require_code('permissions2');
     set_page_permissions_from_environment($zone, $file);
     $caches = $GLOBALS['SITE_DB']->query_select('cached_comcode_pages', array('string_index'), array('the_zone' => $zone, 'the_page' => $file));
     $GLOBALS['SITE_DB']->query_delete('cached_comcode_pages', array('the_zone' => $zone, 'the_page' => $file));
     foreach ($caches as $cache) {
         delete_lang($cache['string_index']);
     }
     persistant_cache_empty();
     persistant_cache_delete(array('PAGE_INFO'));
     decache('main_comcode_page_children');
     fix_permissions($fullpath);
     if (is_file($fullpath) && get_option('store_revisions') == '1' && $file_changed) {
         $time = time();
         @copy($fullpath, $fullpath . '.' . strval($time)) or intelligent_write_error($fullpath . '.' . strval($time));
         fix_permissions($fullpath . '.' . strval($time));
         sync_file($fullpath . '.' . strval($time));
     }
     log_it('COMCODE_PAGE_EDIT', $file, $zone);
     require_code('autosave');
     clear_ocp_autosave();
     if ($renaming_page) {
         $GLOBALS['SITE_DB']->query_delete('comcode_pages', array('the_zone' => $zone, 'the_page' => $new_file), '', 1);
         $GLOBALS['SITE_DB']->query_update('comcode_pages', array('the_page' => $new_file), array('the_zone' => $zone, 'the_page' => $file), '', 1);
         $GLOBALS['SITE_DB']->query_update('comcode_pages', array('p_parent_page' => $new_file), array('the_zone' => $zone, 'p_parent_page' => $file));
         foreach ($rename_map as $path => $new_path) {
             if ($afm_needed) {
                 afm_move($path, $new_path);
             } else {
                 rename(get_custom_file_base() . '/' . $path, get_custom_file_base() . '/' . $new_path);
             }
         }
         if (addon_installed('awards')) {
             $types = $GLOBALS['SITE_DB']->query_select('award_types', array('id'), array('a_content_type' => 'comcode_page'));
             foreach ($types as $type) {
                 $GLOBALS['SITE_DB']->query_update('award_archive', array('content_id' => $new_file), array('content_id' => $file, 'a_type_id' => $type['id']));
             }
         }
         $file = $new_file;
     }
     if (post_param_integer('delete', 0) == 1) {
         unlink(get_custom_file_base() . '/' . $path);
     }
     if (addon_installed('awards')) {
         require_code('awards');
         handle_award_setting('comcode_page', $zone . ':' . $file);
     }
     decache('main_sitemap');
     breadcrumb_set_self(do_lang_tempcode('DONE'));
     // Look for bad title semantics
     $_new['html'] = $_new['tempcode']->evaluate();
     if (substr($file, 0, 1) != '_' && substr($file, 0, 6) != 'panel_' && trim($_new['html']) != '') {
         if (strpos($_new['html'], '<h1') === false && strpos($_new['comcode'], '[title]') === false && strpos($_new['comcode'], '[title="1"]') === false) {
             attach_message(do_lang_tempcode('NO_LEVEL_1_HEADERS'), 'notice');
         }
         $matches = array();
         if (strpos($_new['html'], '<h2') === false && preg_match_all('#\\n\\[(b|font|size)\\][^\\.]+\\[/(b|font|size)\\]\\n#', $_new['comcode'], $matches) >= 2) {
             attach_message(do_lang_tempcode('NO_LEVEL_2_HEADERS'), 'inform');
         }
     }
     // Show it worked / Refresh
     $url = post_param('redirect', '');
     if ($url != '') {
         return redirect_screen($title, $url, $completion_text);
     }
     return $this->do_next_manager($title, $file, $zone, $completion_text);
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:101,代码来源:cms_comcode_pages.php

示例13: delete_newsletter

/**
 * Delete a newsletter.
 *
 * @param  AUTO_LINK		The ID
 */
function delete_newsletter($id)
{
    $_title = $GLOBALS['SITE_DB']->query_value('newsletters', 'title', array('id' => $id));
    $_description = $GLOBALS['SITE_DB']->query_value('newsletters', 'description', array('id' => $id));
    log_it('DELETE_NEWSLETTER', strval($id), get_translated_text($_title));
    $GLOBALS['SITE_DB']->query_delete('newsletters', array('id' => $id), '', 1);
    $GLOBALS['SITE_DB']->query_delete('newsletter_subscribe', array('newsletter_id' => $id));
    delete_lang($_title);
    delete_lang($_description);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:15,代码来源:newsletter.php

示例14: ocf_delete_group

/**
 * Delete a usergroup.
 *
 * @param  AUTO_LINK		The ID of the usergroup to delete.
 * @param  ?GROUP			The usergroup to move primary members to (NULL: main members).
 */
function ocf_delete_group($group_id, $target_group = NULL)
{
    $orig_target_group = $target_group;
    if (is_null($target_group)) {
        $target_group = get_first_default_group();
    }
    if ($group_id == db_get_first_id() + 0 || $group_id == db_get_first_id() + 1 || $group_id == db_get_first_id() + 8) {
        fatal_exit(do_lang_tempcode('INTERNAL_ERROR'));
    }
    $_group_info = $GLOBALS['FORUM_DB']->query_select('f_groups', array('g_name', 'g_title', 'g_rank_image'), array('id' => $group_id), '', 1);
    if (!array_key_exists(0, $_group_info)) {
        warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
    }
    $_name = $_group_info[0]['g_name'];
    $_title = $_group_info[0]['g_title'];
    $name = get_translated_text($_name, $GLOBALS['FORUM_DB']);
    delete_lang($_name, $GLOBALS['FORUM_DB']);
    delete_lang($_title, $GLOBALS['FORUM_DB']);
    $GLOBALS['FORUM_DB']->query_update('f_groups', array('g_promotion_target' => NULL), array('g_promotion_target' => $group_id));
    $GLOBALS['FORUM_DB']->query_update('f_members', array('m_primary_group' => $target_group), array('m_primary_group' => $group_id));
    if (!is_null($orig_target_group)) {
        $GLOBALS['FORUM_DB']->query_update('f_group_members', array('gm_group_id' => $target_group), array('gm_group_id' => $group_id), '', NULL, NULL, false, true);
    }
    $GLOBALS['FORUM_DB']->query_delete('f_group_members', array('gm_group_id' => $group_id));
    $GLOBALS['FORUM_DB']->query_delete('f_groups', array('id' => $group_id), '', 1);
    // No need to delete ocPortal permission stuff, as it could be on any MSN site, and ocPortal is coded with a tolerance due to the forum driver system. However, to be tidy...
    $GLOBALS['SITE_DB']->query_delete('gsp', array('group_id' => $group_id));
    $GLOBALS['SITE_DB']->query_delete('group_zone_access', array('group_id' => $group_id));
    $GLOBALS['SITE_DB']->query_delete('group_category_access', array('group_id' => $group_id));
    $GLOBALS['SITE_DB']->query_delete('group_page_access', array('group_id' => $group_id));
    if (addon_installed('ecommerce')) {
        $GLOBALS['FORUM_DB']->query_delete('f_usergroup_subs', array('s_group_id' => $group_id));
    }
    require_code('themes2');
    tidy_theme_img_code(NULL, $_group_info[0]['g_rank_image'], 'f_groups', 'g_rank_image', $GLOBALS['FORUM_DB']);
    log_it('DELETE_GROUP', strval($group_id), $name);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:43,代码来源:ocf_groups_action2.php

示例15: delete_author

/**
 * Delete an author
 *
 * @param  ID_TEXT		The name of an author
 */
function delete_author($author)
{
    $rows = $GLOBALS['SITE_DB']->query_select('authors', array('description', 'skills'), array('author' => $author), '', 1);
    if (array_key_exists(0, $rows)) {
        delete_lang($rows[0]['description']);
        delete_lang($rows[0]['skills']);
        $GLOBALS['SITE_DB']->query_delete('authors', array('author' => $author), '', 1);
    } else {
        warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
    }
    log_it('DELETE_AUTHOR', $author);
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:17,代码来源:authors.php


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