in Razno, WordPress Plugins

Vote For Post Plugin v 1.0 – WordPress Plugin [en]

Vote For Post Plugin is my new WordPress plugin, for voting your posts. Your visitors can vote for your post, from 1 to 5. You can set description for grades, from poor to superb, in WordPress options.

One visitor can vote only one time, for one post in your blog. This plugin is very easy for use.

Installation

  1. Copy VoteForPost.php to Plugin folder in WordPress
  2. Activate this plugin in WordPress Plugins
  3. Add this code
    1. <?php VotePlugin($p);  ?><pre> in index.php file in you Theme files, after post text</li>
    2.         <li>Add this code <pre lang="php"><? if (!isset($_SESSION[‘glasao’])) {
    3.   session_register("glasao");
    4.   $GLOBALS[‘glasao’][0] = -1;
    5. }?>

    in index.php before any code.

  4. In WordPress admin, in Options, you can see new tab “Vote For Post Plugin”, there you can set grade descriptions
  5. Plugin is installed and ready for using

When you are log-in as admin you can inly see Results if there is votes, and only visitors can vote.

Now u can add this code in style.css file, to make your vote table good looking.

  1.  
  2. .glasanje {
  3.         font-family: Verdana, Arial, Helvetica, sans-serif;
  4.         font-size: 9px;
  5.         font-weight: normal;
  6.         background-color: #C4D7FF;
  7. }
  8. .naslov_glasanja {
  9.  
  10.         font-family: Verdana, Arial, Helvetica, sans-serif;
  11.         font-size: 12px;
  12.         font-weight: bold;
  13.         color: #000000;
  14. }
  15.  

.naslov_glasanja is for Table headline, background of “Vote for this plugin”, and .glasanje is for background of radiobuttons. You can change this CSS in your way.

For next version, i am planing, to you can set headline title and submut button value your own.

Give me some comments, new ideas and critics please, and if u see some bug inform me! Afcourse download this plugin and try it in your own blog!

Latest changes and new versions:

Version 1.1 is hire. There is a bug with table_prefiks, and everyone who don’t have prefiks ‘wp_’ this plugin make problems. Now this is solved, and u can test new fresh plugin version!

Write a Comment

Comment

26 Comments

  1. Hello,
    This looks like a wonderful plugin, thank you for sharing it..just what I am looking for.
    I am having some problems getting the voting section to show up in the blog. I am not sure exactly where in the index file should go.
    Thanks so much 🙂

  2. [code]
    < ? VotePlugin($p); ?>
    [/code]

    Where u put this code depends of your theme. First find index.php in you theme folder.

    try to find:
    [code]
    < ?php if ( pings_open() ) : ?>
    ” rel=”trackback”>< ?php _e('TrackBack'); ?>
    < ?php endif; ?>
    [/code]

    after this add finction:
    [code]
    < ? VotePlugin($p); ?>
    [/code]
    Vote section is visible only when u open whole post. It is before Comment form, and after post text.

  3. This error appears instead of the voting panel :

    Warning: array_search(): Wrong datatype for second argument in /var/www/html/flash/wp-content/plugins/VoteForPost.php on line 117

    I had to change all wp_ to flash_ since i use a different prefix for wordpress, could that have anything to do with this? How can this problem be solved? Thank you. 🙂

  4. Add this code

    < ? if (!isset($_SESSION['glasao'])) { session_start(); session_register("glasao"); $GLOBALS['glasao'][0] = -1; }?>

    in index.php in Theme folder, before any code, on the top.

    It is very good u changed wp_ to flash_ , this is my mistake, and i change it very soon in new version.

  5. Version 1.1 is hire. There is a bug with table_prefiks, and everyone who don’t have prefiks ‘wp_’ this plugin make problems. Now this is solved, and u can test new fresh plugin version!

  6. SORRY ABOUT THAT POST , Ok could you please list the steps 1-3 as am unable to see the directions to have this plugin working…thanks

  7. for sim:
    1. copy VoteForPost.php in folder plugins
    your_blog/wp_content/plugins
    2.In WordPress Admin panel finf tab Plugins, click on it, and in list find VOteForPost plugin, and click on the Activate button.
    3. try to find < ?php endwhile; ?> and put code

    < ?php $p = _GET['p']; VotePlugin($p); ?>

    BEFORE
    < ?php endwhile; ?>

    Try to do this, and then call me back !

  8. No, unfortunately there is not function for best or most voted post.

    When i find time, i wrote a function in a new plugin version.

  9. I get nothing from this plugin. I did everything you said. And nothing is happening. Downloaded code, installed code to /plugins/ folder, activated plugin, inserted ” before ” , and inserted CSS code. Nothing happens

  10. Hi,

    I cant get this to work, I put the session code on top of everything and the other code beside the “comments” option. Nothing shows up. Why?

    Would you please email me?

    Thanks,

    – Mattias

  11. Hello,

    thanks for sharing the pluggin! Unfortunately it doesn`t run. I have no knowledge in PHP. I tried the things you said here…no fortune.

    Maybe we can get in contact per Mail?

    Thanks!

    Peedaa

  12. Sorry, doesn`t run is no good description of my Problem. In the admin section everything seems to be O.K.. But the Voting-Tool doesn`t appear at my website.

    😉

  13. Thank you for this plugin. I’ve added it to wordpressr.com. It’s an meta search for WordPress themes, plugins, and tutorials using Google’s custom search API.

  14. This doesn’t appear to work on wordpress 2.1, any thoughts?

    I added this…

    At the top of my index.php

    I added this…

    After the “the_content” line in my index.php

    Then added this…
    /* VoteForPost */

    .glasanje {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 9px;
    font-weight: normal;
    background-color: #C4D7FF;
    }
    .naslov_glasanja {

    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #000000;
    }

    To the end of my style.css

    Still didn’t work, now what?

  15. This plugin is not tested with WP 2.1 Ella, I will test it soon as possible . If its not compatible new version will be updated, but i can’t promise when …

  16. I am just having a heck of a time, been on this for over a week now. if anyone out there can help me, geesh , I’ll pay them to install this post voting plugin. Ive tried a few voting plugins and I just can not get them to work. All I want is for people to be able to vote one through 5 on any post. I mean, I see it all over and I can not figure it out. If anyone can help me, please shoot me a e-mail.
    Thanks
    easysharez@live.com

Webmentions

  • WP Plugin Archive » Vote For Post Plugin August 21, 2008

    […] des Vote For Post Plugin von Ivan Djurdjevac können Besucher Blog Artikel mit einer Note von 1 – 5 bewerten. […]