WP-PostRatings 只显示评分结果方法

Kevin 杂记 886 次浏览 88条评论

WP-PostRatings 插件使用<?php if(function_exists('the_ratings')) { the_ratings(); } ?>代码添加评分功能,但这是一个完整模块。如果希望只希望显示评分结果,限制点击评分操作,可以使用<?php echo the_ratings_results( get_the_ID() ); ?>获取,多余文本在插件模板选项里删除。

另一个方法是直接从数据库获取评分数据输出,方便修改结构样式。在functions.php主题文件里添加下面代码。

function showRatings($id, $css_class = 'show-ratings') {
 global $wpdb;
 $path = plugins_url('wp-postratings/images/'.get_option('postratings_image'));
 $rating = $wpdb->get_var("SELECT AVG(rating_rating) AS rating FROM $wpdb->ratings WHERE rating_postid = $id");
 $i = 0;
 $html = '<div class="'.$css_class.'">';
 if (!empty($rating)) {
 while ($i < floor($rating)) {
 $html .= '<img src="'.$path.'/rating_on.gif" alt="" />';
 $i++;
 }
 if (round($rating, 1) == ($i+0.5)) {
 $html .= '<img src="'.$path.'/rating_half.gif" alt="" />';
 $i++;
 }
 }
 while ($i < 5) {
 $html .= '<img src="'.$path.'/rating_off.gif" alt="" />';
 $i++;
 }
 $html .= '</div>';
 return $html; 
}

然后使用<?php echo showRatings( get_the_ID() ); ?>代码调用。

评论列表

  1. #1

    hydroxychloroquine sulfate tabs https://hydroxychloroquine.webbfenix.com/

  2. #2

    dose for acyclovir herpes simplex https://www.herpessymptomsinmen.org/productacyclovir/

  3. #3

    ivermectin dosage humans https://ivermectin.webbfenix.com/

  4. #4

    starting dose of naltrexone https://naltrexoneonline.confrancisyalgomas.com/

  5. #5

    hydroxychloroquine clinical trial results https://hydroxychloroquine.mlsmalta.com/

  6. #6

    ivermectin dosing for scabies https://ivermectin.mlsmalta.com/

  7. #7

    keflex sinus infection dosage https://keflex.webbfenix.com/

  8. #8

    vidalista 5mg cost https://vidalista.mlsmalta.com/

  9. #9

    buy zentiva hydroxychloroquine https://hhydroxychloroquine.com/

  10. #10

    tadalafil dapoxetine reviews https://dapoxetine.confrancisyalgomas.com/

  11. #11

    50mg viagra pills http://droga5.net/

  12. #12

    erectile disorder 38 cfr
    buy erection pills
    erectile enhancement pills
    top erectile urologists in san francisco

  13. #13

    vidalista without doctor prescription reviews https://vidalista40mg.mlsmalta.com/

  14. #14

    nolvadex 10mg https://tamoxifen.mrdgeography.com/

  15. #15

    free cialis trial coupon https://wisig.org/

  16. #16

    amstyles.com https://amstyles.com/

  17. #17

    dapoxetine without a doctor prescription not scam https://ddapoxetine.com/

  18. #18

    chloroquine 250 mg tablets https://hydroxychloroquine.grassfed.us/

  19. #19

    chloroquine 250 mg tablets https://hydroxychloroquine.mymvrc.org/

  20. #20

    quineprox 200 mg https://hydroxychloroquinee.com/

  21. #21

    walgreens male enhancement products https://tadalafileo.online/

  22. #22

    walgreens male enhancement products https://tadalafil365.online/

  23. #23

    does erectile dysfunction ever reverse
    erectile dysfunction drugs
    are erectile dysfunction pills dangerous

  24. #24

    erectile aid device
    ed meds
    when does erectile dysfunction happen
    erectile deformity

  25. #25

    vidalista dosage recommendations http://viidalista.co/

  26. #26

    buy erectile dysfunction meds
    erectile injection video

  27. #27

    You have remarked very interesting details! ps nice site. https://local-auto-locksmith.co.uk/kia/

  28. #28

    Świetny post. Bardzo ciekawie opisany artykuł. Jak możesz sprawdź stronę o samochodach u mnie! Do zobaczenia! https://samocholand.pl/

  29. #29

    taking cefixime without ed https://ceefexime.co/

  30. #30

    the best canadian online pharmacies https://edmeds.buszcentrum.com/

  31. #31

    the best canadian online pharmacies https://medpills.bee-rich.com/

  32. #32

    Thanks for your whole work on this website. My niece takes pleasure in working on research and it is simple to grasp why. We all notice all relating to the powerful ways you render vital tips and tricks via your website and therefore welcome response from website visitors on this topic while our own simple princess is without question understanding so much. Take pleasure in the rest of the year. Your performing a very good job. https://lvagroupinc.com/

  33. #33

    Thanks for your own work on this website. My mother take interest in setting aside time for research and it is simple to grasp why. My spouse and i notice all relating to the powerful way you provide very helpful tips via your website and in addition recommend response from visitors on this subject matter while our own simple princess is undoubtedly studying so much. Take pleasure in the rest of the year. You have been performing a tremendous job. https://bupronbupropion.com/

  34. #34

    A lot of thanks for all your valuable efforts on this site. Kate loves getting into investigation and it’s really easy to understand why. I know all concerning the dynamic medium you give informative solutions on this web blog and as well as foster participation from others on that content plus our daughter is always discovering a lot. Have fun with the remaining portion of the new year. You are conducting a great job. https://venlorz.com/#

  35. #35

    My spouse and i got quite glad that Ervin could deal with his investigations through the ideas he got out of the web page. It’s not at all simplistic to just continually be giving out methods that many other people have been selling. And we also fully understand we have got the website owner to be grateful to for that. The entire explanations you have made, the simple site menu, the friendships you can help foster – it’s got many great, and it’s really helping our son and the family imagine that the issue is entertaining, and that is pretty indispensable. Thank you for everything! https://tofranilimipramine.com/#

  36. #36

    My spouse and i got quite glad that John could deal with his preliminary research through the ideas he grabbed out of your web page. It’s not at all simplistic to just continually be giving out methods that many others have been selling. And we also fully understand we have got the website owner to be grateful to for that. The main explanations you have made, the simple site menu, the friendships you can help foster – it’s got many great, and it’s really helping our son and the family imagine that the matter is excellent, and that is pretty indispensable. Thank you for everything! https://tofranilimipramine.com/#

  37. #37

    buy cialis without seeing doctor http://ciialis.co/

  38. #38

    generic cialis 20 mg price https://cialis.buszcentrum.com/

  39. #39

    generic cialis 20 mg price https://cialis.bee-rich.com/

  40. #40

    generic cialis 60 mg india https://cialis.studiowestinc.com/

  41. #41

    generic cialis 60 mg india https://cialis.adicbc.com/

  42. #42

    Touche. Sound arguments. Keep up the amazing work.

    Feel free to surf to my blog post; bbq chicken grill aluminum foil

  43. #43

    Hello! I realize this is somewhat off-topic however I had to ask.
    Does managing a well-established blog like yours require a large amount of work?
    I’m brand new to operating a blog however
    I do write in my diary on a daily basis. I’d like to start a blog so I will be able to share my
    own experience and feelings online. Please let me know if you have any kind of suggestions or tips for new aspiring
    blog owners. Thankyou!

    My website – grilled chicken steak ala pobre

  44. #44

    Thanks designed for sharing such a pleasant idea, piece of writing is fastidious, thats why i have read it
    completely

    Here is my webpage: pubg jeu

  45. #45

    These are genuinely great ideas in concerning
    blogging. You have touched some good things here.
    Any way keep up wrinting.

    Check out my homepage; pubg telecharger gratuit

  46. #46

    Hey there just wanted to give you a brief heads up and let you know a few of the
    images aren’t loading correctly. I’m not sure why but I think its a linking issue.
    I’ve tried it in two different web browsers and both show the same outcome.

    Feel free to surf to my webpage; pubg corporation; Arlette,

  47. #47

    It’s an remarkable article in favor of all the online visitors; they will take advantage from it I am sure.

    My webpage :: room addition drawings (Gordon)

  48. #48

    I need to to thank you for this very good read!!

    I absolutely loved every little bit of it. I have you book marked to look at
    new stuff you post…

    Here is my blog post: gta 5 apk com

  49. #49

    Yes! Finally someone writes about grilling.

    My homepage :: grilling crab legs

  50. #50

    My partner and I stumbled over here different website
    and thought I may as well check things out. I like what I see so now i’m following you.
    Look forward to checking out your web page again. http://antiibioticsland.com/Zithromax.htm

  51. #51

    The other day, while I was at work, my sister stole my
    iPad and tested to see if it can survive a 30 foot drop, just so she can be a youtube sensation. My apple ipad is now destroyed and she has 83 views.
    I know this is totally off topic but I had to share it with someone!

    Visit my web page pubg india download link

  52. #52

    An intriguing discussion is worth comment. I think that you should
    publish more about this subject matter, it might not be a taboo matter but typically
    folks don’t discuss these topics. To the next!
    All the best!!

    Here is my page – technology analyst accenture (https://techmeozia.over-blog.com/2021/03/how-technology-and-changing-business-models.html)

  53. #53

    Normally I don’t learn article on blogs, however
    I wish to say that this write-up very compelled me to try and do so!
    Your writing style has been amazed me. Thank you, very nice article.

    My site … 명품 쇼핑몰

  54. #54

    I’m impressed, I have to admit. Seldom do I come across a blog that’s
    both equally educative and interesting, and let me tell you,
    you have hit the nail on the head. The issue is something that not enough people are
    speaking intelligently about. Now i’m very happy I came across this during my search for something relating to this.

    my web blog – Maude Lindenberg

  55. #55

    It’s truly very complex in this full of activity life to listen news on Television, so I only use web
    for that purpose, and get the latest information.

    Feel free to surf to my web-site :: NY accident
    attorney; http://digital-marketing-consult33344.blogproducer.com,

  56. #56

    I think this is among the most significant information for me.
    And i am glad reading your article. But wanna remark on few
    general things, The site style is ideal, the articles is really excellent :
    D. Good job, cheers

    Also visit my blog post: NY business lawyer

  57. #57

    It’s an amazing paragraph in support of all the internet
    visitors; they will obtain benefit from it I am sure.

    Also visit my blog post … Bong Ney

  58. #58

    It’s going to be ending of mine day, however before end I
    am reading this fantastic paragraph to increase my experience.

    Also visit my website – 구글상위노출

  59. #59

    Howdy, i read your blog occasionally and i own a similar one and i was just curious if you get a lot of spam responses?
    If so how do you protect against it, any plugin or anything you can advise?
    I get so much lately it’s driving me crazy so any help is very much appreciated.

    Have a look at my blog post Jaquelyn Gartrell (Zandra)

  60. #60

    I like the helpful info you provide in your articles. I’ll
    bookmark your weblog and check again here frequently.
    I’m quite sure I will learn a lot of new stuff right here!
    Good luck for the next!

    Feel free to surf to my website – Homepage

  61. #61

    Very soon this web page will be famous amid all blogging and site-building people, due to it’s fastidious content

    Review my website … grill igniter (Roma)

  62. #62

    I don’t even know how I ended up here, but I thought this
    post was great. I don’t know who you are but certainly you’re going
    to a famous blogger if you are not already 😉 Cheers!

    Feel free to visit my web blog ATM machine

  63. #63

    I am really inspired with your writing abilities and also with the structure in your
    blog. Is that this a paid subject matter or
    did you customize it your self? Anyway keep up the nice high quality writing, it’s uncommon to see a nice
    weblog like this one these days..

    Take a look at my page: Lavonia Burrough

  64. #64

    Useful information. Lucky me I discovered your website
    accidentally, and I’m stunned why this twist of fate didn’t
    came about earlier! I bookmarked it.

    Here is my web-site … Guantes meca 3

  65. #65

    Hi there, I discovered your blog by means of Google at the same
    time as searching for a related matter, your website came up, it looks good.
    I’ve bookmarked it in my google bookmarks.
    Hello there, just became aware of your blog thru Google, and found
    that it’s really informative. I’m going to watch out for brussels.
    I will be grateful when you proceed this in future.

    Lots of people might be benefited out of your writing.
    Cheers!

    Review my web site :: barbecue (Pasquale)

  66. #66

    Good post! We will be linking to this great article on our
    site. Keep up the good writing.

    Here is my web-site :: Jutta Racey

  67. #67

    I will right away clutch your rss as I can not in finding your email
    subscription link or e-newsletter service. Do
    you’ve any? Kindly allow me know so that I could subscribe.
    Thanks.

    Here is my page … Edmonton ceramic car coating

  68. #68

    This is very interesting, You are a very skilled blogger.
    I have joined your feed and look forward to seeking
    more of your wonderful post. Also, I have shared your web site in my social networks!

    My web-site – Tomoko Novak

  69. #69

    Pretty! This has been an extremely wonderful article. Thanks for supplying this info.

    Feel free to surf to my page … Insurance fayetteville ar

  70. #70

    I every time used to study post in news papers but now as I am a user of internet so from
    now I am using net for articles or reviews, thanks to web.

    My web-site: green roof trays

  71. #71

    Excellent weblog here! Also your website
    a lot up very fast! What web host are you the use of? Can I get
    your associate link on your host? I wish
    my website loaded up as quickly as yours lol

    Also visit my blog Lula Bostick

  72. #72

    My family all the time say that I am wasting my time here at net,
    however I know I am getting know-how every day
    by reading such nice articles or reviews.

    Also visit my blog Mental Toughness Coach (https://learningstylegrid.com)

  73. #73

    What’s up to all, the contents present at this web site
    are in fact awesome for people experience, well, keep up the good work fellows.

    Have a look at my blog post; Investing and Planning for retirement by diversifying your portfolio

  74. #74

    Hello would you mind letting me know which web host you’re using?
    I’ve loaded your blog in 3 completely different browsers and I must say this blog loads a lot quicker then most.
    Can you suggest a good internet hosting provider at a fair price?
    Many thanks, I appreciate it!

    Here is my web site – We buy junk cars near me

  75. #75

    What’s up, I desire to subscribe for this website to get newest updates, so where can i do it
    please assist.

    Here is my web blog LifePo4 golf cart batteries pack supplier –
    Ruth,

  76. #76

    Greetings! Very helpful advice in this particular post!
    It’s the little changes which will make the most significant
    changes. Many thanks for sharing!

    my blog post … interior design (https://stackoverflow.com/users/15607222/dorstendoors8?tab=profile)

  77. #77

    Thanks very interesting blog!

    My blog post: Cansoft (Marvin)

  78. #78

    Hello, i think that i saw you visited my website thus i came to “return the favor”.I am trying to find things to improve my
    site!I suppose its ok to use some of your ideas!!

    My page Promotional Products Las Vegas

  79. #79

    Hey there! I simply wish to offer you a huge thumbs
    up for the excellent information you’ve got here on this post.

    I’ll be coming back to your site for more soon.

    My web page – Entrepreneur apparel

  80. #80

    Today, while I was at work, my sister stole my apple ipad
    and tested to see if it can survive a twenty five foot drop,
    just so she can be a youtube sensation. My apple ipad is now broken and she has 83 views.
    I know this is totally off topic but I had to share it with
    someone!

    My page … Standup Bot for Slack (johnathanzqed305.mystrikingly.com)

  81. #81

    I’ll right away snatch your rss as I can not find your e-mail subscription link or e-newsletter service.
    Do you have any? Please let me recognize in order that I may subscribe.
    Thanks.

    My page … 24/7 payday loans Pretoria

  82. #82

    It’s an amazing piece of writing in support of all the internet viewers; they will obtain benefit from it I
    am sure.

    Feel free to surf to my site: wedding cards (Dolly)

  83. #83

    Having read this I thought it was very enlightening. I appreciate you spending some time
    and energy to put this article together. I once again find myself spending
    way too much time both reading and posting comments. But so what, it was still worthwhile! https://cialis.lm360.us/tadalafil

  84. #84

    Hi there! I know this is kinda off topic but I was wondering which blog platform are you using for this site?
    I’m getting sick and tired of WordPress because I’ve had issues with
    hackers and I’m looking at options for another platform.

    I would be fantastic if you could point me in the direction of a good platform.

    Have a look at my web-site – it takes two steam key (Alina)

  85. #85

    I’m amazed, I have to admit. Rarely do I encounter a blog that’s both equally educative and interesting,
    and without a doubt, you’ve hit the nail on the head.
    The problem is an issue that too few men and women are speaking intelligently
    about. I am very happy I stumbled across this
    during my search for something regarding this.

    Feel free to visit my blog post; n95 face mask for sale (Ron)

  86. #86

    Great web site you have got here.. It’s hard to find
    high-quality writing like yours nowadays. I seriously appreciate people like you!

    Take care!!

    Review my blog … woocommerce dropshipping

  87. #87

    Whats up are using WordPress for your blog platform? I’m new to the
    blog world but I’m trying to get started and set up my own. Do you need any
    coding expertise to make your own blog? Any help would be really appreciated!

    my web-site soap dispenser holder wall mounted (Jordan)

  88. #88

    Hi everyone, it’s my first visit at this website,
    and article is actually fruitful in favor of me, keep up posting such articles.

    Stop by my page: nylon tricot panties

发表评论

电邮地址用于 Gravatar 头像显示,不会被公开可见。