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

PHP the_ratings函数代码示例

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

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



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

示例1: ratings_shortcode

function ratings_shortcode($atts)
{
    $attributes = shortcode_atts(array('id' => 0, 'results' => false), $atts);
    if (!is_feed()) {
        $id = intval($attributes['id']);
        if ($attributes['results']) {
            return the_ratings_results($id);
        } else {
            return the_ratings('span', $id, false);
        }
    } else {
        return __('Note: There is a rating embedded within this post, please visit this post to rate it.', 'wp-postratings');
    }
}
开发者ID:AAbouZaid,项目名称:wp-postratings,代码行数:14,代码来源:postratings-shortcodes.php


示例2: get_the_post_thumbnail

            if (!empty($attachment_id)) {
                $img = get_the_post_thumbnail(get_the_ID(), array($width, $height));
            } else {
                $img = '<img src="' . get_stylesheet_directory_uri() . '/images/default.jpg" alt="' . get_the_title() . '" title="' . get_the_title() . '">';
            }
            // create json map
            $address = get_field('address');
            $dataLatLng = geocode($address);
            //			if(wpmd_is_notdevice()){
            //				$des = '<p class="address">'.the_excerpt_max_charlength(25).'</p>';
            //			}else{
            //				$des = '';
            //			}
            $url = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            $total_comment = getFacebookDetails($url);
            $jsonData[] = array('title' => get_the_title(), 'lng' => $dataLatLng[0], 'lat' => $dataLatLng[1], 'address' => '', 'vote' => '<p><span>Bình chọn:</span>' . the_ratings() . '</p>', 'comment' => '<p class="review">Bình luận: <span>' . $total_comment . '</span></p>', 'img' => $img, 'baseurl' => get_the_permalink());
            ?>
        
		<?php 
        }
        ?>
			</ul>
			<?php 
        $defaultLng = 10.7596132;
        $defaultLat = 106.6644058;
        if ($jsonData) {
            foreach ($jsonData as $val) {
                if (!empty($val['lng']) || !empty($val['lat'])) {
                    $defaultLng = $val['lng'];
                    $defaultLat = $val['lat'];
                    break;
开发者ID:vanlong200880,项目名称:tmdt,代码行数:31,代码来源:search_post.php


示例3: the_ratings

         $returnval .= the_ratings("div", $newPostID);
         $out1 = ob_get_contents();
         ob_end_clean();
         if (!strpos($out1, "onmouseout") > 0) {
             $out1 = "already rated";
         }
         $out1 = str_replace("(No Ratings Yet)", "", $out1);
         # only scanning person should be allowed to rate here!
         if ($show_public_profile != 1) {
             $article_created = $txt_subscr_pleaserate . ": <br><nobr>{$out1}</nobr>";
         }
     }
     if ($usbid != "" && $scantype != "mainboard") {
         $newPostID = lhg_create_usb_article($title, $sid, $usbid);
         ob_start();
         $returnval .= the_ratings("div", $newPostID);
         $out1 = ob_get_contents();
         ob_end_clean();
         if (!strpos($out1, "onmouseout") > 0) {
             $out1 = "already rated";
         }
         $out1 = str_replace("(No Ratings Yet)", "", $out1);
         # only scanning person should be allowed to rate here!
         if ($show_public_profile != 1) {
             $article_created = $txt_subscr_pleaserate . ": <br><nobr>{$out1}</nobr>";
         }
     }
 }
 // end of autocreate skipping in debug mode
 $css_id = "col-hw";
 if ($show_public_profile == 1) {
开发者ID:cptpike,项目名称:linuxhardwareguide,代码行数:31,代码来源:scan.php


示例4: mystique_post


//.........这里部分代码省略.........

     <div class="post-info clear-block <?php 
        if ($post_thumb) {
            echo 'with-thumbs';
        }
        ?>
">
      <p class="author alignleft"><?php 
        printf(__('Posted by %1$s in %2$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>', $category_link);
        ?>
      <?php 
        if (function_exists('the_views')) {
            ?>
<span class="postviews">| <?php 
            the_views();
            ?>
</span><?php 
        }
        ?>
      <?php 
        edit_post_link(__('Edit', 'mystique'), ' | ');
        ?>
      </p>
      <?php 
        if (comments_open() || $comment_count > 0) {
            ?>
      <p class="comments alignright"><a href="<?php 
            the_permalink();
            ?>
#comments" class="<?php 
            if ($comment_count < 1) {
                echo "no";
            }
            ?>
 comments"><?php 
            comments_number(__('No comments', 'mystique'), __('1 comment', 'mystique'), __('% comments', 'mystique'));
            ?>
</a></p>
      <?php 
        }
        ?>
     </div>
    <?php 
    }
    ?>

   <?php 
    if ($post_settings['post_content']) {
        ?>
     <div class="post-content clear-block">
      <?php 
        if ($post_settings['post_content_length'] == 'f') {
            the_content(__('More &gt;', 'mystique'));
        } elseif ($post_settings['post_content_length'] == 'e') {
            the_excerpt();
        } else {
            $word_count = $post_settings['post_content_length'];
            // save original post content to variable
            $content = get_the_content();
            // prevent tags strip | it's a bug in WordPress!
            $content = apply_filters('the_content', $content);
            $content = str_replace(']]>', ']]&gt;', $content);
            // throw out trimmed: content to process, read more tag, post permalink, words length
            echo mystique_trim_the_content($content, __('More &gt;', 'mystique'), get_permalink($post->ID), $word_count);
        }
        ?>
     </div>
   <?php 
    }
    ?>
   <?php 
    if (function_exists('the_ratings')) {
        the_ratings();
    }
    ?>

   <?php 
    if ($post_tags && $post_settings['post_tags']) {
        ?>
    <div class="post-tags">
    <?php 
        $tags = array();
        $i = 0;
        foreach ($post_tags as $tag) {
            $tags[$i] .= '<a href="' . get_tag_link($tag->term_id) . '" rel="tag" title="' . sprintf(__('%1$s (%2$s topics)'), $tag->name, $tag->count) . '">' . $tag->name . '</a>';
            $i++;
        }
        echo implode(', ', $tags);
        ?>
    </div>
    <?php 
    }
    ?>


  </div>
  <!-- /post -->
 <?php 
    do_action('mystique_after_post');
}
开发者ID:nottombrown,项目名称:vlab,代码行数:101,代码来源:core.php


示例5: cp_bookmark_article_button

				<h2 class="section-header">Save &amp; Share</h2>
				<div class="social-share">
					<ul>
						<?php cp_bookmark_article_button($post->ID); ?>
						<?php cp_printpage_button($post->ID); ?>
						<?php cp_ttpdf_button($post->ID); ?>
						<?php echo cp_emailarticle_button(); ?>
						<li><a class="tooltip" title="Share on Facebook" href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>" target="_blank"><i class="fa fa-facebook"></i></a></li>
						<li><a class="tooltip" title="Share on Twitter" href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>&amp;text=<?php the_title(); ?>" target="_blank"><i class="fa fa-twitter"></i></a></li>
					</ul>
				</div>

				<?php cp_emailarticle_form($post->ID); ?>

				<h2 class="section-header">Rate this article</h2>
				<?php if(function_exists('the_ratings')) { the_ratings(); } ?>

				<?php if ($term_list = wp_get_post_tags($post->ID, array("fields" => "all"))): ?>
				<h2 class="section-header">Article tags</h2>
					<div class="article-tags">
					<?php foreach($term_list as $term): ?>
						<a target="blank" href="<?php echo get_atoz_letter_link($term->slug); ?>"><?php echo ucfirst($term->name); ?></a>
					<?php endforeach; ?>
					</div>
				<?php endif; ?>
				<?php endif; // end is_page() ?>
			<?php

				$related_advice = get_field('related_care_advice');
				if( $related_advice ){
开发者ID:acutedeveloper,项目名称:carepoint-development,代码行数:30,代码来源:single.php


示例6: add_ratings_to_content

function add_ratings_to_content($content)
{
    if (!is_feed()) {
        $content .= the_ratings('div', 0, false);
    }
    return $content;
}
开发者ID:PatelUtkarsh,项目名称:wp-postratings,代码行数:7,代码来源:wp-postratings.php


示例7: comment_form

/**
 * Outputs a complete commenting form for use within a template.
 * Most strings and form fields may be controlled through the $args array passed
 * into the function, while you may also choose to use the comment_form_default_fields
 * filter to modify the array of default fields if you'd just like to add a new
 * one or remove a single field. All fields are also individually passed through
 * a filter of the form comment_form_field_$name where $name is the key used
 * in the array of fields.
 *
 * @since 3.0.0
 * @param array $args Options for strings, fields etc in the form
 * @param mixed $post_id Post ID to generate the form for, uses the current post if null
 * @return void
 */
function comment_form($args = array(), $post_id = null)
{
    global $id;
    global $txt_privacy_stat;
    global $txt_compat_rat;
    global $txt_use_tags;
    global $txt_logged_in_as;
    global $txt_logout;
    global $txt_send_comment;
    global $txt_cancel_reply;
    global $txt_reply_to;
    global $txt_comments;
    global $txt_comment;
    global $txt_to_comment;
    global $txt_website;
    global $txt_att_filetypes;
    global $txt_att_maxsize;
    global $txt_att_attachment;
    if (null === $post_id) {
        $post_id = $id;
    } else {
        $id = $post_id;
    }
    $commenter = wp_get_current_commenter();
    $user = wp_get_current_user();
    $user_identity = !empty($user->ID) ? $user->display_name : '';
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $fields = array('author' => '<p class="comment-form-author">' . '<label for="author">' . __('Name') . '</label> ' . ($req ? '<span class="required">*</span>' : '') . '<input id="author" name="author" type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' /></p>', 'email' => '<p class="comment-form-email"><label for="email">' . __('Email') . '</label> ' . ($req ? '<span class="required">*</span>' : '') . '<input id="email" name="email" type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' /></p>', 'url' => '<!-- p class="comment-form-url"><label for="url">' . __($txt_website) . '</label>' . '<input id="url" name="url" type="text" value="" size="30" /></p -->');
    // original version
    //	'url'    => '<p class="comment-form-url"><label for="url">' . __( $txt_website ) . '</label>' .
    //	            '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p >',
    $required_text = sprintf(' ' . __('Required fields are marked %s'), '<span class="required">*</span>');
    //rating image
    ob_start();
    //if(function_exists('the_ratings'))
    //{
    $returnval .= the_ratings();
    //}
    $out1 = ob_get_contents();
    ob_end_clean();
    if ($out1 == "") {
        $out1 = "Error: No rating found";
    }
    $lhg_rating_line = "";
    if (is_single()) {
        $lhg_rating_line = '
        <div style="border: 0px solid #000;">
          <div style="width: 145px; float: left; margin-right: 5px; font:normal 11px Arial, Helvetica, sans-serif;">' . $txt_compat_rat . '
          </div>

          <div style="border: 1px solid #d0d0d0; float: left; background-color: #f6f6f6; padding: 5px;">' . $out1 . '
          </div>
        </div>
        <br />
        <br />
        ';
    }
    // original line
    //'comment_field'        => '<div style="border: 0px solid #000;"><div style="width: 145px; float: left; margin-right: 5px; font:normal 11px Arial, Helvetica, sans-serif;">'.$txt_compat_rat.'</div><div style="border: 1px solid #d0d0d0; float: left; background-color: #f6f6f6; padding: 5px;">'.$out1.'</div></div> <br><br><p class="comment-form-comment"><label for="comment">' . _x( $txt_to_comment, 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
    $tmp1 = $lhg_rating_line . '<p class="comment-form-comment"><label for="comment">' . _x($txt_to_comment, 'noun') . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>';
    $defaults = array('fields' => apply_filters('comment_form_default_fields', $fields), 'comment_field' => sprintf($tmp1), 'must_log_in' => '<p class="must-log-in">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.'), wp_login_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</p>', 'logged_in_as' => '<p class="logged-in-as">' . sprintf(__($txt_logged_in_as . ' <a href="%1$s">%2$s</a>. <a href="%3$s" title="Abmelden">' . $txt_logout . '?</a>'), admin_url('profile.php'), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</p>', 'comment_notes_before' => '<p class="comment-notes">' . __($txt_privacy_stat) . ($req ? $required_text : '') . '</p>', 'comment_notes_after' => '<p class="form-allowed-tags">' . sprintf(__($txt_use_tags . ': %s'), ' <code>' . allowed_tags() . '</code>') . '</p>', 'id_form' => 'commentform', 'id_submit' => 'submit', 'title_reply' => __("{$txt_comment} "), 'title_reply_to' => __($txt_reply_to . ' %s'), 'cancel_reply_link' => __($txt_cancel_reply), 'label_submit' => __($txt_send_comment));
    // 'comment_field'        => $lhg_rating_line . '<p class="comment-form-comment"><label for="comment">' . _x( $txt_to_comment, 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
    $args = wp_parse_args($args, apply_filters('comment_form_defaults', $defaults));
    ?>
		<?php 
    if (comments_open()) {
        ?>
			<?php 
        do_action('comment_form_before');
        ?>
			<div id="respond">
				<?php 
        comment_form_title($args['title_reply'], $args['title_reply_to']);
        ?>
 <small><?php 
        cancel_comment_reply_link($args['cancel_reply_link']);
        ?>
</small>
				<?php 
        if (get_option('comment_registration') && !is_user_logged_in()) {
            ?>
					<?php 
            echo $args['must_log_in'];
            ?>
					<?php 
//.........这里部分代码省略.........
开发者ID:cptpike,项目名称:linuxhardwareguide,代码行数:101,代码来源:comment-template.php


示例8: the_ratings

                echo $sortarray[$i][$j]->post_title;
                ?>
</a>
								</h3>
								<?php 
                if (empty($content)) {
                    echo '<p>この画像には説明がありません。</p>';
                } else {
                    echo "<p>{$content}</p>";
                }
                // 未完成だった時は表示しない
                if ($Unfin_key === FALSE) {
                    ?>
								<span class="view_star">
									<?php 
                    the_ratings('div', $sortarray[$i][$j]->ID, true);
                    ?>
								</span>
								<?php 
                }
                ?>
							</div>
						</div>
                    <?php 
            }
            // endif
        }
        // endfor j
    }
    //	endfor i
    ?>
开发者ID:nashinomi,项目名称:kukuru,代码行数:31,代码来源:single-illust.php


示例9: getSingleAmazonProduct


//.........这里部分代码省略.........
            $attr = array('alt' => trim(strip_tags(translate_title(get_the_title($PID)))), 'title' => trim(strip_tags(translate_title(get_the_title($PID)))));
            $amazon_image = get_the_post_thumbnail($artid, array(130, 130), $attr);
            if (strpos($amazon_image, 'src=""')) {
                $amazon_image = '<img src="/wp-uploads/2013/03/noimage130.jpg" alt="' . $txt_cpl_noimage . '" title="' . $txt_cpl_noimage . '">';
            }
            if ($amazon_image == "") {
                $amazon_image = '<img src="/wp-uploads/2013/03/noimage130.jpg" alt="' . $txt_cpl_noimage . '" title="' . $txt_cpl_noimage . '">';
            }
            $returnval .= '					' . $amazon_image . '' . "\n";
            //$returnval .= '					'. awsImageGrabber($result['MediumImage'],'amazon-image') . ''."\n";
            //if($result['LargeImage']!=''){
            //$returnval .= '				<a target="amazon-image" href="javascript: void(0)" onclick="artwindow=window.open(\'' .$result['LargeImage'] .'\',\'art\',\'directories=no, location=no, menubar=no, resizable=no, scrollbars=no, status=no, toolbar=no, width=400,height=525\');artwindow.focus();return false;"><span class="amazon-tiny">'.$appip_text_lgimage.'</span></a>'."\n";
            //$returnval .= '					<a rel="appiplightbox" href="'.$result['LargeImage'] .'"><span class="amazon-tiny">'.$appip_text_lgimage.'</span></a>'."\n";
            //$returnval .= '					<span class="amazon-tiny">'.$appip_text_lgimage.'</span>'."\n";
            //}
            $returnval .= '				</div>' . "\n";
            $returnval .= '
<div class="amazon-buying">' . "\n";
            //$returnval .= '					<h2 class="amazon-asin-title"><a href="' . $result["URL"] . '" '. $apippnewwindowhtml .'><span class="asin-title">'.$result["Title"].'</span></a></h2>'."\n";
            //$returnval .= '					<h2 class="amazon-asin-title"><a href="' . $result["URL"] . '" '. $apippnewwindowhtml .'><span class="asin-title">'.$result["Title"].'</span></a></h2>'."\n";
            #if(isset($result["Author"])){
            #$returnval .= '					<span class="amazon-author">'.$appip_text_author.' '.$result["Author"].'</span><br />'."\n";
            #}
            #if(isset($result["Director"])){
            #$returnval .= '					<span class="amazon-director-label">'.$appip_text_director.': </span><span class="amazon-director">'.$result["Director"].'</span><br />'."\n";
            #}
            #if(isset($result["Actors"])){
            #$returnval .= '					<span class="amazon-starring-label">'.$appip_text_starring.': </span><span class="amazon-starring">'.$result["Actors"].'</span><br />'."\n";
            #}
            //if(isset($result["Rating"])){
            //$returnval .= '					<span class="amazon-rating-label">Rating: </span><span class="amazon-rating">'.$result["Rating"].'</span><br />'."\n";
            //}
            ob_start();
            if (function_exists('the_ratings')) {
                $returnval .= the_ratings();
            }
            $out1 = ob_get_contents();
            ob_end_clean();
            //get the correct! rating
            $post_id = $post->ID;
            global $wpdb;
            global $lhg_price_db;
            if ($lang != "de") {
                $ratings = $lhg_price_db->get_results("SELECT * FROM  `lhgtransverse_posts` WHERE postid_com = {$post_id}");
            }
            if ($lang == "de") {
                $ratings = $lhg_price_db->get_results("SELECT * FROM  `lhgtransverse_posts` WHERE postid_de = {$post_id}");
            }
            #$get_rates = $wpdb->get_results("SELECT rating_rating FROM $wpdb->ratings WHERE rating_postid = $post_id");
            $rating_total = 0;
            $rating_total = $ratings[0]->post_ratings_users_com + $ratings[0]->post_ratings_users_de;
            $rating = $ratings[0]->post_ratings_score_com + $ratings[0]->post_ratings_score_de;
            #foreach($get_rates as $get_rate){
            #        $rating += $get_rate->rating_rating;
            #        //print_r($get_rate);
            #        $rating_total++;
            #}
            //$returnval .= '<div class="hreview-aggregate">';
            //$returnval .= '<span class="item">';
            //$returnval .= '<span class="fn"><span class="value-title" title="'.get_the_title().'"/></span>';
            //$returnval .= '<span class="photo"><span class="value-title" title="'.wp_get_attachment_url( get_post_thumbnail_id($post->ID) ).'"/></span>';
            //$returnval .= '</span>';
            //$returnval .= '<span class="rating"><span class="value-title" title="'.($rating/$rating_total).'"/></span>';
            //$returnval .= '<span class="reviewer"><span class="value-title" title="linux-hardware-guide.de"/></span>';
            //$returnval .= '<span class="dtreviewed"><span class="value-title" title="'.get_the_date().'"/></span>';
            //$returnval .= '<span class="votes"><span class="value-title" title="'.$rating_total.'"/></span>';
开发者ID:cptpike,项目名称:linuxhardwareguide,代码行数:67,代码来源:lhg-product-post.php


示例10: comicpress_display_post

    function comicpress_display_post()
    {
        global $post, $wp_query;
        $is_comic = 0;
        if (comicpress_in_comic_category()) {
            $is_comic = 1;
        }
        ?>
		<?php 
        comicpress_display_blog_navigation($is_comic);
        ?>
		<?php 
        comicpress_display_comic_navigation($is_comic);
        ?>
		<div <?php 
        post_class();
        ?>
>
			<?php 
        comicpress_display_post_thumbnail($is_comic);
        ?>
			<?php 
        if (comicpress_themeinfo('enable_caps')) {
            ?>
<div class="post-head"></div><?php 
        }
        ?>
			<div class="post-content">
				<div class="post-info">
					<?php 
        comicpress_display_author_gravatar($is_comic);
        ?>
					<?php 
        comicpress_display_post_calendar($is_comic);
        ?>
					<?php 
        if (function_exists('comicpress_show_mood_in_post')) {
            comicpress_show_mood_in_post();
        }
        ?>
					<div class="post-text">
						<?php 
        comicpress_display_post_title($is_comic);
        if (!is_page()) {
            comicpress_display_post_author();
            comicpress_display_post_date();
            comicpress_display_post_time();
            if (!is_archive() && !is_search()) {
                edit_post_link(__('Edit', 'comicpress'), ' <span class="pipe">|</span> <span class="post-edit">', '</span>');
            }
            comicpress_display_post_category($is_comic);
            if (function_exists('the_ratings') && $post->post_type == 'post') {
                the_ratings();
            }
        }
        ?>
					</div>
				</div>
				<div class="clear"></div>
				<div class="entry">
					<?php 
        comicpress_display_the_content($is_comic);
        ?>
					<div class="clear"></div>
				</div>
				<div class="clear"></div>
				<?php 
        if (!is_page()) {
            ?>
				<div class="post-extras">
					<?php 
            comicpress_display_post_tags();
            ?>
					<?php 
            comicpress_display_comment_link();
            ?>
					<?php 
            if ($is_comic) {
                if (function_exists('comicpress_related_comics_shortcode') && comicpress_themeinfo('enable_related_comics')) {
                    echo comicpress_related_comics_shortcode();
                }
            } else {
                if (function_exists('comicpress_related_posts_shortcode') && comicpress_themeinfo('enable_related_posts')) {
                    echo comicpress_related_posts_shortcode();
                }
            }
            ?>
					<div class="clear"></div>
				</div>
				<?php 
        }
        ?>
				<?php 
        if (is_page()) {
            edit_post_link(__('Edit this page.', 'comicpress'), '', '');
        }
        ?>
			</div>
			<?php 
        if (comicpress_themeinfo('enable_caps')) {
//.........这里部分代码省略.........
开发者ID:besimhu,项目名称:legacy,代码行数:101,代码来源:displaypost.php


示例11: get_popular_posts


//.........这里部分代码省略.........
                     }
                 }
             }
             // STATS
             // comments
             if ($instance['stats_tag']['comment_count']) {
                 $comments_text = sprintf(_n('1 new comment', '%s new comments', $comments, 'wordpress-popular-posts'), number_format_i18n($comments));
                 $stats .= "<span class=\"wpp-comments\">" . $comments_text . "</span>";
             } else {
             }
             // views
             if ($instance['stats_tag']['views']) {
                 if ($instance['order_by'] == 'avg') {
                     $views_text = sprintf(_n('1 view per day', '%s views per day', intval($pageviews), 'wordpress-popular-posts'), number_format_i18n($pageviews, 2));
                 } else {
                     $views_text = sprintf(_n('1 view', '%s views', intval($pageviews), 'wordpress-popular-posts'), number_format_i18n($pageviews));
                 }
                 $stats .= $stats == "" ? "<span class=\"wpp-views\">" . $views_text . "</span>" : " | <span class=\"wpp-views\">" . $views_text . "</span>";
             }
             //author
             if ($instance['stats_tag']['author']) {
                 $display_name = "<a href=\"" . get_author_posts_url($p->uid) . "\">{$author}</a>";
                 $stats .= $stats == "" ? "<span class=\"wpp-author\">" . __('by', 'wordpress-popular-posts') . " {$display_name}</span>" : " | <span class=\"wpp-author\">" . __('by', 'wordpress-popular-posts') . " {$display_name}</span>";
             }
             // date
             if ($instance['stats_tag']['date']['active']) {
                 $stats .= $stats == "" ? "<span class=\"wpp-date\">" . __('posted on', 'wordpress-popular-posts') . " {$date}</span>" : " | <span class=\"wpp-date\">" . __('posted on', 'wordpress-popular-posts') . " {$date}</span>";
             }
             // category
             if ($instance['stats_tag']['category']) {
                 $post_cat = get_the_category($p->id);
                 $post_cat = isset($post_cat[0]) ? '<a href="' . get_category_link($post_cat[0]->term_id) . '">' . $post_cat[0]->cat_name . '</a>' : '';
                 if ($post_cat != '') {
                     $stats .= $stats == "" ? "<span class=\"wpp-category\">" . __('under', 'wordpress-popular-posts') . " {$post_cat}</span>" : " | <span class=\"wpp-category\">" . __('under', 'wordpress-popular-posts') . " {$post_cat}</span>";
                 }
             }
             // RATING
             if ($instance['rating'] && $this->postRating && function_exists('the_ratings')) {
                 $rating = '<span class="wpp-rating">' . the_ratings('span', $p->id, false) . '</span>';
             }
             // POST THUMBNAIL
             //if ($instance['thumbnail']['active'] && $this->thumb) {
             if (1 == 1) {
                 $tbWidth = 40;
                 //$instance['thumbnail']['width'];
                 $tbHeight = 40;
                 //$instance['thumbnail']['height'];
                 //$thumb = "<a href=\"". $permalink ."\" title=\"{$title}\" target=\"".$this->user_ops['tools']['link']['target']."\">";
                 $thumb = "";
                 /*
                 if ( $this->user_ops['tools']['thumbnail']['source'] == "custom_field" ) { // get image from custom field
                 
                 							$path = get_post_meta($p->id, $this->user_ops['tools']['thumbnail']['field'], true);
                 
                 							if ( $path != "" ) {
                 								
                 								if ( $this->user_ops['tools']['thumbnail']['resize'] ) {
                 									
                 									$thumb .= $this->get_img( $p->id, array($tbWidth, $tbHeight), $this->user_ops['tools']['thumbnail']['source'] );
                 																		
                 								} else {
                 									$thumb .= "<img src=\"{$path}\" width=\"{$tbWidth}\" height=\"{$tbHeight}\" alt=\"{$title}\" border=\"0\" class=\"wpp-thumbnail wpp_cf\" />";
                 								}
                 								
                 							} else {
                 								$thumb .= "<img src=\"". $this->default_thumbnail ."\" alt=\"{$title}\" border=\"0\" width=\"{$tbWidth}\" height=\"{$tbHeight}\" class=\"wpp-thumbnail wpp_cf_def\" />";
                 							}
                 
                 						} else { // get image from post / Featured Image
                 							$thumb .= $this->get_img( $p->id, array($tbWidth, $tbHeight), $this->user_ops['tools']['thumbnail']['source'] );
                 						}
                 */
                 $thumb .= get_the_post_thumbnail($p->id, array(40, 40), array('class' => 'wp-cpl-sc-thumb', 'alt' => translate_title(get_the_title($p->id)), 'title' => translate_title(get_the_title($p->id))));
                 //$thumb .= "</a>";
             }
             $data = array('id' => $p->id, 'title' => '<a href="' . $permalink . '" title="' . $title . '">' . $title_sub . '</a>', 'summary' => $excerpt, 'stats' => $stats, 'img' => $thumb, 'url' => $permalink, 'text_title' => $title, 'category' => $post_cat, 'author' => "<a href=\"" . get_author_posts_url($p->uid) . "\">{$author}</a>", 'views' => $pageviews, 'comments' => $comments);
             $posts_data[] = (object) $data;
             // PUTTING IT ALL TOGETHER
             if ($instance['markup']['custom_html']) {
                 // build custom layout
                 $content .= htmlspecialchars_decode($this->format_content($instance['markup']['post-html'], $data, $instance['rating']), ENT_QUOTES) . "\n";
             } else {
                 // build regular layout
                 $content .= "<li><a href=\"" . $permalink . "\" title=\"{$title}\">" . '<div class="popular-post">' . "\n                                                {$thumb}<span class=\"post-stats\">{$stats}</span><br><b>{$title_sub}</b>{$excerpt}</div></a>\n                                                </li>" . "\n";
                 /* $content .= "<li><a href=\"". $permalink ."\" title=\"{$title}\">".'<div class="popular-post">'."
                    {$thumb}<a href=\"{$permalink}\" title=\"{$title}\" class=\"wpp-post-title\" target=\"".$this->user_ops['tools']['link']['target']."\">{$title_sub}</a> {$excerpt}<span class=\"post-stats\">{$stats}</span>{$rating}</div></a></li>" . "\n";
                    */
             }
         }
         // END HTML wrapper
         if ($instance['markup']['custom_html']) {
             $content .= htmlspecialchars_decode($instance['markup']['wpp-end'], ENT_QUOTES) . "\n";
         } else {
             $content .= "\n" . "</ul>" . "\n";
         }
     }
     //return $content;
     return apply_filters('wpp_html', $content2 . $content, $posts_data);
     die;
 }
开发者ID:cptpike,项目名称:linuxhardwareguide,代码行数:101,代码来源:wordpress-popular-posts.php


示例12: gallery_single_post

function gallery_single_post()
{
    global $post;
    if (function_exists('file_get_contents')) {
        $shortenedurl = file_get_contents('http://tinyurl.com/api-create.php?url=' . urlencode(get_permalink()));
    } else {
        $shortenedurl = urlencode(get_permalink());
    }
    ?>
			<div id="post-<?php 
    the_ID();
    ?>
" class="<?php 
    thematic_post_class();
    if (function_exists('p75GetVideo')) {
        if (p75GetVideo($post->ID)) {
            echo " video";
            $video = 1;
        }
    }
    ?>
">
			  <div class="entry-content">
			    <?php 
    if (function_exists('the_ratings')) {
        echo the_ratings();
    }
    ?>
			    <h1><?php 
    the_title();
    ?>
</h1>
				<?php 
    the_content('' . __('Read More <span class="meta-nav">&raquo;</span>', 'thematic') . '');
    ?>
				<ul class="meta">
				  <?php 
    if (get_post_meta($post->ID, 'designed-by')) {
        ?>
<li class="designer">Designed by: <?php 
        echo get_post_meta($post->ID, 'designed-by', $single = true);
        ?>
</li><?php 
    }
    ?>
				  <?php 
    if (get_post_meta($post->ID, 'web-url')) {
        ?>
					  <li class="site-link"><a rel="source" href="<?php 
        echo get_post_meta($post->ID, 'web-url', $single = true);
        ?>
"><?php 
        echo get_post_meta($post->ID, 'web-url', $single = true);
        ?>
</a></li>
					  <li class="delicious"><a href="http://del.icio.us/post?url=<?php 
        echo get_post_meta($post->ID, 'web-url', $single = true);
        ?>
&amp;<?php 
        the_title();
        ?>
">Bookmark This (<?php 
        echo get_post_meta($post->ID, 'web-url', $single = true);
        ?>
)</a></li>
					  <li class="twitter"><a href="http://www.twitter.com/home?status=<?php 
        echo str_replace(' ', '+', the_title_attribute('echo=0'));
        echo '+' . $shortenedurl;
        echo "+(via+@mixcss)";
        ?>
" title="Share <?php 
        the_title_attribute();
        ?>
 on Twitter">Tweet This</a></li>
				  <?php 
    }
    ?>
				</ul>
			    <div id="nav-below" class="navigation">
			      <div class="nav-previous"><?php 
    previous_post_link('%link', '<span class="meta-nav">&laquo;</span> %title');
    ?>
</div>
				  <div class="nav-next"><?php 
    next_post_link('%link', '%title <span class="meta-nav">&raquo;</span>');
    ?>
</div>
			    </div>
			  </div>
			</div><!-- .post -->

			<div class="artwork-container">
			  <div class="entry-artwork">
          <?php 
    if ($video == 1) {
        echo p75GetVideo($post->ID);
    } else {
        ?>
							<?php 
        if (get_post_meta($post->ID, 'web-url')) {
//.........这里部分代码省略.........
开发者ID:Aliciakwan,项目名称:OneCollection,代码行数:101,代码来源:functions.php


示例13: comicpress_display_post

function comicpress_display_post()
{
    global $post, $wp_query;
    $is_comic = 0;
    if (in_comic_category()) {
        $is_comic = 1;
    }
    ?>
	<?php 
    comicpress_display_blog_navigation($is_comic);
    ?>
	<?php 
    comicpress_display_comic_navigation($is_comic);
    ?>
	<div <?php 
    post_class();
    ?>
>
		<?php 
    comicpress_display_post_thumbnail($is_comic);
    ?>
		<div class="post-head"></div>
			<div class="post-content">
				<div class="post-info">
					<?php 
    comicpress_display_author_gravatar($is_comic);
    ?>
					<?php 
    comicpress_display_post_calendar($is_comic);
    ?>
					<?php 
    if (function_exists('comicpress_show_mood_in_post')) {
        comicpress_show_mood_in_post();
    }
    ?>
					<div class="post-text">
						<?php 
    comicpress_display_post_title($is_comic);
    if (!is_page()) {
        comicpress_display_post_author($is_comic);
        comicpress_display_post_category($is_comic);
        if (function_exists('the_ratings')) {
            the_ratings();
        }
        if (!is_archive() && !is_search()) {
            ?>
								<small><?php 
            edit_post_link(__('Edit Post', 'comicpress'), ' [ ', ' ] ');
            ?>
</small>
							<?php 
        }
    }
    ?>
					</div>
				</div>
				<div class="clear"></div>
				<div class="entry">
					<?php 
    comicpress_display_the_content($is_comic);
    ?>
					<br class="clear-margins" />
				</div>
				<?php 
    wp_link_pages(array('before' => '<div class="linkpages"><span class="linkpages-pagetext">' . __('Pages:', 'comicpress') . '</span> ', 'after' => '</div>', 'next_or_number' => 'number'));
    ?>
				<div class="post-extras">
					<?php 
    comicpress_display_post_tags();
    ?>
					<?php 
    comicpress_display_comment_link();
    ?>
					<div class="clear"></div>
					<?php 
    comicpress_display_related_posts($is_comic);
    ?>
					<?php 
    if (is_page()) {
        edit_post_link(__('Edit this page.', 'comicpress'), '<p>', '</p>');
    }
    ?>
				</div>
			</div>
		<div class="post-foot"></div>
	</div>
	<?php 
}
开发者ID:johnbintz,项目名称:comicpress-2.8,代码行数:88,代码来源:displaypost.php


示例14: _get_rating

 /**
  * Gets post's rating.
  *
  * @since	3.0.0
  * @param	object	p
  * @param	array	instance	The current instance of the widget / shortcode parameters
  * @return	string
  */
 protected function _get_rating($p, $instance)
 {
     $cache =& $this->__cache(__FUNCTION__, array());
     if (isset($cache[$p->id])) {
         return $cache[$p->id];
     }
     $rating = '';
     // RATING
     if (function_exists('the_ratings') && $instance['rating']) {
         $rating = '<span class="wpp-rating">' . the_ratings('span', $p->id, false) . '</span>';
     }
     return $cache[$p->id] = $rating;
 }
开发者ID:JosephinesGhost,项目名称:wordpress-popular-posts,代码行数:21,代码来源:wordpress-popular-posts.php


示例15: bfa_postinfo


//.........这里部分代码省略.........
        $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);
        } 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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