WordPress Plugin :: WP-PostViews Plus @ English

479 + 233 人次 26 篇回應 民國九十六年十一月十六日 星期五

Function Reference

  • the_views('Views', true)
    The views of post.
    1st value: the world after views number.
    2nd value: is output(true for output, false for return number)
  • the_user_views(' User Views', true)
    The views of post by user.
    1st value: the world after views number.
    2nd value: is output(true for output, false for return number)
  • the_bot_views(' Bot Views', true)
    The views of post by bot.
    1st value: the world after views number.
    2nd value: is output(true for output, false for return number)
  • get_most_viewed('', 10, 0 , true , true)
    The most views posts. return the string of list start by <li> and end by </li>.
    1st value: type of post('post' for post, 'page' for page, '' for both)
    2nd value: the number of post you what to get
    3th value: the words of title(0 for no limit)
    4th value: is output(true for output, false for return string)
    5th value: is include bot views(true for include, false for uninclude)
  • get_most_viewed_category(1, '', 10, 0, true, true)
    The most views posts in catrgory. return the string of list start by <li> and end by </li>. (After Version 1.1.0)
    1st value: the category ID(It can be a single ID or an array of ID) (set 'auto', it use the category of the post (After Version 1.1.5) )
    2nd value: type of post('post' for post, 'page' for page, '' for both)
    3nd value: the number of post you what to get
    4th value: the words of title(0 for no limit)
    5th value: is output(true for output, false for return string)
    6th value: is include bot views(true for include, false for uninclude)
  • get_timespan_most_viewed('', 10, 7, true, true, 0)
    The most views posts of posted in recent several days. return the string of list start by <li> and end by </li>.
    1st value: type of post('post' for post, 'page' for page, '' for both)
    2nd value: the number of post you what to get
    3th value: the days for seach
    4th value: is output(true for output, false for return string)
    5th value: is include bot views(true for include, false for uninclude)
    6th value: the words of title(0 for no limit)
  • get_timespan_most_viewed_cat(1, '', 10, 7, true, true, 0)
    The most views posts in catrgory of posted in recent several days. return the string of list start by <li> and end by </li>. (After Version 1.1.0)
    1st value: the category ID(It can be a single ID or an array of ID) (set 'auto', it use the category of the post (After Version 1.1.5) )
    2nd value: type of post('post' for post, 'page' for page, '' for both)
    3th value: the number of post you what to get
    4th value: the days for seach
    5th value: is output(true for output, false for return string)
    6th value: is include bot views(true for include, false for uninclude)
    7th value: the words of title(0 for no limit)
  • get_totalviews(true, true, true)
    Total views number
    1st value: is output(true for output, false for return string)
    2nd value: is include bot views(true for include, false for uninclude)
    3th value: is include the post views of not by "post" or "page"(true for include, false for uninclude)

分頁: 1 2

本站文章如無特別註明,皆採用 CC授權 條款,文章歡迎 引用、網摘,但不接受全文轉載
  1. Rómulo 說道:

    Hi:
    I'm not sure if this is the way to send you a question because I don't speak chinese. I use your plugin without problems but now when I migrate to other server, the function

    have a error:

    PHP Fatal error: Call to undefined function mb_internal_encoding() in C:\webspace\hostings\Postoffices\mastersdesigners.com\hosting\www\wp-content\plugins\postviews_plus\postviews_plus.php on line 332

    I only change the hosting, nothing else..... this is, for now, the only function make error.

    Would you be good enough to help me?

    Sorry my grammar
    Regards from Lima, Perú

  2. richer 說道:

    To Rómulo
    The error is because your server(php) not support "Multibyte String Functions".
    I will update my plugin to support the server without that function.

  3. Rómulo 說道:

    Thanks my friend, it's works fine...... I really apreciate your time and dedication.

    Sorry my grammar.
    Regards from Lima, Perú

  4. Rómulo 說道:

    Sorry for send you another possible problem. Now I don't see the error I tell you before, but now the list is showing with 0 views value, but all the post have more than 150 views. You can see it in http://mastersdesigners.com/?page_id=17 or http://mastersdesigners.com/ in the tab "Los más leídos".

    In the setup or your plugin I check this options:
    Add Views number if User is logoin.
    Add Views number if User is logoin.
    Add Views number if User is logoin.

    I don't change anything else. By example the post "Beneficios y Obligaciones de los Miembros" have 265 views. Do I do something wrong perhaps? I just start wp and theme from zero, I don't import any data.

    Sorry for the inconvenience.
    Sorry my poor grammar.
    Regards from Lima, Perú

  5. Rómulo 說道:

    By the way, I use this function of your plugin:

  6. Rómulo 說道:

    get_most_viewed('post', 10, 0, true, true)

  7. Rómulo 說道:

    forget it my friend...... I solve it with a simple clear local cache..... sorry.... thanks for all

    Regards from Lima, Perú

  8. richer 說道:

    To Rómulo
    It's OK! You can use this plugin will is the bset thing.
    Sorry my grammar.

  9. Dayakar 說道:

    Thanks for the plugin. I am using the function "the_views(' views', true)", the views output is displayed with an increment of 3. Could you please let me know how to set the increment to 1.

    • Dayakar 說道:

      I have made a simple modification in the plugin to get correct value, the variable $post_user_views/$post_views is divided by 3.

  10. Garçon 說道:

    Thanks a lot for your plugin.
    I have a question regarding a strange behavior that started a few ays ago. The number of views counted is somehow multiplied by 4 or 5 now... is there any reason you can think about that could cause that ?

  11. jar.io 說道:

    but need put a screenshot.
    thanks.

  12. BadBoy 說道:

    hello there im a little lost here i just need to upload to plugins and thats it i dont see the theme instructions need a hand here hehe

    i have installed and activaded but nothing new were can i find the instructions

    thanks

  13. BadBoy 說道:

    this is were i want it to display the post views

    http://i26.tinypic.com/30swwox.jpg

  14. BadBoy 說道:

    thanks i dont know alot of this can you tell me exactly what file of the theme were can i find it and were inside that file i need to put this code

  15. BadBoy 說道:

    thanks i went to sigle.php and inserted and played untill i got what i wanted xD

    i30.tinypic.com/4h484j.jpg

    this time the pic isint a url hehe

    now i need to show the same thing on the categories

  16. BadBoy 說道:

    thanks for the great mod and sorry for the bumps i got it to work in the main page as well the modification i needed was in index.php so vies can be seen in home page and inside post in single.php

    great job with this mod

  17. Mans 說道:

    I upgraded your plugin... it wont show view number what happen..?

  18. jeff 說道:

    1.1.20 is adding the javascript inside the body tag...

    I had to revert to 1.1.19 to fix.

  19. jeff 說道:

    It breaks our theme layout. The class names for the body tag are not working with the new javascript there.

    ie. gets broken.

    We're using the "sandbox" theme.

  20. jeff 說道:

    ie. body class='somename' gets broken

  21. Dayakar 說道:

    The latest version 1.1.20 is adding the following text before header
    in individual post page and page. Also, it breaks theme layout.

    Individual post page:
    "/* */ wordpress k2 y2009 m10 d12 h12 single postid-13
    s-slug-introduction-to-metapost s-y2009 s-m10 s-d08 s-h13
    s-category-tug-2009 s-tag-metapost s-tag-tex s-author-admin
    columns-two lang-en wpmu-1">"

    Page:
    "/* */ wordpress k2 y2009 m10 d12 h12 page pageid-2 page-author-admin
    page-slug-about columns-two lang-en wpmu-1">"

    Any help in resolving this issue is very much appreciated.

    WordPress version: 2.8.4
    Theme: k2

    Thank you,
    Dayakar

  22. Procter 說道:

    Tried to activate the plugin, but no tables a created. Any help appreciated. Thank you

    PHP Warning: array_merge(): Argument #2 is not an array in /srv/www/vhosts/..../postviews_plus.php on line 652

    WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= "1.1.20")' at line 9 for query CREATE TABLE IF NOT EXISTS wp_postviewsplus (\n\t\t\t`count_type` VARCHAR(10) NOT NULL,\n\t\t\t`count_id` VARCHAR(10) NOT NULL,\n\t\t\t`tv` VARCHAR(255) NOT NULL DEFAULT "",\n\t\t\t`gt` VARCHAR(255) NOT NULL DEFAULT "",\n\t\t\t`look_ip` TEXT NOT NULL DEFAULT "",\n\t\t\t`look_ip_time` INT UNSIGNED NOT NULL DEFAULT "0",\n\t\t\tPRIMARY KEY (`count_type`, `count_id`),\n\t\t\tCOMMENT = "1.1.20") made by activate_plugin, do_action, call_user_func_array, postviews_plus_add

留下您的回應