1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Add-on "Post Ratings" to likes converter (CLI)

Discussion in 'Custom Service/Development Requests' started by allewreK, Nov 9, 2013.

  1. allewreK

    allewreK Active Member


    I am using for like 1 years this addon by @Luke Foreman : http://xenforo.com/community/resources/post-ratings-taking-likes-to-the-next-level.410/

    But I would like to switch back to the traditional like system because I think queries on a big board takes longer than XenForo's core likes.

    My problem is that I can't just disable the addon : if I do that my members will loose a lot of points and loads of evaluations will be lost.

    So I would like an importer, it would convert every "post rating" evaluation to a like AND update each members total like.

    If anyone is interested, tell me, I could pay. Since I have a lot of data, it would be safer (and easier) to do it as a CLI script.

    Hushero likes this.
  2. Luke F

    Luke F Well-Known Member

    The code to do this already exists in Dark_PostRating_Model::recountRatings, just a matter of commenting out the other bits and swapping the like rating id condition with a positive rating condition
    allewreK likes this.
  3. allewreK

    allewreK Active Member

    Really Luke ? I'm going to have a look to this, thanks you very much =D

    But will this work with a huge database ? I have a lot of users and rating... could their be a timeout if it is too long ?

    And will this remove old "post ratings" once converted to the traditional like system ? Because if it fails at 50% and I run again the import, the first 50% will get double like...
  4. allewreK

    allewreK Active Member

    Can you help me commenting out the other bits and swapping the like rating id condition with a posivite rating condition please ?
  5. Luke F

    Luke F Well-Known Member

    You can keep running it until it fully completes without any double likes occurring
    allewreK likes this.
  6. allewreK

    allewreK Active Member

    It would be safer removing imported likes on the go. But I trust you :)

    What code modification do I need to do in recountRatings ?
  7. allewreK

    allewreK Active Member

    Hey Luke, anything new ?
  8. allewreK

    allewreK Active Member

    Please Luke,

    What is the condition swap, and the code to comment out ?

Share This Page