Post Ratings - taking likes to the next level [Deleted]

Again i realize that the quote of a thread is calculated by the votes for the first post.
Lets see what is possible:

X writes a real nice article and 20 people say: I like it.
Now the thread has 20 thumbs up.

After the frist post we get 200 more posts from x, but people hate him for all the stupid things and vote 523 times with thumb up down in all the 200 posts after the first one.

Now we have still 20 thumbs up for the thread.


My solution:
1. Dont show the rating for the thread
2. Use another function/addon to rate the thread itself
3. A trigger for this addon to say: please calculate all votes for a value of the thread (every night a 4 by a cron-job)
 
Last edited:
Yes. But anyway there is no change for the thumbs for the thread. They are taken only from the first post. This makes sense only in some special situations. For example you have a hotel review in the first post and tell people to rate it only in the first post. But to show the "value" of a thread it should be voted by itself or as a calculation of all posts. (maybe the programer wants to add an option to do this someday ... :)
 
Can i use this with like/hide? For example user cant see content untill he do not push like button. I want something like like ratio watch, like recived=like give, how many like you recive the same number like you can give.
Is that possible with this plugin?
 
Is there or can there be a CLI rebuild of the ratings? We have been running the rebuild for 2 days now and are only half way through... 33 million of over 60 million posts.

Screen Shot 2017-02-17 at 11.01.08 AM.webp
 
Is there or can there be a CLI rebuild of the ratings? We have been running the rebuild for 2 days now and are only half way through... 33 million of over 60 million posts.

View attachment 148461

There is no CLI option but you can potentially speed up the process (at the risk of timeouts on a slow server) by raising the value of PER_PAGE at the top of /library/Dark/PostRating/Deferred/PostCache.php (and the other .php files, but PostCache is the one in your screenshot)

Addon is installed but rating options are not showing up. Permissions are all fine though.

Can you PM me admin CP details to take a look?

You might also want to triple check the permissions with /admin.php?permissions/analyze
 
There is no CLI option but you can potentially speed up the process (at the risk of timeouts on a slow server) by raising the value of PER_PAGE at the top of /library/Dark/PostRating/Deferred/PostCache.php (and the other .php files, but PostCache is the one in your screenshot)



Can you PM me admin CP details to take a look?

You might also want to triple check the permissions with /admin.php?permissions/analyze
Hello, sent! :)
 
There is no CLI option but you can potentially speed up the process (at the risk of timeouts on a slow server) by raising the value of PER_PAGE at the top of /library/Dark/PostRating/Deferred/PostCache.php (and the other .php files, but PostCache is the one in your screenshot)

Don't know if this is something that can be improved in a future update or if a different approach can be taken for a rewrite, if that happens for XF2... but this query that is a part of the rebuild process for post ratings is a beast.

Code:
# User@Host: root[root] @ localhost []
# Thread_id: 12900513  Schema: live_xf  QC_hit: No
# Query_time: 100.058259  Lock_time: 0.000040  Rows_sent: 20000  Rows_examined: 41121021
# Rows_affected: 0
SET timestamp=1487624154;
select
                                post.post_id, post.thread_id
                                , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 1) as dark_postrating_1_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 2) as dark_postrating_2_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 4) as dark_postrating_4_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 5) as dark_postrating_5_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 6) as dark_postrating_6_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 7) as dark_postrating_7_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 8) as dark_postrating_8_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 9) as dark_postrating_9_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 10) as dark_postrating_10_count
        ,
                        pr_cache.rating_cache,
                        pr2.rating, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 1) as dark_postrating_1_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 2) as dark_postrating_2_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 4) as dark_postrating_4_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 5) as dark_postrating_5_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 6) as dark_postrating_6_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 7) as dark_postrating_7_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 8) as dark_postrating_8_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 9) as dark_postrating_9_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 10) as dark_postrating_10_count

                        from xf_post AS post
                        left join dark_postrating_post_cache pr_cache ON (post.post_id = pr_cache.post_id)
                        left join dark_postrating pr2 on (post.post_id = pr2.post_id and pr2.user_id = 374904)
                        limit 41100000, 20000;
 
Bought that, have it running, love it. But have a couple of questions.

1. Doesn't it show in notifications panel when a user gets a like or dislike? I'm sure it did before with the stock likes but doesn't seem to be now..?!

2. Is there a way to send an email when a user gets a like / rating? (Let them turn it off via CP perhaps?)
 
Don't know if this is something that can be improved in a future update or if a different approach can be taken for a rewrite, if that happens for XF2... but this query that is a part of the rebuild process for post ratings is a beast.

Code:
# User@Host: root[root] @ localhost []
# Thread_id: 12900513  Schema: live_xf  QC_hit: No
# Query_time: 100.058259  Lock_time: 0.000040  Rows_sent: 20000  Rows_examined: 41121021
# Rows_affected: 0
SET timestamp=1487624154;
select
                                post.post_id, post.thread_id
                                , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 1) as dark_postrating_1_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 2) as dark_postrating_2_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 4) as dark_postrating_4_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 5) as dark_postrating_5_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 6) as dark_postrating_6_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 7) as dark_postrating_7_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 8) as dark_postrating_8_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 9) as dark_postrating_9_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 10) as dark_postrating_10_count
        ,
                        pr_cache.rating_cache,
                        pr2.rating, (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 1) as dark_postrating_1_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 2) as dark_postrating_2_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 4) as dark_postrating_4_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 5) as dark_postrating_5_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 6) as dark_postrating_6_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 7) as dark_postrating_7_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 8) as dark_postrating_8_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 9) as dark_postrating_9_count
        , (select count(*) from dark_postrating pr USE INDEX (`post_id_rating`) where pr.post_id = post.post_id and pr.rating = 10) as dark_postrating_10_count

                        from xf_post AS post
                        left join dark_postrating_post_cache pr_cache ON (post.post_id = pr_cache.post_id)
                        left join dark_postrating pr2 on (post.post_id = pr2.post_id and pr2.user_id = 374904)
                        limit 41100000, 20000;


Yes there is room for improvement in that query, it doesn't seem to have an order by and could benefit from an early-out on unrated posts. I will revisit it in the 2.0 update

Bought that, have it running, love it. But have a couple of questions.

1. Doesn't it show in notifications panel when a user gets a like or dislike? I'm sure it did before with the stock likes but doesn't seem to be now..?!

2. Is there a way to send an email when a user gets a like / rating? (Let them turn it off via CP perhaps?)

1. It should show an alert as before, check you have not changed any settings related to alerts in the Post Ratings admin cp options

2. Unfortunately this is not possible, but you may be able to find a 3rd party addon that sends an email on alerts
 
@Luke F

I used the query suggested on page 1 of this discussion to remove ratings received from a banned member so they do not display on the most notable pages if banned.

Can you suggest a modification I can do to the query for most notable listing that would pass over a banned member so it does not display there, without myself having to run a query to remove the ratings received by that member?
 
So, not sure if this is on my end or not. I am doing a site makeover, starting from scratch. When I went to go find Post Ratings download in my email I received this error, very confused now.

upload_2017-3-5_3-20-58.webp
upload_2017-3-5_3-21-33.webp
upload_2017-3-5_3-21-58.webp
Little help would be greatly appreciated!
 
So, not sure if this is on my end or not. I am doing a site makeover, starting from scratch. When I went to go find Post Ratings download in my email I received this error, very confused now.

View attachment 149353
View attachment 149354
View attachment 149355
Little help would be greatly appreciated!

Gmail has frustratingly started blocking .js attachments in emails, even when inside zip files, and even retroactively.

If you PM me your purchase email address I will get the latest version sent to you that includes a fix for this (JS stored as .txt and renamed by install script)
 
Yes there is room for improvement in that query, it doesn't seem to have an order by and could benefit from an early-out on unrated posts. I will revisit it in the 2.0 update

Luke, can you revisit for Version 2, so that all positive ratings are rated as a like within the Xenforo dbase.
 
Top Bottom