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

PHP get_extended函数代码示例

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

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



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

示例1: mt_getpost

function mt_getpost($params)
{
    // ($postid, $user, $pass)
    $xpostid = $params->getParam(0);
    $xuser = $params->getParam(1);
    $xpass = $params->getParam(2);
    $post_ID = $xpostid->scalarval();
    $username = $xuser->scalarval();
    $password = $xpass->scalarval();
    // Check login
    if (user_pass_ok(addslashes($username), $password)) {
        $postdata = get_postdata($post_ID);
        if ($postdata['Date'] != '') {
            // why were we converting to GMT here? spec doesn't call for that.
            //$post_date = mysql2date('U', $postdata['Date']);
            //$post_date = gmdate('Ymd', $post_date).'T'.gmdate('H:i:s', $post_date);
            $post_date = strtotime($postdata['Date']);
            $post_date = date('Ymd', $post_date) . 'T' . date('H:i:s', $post_date);
            $catids = wp_get_post_cats('1', $post_ID);
            logIO('O', 'Category No:' . count($catids));
            foreach ($catids as $catid) {
                $catname = get_cat_name($catid);
                logIO('O', 'Category:' . $catname);
                $catnameenc = new xmlrpcval(mb_conv($catname, 'UTF-8', $GLOBALS['blog_charset']));
                $catlist[] = $catnameenc;
            }
            $post = get_extended($postdata['Content']);
            $allow_comments = 'open' == $postdata['comment_status'] ? 1 : 0;
            $allow_pings = 'open' == $postdata['ping_status'] ? 1 : 0;
            $resp = array('link' => new xmlrpcval(post_permalink($post_ID)), 'title' => new xmlrpcval(mb_conv($postdata['Title'], 'UTF-8', $GLOBALS['blog_charset'])), 'description' => new xmlrpcval(mb_conv($post['main'], 'UTF-8', $GLOBALS['blog_charset'])), 'dateCreated' => new xmlrpcval($post_date, 'dateTime.iso8601'), 'userid' => new xmlrpcval($postdata['Author_ID']), 'postid' => new xmlrpcval($postdata['ID']), 'content' => new xmlrpcval(mb_conv($postdata['Content'], 'UTF-8', $GLOBALS['blog_charset'])), 'permalink' => new xmlrpcval(post_permalink($post_ID)), 'categories' => new xmlrpcval($catlist, 'array'), 'mt_keywords' => new xmlrpcval("{$catids[0]}"), 'mt_excerpt' => new xmlrpcval(mb_conv($postdata['Excerpt'], 'UTF-8', $GLOBALS['blog_charset'])), 'mt_allow_comments' => new xmlrpcval($allow_comments, 'int'), 'mt_allow_pings' => new xmlrpcval($allow_pings, 'int'), 'mt_convert_breaks' => new xmlrpcval('true'), 'mt_text_more' => new xmlrpcval(mb_conv($post['extended'], 'UTF-8', $GLOBALS['blog_charset'])));
            $resp = new xmlrpcval($resp, 'struct');
            return new xmlrpcresp($resp);
        } else {
            return new xmlrpcresp(0, $GLOBALS['xmlrpcerruser'] + 3, "No such post #{$post_ID}");
        }
    } else {
        return new xmlrpcresp(0, $GLOBALS['xmlrpcerruser'] + 3, 'Wrong username/password combination ' . $username . ' / ' . starify($password));
    }
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:39,代码来源:xmlrpc.php


示例2: appendExtended

 /**
  * Append the extended contents to the "read more" link
  *
  * @param   string  $link      The current "read more" link
  * @param   string  $linkText  The text for the "read more" link
  *
  * @return  string             "Read more" link with the extended entry contents
  */
 public function appendExtended($link, $linkText)
 {
     $link = $this->replaceLinkText($link, $linkText);
     $post = get_post();
     $extended = get_extended($post->post_content);
     $extended = "<div class=\"entry-extended\">{$extended['extended']}</div>";
     return $link . $extended;
 }
开发者ID:Inggo,项目名称:Sela,代码行数:16,代码来源:Sela.php


示例3: get_raw_value

 /**
  * @see CPAC_Column::get_raw_value()
  * @since 2.0.3
  */
 function get_raw_value($post_id)
 {
     $value = '';
     $p = get_post($post_id);
     $extended = get_extended($p->post_content);
     if (!empty($extended['extended'])) {
         $value = $this->get_shortened_string($extended['main'], $this->options->excerpt_length);
     }
     return $value;
 }
开发者ID:OneTimeUser,项目名称:retailwire,代码行数:14,代码来源:before-moretag.php


示例4: toutatis_excerpt

 function toutatis_excerpt($length)
 {
     global $post;
     // No excerpt needed
     if ($length == 0) {
         return '';
     }
     // Do we have an excerpt ? (excerpt field in the post editor)
     if (has_excerpt()) {
         return apply_filters('the_excerpt', wpautop(strip_shortcodes(strip_tags(get_the_excerpt()))));
     }
     // Do we have a read more tag (<!--more-->) in the post content ?
     if (strpos($post->post_content, '<!--more-->')) {
         $content_arr = get_extended($post->post_content);
         return apply_filters('the_excerpt', wpautop(strip_shortcodes(strip_tags($content_arr['main']))));
     }
     // Get the post content without shortcodes or HTML tags
     $content = strip_shortcodes(strip_tags(get_the_content()));
     // Create a custom excerpt based on the post content
     return apply_filters('the_excerpt', wpautop(wp_trim_words($content, $length)));
 }
开发者ID:hexagone-io,项目名称:Toutatis,代码行数:21,代码来源:toutatis-functions.php


示例5: bdn_xmlrpc_get_posts

function bdn_xmlrpc_get_posts($args)
{
    global $wp_xmlrpc_server;
    $wp_xmlrpc_server->escape($args);
    $blog_ID = (int) $args[0];
    $username = $args[1];
    $password = $args[2];
    $post_type = $args[3];
    $category = $args[4];
    $numberposts = $args[5];
    $extra = $args[6];
    if (!($user = $wp_xmlrpc_server->login($username, $password))) {
        return $wp_xmlrpc_server->error;
    }
    $category_int = (int) $category;
    if (!empty($category_int)) {
        $category_call = 'cat';
    } else {
        $category_call = 'category_name';
    }
    $post_args = array('numberposts' => $numberposts, 'posts_per_page' => $numberposts, $category_call => $category, 'post_type' => $post_type, 'post_status' => 'any');
    if (is_array($extra)) {
        $post_args = array_merge($post_args, $extra);
    }
    $posts_list = query_posts($post_args);
    if (!$posts_list) {
        $wp_xmlrpc_server->error = new IXR_Error(500, __('Either there are no posts, or something went wrong.'));
        return $wp_xmlrpc_server->error;
    }
    foreach ($posts_list as $entry) {
        if (!current_user_can('edit_post', $entry->ID)) {
            continue;
        }
        $post_date = mysql2date('Ymd\\TH:i:s', $entry->post_date, false);
        $post_date_gmt = mysql2date('Ymd\\TH:i:s', $entry->post_date_gmt, false);
        $post_modified = mysql2date('Ymd\\TH:i:s', $entry->post_modified, false);
        // For drafts use the GMT version of the date
        if ($entry->post_status == 'draft') {
            $post_date_gmt = get_gmt_from_date(mysql2date('Y-m-d H:i:s', $entry->post_date), 'Ymd\\TH:i:s');
        }
        $categories = array();
        $cats = get_the_category($entry->ID, 'category');
        foreach ($cats as $cat) {
            $categories[] = array('name' => $cat->cat_name, 'parent' => $cat->category_parent);
        }
        $publications = array();
        $pubs = get_the_terms($entry->ID, 'publication');
        foreach ($pubs as $pub) {
            $publications[] = $pub->name;
        }
        $post = get_extended($entry->post_content);
        $link = post_permalink($entry->ID);
        // Get the post author info.
        $authors = (array) get_userdata($entry->post_author);
        if (function_exists('get_coauthors')) {
            $authors = get_coauthors($entry->ID);
        }
        $allow_comments = 'open' == $entry->comment_status ? 1 : 0;
        $allow_pings = 'open' == $entry->ping_status ? 1 : 0;
        // Consider future posts as published
        if ($entry->post_status === 'future') {
            $entry->post_status = 'publish';
        }
        $entryPost = array('post_date' => new IXR_Date($post_date), 'post_updated' => new IXR_Date($post_modified), 'userid' => $entry->post_author, 'post_id' => $entry->ID, 'description' => $post['main'], 'post_title' => $entry->post_title, 'link' => $link, 'permaLink' => $link, 'post_parent' => strval($post['post_parent']), 'post_content' => $entry->post_content, 'categories' => $categories, 'mt_excerpt' => $entry->post_excerpt, 'mt_text_more' => $post['extended'], 'mt_allow_comments' => $allow_comments, 'mt_allow_pings' => $allow_pings, 'wp_slug' => $entry->post_name, 'wp_password' => $entry->post_password, 'wp_authors' => $authors, 'date_created_gmt' => new IXR_Date($post_date_gmt), 'post_status' => $entry->post_status, 'custom_fields' => $wp_xmlrpc_server->get_custom_fields($entry->ID), 'publications' => $publications);
        $post_type_taxonomies = get_object_taxonomies(POST_TYPE, 'names');
        $terms = wp_get_object_terms($entry->ID, $post_type_taxonomies);
        $entryPost['terms'] = array();
        foreach ($terms as $term) {
            $entryPost['terms'][] = _prepare_term($term);
        }
        $struct[] = $entryPost;
    }
    $recent_posts = array();
    for ($j = 0; $j < count($struct); $j++) {
        array_push($recent_posts, $struct[$j]);
    }
    return $recent_posts;
}
开发者ID:andboson,项目名称:WordPress-xmlrpc-extenders,代码行数:78,代码来源:plugin.php


示例6: hippo_has_more_content

/**
 * Check that content has <!--more--> tag or not :)
 *
 * @param $contents
 *
 * @return bool
 */
function hippo_has_more_content($contents)
{
    $contents = get_extended($contents);
    return !empty($contents['extended']);
}
开发者ID:estrategasdigitales,项目名称:flazam,代码行数:12,代码来源:index.php


示例7: mltlngg_the_content_filter

 function mltlngg_the_content_filter($content)
 {
     global $hook_suffix, $post, $wpdb, $mltlngg_table_translate, $mltlngg_current_language, $mltlngg_active_language, $mltlngg_options, $mltlngg_wp_providers;
     if (is_admin() && !('post.php' == $hook_suffix || 'post-new.php' == $hook_suffix)) {
         return $content;
     }
     $mltlngg_post_type = get_post_type($post->ID);
     /* If current post type enabled to translation */
     if ($mltlngg_post_type == 'post' || $mltlngg_post_type == 'page') {
         if (is_admin()) {
             $mltlngg_current_language = isset($_GET['lang']) ? $_GET['lang'] : (isset($mltlngg_active_language['locale']) ? $mltlngg_active_language['locale'] : $mltlngg_options['default_language']);
         }
         $new_content = $wpdb->get_var($wpdb->prepare("SELECT `post_content` FROM {$mltlngg_table_translate} WHERE `post_ID` = %d AND `language` = '%s' ", $post->ID, $mltlngg_current_language));
         if (!empty($new_content)) {
             if (!is_admin()) {
                 if (!post_password_required()) {
                     $noteaser = false !== strpos($new_content, '<!--noteaser-->') ? true : false;
                     $extends = get_extended($new_content);
                     $extended = $extends['extended'];
                     $new_content = $extends['main'];
                     if (!empty($mltlngg_wp_providers)) {
                         foreach ($mltlngg_wp_providers as $template) {
                             if (false !== preg_match($template, $extends['extended'])) {
                                 $extended = preg_replace_callback($template, "mltlngg_videos_filter", $extended);
                             }
                             if (false !== preg_match($template, $extends['main'])) {
                                 $new_content = preg_replace_callback($template, "mltlngg_videos_filter", $new_content);
                             }
                         }
                     }
                     if (!is_single() && !is_page() && !is_search()) {
                         $more_link_text = __('(more&hellip;)');
                         $more_link = apply_filters('the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">{$more_link_text}</a>", $more_link_text);
                         if ('' != $extended) {
                             $new_content .= $more_link;
                         }
                     } elseif (is_page()) {
                         $new_content .= $extended;
                     } else {
                         if ($noteaser) {
                             $new_content = '';
                         }
                         $new_content .= 0 != strlen($new_content) ? '<span id="more-' . $post->ID . '"></span>' . $extended : $extended;
                     }
                     if (0 != strlen($new_content)) {
                         return $new_content;
                     }
                 } else {
                     $content = get_the_password_form();
                 }
                 /* If translation is exist and not empty, filter content */
             } else {
                 $content = $new_content;
             }
         }
     }
     return $content;
 }
开发者ID:rochellecanale,项目名称:wordpress,代码行数:58,代码来源:multilanguage.php


示例8: mw_getRecentPosts

 function mw_getRecentPosts($args)
 {
     $this->escape($args);
     $blog_ID = (int) $args[0];
     $user_login = $args[1];
     $user_pass = $args[2];
     $num_posts = (int) $args[3];
     if (!$this->login_pass_ok($user_login, $user_pass)) {
         return $this->error;
     }
     $posts_list = wp_get_recent_posts($num_posts);
     if (!$posts_list) {
         $this->error = new IXR_Error(500, __('Either there are no posts, or something went wrong.'));
         return $this->error;
     }
     set_current_user(0, $user_login);
     foreach ($posts_list as $entry) {
         if (!current_user_can('edit_post', $entry['ID'])) {
             continue;
         }
         $post_date = mysql2date('Ymd\\TH:i:s', $entry['post_date']);
         $post_date_gmt = mysql2date('Ymd\\TH:i:s', $entry['post_date_gmt']);
         $categories = array();
         $catids = wp_get_post_categories($entry['ID']);
         foreach ($catids as $catid) {
             $categories[] = get_cat_name($catid);
         }
         $tagnames = array();
         $tags = wp_get_post_tags($entry['ID']);
         if (!empty($tags)) {
             foreach ($tags as $tag) {
                 $tagnames[] = $tag->name;
             }
             $tagnames = implode(', ', $tagnames);
         } else {
             $tagnames = '';
         }
         $post = get_extended($entry['post_content']);
         $link = post_permalink($entry['ID']);
         // Get the post author info.
         $author = get_userdata($entry['post_author']);
         $allow_comments = 'open' == $entry['comment_status'] ? 1 : 0;
         $allow_pings = 'open' == $entry['ping_status'] ? 1 : 0;
         $struct[] = array('dateCreated' => new IXR_Date($post_date), 'userid' => $entry['post_author'], 'postid' => $entry['ID'], 'description' => $post['main'], 'title' => $entry['post_title'], 'link' => $link, 'permaLink' => $link, 'categories' => $categories, 'mt_excerpt' => $entry['post_excerpt'], 'mt_text_more' => $post['extended'], 'mt_allow_comments' => $allow_comments, 'mt_allow_pings' => $allow_pings, 'mt_keywords' => $tagnames, 'wp_slug' => $entry['post_name'], 'wp_password' => $entry['post_password'], 'wp_author_id' => $author->ID, 'wp_author_display_name' => $author->display_name, 'date_created_gmt' => new IXR_Date($post_date_gmt));
     }
     $recent_posts = array();
     for ($j = 0; $j < count($struct); $j++) {
         array_push($recent_posts, $struct[$j]);
     }
     return $recent_posts;
 }
开发者ID:helmonaut,项目名称:owb-mirror,代码行数:51,代码来源:xmlrpc.php


示例9: the_ID

	
	<div id="post-<?php 
the_ID();
?>
" <?php 
post_class();
?>
>
	
		<div class="post-quote">

			<?php 
// Fetch post content
$content = get_post_field('post_content', get_the_ID());
// Get content parts
$content_parts = get_extended($content);
// Output part before <!--more--> tag
echo $content_parts['main'];
?>
		
		</div> <!-- /post-quote -->
		
		<?php 
if (is_sticky()) {
    ?>
				
			<div class="is-sticky">
				<div class="genericon genericon-pinned"></div>
			</div>
		
		<?php 
开发者ID:LSYanJun,项目名称:wordpress,代码行数:30,代码来源:content-quote.php


示例10: mw_getRecentPosts

	function mw_getRecentPosts($args) {

		$this->escape($args);

		$blog_ID     = $args[0];
		$user_login  = $args[1];
		$user_pass   = $args[2];
		$num_posts   = $args[3];

		if (!$this->login_pass_ok($user_login, $user_pass)) {
			return $this->error;
		}

		$posts_list = wp_get_recent_posts($num_posts);

		if (!$posts_list) {
			$this->error = new IXR_Error(500, 'Either there are no posts, or something went wrong.');
			return $this->error;
		}

		foreach ($posts_list as $entry) {

			$post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']);
			$categories = array();
			$catids = wp_get_post_categories($entry['ID']);
			foreach($catids as $catid) {
				$categories[] = get_cat_name($catid);
			}

			$post = get_extended($entry['post_content']);
			$link = post_permalink($entry['ID']);

			$allow_comments = ('open' == $entry['comment_status']) ? 1 : 0;
			$allow_pings = ('open' == $entry['ping_status']) ? 1 : 0;

			$struct[] = array(
				'dateCreated' => new IXR_Date($post_date),
				'userid' => $entry['post_author'],
				'postid' => $entry['ID'],
				'description' => $post['main'],
				'title' => $entry['post_title'],
				'link' => $link,
				'permaLink' => $link,
// commented out because no other tool seems to use this
//	      'content' => $entry['post_content'],
				'categories' => $categories,
				'mt_excerpt' => $entry['post_excerpt'],
				'mt_text_more' => $post['extended'],
				'mt_allow_comments' => $allow_comments,
				'mt_allow_pings' => $allow_pings
			);

		}

		$recent_posts = array();
		for ($j=0; $j<count($struct); $j++) {
			array_push($recent_posts, $struct[$j]);
		}

		return $recent_posts;
	}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:61,代码来源:xmlrpc.php


示例11: get_orderby_posts_vars


//.........这里部分代码省略.........
             }
             break;
         case 'column-sticky':
             $sort_flag = SORT_REGULAR;
             $stickies = get_option('sticky_posts');
             foreach ($this->get_any_posts_by_posttype($post_type) as $p) {
                 $cposts[$p->ID] = $p->ID;
                 if (!empty($stickies) && in_array($p->ID, $stickies)) {
                     $cposts[$p->ID] = 0;
                 }
             }
             break;
         case 'column-featured_image':
             $sort_flag = SORT_REGULAR;
             foreach ($this->get_any_posts_by_posttype($post_type) as $p) {
                 $cposts[$p->ID] = $p->ID;
                 $thumb = get_the_post_thumbnail($p->ID);
                 if (!empty($thumb)) {
                     $cposts[$p->ID] = 0;
                 }
             }
             break;
         case 'column-roles':
             $sort_flag = SORT_STRING;
             foreach ($this->get_any_posts_by_posttype($post_type) as $p) {
                 $cposts[$p->ID] = 0;
                 $userdata = get_userdata($p->post_author);
                 if (!empty($userdata->roles[0])) {
                     $cposts[$p->ID] = $userdata->roles[0];
                 }
             }
             break;
         case 'column-status':
             $sort_flag = SORT_STRING;
             foreach ($this->get_any_posts_by_posttype($post_type) as $p) {
                 $cposts[$p->ID] = $p->post_status . strtotime($p->post_date);
             }
             break;
         case 'column-comment-status':
             $sort_flag = SORT_STRING;
             foreach ($this->get_any_posts_by_posttype($post_type) as $p) {
                 $cposts[$p->ID] = $p->comment_status;
             }
             break;
         case 'column-ping-status':
             $sort_flag = SORT_STRING;
             foreach ($this->get_any_posts_by_posttype($post_type) as $p) {
                 $cposts[$p->ID] = $p->ping_status;
             }
             break;
         case 'column-taxonomy':
             $sort_flag = SORT_STRING;
             // needed to sort
             $taxonomy = str_replace('column-taxonomy-', '', $id);
             $cposts = $this->get_posts_sorted_by_taxonomy($post_type, $taxonomy);
             break;
         case 'column-author-name':
             $sort_flag = SORT_STRING;
             $display_as = $column[$id]['display_as'];
             if ('userid' == $display_as) {
                 $sort_flag = SORT_NUMERIC;
             }
             foreach ($this->get_any_posts_by_posttype($post_type) as $p) {
                 if (!empty($p->post_author)) {
                     $name = Codepress_Admin_Columns::get_author_field_by_nametype($display_as, $p->post_author);
                     $cposts[$p->ID] = $name;
                 }
             }
             break;
         case 'column-before-moretag':
             $sort_flag = SORT_STRING;
             foreach ($this->get_any_posts_by_posttype($post_type) as $p) {
                 $extended = get_extended($p->post_content);
                 $content = !empty($extended['extended']) ? $extended['main'] : '';
                 $cposts[$p->ID] = $this->prepare_sort_string_value($content);
             }
             break;
             /** native WP columns */
             // categories
         /** native WP columns */
         // categories
         case 'categories':
             $sort_flag = SORT_STRING;
             // needed to sort
             $cposts = $this->get_posts_sorted_by_taxonomy($post_type, 'category');
             break;
             // tags
         // tags
         case 'tags':
             $sort_flag = SORT_STRING;
             // needed to sort
             $cposts = $this->get_posts_sorted_by_taxonomy($post_type, 'post_tag');
             break;
     }
     // we will add the sorted post ids to vars['post__in'] and remove unused vars
     if (isset($sort_flag)) {
         $vars = $this->get_vars_post__in($vars, $cposts, $sort_flag);
     }
     return $vars;
 }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:101,代码来源:sortable.php


示例12: get_header

<?php

get_header();
?>

<?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
	

<?php 
        $post_content = get_extended($post->post_content);
        $content_main = apply_filters('the_content', $post_content['main']);
        $content_extended = apply_filters('the_content', $post_content['extended']);
        $show_author = get_field('show_author');
        //echo '<pre class="debug">';print_r($post_content);echo '</pre>';
        if (!empty($post_content['more_text'])) {
            $more_btn_text = $post_content['more_text'];
        } else {
            $more_btn_text = "Continue Reading";
        }
        ?>

<!-- Container  -->
<div class="container">
	<article <?php 
        post_class();
        ?>
>
开发者ID:kevwaddell,项目名称:motopro-desktop,代码行数:31,代码来源:single.php


示例13: get_the_time

                <?php 
        if ($fields->show_date) {
            ?>
                <p><?php 
            echo get_the_time('Y-m-d H:i', $post->ID);
            ?>
</p>
                <?php 
        }
        ?>

                <?php 
        if ($fields->show_excerpt) {
            ?>
                <p><?php 
            echo isset(get_extended($post->post_content)['main']) ? get_extended($post->post_content)['main'] : '';
            ?>
</p>
                <?php 
        }
        ?>
            </div>
        </a>
    </div>
    <?php 
    }
    ?>
    </div>

<?php 
}
开发者ID:helsingborg-stad,项目名称:dunkerskulturhus.se,代码行数:31,代码来源:modularity-mod-latest-default.php


示例14: get_extended

 public function get_extended()
 {
     return get_extended($this->post->post_content);
 }
开发者ID:brutalenemy666,项目名称:wp-utils,代码行数:4,代码来源:abstract-post.php


示例15: make_excerpt

 public function make_excerpt($more_text = null)
 {
     // Author inserted a <!--more--> tag
     $parts = get_extended($this->post_content);
     if (!empty($parts['extended'])) {
         $ret = trim($parts['main']);
         // Conditionally add a read more link and
         // clean up punctuation and ellipsis at end of excerpt
         $wc_excerpt = str_word_count($ret);
         $wc_content = str_word_count($this->post_content);
         if ($wc_excerpt < $wc_content) {
             $ret = preg_replace('/([\\.,;:!?\'"]{4,})$/', '...', $ret . '...');
             if (!empty($more_text)) {
                 $ret = $ret . ' <a href="' . $this->permalink . '" class="more-link">' . $more_text . '</a>';
             }
         }
     }
     // Excerpt is empty, so generate one
     if (empty($parts['extended'])) {
         $text = strip_shortcodes($this->post_content);
         $text = apply_filters('the_content', $text);
         $text = str_replace(']]>', ']]&gt;', $text);
         $text = strip_tags($text);
         $excerpt_length = apply_filters('excerpt_length', 55);
         $read_more = apply_filters('read_more', ' ' . '[...]', $this);
         $words = preg_split("/[\n\r\t ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);
         if (count($words) > $excerpt_length) {
             array_pop($words);
             $text = implode(' ', $words);
             $text = $text . $read_more;
         } else {
             $text = implode(' ', $words);
         }
         $ret = apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
     }
     /* TODO: cache results of this function */
     return $ret;
 }
开发者ID:newsapps,项目名称:wordpress-mtv,代码行数:38,代码来源:models.php


示例16: show_single

function show_single()
{
    global $s, $m, $x, $mtitle, $site_url, $comments, $page_display_name, $site_name, $comment_ok, $date_format, $lang, $error, $scream, $sname, $semail, $scomment, $sweb, $timezone;
    $rs = safe_row('*', 'pixie_dynamic_posts', "post_slug = '{$x}' and public = 'yes' limit 0,1");
    if ($rs) {
        extract($rs);
        safe_update('pixie_dynamic_posts', "post_views  = {$post_views} + 1", "post_id = '{$post_id}'");
        $logunix = returnUnixtimestamp($posted);
        $date = safe_strftime($date_format, $logunix);
        $timeunix = returnUnixtimestamp($last_modified);
        $xdate = safe_strftime($date_format, $timeunix);
        $microformat = safe_strftime('%Y-%m-%dT%T%z', $logunix);
        $slug = $post_slug;
        $fullname = safe_field('realname', 'pixie_users', "user_name='{$author}'");
        if (public_page_exists('profiles')) {
            $mauthor = "<a href=\"" . createURL("profiles", $author) . "\" class=\"url fn\" title=\"" . $lang['view'] . " {$fullname}'s " . $lang['profile'] . "\">{$fullname}</a>";
        } else {
            $mauthor = "<a href=\"{$site_url}\" class=\"url fn\" title=\"{$site_url}\">{$fullname}</a>";
        }
        if (isset($tags) && $tags) {
            $all_tags = strip_tags($tags);
            $all_tags = str_replace('&quot;', "", $tags);
            $tags_array_temp = explode(" ", $all_tags);
            for ($count = 0; $count < count($tags_array_temp); $count++) {
                $current = $tags_array_temp[$count];
                $first = $current[strlen($current) - strlen($current)];
                if ($first == " ") {
                    $current = substr($current, 1, strlen($current) - 1);
                }
                $ncurrent = make_slug($current);
                if (isset($s) && isset($ncurrent)) {
                    if (isset($tag_list)) {
                    } else {
                        $tag_list = NULL;
                    }
                    $tag_list .= "<a href=\"" . createURL($s, 'tag', $ncurrent) . "\" title=\"" . $lang['view'] . " " . $lang['all_posts_tagged'] . ": " . $current . "\"  rel=\"tag\" >" . $current . "</a>, ";
                }
                if ($ncurrent != "") {
                    if (isset($class_list)) {
                    } else {
                        $class_list = NULL;
                    }
                    $class_list .= "tag_{$ncurrent} ";
                }
            }
            $tag_list = substr($tag_list, 0, strlen($tag_list) - 2) . "";
        }
        if (isset($s)) {
            $permalink = createURL($s, 'permalink', $slug);
        }
        $authorclass = strtolower($author);
        $timeclass = safe_strftime('y%Y m%m d%d h%H', $logunix);
        echo "\n\t\t\t\t\t<div class=\"section hentry author_{$authorclass} {$class_list}{$timeclass} single\" id=\"post_{$post_id}\">\n\t\t\t\t\t\t<h4 class=\"entry-title\"><a href=\"{$permalink}\" rel=\"bookmark\">{$title}</a></h4>\n\t\t\t\t\t\t<ul class=\"post_links\">\n\t\t\t\t\t\t\t<li class=\"post_date\"><abbr class=\"published\" title=\"{$microformat}\">{$date}</abbr></li>";
        if (isset($_COOKIE['pixie_login'])) {
            list($username, $cookie_hash) = explode(',', $_COOKIE['pixie_login']);
            $nonce = safe_field('nonce', 'pixie_users', "user_name='{$username}'");
            if (md5($username . $nonce) == $cookie_hash) {
                $privs = safe_field('privs', 'pixie_users', "user_name='{$username}'");
                if ($privs >= 1) {
                    echo "\n\t\t\t\t\t\t\t<li class=\"post_edit\"><a href=\"" . $site_url . "admin/?s=publish&amp;m=dynamic";
                    if (isset($s)) {
                        echo '&amp;x=' . $s;
                    }
                    echo "&amp;edit={$post_id}\" title=\"" . $lang['edit_post'] . "\">" . $lang['edit_post'] . "</a></li>";
                }
            }
        }
        echo "\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<div class=\"post entry-content\">\n";
        //<!--more-->
        $post = get_extended($content);
        echo "\t\t\t\t\t\t\t" . $post['main'];
        if ($post['extended']) {
            echo $post['extended'];
        }
        echo "\n\t\t\t\t\t\t</div>\t\t\n\t\t\t\t\t\t<div class=\"post_credits\">\n\t\t\t\t\t\t \t<span class=\"vcard author\">" . $lang['by'] . " {$mauthor}</span>\n\t\t\t\t\t\t \t<span class=\"post_tags\">" . $lang['tagged'] . ": {$tag_list}</span>\n\t\t\t\t\t\t \t<span class=\"post_updated\">" . $lang['last_updated'] . ": {$xdate} </span>\n\t\t\t\t\t\t</div>\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<div id=\"nav_posts\" class=\"dynamic_bottom_nav\">\n";
        // previous and next posts
        if (isset($s)) {
            $thisid = get_page_id($s);
        }
        // what post is next?
        $searchnext = safe_field('post_id', 'pixie_dynamic_posts', "page_id = '{$thisid}' and public = 'yes' and posted > '{$posted}' limit 0,1");
        if ($searchnext) {
            $ntitle = safe_field('title', 'pixie_dynamic_posts', "post_id ='{$searchnext}'");
            $nslug = safe_field('post_slug', 'pixie_dynamic_posts', "post_id ='{$searchnext}'");
            echo "\t\t\t\t\t\t<div id=\"post_next\" class=\"link_next\"><a class=\"link_next_a\" href=\"";
            if (isset($s)) {
                echo createURL($s, 'permalink', $nslug);
            }
            echo "\" title=\"" . $lang['next_post'] . ": {$ntitle}\">" . $lang['next_post'] . " &raquo;</a></div>\n";
        }
        // what post is previous?
        $searchprev = safe_field('post_id', 'pixie_dynamic_posts', "page_id = '{$thisid}' and public = 'yes' and posted < '{$posted}' order by posted desc limit 0,1");
        if ($searchprev) {
            $ptitle = safe_field('title', 'pixie_dynamic_posts', "post_id ='{$searchprev}'");
            $pslug = safe_field('post_slug', 'pixie_dynamic_posts', "post_id ='{$searchprev}'");
            echo "\t\t\t\t\t\t<div id=\"post_previous\" class=\"link_previous\"><a class=\"link_prev_a\" href=\"";
            if (isset($s)) {
                echo createURL($s, 'permalink', $pslug);
            }
            echo "\" title=\"" . $lang['previous_post'] . ": ";
//.........这里部分代码省略.........
开发者ID:joseph-mudloff,项目名称:pixie-cms,代码行数:101,代码来源:dynamic.php


示例17: raindrops_posted_in

}
if ('before' == raindrops_warehouse('raindrops_posted_in_position')) {
    raindrops_posted_in();
}
?>
</div>

<div class="entry-content clearfix">
	<?php 
raindrops_prepend_entry_content();
$content = $post->post_content;
$content = apply_filters('the_content', $content);
$content = apply_filters('raindrops_entry_content', $content);
$content = str_replace(']]>', ']]&gt;', $content);
$content = str_replace('<span id="more-' . $post->ID . '"></span>', '<!--more-->', $content);
$text_array = get_extended($content);
if (empty($text_array['more_text'])) {
    $text_array['more_text'] = esc_html__('Continue&nbsp;reading ', 'raindrops') . '<span class="meta-nav">&rarr;</span><span class="more-link-post-unique">' . esc_html__('&nbsp;Post ID&nbsp;', 'raindrops') . get_the_ID() . '</span>';
}
if ($text_array['extended'] !== '') {
    $text_array['main'] .= sprintf('<p class="additional-more"><a href="%1$s"><span>%2$s</span></a></p>', get_permalink(), $text_array['more_text']);
}
if (has_post_thumbnail($post->ID) && is_front_page()) {
    ?>
		<div class="line">
			<div class="unit size1of4"><?php 
    the_post_thumbnail();
    ?>
</div>
			<div class="unit size3of4"><?php 
    echo $text_array['main'];
开发者ID:TheRojam,项目名称:raindrops,代码行数:31,代码来源:part-additional.php


示例18: mt_getpost

function mt_getpost($params)
{
    // ($postid, $user, $pass)
    global $xmlrpcerruser;
    $xpostid = $params->getParam(0);
    $xuser = $params->getParam(1);
    $xpass = $params->getParam(2);
    $post_ID = $xpostid->scalarval();
    $username = $xuser->scalarval();
    $password = $xpass->scalarval();
    // Check login
    if (user_pass_ok($username, $password)) {
        $postdata = get_postdata($post_ID);
        if ($postdata["Date"] != "") {
            // why were we converting to GMT here? spec doesn't call for that.
            //$post_date = mysql2date("U", $postdata["Date"]);
            //$post_date = gmdate("Ymd", $post_date)."T".gmdate("H:i:s", $post_date);
            $post_date = strtotime($postdata['Date']);
            $post_date = date("Ymd", $post_date) . "T" . date("H:i:s", $post_date);
            $catids = wp_get_post_cats('1', $post_ID);
            logIO("O", "CateGory No:" . count($catids));
            foreach ($catids as $catid) {
                $catname = get_cat_name($catid);
                logIO("O", "CateGory:" . $catname);
                $catnameenc = new xmlrpcval(mb_conv($catname, "UTF-8", "auto"));
                $catlist[] = $catnameenc;
            }
            $post = get_extended($postdata['Content']);
            $allow_comments = 'open' == $postdata['comment_status'] ? 1 : 0;
            $allow_pings = 'open' == $postdata['ping_status'] ? 1 : 0;
            $resp = array('link' => new xmlrpcval(post_permalink($post_ID)), 'title' => new xmlrpcval(mb_conv($postdata["Title"], "UTF-8", "auto")), 'description' => new xmlrpcval(mb_conv($post['main'], "UTF-8", "auto")), 'dateCreated' => new xmlrpcval($post_date, 'dateTime.iso8601'), 'userid' => new xmlrpcval($postdata["Author_ID"]), 'postid' => new xmlrpcval($postdata["ID"]), 'content' => new xmlrpcval(mb_conv($postdata["Content"], "UTF-8", "auto")), 'permalink' => new xmlrpcval(post_permalink($post_ID)), 'categories' => new xmlrpcval($catlist, 'array'), 'mt_keywords' => new xmlrpcval("{$catids[0]}"), 'mt_excerpt' => new xmlrpcval(mb_conv($postdata['Excerpt'], "UTF-8", "auto")), 'mt_allow_comments' => new xmlrpcval($allow_comments, 'int'), 'mt_allow_pings' => new xmlrpcval($allow_pings, 'int'), 'mt_convert_breaks' => new xmlrpcval('true'), 'mt_text_more' => new xmlrpcval(mb_conv($post['extended'], "UTF-8", "auto")));
            $resp = new xmlrpcval($resp, 'struct');
            return new xmlrpcresp($resp);
        } else {
            return new xmlrpcresp(0, $xmlrpcerruser + 3, "No such post #{$post_ID}");
        }
    } else {
        return new xmlrpcresp(0, $xmlrpcerruser + 3, 'Wrong username/password combination ' . $username . ' / ' . starify($password));
    }
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:40,代码来源:xmlrpc.php


示例19: array

<?php

$config = array('name' => 'content/woocommerce', 'main' => 'YOOtheme\\Widgetkit\\Content\\Type', 'config' => function ($app) {
    return array('name' => 'woocommerce', 'label' => 'WooCommerce', 'icon' => $app['url']->to('plugins/content/woocommerce/content.svg'), 'item' => array('title', 'content', 'media', 'link'), 'data' => array('number' => 5, 'content' => 'intro', 'category' => '', 'order_by' => 'post_date'));
}, 'items' => function ($items, $content) {
    $order = explode('_asc', $content['order_by']);
    $args = array('numberposts' => $content['number'] ?: 5, 'orderby' => isset($order[0]) ? $order[0] : 'post_date', 'order' => isset($order[1]) ? 'ASC' : 'DESC', 'post_status' => 'publish', 'post_type' => 'product');
    if ($content['category'] > 0) {
        $args['tax_query'] = array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => (int) $content['category'], 'include_children' => false) 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_extension函数代码示例发布时间:2022-05-15
下一篇:
PHP get_ext函数代码示例发布时间: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