• REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Implemented Allow the creator to rate the item?

Russ

New Member
AMS Premium
CAS Premium
EMS Early Adopter
IMS Premium
LD Premium
RMS Premium
SC Premium
UBS Premium
Am I missing an option or is it not built it but is there a way to allow whoever creates the item can put a star rating on it?

If not is it an easy fix by chance?
 
Upvote 0
This suggestion has been implemented. Votes are no longer accepted.
Its done that way on purpose... just like you can't rate your own Resource. Its meant for others to Rate your item.

Its driven off the method NFLJ_Showcase_Model_Item::canRateItem

If you want Item Owners to be able to rate their own item you'll need to replace this method.

edit the file /library/NFLJ/Showcase/Model/Item.php

find this (around line 1013)
PHP:
    public function canRateItem(array $item, array $viewingUser = null)
    {
        $this->standardizeViewingUserReference($viewingUser);
       
        if ($item['user_id'] == $viewingUser['user_id'])
        {
            return false;
        }
       
        if (XenForo_Permission::hasPermission($viewingUser['permissions'], 'nfljsc', 'canRateItem'))
        {
            $hasRated = $this->hasRated($viewingUser['user_id'], $item['item_id']);
           
            if ($hasRated)
            {
                return false;
            }   
           
            return true;
        }
       
        return false;
    }

Replace the above method with this one:
PHP:
    public function canRateItem(array $item, array $viewingUser = null)
    {
        $this->standardizeViewingUserReference($viewingUser);
       
        if (XenForo_Permission::hasPermission($viewingUser['permissions'], 'nfljsc', 'canRateItem'))
        {
            $hasRated = $this->hasRated($viewingUser['user_id'], $item['item_id']);
           
            if ($hasRated)
            {
                return false;
            }   
           
            return true;
        }
       
        return false;
    }
 
I've moved this into suggestions and marked it "Considered" as I think it would be useful to some people if I added in another permission 'Can Rate Own Item" which I will then integrate into the above method. That way those that want to have that option can not only have it, but it also gives them the option to enable/disable per user group as well. Also means you won't have to modify any code in future releases ;)
 
Thanks, the thought of it from my perspective would be I think the owner should have a say in what he thinks the item should be rated as(in his/her opinion). Thanks for the fix though :)
 
Thanks, the thought of it from my perspective would be I think the owner should have a say in what he thinks the item should be rated as(in his/her opinion). Thanks for the fix though :)

agreed...Its already done and will be included in the next release :)
 
I actually made it so that Item Owners are able to rate their own Item but others cant (in case of wanting to do review style rating).

Two permissions now drive the system:

Rate Items
Rate Own Item

If Rate Items is set to no and Rate Own Item is set to Allow, then the Item Owner can rate the item once.
If Rate Items is set to Allow and Rate Own Item is set to no, then members can rate, by the item owner can not.
If both are set to allow, then both the Item Owner and members can Rate the item.
If neither are set, then neither can rate.
 
I actually made it so that Item Owners are able to rate their own Item but others cant (in case of wanting to do review style rating).

Two permissions now drive the system:

Rate Items
Rate Own Item

If Rate Items is set to no and Rate Own Item is set to Allow, then the Item Owner can rate the item once.
If Rate Items is set to Allow and Rate Own Item is set to no, then members can rate, by the item owner can not.
If both are set to allow, then both the Item Owner and members can Rate the item.
If neither are set, then neither can rate.

Awesome Bob, that will help so much, thanks for being on top of this!
 
Back
Top