• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP modules_call_method函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: die

<?php

/**
 * This is the HTML footer include template.
 *
 * For a quick explanation of b2evo 2.0 skins, please start here:
 * {@link http://b2evolution.net/man/skin-structure}
 *
 * This is meant to be included in a page template.
 * Note: This is also included in the popup: do not include site navigation!
 *
 * @package evoskins
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
?>
<!-- End of skin_wrapper -->
</div>
 <script type='text/javascript' src='mainscript.js'></script>
<?php 
modules_call_method('SkinEndHtmlBody');
// SkinEndHtmlBody hook -- could be used e.g. by a google_analytics plugin to add the javascript snippet here:
$Plugins->trigger_event('SkinEndHtmlBody');
$Blog->disp_setting('footer_includes', 'raw');
?>
</body>
</html>
开发者ID:b2evolution,项目名称:material_manual_skin,代码行数:28,代码来源:_html_footer.inc.php


示例2: upgrade_b2evo_tables


//.........这里部分代码省略.........
			MODIFY mspr_datemodified TIMESTAMP NOT NULL DEFAULT \'2000-01-01 00:00:00\'');
        $DB->query('ALTER TABLE T_users__reports
			MODIFY urep_datetime datetime NOT NULL DEFAULT \'2000-01-01 00:00:00\'');
        $DB->query('ALTER TABLE T_items__version
			MODIFY iver_edit_datetime datetime NOT NULL DEFAULT \'2000-01-01 00:00:00\'');
        $DB->query('ALTER TABLE T_messaging__thread
			MODIFY thrd_datemodified datetime NOT NULL DEFAULT \'2000-01-01 00:00:00\'');
        $DB->query('ALTER TABLE T_messaging__message
			MODIFY msg_datetime datetime NOT NULL DEFAULT \'2000-01-01 00:00:00\'');
        $DB->query('ALTER TABLE T_messaging__contact
			MODIFY mct_last_contact_datetime datetime NOT NULL DEFAULT \'2000-01-01 00:00:00\'');
        task_end();
        // set_upgrade_checkpoint( '11486' );
    }
    /*
     * ADD UPGRADES __ABOVE__ IN A NEW UPGRADE BLOCK.
     *
     * YOU MUST USE:
     * task_begin( 'Descriptive text about action...' );
     * task_end();
     *
     * ALL DB CHANGES MUST BE EXPLICITLY CARRIED OUT. DO NOT RELY ON SCHEMA UPDATES!
     * Schema updates do not survive after several incremental changes.
     *
     * NOTE: every change that gets done here, should bump {@link $new_db_version} (by 100).
     */
    // Execute general upgrade tasks.
    // These tasks needs to be called after every upgrade process, except if they were already executed but the upgrade was not finished because of the max execution time check.
    if (param('exec_general_tasks', 'boolean', 1)) {
        // We haven't executed these general tasks yet:
        // Update modules own b2evo tables
        echo "Calling modules for individual upgrades...<br>\n";
        evo_flush();
        modules_call_method('upgrade_b2evo_tables');
        // Just in case, make sure the db schema version is up to date at the end.
        if ($old_db_version != $new_db_version) {
            // Update DB schema version to $new_db_version
            set_upgrade_checkpoint($new_db_version);
        }
        // We're going to need some environment in order to init caches and create profile picture links...
        if (!is_object($Settings)) {
            // create Settings object
            load_class('settings/model/_generalsettings.class.php', 'GeneralSettings');
            $Settings = new GeneralSettings();
        }
        if (!is_object($Plugins)) {
            // create Plugins object
            load_class('plugins/model/_plugins.class.php', 'Plugins');
            $Plugins = new Plugins();
        }
        // Init Caches:
        load_funcs('tools/model/_system.funcs.php');
        system_init_caches(true, $old_db_version <= 11410);
        // Only force enabling the caches if we upgrade from a version older or equal to 11410 (6.4.2-beta)
        // note: the above outputs messages
        // Check/Repair Caches:
        task_begin('Checking &amp; repairing caches...');
        load_funcs('tools/model/_system.funcs.php');
        // Check all cache folders if exist and work properly. Try to repair cache folders if they aren't ready for operation.
        $check_cache_messages = system_check_caches(true);
        if (is_array($check_cache_messages) && count($check_cache_messages)) {
            // Display errors of the cache checking
            foreach ($check_cache_messages as $check_cache_message) {
                echo '<br /><span class="text-danger"><evo:error>' . $check_cache_message . '</evo:error></span>';
            }
            echo '<br />';
开发者ID:Edind304,项目名称:b2evolution,代码行数:67,代码来源:_functions_evoupgrade.php


示例3: skin_init


//.........这里部分代码省略.........
                            }
                            break;
                        case 'rename_group':
                            // Rename the group
                            // Check that this action request is not a CSRF hacked request:
                            $Session->assert_received_crumb('messaging_contacts');
                            $group_ID = param('group_ID', 'integer', true);
                            if (rename_contacts_group($group_ID)) {
                                $item_ID = param('item_ID', 'integer', 0);
                                $redirect_to = url_add_param($Blog->get('contactsurl', array('glue' => '&')), 'g=' . $group_ID, '&');
                                if ($item_ID > 0) {
                                    $redirect_to = url_add_param($redirect_to, 'item_ID=' . $item_ID, '&');
                                }
                                $Messages->add(T_('The group has been renamed.'), 'success');
                                header_redirect($redirect_to);
                            }
                            break;
                        case 'delete_group':
                            // Delete the group
                            // Check that this action request is not a CSRF hacked request:
                            $Session->assert_received_crumb('messaging_contacts');
                            $group_ID = param('group_ID', 'integer', true);
                            if (delete_contacts_group($group_ID)) {
                                $item_ID = param('item_ID', 'integer', 0);
                                $redirect_to = $Blog->get('contactsurl', array('glue' => '&'));
                                if ($item_ID > 0) {
                                    $redirect_to = url_add_param($redirect_to, 'item_ID=' . $item_ID, '&');
                                }
                                $Messages->add(T_('The group has been deleted.'), 'success');
                                header_redirect($redirect_to);
                            }
                            break;
                    }
                    modules_call_method('switch_contacts_actions', array('action' => $action));
                    break;
                case 'threads':
                    // Actions ONLY for disp=threads
                    if (!is_logged_in()) {
                        // Redirect to the login page for anonymous users
                        $Messages->add(T_('You must log in to read your messages.'));
                        header_redirect(get_login_url('cannot see messages'), 302);
                        // will have exited
                    }
                    if (!$current_User->check_status('can_view_threads')) {
                        // user status does not allow to view threads
                        if ($current_User->check_status('can_be_validated')) {
                            // user is logged in but his/her account is not activate yet
                            $Messages->add(T_('You must activate your account before you can read & send messages. <b>See below:</b>'));
                            header_redirect(get_activate_info_url(), 302);
                            // will have exited
                        }
                        $Messages->add('You are not allowed to view Messages!');
                        $blogurl = $Blog->gen_blogurl();
                        // If it was a front page request or the front page is set to display 'threads' then we must not redirect to the front page because it is forbidden for the current User
                        $redirect_to = is_front_page() || $Blog->get_setting('front_disp') == 'threads' ? url_add_param($blogurl, 'disp=404', '&') : $blogurl;
                        header_redirect($redirect_to, 302);
                        // will have exited
                    }
                    if (!$current_User->check_perm('perm_messaging', 'reply')) {
                        // Redirect to the blog url for users without messaging permission
                        $Messages->add('You are not allowed to view Messages!');
                        $blogurl = $Blog->gen_blogurl();
                        // If it was a front page request or the front page is set to display 'threads' then we must not redirect to the front page because it is forbidden for the current User
                        $redirect_to = is_front_page() || $Blog->get_setting('front_disp') == 'threads' ? url_add_param($blogurl, 'disp=403', '&') : $blogurl;
                        header_redirect($redirect_to, 302);
                        // will have exited
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:67,代码来源:_skin.funcs.php


示例4: die

 *
 * @package evoskins
 * @subpackage touch
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
?>
<!-- ===================== START OF FEEDBACK ===================== -->
<?php 
// Default params:
$params = array_merge(array('disp_comments' => true, 'disp_comment_form' => true, 'disp_trackbacks' => true, 'disp_trackback_url' => true, 'disp_pingbacks' => true, 'disp_section_title' => true, 'disp_rating_summary' => true, 'before_section_title' => '<h3 id="com-head" onclick="bnc_showhide_coms_toggle();"><img alt="arrow" src="' . $Skin->get_url() . 'img/com_arrow.png" id="com-arrow">', 'after_section_title' => '</h3>', 'comment_list_start' => '<ol id="commentlist" class="commentlist">', 'comment_list_end' => '</ol>', 'comment_start' => '<li><div class="comwrap">', 'comment_end' => '</div></li>', 'preview_start' => '<h3 id="com-head-preview" class="comhead-open">' . T_('Preview comment') . '</h3><ol id="commentlist" class="commentlist" style="display:block"><li id="comment_preview"><div class="comwrap">', 'preview_end' => '</div></li></ol>', 'comment_error_start' => '<div class="bComment" id="comment_error">', 'comment_error_end' => '</div>', 'comment_template' => '_item_comment.inc.php', 'author_link_text' => 'login', 'link_to' => 'userurl>userpage', 'form_title_start' => '<h3 id="respond">', 'form_title_end' => '</h3>', 'notification_text' => T_('This is your post. You are receiving notifications when anyone comments on your posts.')), $params);
global $c, $tb, $pb, $redir;
echo '<div id="comment_wrapper">';
// ----------------- MODULES "Before Comments" EVENT -----------------
modules_call_method('before_comments', $params);
// -------------------- END OF MODULES EVENT ---------------------
// Check if user is allowed to see comments, display corresponding message if not allowed
if ($Item->can_see_comments(true)) {
    // user is allowed to see comments
    if (empty($c)) {
        // Comments not requested
        $params['disp_comments'] = false;
        // DO NOT Display the comments if not requested
        $params['disp_comment_form'] = false;
        // DO NOT Display the comments form if not requested
    }
    if (empty($tb) || !$Item->can_receive_pings()) {
        // Trackback not requested or not allowed
        $params['disp_trackbacks'] = false;
        // DO NOT Display the trackbacks if not requested
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_item_feedback.inc.php


示例5: init_menus

 /**
  * Init the menus.
  *
  * Do this as late as possible. Especially after determining the blog ID we work on.
  * This allows to check for proper permissions and build correct cross navigation links.
  *
  * Note: The menu structure is determined by the modules and the plugins.
  * Individual Admin skins can still override the whole menu. In a cumbersome way though.
  */
 function init_menus()
 {
     global $Plugins;
     if (!empty($this->_menus)) {
         // Already initialized!
         return;
     }
     // Let the modules construct the menu:
     // Part 1:
     modules_call_method('build_menu_1');
     // Part 2:
     modules_call_method('build_menu_2');
     // Part 3:
     modules_call_method('build_menu_3');
     // Call AdminAfterMenuInit to notify Plugins that the menu is initialized
     // E.g. the livehits_plugin and weather_plugin use it for adding a menu entry.
     $Plugins->trigger_event('AdminAfterMenuInit');
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:27,代码来源:_adminUI_general.class.php


示例6: Menu

/**
 * @global Menu Evobar menu on the top left (should be useed for content & system management features)
 */
global $topleft_Menu;
$topleft_Menu = new Menu();
/**
 * @global Menu Evobar menu on the top right (should be used for current user's session, profile & prefs features)
 */
global $topright_Menu;
$topright_Menu = new Menu();
// Switch to users locale (if not overridden via REQUEST):
if (!$locale_from_get) {
    locale_temp_switch($current_User->locale);
}
// Let the modules construct the menu:
modules_call_method('build_evobar_menu');
// Call AdminAfterToolbarInit to notify Plugins that the toolbar menus are initialized. Plugins can add entries.
$Plugins->trigger_event('AdminAfterEvobarInit');
?>

<div id="evo_toolbar" class="evo_toolbar_<?php 
echo $Hit->get_agent_name();
?>
">
	<div class="actions_right">
		<?php 
// Display evobar menu:
echo $topright_Menu->get_html_menu(NULL, 'evobar-menu-right');
?>
	</div>
	<div class="actions_left">
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_toolbar.inc.php


示例7: action_icon

        // Display a link to add new meta comment if current user has a permission
        echo action_icon(T_('Add meta comment') . '...', 'new', $admin_url . '?ctrl=items&amp;p=' . $edited_Item->ID . '&amp;comment_type=meta&amp;blog=' . $Blog->ID . '#comments', T_('Add meta comment') . ' &raquo;', 3, 4);
    }
    // Load JS functions to work with meta comments:
    load_funcs('comments/model/_comment_js.funcs.php');
    $Form->end_fieldset();
}
?>

</div>

<div class="right_col col-lg-3 col-md-4">

	<?php 
// ################### MODULES SPECIFIC ITEM SETTINGS ###################
modules_call_method('display_item_settings', array('Form' => &$Form, 'Blog' => &$Blog, 'edited_Item' => &$edited_Item, 'edit_layout' => 'expert', 'fold' => true));
// ############################ WORKFLOW #############################
if ($Blog->get_setting('use_workflow')) {
    // We want to use workflow properties for this blog:
    $Form->begin_fieldset(T_('Workflow properties') . get_manual_link('post-edit-workflow-panel'), array('id' => 'itemform_workflow_props', 'fold' => true));
    echo '<div id="itemform_edit_workflow" class="edit_fieldgroup">';
    $Form->switch_layout('linespan');
    $Form->select_input_array('item_priority', $edited_Item->priority, item_priority_titles(), T_('Priority'), '', array('force_keys_as_values' => true));
    echo ' ';
    // allow wrapping!
    // Load current blog members into cache:
    $UserCache =& get_UserCache();
    // Load only first 21 users to know when we should display an input box instead of full users list
    $UserCache->load_blogmembers($Blog->ID, 21, false);
    if (count($UserCache->cache) > 20) {
        $assigned_User =& $UserCache->get_by_ID($edited_Item->get('assigned_user_ID'), false, false);
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_item_expert.form.php


示例8: load_from_Request


//.........这里部分代码省略.........
            $location_country = param('location_country', 'string', 'hidden');
            $location_region = param('location_region', 'string', 'hidden');
            $location_subregion = param('location_subregion', 'string', 'hidden');
            $location_city = param('location_city', 'string', 'hidden');
            if ($location_city == 'required') {
                // If city is required - all location fields also are required
                $location_country = $location_region = $location_subregion = 'required';
            } else {
                if ($location_subregion == 'required') {
                    // If subregion is required - country & region fields also are required
                    $location_country = $location_region = 'required';
                } else {
                    if ($location_region == 'required') {
                        // If region is required - country field also is required
                        $location_country = 'required';
                    }
                }
            }
            $this->set_setting('location_country', $location_country);
            $this->set_setting('location_region', $location_region);
            $this->set_setting('location_subregion', $location_subregion);
            $this->set_setting('location_city', $location_city);
            // Set to show Latitude & Longitude params for this blog items
            $this->set_setting('show_location_coordinates', param('show_location_coordinates', 'integer', 0));
            // Load custom double & varchar fields
            $custom_field_names = array();
            $this->load_custom_fields('double', $update_cascade_query, $custom_field_names);
            $this->load_custom_fields('varchar', $update_cascade_query, $custom_field_names);
            if (!empty($update_cascade_query)) {
                // Some custom fields were deleted and these fields must be deleted from the item settings table also. Add required query.
                $this->CollectionSettings->add_update_cascade($update_cascade_query);
            }
            // call modules update_collection_features on this blog
            modules_call_method('update_collection_features', array('edited_Blog' => &$this));
        }
        if (in_array('comments', $groups)) {
            // we want to load the workflow checkboxes:
            // load moderation statuses
            $moderation_statuses = get_visibility_statuses('moderation');
            $blog_moderation_statuses = array();
            foreach ($moderation_statuses as $status) {
                if (param('notif_' . $status, 'integer', 0)) {
                    $blog_moderation_statuses[] = $status;
                }
            }
            $this->set_setting('moderation_statuses', implode(',', $blog_moderation_statuses));
            $this->set_setting('comment_quick_moderation', param('comment_quick_moderation', 'string', 'expire'));
            $this->set_setting('allow_item_subscriptions', param('allow_item_subscriptions', 'integer', 0));
            $this->set_setting('comments_detect_email', param('comments_detect_email', 'integer', 0));
            $this->set_setting('comments_register', param('comments_register', 'integer', 0));
        }
        if (in_array('other', $groups)) {
            // we want to load the workflow checkboxes:
            $this->set_setting('enable_sitemaps', param('enable_sitemaps', 'integer', 0));
            $this->set_setting('allow_subscriptions', param('allow_subscriptions', 'integer', 0));
            $this->set_setting('allow_item_subscriptions', param('allow_item_subscriptions', 'integer', 0));
            // Public blog list
            $this->set('in_bloglist', param('blog_in_bloglist', 'integer', 0));
            $this->set_setting('image_size_user_list', param('image_size_user_list', 'string'));
            $this->set_setting('image_size_messaging', param('image_size_messaging', 'string'));
            $this->set_setting('archive_mode', param('archive_mode', 'string', true));
        }
        if (param('allow_comments', 'string', NULL) !== NULL) {
            // Feedback options:
            $this->set_setting('allow_comments', param('allow_comments', 'string', 'any'));
            $this->set_setting('allow_view_comments', param('allow_view_comments', 'string', 'any'));
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:67,代码来源:_blog.class.php


示例9: array

$Form->text_input('item_tags', $item_tags, 40, '', '', array('maxlength' => 255, 'style' => 'width: 100%;'));
echo '</td><td width="1"><!-- for IE7 --></td></tr>';
echo '</table>';
$Form->switch_layout(NULL);
$Form->end_fieldset();
// ####################### PLUGIN FIELDSETS #########################
$Plugins->trigger_event('AdminDisplayItemFormFieldset', array('Form' => &$Form, 'Item' => &$edited_Item, 'edit_layout' => 'simple'));
?>

</div>

<div class="right_col">

	<?php 
// ################### MODULES SPECIFIC ITEM SETTINGS ###################
modules_call_method('display_item_settings', array('Form' => &$Form, 'Blog' => &$Blog, 'edited_Item' => &$edited_Item));
// ################### CATEGORIES ###################
cat_select($Form);
// ################### VISIBILITY / SHARING ###################
$Form->begin_fieldset(T_('Visibility / Sharing'), array('id' => 'itemform_visibility'));
$Form->switch_layout('linespan');
visibility_select($Form, $edited_Item->status);
$Form->switch_layout(NULL);
$Form->end_fieldset();
// ################### COMMENT STATUS ###################
if ($Blog->get_setting('allow_comments') != 'never' && $Blog->get_setting('disable_comments_bypost')) {
    $Form->begin_fieldset(T_('Comments'), array('id' => 'itemform_comments'));
    ?>
			<label title="<?php 
    echo T_('Visitors can leave comments on this post.');
    ?>
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_item_simple.form.php


示例10: array

	<script type="text/javascript">
		<!--
		jQuery( '.feedback_details_container' ).hide();
		//-->
	</script>
	<?php 
}
$Form->end_fieldset();
$Form->begin_fieldset(T_('Voting options'), array('class' => 'feedback_details_container'));
$Form->radio('allow_rating_items', $edited_Blog->get_setting('allow_rating_items'), array($any_option, $registered_option, $member_option, $never_option), T_('Allow star ratings from'), true);
$Form->textarea_input('rating_question', $edited_Blog->get_setting('rating_question'), 3, T_('Star rating question'), array('class' => 'large'));
$Form->checkbox('allow_rating_comment_helpfulness', $edited_Blog->get_setting('allow_rating_comment_helpfulness'), T_('Allow helpful/not helpful'), T_("Allow users to say if a comment was helpful or not."));
$Form->end_fieldset();
// display comments settings provided by optional modules:
// echo 'modules';
modules_call_method('display_collection_comments', array('Form' => &$Form, 'edited_Blog' => &$edited_Blog));
$Form->begin_fieldset(T_('Comment moderation'));
$newstatus_warning_attrs = ' id="newstatus_warning" style="display:' . ($edited_Blog->get_setting('new_feedback_status') == 'published' ? 'inline' : 'none') . '"';
$newstatus_warning = str_replace('$attrs$', $newstatus_warning_attrs, $spammers_warning);
$status_options = get_visibility_statuses('', array('redirected', 'trash'));
if ($edited_Blog->get_setting('new_feedback_status') != 'published') {
    if ($perm_blog_admin) {
        // Only admin can set this setting to 'Public'
        $status_options['published'] .= ' [' . T_('Admin') . ']';
    } else {
        // Remove published status for non-admin users
        unset($status_options['published']);
    }
}
// put this on feedback details container, this way it won't be displayed if comment posting is not allowed
echo '<div class="feedback_details_container">';
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_coll_comments.form.php


示例11: dbinsert

 /**
  * Insert object into DB based on previously recorded changes
  *
  * @return boolean true on success
  */
 function dbinsert()
 {
     global $DB, $current_User, $Plugins;
     $DB->begin('SERIALIZABLE');
     if ($this->status != 'draft') {
         // The post is getting published in some form, set the publish date so it doesn't get auto updated in the future:
         $this->set('dateset', 1);
     }
     if (empty($this->creator_user_ID)) {
         // No creator assigned yet, use current user:
         $this->set_creator_User($current_User);
     }
     // Create new slug with validated title
     $new_Slug = new Slug();
     $new_Slug->set('title', urltitle_validate($this->urltitle, $this->title, $this->ID, false, $new_Slug->dbprefix . 'title', $new_Slug->dbprefix . 'itm_ID', $new_Slug->dbtablename, $this->locale));
     $new_Slug->set('type', 'item');
     $this->set('urltitle', $new_Slug->get('title'));
     $this->update_renderers_from_Plugins();
     $this->update_excerpt();
     if (isset($Plugins)) {
         // Note: Plugins may not be available during maintenance, install or test cases
         // TODO: allow a plugin to cancel update here (by returning false)?
         $Plugins->trigger_event('PrependItemInsertTransact', $params = array('Item' => &$this));
     }
     $this->set_last_touched_ts();
     $dbchanges = $this->dbchanges;
     // we'll save this for passing it to the plugin hook
     if ($result = parent::dbinsert()) {
         // We could insert the item object..
         // Let's handle the extracats:
         $result = $this->insert_update_extracats('insert');
         if ($result) {
             // Let's handle the tags:
             $this->insert_update_tags('insert');
         }
         // save Item settings
         if ($result && isset($this->ItemSettings) && isset($this->ItemSettings->cache[0])) {
             // update item ID in the ItemSettings cache
             $this->ItemSettings->cache[$this->ID] = $this->ItemSettings->cache[0];
             unset($this->ItemSettings->cache[0]);
             $this->ItemSettings->dbupdate();
         }
         if ($result) {
             modules_call_method('update_item_after_insert', array('edited_Item' => $this));
         }
         // Let's handle the slugs:
         // set slug item ID:
         $new_Slug->set('itm_ID', $this->ID);
         // Create tiny slug:
         $new_tiny_Slug = new Slug();
         load_funcs('slugs/model/_slug.funcs.php');
         $tinyurl = getnext_tinyurl();
         $new_tiny_Slug->set('title', $tinyurl);
         $new_tiny_Slug->set('type', 'item');
         $new_tiny_Slug->set('itm_ID', $this->ID);
         if ($result && ($result = $new_Slug->dbinsert() && $new_tiny_Slug->dbinsert())) {
             $this->set('canonical_slug_ID', $new_Slug->ID);
             $this->set('tiny_slug_ID', $new_tiny_Slug->ID);
             if ($result = parent::dbupdate()) {
                 $DB->commit();
                 // save the last tinyurl
                 global $Settings;
                 $Settings->set('tinyurl', $tinyurl);
                 $Settings->dbupdate();
                 if (isset($Plugins)) {
                     // Note: Plugins may not be available during maintenance, install or test cases
                     $Plugins->trigger_event('AfterItemInsert', $params = array('Item' => &$this, 'dbchanges' => $dbchanges));
                 }
             }
         }
         // Update last touched date of this Item and also all categories of this Item
         $this->update_last_touched_date(false, false);
     }
     if (!$result) {
         // Rollback current transaction
         $DB->rollback();
     }
     return $result;
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:84,代码来源:_item.class.php


示例12: require_css

// Require results.css to display thread query results in a table
require_css('results.css');
// Results/tables styles
// Load classes
load_class('messaging/model/_thread.class.php', 'Thread');
load_class('messaging/model/_message.class.php', 'Message');
// Get action parameter from request:
$action = param_action('view');
switch ($action) {
    case 'new':
        // Check permission:
        $current_User->check_perm('perm_messaging', 'reply', true);
        $edited_Thread = new Thread();
        $edited_Message = new Message();
        $edited_Message->Thread =& $edited_Thread;
        modules_call_method('update_new_thread', array('Thread' => &$edited_Thread));
        if (($unsaved_message_params = get_message_params_from_session()) !== NULL) {
            // set Message and Thread saved params from Session
            $edited_Message->text = $unsaved_message_params['message'];
            $edited_Thread->title = $unsaved_message_params['subject'];
            $edited_Thread->recipients = $unsaved_message_params['thrd_recipients'];
            $thrd_recipients_array = $unsaved_message_params['thrd_recipients_array'];
            $thrdtype = $unsaved_message_params['thrdtype'];
        } else {
            if (empty($edited_Thread->recipients)) {
                $edited_Thread->recipients = param('thrd_recipients', 'string', '');
            }
            if (empty($edited_Thread->title)) {
                $edited_Thread->title = param('subject', 'string', '');
            }
        }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:threads.main.php


示例13: header_redirect

        header_redirect(url_add_param($Blog->gen_blogurl(), 'disp=user&user_ID=' . $user_ID));
        break;
    case 'remove_report':
        // Remove current User report from the given user
        // Check that this action request is not a CSRF hacked request:
        $Session->assert_received_crumb('messaging_contacts');
        $user_ID = param('user_ID', 'integer', 0);
        remove_report_from($user_ID);
        $unblocked_message = '';
        if (set_contact_blocked($user_ID, 0)) {
            // the user was unblocked
            $unblocked_message = ' ' . T_('You have also unblocked this user. He will be able to contact you again in the future.');
        }
        $Messages->add(T_('The report was removed.') . $unblocked_message, 'success');
        header_redirect(url_add_param($Blog->gen_blogurl(), 'disp=user&user_ID=' . $user_ID));
        break;
}
modules_call_method('switch_contacts_actions', array('action' => $action));
// var bgxy_expand is used by toggle_filter_area() and toggle_clickopen()
// var htsrv_url is used for AJAX callbacks
add_js_headline("// Paths used by JS functions:\r\n\t\tvar bgxy_expand = '" . get_icon('expand', 'xy') . "';\r\n\t\tvar bgxy_collapse = '" . get_icon('collapse', 'xy') . "';");
// Require results.css to display contact query results in a table
require_css('results.css');
// Results/tables styles
require_js('form_extensions.js', 'blog');
// Used for combo_box
// Require functions.js to show/hide a panel with filters
require_js('functions.js', 'blog');
// Include this file to expand/collapse the filters panel when JavaScript is disabled
require_once $inc_path . '_filters.inc.php';
require $ads_current_skin_path . 'index.main.php';
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:contacts.main.php


示例14: T_

</p>

			<div class="checkbox">
				<label>
					<input type="checkbox" name="create_sample_contents" id="create_sample_contents" value="1" checked="checked" />
					<?php 
        echo T_('Install sample collections &amp; sample contents. The sample posts explain several features of b2evolution. This is highly recommended for new users.');
        ?>
				</label>
				<div id="create_sample_contents_options" style="margin:10px 0 0 20px">
					<?php 
        echo T_('Which demo collections would you like to install?');
        // Display the collections to select which install
        $collections = array('home' => T_('Home'), 'a' => T_('Blog A'), 'b' => T_('Blog B'), 'photos' => T_('Photos'), 'forums' => T_('Forums'), 'manual' => T_('Manual'));
        // Allow all modules to set what collections should be installed
        $module_collections = modules_call_method('get_demo_collections');
        if (!empty($module_collections)) {
            foreach ($module_collections as $module_key => $module_colls) {
                foreach ($module_colls as $module_coll_key => $module_coll_title) {
                    $collections[$module_key . '_' . $module_coll_key] = $module_coll_title;
                }
            }
        }
        foreach ($collections as $coll_index => $coll_title) {
            // Display the checkboxes to select what demo collection to install
            ?>
					<div class="checkbox" style="margin-left:1em">
						<label>
							<input type="checkbox" name="collections[]" id="collection_<?php 
            echo $coll_index;
            ?>
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:index.php


示例15: array

                // first group of this user
                $cache_user_contacts_groups[$group->user_ID] = $group_name;
            }
        }
    }
    if (isset($cache_user_contacts_groups[$user_ID])) {
        // user has groups
        echo $cache_user_contacts_groups[$user_ID];
    }
}
$Results->cols[] = array('th' => T_('Groups'), 'th_class' => 'shrinkwrap', 'td_class' => 'left nowrap', 'td' => '%contacts_groups( #mct_to_user_ID# )%');
$Results->display($display_params);
if (count($Results->rows) > 0) {
    // Display actions buttons
    global $module_contacts_list_params;
    modules_call_method('get_contacts_list_params');
    $Form = new Form(get_dispctrl_url('contacts'), 'add_group_contacts');
    echo '<div class="form_send_contacts">';
    $multi_action_icon = get_icon('multi_action', 'imgtag', array('style' => 'margin:0 2px 0 14px;position:relative;top:-5px;'));
    $Form->button_input(array('type' => 'button', 'value' => $module_contacts_list_params['title_selected'], 'onclick' => 'location.href=\'' . $module_contacts_list_params['recipients_link'] . '\'', 'id' => 'send_selected_recipients', 'input_prefix' => $multi_action_icon));
    echo '</div>';
    $Form->switch_layout('none');
    $Form->switch_template_parts(array('formstart' => '<div class="form_add_contacts">', 'labelstart' => '<span class="label">', 'labelend' => '</span> <span class="controls">', 'formend' => '</div>'));
    $Form->begin_form();
    $Form->add_crumb('messaging_contacts');
    $Form->hidden('users', '');
    if (isset($module_contacts_list_params['form_hiddens']) && !empty($module_contacts_list_params['form_hiddens'])) {
        // Append the hidden input elements from module
        foreach ($module_contacts_list_params['form_hiddens'] as $hidden_input) {
            $Form->hidden($hidden_input['name'], $hidden_input['value']);
        }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_contact_list.view.php


示例16: statuses_where_clause

/**
 * Construct the where clause to limit retrieved posts/comment on their status
 *
 * TODO: asimo> would be good to move this function to an items and comments common file
 *
 * @param Array statuses of posts/comments we want to get
 * @param string post/comment table db prefix
 * @param integer blog ID
 * @param string permission prefix: 'blog_post!' or 'blog_comment!'
 * @param boolean filter statuses by the current user perm and current page, by default is true. It should be false only e.g. when we have to count comments awaiting moderation.
 * @return string statuses where condition
 */
function statuses_where_clause($show_statuses = NULL, $dbprefix = 'post_', $req_blog = NULL, $perm_prefix = 'blog_post!', $filter_by_perm = true, $author_filter = NULL)
{
    global $current_User, $blog, $DB;
    if (is_null($req_blog)) {
        // try to init request blog if it was not set
        global $blog;
        $req_blog = $blog;
    }
    if (empty($show_statuses)) {
        // use in-skin statuses if show_statuses is empty
        $show_statuses = get_inskin_statuses();
    }
    // init where clauses array
    $where = array();
    // Check modules item statuses where condition but only in case of the items, and don't need to check in case of comments
    if ($req_blog && $perm_prefix == 'blog_post!') {
        // If requested blog is set, then set additional "where" clauses from modules method, before we would manipulate the $show_statuses array
        $modules_condition = modules_call_method('get_item_statuses_where_clause', array('blog_ID' => $req_blog, 'statuses' => $show_statuses));
        if (!empty($modules_condition)) {
            foreach ($modules_condition as $condition) {
                if (!empty($condition)) {
                    // condition is not empty
                    $where[] = $condition;
                }
            }
        }
    }
    if (is_logged_in(false)) {
        // User is logged in and the account was activated
        if ($current_User->check_perm('blogs', 'editall', false)) {
            // User has permission to all blogs posts and comments, we don't have to check blog specific permissions.
            $allowed_statuses_cond = get_allowed_statuses_condition($show_statuses, $dbprefix, NULL, $perm_prefix);
            if (!empty($allowed_statuses_cond)) {
                // condition is not empty
                $where[] = $allowed_statuses_cond;
            }
            $filter_by_perm = false;
            $show_statuses = NULL;
        } elseif (!empty($author_filter) && $author_filter != $current_User->ID) {
            // Author filter is set, but current_User is not the filtered user, then these statuses are not visible for sure
            $show_statuses = array_diff($show_statuses, array('private', 'draft'));
        }
    }
    if ($req_blog == 0 && $filter_by_perm) {
        // This is a very special case when we must check visibility statuses from each blog separately
        // Note: This case should not be called frequently, it may be really slow!!
        $where_condition = '';
        $condition = '';
        if (in_array('published', $show_statuses)) {
            // 'published' status is always allowed in case of all blogs, handle this condition separately
            $where_condition = '( ' . $dbprefix . 'status = "published" )';
            $condition = ' OR ';
        }
        if (!is_logged_in(false)) {
            // When user is not logged in only the 'published' status is allowed, don't check more
            return $where_condition;
        }
        if (in_array('community', $show_statuses)) {
            // 'community' status is always allowed in case of all blogs when a user is logged in, handle this condition separately
            $where_condition .= $condition . '( ' . $dbprefix . 'status = "community" )';
            $condition = ' OR ';
        }
        // Remove 'published' and 'community' statuses because those were already handled
        $show_statuses = array_diff($show_statuses, array('published', 'community'));
        if (empty($show_statuses)) {
            // return if there are no other status
            return $where_condition;
        }
        // Select each blog
        $blog_ids = $DB->get_col('SELECT blog_ID FROM T_blogs');
        $sub_condition = '';
        foreach ($blog_ids as $blog_id) {
            // create statuses where clause condition for each blog separately
            $status_perm = statuses_where_clause($show_statuses, $dbprefix, $blog_id, $perm_prefix, $filter_by_perm, $author_filter);
            if ($status_perm) {
                // User has permission to view some statuses on this blog
                $sub_condition .= '( ( cat_blog_ID = ' . $blog_id . ' ) AND' . $status_perm . ' ) OR ';
            }
        }
        if ($dbprefix == 'post_') {
            // Item query condition
            $from_table = 'FROM T_items__item';
            $reference_column = 'post_ID';
        } else {
            // Comment query condition
            $from_table = 'FROM T_comments';
            $reference_column = 'comment_post_ID';
        }
//.........这里部分代码省略.........
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:101,代码来源:_item.funcs.php


示例17: define

     * Prevent double loading since require_once won't work in all situations
     * on windows when some subfolders have caps :(
     * (Check it out on static page generation)
     */
    return;
}
define('EVO_MAIN_INIT', true);
// == 1. Initialize the most basic stuff: ==
require dirname(__FILE__) . '/_init_base.inc.php';
if ($use_db) {
    // == 2. In 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP modules_path函数代码示例发布时间:2022-05-15
下一篇:
PHP modulehook函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap