Beispiel #1
0
    /**
     *
     */
    function miss_comment_tab()
    {
        global $post;
        $get_comments = get_comments('post_id=' . $post->ID);
        $separate_comments = separate_comments($get_comments);
        $comments_by_type =& $separate_comments;
        ?>
<div class="blog_tabs_container">

		<ul class="blog_tabs">
			<li><a href="#" class="current"><?php 
        printf(_n('%1$s Comment', '%1$s Comments', count($comments_by_type['comment']), MISS_TEXTDOMAIN), number_format_i18n(count($comments_by_type['comment'])));
        ?>
</a></li>
			<li><a href="#" class=""><?php 
        printf(_n('%1$s Trackback', '%1$s Trackback', count($comments_by_type['pings']), MISS_TEXTDOMAIN), number_format_i18n(count($comments_by_type['pings'])));
        ?>
</a></li>
			<div class="clearboth"></div>
		</ul><!-- .blog_tabs -->

		<div class="blog_tabs_content">
			<ol class="commentlist">
				<?php 
        wp_list_comments(array('type' => 'comment', 'callback' => 'miss_comments_callback'));
        ?>
			</ol>

			<?php 
        if (get_option('page_comments')) {
            ?>
				<div class="comment-navigation paged-navigation">
					<?php 
            paginate_comments_links(miss_portfolio_comment_url($nav = true));
            ?>
				</div><!-- .comment-navigation -->
			<?php 
        }
        ?>

		</div><!-- .blog_tabs_content -->

		<div class="blog_tabs_content">
			<ol class="commentlist trackbacks_pingbacks">
				<!-- <?php 
        trackback_url();
        ?>
 -->
				<?php 
        wp_list_comments(array('type' => 'pings', 'callback' => 'miss_pings_callback'));
        ?>
			</ol>
		</div><!-- .blog_tabs_content -->

	</div><!-- .blog_tabs_container -->

<?php 
    }
						This entry was posted
						<?php /* This is commented, because it requires a little adjusting sometimes.
							You'll need to download this plugin, and follow the instructions:
							http://binarybonsai.com/archives/2004/08/17/time-since-plugin/ */
							/* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?>
						on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>
						and is filed under <?php the_category(', ') ?>.
						You can follow any responses to this entry through the <?php comments_rss_link('RSS 2.0'); ?> feed.

						<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
							// Both Comments and Pings are open ?>
							You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site.

						<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
							// Only Pings are Open ?>
							Responses are currently closed, but you can <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> from your own site.

						<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
							// Comments are open, Pings are not ?>
							You can skip to the end and leave a response. Pinging is currently not allowed.

						<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
							// Neither Comments, nor Pings are open ?>
							Both comments and pings are currently closed.

						<?php } edit_post_link('Edit this entry.','',''); ?>

					</small>
				</p>

			</div>
			<?php do_atomic( 'after_comment_list' ); // After comment list hook ?>

			<?php if ( get_option( 'page_comments' ) ) : ?>
				<div class="comment-navigation comment-pagination paged-navigation">
					<?php paginate_comments_links(); ?>
				</div><!-- .comment-navigation -->
			<?php endif; ?>

		</div><!-- #comments -->

	<?php else : ?>

		<?php if ( pings_open() && !comments_open() ) : ?>

			<p class="comments-closed pings-open">
				<?php printf( __( 'Comments are closed, but <a href="%1$s" title="Trackback URL for this post">trackbacks</a> and pingbacks are open.', hybrid_get_parent_textdomain() ), trackback_url( '0' ) ); ?>
			</p><!-- .comments-closed .pings-open -->

		<?php endif; ?>

	<?php endif; ?>
	
	<?php 	//modify comment form
			$args = array( 	'title_reply' => __('Leave a comment'),
							'label_submit' => __('Submit'),
						);
	?>

	<?php comment_form( $args ); // Load the comment form. ?>

</div><!-- #comments-template -->
Beispiel #4
0
			</div>
		<?php 
    }
    ?>

	</div><!-- #comments -->
<?php 
} else {
    ?>

	<?php 
    if (pings_open() && !comments_open() && (is_single() || is_page())) {
        ?>
		<p class="comments-closed pings-open">
			<?php 
        printf(__('Comments are closed, but <a href="%1$s" title="Trackback URL for this post">trackbacks</a> and pingbacks are open.', 'framemarket'), trackback_url('0'));
        ?>
		</p>
	<?php 
    } elseif (!comments_open() && (is_single() || is_page())) {
        ?>
		<p class="comments-closed">
			<?php 
        _e('Comments are closed.', 'framemarket');
        ?>
		</p>
	<?php 
    }
    ?>

<?php 
Beispiel #5
0
				</div>
				<br class="clear" />

				<p class="postmetadata alt">
					<small>
						<?php printf(__('This entry was posted on %1$s at %2$s and is filed under %3$s.', 'xpress'),  get_the_time(__('l, F jS, Y', 'xpress')), get_the_time(), get_the_category_list(', ')); ?>
						<?php the_taxonomies(); ?>
						<?php printf(__("You can follow any responses to this entry through the <a href='%s'>RSS 2.0</a> feed.", "xpress"), get_post_comments_feed_link()); ?> 

						<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
							// Both Comments and Pings are open ?>
							<?php printf(__('You can <a href="#respond">leave a response</a>, or <a href="%s" rel="trackback">trackback</a> from your own site.', 'xpress'), trackback_url(false)); ?>

						<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
							// Only Pings are Open ?>
							<?php printf(__('Responses are currently closed, but you can <a href="%s" rel="trackback">trackback</a> from your own site.', 'xpress'), trackback_url(false)); ?>

						<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
							// Comments are open, Pings are not ?>
							<?php _e('You can skip to the end and leave a response. Pinging is currently not allowed.', 'xpress'); ?>

						<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
							// Neither Comments, nor Pings are open ?>
							<?php _e('Both comments and pings are currently closed.', 'xpress'); ?>

						<?php } edit_post_link(__('Edit this entry.', 'xpress'),'',''); ?>

					</small>
				</p>

			</div>
Beispiel #6
0
        printf(__('Posted in %s', 'xpress'), get_the_category_list(', '));
        echo ' | ';
        edit_post_link(__('Edit', 'xpress'), '', ' | ');
        comments_popup_link(__('No Comments &#187;', 'xpress'), __('1 Comment &#187;', 'xpress'), __('% Comments &#187;', 'xpress'), '', __('Comments Closed', 'xpress'));
        ?>
					</div>
							
					<div id ="xpress-pings-block">
						<h3><?php 
        xpress_pings_number('zero=' . __('No Trackback/Pingback', 'xpress') . '&one=' . __('One Trackback/Pingback', 'xpress') . '&more=' . __('% TrackBack/Pingback', 'xpress'));
        ?>
</h3>
						<p class="xpress_pings_status"><small>
						<?php 
        if ('open' == $post->ping_status) {
            printf(__('You can <a href="%s" rel="trackback">trackback</a> from your own site.', 'xpress'), trackback_url(false));
        } else {
            _e('Pinging is currently not allowed.', 'xpress');
        }
        ?>
						</small></p>
						<?php 
        xpress_pings_list('echo=1');
        ?>
					
					</div>
							
					<div id ="xpress-comments-block">
						<?php 
        if (xpress_is_wp_version('<', '2.7')) {
            comments_template();
function recent_posts_list_block($options)
{
    $mydirname = empty($options[0]) ? 'xpress' : $options[0];
    $this_template = empty($options[1]) ? 'db:' . $mydirname . '_recent_posts_list_block.html' : trim($options[1]);
    $disp_count = empty($options[2]) ? '10' : $options[2];
    $disp_red = empty($options[3]) ? '1' : $options[3];
    $disp_green = empty($options[4]) ? '7' : $options[4];
    $date_format = empty($options[5]) ? '' : $options[5];
    $time_format = empty($options[6]) ? '' : $options[6];
    $tag_select = $options[7];
    $cat_select = empty($options[8]) ? '0' : $options[8];
    $selected = explode(',', $cat_select);
    $mydirpath = get_xpress_dir_path();
    if (empty($date_format)) {
        $date_format = get_settings('date_format');
    }
    if (empty($time_format)) {
        $time_format = get_settings('time_format');
    }
    if (empty($tag_select)) {
        $tag_where = '';
    } else {
        $tag_where = "tag='{$tag_select}'&";
    }
    if (array_search(0, $selected) === 0) {
        $cat_select = 0;
    }
    $selected_author_id = xpress_selected_author_id('echo=0');
    if (!empty($selected_author_id)) {
        $author_where = "author={$selected_author_id}&";
    } else {
        $author_where = '';
    }
    global $wpdb, $wp_query;
    $block = array();
    $item_no = 0;
    if (!is_null($wpdb)) {
        $wp_query->in_the_loop = true;
        //for use the_tags() in multi lopp
        if ($cat_select) {
            $r = new WP_Query($author_where . $tag_where . "cat={$cat_select}&showposts={$disp_count}&what_to_show=posts&nopaging=0&post_status=publish");
        } else {
            $r = new WP_Query($author_where . $tag_where . "showposts={$disp_count}&what_to_show=posts&nopaging=0&post_status=publish");
        }
        while ($r->have_posts()) {
            $r->the_post();
            ob_start();
            the_ID();
            $post_id = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_title();
            $title = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_permalink();
            $permalink = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_author_posts_link();
            $author = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_category(' &bull; ');
            $category = ob_get_contents();
            ob_end_clean();
            if (function_exists('the_tags')) {
                ob_start();
                the_tags(__('Tags:', 'xpress') . ' ', ' &bull; ', '');
                $tags = ob_get_contents();
                ob_end_clean();
            } else {
                $tags = '';
            }
            ob_start();
            the_modified_date($date_format);
            $post_modified_date = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_modified_date($time_format);
            $post_modified_time = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_time($date_format);
            $post_date = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_time($time_format);
            $post_time = ob_get_contents();
            ob_end_clean();
            ob_start();
            comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)'));
            $comments_popup_link = ob_get_contents();
            ob_end_clean();
            $red_sec = $disp_red * 60 * 60 * 24;
            $green_sec = $disp_green * 60 * 60 * 24;
            ob_start();
            the_time('U');
            $check_time = ob_get_contents();
            ob_end_clean();
            $elapse = time() - $check_time;
            $new_mark = '';
            if ($elapse < $red_sec) {
                $new_mark = '<em style="color: red; font-size: small;">New! </em>';
            } else {
                if ($elapse < $green_sec) {
                    $new_mark = '<em style="color: green; font-size: small;">New! </em>';
                }
            }
            $post_title = '<a href="' . $permalink . '">' . $title . '</a>';
            $post_date_time = $post_date . ' ' . $post_time;
            $post_modified_date_time = $post_modified_date . ' ' . $post_modified_time;
            $trackback_url = trackback_url(false);
            $post_viwes = xpress_post_views_count('post_id=' . $post_id . '&format=' . __('Views :%d', 'xpress') . '&echo=0');
            //			if (empty($tags)) $tags = __('Not Tag');
            $row_data = array('post_id' => $post_id, 'new_mark' => $new_mark, 'post_title' => $post_title, 'post_date' => $post_date, 'post_time' => $post_time, 'post_date_time' => $post_date_time, 'post_modified_date' => $post_modified_date, 'post_modified_time' => $post_modified_time, 'post_modified_date_time' => $post_modified_date_time, 'post_author' => $author, 'post_category' => $category, 'post_tags' => $tags, 'post_views' => $post_viwes, 'comment_link' => $comments_popup_link, 'trackback_url' => $trackback_url);
            $block['contents']['item' . $item_no] = $row_data;
            $item_no++;
        }
        $block['data_count'] = $item_no;
        //xml unserialise error
    }
    return $block;
}
    function trackback_rdf($timezone = 0, $echo = true)
    {
        $trackback_rdf = '';
        if (!stristr($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator')) {
            $trackback_rdf .= '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
		    xmlns:dc="http://purl.org/dc/elements/1.1/"
		    xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
			<rdf:Description rdf:about="' . get_permalink() . '"' . "\n";
            $trackback_rdf .= '    dc:identifier="' . get_permalink() . '"' . "\n";
            $trackback_rdf .= '    dc:title="' . str_replace('--', '&#x2d;&#x2d;', wptexturize(strip_tags(get_the_title()))) . '"' . "\n";
            $trackback_rdf .= '    trackback:ping="' . trackback_url(0) . '"' . " />\n";
            $trackback_rdf .= '</rdf:RDF>';
        }
        return _echo($trackback_rdf, $echo);
    }
function trackback_rdf($timezone = 0)
{
    global $pathserver, $id, $HTTP_SERVER_VARS;
    if (!stristr($HTTP_SERVER_VARS['HTTP_USER_AGENT'], 'W3C_Validator')) {
        echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" ' . "\n";
        echo '    xmlns:dc="http://purl.org/dc/elements/1.1/"' . "\n";
        echo '    xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">' . "\n";
        echo '<rdf:Description' . "\n";
        echo '    rdf:about="';
        permalink_single();
        echo '"' . "\n";
        echo '    dc:identifier="';
        permalink_single();
        echo '"' . "\n";
        echo '    dc:title="' . addslashes(get_the_title()) . '"' . "\n";
        echo '    trackback:ping="' . trackback_url(0) . '"' . " />\n";
        echo '</rdf:RDF>';
    }
}
Beispiel #10
0
	    <?php 
        if (is_single()) {
            ?>
	    <?php 
            printf('<a href="%s">コメントRSS</a>', get_post_comments_feed_link());
            ?>
 | 
	    <?php 
        }
        ?>

	    <?php 
        if (pings_open()) {
            ?>
	    <?php 
            printf('<a href="%s" rel="trackback">トラックバックURL</a>', trackback_url(false));
            ?>
	    <?php 
        }
        ?>
	  </p>
	  
	</div><!-- end of entry_inner -->
      </div><!-- post_class -->


      <!-- コメント -->
      <?php 
        if (is_single()) {
            ?>
      <?php 
Beispiel #11
0
				<div class="comment-navigation paged-navigation">

					<?php paginate_comments_links(); ?>

				</div>

			<?php endif; ?>

		</div><!-- #comments -->

	<?php else : ?>

		<?php if ( pings_open() && !comments_open() && is_single() ) : ?>

			<p class="comments-closed pings-open">
				<?php printf( __('Comments are closed, but <a href="%1$s" title="Trackback URL for this post">trackbacks</a> and pingbacks are open.', 'buddypress'), trackback_url( '0' ) ); ?>
			</p>

		<?php elseif ( !comments_open() && is_single() ) : ?>

			<p class="comments-closed">
				<?php _e('Comments are closed.', 'buddypress'); ?>
			</p>

		<?php endif; ?>

	<?php endif; ?>

		<?php if ( comments_open() ) : ?>

		<div id="respond">
function trackback_rdf($timezone = 0) {
	global $id;
	if (stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') === false) {
		echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
				xmlns:dc="http://purl.org/dc/elements/1.1/"
				xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
			<rdf:Description rdf:about="';
		the_permalink();
		echo '"'."\n";
		echo '    dc:identifier="';
		the_permalink();
		echo '"'."\n";
		echo '    dc:title="'.str_replace('--', '&#x2d;&#x2d;', wptexturize(strip_tags(get_the_title()))).'"'."\n";
		echo '    trackback:ping="'.trackback_url(0).'"'." />\n";
		echo '</rdf:RDF>';
	}
}
function recent_posts_content_block($options)
{
	$mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
	$this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_recent_posts_content_block.html' : trim( $options[1] );
	$disp_count =  ($options[2])?intval($options[2]):10;
	$excerpt = empty( $options[3] ) ? false : true ;
	$excerpt_size =  ($options[4])?intval($options[4]):100;
	$date_format = empty( $options[5] ) ? '' : $options[5] ;
	$time_format = empty( $options[6] ) ? '' : $options[6] ;
	$tag_select = $options[7] ;
	$cat_select = empty( $options[8] ) ? '0' : $options[8] ;
	$day_select = ($options[9])?intval($options[9]):0;
	$day_size = ($options[10])?intval($options[10]):0;

	$selected = explode(',' , $cat_select);
	
	$mydirpath = get_xpress_dir_path();
	
	if (empty($date_format)) $date_format = get_settings('date_format');
	if (empty($time_format)) $time_format = get_settings('time_format');
	if(empty($tag_select)) $tag_where = ''; else $tag_where = "tag='$tag_select'&";
	if (array_search(0,$selected)===0) $cat_select = 0;

	$selected_author_id = xpress_selected_author_id('echo=0');	
	if (!empty($selected_author_id)){
		$author_where ="author=$selected_author_id&";
	} else {
		$author_where = '';
	}
	
	$date_today = mktime (0, 0, 0, date("m"), date("d"), date("Y"));
	$between_days = $day_size * 60 * 60 * 24;
	
	global $wpdb,$wp_query;
	$block = array();
	$item_no = 0;	
	if (!is_null($wpdb)){
		$wp_query->in_the_loop = true;		//for use the_tags() in multi lopp 
		if ($cat_select) {
			$r = new WP_Query($author_where . $tag_where ."cat=$cat_select&showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish");
		} else {
			$r = new WP_Query($author_where . $tag_where ."showposts=$disp_count&what_to_show=posts&nopaging=0&post_status=publish");
		}
		while($r->have_posts()){			
			$r->the_post();
			if ($day_select == 1){
				$post_date = mktime (0, 0, 0, get_the_time("m"), get_the_time("d"), get_the_time("Y"));
				$base_date = $date_today - $between_days;
				if ($post_date < $base_date) continue;
			}
			if ($day_select == 2){
				$post_date = mktime (0, 0, 0, get_the_time("m"), get_the_time("d"), get_the_time("Y"));
				if (empty($latest_date)) $latest_date = $post_date;
				$base_date = $latest_date - $between_days;
				if ($post_date < $base_date) continue;
			}
			
			ob_start();
				the_ID();
				$post_id = ob_get_contents();
			ob_end_clean();
			
			$title = xpress_the_title('echo=0');
			
			ob_start();
				the_permalink();
				$permalink = ob_get_contents();
			ob_end_clean();					
			
			ob_start();
				the_author_posts_link();
				$author = ob_get_contents();
			ob_end_clean();
			
			ob_start();
				the_category(' &bull; ');
				$category = ob_get_contents();
			ob_end_clean();	
			
			if (function_exists('the_tags')){
				ob_start();
					the_tags(__('Tags:', 'xpress') . ' ',' &bull; ','');
					$tags = ob_get_contents();
				ob_end_clean();	
			} else {
				$tags = '';
			}

			$param = array(
				'configration_select' => 0, 
				'do_excerpt' => $excerpt,
				'excerpt_length_word' => $excerpt_size, 
				'excerpt_length_character' => $excerpt_size, 
				'echo' => 0
			);

			$post_content = xpress_the_content($param);
			
			ob_start();
				the_modified_date($date_format);
				$post_modified_date = ob_get_contents();
			ob_end_clean();
				
			ob_start();
				the_modified_date($time_format);
				$post_modified_time = ob_get_contents();
			ob_end_clean();
			
			ob_start();
				the_time($date_format);
				$post_date = ob_get_contents();
			ob_end_clean();
			
			ob_start();
				the_time($time_format);
				$post_time = ob_get_contents();
			ob_end_clean();
			
			
			ob_start();
				comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)'));
				$comments_popup_link = ob_get_contents();
			ob_end_clean();

// all_in_one			
			ob_start();
?>
				<div class="xpress-post" id="post-<?php the_ID(); ?>">
					<div class ="xpress-post-header">
						<?php if (function_exists('hotDates')) { hotDates(); }?>
						<div class ="xpress-post-title">
							<?php if(function_exists('the_title_attribute')) : ?>			
								<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'xpress'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h2>
							<?php else : ?>
								<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'xpress'), the_title('','',false)); ?>"><?php the_title(); ?></a></h2>
							<?php endif; ?>

						</div>
					</div>
					<div class="xpress-post-entry">
					<?php	echo $post_content; ?>							
					</div>
					<div class="xpress-link-pages"><?php wp_link_pages() ?></div>
					<div class ="xpress-post-footer">
<?php
						the_time('Y/m/d l');
						echo ' - ';
						the_author_posts_link();
						echo ' (' . xpress_post_views_count('post_id=' . $post->ID . '&format=' . __('Views :%d', 'xpress'). '&echo=0') . ')'; 
						
						echo ' | ';
						// echo the_tags(__('Tags:', 'xpress') . ' ', ', ', ' | ');
						printf(__('Posted in %s', 'xpress'), get_the_category_list(', '));
						echo ' | ';
						edit_post_link(__('Edit', 'xpress'), '', ' | ');
						comments_popup_link(__('No Comments &#187;', 'xpress'), __('1 Comment &#187;', 'xpress'), __('% Comments &#187;', 'xpress'), '', __('Comments Closed', 'xpress') );
?>
					</div>
				</div>
<?php
			$all_in_one = ob_get_contents();
			ob_end_clean();
						
			
			$post_title = '<a href="' . $permalink . '">' . $title . '</a>';
			$post_date_time = $post_date . ' ' . $post_time ;
			$post_modified_date_time = $post_modified_date . ' ' . $post_modified_time ;
			$trackback_url = trackback_url(false);
			$post_viwes = xpress_post_views_count('post_id=' . $post_id . '&format=' . __('Views :%d', 'xpress'). '&echo=0');

//			if (empty($tags)) $tags = __('Not Tag');

			$row_data = array(
				'post_id'		=> $post_id ,
				'post_title'	=> $post_title ,
				'post_content' 		=> $post_content ,
				'post_date' => $post_date ,
				'post_time' => $post_time ,
				'post_date_time' => $post_date_time ,
				'post_modified_date' => $post_modified_date ,
				'post_modified_time' => $post_modified_time ,
				'post_modified_date_time' => $post_modified_date_time ,
				'post_author' 	=> $author ,
				'post_category' 	=> $category ,	
				'post_tags' 		=> $tags,
				'post_views' 		=> $post_viwes,
				'comment_link' 	=> $comments_popup_link ,
				'trackback_url' => $trackback_url ,
				'all_in_one' => $all_in_one
			);
			
			$block['contents']['item'.$item_no] = $row_data;
			$item_no++;
		}
		$block['data_count'] = $item_no;  //xml unserialise error
	}
	return $block ;
}
function global_popular_posts_block($options)
{
	$mydirname = empty( $options[0] ) ? 'xpress' : $options[0] ;
	$this_template = empty( $options[1] ) ? 'db:'.$mydirname.'_grobal_popular_posts_block.html' : trim( $options[1] );
	$disp_count = empty( $options[2] ) ? '10' : $options[2] ;
	$show_month_range = empty( $options[3] ) ? '0' : $options[3] ;
	$date_format = empty( $options[4] ) ? '' : $options[4] ;
	$time_format = empty( $options[5] ) ? '' : $options[5] ;
	
	$selected = explode(',' , $cat_select);

	$mydirpath = get_xpress_dir_path();
	
	if (empty($date_format)) $date_format = get_settings('date_format');
	if (empty($time_format)) $time_format = get_settings('time_format');
	
	$cat_select;
	$block = array();
	$item_no = 0;	
	
	$selected_author_id = xpress_selected_author_id('echo=0');	
	
	$data_array = array();

	global $wpdb,$wp_query,$xoops_db,$wp_rewrite;
	
	if (xpress_is_multiblog()){
		$blogs = get_blog_list(0,'all');
		foreach ($blogs AS $blog) {
			switch_to_blog($blog['blog_id']);
			$wp_rewrite->init();
			
			$blog_title = get_bloginfo('name');
			$blog_link = get_bloginfo('url');
			$blog_title_link = '<a href="' . $blog_link . '">' . $blog_title . '</a>' ;

			$db_prefix = get_wp_prefix();
			
			$post_tb = $wpdb->posts;
			$view_tb = $db_prefix . 'views';
			$user_tb = $db_prefix . 'users';
			
			$term_relationships_tb = $wpdb->term_relationships;	// upper 2.3
			$term_taxonomy = $wpdb->term_taxonomy;				// upper 2.3
			$terms_tb = $wpdb->terms;							// upper 2.3

			$post2cat_tb = $wpdb->post2cat; 					//under 2.3
			$categories_tb = $wpdb->categories; 				//under 2.3
			
			include ($mydirpath . '/wp-includes/version.php');
				
			$select = "SELECT $view_tb.post_views, $post_tb.ID, $post_tb.post_title, $post_tb.post_date";				
			if ($wp_db_version >= 6124){
		 		$from  = " FROM (((";
		 		$from .= " $post_tb LEFT JOIN $view_tb ON $post_tb.ID = $view_tb.post_id)";
		 		$from .= " INNER JOIN $term_relationships_tb ON $post_tb.ID = $term_relationships_tb.object_id)";
		 		$from .= " INNER JOIN $term_taxonomy ON $term_relationships_tb.term_taxonomy_id = $term_taxonomy.term_taxonomy_id)";
		 		$from .= " INNER JOIN $terms_tb ON $term_taxonomy.term_id = $terms_tb.term_id ";
		 		
			 	$where = " WHERE $post_tb.post_type = 'post' AND $post_tb.post_status = 'publish'";
			} else {
				$from  = " FROM ((";
				$from .= " $post_tb LEFT JOIN $view_tb ON $post_tb.ID = $view_tb.post_id)";
				$from .= " LEFT JOIN $post2cat_tb ON $post_tb.ID = $post2cat_tb.post_id)";
				$from .= " INNER JOIN $user_tb ON $post_tb.post_author = $user_tb.ID";
				
				$where = " WHERE ($post_tb.post_status = 'publish') AND  (UNIX_TIMESTAMP($post_tb.post_date) <= UNIX_TIMESTAMP())" ;
				
			}
				

			if ($show_month_range > 0) {
			 		$where .= " AND (UNIX_TIMESTAMP($post_tb.post_date) >= UNIX_TIMESTAMP(DATE_ADD(CURRENT_DATE, INTERVAL -$show_month_range month)))";
			}
			$order_limmit = " GROUP BY $post_tb.ID ORDER BY $view_tb.post_views DESC LIMIT 0, $disp_count";
			$sql = $select . $from . $where . $order_limmit;

			$populars = $wpdb->get_results($sql);
			
			foreach ($populars as $popular){
				$wp_query->in_the_loop = true;		//for use the_tags() in multi lopp 
				$r = new WP_Query("p=$popular->ID");
				if($r->have_posts()){
					$r->the_post();
					ob_start();
						the_ID();
						$post_id = ob_get_contents();
					ob_end_clean();
					
					ob_start();
						the_title();
						$title = ob_get_contents();
					ob_end_clean();
					
					ob_start();
						the_permalink();
						$permalink = ob_get_contents();
					ob_end_clean();					
					
					ob_start();
						the_author_posts_link();
						$author = ob_get_contents();
					ob_end_clean();
					
					ob_start();
						the_category(' &bull; ');
						$category = ob_get_contents();
					ob_end_clean();	
					
					if (function_exists('the_tags')){
						ob_start();
							the_tags(__('Tags:', 'xpress') . ' ',' &bull; ','');
							$tags = ob_get_contents();
						ob_end_clean();	
					} else {
						$tags = '';
					}
					
					ob_start();
						the_modified_date($date_format);
						$post_modified_date = ob_get_contents();
					ob_end_clean();
						
					ob_start();
						the_modified_date($time_format);
						$post_modified_time = ob_get_contents();
					ob_end_clean();
					
					ob_start();
						the_time($date_format);
						$post_date = ob_get_contents();
					ob_end_clean();
					
					ob_start();
						the_time($time_format);
						$post_time = ob_get_contents();
					ob_end_clean();
					
					
					ob_start();
						comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)'));
						$comments_popup_link = ob_get_contents();
					ob_end_clean();
					

					$post_title = '<a href="' . $permalink . '">' . $title . '</a>';
					$post_date_time = $post_date . ' ' . $post_time ;
					$post_modified_date_time = $post_modified_date . ' ' . $post_modified_time ;
					$trackback_url = trackback_url(false);
					$post_views = xpress_post_views_count('post_id=' . $post_id . '&format=' . __('Views :%d', 'xpress'). '&echo=0');
					$post_views_num = (int) xpress_post_views_count("post_id={$post_id}&format=%d&echo=0");
					$row_data = array(
						'blog_title' => $blog_title ,
						'blog_link' => $blog_link ,
						'blog_title_link' => $blog_title_link ,
						'post_id'		=> $post_id ,
						'post_title'	=> $post_title ,
						'post_date' => $post_date ,
						'post_time' => $post_time ,
						'post_date_time' => $post_date_time ,
						'post_modified_date' => $post_modified_date ,
						'post_modified_time' => $post_modified_time ,
						'post_modified_date_time' => $post_modified_date_time ,
						'post_author' 	=> $author ,
						'post_category' 	=> $category ,	
						'post_tags' 		=> $tags,
						'post_views' 		=> $post_views,
						'post_views_num'	=> $post_views_num,
						'comment_link' 	=> $comments_popup_link ,
						'trackback_url' => $trackback_url
					);
					$data_array[] = $row_data;
				}
			}  // end of foreach
			restore_current_blog();
			$wp_rewrite->init();
		}
		usort($data_array, "post_views_cmp");
		if (!empty($disp_count)){
			$data_array = array_slice($data_array,0,$disp_count);
		}

		$item_no = 0;
		foreach ($data_array as $data) {
			$block['contents']['item'.$item_no] = $data;
			$item_no++;
		}
		$block['data_count'] = $item_no;
	} else {
		$block['err_message'] = __('This blog is not set to the multi blog.', 'xpress');
	}
	return $block ;
}
function thematic_postfooter()
{
    global $id, $post;
    // Create $posteditlink
    $posteditlink .= '<span class="edit"><a href="' . get_bloginfo('wpurl') . '/wp-admin/post.php?action=edit&amp;post=' . $id;
    $posteditlink .= '" title="' . __('Edit post', 'thematic') . '">';
    $posteditlink .= __('Edit', 'thematic') . '</a></span>';
    $posteditlink = apply_filters('thematic_postfooter_posteditlink', $posteditlink);
    // Display the post categories
    $postcategory .= '<span class="cat-links">';
    if (is_single()) {
        $postcategory .= __('This entry was posted in ', 'thematic') . get_the_category_list(', ');
        $postcategory .= '</span>';
    } elseif (is_category() && ($cats_meow = thematic_cats_meow(', '))) {
        /* Returns categories other than the one queried */
        $postcategory .= __('Also posted in ', 'thematic') . $cats_meow;
        $postcategory .= '</span> <span class="meta-sep meta-sep-tag-links">|</span>';
    } else {
        $postcategory .= __('Posted in ', 'thematic') . get_the_category_list(', ');
        $postcategory .= '</span> <span class="meta-sep meta-sep-tag-links">|</span>';
    }
    $postcategory = apply_filters('thematic_postfooter_postcategory', $postcategory);
    // Display the tags
    if (is_single()) {
        $tagtext = __(' and tagged', 'thematic');
        $posttags = get_the_tag_list("<span class=\"tag-links\"> {$tagtext} ", ', ', '</span>');
    } elseif (is_tag() && ($tag_ur_it = thematic_tag_ur_it(', '))) {
        /* Returns tags other than the one queried */
        $posttags = '<span class="tag-links">' . __(' Also tagged ', 'thematic') . $tag_ur_it . '</span> <span class="meta-sep meta-sep-comments-link">|</span>';
    } else {
        $tagtext = __('Tagged', 'thematic');
        $posttags = get_the_tag_list("<span class=\"tag-links\"> {$tagtext} ", ', ', '</span> <span class="meta-sep meta-sep-comments-link">|</span>');
    }
    $posttags = apply_filters('thematic_postfooter_posttags', $posttags);
    // Display comments link and edit link
    if (comments_open()) {
        $postcommentnumber = get_comments_number();
        if ($postcommentnumber > '1') {
            $postcomments = ' <span class="comments-link"><a href="' . get_permalink() . '#comments" title="' . __('Comment on ', 'thematic') . the_title_attribute('echo=0') . '">';
            $postcomments .= get_comments_number() . __(' Comments', 'thematic') . '</a></span>';
        } elseif ($postcommentnumber == '1') {
            $postcomments = ' <span class="comments-link"><a href="' . get_permalink() . '#comments" title="' . __('Comment on ', 'thematic') . the_title_attribute('echo=0') . '">';
            $postcomments .= get_comments_number() . __(' Comment', 'thematic') . '</a></span>';
        } elseif ($postcommentnumber == '0') {
            $postcomments = ' <span class="comments-link"><a href="' . get_permalink() . '#comments" title="' . __('Comment on ', 'thematic') . the_title_attribute('echo=0') . '">';
            $postcomments .= __('Leave a comment', 'thematic') . '</a></span>';
        }
    } else {
        $postcomments = ' <span class="comments-link comments-closed-link">' . __('Comments closed', 'thematic') . '</span>';
    }
    // Display edit link
    if (current_user_can('edit_posts')) {
        $postcomments .= ' <span class="meta-sep meta-sep-edit">|</span> ' . $posteditlink;
    }
    $postcomments = apply_filters('thematic_postfooter_postcomments', $postcomments);
    // Display permalink, comments link, and RSS on single posts
    $postconnect .= __('. Bookmark the ', 'thematic') . '<a href="' . get_permalink() . '" title="' . __('Permalink to ', 'thematic') . the_title_attribute('echo=0') . '">';
    $postconnect .= __('permalink', 'thematic') . '</a>.';
    if ('open' == $post->comment_status && 'open' == $post->ping_status) {
        /* Comments are open */
        $postconnect .= ' <a class="comment-link" href="#respond" title ="' . __('Post a comment', 'thematic') . '">' . __('Post a comment', 'thematic') . '</a>';
        $postconnect .= __(' or leave a trackback: ', 'thematic');
        $postconnect .= '<a class="trackback-link" href="' . trackback_url(FALSE) . '" title ="' . __('Trackback URL for your post', 'thematic') . '" rel="trackback">' . __('Trackback URL', 'thematic') . '</a>.';
    } elseif (!('open' == $post->comment_status) && 'open' == $post->ping_status) {
        /* Only trackbacks are open */
        $postconnect .= __(' Comments are closed, but you can leave a trackback: ', 'thematic');
        $postconnect .= '<a class="trackback-link" href="' . trackback_url(FALSE) . '" title ="' . __('Trackback URL for your post', 'thematic') . '" rel="trackback">' . __('Trackback URL', 'thematic') . '</a>.';
    } elseif ('open' == $post->comment_status && !('open' == $post->ping_status)) {
        /* Only comments open */
        $postconnect .= __(' Trackbacks are closed, but you can ', 'thematic');
        $postconnect .= '<a class="comment-link" href="#respond" title ="' . __('Post a comment', 'thematic') . '">' . __('post a comment', 'thematic') . '</a>.';
    } elseif (!('open' == $post->comment_status) && !('open' == $post->ping_status)) {
        /* Comments and trackbacks closed */
        $postconnect .= __(' Both comments and trackbacks are currently closed.', 'thematic');
    }
    // Display edit link on single posts
    if (current_user_can('edit_posts')) {
        $postconnect .= ' ' . $posteditlink;
    }
    $postconnect = apply_filters('thematic_postfooter_postconnect', $postconnect);
    // Add it all up
    if ($post->post_type == 'page' && current_user_can('edit_posts')) {
        /* For logged-in "page" search results */
        $postfooter = '<div class="entry-utility">' . '<span class="edit">' . $posteditlink . '</span>';
        $postfooter .= "</div><!-- .entry-utility -->\n";
    } elseif ($post->post_type == 'page') {
        /* For logged-out "page" search results */
        $postfooter = '';
    } else {
        if (is_single()) {
            $postfooter = '<div class="entry-utility">' . $postcategory . $posttags . $postconnect;
        } else {
            $postfooter = '<div class="entry-utility">' . $postcategory . $posttags . $postcomments;
        }
        $postfooter .= "</div><!-- .entry-utility -->\n";
    }
    // Put it on the screen
    echo apply_filters('thematic_postfooter', $postfooter);
    // Filter to override default post footer
}
Beispiel #16
0
</a> </td><?php 
            }
            ?>
            <?php 
            if ($settings["post_single_meta"]) {
                ?>
            <td class="details">
              <?php 
                printf(__('This entry was posted by %1$s on %2$s at %3$s, and is filed under %4$s. Follow any responses to this post through %5$s.', 'mystique'), '<a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" title="' . sprintf(__("Posts by %s", "mystique"), attribute_escape(get_the_author())) . ' ">' . get_the_author() . '</a>', get_the_time(get_option('date_format')), get_the_time(get_option('time_format')), get_the_category_list(', '), '<a href="' . get_post_comments_feed_link($post->ID) . '" title="RSS 2.0">RSS 2.0</a>');
                echo ' ';
                if ('open' == $post->comment_status && 'open' == $post->ping_status) {
                    // Both Comments and Pings are open
                    printf(__('You can <a%1$s>leave a response</a> or <a%2$s>trackback</a> from your own site.', 'mystique'), ' href="#respond"', ' href="' . trackback_url('', false) . '" rel="trackback"');
                } elseif (!('open' == $post->comment_status) && 'open' == $post->ping_status) {
                    // Only Pings are Open
                    printf(__('Responses are currently closed, but you can <a%1$s>trackback</a> from your own site.', 'mystique'), ' href="' . trackback_url('', false) . '" rel="trackback"');
                } elseif ('open' == $post->comment_status && !('open' == $post->ping_status)) {
                    // Comments are open, Pings are not
                    _e('You can skip to the end and leave a response. Pinging is currently not allowed.', 'mystique');
                } elseif (!('open' == $post->comment_status) && !('open' == $post->ping_status)) {
                    // Neither Comments, nor Pings are open
                    _e('Both comments and pings are currently closed.', 'mystique');
                }
                edit_post_link(__('Edit this entry', 'mystique'));
                ?>
            </td>
            <?php 
            }
            ?>
          </tr>
        </table>
    _e('Trackback this post', 'flower-power');
    ?>
</a> &nbsp;|&nbsp; <?php 
    post_comments_feed_link(__('Subscribe to comments via RSS Feed', 'flower-power'));
    ?>
</p>
<?php 
} elseif (comments_open()) {
    ?>
	<p><?php 
    post_comments_feed_link(__('Subscribe to comments via RSS Feed', 'flower-power'));
    ?>
</p>
<?php 
} elseif (pings_open()) {
    ?>
	<p><a href="<?php 
    trackback_url('display');
    ?>
"><?php 
    _e('Trackback', 'flower-power');
    ?>
</a></p>
<?php 
}
?>

<div class="divider"></div>
		
</div> <!-- /comments -->
	<style type="text/css" media="screen">
		@import url( <?php bloginfo('stylesheet_url'); ?> );
		body { margin: 3px; }
	</style>

</head>
<body id="commentspopup">

<h1 id="header"><a href="" title="<?php echo get_settings('blogname'); ?>"><?php echo get_settings('blogname'); ?></a></h1>

<h2 id="comments">Comments</h2>

<p><a href="<?php echo get_settings('siteurl'); ?>/wp-commentsrss2.php?p=<?php echo $post->ID; ?>"><abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.</a></p>

<?php if ('open' == $post->ping_status) { ?>
<p>The <acronym title="Uniform Resource Identifier">URI</acronym> to TrackBack this entry is: <em><?php trackback_url() ?></em></p>
<?php } ?>

<?php
// this line is WordPress' motor, do not delete it.
$commenter = wp_get_current_commenter();
extract($commenter);
$comments = get_approved_comments($id);
$post = get_post($id);
if (!empty($post->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
	echo(get_the_password_form());
} else { ?>

<?php if ($comments) { ?>
<ol id="commentlist">
<?php foreach ($comments as $comment) { ?>
	<style type="text/css" media="screen">
		@import url( <?php bloginfo('stylesheet_url'); ?> );
		body { margin: 3px; }
	</style>

</head>
<body id="commentspopup">

<h1 id="header"><a href="" title="<?php echo get_option('blogname'); ?>"><?php echo get_option('blogname'); ?></a></h1>

<h2 id="comments"><?php _e("Comments"); ?></h2>

<p><a href="<?php echo get_post_comments_feed_link($post->ID); ?>"><?php _e("<abbr title=\"Really Simple Syndication\">RSS</abbr> feed for comments on this post."); ?></a></p>

<?php if ('open' == $post->ping_status) { ?>
<p><?php _e("The <abbr title=\"Universal Resource Locator\">URL</abbr> to TrackBack this entry is:"); ?> <em><?php trackback_url() ?></em></p>
<?php } ?>

<?php
// this line is WordPress' motor, do not delete it.
$commenter = wp_get_current_commenter();
extract($commenter);
$comments = get_approved_comments($id);
$commentstatus = get_post($id);
if (!empty($commentstatus->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) {  // and it doesn't match the cookie
	echo(get_the_password_form());
} else { ?>

<?php if ($comments) { ?>
<ol id="commentlist">
<?php foreach ($comments as $comment) { ?>
Beispiel #20
0
function vanilla_postfooter()
{
    global $id, $post;
    // Display the tags
    if (is_single()) {
        $tagtext = __(' and tagged', 'thematic');
        $posttags = get_the_tag_list("<span class=\"tag-links\"> {$tagtext} ", ', ', '</span>');
    } elseif (is_tag() && ($tag_ur_it = sandbox_tag_ur_it(', '))) {
        /* Returns tags other than the one queried */
        $posttags = '<span class="tag-links">' . __(' Also tagged ', 'thematic') . $tag_ur_it . '</span> <span class="meta-sep">|</span>';
    } else {
        $tagtext = __('Tagged', 'thematic');
        $posttags = get_the_tag_list("<span class=\"tag-links\"> {$tagtext} ", ', ', '</span> <span class="meta-sep">|</span>');
    }
    // Display comments link and edit link
    $postcomments = ' <span class="comments-link"><span class="bracket">{</span>';
    if (comments_open()) {
        $postcommentnumber = get_comments_number();
        if ($postcommentnumber != '1') {
            $postcomments .= ' <a href="' . get_permalink() . '#comments" title="' . __('Comment on ', 'thematic') . the_title_attribute('echo=0') . '">';
            $postcomments .= '<span>' . get_comments_number() . '</span>' . __(' comments', 'thematic') . '</a>';
        } else {
            $postcomments .= ' <a href="' . get_permalink() . '#comments" title="' . __('Comment on ', 'thematic') . the_title_attribute('echo=0') . '">';
            $postcomments .= '<span>' . get_comments_number() . '</span>' . __(' comment', 'thematic') . '</a>';
        }
    } else {
        $postcomments .= __('Comments closed', 'thematic');
    }
    $postcomments .= ' <span class="bracket">}</span></span>';
    // Display permalink, comments link, and RSS on single posts
    $postconnect .= __('. Bookmark the ', 'thematic') . '<a href="' . get_permalink() . '" title="' . __('Permalink to ', 'thematic') . the_title_attribute('echo=0') . '">';
    $postconnect .= __('permalink', 'thematic') . '</a>.';
    if ('open' == $post->comment_status && 'open' == $post->ping_status) {
        /* Comments are open */
        $postconnect .= ' <a class="comment-link" href="#respond" title ="' . __('Post a comment', 'thematic') . '">' . __('Post a comment', 'thematic') . '</a>';
        $postconnect .= __(' or leave a trackback: ', 'thematic');
        $postconnect .= '<a class="trackback-link" href="' . trackback_url(FALSE) . '" title ="' . __('Trackback URL for your post', 'thematic') . '" rel="trackback">' . __('Trackback URL', 'thematic') . '</a>.';
    } elseif (!('open' == $post->comment_status) && 'open' == $post->ping_status) {
        /* Only trackbacks are open */
        $postconnect .= __(' Comments are closed, but you can leave a trackback: ', 'thematic');
        $postconnect .= '<a class="trackback-link" href="' . trackback_url(FALSE) . '" title ="' . __('Trackback URL for your post', 'thematic') . '" rel="trackback">' . __('Trackback URL', 'thematic') . '</a>.';
    } elseif ('open' == $post->comment_status && !('open' == $post->ping_status)) {
        /* Only comments open */
        $postconnect .= __(' Trackbacks are closed, but you can ', 'thematic');
        $postconnect .= '<a class="comment-link" href="#respond" title ="' . __('Post a comment', 'thematic') . '">' . __('post a comment', 'thematic') . '</a>.';
    } elseif (!('open' == $post->comment_status) && !('open' == $post->ping_status)) {
        /* Comments and trackbacks closed */
        $postconnect .= __(' Both comments and trackbacks are currently closed.', 'thematic');
    }
    // Display edit link on single posts
    if (current_user_can('edit_posts')) {
        $postconnect .= ' ' . $posteditlink;
    }
    // Add it all up
    $postfooter = '<div class="entry-utility">';
    if ($post->post_type == 'page' && current_user_can('edit_posts')) {
        /* For logged-in "page" search results */
        $postfooter .= $posteditlink;
    } elseif ($post->post_type == 'page') {
        /* For logged-out "page" search results */
        // nothing
    } else {
        if (is_single()) {
            $postfooter .= $posttags . $postconnect;
        } else {
            $postfooter .= $posttags . $postcomments;
        }
    }
    $postfooter .= "</div><!-- .entry-utility -->\n";
    // Put it on the screen
    echo apply_filters('vanilla_postfooter', $postfooter);
    // Filter to override default post footer
}
function popular_posts_block($options)
{
    $mydirname = empty($options[0]) ? 'xpress' : $options[0];
    $this_template = empty($options[1]) ? 'db:' . $mydirname . '_block_popular.html' : trim($options[1]);
    $disp_count = empty($options[2]) ? '10' : $options[2];
    $show_month_range = empty($options[3]) ? '0' : $options[3];
    $date_format = empty($options[4]) ? '' : $options[4];
    $time_format = empty($options[5]) ? '' : $options[5];
    $tag_select = $options[6];
    $cat_select = empty($options[7]) ? '0' : $options[7];
    $selected = explode(',', $cat_select);
    $mydirpath = get_xpress_dir_path();
    if (empty($date_format)) {
        $date_format = get_settings('date_format');
    }
    if (empty($time_format)) {
        $time_format = get_settings('time_format');
    }
    if (array_search(0, $selected) === 0) {
        $cat_select = 0;
    }
    $cat_select;
    $block = array();
    $item_no = 0;
    $selected_author_id = xpress_selected_author_id('echo=0');
    global $wpdb, $wp_query, $xoops_db;
    $db_prefix = get_wp_prefix();
    $post_tb = $wpdb->posts;
    $view_tb = $db_prefix . 'views';
    $user_tb = $db_prefix . 'users';
    $term_relationships_tb = $wpdb->term_relationships;
    // upper 2.3
    $term_taxonomy = $wpdb->term_taxonomy;
    // upper 2.3
    $terms_tb = $wpdb->terms;
    // upper 2.3
    $post2cat_tb = $wpdb->post2cat;
    //under 2.3
    $categories_tb = $wpdb->categories;
    //under 2.3
    include $mydirpath . '/wp-includes/version.php';
    $select = "SELECT {$view_tb}.post_views, {$post_tb}.ID, {$post_tb}.post_title, {$post_tb}.post_date";
    if ($wp_db_version >= 6124) {
        $from = " FROM (((";
        $from .= " {$post_tb} LEFT JOIN {$view_tb} ON {$post_tb}.ID = {$view_tb}.post_id)";
        $from .= " INNER JOIN {$term_relationships_tb} ON {$post_tb}.ID = {$term_relationships_tb}.object_id)";
        $from .= " INNER JOIN {$term_taxonomy} ON {$term_relationships_tb}.term_taxonomy_id = {$term_taxonomy}.term_taxonomy_id)";
        $from .= " INNER JOIN {$terms_tb} ON {$term_taxonomy}.term_id = {$terms_tb}.term_id ";
        $where = " WHERE {$post_tb}.post_type = 'post' AND {$post_tb}.post_status = 'publish'";
        //		if (!empty($selected_author_id)){
        //			$where  .= " AND ($post_tb.post_author = $selected_author_id) ";
        //			$where  .= " AND ($post_tb.post_author = 2) ";
        //		}
        if ($cat_select) {
            $where .= " AND ({$term_taxonomy}.term_id IN ({$cat_select}))";
        }
        if (!empty($tag_select)) {
            $tag_id_list = get_tag_id($tag_select);
            if (!empty($tag_id_list)) {
                $where .= " AND ({$term_taxonomy}.term_id IN ({$tag_id_list}))";
            }
        }
    } else {
        $from = " FROM ((";
        $from .= " {$post_tb} LEFT JOIN {$view_tb} ON {$post_tb}.ID = {$view_tb}.post_id)";
        $from .= " LEFT JOIN {$post2cat_tb} ON {$post_tb}.ID = {$post2cat_tb}.post_id)";
        $from .= " INNER JOIN {$user_tb} ON {$post_tb}.post_author = {$user_tb}.ID";
        $where = " WHERE ({$post_tb}.post_status = 'publish') AND  (UNIX_TIMESTAMP({$post_tb}.post_date) <= UNIX_TIMESTAMP())";
        if ($cat_select) {
            $where .= " AND ({$post2cat_tb}.category_id IN ({$cat_select}))";
        }
    }
    if ($show_month_range > 0) {
        $where .= " AND (UNIX_TIMESTAMP({$post_tb}.post_date) >= UNIX_TIMESTAMP(DATE_ADD(CURRENT_DATE, INTERVAL -{$show_month_range} month)))";
    }
    $order_limmit = " GROUP BY {$post_tb}.ID ORDER BY {$view_tb}.post_views DESC LIMIT 0, {$disp_count}";
    $sql = $select . $from . $where . $order_limmit;
    $populars = $wpdb->get_results($sql);
    foreach ($populars as $popular) {
        $wp_query->in_the_loop = true;
        //for use the_tags() in multi lopp
        $r = new WP_Query("p={$popular->ID}");
        if ($r->have_posts()) {
            $r->the_post();
            ob_start();
            the_ID();
            $post_id = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_title();
            $title = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_permalink();
            $permalink = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_author_posts_link();
            $author = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_category(' &bull; ');
            $category = ob_get_contents();
            ob_end_clean();
            if (function_exists('the_tags')) {
                ob_start();
                the_tags(__('Tags:', 'xpress') . ' ', ' &bull; ', '');
                $tags = ob_get_contents();
                ob_end_clean();
            } else {
                $tags = '';
            }
            ob_start();
            the_modified_date($date_format);
            $post_modified_date = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_modified_date($time_format);
            $post_modified_time = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_time($date_format);
            $post_date = ob_get_contents();
            ob_end_clean();
            ob_start();
            the_time($time_format);
            $post_time = ob_get_contents();
            ob_end_clean();
            ob_start();
            comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)'));
            $comments_popup_link = ob_get_contents();
            ob_end_clean();
            $post_title = '<a href="' . $permalink . '">' . $title . '</a>';
            $post_date_time = $post_date . ' ' . $post_time;
            $post_modified_date_time = $post_modified_date . ' ' . $post_modified_time;
            $trackback_url = trackback_url(false);
            $post_viwes = xpress_post_views_count('post_id=' . $post_id . '&format=' . __('Views :%d', 'xpress') . '&echo=0');
            //			if (empty($tags)) $tags = __('Not Tag');
            $row_data = array('post_id' => $post_id, 'post_title' => $post_title, 'post_date' => $post_date, 'post_time' => $post_time, 'post_date_time' => $post_date_time, 'post_modified_date' => $post_modified_date, 'post_modified_time' => $post_modified_time, 'post_modified_date_time' => $post_modified_date_time, 'post_author' => $author, 'post_category' => $category, 'post_tags' => $tags, 'post_views' => $post_viwes, 'comment_link' => $comments_popup_link, 'trackback_url' => $trackback_url);
            $block['contents']['item' . $item_no] = $row_data;
            $item_no++;
        }
    }
    // end of foreach
    $block['data_count'] = $item_no;
    //xml unserialise error
    return $block;
}
	<style type="text/css" media="screen">
		@import url( <?php bloginfo('stylesheet_url'); ?> );
		body { margin: 3px; }
	</style>

</head>
<body id="commentspopup">

<h1 id="header"><a href="" title="<?php echo get_settings('blogname'); ?>"><?php echo get_settings('blogname'); ?></a></h1>

<h2 id="comments"><?php _e("Comments"); ?></h2>

<p><a href="<?php echo get_settings('siteurl'); ?>/wp-commentsrss2.php?p=<?php echo $post->ID; ?>"><?php _e("<abbr title=\"Really Simple Syndication\">RSS</abbr> feed for comments on this post."); ?></a></p>

<?php if ('open' == $post->ping_status) { ?>
<p><?php _e("The <acronym title=\"Uniform Resource Identifier\">URI</acronym> to TrackBack this entry is:"); ?> <em><?php trackback_url() ?></em></p>
<?php } ?>

<?php
// this line is WordPress' motor, do not delete it.
$commenter = wp_get_current_commenter();
extract($commenter);
$comments = get_approved_comments($id);
$commentstatus = get_post($id);
if (!empty($commentstatus->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) {  // and it doesn't match the cookie
	echo(get_the_password_form());
} else { ?>

<?php if ($comments) { ?>
<ol id="commentlist">
<?php foreach ($comments as $comment) { ?>
function trackback_rdf($timezone = 0)
{
    global $siteurl, $id;
    if (!stristr($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator')) {
        echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" ' . "\n";
        echo '    xmlns:dc="http://purl.org/dc/elements/1.1/"' . "\n";
        echo '    xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xml:lang="ja">' . "\n";
        echo '<rdf:Description' . "\n";
        echo '    rdf:about="';
        permalink_single();
        echo '"' . "\n";
        echo '    dc:identifier="';
        permalink_single();
        echo '"' . "\n";
        echo '    dc:title="' . str_replace('--', '&#x2d;&#x2d;', addslashes(strip_tags(get_the_title()))) . '"' . "\n";
        echo '    trackback:ping="' . trackback_url(0) . '"' . " />\n";
        echo '</rdf:RDF>';
    }
}
Beispiel #24
0
	<?php echo get_avatar( $comment, 32 ); ?>
	<?php comment_text() ?>
	<p><cite><?php comment_type(_x('Comment', 'noun'), __('Trackback'), __('Pingback')); ?> <?php _e('by'); ?> <?php comment_author_link() ?> &#8212; <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite> <?php edit_comment_link(__("Edit This"), ' |'); ?></p>
	</li>

<?php endforeach; ?>

</ol>

<?php else : // If there are no comments yet ?>
	<p><?php _e('No comments yet.'); ?></p>
<?php endif; ?>

<p><?php post_comments_feed_link(__('<abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.')); ?>
<?php if ( pings_open() ) : ?>
	<a href="<?php trackback_url() ?>" rel="trackback"><?php _e('TrackBack <abbr title="Universal Resource Locator">URL</abbr>'); ?></a>
<?php endif; ?>
</p>

<?php if ( comments_open() ) : ?>
<h2 id="postcomment"><?php _e('Leave a comment'); ?></h2>

<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
<p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.'), wp_login_url( get_permalink() ) );?></p>
<?php else : ?>

<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

<?php if ( is_user_logged_in() ) : ?>

<p><?php printf(__('Logged in as %s.'), '<a href="'.get_option('siteurl').'/wp-admin/profile.php">'.$user_identity.'</a>'); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Log out of this account') ?>"><?php _e('Log out &raquo;'); ?></a></p>
Beispiel #25
0
               <div class="clear"></div>
		    </div>

            <p class="postmetadata alt">
  			<small>
                 <?php 
        printf(__('This entry was posted on %s and is filed under %s. You can follow any responses to this entry through %s.', 'fusion'), get_the_time(get_option('date_format') . ', ' . get_option('time_format')), get_the_category_list(', '), '<a href="' . get_post_comments_feed_link($post->ID) . '" title="RSS 2.0">RSS 2.0</a>');
        ?>

                 <?php 
        if ('open' == $post->comment_status && 'open' == $post->ping_status) {
            // Both Comments and Pings are open
            printf(__('You can <a href="#respond">leave a response</a>, or <a href="%s" rel="trackback">trackback</a> from your own site.', 'fusion'), trackback_url('', false));
        } elseif (!('open' == $post->comment_status) && 'open' == $post->ping_status) {
            // Only Pings are Open
            printf(__('Responses are currently closed, but you can <a href="%s" rel="trackback">trackback</a> from your own site.', 'fusion'), trackback_url('', false));
        } elseif ('open' == $post->comment_status && !('open' == $post->ping_status)) {
            // Comments are open, Pings are not
            _e('You can skip to the end and leave a response. Pinging is currently not allowed.', 'fusion');
        } elseif (!('open' == $post->comment_status) && !('open' == $post->ping_status)) {
            // Neither Comments, nor Pings are open
            _e('Both comments and pings are currently closed.', 'fusion');
        }
        ?>
                  <?php 
        edit_post_link(__('Edit this entry', 'fusion'));
        ?>
              </small>
  		   </p>
  	<?php 
        comments_template();
Beispiel #26
0
function bfa_postinfo($postinfo_string)
{
    // one theme option needed below for nofollow trackback / RSS links yes/no
    global $bfa_ata, $post;
    /* replace date format escape placeholders(#) with the actual escpae
    	character (=backslashes). This function removes all backslashes from
    	post info strings to avoid issues with hosts that have magic_quotes_gpc ON.
    	But we want to keep the backslashes inside date items, because they are
    	needed to escape literal strings inside dates */
    $postinfo_string = str_replace("#", "\\", $postinfo_string);
    $postinfo = $postinfo_string;
    // Author public name
    if (strpos($postinfo_string, '%author%') !== FALSE) {
        ob_start();
        the_author();
        $author = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author%", $author, $postinfo);
    }
    // Public name of Author who last modified a post, since WordPress 2.8.
    // Check first if function is available (= if this is WP 2.8+)
    if (function_exists('the_modified_author')) {
        if (strpos($postinfo_string, '%modified-author%') !== FALSE) {
            ob_start();
            the_modified_author();
            $modified_author = ob_get_contents();
            ob_end_clean();
            $postinfo = str_replace("%modified-author%", $modified_author, $postinfo);
        }
    }
    // Author about yourself
    if (strpos($postinfo_string, '%author-description%') !== FALSE) {
        ob_start();
        the_author_meta('description');
        $author_description = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-description%", $author_description, $postinfo);
    }
    // Author login name
    if (strpos($postinfo_string, '%author-login%') !== FALSE) {
        ob_start();
        the_author_meta('user_login');
        $author_login = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-login%", $author_login, $postinfo);
    }
    // Author first name
    if (strpos($postinfo_string, '%author-firstname%') !== FALSE) {
        ob_start();
        the_author_meta('first_name');
        $author_firstname = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-firstname%", $author_firstname, $postinfo);
    }
    // Author last name
    if (strpos($postinfo_string, '%author-lastname%') !== FALSE) {
        ob_start();
        the_author_meta('last_name');
        $author_lastname = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-lastname%", $author_lastname, $postinfo);
    }
    // Author nickname
    if (strpos($postinfo_string, '%author-nickname%') !== FALSE) {
        ob_start();
        the_author_meta('nickname');
        $author_nickname = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-nickname%", $author_nickname, $postinfo);
    }
    // Author ID
    if (strpos($postinfo_string, '%author-id%') !== FALSE) {
        ob_start();
        the_author_meta('ID');
        $author_ID = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-id%", $author_ID, $postinfo);
    }
    // Author email address, clear text in HTML source code
    if (strpos($postinfo_string, '%author-email-clear%') !== FALSE) {
        ob_start();
        the_author_meta('email');
        $author_email_clear = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-email-clear%", $author_email_clear, $postinfo);
    }
    // Author email address obfuscated
    if (strpos($postinfo_string, '%author-email%') !== FALSE) {
        $postinfo = str_replace("%author-email%", antispambot(get_the_author_email()), $postinfo);
    }
    // Author website URL
    if (strpos($postinfo_string, '%author-url%') !== FALSE) {
        ob_start();
        the_author_meta('url');
        $author_url = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-url%", $author_url, $postinfo);
    }
    // Author website link
    if (strpos($postinfo_string, '%author-link%') !== FALSE) {
        ob_start();
        the_author_link();
        $author_link = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-link%", $author_link, $postinfo);
    }
    // Author posts archive link
    if (strpos($postinfo_string, '%author-posts-link%') !== FALSE) {
        ob_start();
        the_author_posts_link();
        $author_posts_link = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-posts-link%", $author_posts_link, $postinfo);
    }
    //  LEGACY: %author-linked% replaced by %author-posts-link% in 3.3.2, but displays the same: Author posts archive link
    if (strpos($postinfo_string, '%author-linked%') !== FALSE) {
        ob_start();
        the_author_posts_link();
        $author_posts_link = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-linked%", $author_posts_link, $postinfo);
    }
    // Author post count
    if (strpos($postinfo_string, '%author-post-count%') !== FALSE) {
        ob_start();
        the_author_posts();
        $author_post_count = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-post-count%", $author_post_count, $postinfo);
    }
    // Author AOL Instant Messenger screenname
    if (strpos($postinfo_string, '%author-aim%') !== FALSE) {
        ob_start();
        the_author_meta('aim');
        $author_aim = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-aim%", $author_aim, $postinfo);
    }
    // Author Yahoo IM ID
    if (strpos($postinfo_string, '%author-yim%') !== FALSE) {
        ob_start();
        the_author_meta('yim');
        $author_yim = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-yim%", $author_yim, $postinfo);
    }
    // Date & Time
    if (strpos($postinfo_string, '%date(') !== FALSE) {
        $postinfo = preg_replace_callback("/%date\\((.*?)'(.*?)'(.*?)\\)%/is", "bfa_parse_date_callback", $postinfo);
    }
    // Date & Time, last modified
    if (strpos($postinfo_string, '%date-modified(') !== FALSE) {
        $postinfo = preg_replace_callback("/%date-modified\\((.*?)'(.*?)'(.*?)\\)%/is", "bfa_parse_date_modified_callback", $postinfo);
    }
    // Tags, linked - since WP 2.3
    if (strpos($postinfo_string, '%tags-linked') !== FALSE) {
        while (strpos($postinfo, '%tags-linked') !== FALSE) {
            $tag_link_options = preg_match("/(.*)%tags-linked\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $tag_link_matches);
            $tags_linked = get_the_tag_list($tag_link_matches[2], $tag_link_matches[4], $tag_link_matches[6]);
            $postinfo = preg_replace("/(.*)%tags-linked\\((.*?)\\)%(.*)/i", "\${1}" . $tags_linked . "\${3}", $postinfo);
        }
    }
    // Tags, linked. If post has no tags, categories are displayed instead -  since WP 2.3
    if (strpos($postinfo_string, '%tags-cats-linked') !== FALSE) {
        while (strpos($postinfo, '%tags-cats-linked') !== FALSE) {
            $tag_link_options = preg_match("/(.*)%tags-cats-linked\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $tag_link_matches);
            ob_start();
            the_tags($tag_link_matches[2], $tag_link_matches[4], $tag_link_matches[6]);
            $tags_cats_linked = ob_get_contents();
            ob_end_clean();
            $postinfo = preg_replace("/(.*)%tags-cats-linked\\((.*?)\\)%(.*)/i", "\${1}" . $tags_cats_linked . "\${3}", $postinfo);
        }
    }
    // Tags, not linked - since WP 2.3
    if (strpos($postinfo_string, '%tags(') !== FALSE) {
        while (strpos($postinfo, '%tags(') !== FALSE) {
            $tag_options = preg_match("/(.*)%tags\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $tag_matches);
            $posttags = get_the_tags();
            if ($posttags) {
                foreach ($posttags as $tag) {
                    $tag_list .= $tag->name . $tag_matches[4];
                }
                // remove last separator
                $tag_list = preg_replace("/" . $tag_matches[4] . "\$/mi", "", $tag_list);
                $tags = $tag_matches[2] . $tag_list . $tag_matches[6];
            } else {
                $tags = "";
            }
            $postinfo = preg_replace("/(.*)%tags\\((.*?)\\)%(.*)/i", "\${1}" . $tags . "\${3}", $postinfo);
        }
    }
    // 1st category
    if (strpos($postinfo_string, '%category%') !== FALSE) {
        $all_categories = get_the_category();
        $category = $all_categories[0]->cat_name;
        $category_notlinked = $category;
        $postinfo = str_replace("%category%", $category_notlinked, $postinfo);
    }
    // 1st category, linked
    if (strpos($postinfo_string, '%category-linked%') !== FALSE) {
        $all_categories = get_the_category();
        $category = $all_categories[0]->cat_name;
        $category_linked = '<a class="' . $category . '" href="' . get_category_link($all_categories[0]->cat_ID) . '">' . $category . '</a>';
        $postinfo = str_replace("%category-linked%", $category_linked, $postinfo);
    }
    // Categories, linked with class name added
    $categories_linked = '';
    if (strpos($postinfo_string, '%categories-linked') !== FALSE) {
        while (strpos($postinfo, '%categories-linked') !== FALSE) {
            $category_linked_separator = preg_match("/(.*)%categories-linked\\('(.*?)'\\)(.*)/i", $postinfo_string, $category_linked_matches);
            ob_start();
            $categories = get_the_category();
            $items_in_categories = count($categories);
            $output = '';
            $categories_count = $items_in_categories;
            if ($categories) {
                foreach ($categories as $category) {
                    $categories_count -= 1;
                    if ($categories_count) {
                        $seperator = $category_linked_matches[2];
                    } else {
                        $seperator = '';
                    }
                    $categories_linked .= '<a class="' . $category->slug . '" href="' . get_category_link($category->term_id) . '" title="' . esc_attr(sprintf(__("View all posts in %s"), $category->name)) . '">' . $category->cat_name . $seperator . '</a>';
                }
            }
            ob_end_clean();
            $postinfo = preg_replace("/(.*)%categories-linked\\((.*?)\\)%(.*)/i", "\${1}" . $categories_linked . "\${3}", $postinfo);
        }
    }
    // Categories, not linked
    if (strpos($postinfo_string, '%categories(') !== FALSE) {
        while (strpos($postinfo, '%categories(') !== FALSE) {
            $category_separator = preg_match("/(.*)%categories\\('(.*?)'\\)(.*)/i", $postinfo_string, $category_matches);
            $categories = "";
            foreach (get_the_category() as $category) {
                $categories .= $category->cat_name . $category_matches[2];
            }
            // remove last separator
            $categories = preg_replace("/" . $category_matches[2] . "\$/mi", "", $categories);
            $postinfo = preg_replace("/(.*)%categories\\((.*?)\\)%(.*)/i", "\${1}" . $categories . "\${3}", $postinfo);
        }
    }
    // Comment link
    if (strpos($postinfo_string, '%comments(') !== FALSE) {
        while (strpos($postinfo, '%comments(') !== FALSE) {
            $comment_options = preg_match("/(.*)%comments\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $comment_matches);
            if (!comments_open() and $comment_matches[8] == "dontshow") {
                $comment_link = '';
            } else {
                ob_start();
                comments_popup_link($comment_matches[2], $comment_matches[4], $comment_matches[6], 'comments-link', $comment_matches[8]);
                $comment_link = ob_get_contents();
                ob_end_clean();
            }
            if (!comments_open()) {
                if ($post->comment_count == 0) {
                    $comment_link = '<strong>' . $comment_matches[8] . '</strong>';
                } else {
                    $comment_link = $comment_link . ' - <strong>(' . $comment_matches[8] . ')</strong>';
                }
            }
            if (!comments_open() and $comment_matches[8] == "dontshow") {
                $comment_link = '';
            }
            $postinfo = preg_replace("/(.*)%comments\\((.*?)\\)%(.*)/i", "\${1}" . $comment_link . "\${3}", $postinfo);
        }
    }
    // Comments Feed link
    if (strpos($postinfo_string, '%comments-rss') !== FALSE) {
        while (strpos($postinfo, '%comments-rss') !== FALSE) {
            $comments_rss_link_text = preg_match("/(.*)%comments-rss\\('(.*?)'(.*)/i", $postinfo_string, $comments_rss_matches);
            ob_start();
            post_comments_feed_link($comments_rss_matches[2]);
            $comments_rss_link = ob_get_contents();
            ob_end_clean();
            // make link nofollow if set in theme options
            if ($bfa_ata['nofollow'] == "Yes") {
                $comments_rss_link = str_replace('href=', 'rel="nofollow" href=', $comments_rss_link);
            }
            $postinfo = preg_replace("/(.*)%comments-rss\\((.*?)\\)%(.*)/i", "\${1}" . $comments_rss_link . "\${3}", $postinfo);
        }
    }
    // Trackback URL
    if (strpos($postinfo_string, '%trackback%') !== FALSE) {
        $trackback_url = trackback_url(FALSE);
        $postinfo = str_replace("%trackback%", $trackback_url, $postinfo);
    }
    // Trackback Link
    if (strpos($postinfo_string, '%trackback-linked(') !== FALSE) {
        while (strpos($postinfo, '%trackback-linked(') !== FALSE) {
            $trackback_url = trackback_url(FALSE);
            $trackback_link_text = preg_match("/(.*)%trackback-linked\\('(.*?)'(.*)/i", $postinfo_string, $trackback_matches);
            $trackback_link = '<a href="' . $trackback_url . '">' . $trackback_matches[2] . '</a>';
            // make link nofollow if set in theme options
            if ($bfa_ata['nofollow'] == "Yes") {
                $trackback_link = str_replace('href=', 'rel="nofollow" href=', $trackback_link);
            }
            $postinfo = preg_replace("/(.*)%trackback-linked\\((.*?)\\)%(.*)/i", "\${1}" . $trackback_link . "\${3}", $postinfo);
        }
    }
    // Trackback RDF
    if (strpos($postinfo_string, '%trackback-rdf%') !== FALSE) {
        ob_start();
        trackback_rdf();
        $trackback_rdf = "<!-- " . ob_get_contents() . " -->";
        ob_end_clean();
        $postinfo = str_replace("%trackback-rdf%", $trackback_rdf, $postinfo);
    }
    // Permalink
    if (strpos($postinfo_string, '%permalink%') !== FALSE) {
        ob_start();
        the_permalink();
        $permalink = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%permalink%", $permalink, $postinfo);
    }
    // Post ID
    if (strpos($postinfo_string, '%post-id%') !== FALSE) {
        ob_start();
        the_ID();
        $post_id = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%post-id%", $post_id, $postinfo);
    }
    // Post Title
    if (strpos($postinfo_string, '%post-title%') !== FALSE) {
        ob_start();
        the_title();
        $post_title = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%post-title%", $post_title, $postinfo);
    }
    // Edit post
    if (strpos($postinfo_string, '%edit(') !== FALSE) {
        while (strpos($postinfo, '%edit(') !== FALSE) {
            $edit_options = preg_match("/(.*)%edit\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $edit_matches);
            ob_start();
            edit_post_link($edit_matches[4], $edit_matches[2], $edit_matches[6]);
            $edit_link = ob_get_contents();
            ob_end_clean();
            $postinfo = preg_replace("/(.*)%edit\\((.*?)\\)%(.*)/i", "\${1}" . $edit_link . "\${3}", $postinfo);
        }
    }
    // Print
    if (strpos($postinfo_string, '%print(') !== FALSE) {
        while (strpos($postinfo, '%print(') !== FALSE) {
            $print_text = preg_match("/(.*)%print\\('(.*?)'(.*)/i", $postinfo_string, $print_text_matches);
            $print_link = '<a href="javascript:window.print()">' . $print_text_matches[2] . '</a>';
            $postinfo = preg_replace("/(.*)%print\\((.*?)\\)%(.*)/i", "\${1}" . $print_link . "\${3}", $postinfo);
        }
    }
    // For the "WP-Email" plugin
    if (strpos($postinfo_string, '%wp-email%') !== FALSE) {
        $wp_email = function_exists('wp_email') ? email_link($email_post_text = '', $email_page_text = '', $echo = FALSE) : "";
        $postinfo = str_replace("%wp-email%", $wp_email, $postinfo);
    }
    // For the "WP-Print" plugin
    if (strpos($postinfo_string, '%wp-print%') !== FALSE) {
        $wp_print = function_exists('wp_print') ? print_link($print_post_text = '', $print_page_text = '', $echo = FALSE) : "";
        $postinfo = str_replace("%wp-print%", $wp_print, $postinfo);
    }
    // For the "WP-PostViews" plugin
    if (strpos($postinfo_string, '%wp-postviews%') !== FALSE) {
        $wp_postviews = function_exists('the_views') ? the_views($display = FALSE) : "";
        $postinfo = str_replace("%wp-postviews%", $wp_postviews, $postinfo);
    }
    // For the "WP-PostRatings" plugin
    if (strpos($postinfo_string, '%wp-postratings%') !== FALSE) {
        $wp_postratings = function_exists('the_ratings') ? the_ratings($start_tag = 'span', $custom_id = 0, $display = FALSE) : "";
        $postinfo = str_replace("%wp-postratings%", $wp_postratings, $postinfo);
    }
    // For the "Sociable" plugin
    if (strpos($postinfo_string, '%sociable%') !== FALSE) {
        ob_start();
        $sociable = (function_exists('sociable_html2') and function_exists(do_sociable())) ? do_sociable() : "";
        $sociable = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%sociable%", $sociable, $postinfo);
    }
    // For the "Share This" plugin
    if (strpos($postinfo_string, '%share-this%') !== FALSE) {
        ob_start();
        if (function_exists('sharethis_button')) {
            sharethis_button();
            $share_this = ob_get_contents();
        } else {
            $share_this = "";
        }
        ob_end_clean();
        $postinfo = str_replace("%share-this%", $share_this, $postinfo);
    }
    // Images
    if (strpos($postinfo_string, '<image(') !== FALSE) {
        $postinfo = preg_replace_callback("|<image\\((.*?)\\)>|", "bfa_image_files", $postinfo);
    }
    /* The meta = ALL custom fields:values, formatted by Wordpress as
    	unordered list <ul><li>..</li><li>..</li></ul> */
    if (strpos($postinfo_string, '%meta%') !== FALSE) {
        ob_start();
        the_meta();
        $the_meta = ob_get_contents();
        ob_end_clean();
        // 3.4.3.: remove bfa_ata metas */
        $the_meta = preg_replace("/<li>(.*)bfa_ata(.*)<\\/li>/i", "", $the_meta);
        $postinfo = str_replace("%meta%", $the_meta, $postinfo);
    }
    // Single post meta values, not formatted
    if (strpos($postinfo_string, '%meta(') !== FALSE) {
        $postinfo = preg_replace_callback("|%meta\\('(.*?)'\\)%|", "bfa_meta_value", $postinfo);
    }
    // Since 3.6.7, parse widget areas
    $postinfo = bfa_parse_widget_areas($postinfo);
    return $postinfo;
}
						
						<?php 
        if (comments_open() && pings_open()) {
            // Both Comments and Pings are open
            ?>
							You can <a href="#respond">leave a response</a>, or <a href="<?php 
            trackback_url(true);
            ?>
" rel="trackback">trackback</a> from your own site.
						
						<?php 
        } elseif (!comments_open() && pings_open()) {
            // Only Pings are Open
            ?>
							Responses are currently closed, but you can <a href="<?php 
            trackback_url(true);
            ?>
 " rel="trackback">trackback</a> from your own site.
						
						<?php 
        } elseif (comments_open() && !pings_open()) {
            // Comments are open, Pings are not
            ?>
							You can skip to the end and leave a response. Pinging is currently not allowed.
			
						<?php 
        } elseif (!comments_open() && !pings_open()) {
            // Neither Comments, nor Pings are open
            ?>
							Both comments and pings are currently closed.			
						
<?php 
if (comments_open() && pings_open()) {
    ?>
	<p><a href="<?php 
    trackback_url(display);
    ?>
">Trackback this post</a> &nbsp;|&nbsp; <?php 
    comments_rss_link('Subscribe to the comments via RSS Feed');
    ?>
</p>
<?php 
} elseif (comments_open()) {
    ?>
	<p><?php 
    comments_rss_link('Subscribe to the comments via RSS Feed');
    ?>
</p>
<?php 
} elseif (pings_open()) {
    ?>
	<p><a href="<?php 
    trackback_url(display);
    ?>
">Trackback this post</a></p>
<?php 
}
?>

</div> <!-- /comments -->
Beispiel #29
0
        ?>
 feed.

						<?php 
        if ('open' == $post->comment_status && 'open' == $post->ping_status) {
            ?>
							You can <a href="#respond">leave a response</a>, or <a href="<?php 
            trackback_url();
            ?>
" rel="trackback">trackback</a> from your own site.

						<?php 
        } elseif (!('open' == $post->comment_status) && 'open' == $post->ping_status) {
            ?>
							Responses are currently closed, but you can <a href="<?php 
            trackback_url();
            ?>
 " rel="trackback">trackback</a> from your own site.

						<?php 
        } elseif ('open' == $post->comment_status && !('open' == $post->ping_status)) {
            ?>
							You can skip to the end and leave a response. Pinging is currently not allowed.

						<?php 
        } elseif (!('open' == $post->comment_status) && !('open' == $post->ping_status)) {
            ?>
							Both comments and pings are currently closed.

						<?php 
        }
Beispiel #30
0
function thematic_postfooter_postconnect()
{
    $postconnect = __('. Bookmark the ', 'thematic') . '<a href="' . get_permalink() . '" title="' . __('Permalink to ', 'thematic') . the_title_attribute('echo=0') . '">';
    $postconnect .= __('permalink', 'thematic') . '</a>.';
    if (comments_open() && pings_open()) {
        /* Comments are open */
        $postconnect .= ' <a class="comment-link" href="#respond" title ="' . __('Post a comment', 'thematic') . '">' . __('Post a comment', 'thematic') . '</a>';
        $postconnect .= __(' or leave a trackback: ', 'thematic');
        $postconnect .= '<a class="trackback-link" href="' . trackback_url(FALSE) . '" title ="' . __('Trackback URL for your post', 'thematic') . '" rel="trackback">' . __('Trackback URL', 'thematic') . '</a>.';
    } elseif (!comments_open() && pings_open()) {
        /* Only trackbacks are open */
        $postconnect .= __(' Comments are closed, but you can leave a trackback: ', 'thematic');
        $postconnect .= '<a class="trackback-link" href="' . trackback_url(FALSE) . '" title ="' . __('Trackback URL for your post', 'thematic') . '" rel="trackback">' . __('Trackback URL', 'thematic') . '</a>.';
    } elseif (comments_open() && !pings_open()) {
        /* Only comments open */
        $postconnect .= __(' Trackbacks are closed, but you can ', 'thematic');
        $postconnect .= '<a class="comment-link" href="#respond" title ="' . __('Post a comment', 'thematic') . '">' . __('post a comment', 'thematic') . '</a>.';
    } elseif (!comments_open() && !pings_open()) {
        /* Comments and trackbacks closed */
        $postconnect .= __(' Both comments and trackbacks are currently closed.', 'thematic');
    }
    // Display edit link on single posts
    if (current_user_can('edit_posts')) {
        $postconnect .= ' ' . thematic_postfooter_posteditlink();
    }
    return apply_filters('thematic_postfooter_postconnect', $postconnect);
}