Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'vote'

Viewing 25 results - 51 through 75 (of 230 total)
  • Author
    Search Results
  • #160622
    grosbouff
    Participant

    I just made one, check it out !

    https://wordpress.org/plugins/bbpress-votes/

    Allow users to vote up or down to topics and replies inside bbPress, just like you can on StackOverflow for example.

    bbPress Votes screenshot

    #160489

    In reply to: Request: Voting

    Chad R. Schulz
    Participant

    Odd. That doesn’t happen on my test site.

    On my site it allows you vote for topic/replies individually. And you can vote for replies without voting for topics.

    I tested it out and now know what’s happening. I’m not using threaded (nested) replies. If you use threaded replies it assumes all that follows is an extension of the first reply/topic and adds the meta to it, not the actual reply.

    Unless you absolutely want threaded replies? I don’t because I think it ends up kinda messy–if someone wants to splinter the discussion from the main topic they need to start their own topic instead.

    Maybe someone else knows of a potential fix on threaded discussions?

    Good luck,
    Chad

    #160481

    In reply to: Request: Voting

    Lars Henriksen
    Participant

    Thank you very much Chad for taking your time to explain this.

    It works – almost like I wanted.

    The only thing that bugs me, is that you can’t vote for a single reply – it is by topic.

    If you can only vote for an entire topic/thread, it would be more logical to place the buttons next to the subscribe/favorite links in the top.

    I tried to add the code to the ‘content-single-topic-lead.php’ but to no avail.

    You can see it here.

    Anyways, I’m happy with my set up now, thanks again.

    #160450

    In reply to: Request: Voting

    Chad R. Schulz
    Participant

    I’m trying Thumbs Rating. It doesn’t tie into any user meta, so you can’t restrict the voting to only registered/logged-in users. However, it works very well and very fast. It only adds post meta so it shouldn’t noticeably slow-down your site even with thousands of topics/replies.

    After activation, per the plugin developers instructions I put the following code into my loop-single-relay.php:
    <?=function_exists('thumbs_rating_getlink') ? thumbs_rating_getlink() : ''?>
    goes somewhere between <div class="bbp-reply-content"> and </div>
    –this is theme specific and has to be modified based on your needs. I found that placing the vote before or after and not inside the content works best as the “quote” function in the forum(s) gets screwed up with the added voting content.

    That means before/after the <?php do_action( 'bbp_theme_before/after_reply_content' ); ?>

    Of course, as a lightweight plugin some serious css work is required. And it would be best to place this modified .php file into a bbpress child theme folder to ensure it continues to work after updates.

    Good luck, Chad

    #160299

    In reply to: Request: Voting

    Stagger Lee
    Participant

    Be very careful if you plan to use Like/Vote for comments/replies. Each reply is treated as separate Post and you could very easy slow down your forum tremendously.
    And maybe your whole WP site, I see you need to use widget too.

    #159975

    In reply to: Request: Voting

    Lars Henriksen
    Participant

    Thanks Robkk,

    I tried bbPress-Support-Forums, but it puts some strange stuff in the forum header:

    Screenshot

    It would be nice with a plugin that just lets logged in users vote, with a widget of most voted topics.

    #159285
    MattConway
    Participant

    Hello,

    My name is Matt Conway, just joined the site. I would like to know how easy it is to run a bbPress forum. The only thing I’ve ever used before is iWeb; I enjoyed it’s simplicity but I’m not stupid and I know there will be a learning curve.

    Our local council here are planning to redevelop the town centre with high rise apartments. There is a lot of local anger about this and I think a forum is the best way to get people talking. I’d like to know: Is it within the bounds of someone with no programming knowledge, but a desire to learn, to set up and moderate a bbPress forum?

    I would start as simply as possible, but over the course of time would like to do the following things:

    1 – Run the forum from a name I have just registered: http://www.walthamforestforum.org

    2 – Make users register before being able to post – add someway to deter spammers

    3 – Make it possible for users to add photos

    4 – Make it possible for users to vote on issues

    5 – Make it possible for users to sign a petition (could be just a link to another petition site)

    6 – Make it possible for users to “thumbs up” or “thumbs down” other people’s comments

    6 – Start a diary of upcoming local events (maybe best in another part of the site?)

    7 – Start a sub-forum that lists local tradesmen, shops etc; where users can add to an accumulated star rating and add comments on the tradesmen’s individual thread

    How much of this is possible on bbPress? Should I instead be looking at phpBB?

    Thanks, Matt.

    #158717
    VSensational
    Participant

    Since I can’t edit my post, I should clarify, it needs to have the ability to sort the forum based on said rating system. Just a rating system alone, be it upvotes or stars or 5 out of 5 toasters, isn’t what I’m looking for 😛

    #158713
    VSensational
    Participant

    Could anyone recommend a rating and/or sorting plugin that will let me sort the threads on my bbpress forum by the highest voted and/or most replied to threads? I’m thinking Reddit here, i.e. upvotes and then shifting “sort by” to Top and so on.

    Unless this is built into bbpress default and I’m just being an idiot, in which case please point me in the right direction to set that up.

    #158609
    Robkk
    Moderator

    you probably can

    you would just really need a good upvote/downvote plugin

    this might be a good post rating plugin that has alot of filters to be able to do it

    https://wordpress.org/plugins/wp-postratings/changelog/

    but then you would have to customize the query of the topics replies to sort.

    and of course enable thread repies with at least 1 or 2 threads.

    i don’t have a step by step but its definitly possible

    you probably need to go to http://jobs.wordpress.net/ and post a job so a developer can custom develop this for you.

    #156749
    John Clause
    Participant

    It might have been already reported to you, I would like to post another vote to get rid of the following message:

    Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /wp-includes/functions.php on line 3547

    which starts showing up when bbPress is activated and WP_DEBUG is on in /wp-config.php. It does not seem to break functionality of bbPress, but it is very annoying, when one tries to debug other stuff.

    Thank you very much.

    Joe Dostie
    Participant

    Is there anywhere to report a potential SPAM account? As a new contributor it would be nice to report and account that I think is SPAM. We could take control as a team.

    This account appears to be SPAMMING with the real information behind it…

    womper (@womper)

    I looked at all their replies and they are all similar with a link in them.

    I’m thinking this would be a good opportunity for a plug in…

    Imagine if several people “voted” that you were a suspected SPAMMER
    Your account could be locked unless you went to a RECATCHA page or something like that.

    Just a thought….

    In my opinion, I wouldn’t take bbPress being SPAMED as a bad sign…that would be like blaming the rape victim because she dressed so pretty…its the SPAMMERS fault, not bbPress.

    #154630
    drrule
    Participant

    What is the best way to allow users to vote on a response, then having the highest rated response flow to the top of the answers? Thanks!

    #154178
    dtbaker
    Participant

    I’ve updated the plugin to include a (very basic) paypal payment feature and the ability to mark topics as “accepted”. You have to manually update the topics when payments come in, I don’t have enough time to make any sort of PayPal IPN integration.

    Code has been updated here: https://github.com/dtbaker/bbPress-Support-Forums ( warning, my paypal address is hard coded into includes/bbps-vote-functions.php )

    Screenshots:

    Main forum page, it sorts topics by “funds” then “accepted” then “votes”.

    Admin topic page: you can vote, mark topic as accepted, and manually update payments.

    User topic view, can vote (when logged in) and pay:

    Live demo here: http://ultimateclientmanager.com/forums/forum/feature-requests/

    #153023

    One more thing I noticed after the migration: Although all topic tags where imported, they are no longer linked to any topics. Not a big deal in my case but it’s good to know in advance.

    +1 vote for an official export/import fix or dedicated tool 🙂

    #152670

    In reply to: Full Width Forum Pages

    bertusschoeman
    Participant

    Sorry about that 🙂 So the gaol is for the forum’s sub pages, the topic and discussions pages, IE – http://secularsociety.co.za/forum/topic/sass-logo-vote to look exactly like the forum’s main page over here http://secularsociety.co.za/forum. The main forum page (this one http://secularsociety.co.za/forum) is full width, but the forum interface is blocked within the full width page, see image – https://www.dropbox.com/s/rcmc1c0kewu4frb/Screen-Shot-Correct-Layout.jpg?dl=0. The sub pages, the focus of this discussion, are now full width (thanks to your help), but the forum interface is not blocked, see image – https://www.dropbox.com/s/a6o0b8x7sqiuvah/Screen-Shot-Incorrect-Layout.jpg?dl=0. In conclusion, the sub pages need to be full width (as we’ve achieved by duplicating the theme’s full width page.php, reanaming it and changing some of the code), with the forum interface blocked as shown in this image – https://www.dropbox.com/s/rcmc1c0kewu4frb/Screen-Shot-Correct-Layout.jpg?dl=0. Hope this makes sense 😀 Looking forward to your response. Thanks a mil!

    #147991
    Robkk
    Moderator

    okay so i have found a great post rating plugin

    with a simple count , with just vote up and vote down

    https://wordpress.org/plugins/like-dislike-counter-for-posts-pages-and-comments/

    heres a picture of how i have my layout

    https://docs.google.com/file/d/0B_Ue9ryY5cmYU3BHMDRkNzJsNU0/edit

    is it possible that whenever the post count goes down a certain number of times lets say 4 times that i can send data to akismet to recognize the post type (topic or reply) as spam?

    Like akismet would react the same as if i clicked the spam link in my bbpress reply admin links?

    just wondering if this possible?

    Robin W
    Moderator

    I haven’t been through the code yet, or looked at the pugin, so can you save me some time?

    ok, so do you want this just for bbpress? or can they vote in both bbpress and wordpress – hopefully not the latter !

    and can you give a quick summary of how what it does (or better what you would like it to do and how it would work? eg only on topics, on topics and replies, what are they voting for – eg the topic or a book within the topic. Will a book only ever be in one topic? What should they see – no. votes? average of replies, starts? Do you want votes for and votes against eg like/dislike? etc.

    Jerry
    Participant

    Okay, here is a very tough and long question. So I have this plugin created by Igor Yavych. I have a book review site and I really need my users to be able to rate the books listed (star rating). Here is my dilemma; this plugin only works for WordPress Posts. It does not work for bbpress posts. I want to change this plugin to function with bbpress. I think I probably have to dig through the bbpress codex, but I am hoping someone can tell me an easier way? There is a lot of code posted below from rating.php (my apologies). I will also post code from settings.php at the bottom. I think perhaps I need to just change some common wordpress variables to bbpress variables?
    Of course, what I would actually hope is that someone knows of a star rating plugin that already works for bbpress. I’ve been searching for days and cannot find one.

    <?php
    /*
      Plugin Name: Simple Rating
      Description: Allows users to rate posts and pages.
      Version: 1.3.2
      Author: Igor Yavych
      Author URI: https://www.odesk.com/users/~~d196de64099a8aa3
     */
    require_once ("spr_widgets.php");
    require_once ("spr_upgrade.php");
    upgrade();
    $options=spr_options();
    if ($options['activated']==1&&$options['method']=="auto")
    {
        add_filter('the_content', 'spr_filter', 15);
    }
    
    function spr_filter($content)
    {
        $options=spr_options();
        $list=spr_list_cpt_slugs();
        global $post, $wpdb, $spr_style;
        $disable_rating=get_post_meta($post->ID, '_spr_disable', true);
        //trying to change this to a bbpress plugin instead of a wordpress plugin - bbp_topic_id() or topic_id
        //$disable_rating=get_post_meta($post->topic_id, '_spr_disable', true);
        foreach ($list as $list_)
        {
            if (is_singular($list_)&&$options['where_to_show'][$list_]&&$disable_rating!='1')
            {
                if ($options['position']=='before')
                {
                    $content=spr_rating().$content;
                }
                elseif ($options['position']=='after')
                {
                    $content .= spr_rating();
                }
                break;
            }
            else if ((is_archive()||(is_home()&&$options['loop_on_hp']==1&&in_the_loop()))&&$options['show_in_loops']==1)
            {
                if ($post->post_type==$list_&$options['where_to_show'][$list_]&&$disable_rating!='1')
                {
                    wp_enqueue_style('spr_style', plugins_url('/resources/spr_style.css', __FILE__));
                    if ($spr_style!=1)
                    {
                        spr_print_additional_styles();
                        $spr_style=1;
                    }
                    $query="select <code>votes</code>, <code>points</code> from <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> where <code>post_id</code>='$post->ID';";
                    $popularity=$wpdb->get_results($query, ARRAY_N);
                    if (count($popularity)>0)
                    {
                        $votes=$popularity[0][0];
                        $points=$popularity[0][1];
                    }
                    else
                    {
                        $votes=0;
                        $points=0;
                    }
                    $results='<div id="spr_container"><div class="spr_visual_container">'.spr_show_voted($votes, $points, $options['show_vote_count']).'</div></div>';
                    if ($options['position']=='before')
                    {
                        $content=$results.$content;
                    }
                    elseif ($options['position']=='after')
                    {
                        $content .= $results;
                    }
                    break;
                }
            }
        }
        return $content;
    }
    
    function spr_show_rating()
    {
        $options=spr_options();
        $list=spr_list_cpt_slugs();
        global $post, $wpdb, $spr_added, $spr_added_loop, $spr_style;
        $disable_rating=get_post_meta($post->ID, '_spr_disable', true);
        //trying to change this to a bbpress plugin instead of a wordpress plugin
        //$disable_rating=get_post_meta($post->topic_id, '_spr_disable', true);
        $result="";
        if ($options['method']=="manual"&&$options['activated']==1)
        {
            foreach ($list as $list_)
            {
                if (is_singular($list_)&&$options['where_to_show'][$list_]&&$disable_rating!='1'&&$spr_added!=1)
                {
                    $result=spr_rating();
                    $spr_added=1;
                    break;
                }
                if ((is_archive()||($options['loop_on_hp']==1&&is_home()&&in_the_loop()))&&$options['show_in_loops']==1)
                {
                    if ($post->post_type==$list_&$options['where_to_show'][$list_]&&$disable_rating!='1'&&!isset($spr_added_loop[$post->ID]))
                    {
                        wp_enqueue_style('spr_style', plugins_url('/resources/spr_style.css', __FILE__));
                        if ($spr_style!=1)
                        {
                            spr_print_additional_styles();
                            $spr_style=1;
                        }
                        $query="select <code>votes</code>, <code>points</code> from <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> where <code>post_id</code>='$post->ID';";
                        $popularity=$wpdb->get_results($query, ARRAY_N);
                        if (count($popularity)>0)
                        {
                            $votes=$popularity[0][0];
                            $points=$popularity[0][1];
                        }
                        else
                        {
                            $votes=0;
                            $points=0;
                        }
                        $result='<div id="spr_container"><div class="spr_visual_container">'.spr_show_voted($votes, $points, $options['show_vote_count']).'</div></div>';
                        $spr_added_loop[$post->ID]=1;
                        break;
                    }
                }
            }
            return $result;
        }
    }
    
    function spr_get_entry_rating($post_id, $echo=false)
    {
        global $wpdb, $spr_added_loop, $spr_style;
        $options=spr_options();
        if ($options['activated'])
        {
            if (is_numeric($post_id))
            {
                wp_enqueue_style('spr_style', plugins_url('/resources/spr_style.css', __FILE__));
                if ($spr_style!=1)
                {
                    spr_print_additional_styles();
                    $spr_style=1;
                }
                if (!isset($spr_added_loop[$post_id]))
                {
                    $query="select <code>votes</code>, <code>points</code> from <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> where <code>post_id</code>='$post_id';";
                    $popularity=$wpdb->get_results($query, ARRAY_N);
                    if (count($popularity)>0)
                    {
                        $votes=$popularity[0][0];
                        $points=$popularity[0][1];
                    }
                    else
                    {
                        $votes=0;
                        $points=0;
                    }
                    $result='<div id="spr_container"><div class="spr_visual_container">'.spr_show_voted($votes, $points, $options['show_vote_count']).'</div></div>';
                    $spr_added_loop[$post_id]=1;
                    if ($echo)
                    {
                        echo $result;
                    }
                    else
                    {
                        return $result;
                    }
                }
            }
            else
            {
                echo "Invalid Post ID was supplied";
            }
        }
    }
    
    function spr_rating()
    {
        global $post, $current_user, $wpdb;
        $query="select <code>votes</code>, <code>points</code> from <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> where <code>post_id</code>='$post->ID';";
        $popularity=$wpdb->get_results($query, ARRAY_N);
        if (count($popularity)>0)
        {
            $votes=$popularity[0][0];
            $points=$popularity[0][1];
        }
        else
        {
            $votes=0;
            $points=0;
        }
        wp_enqueue_script('spr_script', plugins_url('/resources/spr_script.js', __FILE__), array('jquery'), NULL);
        wp_enqueue_style('spr_style', plugins_url('/resources/spr_style.css', __FILE__));
        $options=spr_options();
        spr_print_additional_styles();
        if ($votes>0)
        {
            $rate=$points/$votes;
            if ($options['use_aggregated'])
            {
                $aggregated='<div class="spr_hidden" itemscope="" itemtype="http://schema.org/Product"><meta itemprop="name" content="'.$post->post_title.'"><div class="spr_hidden" itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating"><meta itemprop="bestRating" content="'.$options['scale'].'"><meta itemprop="ratingValue" content="'.$rate.'"><meta itemprop="ratingCount" content="'.$votes.'"></div></div>';
            }
            else
            {
                $aggregated='';
            }
        }
        else
        {
            $rate=0;
            $votes=0;
            $aggregated='';
        }
    
        if (is_user_logged_in()==1)
        {
            $query="select * from <code>&quot;.$wpdb->prefix.&quot;spr_votes</code> where <code>post_id</code>='$post->ID' and <code>user_id</code>='$current_user->ID';";
            $voted=$wpdb->get_results($query, ARRAY_N);
            if (count($voted)>0)
            {
                $results='<div id="spr_container"><div class="spr_visual_container">'.spr_show_voted($votes, $points, $options['show_vote_count']).'</div></div>'.$aggregated;
                wp_localize_script('spr_script', 'spr_ajax_object', array('ajax_url'=>admin_url('admin-ajax.php'), 'scale'=>$options['scale'], 'spr_type'=>$options['color'].$options['shape'], 'rating_working'=>false, 'post_id'=>$post->ID));
                return $results;
            }
            else
            {
                $results='<div id="spr_container"><div class="spr_visual_container" id="spr_container_'.$post->ID.'">'.spr_show_voting($votes, $points, $options['show_vote_count']).'</div></div>'.$aggregated;
                wp_localize_script('spr_script', 'spr_ajax_object', array('ajax_url'=>admin_url('admin-ajax.php'), 'scale'=>$options['scale'], 'spr_type'=>$options['color'].$options['shape'], 'rating_working'=>true, 'post_id'=>$post->ID));
                return $results;
            }
        }
        else if ($options['allow_guest_vote']&&filter_var(spr_get_ip(), FILTER_VALIDATE_IP))
        {
            $query="select * from <code>&quot;.$wpdb->prefix.&quot;spr_votes</code> where <code>post_id</code>='$post->ID' and <code>user_id</code>='".spr_get_ip()."';";
            $voted=$wpdb->get_results($query, ARRAY_N);
            if (count($voted)>0)
            {
                $results='<div id="spr_container"><div class="spr_visual_container">'.spr_show_voted($votes, $points, $options['show_vote_count']).'</div></div>'.$aggregated;
                wp_localize_script('spr_script', 'spr_ajax_object', array('ajax_url'=>admin_url('admin-ajax.php'), 'scale'=>$options['scale'], 'spr_type'=>$options['color'].$options['shape'], 'rating_working'=>false, 'post_id'=>$post->ID));
                return $results;
            }
            else
            {
                $results='<div id="spr_container"><div class="spr_visual_container" id="spr_container_'.$post->ID.'">'.spr_show_voting($votes, $points, $options['show_vote_count']).'</div></div>'.$aggregated;
                wp_localize_script('spr_script', 'spr_ajax_object', array('ajax_url'=>admin_url('admin-ajax.php'), 'scale'=>$options['scale'], 'spr_type'=>$options['color'].$options['shape'], 'rating_working'=>true, 'post_id'=>$post->ID));
                return $results;
            }
        }
        else
        {
            wp_localize_script('spr_script', 'spr_ajax_object', array('ajax_url'=>admin_url('admin-ajax.php'), 'scale'=>$options['scale'], 'spr_type'=>$options['color'].$options['shape'], 'rating_working'=>false));
            $results='<div id="spr_container"><div class="spr_visual_container">'.spr_show_voted($votes, $points, $options['show_vote_count']).'</div></div>'.$aggregated;
            return $results;
        }
    }
    
    function spr_show_voted($votes, $points, $show_vc)
    {
        $options=spr_options();
        $spr_type=$options['color'].$options['shape'];
        if ($votes>0)
        {
            $rate=$points/$votes;
        }
        else
        {
            $rate=0;
            $votes=0;
        }
        $html='<div id="spr_shapes">';
        for ($i=1; $i<=$options['scale']; $i++)
        {
            if ($rate>=($i-0.25))
            {
                $class='spr_'.$spr_type.'_full_voted';
            }
            elseif ($rate<($i-0.25)&&$rate>=($i-0.75))
            {
                $class='spr_'.$spr_type.'_half_voted';
            }
            else
            {
                $class='spr_'.$spr_type.'_empty';
            }
            $html .= '<span class="spr_rating_piece '.$class.'"></span> ';
        }
        $html.='</div>';
        if ($show_vc)
        {
            if ($votes==1)
            {
                $votesorvote='vote';
            }
            else
            {
                $votesorvote='votes';
            }
            $html .= '<span id="spr_votes">'.$votes.' '.$votesorvote.'</span>';
        }
    
        return $html;
    }
    
    function spr_show_voting($votes, $points, $show_vc)
    {
        $options=spr_options();
        $spr_type=$options['color'].$options['shape'];
        if ($votes>0)
        {
            $rate=$points/$votes;
        }
        else
        {
            $rate=0;
            $votes=0;
        }
        $html='<div id="spr_shapes">';
        for ($i=1; $i<=$options['scale']; $i++)
        {
            if ($rate>=($i-0.25))
            {
                $class='spr_'.$spr_type.'_full_voting';
            }
            elseif ($rate<($i-0.25)&&$rate>=($i-0.75))
            {
                $class='spr_'.$spr_type.'_half_voting';
            }
            else
            {
                $class='spr_'.$spr_type.'_empty';
            }
            $html .= '<span id="spr_piece_'.$i.'" class="spr_rating_piece '.$class.'"></span> ';
        }
        $html.='</div>';
        if ($show_vc)
        {
            if ($votes==1)
            {
                $votesorvote='vote';
            }
            else
            {
                $votesorvote='votes';
            }
            $html .= '<span id="spr_votes">'.$votes.' '.$votesorvote.'</span>';
        }
        return $html;
    }
    
    function spr_rate()
    {
        global $current_user, $wpdb;
        $options=spr_options();
        if ($options['activated']==1)
        {
            if (isset($_POST['points'])&&isset($_POST['post_id'])) // key parameters are set
            {
                $post_id=(int) esc_sql($_POST['post_id']);
                $points_=(int) esc_sql($_POST['points']);
                if ($points_>=1&&$points_<=$options['scale'])
                {
                    if (is_user_logged_in()==1) // user is logged in
                    {
                        $query="select * from <code>&quot;.$wpdb->prefix.&quot;posts</code> where <code>ID</code>='$post_id';";
                        $post_exists=$wpdb->get_results($query, ARRAY_N);
                        if (count($post_exists)>0) // post exists
                        {
                            $query="select * from <code>&quot;.$wpdb->prefix.&quot;spr_votes</code> where <code>post_id</code>='$post_id' and <code>user_id</code>='$current_user->ID';";
                            $voted=$wpdb->get_results($query, ARRAY_N);
                            if (count($voted)>0)  // already voted
                            {
                                $response=json_encode(array('status'=>2));
                            }
                            else // haven't voted yet 
                            {
                                $wpdb->query("INSERT INTO <code>&quot;.$wpdb->prefix.&quot;spr_votes</code> (<code>post_id</code>, <code>user_id</code>, <code>points</code>) VALUES ('$post_id', '$current_user->ID', '$points_');");
                                $query="select <code>votes</code>, <code>points</code> from <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> where <code>post_id</code>='$post_id';";
                                $popularity=$wpdb->get_results($query, ARRAY_N);
                                if (count($popularity)>0)
                                {
                                    $votes=$popularity[0][0];
                                    $points=$popularity[0][1];
                                }
                                else
                                {
                                    $votes=0;
                                    $points=0;
                                }
                                if ($votes==0||$points==0)
                                {
                                    $wpdb->query("INSERT INTO <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> (<code>post_id</code>, <code>votes</code>, <code>points</code>) VALUES ('$post_id', '1', '$points_');");
                                }
                                else
                                {
                                    $points=$points+$points_;
                                    $votes=$votes+1;
                                    $wpdb->query("UPDATE <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> set <code>votes</code>='$votes', <code>points</code>='$points' where <code>post_id</code>='$post_id';");
                                }
                                $query="select <code>votes</code>, <code>points</code> from <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> where <code>post_id</code>='$post_id';";
                                $popularity=$wpdb->get_results($query, ARRAY_N);
                                if (count($popularity)>0)
                                {
                                    $votes=$popularity[0][0];
                                    $points=$popularity[0][1];
                                }
                                else
                                {
                                    $votes=0;
                                    $points=0;
                                }
                                $html=spr_show_voted($votes, $points, $options['show_vote_count']);
                                $response=json_encode(array('status'=>1, 'html'=>$html));
                            }
                        }
                        else
                        {
                            $response=json_encode(array('status'=>3)); // post doesn't exist
                        }
                    }
                    else if ($options['allow_guest_vote']&&filter_var(spr_get_ip(), FILTER_VALIDATE_IP))
                    {
                        $query="select * from <code>&quot;.$wpdb->prefix.&quot;posts</code> where <code>ID</code>='$post_id';";
                        $post_exists=$wpdb->get_results($query, ARRAY_N);
                        if (count($post_exists)>0) // post exists
                        {
                            $query="select * from <code>&quot;.$wpdb->prefix.&quot;spr_votes</code> where <code>post_id</code>='$post_id' and <code>user_id</code>='".spr_get_ip()."';";
                            $voted=$wpdb->get_results($query, ARRAY_N);
                            if (count($voted)>0)  // already voted
                            {
                                $response=json_encode(array('status'=>2));
                            }
                            else // haven't voted yet 
                            {
                                $wpdb->query("INSERT INTO <code>&quot;.$wpdb->prefix.&quot;spr_votes</code> (<code>post_id</code>, <code>user_id</code>, <code>points</code>) VALUES ('$post_id', '".spr_get_ip()."', '$points_');");
                                $query="select <code>votes</code>, <code>points</code> from <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> where <code>post_id</code>='$post_id';";
                                $popularity=$wpdb->get_results($query, ARRAY_N);
                                if (count($popularity)>0)
                                {
                                    $votes=$popularity[0][0];
                                    $points=$popularity[0][1];
                                }
                                else
                                {
                                    $votes=0;
                                    $points=0;
                                }
                                if ($votes==0||$points==0)
                                {
                                    $wpdb->query("INSERT INTO <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> (<code>post_id</code>, <code>votes</code>, <code>points</code>) VALUES ('$post_id', '1', '$points_');");
                                }
                                else
                                {
                                    $points=$points+$points_;
                                    $votes=$votes+1;
                                    $wpdb->query("UPDATE <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> set <code>votes</code>='$votes', <code>points</code>='$points' where <code>post_id</code>='$post_id';");
                                }
                                $query="select <code>votes</code>, <code>points</code> from <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> where <code>post_id</code>='$post_id';";
                                $popularity=$wpdb->get_results($query, ARRAY_N);
                                if (count($popularity)>0)
                                {
                                    $votes=$popularity[0][0];
                                    $points=$popularity[0][1];
                                }
                                else
                                {
                                    $votes=0;
                                    $points=0;
                                }
                                $html=spr_show_voted($votes, $points, $options['show_vote_count']);
                                $response=json_encode(array('status'=>1, 'html'=>$html));
                            }
                        }
                        else
                        {
                            $response=json_encode(array('status'=>3)); // post doesn't exist
                        }
                    }
                    else
                    {
                        $response=json_encode(array('status'=>4)); // user isn't logged in
                    }
                }
                else
                {
                    $response=json_encode(array('status'=>5));  // key parameters aren't set
                }
            }
            else
            {
                $response=json_encode(array('status'=>6));  // key parameters aren't set
            }
        }
        else
        {
            $response=json_encode(array('status'=>7));  // rating isn't active
        }
        echo $response;
        if (isset($_POST['action']))
        {
            die();
        }
    }
    
    function spr_options()
    {
        $list=spr_list_cpt_slugs();
        foreach ($list as $list_)
        {
            $def_types[$list_]=0;
        }
        $default_options=array("shape"=>"s", "color"=>"y", "where_to_show"=>$def_types, "position"=>"before", "show_vote_count"=>"1", "activated"=>"0", "scale"=>"5", "method"=>"auto", "alignment"=>"center", "vote_count_color"=>"", "vc_bold"=>"0", "vc_italic"=>"0", "show_in_loops"=>"0", "loop_on_hp"=>"0", "use_aggregated"=>"1", "allow_guest_vote"=>"0", "show_stats_metabox"=>"1");
        $options=get_option('spr_settings', 'undef');
        if ($options!='undef')
        {
            $options=json_decode($options, true);
            $diff=array_diff_key($default_options, $options);
            if (count($diff)>0)
            {
                $options=array_merge($options, $diff);
            }
        }
        else
        {
            $options=$default_options;
        }
        return $options;
    }
    
    function spr_options_page()
    {
        require_once (plugin_dir_path(__FILE__).'/settings.php');
    }
    
    function spr_save_settings()
    {
        $current_options=spr_options();
        $current_json=json_encode($current_options);
        if (isset($_POST['spr_shape'])||isset($_POST['spr_color'])||isset($_POST['spr_position'])||isset($_POST['spr_scale'])||isset($_POST['spr_show_vote_count'])||isset($_POST['spr_activated'])||isset($_POST['spr_method'])||isset($_POST['spr_vote_count_color'])||isset($_POST['spr_vc_bold'])||isset($_POST['spr_vc_italic'])||isset($_POST['spr_show_in_loops'])||isset($_POST['spr_loop_on_hp'])||isset($_POST['spr_use_aggregated'])||isset($_POST['spr_allow_guest_vote'])||isset($_POST['spr_show_stats_metabox']))
        {
    
    //Shape
            if (isset($_POST['spr_shape']))
            {
                switch ($_POST['spr_shape'])
                {
                    case 'c' :
                        {
                            $options['shape']='c';
                            break;
                        }
                    case 'h' :
                        {
                            $options['shape']='h';
                            break;
                        }
                    case 'b' :
                        {
                            $options['shape']='b';
                            break;
                        }
                    case 's' :
                        {
                            $options['shape']='s';
                            break;
                        }
                    default:
                        {
                            $options['shape']=$current_options['shape'];
                            break;
                        }
                }
            }
            //Color
            if (isset($_POST['spr_color']))
            {
                switch ($_POST['spr_color'])
                {
                    case 'p' :
                        {
                            $options['color']='p';
                            break;
                        }
                    case 'b' :
                        {
                            $options['color']='b';
                            break;
                        }
                    case 'y' :
                        {
                            $options['color']='y';
                            break;
                        }
                    case 'r' :
                        {
                            $options['color']='r';
                            break;
                        }
                    case 'g' :
                        {
                            $options['color']='g';
                            break;
                        }
                    default:
                        {
                            $options['color']=$current_options['color'];
                            break;
                        }
                }
            }
            //Position
            if (isset($_POST['spr_position']))
            {
                switch ($_POST['spr_position'])
                {
                    case 'before' :
                        {
                            $options['position']='before';
                            break;
                        }
                    case 'after' :
                        {
                            $options['position']='after';
                            break;
                        }
                    default:
                        {
                            $options['position']=$current_options['position'];
                            break;
                        }
                }
            }
            //Alignment 
            if (isset($_POST['spr_alignment']))
            {
                switch ($_POST['spr_alignment'])
                {
                    case 'center' :
                        {
                            $options['alignment']='center';
                            break;
                        }
                    case 'left' :
                        {
                            $options['alignment']='left';
                            break;
                        }
                    case 'right' :
                        {
                            $options['alignment']='right';
                            break;
                        }
                    default:
                        {
                            $options['alignment']=$current_options['alignment'];
                            break;
                        }
                }
            }
            //Show vote count
            if (isset($_POST['spr_show_vote_count']))
            {
                $options['show_vote_count']='1';
            }
            else
            {
                $options['show_vote_count']='0';
            }
            //Activated
            if (isset($_POST['spr_activated']))
            {
                $options['activated']='1';
            }
            else
            {
                $options['activated']='0';
            }
            //Scale
            if (isset($_POST['spr_scale']))
            {
                if ($_POST['spr_scale']>=3&&$_POST['spr_scale']<=10)
                {
                    $options['scale']=$_POST['spr_scale'];
                }
                else
                {
                    $options['scale']=$current_options['scale'];
                }
            }
            //Method
            if (isset($_POST['spr_method']))
            {
                switch ($_POST['spr_method'])
                {
                    case 'auto' :
                        {
                            $options['method']='auto';
                            break;
                        }
                    case 'manual' :
                        {
                            $options['method']='manual';
                            break;
                        }
                    default:
                        {
                            $options['method']=$current_options['method'];
                            break;
                        }
                }
            }
            // Vote count color
            if (isset($_POST['spr_vote_count_color']))
            {
                if (preg_match('@^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$@', $_POST['spr_vote_count_color']))
                {
                    $options['vote_count_color']=$_POST['spr_vote_count_color'];
                }
                else
                {
                    $_POST['spr_vote_count_color']="";
                }
            }
            //Bold
            if (isset($_POST['spr_vc_bold']))
            {
                $options['vc_bold']='1';
            }
            else
            {
                $options['vc_bold']='0';
            }
            //Italic
            if (isset($_POST['spr_vc_italic']))
            {
                $options['vc_italic']='1';
            }
            else
            {
                $options['vc_italic']='0';
            }
    
            if (isset($_POST['spr_show_in_loops']))
            {
                $options['show_in_loops']='1';
            }
            else
            {
                $options['show_in_loops']='0';
            }
            //Loop on homepage
            if (isset($_POST['spr_loop_on_hp']))
            {
                $options['loop_on_hp']='1';
            }
            else
            {
                $options['loop_on_hp']='0';
            }
            //Use aggregated
            if (isset($_POST['spr_use_aggregated']))
            {
                $options['use_aggregated']='1';
            }
            else
            {
                $options['use_aggregated']='0';
            }
    
            //Allow guests to vote
            if (isset($_POST['spr_allow_guest_vote']))
            {
                $options['allow_guest_vote']='1';
            }
            else
            {
                $options['allow_guest_vote']='0';
            }
            //Show statistics metabox
            if (isset($_POST['spr_show_stats_metabox']))
            {
                $options['show_stats_metabox']='1';
            }
            else
            {
                $options['show_stats_metabox']='0';
            }
    
            //where to show
            $list=spr_list_cpt_slugs();
            foreach ($list as $list_)
            {
                $def_types[$list_]=0;
                if (isset($_POST[$list_]))
                {
                    $options['where_to_show'][$list_]='1';
                }
                else
                {
                    $options['where_to_show'][$list_]='0';
                }
            }
            $default_options=array("shape"=>"s", "color"=>"y", "where_to_show"=>$def_types, "position"=>"before", "show_vote_count"=>"1", "activated"=>"0", "scale"=>"5", "method"=>"auto", "alignment"=>"center", "vote_count_color"=>"", "vc_bold"=>"0", "vc_italic"=>"0", "show_in_loops"=>"0", "loop_on_hp"=>"0", "use_aggregated"=>"1", "allow_guest_vote"=>"0", "show_stats_metabox"=>"1");
            $diff=array_diff_key($default_options, $options);
            if (count($diff)>0)
            {
                $options=array_merge($options, $diff);
            }
            $options=json_encode($options);
    
            if ($current_json!=$options)
            {
                update_option('spr_settings', $options);
                echo "<div class='updated'><p>Settings were updated successfully.</p></div>";
            }
        }
    }
    
    function spr_menu()
    {
        add_options_page('Simple Rating', 'Simple Rating', 'manage_options', 'spr_options', 'spr_options_page');
    }
    
    function spr_activation_func()
    {
        global $wpdb;
        $query="CREATE TABLE IF NOT EXISTS <code>&quot;.$wpdb->prefix.&quot;spr_votes</code>  (
    	<code>post_id</code> INT(11) NULL DEFAULT NULL,
    	<code>user_id</code> TINYTEXT NULL COLLATE 'utf8_unicode_ci',
    	<code>points</code> INT(11) NULL DEFAULT NULL 
    )
    COLLATE='utf8_unicode_ci'
    ENGINE=MyISAM;
    ";
        $wpdb->query($query);
        $query="CREATE TABLE IF NOT EXISTS <code>&quot;.$wpdb->prefix.&quot;spr_rating</code> (
    	<code>post_id</code> INT(11) NOT NULL,
    	<code>votes</code> INT(11) NOT NULL,
    	<code>points</code> INT(11) NOT NULL
    )
    COLLATE='utf8_unicode_ci'
    ENGINE=MyISAM;
    ";
        $wpdb->query($query);
        $list=spr_list_cpt_slugs();
        foreach ($list as $list_)
        {
            $def_types[$list_]=0;
        }
        $default_options=array("shape"=>"s", "color"=>"y", "where_to_show"=>$def_types, "position"=>"before", "show_vote_count"=>"1", "activated"=>"0", "scale"=>"5", "method"=>"auto", "alignment"=>"center", "vote_count_color"=>"", "vc_bold"=>"0", "vc_italic"=>"0", "show_in_loops"=>"0", "loop_on_hp"=>"0", "use_aggregated"=>"1", "allow_guest_vote"=>"0", "show_stats_metabox"=>"1");
        add_option('spr_settings', json_encode($default_options));
        add_option('spr_version', '1.3.1');
    }
    
    function add_spr_checkbox()
    {
        global $post;
        $type=get_post_type($post->ID);
        $disable_rating=get_post_meta($post->ID, '_spr_disable', true);
        ?>
        <div class="misc-pub-section">
            <input id="spr_disable_rating" type="checkbox" name="spr_disable_rating"  value="<?php echo $disable_rating; ?>" <?php checked($disable_rating, 1, true); ?>>
            <label for="spr_enable_rating">Disable rating for this entry</label></div>
        <?php
    }
    
    function spr_new_update_post_handler($data, $postarr)
    {
    
        if (isset($_POST['spr_disable_rating']))
        {
            update_post_meta($postarr['ID'], '_spr_disable', '1');
        }
        else
        {
            delete_post_meta($postarr['ID'], '_spr_disable');
        }
        return $data;
    }
    
    function spr_truncate_tables()
    {
        global $wpdb;
        $query="TRUNCATE TABLE <code>&quot;.$wpdb->prefix.&quot;spr_votes</code> ;";
        $wpdb->query($query);
        $query="TRUNCATE TABLE <code>&quot;.$wpdb->prefix.&quot;spr_rating</code>;";
        $wpdb->query($query);
        echo "<div class='updated'><p>All votes were cleared.</p></div>";
    }
    
    function spr_add_settings_link($links)
    {
    
        return array_merge(
                array(
            'settings'=>'<a href="'.admin_url('options-general.php?page=spr_options').'">Settings</a>'
                ), $links
        );
    }
    
    function spr_print_additional_styles()
    {
        $options=spr_options();
        $style="<style>";
        $vc_style="#spr_votes{";
        $c_style="#spr_container{";
        if (strlen($options['vote_count_color'])>0&&$options['show_vote_count'])
        {
            $vc_style.="color:".$options['vote_count_color']." !important;";
        }
        if ($options['vc_bold']&&$options['show_vote_count'])
        {
            $vc_style.="font-weight:700 !important;";
        }
        if ($options['vc_italic']&&$options['show_vote_count'])
        {
            $vc_style.="font-style:italic !important;";
        }
        $vc_style.="}";
        if ($vc_style!="#spr_votes{}")
        {
            $style.=$vc_style;
        }
        if ($options['alignment']=="right"||$options['alignment']=="left")
        {
            $c_style.="text-align:".$options['alignment']." !important;";
        }
        $c_style.="}";
        if ($c_style!="#spr_container{}")
        {
            $style.=$c_style;
        }
        $style.="</style>";
        if ($style!="<style></style>")
        {
            echo $style;
        }
    }
    
    function spr_get_post_types_fo()
    {
        $options=spr_options();
        $post_types=get_post_types(array('public'=>true, '_builtin'=>false), 'objects', 'and');
        $result='<table><tr><td class="spr_cb_labels">Posts</td><td><input type="checkbox" name="post" id="post" value="'.$options['where_to_show']['post'].'" '.checked($options['where_to_show']['post'], 1, false).'></td></tr><tr><td class="spr_cb_labels">Pages</td><td><input type="checkbox" name="page" id="page" value="'.$options['where_to_show']['page'].'" '.checked($options['where_to_show']['page'], 1, false).'></td></tr>';
        foreach ($post_types as $post_type)
        {
            $result.= '<tr><td class="spr_cb_labels">'.$post_type->labels->name.'</td><td><input type="checkbox" name="'.$post_type->rewrite['slug'].'" id="'.$post_type->rewrite['slug'].'" value="'.$options['where_to_show'][$post_type->rewrite['slug']].'" '.checked($options['where_to_show'][$post_type->rewrite['slug']], 1, false).'></td></tr>';
        }
        $result.="</table>";
        return $result;
    }
    
    function spr_list_cpt_slugs()
    {
        $types=array("post", "page");
        $post_types=get_post_types(array('public'=>true, '_builtin'=>false), 'objects', 'and');
        foreach ($post_types as $post_type)
        {
            $types[]=$post_type->rewrite['slug'];
        }
        return $types;
    }
    
    function spr_get_ip()
    {
        if (getenv("HTTP_CLIENT_IP")&&strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown"))
        {
            $ip=getenv("HTTP_CLIENT_IP");
        }
        else if (getenv("HTTP_X_FORWARDED_FOR")&&strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown"))
        {
            $ip=getenv("HTTP_X_FORWARDED_FOR");
        }
        else if (getenv("REMOTE_ADDR")&&strcasecmp(getenv("REMOTE_ADDR"), "unknown"))
        {
            $ip=getenv("REMOTE_ADDR");
        }
        else if (isset($_SERVER['REMOTE_ADDR'])&&$_SERVER['REMOTE_ADDR']&&strcasecmp($_SERVER['REMOTE_ADDR'], "unknown"))
        {
            $ip=$_SERVER['REMOTE_ADDR'];
        }
        else
        {
            $ip="unknown";
        }
        return($ip);
    }
    
    function spr_list_ratings($post)
    {
        $options=spr_options();
        global $wpdb;
        wp_enqueue_style('spr_style', plugins_url('/resources/spr_style.css', __FILE__));
        $query="select <code>points</code>,<code>user_id</code>, count(points) as <code>amount</code> from <code>&quot;.$wpdb->prefix.&quot;spr_votes</code> where <code>post_id</code>='".$post->ID."' group by <code>points</code> order by <code>points</code> asc;";
        $list=$wpdb->get_results($query, ARRAY_A);
        $html="";
        $result="";
        if (count($list)>0)
        {
            $totalpoints=0;
            $totalvoters=0;
            for ($i=$options['scale']; $i>=1; $i--)
            {
                $users=0;
                $guests=0;
                $votes=0;
                $found=false;
                foreach ($list as $list_)
                {
                    if ($list_['points']==$i)
                    {
                        $found=true;
                        $totalpoints+=$list_['points']*$list_['amount'];
                        $totalvotes+=$list_['amount'];
                        $votes=$list_['amount'];
                        if (is_numeric($list_['used_id']))
                        {
                            $users++;
                        }
                        else if ($options['allow_guest_vote']&&filter_var($list_['used_id'], FILTER_VALIDATE_IP))
                        {
                            $guests++;
                        }
                    }
                }
                if ($found)
                {
                    if ($votes==1)
                    {
                        $votesorvote='vote';
                    }
                    else
                    {
                        $votesorvote='votes';
                    }
                    $html.='<div id="spr_visual_container_adm">'.spr_show_voted(1, $i, false).'<span id="spr_votes">'.$votes." ".$votesorvote."</span></div><br/>";
                }
                else
                {
                    $html.='<div id="spr_visual_container_adm">'.spr_show_voted(1, $i, false)."<span id='spr_votes'>0 votes</span></div><br/>";
                }
            }
            $result='<div id="spr_visual_container_adm">'.spr_show_voted($totalvotes, $totalpoints, true)."</div><div style='text-align:center;font-size:15px;margin:3px;font-weight:700;'>Statistics by rating:</div>";
        }
        else
        {
            $html.="There are no votes for this entry yet.";
        }
        echo $result.$html;
    }
    
    function spr_add_custom_box()
    {
        $options=spr_options();
        if ($options['show_stats_metabox'])
        {
            foreach ($options['where_to_show'] as $k=> $v)
            {
                if ($v)
                {
                    $screens[]=$k;
                }
            }
            if (count($screens)>0)
            {
                foreach ($screens as $screen)
                {
                    add_meta_box('spr_rating_stats', __('Rating statistics', 'spr_text_domain'), 'spr_list_ratings', $screen, 'side');
                }
            }
        }
    }
    
    add_action('add_meta_boxes', 'spr_add_custom_box');
    add_filter('plugin_action_links_'.plugin_basename(__FILE__), 'spr_add_settings_link');
    add_filter('wp_insert_post_data', 'spr_new_update_post_handler', '99', 2);
    add_action('post_submitbox_misc_actions', 'add_spr_checkbox');
    add_action('admin_menu', 'spr_menu');
    add_action('wp_ajax_spr_rate', 'spr_rate');
    add_action('wp_ajax_nopriv_spr_rate', 'spr_rate');
    register_activation_hook(__FILE__, 'spr_activation_func');
    ?>

    Here is code from settings.php. Here I think I probably have to change wp_enqueue to something else, among other things:

    <?php
    if (isset($_POST['spr_reset_votes']))
    {
        if (current_user_can('activate_plugins'))
        {
            spr_truncate_tables();
        }
    }
    spr_save_settings();
    $options=spr_options();
    wp_enqueue_style('farbtastic');
    wp_enqueue_script('farbtastic');
    wp_enqueue_style('spr_style', plugins_url('/resources/spr_style.css', __FILE__));
    wp_enqueue_script('spr_admin', plugins_url('/resources/spr_admin.js', __FILE__), array('farbtastic', 'jquery'), NULL);
    wp_localize_script('spr_admin', 'spr_ajax_object', array('scale'=>$options['scale'], 'spr_type'=>$options['color'].$options['shape']));
    ?>
    <h1>Adjust settings of the Simple Rating</h1>
    <div style="float:left;">
        <form name="form" method="POST" style="margin-top:15px;">
            <table>
                <tr>
                    <td  class="spr_adm_label"><label>Show rating</label></td>
                    <td><input type="checkbox" name="spr_activated" id="spr_activated" value="<?php echo $options['activated']; ?>" <?php checked($options['activated'], 1, true); ?>></td>
                    <td class="spr_hint_container"><div class="spr_hint tooltip-right" data-tooltip="Unless you check this box, rating won't show up."></div></td>
                </tr>
                <tr>
                    <td  class="spr_adm_label"><label>Allow guests to vote</label></td>
                    <td><input type="checkbox" name="spr_allow_guest_vote" id="spr_allow_guest_vote" value="<?php echo $options['allow_guest_vote']; ?>" <?php checked($options['allow_guest_vote'], 1, true); ?>></td>
                    <td class="spr_hint_container"><div class="spr_hint tooltip-right" data-tooltip="If you check this box, guests will be allowed to vote. Guest votes will be tracked by IP instead of UserID"></div></td>
                </tr>
                <tr>
                    <td  class="spr_adm_label"><label>Insertion method</label></td>
                    <td>
                        <select name="spr_method" id="spr_method" class="spr_admin_input">
                            <option value="auto" <?php selected($options['method'], 'auto', true); ?>>Automatic</option>
                            <option value="manual" <?php selected($options['method'], 'manual', true); ?>>Manual</option>
                        </select>
                    </td>
                    <td class="spr_hint_container"><div class="spr_hint tooltip-right" data-tooltip="Automatic method is recommended if you don't want to touch theme files. It will use filter to insert rating before or after content. If you want to insert rating into a specific part of your template, set method to Manual and insert <?php if(function_exists('spr_show_rating')){echo spr_show_rating();}?> where you need it."></div></td>
                </tr> 
                <tr>
                    <td  class="spr_adm_label"><label>Shape</label></td>
                    <td>
                        <select name="spr_shape" id="spr_shape" class="spr_admin_input">
                            <option value="s" <?php selected($options['shape'], 's', true); ?>>Stars</option>
                            <option value="c" <?php selected($options['shape'], 'c', true); ?>>Circles</option>
                            <option value="h" <?php selected($options['shape'], 'h', true); ?>>Hearts</option>
                            <option value="b" <?php selected($options['shape'], 'b', true); ?>>Bar</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td  class="spr_adm_label"><label>Color</label></td>
                    <td>
                        <select name="spr_color" id="spr_color" class="spr_admin_input">
                            <option value="y" <?php selected($options['color'], 'y', true); ?>>Yellow</option>
                            <option value="p" <?php selected($options['color'], 'p', true); ?>>Purple</option>
                            <option value="g" <?php selected($options['color'], 'g', true); ?>>Green</option>
                            <option value="b" <?php selected($options['color'], 'b', true); ?>>Blue</option>
                            <option value="r" <?php selected($options['color'], 'r', true); ?>>Red</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td  class="spr_adm_label"><label>Alignment</label></td>
                    <td>
                        <select name="spr_alignment" id="spr_alignment" class="spr_admin_input">
                            <option value="center" <?php selected($options['alignment'], 'center', true); ?>>Center</option>
                            <option value="right" <?php selected($options['alignment'], 'right', true); ?>>Right</option>
                            <option value="left" <?php selected($options['alignment'], 'left', true); ?>>Left</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td  class="spr_adm_label"><label>Show vote count</label></td>
                    <td><input type="checkbox" name="spr_show_vote_count" id="spr_show_vote_count" value="<?php echo $options['show_vote_count']; ?>" <?php checked($options['show_vote_count'], 1, true); ?>></td>
                </tr>
                <tr>
                    <td  class="spr_adm_label"><label>Vote count color</label></td>
                    <td>
                        <input type="text" size="10" maxlength="8" name="spr_vote_count_color" id="spr_vote_count_color" value="<?php echo $options['vote_count_color']; ?>" class="spr_admin_input">
                    </td>
                    <td><a href="#" id="spr_vote_count_color_box" class="pickcolor" style="padding: 4px 11px; border: 1px solid #dfdfdf; background-color: <?php echo $options['vote_count_color']; ?>;"></a>
                        <div id="psr_color_picker" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div></td>
                </tr>
                <tr>
                    <td  class="spr_adm_label"><label>Vote count style</label></td>
                    <td> 
                        Bold <input type="checkbox" name="spr_vc_bold" id="spr_vc_bold" value="<?php echo $options['vc_bold']; ?>" <?php checked($options['vc_bold'], 1, true); ?>>
                        Italic <input type="checkbox" name="spr_vc_italic" id="spr_vc_italic" value="<?php echo $options['vc_italic']; ?>" <?php checked($options['vc_italic'], 1, true); ?>>
                    </td>
                </tr>
                <tr>
                    <td  class="spr_adm_label"><label>Scale</label></td>
                    <td><input type="text" size="10" maxlength="200" name="spr_scale" id="spr_scale" value="<?php echo $options['scale']; ?>" class="spr_admin_input"></td>
                    <td class="spr_hint_container"><div class="spr_hint tooltip-right" data-tooltip="Scale of rating. Allowed values: 3-10."></div></td>
                </tr>
                <tr>
                    <td  class="spr_adm_label"><label>Where to add rating</label></td>
                    <td>
                        <?php echo spr_get_post_types_fo(); ?>
                    </td>
                </tr> 
                <tr>
                    <td  class="spr_adm_label"><label>Position</label></td>
                    <td>
                        <select name="spr_position" id="spr_position" class="spr_admin_input">
                            <option value="before" <?php selected($options['position'], 'before', true); ?>>Before content</option>
                            <option value="after" <?php selected($options['position'], 'after', true); ?>>After content</option>
                        </select>
                    </td>
                </tr>  
                <tr>
                    <td  class="spr_adm_label"><label>Show in loops</label></td>
                    <td><input type="checkbox" name="spr_show_in_loops" id="spr_show_in_loops" value="<?php echo $options['show_in_loops']; ?>" <?php checked($options['show_in_loops'], 1, true); ?>></td>
                    <td class="spr_hint_container"><div class="spr_hint tooltip-right" data-tooltip="Check this box if you want to show rating in the loops. Category page for example. Note: voting is allowed only from a single page."></div></td>
                </tr>
                <tr>
                    <td  class="spr_adm_label"><label>Show in loop on home page</label></td>
                    <td><input type="checkbox" name="spr_loop_on_hp" id="spr_loop_on_hp" value="<?php echo $options['loop_on_hp']; ?>" <?php checked($options['loop_on_hp'], 1, true); ?>></td>
                    <td class="spr_hint_container"><div class="spr_hint tooltip-right" data-tooltip="If your homepage uses loop and you want to show rating there, check this box."></div></td>
                </tr>
                <tr>
                    <td  class="spr_adm_label"><label>Use aggregated rating</label></td>
                    <td><input type="checkbox" name="spr_use_aggregated" id="spr_use_aggregated" value="<?php echo $options['use_aggregated']; ?>" <?php checked($options['use_aggregated'], 1, true); ?>></td>
                    <td class="spr_hint_container"><div class="spr_hint tooltip-right" data-tooltip="If you check this box, rating will be shown in search engines' snippets. See Screenshot 4 for example. Note: this plugin can't control rating style in snippets."></div></td>
                </tr>
                <tr>
                    <td  class="spr_adm_label"><label>Show statistics metabox</label></td>
                    <td><input type="checkbox" name="spr_show_stats_metabox" id="spr_show_stats_metabox" value="<?php echo $options['show_stats_metabox']; ?>" <?php checked($options['show_stats_metabox'], 1, true); ?>></td>
                    <td class="spr_hint_container"><div class="spr_hint tooltip-right" data-tooltip="If you check this box, you will see metabox with rating statistics when editing posts/pages/custom post type entries."></div></td>
                </tr>
            </table>
            <input type="submit" style="margin-top:10px;" class='button button-primary button-large' value="Save settings">
        </form>
    </div>
    <div id="postbox-container-1" class="postbox-container" style="float: right;display:inline-block;width: 280px;margin-right:20px;">
        <div class="postbox ">
            <h3 class="spr_widget_title">
                <span>Live preview</span>
            </h3>
            <div class="inside">         
                <div id="spr_container"><div class="spr_visual_container"><?php echo spr_show_voting(5, 25, $options['show_vote_count']); ?></div></div>
            </div>
        </div>
        <div class="postbox ">
            <h3 class="spr_widget_title">
                <span>Donate</span>
            </h3>
            <div class="inside">         
                <form action="https://www.moneybookers.com/app/payment.pl" method="post">
                    <input type="hidden" name="pay_to_email" value="igor.yavych@gmail.com">
                    <input type="hidden" name="status_url" value="mailto:igor.yavych@gmail.com">
                    <input type="hidden" name="language" value="EN">
                    <input type="hidden" name="recipient_description" value="Simple Rating">
                    <input type="text" name="amount" size="5"  value="5" />
                    <select name="currency" style="margin-top:-1px;" id="currency">
                        <option value="USD" selected="selected">USD</option>
                        <option value="EUR">EUR</option>
                    </select>
                    <input type="hidden" name="confirmation_note" value="Thanks for your support!">
                    <br/><input class="spr_button button button-primary button-small" type="submit" value="Donate via Skrill">
                </form>
            </div>
        </div>
        <div class="postbox ">
            <h3 class="spr_widget_title">
                <span>Reset votes</span>
            </h3>
            <div class="inside">         
                <form method="post" onsubmit="return confirm('Do you really want to reset votes?')">
                    You can reset votes by pressing button below.<br/>
                    <input type="hidden" name="spr_reset_votes" value="1">
                    <input class="spr_button button button-primary button-small" type="submit" value="Reset votes">
                </form>
            </div>
        </div>
        <div class="postbox ">
            <h3 class="spr_widget_title">
                <span>Feedback</span>
            </h3>
            <div class="inside">         
                Found a bug? Or maybe have a feature request? Head over to <a href="http://wordpress.org/support/plugin/simple-rating">support forum</a> and let me know!
            </div>
        </div>
    </div>
    #144633
    jslom
    Participant

    @peterwsterling I will buy your plugin if instead of showing voters: blah blah it can show the sepcific voters for their votes..like

    Yes > voter: 1 23 34 4 536hgdfdh
    No > voters: rr gdfb ghdfhg
    Maybe > gdfsgdfs

    #143461

    In reply to: bbPress 2014 Survey

    Asynaptic
    Participant

    Thanks for doing this for bbPress as well. I hope we get some great feedback.

    May I suggest that a more granular approach would yield better information? I’m thinking of something like:
    http://www.wpsymposium.com/voting/

    Or a uservoice type feedback system where people can suggest ideas and others vote on them.

    While trac is great for measuring feature requests and bugs, it doesn’t measure intensity, immediacy and importance weights which users may attribute to individual features or bugs.

    #143311

    In reply to: Buddypress child theme

    GMarco24
    Participant

    Somebody votes for turning off cache plugins? 🙂
    Sorry, it’s cache…

    Asynaptic
    Participant

    @hillofbeans with respect, I don’t think that is what’s happening exactly. The bbpress team is not jumping up and down with joy to tackle this issue but as jjj said:

    bbPress and WordPress are designed to allow those with specific needs and wants to customize the codebase, and contribute the changes they needed up-stream to the parent project. If this is something multiple people would like, I suggest you group up and build it. If it works, and more people want it, we absorb it into bbPress core.

    This is why I searched and found previous discussions in the forum and a solution which was arrived at several years ago via a plugin (See above). It doesn’t seem like the creator of the plugin took it anywhere though, other than sharing it on the bbpress forums. They didn’t create a plugin officially at the plugin.wordpress.org or update it, etc.

    If I could make a constructive suggestion to the bbpress team, it would be that while they are very busy and it can seem like we are just throwing constant suggestions, critiques, etc. at them, it would be wise to set up a method to gauge the community’s interest or desire for specific issues.

    This can be done very simply with something like uservoice or similar ‘suggestion box’ apps where suggestions are shown and community members here can vote on them to show their interest towards them and move them up the priority list.

    I made a similar suggestion to the buddypress team and I read from jjj or boone that this inspired the recent survey (hopefully we’ll see the results of said survey soon!)

    That was great, btw! at the same time, a survey is a very short lived ‘snapshot’ whereas a uservoice type idea collector and sifter would be continuous

    of course, I’m not at all suggesting that we convert the bbpress or buddypress projects to ‘mob rule’! nope. just that when we have such a communication channel, things like this specific issue would be addressed (rather than linger for 7+ years) because there would be transparency and a collaboration between the wider community and the dev team

    🙂

    #137864
    derock299
    Participant

    hello Nuisere< i finally got it to work, I want to create another page for polls, so that people can vote….but I want it protected too, meaning you have to be a memeber and login just as i did for the forum page, any idea how to do that

    #137721

    In reply to: bbPress users URL

    0 down vote favorite

    I have the following bbPress rewrite rules:

    users/([^/]+)/edit/?$ index.php?bbp_user=$matches[1]&edit=1
    users/([^/]+)/?$ index.php?bbp_user=$matches[1]
    view/([^/]+)/page/?([0-9]{1,})/?$ index.php?bbp_view=$matches[1]&paged=$matches[2]
    view/([^/]+)/feed/?$ index.php?bbp_view=$matches[1]&feed=$matches[2]
    view/([^/]+)/?$ index.php?bbp_view=$matches[1]
    search/page/?([0-9]{1,})/?$ index.php?paged=$matches[1]

    $matches[1] = user_nicename

    Instead of user_nicename I would like to have display_name.

    I was playing in bbpress/includes/users/template-tags.php and managed to rewrite all user profile rules like I want, but when I access any of the user profile pages, the link (href) will disappear.

    I would like to know if there is a way to rewrite the above rules from functions.php file?

Viewing 25 results - 51 through 75 (of 230 total)
Skip to toolbar