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

PHP get_lastcommentmodified函数代码示例

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

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



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

示例1: test_cache_is_cleared_when_comment_is_trashed

 public function test_cache_is_cleared_when_comment_is_trashed()
 {
     $comment_1 = self::factory()->comment->create_and_get(array('comment_status' => 1, 'comment_date' => '1998-01-01 11:00:00', 'comment_date_gmt' => '1998-01-01 10:00:00'));
     $comment_2 = self::factory()->comment->create_and_get(array('comment_status' => 1, 'comment_date' => '2000-01-02 11:00:00', 'comment_date_gmt' => '2000-01-02 10:00:00'));
     get_lastcommentmodified();
     $this->assertSame(strtotime('2000-01-02 10:00:00'), strtotime(wp_cache_get('lastcommentmodified:server', 'timeinfo')));
     wp_trash_comment($comment_2->comment_ID);
     $this->assertFalse(wp_cache_get('lastcommentmodified:server', 'timeinfo'));
     $this->assertSame(strtotime('1998-01-01 10:00:00'), strtotime(get_lastcommentmodified()));
     $this->assertSame(strtotime('1998-01-01 10:00:00'), strtotime(wp_cache_get('lastcommentmodified:server', 'timeinfo')));
 }
开发者ID:aaemnnosttv,项目名称:develop.git.wordpress.org,代码行数:11,代码来源:lastCommentModified.php


示例2: _find

 protected static function _find($app, $args)
 {
     $args = self::convert_request($args);
     $found = 0;
     $comments = array();
     $model = self::model();
     if ($lastModified = apply_filters('thermal_get_lastcommentmodified', get_lastcommentmodified('gmt'))) {
         $app->lastModified(strtotime($lastModified . ' GMT'));
     }
     $comments = $model->find($args, $found);
     array_walk($comments, array(__CLASS__, 'format'), 'read');
     return empty($args['include_found']) ? compact('comments') : compact('comments', 'found');
 }
开发者ID:katymdc,项目名称:thermal-api,代码行数:13,代码来源:Comments.php


示例3: setLastModifiedHeader

 function setLastModifiedHeader(array $headers, WP $wp)
 {
     global $wpdb;
     $this->lastModified = null;
     if (!is_user_logged_in() && empty($wp->query_vars['error']) && empty($wp->query_vars['feed'])) {
         // Retrieve last post modified, not depending on type (includes standard posts, pages, but also any future type of post)
         $wp_last_modified_date = $wpdb->get_var("SELECT GREATEST(post_modified_gmt, post_date_gmt) d FROM {$wpdb->posts} WHERE post_status = 'publish' ORDER BY d DESC LIMIT 1");
         $wp_last_modified_date = max($wp_last_modified_date, get_lastcommentmodified('GMT'));
         if ($user_comment_date = $_COOKIE['comment_date_' . COOKIEHASH]) {
             $wp_last_modified_date = max($wp_last_modified_date, $user_comment_date);
         }
         $wp_last_modified = mysql2date('D, d M Y H:i:s', $wp_last_modified_date, 0) . ' GMT';
         $headers['Last-Modified'] = $wp_last_modified;
         $headers['ETag'] = '"' . md5($wp_last_modified) . '"';
         $this->headers = $headers;
     }
     return $headers;
 }
开发者ID:naholyr,项目名称:wordpress-304,代码行数:18,代码来源:304-not-modified.php


示例4: wpjam_headers

function wpjam_headers($headers, $wp)
{
    if (!is_user_logged_in() && empty($wp->query_vars['feed'])) {
        $headers['Cache-Control'] = 'max-age:600';
        $headers['Expires'] = gmdate('D, d M Y H:i:s', time() + 600) . " GMT";
        $wpjam_timestamp = get_lastpostmodified('GMT') > get_lastcommentmodified('GMT') ? get_lastpostmodified('GMT') : get_lastcommentmodified('GMT');
        $wp_last_modified = mysql2date('D, d M Y H:i:s', $wpjam_timestamp, 0) . ' GMT';
        $wp_etag = '"' . md5($wp_last_modified) . '"';
        $headers['Last-Modified'] = $wp_last_modified;
        $headers['ETag'] = $wp_etag;
        // Support for Conditional GET
        if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
            $client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
        } else {
            $client_etag = false;
        }
        $client_last_modified = empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? '' : trim($_SERVER['HTTP_IF_MODIFIED_SINCE']);
        // If string is empty, return 0. If not, attempt to parse into a timestamp
        $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0;
        // Make a timestamp for our most recent modification...
        $wp_modified_timestamp = strtotime($wp_last_modified);
        $exit_required = false;
        if ($client_last_modified && $client_etag ? $client_modified_timestamp >= $wp_modified_timestamp && $client_etag == $wp_etag : $client_modified_timestamp >= $wp_modified_timestamp || $client_etag == $wp_etag) {
            $status = 304;
            $exit_required = true;
        }
        if ($exit_required) {
            if (!empty($status)) {
                status_header($status);
            }
            foreach ((array) $headers as $name => $field_value) {
                @header("{$name}: {$field_value}");
            }
            if (isset($headers['Last-Modified']) && empty($headers['Last-Modified']) && function_exists('header_remove')) {
                @header_remove('Last-Modified');
            }
            exit;
        }
    }
    return $headers;
}
开发者ID:eric-xujun,项目名称:wordpress,代码行数:41,代码来源:304-speed.php


示例5: send_headers

 /**
  * Send additional HTTP headers for caching, content type, etc.
  *
  * Sets the X-Pingback header, 404 status (if 404), Content-type. If showing
  * a feed, it will also send last-modified, etag, and 304 status if needed.
  *
  * @since 2.0.0
  */
 function send_headers()
 {
     $headers = array('X-Pingback' => get_bloginfo('pingback_url'));
     $status = null;
     $exit_required = false;
     if (is_user_logged_in()) {
         $headers = array_merge($headers, wp_get_nocache_headers());
     }
     if (!empty($this->query_vars['error'])) {
         $status = (int) $this->query_vars['error'];
         if (404 === $status) {
             if (!is_user_logged_in()) {
                 $headers = array_merge($headers, wp_get_nocache_headers());
             }
             $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
         } elseif (in_array($status, array(403, 500, 502, 503))) {
             $exit_required = true;
         }
     } else {
         if (empty($this->query_vars['feed'])) {
             $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
         } else {
             // We're showing a feed, so WP is indeed the only thing that last changed
             if (!empty($this->query_vars['withcomments']) || false !== strpos($this->query_vars['feed'], 'comments-') || empty($this->query_vars['withoutcomments']) && (!empty($this->query_vars['p']) || !empty($this->query_vars['name']) || !empty($this->query_vars['page_id']) || !empty($this->query_vars['pagename']) || !empty($this->query_vars['attachment']) || !empty($this->query_vars['attachment_id']))) {
                 $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0) . ' GMT';
             } else {
                 $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0) . ' GMT';
             }
             $wp_etag = '"' . md5($wp_last_modified) . '"';
             $headers['Last-Modified'] = $wp_last_modified;
             $headers['ETag'] = $wp_etag;
             // Support for Conditional GET
             if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
                 $client_etag = wp_unslash($_SERVER['HTTP_IF_NONE_MATCH']);
             } else {
                 $client_etag = false;
             }
             $client_last_modified = empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? '' : trim($_SERVER['HTTP_IF_MODIFIED_SINCE']);
             // If string is empty, return 0. If not, attempt to parse into a timestamp
             $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0;
             // Make a timestamp for our most recent modification...
             $wp_modified_timestamp = strtotime($wp_last_modified);
             if ($client_last_modified && $client_etag ? $client_modified_timestamp >= $wp_modified_timestamp && $client_etag == $wp_etag : $client_modified_timestamp >= $wp_modified_timestamp || $client_etag == $wp_etag) {
                 $status = 304;
                 $exit_required = true;
             }
         }
     }
     /**
      * Filter the HTTP headers before they're sent to the browser.
      *
      * @since 2.8.0
      *
      * @param array $headers The list of headers to be sent.
      * @param WP    $this    Current WordPress environment instance.
      */
     $headers = apply_filters('wp_headers', $headers, $this);
     if (!empty($status)) {
         status_header($status);
     }
     // If Last-Modified is set to false, it should not be sent (no-cache situation).
     if (isset($headers['Last-Modified']) && false === $headers['Last-Modified']) {
         unset($headers['Last-Modified']);
         // In PHP 5.3+, make sure we are not sending a Last-Modified header.
         if (function_exists('header_remove')) {
             @header_remove('Last-Modified');
         } else {
             // In PHP 5.2, send an empty Last-Modified header, but only as a
             // last resort to override a header already sent. #WP23021
             foreach (headers_list() as $header) {
                 if (0 === stripos($header, 'Last-Modified')) {
                     $headers['Last-Modified'] = '';
                     break;
                 }
             }
         }
     }
     foreach ((array) $headers as $name => $field_value) {
         @header("{$name}: {$field_value}");
     }
     if ($exit_required) {
         exit;
     }
     /**
      * Fires once the requested HTTP headers for caching, content type, etc. have been sent.
      *
      * @since 2.1.0
      *
      * @param WP &$this Current WordPress environment instance (passed by reference).
      */
     do_action_ref_array('send_headers', array(&$this));
 }
开发者ID:jacques,项目名称:wordpress,代码行数:100,代码来源:class-wp.php


示例6: send_headers

 function send_headers()
 {
     @header('X-Pingback: ' . get_bloginfo('pingback_url'));
     if (is_user_logged_in()) {
         nocache_headers();
     }
     if (!empty($this->query_vars['error']) && '404' == $this->query_vars['error']) {
         status_header(404);
         if (!is_user_logged_in()) {
             nocache_headers();
         }
         @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
     } else {
         if (empty($this->query_vars['feed'])) {
             @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
         } else {
             // We're showing a feed, so WP is indeed the only thing that last changed
             if (!empty($this->query_vars['withcomments']) || empty($this->query_vars['withoutcomments']) && (!empty($this->query_vars['p']) || !empty($this->query_vars['name']) || !empty($this->query_vars['page_id']) || !empty($this->query_vars['pagename']) || !empty($this->query_vars['attachment']) || !empty($this->query_vars['attachment_id']))) {
                 $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0) . ' GMT';
             } else {
                 $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0) . ' GMT';
             }
             $wp_etag = '"' . md5($wp_last_modified) . '"';
             @header("Last-Modified: {$wp_last_modified}");
             @header("ETag: {$wp_etag}");
             // Support for Conditional GET
             if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
                 $client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
             } else {
                 $client_etag = false;
             }
             $client_last_modified = empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? '' : trim($_SERVER['HTTP_IF_MODIFIED_SINCE']);
             // If string is empty, return 0. If not, attempt to parse into a timestamp
             $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0;
             // Make a timestamp for our most recent modification...
             $wp_modified_timestamp = strtotime($wp_last_modified);
             if ($client_last_modified && $client_etag ? $client_modified_timestamp >= $wp_modified_timestamp && $client_etag == $wp_etag : $client_modified_timestamp >= $wp_modified_timestamp || $client_etag == $wp_etag) {
                 status_header(304);
                 exit;
             }
         }
     }
     do_action_ref_array('send_headers', array(&$this));
 }
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:44,代码来源:classes.php


示例7: printf

if (is_singular()) {
    printf(ent2ncr(__('Comments on: %s')), get_the_title_rss());
} elseif (is_search()) {
    printf(ent2ncr(__('Comments for %1$s searching on %2$s')), get_bloginfo_rss('name'), attribute_escape(get_search_query()));
} else {
    printf(ent2ncr(__('Comments for %s')), get_bloginfo_rss('name') . get_wp_title_rss());
}
?>
</title>
	<subtitle type="text"><?php 
bloginfo_rss('description');
?>
</subtitle>

	<updated><?php 
echo mysql2date('Y-m-d\\TH:i:s\\Z', get_lastcommentmodified('GMT'));
?>
</updated>
	<?php 
the_generator('atom');
?>

<?php 
if (is_singular()) {
    ?>
	<link rel="alternate" type="<?php 
    bloginfo_rss('html_type');
    ?>
" href="<?php 
    echo get_comments_link();
    ?>
开发者ID:BGCX262,项目名称:zxhproject-svn-to-git,代码行数:31,代码来源:feed-atom-comments.php


示例8: do_action

	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	<?php do_action('rss2_ns'); do_action('rss2_comments_ns'); ?>
	>
<channel>
	<title><?php
		if ( is_singular() )
			printf(ent2ncr(__('Comments on: %s')), get_the_title_rss());
		elseif ( is_search() )
			printf(ent2ncr(__('Comments for %s searching on %s')), get_bloginfo_rss( 'name' ), esc_attr($wp_query->query_vars['s']));
		else
			printf(ent2ncr(__('Comments for %s')), get_bloginfo_rss( 'name' ) . get_wp_title_rss());
	?></title>
	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
	<link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
	<description><?php bloginfo_rss("description") ?></description>
	<lastBuildDate><?php echo mysql2date('r', get_lastcommentmodified('GMT')); ?></lastBuildDate>
	<sy:updatePeriod><?php echo apply_filters( 'rss_update_period', 'hourly' ); ?></sy:updatePeriod>
	<sy:updateFrequency><?php echo apply_filters( 'rss_update_frequency', '1' ); ?></sy:updateFrequency>
	<?php do_action('commentsrss2_head'); ?>
<?php
if ( have_comments() ) : while ( have_comments() ) : the_comment();
	$comment_post = get_post($comment->comment_post_ID);
	get_post_custom($comment_post->ID);
?>
	<item>
		<title><?php
			if ( !is_singular() ) {
				$title = get_the_title($comment_post->ID);
				$title = apply_filters('the_title_rss', $title);
				printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
			} else {
开发者ID:realfluid,项目名称:umbaugh,代码行数:31,代码来源:feed-rss2-comments.php


示例9: send_headers

 /**
  * Send additional HTTP headers for caching, content type, etc.
  *
  * Sets the X-Pingback header, 404 status (if 404), Content-type. If showing
  * a feed, it will also send last-modified, etag, and 304 status if needed.
  *
  * @since 2.0.0
  */
 function send_headers()
 {
     $headers = array('X-Pingback' => get_bloginfo('pingback_url'));
     $status = null;
     $exit_required = false;
     if (is_user_logged_in()) {
         $headers = array_merge($headers, wp_get_nocache_headers());
     }
     if (!empty($this->query_vars['error'])) {
         $status = (int) $this->query_vars['error'];
         if (404 === $status) {
             if (!is_user_logged_in()) {
                 $headers = array_merge($headers, wp_get_nocache_headers());
             }
             $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
         } elseif (in_array($status, array(403, 500, 502, 503))) {
             $exit_required = true;
         }
     } else {
         if (empty($this->query_vars['feed'])) {
             $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
         } else {
             // We're showing a feed, so WP is indeed the only thing that last changed
             if (!empty($this->query_vars['withcomments']) || empty($this->query_vars['withoutcomments']) && (!empty($this->query_vars['p']) || !empty($this->query_vars['name']) || !empty($this->query_vars['page_id']) || !empty($this->query_vars['pagename']) || !empty($this->query_vars['attachment']) || !empty($this->query_vars['attachment_id']))) {
                 $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0) . ' GMT';
             } else {
                 $wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0) . ' GMT';
             }
             $wp_etag = '"' . md5($wp_last_modified) . '"';
             $headers['Last-Modified'] = $wp_last_modified;
             $headers['ETag'] = $wp_etag;
             // Support for Conditional GET
             if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
                 $client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
             } else {
                 $client_etag = false;
             }
             $client_last_modified = empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? '' : trim($_SERVER['HTTP_IF_MODIFIED_SINCE']);
             // If string is empty, return 0. If not, attempt to parse into a timestamp
             $client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0;
             // Make a timestamp for our most recent modification...
             $wp_modified_timestamp = strtotime($wp_last_modified);
             if ($client_last_modified && $client_etag ? $client_modified_timestamp >= $wp_modified_timestamp && $client_etag == $wp_etag : $client_modified_timestamp >= $wp_modified_timestamp || $client_etag == $wp_etag) {
                 $status = 304;
                 $exit_required = true;
             }
         }
     }
     $headers = apply_filters('wp_headers', $headers, $this);
     if (!empty($status)) {
         status_header($status);
     }
     foreach ((array) $headers as $name => $field_value) {
         @header("{$name}: {$field_value}");
     }
     if ($exit_required) {
         exit;
     }
     do_action_ref_array('send_headers', array(&$this));
 }
开发者ID:ryanmerritt,项目名称:WordPress,代码行数:68,代码来源:class-wp.php


示例10: self_link

?>
</title>
	<atom:link href="<?php 
self_link();
?>
" rel="self" type="application/rss+xml" />
	<link><?php 
is_single() ? the_permalink_rss() : bloginfo_rss("url");
?>
</link>
	<description><?php 
bloginfo_rss("description");
?>
</description>
	<lastBuildDate><?php 
$date = get_lastcommentmodified('GMT');
echo $date ? mysql2date('r', $date, false) : date('r');
?>
</lastBuildDate>
	<sy:updatePeriod><?php 
/** This filter is documented in wp-includes/feed-rss2.php */
echo apply_filters('rss_update_period', 'hourly');
?>
</sy:updatePeriod>
	<sy:updateFrequency><?php 
/** This filter is documented in wp-includes/feed-rss2.php */
echo apply_filters('rss_update_frequency', '1');
?>
</sy:updateFrequency>
	<?php 
/**
开发者ID:CompositeUK,项目名称:clone.WordPress-Develop,代码行数:31,代码来源:feed-rss2-comments.php


示例11: if

}

// Sending HTTP headers

if ( !empty($error) && '404' == $error ) {
	if ( preg_match('/cgi/', php_sapi_name()) )
		@header('Status: 404 Not Found');
	else
		@header('HTTP/1.x 404 Not Found');
 } else if ( empty($feed) ) {
	@header('X-Pingback: '. get_bloginfo('pingback_url'));
	@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
} else {
	// We're showing a feed, so WP is indeed the only thing that last changed
	if ( $withcomments )
		$wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT';
	else 
		$wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT';
	$wp_etag = '"' . md5($wp_last_modified) . '"';
	@header("Last-Modified: $wp_last_modified");
	@header("ETag: $wp_etag");
	@header('X-Pingback: ' . get_bloginfo('pingback_url'));

	// Support for Conditional GET
	if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) $client_last_modified = $_SERVER['HTTP_IF_MODIFIED_SINCE'];
	else $client_last_modified = false;
	if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) $client_etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']);
	else $client_etag = false;

	if ( ($client_last_modified && $client_etag) ?
		((strtotime($client_last_modified) >= strtotime($wp_last_modified)) && ($client_etag == $wp_etag)) :
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:wp-blog-header.php


示例12: self_link

?>
</title>
	<atom:link href="<?php 
self_link();
?>
" rel="self" type="application/rss+xml" />
	<link><?php 
is_single() ? the_permalink_rss() : bloginfo_rss("url");
?>
</link>
	<description><?php 
bloginfo_rss("description");
?>
</description>
	<lastBuildDate><?php 
echo mysql2date('r', get_lastcommentmodified('GMT'));
?>
</lastBuildDate>
	<?php 
the_generator('rss2');
?>
	<sy:updatePeriod><?php 
echo apply_filters('rss_update_period', 'hourly');
?>
</sy:updatePeriod>
	<sy:updateFrequency><?php 
echo apply_filters('rss_update_frequency', '1');
?>
</sy:updateFrequency>
	<?php 
do_action('commentsrss2_head');
开发者ID:angelmoratilla,项目名称:digressit,代码行数:31,代码来源:user-comments-feed.php


示例13: send_headers

	function send_headers() {
		@header('X-Pingback: '. get_bloginfo('pingback_url'));
		if ( is_user_logged_in() )
			nocache_headers();
		if ( !empty($this->query_vars['error']) && '404' == $this->query_vars['error'] ) {
			status_header( 404 );
			if ( !is_user_logged_in() )
				nocache_headers();
			@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
		} else if ( empty($this->query_vars['feed']) ) {
			@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
		} else {
			// We're showing a feed, so WP is indeed the only thing that last changed
			if ( $this->query_vars['withcomments'] )
				$wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastcommentmodified('GMT'), 0).' GMT';
			else 
				$wp_last_modified = mysql2date('D, d M Y H:i:s', get_lastpostmodified('GMT'), 0).' GMT';
			$wp_etag = '"' . md5($wp_last_modified) . '"';
			@header("Last-Modified: $wp_last_modified");
			@header("ETag: $wp_etag");

			// Support for Conditional GET
			if (isset($_SERVER['HTTP_IF_NONE_MATCH']))
				$client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
			else $client_etag = false;

			$client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE']);
			// If string is empty, return 0. If not, attempt to parse into a timestamp
			$client_modified_timestamp = $client_last_modified ? strtotime($client_last_modified) : 0;

			// Make a timestamp for our most recent modification...	
			$wp_modified_timestamp = strtotime($wp_last_modified);

			if ( ($client_last_modified && $client_etag) ?
					 (($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) :
					 (($client_modified_timestamp >= $wp_modified_timestamp) || ($client_etag == $wp_etag)) ) {
				status_header( 304 );
				exit;
			}
		}
	}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:41,代码来源:classes.php


示例14: get_param

        }
        $GLOBALS['doing_rss'] = 1;
        if (test_param('p') && $p != 'all' || test_param('name') || get_param('withcomments') == 1) {
            if (test_param('p')) {
                $_post_id = get_param('p');
                $_post_name = '';
            } else {
                if (test_param('name')) {
                    $_post_id = -1;
                    $_post_name = get_param('name');
                } else {
                    $_post_id = 0;
                    $_post_name = '';
                }
            }
            $lastcommentdate_s = mysql2date('Y-m-d H:i:s', get_lastcommentmodified($_post_id, $_post_name));
            $lastcommentdate = mysql2date('U', $lastcommentdate_s);
            static_content_header($lastcommentdate);
        } else {
            $lastpostdate_s = mysql2date('Y-m-d H:i:s', get_lastpostmodified());
            $lastpostdate = mysql2date('U', $lastpostdate_s);
            static_content_header($lastpostdate);
        }
    }
}
/* Getting settings from db */
if (!empty($GLOBALS['doing_rss'])) {
    $GLOBALS['posts_per_page'] = get_settings('posts_per_rss');
}
if ($GLOBALS['pagenow'] == 'nkarchives.php' && !empty($GLOBALS['wp_arc_posts_per_page'])) {
    $GLOBALS['posts_per_page'] = $GLOBALS['wp_arc_posts_per_page'];
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:31,代码来源:wp-blog-header.php


示例15: get_option

<feed
	xmlns="http://www.w3.org/2005/Atom"
	xml:lang="<?php echo get_option('rss_language'); ?>"
	<?php do_action('atom_ns'); ?>
>
	<title type="text"><?php
		if ( is_singular() )
			printf(ent2ncr(__('Comments on: %s')), get_the_title_rss());
		elseif ( is_search() )
			printf(ent2ncr(__('Comments for %1$s searching on %2$s')), get_bloginfo_rss( 'name' ), attribute_escape(get_search_query()));
		else
			printf(ent2ncr(__('Comments for %s')), get_bloginfo_rss( 'name' ) . get_wp_title_rss());
	?></title>
	<subtitle type="text"><?php bloginfo_rss('description'); ?></subtitle>

	<updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastcommentmodified('GMT')); ?></updated>
	<?php the_generator( 'atom' ); ?>

<?php if ( is_singular() ) { ?>
	<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_comments_link(); ?>" />
	<link rel="self" type="application/atom+xml" href="<?php echo get_post_comments_feed_link('', 'atom'); ?>" />
	<id><?php echo get_post_comments_feed_link('', 'atom'); ?></id>
<?php } elseif(is_search()) { ?>
	<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo get_option('home') . '?s=' . attribute_escape(get_search_query()); ?>" />
	<link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link('', 'atom'); ?>" />
	<id><?php echo get_search_comments_feed_link('', 'atom'); ?></id>
<?php } else { ?>
	<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php bloginfo_rss('home'); ?>" />
	<link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" />
	<id><?php bloginfo_rss('comments_atom_url'); ?></id>
<?php } ?>
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:feed-atom-comments.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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