Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey sorry just seen this…

    $.fn.kkstarratings.click = function(obj, stars)
    {
    //////////////////.................
    }

    This means to replace the entire function…so look for that line:
    $.fn.kkstarratings.click = function(obj, stars), then follow it’s opening curly brace, right the way down to its matching closing brace..

    so there’s a lot in between the two…I don’t know the line, I haven’t looked at this for a long time.

    Hi needed this too! This requirement is not part of the plugin, but I’ve found an easy hack that does the job!

    1. Open the kk-star-ratings folder, and open up index.php

    2. Look for the line below. It’s the last line in the function js() (near the top). In the version of this plugin I am using (2.4), the line you want is 71:

    $this->enqueue_js('js', self::file_uri('js.min.js'), $this->ver, array('jquery'), $Params, false, true);

    3. Replace the above line with this:

    if (is_user_logged_in())
    {
       $this->enqueue_js('js', self::file_uri('js.min.js'), $this->ver, array('jquery'), $Params, false, true);
    }
    else {
          $this->enqueue_js('js', self::file_uri('js.js'), $this->ver, array('jquery'), $Params, false, true);
    };

    4. Within the kk-star-ratings folder, open up js.js

    5. Replace this function (line 129)

    $.fn.kkstarratings.click = function(obj, stars)
    {
    //////////////////.................
    }

    with this:

    $.fn.kkstarratings.click = function(obj, stars)
    	{
    
                    alert("You must be registered to vote");
    
    		return false;
    	};

Viewing 2 replies - 1 through 2 (of 2 total)