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

PHP url_add_param函数代码示例

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

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



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

示例1: td_file_properties_link

function td_file_properties_link($File, $link_text)
{
    global $current_User;
    if (is_object($File) && $current_User->check_perm('files', 'edit_allowed', false, $File->get_FileRoot())) {
        // Check if File object is correct and current user has an access
        return '<a href="' . url_add_param($File->get_linkedit_url(), 'action=edit_properties&amp;fm_selected[]=' . rawurlencode($File->get_rdfp_rel_path()) . '&amp;' . url_crumb('file')) . '">' . $link_text . '</a>';
    } else {
        return $link_text;
    }
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:10,代码来源:_file_likes.view.php


示例2: display

 /**
  * Display the widget!
  *
  * @param array MUST contain at least the basic display params
  */
 function display($params)
 {
     global $Blog;
     if (empty($Blog) || $Blog->get_setting('allow_access') != 'members') {
         // Use this widget only when blog is llowed only for members
         return;
     }
     $this->init_display($params);
     echo $this->disp_params['before'];
     echo '<a href="' . url_add_param($Blog->get('usersurl'), 'filter=new&amp;membersonly=1') . '">' . sprintf(T_('%d members'), $this->get_members_count()) . '</a>';
     echo $this->disp_params['after'];
     return true;
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:18,代码来源:_member_count.widget.php


示例3: test_url_add_param

 /**
  * Test {@link url_add_param()}
  */
 function test_url_add_param()
 {
     $this->assertEqual(url_add_param('foo', 'bar', '&'), 'foo?bar');
     $this->assertEqual(url_add_param('foo#anchor', 'bar', '&'), 'foo?bar#anchor');
     $this->assertEqual(url_add_param('foo?', 'bar', '&'), 'foo?bar');
     $this->assertEqual(url_add_param('foo?#anchor', 'bar', '&'), 'foo?bar#anchor');
     $this->assertEqual(url_add_param('?', 'bar', '&'), '?bar');
     $this->assertEqual(url_add_param('?#anchor', 'bar', '&'), '?bar#anchor');
     $this->assertEqual(url_add_param('#anchor', 'bar', '&'), '?bar#anchor');
     $this->assertEqual(url_add_param('?', array('foo' => 1)), '?foo=1');
     $this->assertEqual(url_add_param('?', array('foo' => array(1 => 2))), '?foo%5B1%5D=2');
     $this->assertEqual(url_add_param('?', array('foo' => array(1, 2))), '?foo%5B%5D=1&amp;foo%5B%5D=2');
     $this->assertEqual(url_add_param('?', array('foo' => '100%')), '?foo=100%25');
     $this->assertEqual(url_add_param('?', array('foo' => '1&2')), '?foo=1%262');
     $this->assertEqual(url_add_param('?', array('foo' => array('bar' => 1))), '?foo%5Bbar%5D=1');
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:19,代码来源:url.funcs.simpletest.php


示例4: contacts_groups

function contacts_groups($user_ID)
{
    global $current_User, $DB, $cache_user_contacts_groups;
    if (!is_array($cache_user_contacts_groups)) {
        // Execute only first time to init cache
        $cache_user_contacts_groups = array();
        // Get contacts of current user
        $groups_SQL = new SQL();
        $groups_SQL->SELECT('cgr_ID AS ID, cgu_user_ID AS user_ID, cgr_name AS name');
        $groups_SQL->FROM('T_messaging__contact_groupusers');
        $groups_SQL->FROM_add('LEFT JOIN T_messaging__contact_groups ON cgu_cgr_ID = cgr_ID');
        $groups_SQL->WHERE('cgr_user_ID = ' . $current_User->ID);
        $groups_SQL->ORDER_BY('cgr_name');
        $groups = $DB->get_results($groups_SQL->get());
        $remove_link = url_add_param(get_dispctrl_url('contacts'), 'action=remove_user&amp;view=contacts&amp;' . url_crumb('messaging_contacts'));
        foreach ($groups as $group) {
            // Init cache for groups for each contact of current user
            $group_name = $group->name . action_icon(T_('Remove user from this group'), 'remove', url_add_param($remove_link, 'user_ID=' . $group->user_ID . '&amp;group_ID=' . $group->ID));
            if (isset($cache_user_contacts_groups[$group->user_ID])) {
                // nth group of this user
                $cache_user_contacts_groups[$group->user_ID] .= '<br />' . $group_name;
            } else {
                // 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];
    }
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:32,代码来源:_contact_list.view.php


示例5: rawurlencode

$current_skin_ID = $edited_Blog->get_setting($skin_type . '_skin_ID', true);
if ($current_User->check_perm('options', 'edit', false)) {
    // We have permission to modify:
    $block_item_Widget->global_icon(T_('Install new skin...'), 'new', $dispatcher . '?ctrl=skins&amp;action=new&amp;redirect_to=' . rawurlencode(url_rel_to_same_host(regenerate_url('', 'skinpage=selection', '', '&'), $admin_url)), T_('Install new'), 3, 4);
    $block_item_Widget->global_icon(T_('Keep current skin!'), 'close', regenerate_url('skinpage'), ' ' . T_('Don\'t change'), 3, 4);
}
$block_item_Widget->disp_template_replaced('block_start');
$SkinCache =& get_SkinCache();
$SkinCache->load_all();
if ($display_same_as_normal) {
    $skinshot_title = T_('Same as normal skin');
    $select_url = '?ctrl=coll_settings&tab=skin&blog=' . $edited_Blog->ID . '&amp;action=update&amp;skinpage=selection&amp;' . $skin_type . '_skin_ID=0&amp;' . url_crumb('collection');
    $disp_params = array('function' => 'select', 'selected' => $current_skin_ID == '0', 'select_url' => $select_url);
    Skin::disp_skinshot($skinshot_title, $skinshot_title, $disp_params);
}
$SkinCache->rewind();
while (($iterator_Skin =& $SkinCache->get_next()) != NULL) {
    if ($iterator_Skin->type != $skin_type) {
        // This skin cannot be used here...
        continue;
    }
    $selected = $current_skin_ID == $iterator_Skin->ID;
    $blog_skin_param = $skin_type . '_skin_ID=';
    $select_url = '?ctrl=coll_settings&tab=skin&blog=' . $edited_Blog->ID . '&amp;action=update&amp;skinpage=selection&amp;' . $blog_skin_param . $iterator_Skin->ID . '&amp;' . url_crumb('collection');
    $preview_url = url_add_param($edited_Blog->gen_blogurl(), 'tempskin=' . rawurlencode($iterator_Skin->folder));
    $disp_params = array('function' => 'select', 'selected' => $selected, 'select_url' => $select_url, 'function_url' => $preview_url);
    // Display skinshot:
    Skin::disp_skinshot($iterator_Skin->folder, $iterator_Skin->name, $disp_params);
}
echo '<div class="clear"></div>';
$block_item_Widget->disp_template_replaced('block_end');
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:31,代码来源:_coll_skin.view.php


示例6: url_add_param

            if ($Messages->has_errors()) {
                // Redirect to a form for requesting an activation again if some errors exist
                $redirect = url_add_param($redirect, 'force_request=1', '&');
            }
        } elseif ($action == 'lostpassword') {
            // redirect to inskin lost password page
            $redirect = $Blog->get('lostpasswordurl', array('glue' => '&'));
            if (!empty($lostpassword_error)) {
                // Set this param to know after redirection if error was here
                $redirect = url_add_param($redirect, 'field_error=1', '&');
            }
        } else {
            // redirect to inskin login page
            $redirect = $Blog->get('loginurl', array('glue' => '&'));
        }
        $redirect = url_add_param($redirect, 'redirect_to=' . $redirect_to, '&');
        header_redirect($redirect);
        // already exited here
        exit(0);
    }
}
/**
 * Display standard login screen:
 */
switch ($action) {
    case 'lostpassword':
        // Lost password:
        $page_title = T_('Lost your password?');
        $hidden_params = array('redirect_to' => url_rel_to_same_host($redirect_to, $secure_htsrv_url));
        $wrap_width = '480px';
        // Use the links in the form title
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:login.php


示例7: reply_link

 /**
  * Displays link for replying to the Comment if blog's setting allows this action
  *
  * @param string to display before link
  * @param string to display after link
  * @param string link text
  * @param string link title
  * @param string class name
  */
 function reply_link($before = ' ', $after = ' ', $text = '#', $title = '#', $class = '')
 {
     if (!is_logged_in(false)) {
         return false;
     }
     if (empty($this->ID)) {
         // Happens in Preview
         return false;
     }
     $this->get_Item();
     $this->Item->load_Blog();
     if (!$this->Item->Blog->get_setting('threaded_comments')) {
         // A blog's setting is OFF for replying to the comment
         return false;
     }
     if (!$this->Item->can_comment()) {
         // The comments are disabled
         return false;
     }
     // ID of a replying comment
     $comment_reply_ID = param('reply_ID', 'integer', 0);
     if ($text == '#') {
         // Use default text
         $text = $this->ID == $comment_reply_ID ? T_('You are currently replying to this comment') : T_('Reply to this comment');
     }
     if ($title == '#') {
         // Use default title
         $title = T_('Reply to this comment');
     }
     $class .= ' comment_reply';
     if ($this->ID == $comment_reply_ID) {
         // This comment is using for replying now
         $class .= ' active';
     }
     $class = ' class="' . trim($class) . '"';
     $url = url_add_param($this->Item->get_permanent_url(), 'reply_ID=' . $this->ID . '&amp;redir=no') . '#form_p' . $this->Item->ID;
     echo $before;
     // Display a link
     echo '<a href="' . $url . '" title="' . $title . '"' . $class . ' rel="' . $this->ID . '">' . $text . '</a>';
     echo $after;
     return true;
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:51,代码来源:_comment.class.php


示例8: _wp_mw_getcategories

/**
 * metaWeblog.getCategories
 *
 * @see http://www.xmlrpc.com/metaWeblogApi#metawebloggetcategories
 *
 * @param xmlrpcmsg XML-RPC Message
 *					0 blogid (string): Unique identifier of the blog the post will be added to.
 *						Currently ignored in b2evo, in favor of the category.
 *					1 username (string): Login for a Blogger user who has permission to edit the given
 *						post (either the user who originally created it or an admin of the blog).
 *					2 password (string): Password for said username.
 * @param array of params to narrow category selection
 */
function _wp_mw_getcategories($m, $params = array())
{
    global $DB, $Settings;
    // CHECK LOGIN:
    /**
     * @var User
     */
    if (!($current_User =& xmlrpcs_login($m, 1, 2))) {
        // Login failed, return (last) error:
        return xmlrpcs_resperror();
    }
    // GET BLOG:
    /**
     * @var Blog
     */
    if (!($Blog =& xmlrpcs_get_Blog($m, 0))) {
        // Login failed, return (last) error:
        return xmlrpcs_resperror();
    }
    $SQL = new SQL();
    $SQL->SELECT('cat_ID, cat_name, cat_order');
    $SQL->FROM('T_categories');
    $SQL->WHERE($Blog->get_sql_where_aggregate_coll_IDs('cat_blog_ID'));
    if (!empty($params['search'])) {
        // Category name starts with 'search'
        $SQL->WHERE_and('cat_name LIKE "' . $DB->like_escape($params['search']) . '%"');
    }
    if ($Settings->get('chapter_ordering') == 'manual') {
        // Manual order
        $SQL->ORDER_BY('cat_order');
    } else {
        // Alphabetic order
        $SQL->ORDER_BY('cat_name');
    }
    $rows = $DB->get_results($SQL->get());
    if ($DB->error) {
        // DB error
        return xmlrpcs_resperror(99, 'DB error: ' . $DB->last_error);
        // user error 9
    }
    $total_rows = count($rows);
    logIO('Categories: ' . $total_rows);
    $ChapterCache =& get_ChapterCache();
    $data = array();
    for ($i = 0; $i < $total_rows; $i++) {
        if (!empty($params['limit']) && $i >= $params['limit']) {
            // We found enough, exit the loop
            break;
        }
        $Chapter =& $ChapterCache->get_by_ID($rows[$i]->cat_ID, false, false);
        if (!$Chapter) {
            continue;
        }
        if (isset($params['search'])) {
            // wp.suggestCategories
            $data[] = new xmlrpcval(array('category_id' => new xmlrpcval(intval($Chapter->ID)), 'category_name' => new xmlrpcval($Chapter->name)), 'struct');
        } else {
            $data[] = new xmlrpcval(array('categoryId' => new xmlrpcval(intval($Chapter->ID)), 'parentId' => new xmlrpcval(intval($Chapter->parent_ID)), 'description' => new xmlrpcval($Chapter->name), 'categoryDescription' => new xmlrpcval($Chapter->description), 'categoryName' => new xmlrpcval($Chapter->name), 'htmlUrl' => new xmlrpcval($Chapter->get_permanent_url()), 'rssUrl' => new xmlrpcval(url_add_param($Chapter->get_permanent_url(), 'tempskin=_rss2'))), 'struct');
        }
    }
    logIO('OK.');
    return new xmlrpcresp(new xmlrpcval($data, 'array'));
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:76,代码来源:_xmlrpcs.funcs.php


示例9: user_prevnext_links

    user_prevnext_links(array('user_tab' => 'avatar'));
    // ------------- END OF PREV/NEXT USER LINKS -------------------
}
$Form = new Form($form_action, 'user_checkchanges');
if (is_admin_page()) {
    $form_class = 'fform';
    $Form->title_fmt = '<span style="float:right">$global_icons$</span><div>$title$</div>' . "\n";
    $ctrl_param = '?ctrl=user&amp;user_tab=avatar&amp;user_ID=' . $edited_User->ID;
    $form_title = '';
    $form_class = 'fform';
    $Form->title_fmt = '<span style="float:right">$global_icons$</span><div>$title$</div>' . "\n";
} else {
    global $Blog;
    $form_title = '';
    $form_class = 'bComment';
    $ctrl_param = url_add_param($Blog->gen_blogurl(), 'disp=' . $disp);
}
if ($display_mode != 'js' && is_admin_page()) {
    if (!$user_profile_only) {
        echo_user_actions($Form, $edited_User, $action);
    }
    $form_text_title = T_('Crop profile picture');
    // used for js confirmation message on leave the changed form
    $form_title = get_usertab_header($edited_User, '', $form_text_title);
}
// Display this error when JS is not enabled
echo '<noscript>' . '<p class="error text-danger">' . T_('Please activate Javascript in your browser in order to use this feature.') . '</p>' . '<style type="text/css">form#user_checkchanges { display:none }</style>' . '</noscript>';
$Form->begin_form($form_class, $form_title, array('title' => isset($form_text_title) ? $form_text_title : $form_title));
if (is_admin_page()) {
    $Form->hidden_ctrl();
} else {
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_user_crop.form.php


示例10: handle_htsrv_action

 /**
  * Handle messaging module htsrv actions
  */
 function handle_htsrv_action()
 {
     global $current_User, $Blog, $Session, $Messages, $samedomain_htsrv_url;
     // Init objects we want to work on.
     $action = param_action(true, true);
     $disp = param('disp', '/^[a-z0-9\\-_]+$/', 'threads');
     // Check that this action request is not a CSRF hacked request:
     $Session->assert_received_crumb('messaging_' . $disp);
     // Load classes
     load_class('messaging/model/_thread.class.php', 'Thread');
     load_class('messaging/model/_message.class.php', 'Message');
     if (!is_logged_in()) {
         // user must be logged in
         debug_die('User must be logged in to proceed with messaging updates!');
     }
     // Check permission:
     $current_User->check_perm('perm_messaging', 'reply', true);
     // set where to redirect
     $redirect_to = param('redirect_to', 'url', NULL);
     if (empty($redirect_to)) {
         if (isset($Blog)) {
             $redirect_to = url_add_param($Blog->gen_baseurl(), 'disp=' . $disp);
         } else {
             $redirect_to = url_add_param($baseurl, 'disp=' . $disp);
         }
     }
     if ($disp != 'contacts' && ($thrd_ID = param('thrd_ID', 'integer', '', true))) {
         // Load thread from cache:
         $ThreadCache =& get_ThreadCache();
         if (($edited_Thread =& $ThreadCache->get_by_ID($thrd_ID, false)) === false) {
             unset($edited_Thread);
             forget_param('thrd_ID');
             $Messages->add(sprintf(T_('Requested &laquo;%s&raquo; object does not exist any longer.'), T_('Thread')), 'error');
             $action = 'nil';
         }
     }
     switch ($disp) {
         // threads action
         case 'threads':
             if ($action != 'create') {
                 // Make sure we got a thrd_ID:
                 param('thrd_ID', 'integer', true);
             }
             switch ($action) {
                 case 'create':
                     // create thread
                     // check if create new thread is allowed
                     if (check_create_thread_limit()) {
                         // max new threads limit reached, don't allow to create new thread
                         debug_die('Invalid request, new conversation limit already reached!');
                     }
                     if (!create_new_thread()) {
                         // unsuccessful new thread creation
                         global $edited_Thread, $edited_Message, $thrd_recipients, $thrd_recipients_array;
                         $redirect_to .= '&action=new';
                         // save new message and thread params into the Session to not lose the content
                         $unsaved_message_params = array();
                         $unsaved_message_params['subject'] = $edited_Thread->title;
                         $unsaved_message_params['message'] = $edited_Message->text;
                         $unsaved_message_params['thrdtype'] = param('thrdtype', 'string', 'individual');
                         // alternative: discussion
                         $unsaved_message_params['thrd_recipients'] = $thrd_recipients;
                         $unsaved_message_params['thrd_recipients_array'] = $thrd_recipients_array;
                         save_message_params_to_session($unsaved_message_params);
                     }
                     break;
                 case 'delete':
                     // delete thread
                     // Check permission:
                     $current_User->check_perm('perm_messaging', 'delete', true);
                     $confirmed = param('confirmed', 'integer', 0);
                     if ($confirmed) {
                         $msg = sprintf(T_('Thread &laquo;%s&raquo; deleted.'), $edited_Thread->dget('title'));
                         $edited_Thread->dbdelete(true);
                         unset($edited_Thread);
                         forget_param('thrd_ID');
                         $Messages->add($msg, 'success');
                     } else {
                         $delete_url = $samedomain_htsrv_url . 'action.php?mname=messaging&thrd_ID=' . $edited_Thread->ID . '&action=delete&confirmed=1&redirect_to=' . $redirect_to . '&' . url_crumb('messaging_threads');
                         $ok_button = '<span class="linkbutton"><a href="' . $delete_url . '">' . T_('I am sure!') . '!</a></span>';
                         $cancel_button = '<span class="linkbutton"><a href="' . $redirect_to . '">CANCEL</a></span>';
                         $msg = sprintf(T_('You are about to delete all messages in the conversation &laquo;%s&raquo;.'), $edited_Thread->dget('title'));
                         $msg .= '<br />' . T_('This CANNOT be undone!') . '<br />' . T_('Are you sure?') . '<br /><br />' . $ok_button . "\t" . $cancel_button;
                         $Messages->add($msg, 'error');
                     }
                     break;
                 case 'leave':
                     // user wants to leave the thread
                     leave_thread($edited_Thread->ID, $current_User->ID, false);
                     $Messages->add(sprintf(T_('You have successfuly left the &laquo;%s&raquo; conversation!'), $edited_Thread->get('title')), 'success');
                     break;
                 case 'close':
                     // close the thread
                 // close the thread
                 case 'close_and_block':
                     // close the thread and block contact
                     leave_thread($edited_Thread->ID, $current_User->ID, true);
//.........这里部分代码省略.........
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:101,代码来源:_messaging.init.php


示例11: ON

$sql = 'SELECT T_blogs.*, user_login
					FROM T_blogs INNER JOIN T_users ON blog_owner_user_ID = user_ID';
if (!$current_User->check_perm('blogs', 'view')) {
    // We do not have perm to view all blogs... we need to restrict to those we're a member of:
    $sql .= " LEFT JOIN T_coll_user_perms ON (blog_advanced_perms <> 0\r\n\t\t       \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND blog_ID = bloguser_blog_ID\r\n\t\t       \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND bloguser_user_ID = {$current_User->ID} )\r\n\t\t       LEFT JOIN T_coll_group_perms ON (blog_advanced_perms <> 0\r\n\t\t          \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND blog_ID = bloggroup_blog_ID\r\n\t\t          \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND bloggroup_group_ID = {$current_User->group_ID} )\r\n\t\t       WHERE blog_owner_user_ID = {$current_User->ID}\r\n\t\t       \t\t\t\tOR bloguser_ismember <> 0\r\n\t\t\t\t\t\t\t\t \tOR bloggroup_ismember <> 0";
    $no_results = T_('Sorry, you have no permission to edit/view any blog\'s properties.');
} else {
    $no_results = T_('No blog has been created yet!');
}
// Create result set:
$Results =& new Results($sql, 'blog_');
$Results->Cache =& get_Cache('BlogCache');
$Results->title = T_('Blog list');
$Results->no_results_text = $no_results;
if ($current_User->check_perm('blogs', 'create')) {
    $Results->global_icon(T_('New blog...'), 'new', url_add_param($dispatcher, 'ctrl=collections&amp;action=new'), T_('New blog...'), 3, 4);
}
$Results->cols[] = array('th' => T_('ID'), 'order' => 'blog_ID', 'th_class' => 'shrinkwrap', 'td_class' => 'shrinkwrap', 'td' => '$blog_ID$');
function disp_coll_name($coll_name, $coll_ID)
{
    global $current_User, $ctrl;
    if ($ctrl == 'dashboard') {
        // Dashboard
        $edit_url = regenerate_url('ctrl', 'ctrl=dashboard&amp;blog=' . $coll_ID);
        $r = '<a href="' . $edit_url . '">';
        $r .= $coll_name;
        $r .= '</a>';
    } elseif ($current_User->check_perm('blog_properties', 'edit', false, $coll_ID)) {
        // Blog setting & can edit
        $edit_url = regenerate_url('ctrl', 'ctrl=coll_settings&amp;blog=' . $coll_ID);
        $r = '<a href="' . $edit_url . '" title="' . T_('Edit properties...') . '">';
开发者ID:LFSF,项目名称:oras,代码行数:31,代码来源:_coll_list.view.php


示例12: wp_gettags

/**
 * wp.getTags
 *
 * @see http://codex.wordpress.org/XML-RPC_wp#wp.getTags
 *
 * @param xmlrpcmsg XML-RPC Message
 *					0 blogid (int): Unique identifier of the blog.
 *					1 username (string): User login.
 *					2 password (string): Password for said username.
 */
function wp_gettags($m)
{
    // CHECK LOGIN:
    /**
     * @var User
     */
    if (!($current_User =& xmlrpcs_login($m, 1, 2))) {
        // Login failed, return (last) error:
        return xmlrpcs_resperror();
    }
    // GET BLOG:
    /**
     * @var Blog
     */
    if (!($Blog =& xmlrpcs_get_Blog($m, 0))) {
        // Login failed, return (last) error:
        return xmlrpcs_resperror();
    }
    $data = array();
    $tags = get_tags($Blog->ID);
    if (!empty($tags)) {
        logIO('Got ' . count($tags) . ' tags');
        load_funcs('_core/_url.funcs.php');
        $BlogCache =& get_BlogCache();
        foreach ($tags as $tag) {
            if (($l_Blog =& $BlogCache->get_by_id($tag->cat_blog_ID, false)) === false) {
                continue;
            }
            $tag_url = $l_Blog->gen_tag_url($tag->tag_name);
            $data[] = new xmlrpcval(array('tag_id' => new xmlrpcval($tag->tag_ID, 'int'), 'name' => new xmlrpcval($tag->tag_name), 'count' => new xmlrpcval($tag->tag_count, 'int'), 'slug' => new xmlrpcval(''), 'html_url' => new xmlrpcval($tag_url), 'rss_url' => new xmlrpcval(url_add_param($tag_url, 'tempskin=_rss2', '&'))), 'struct');
        }
    }
    logIO('OK.');
    return new xmlrpcresp(new xmlrpcval($data, 'array'));
}
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:45,代码来源:_wordpress.api.php


示例13: get_login_url

            $link_log_in = 'href="' . get_login_url('blocked comment email', $commented_Item->get_url('public_view')) . '"';
            $link_register = 'href="' . get_user_register_url($commented_Item->get_url('public_view'), 'blocked comment email') . '"';
            $Messages->add(sprintf(T_('Your comment contains an email address. Please <a %s>log in</a> or <a %s>create an account now</a> instead. This will allow people to send you private messages without revealing your email address to SPAM robots.'), $link_log_in, $link_register), 'error');
            // Save the user data if he will go to register form after this action
            $register_user = array('name' => $Comment->author, 'email' => $Comment->author_email);
            $Session->set('core.register_user', $register_user);
        } else {
            // No registration
            $Messages->add(T_('Your comment contains an email address. We recommend you check the box "Allow message form." below instead. This will allow people to contact you without revealing your email address to SPAM robots.'), 'error');
        }
    }
    // Passthrough comment_cookies & comment_allow_msgform params:
    // fp> moved this down here in order to keep return URLs clean whenever this is not needed.
    $redirect_to = url_add_param($redirect_to, 'redir=no&comment_cookies=' . $comment_cookies . '&comment_allow_msgform=' . $comment_allow_msgform, '&');
    if (!empty($reply_ID)) {
        $redirect_to = url_add_param($redirect_to, 'reply_ID=' . $reply_ID, '&');
    }
    $redirect_to .= '#comment_preview';
    header_redirect();
    exit(0);
} else {
    // delete any preview comment from session data:
    $Session->delete('core.preview_Comment');
}
// RECORD comment:
$result = $Comment->dbinsert();
// Create links
if ($result && !empty($preview_attachments)) {
    global $DB;
    load_class('links/model/_linkcomment.class.php', 'LinkComment');
    $order = 1;
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:comment_post.php


示例14: display

 /**
  * Display the widget!
  *
  * @param array MUST contain at least the basic display params
  */
 function display($params)
 {
     /**
      * @var Blog
      */
     global $Blog;
     $this->init_display($params);
     // Collection common links:
     echo $this->disp_params['block_start'];
     // Display title if requested
     $this->disp_title();
     echo $this->disp_params['list_start'];
     if ($this->disp_params['show_recently']) {
         echo $this->disp_params['item_start'];
         echo '<strong><a href="' . $Blog->get('url') . '">' . T_('Recently') . '</a></strong>';
         echo $this->disp_params['item_end'];
     }
     if ($this->disp_params['show_search']) {
         echo $this->disp_params['item_start'];
         echo '<strong><a href="' . $Blog->get('searchurl') . '">' . T_('Search') . '</a></strong>';
         echo $this->disp_params['item_end'];
     }
     if ($this->disp_params['show_postidx']) {
         echo $this->disp_params['item_start'];
         echo '<strong><a href="' . $Blog->get('postidxurl') . '">' . T_('Post index') . '</a></strong>';
         echo $this->disp_params['item_end'];
     }
     if ($this->disp_params['show_archives']) {
         // fp> TODO: don't display this if archives plugin not installed... or depluginize archives (I'm not sure)
         echo $this->disp_params['item_start'];
         echo '<strong><a href="' . $Blog->get('arcdirurl') . '">' . T_('Archives') . '</a></strong>';
         echo $this->disp_params['item_end'];
     }
     if ($this->disp_params['show_categories']) {
         echo $this->disp_params['item_start'];
         echo '<strong><a href="' . $Blog->get('catdirurl') . '">' . T_('Categories') . '</a></strong>';
         echo $this->disp_params['item_end'];
     }
     if ($this->disp_params['show_mediaidx']) {
         echo $this->disp_params['item_start'];
         echo '<strong><a href="' . $Blog->get('mediaidxurl') . '">' . T_('Photo index') . '</a></strong>';
         echo $this->disp_params['item_end'];
     }
     if ($this->disp_params['show_latestcomments'] && $Blog->get_setting('comments_latest')) {
         // Display link to latest comments if this feature is enabled for current blog
         echo $this->disp_params['item_start'];
         echo '<strong><a href="' . $Blog->get('lastcommentsurl') . '">' . T_('Latest comments') . '</a></strong>';
         echo $this->disp_params['item_end'];
     }
     if ($this->disp_params['show_owneruserinfo']) {
         echo $this->disp_params['item_start'];
         echo '<strong><a href="' . url_add_param($Blog->get('userurl'), 'user_ID=' . $Blog->owner_user_ID) . '">' . T_('Owner details') . '</a></strong>';
         echo $this->disp_params['item_end'];
     }
     if ($this->disp_params['show_ownercontact'] && ($url = $Blog->get_contact_url(true))) {
         // owner allows contact:
         echo $this->disp_params['item_start'];
         echo '<strong><a href="' . $url . '">' . T_('Contact') . '</a></strong>';
         echo $this->disp_params['item_end'];
     }
     if ($this->disp_params['show_sitemap']) {
         echo $this->disp_params['item_start'];
         echo '<strong><a href="' . $Blog->get('sitemapurl') . '">' . T_('Site map') . '</a></strong>';
         echo $this->disp_params['item_end'];
     }
     echo $this->disp_params['list_end'];
     echo $this->disp_params['block_end'];
     return true;
 }
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:74,代码来源:_coll_common_links.widget.php


示例15: skin_init

/**
 * Template tag. Initializes internal states for the most common skin displays.
 *
 * For more specific skins, this function should not be called and
 * equivalent code should be customized within the skin.
 *
 * @param string What are we going to display. Most of the time the global $disp should be passed.
 */
function skin_init($disp)
{
    /**
     * @var Blog
     */
    global $Blog;
    /**
     * @var Item
     */
    global $Item;
    /**
     * @var Skin
     */
    global $Skin;
    global $robots_index;
    global $seo_page_type;
    global $redir, $ReqURL, $ReqURI, $m, $w, $preview;
    global $Chapter;
    global $Debuglog;
    /**
     * @var ItemList2
     */
    global $MainList;
    /**
     * This will give more detail when $disp == 'posts'; otherwise it will have the same content as $disp
     * @var string
     */
    global $disp_detail, $Settings;
    global $Timer;
    global $Messages, $PageCache;
    $Timer->resume('skin_init');
    if (empty($disp_detail)) {
        $disp_detail = $disp;
    }
    $Debuglog->add('skin_init: ' . $disp, 'skins');
    // This is the main template; it may be used to display very different things.
    // Do inits depending on current $disp:
    switch ($disp) {
        case 'posts':
        case 'single':
        case 'page':
        case 'feedback-popup':
        case 'search':
            // We need to load posts for this display:
            // Note: even if we request the same post as $Item above, the following will do more restrictions (dates, etc.)
            // Init the MainList object:
            init_MainList($Blog->get_setting('posts_per_page'));
            // Init post navigation
            $post_navigation = $Skin->get_post_navigation();
            if (empty($post_navigation)) {
                $post_navigation = $Blog->get_setting('post_navigation');
            }
            break;
    }
    // SEO stuff & redirects if necessary:
    $seo_page_type = NULL;
    switch ($disp) {
        // CONTENT PAGES:
        case 'single':
        case 'page':
            init_ajax_forms();
            // auto requires jQuery
            init_ratings_js();
            init_voting_comment_js();
            init_scrollwide_js();
            // Add jQuery Wide Scroll plugin
            if ($disp == 'single') {
                $seo_page_type = 'Single post page';
            } else {
                $seo_page_type = '"Page" page';
            }
            // Check if the post has 'redirected' status:
            if (!$preview && $Item->status == 'redirected' && $redir == 'yes') {
                // $redir=no here allows to force a 'single post' URL for commenting
                // Redirect to the URL specified in the post:
                $Debuglog->add('Redirecting to post URL [' . $Item->url . '].');
                header_redirect($Item->url, true);
            }
            // Check if we want to redirect to a canonical URL for the post
            // Please document encountered problems.
            if (!$preview && ($Blog->get_setting('canonical_item_urls') && $redir == 'yes' || $Blog->get_setting('relcanonical_item_urls'))) {
                // We want to redirect to the Item's canonical URL:
                $canonical_url = $Item->get_permanent_url('', '', '&');
                if (preg_match('|[&?](page=\\d+)|', $ReqURI, $page_param)) {
                    // A certain post page has been requested, keep only this param and discard all others:
                    $canonical_url = url_add_param($canonical_url, $page_param[1], '&');
                }
                if (preg_match('|[&?](mode=quote&[qcp]+=\\d+)|', $ReqURI, $page_param)) {
                    // A quote of comment/post, keep only these params and discard all others:
                    $canonical_url = url_add_param($canonical_url, $page_param[1], '&');
                }
                if (!is_same_url($ReqURL, $canonical_url)) {
//.........这里部分代码省略.........
开发者ID:ldanielz,项目名称:uesp.blog,代码行数:101,代码来源:_skin.funcs.php


示例16: display

    /**
     * Display the widget!
     *
     * @param array MUST contain at least the basic display params
     */
    function display($params)
    {
        // Template params: $widget_title$, $switch_url$
        $params = array_merge(array('wms_template_normal_to_mobile' => '<p><a href="$switch_url$">' . T_('Switch to mobile skin') . '</a></p>', 'wms_template_normal_to_tablet' => '<p><a href="$switch_url$">' . T_('Switch to tablet skin') . '</a></p>', 'wms_template_mobile' => '<div id="switch">$widget_title$:<div>
							<span class="on active">' . T_('ON') . '</span>
							<a href="$switch_url$" class="off">' . T_('OFF') . '</a>
						</div></div>', 'wms_template_tablet' => '<div id="switch">$widget_title$:<div>
							<span class="on active">' . T_('ON') . '</span>
							<a href="$switch_url$" class="off">' . T_('OFF') . '</a>
						</div></div>'), $params);
        global $ReqURI, $Session, $Blog;
        if (empty($Blog)) {
            // Blog must be defined
            return;
        }
        $is_mobile_session = $Session->is_mobile_session();
        $is_tablet_session = $Session->is_tablet_session();
        if (!$is_mobile_session && !$is_tablet_session || $is_mobile_session && $Blog->get_setting('mobile_skin_ID', true) < 1 || $is_tablet_session && $Blog->get_setting('tablet_skin_ID', true) < 1) {
            // Display the switcher only for mobile/tablet devices and when the mobile/tablet skins are defined
            return;
        }
        $force_skin = $Session->get('force_skin');
        $this->init_display($params);
        // Collection common links:
        echo $this->disp_params['block_start'];
        if (empty($force_skin) || $force_skin == 'mobile' || $force_skin == 'tablet') {
            // Mobile skin is enabled now, Display a link to switch on desktop skin
            if (empty($force_skin)) {
                // Set what skin to use when user didn't switch skin yet
                $force_skin = $is_mobile_session ? 'mobile' : 'tablet';
            }
            $switch_url = url_add_param($ReqURI, 'force_skin=normal');
            $template_name = 'wms_template_' . $force_skin;
        } else {
            // Desktop skin is enabled now, Display a link to switch back on mobile/tablet skin
            $this->disp_title($this->disp_params['title']);
            $switch_url = url_add_param($ReqURI, 'force_skin=auto');
            if ($is_mobile_session) {
                // Mobile session
                $template_name = 'wms_template_normal_to_mobile';
            } else {
                // Tablet session
                $template_name = 'wms_template_normal_to_tablet';
            }
        }
        echo $this->disp_params['block_body_start'];
        // Print out the template with the replaced vars
        echo str_replace(array('$widget_title$', '$switch_url$'), array($this->disp_params['title'], $switch_url), $params[$template_name]);
        echo $this->disp_params['block_body_end'];
        echo $this->disp_params['block_end'];
        return true;
    }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:57,代码来源:_mobile_skin_switcher.widget.php


示例17: get_user_avatar_url

                // Redirect to upload avatar
                $redirect_to = get_user_avatar_url();
            }
            break;
        case 'upload_avatar':
            // Redirect to display user profile form
            $redirect_to = url_add_param($Blog->gen_blogurl(), 'disp=profile', '&');
            break;
    }
    if (!empty($redirect_to)) {
        header_redirect($redirect_to);
    }
}
if (!param_errors_detected() || !isset($disp)) {
    // User data is updated without errors
    // redirect will save $Messages into Session:
    $redirect_to = NULL;
    if (isset($disp)) {
        $redirect_to = url_add_param($Blog->gen_blogurl(), 'disp=' . $disp, '&');
    }
    // redirect to the corresponding display form
    header_redirect($redirect_to);
    // EXITED
} else {
    // Errors exist; Don't redirect; Display a template to save a received data from request
    $SkinCache =& get_SkinCache();
    $Skin =& $SkinCache->get_by_ID($Blog->get_skin_ID());
    $skin = $Skin->folder;
    $ads_current_skin_path = $skins_path . $skin . '/';
    require $ads_current_skin_path . 'index.main.php';
}
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:profile_update.php


示例18: param

            param('comments_number', 'integer', $total_comments_number);
        }
        $show_comments_expiry = param('show_comments_expiry', 'string', 'active', false, true);
        $expiry_statuses = array('active');
        if ($show_comments_expiry == 'all') {
            // Display also the expired comments
            $expiry_statuses[] = 'expired';
        }
        global $CommentList;
        $CommentList = new Commen 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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