Jump to the post that solved this thread.
Solved: 1 Year, 11 Months, 3 Weeks ago Question about modifying OUGC Custom Reputation
#1
Solved: 1 Year, 11 Months, 3 Weeks ago
I want to modify it to

1. Only show up in specific forums

2. Only show for the first post

3. Give a custom rating based on reputation... so someone with 100rep would give +5, but someone with 0rep would only give +1

4. Be able to write a PHP script to read the ratings

5. Be able to lock the ratings for a thread



It seems like the instructions say that it can do 1,2 and 5

5.
Quote:Deactivate ratings without missing data.

2.
Quote:Activate only for first post or for all posts on a per rating basis.
1.
Quote:Display ratings inside the forum display thread listing for specific forums.




How difficult would it be to do 3 and 4? For someone with no PHP experience...

Ok i'm gonna try to investigate this myself...

I'm scared (serious) xD

Ok I just downloaded it this is awesome... (first plugin i've downloaded)
Reply
#2
Solved: 1 Year, 11 Months, 3 Weeks ago
Quote:5. Be able to lock the ratings for a thread

Quote:Deactivate ratings without missing data.

This means you can disable any rating altogether and activate it back later, not necessarily in a per thread basis but globally.

IIRC users can rate closed threads, so that would be the only way to block rating specific threads.

Quote:4. Be able to write a PHP script to read the ratings

Take a look at the code that builds the profile stats, so you are able to code your desired script.

Quote:3. Give a custom rating based on reputation... so someone with 100rep would give +5, but someone with 0rep would only give +1

Should be possible by hooking at ouc_customrep_insert_log or simply modify $reptype right after this line.

But it seems I did put some limits, as you can see in the following lines:
https://github.com/Sama34/OUGC-Custom-Re....php#L2604
https://github.com/Sama34/OUGC-Custom-Re....php#L2080

To update the DB structure simply edit the second link line, deactivate, and activate back. But you will need to keep this change on mind if you ever update as you might lose data if I don't increase the allowed value myself.
Reply
#3
Solved: 1 Year, 11 Months, 3 Weeks ago
(2020-09-29, 08:45 PM)Omar G. Wrote:
Quote:5. Be able to lock the ratings for a thread

Quote:Deactivate ratings without missing data.

This means you can disable any rating altogether and activate it back later, not necessarily in a per thread basis but globally.

IIRC users can rate closed threads, so that would be the only way to block rating specific threads.

Quote:4. Be able to write a PHP script to read the ratings

Take a look at the code that builds the profile stats, so you are able to code your desired script.

Quote:3. Give a custom rating based on reputation... so someone with 100rep would give +5, but someone with 0rep would only give +1

Should be possible by hooking at ouc_customrep_insert_log or simply modify $reptype right after this line.

But it seems I did put some limits, as you can see in the following lines:
https://github.com/Sama34/OUGC-Custom-Re....php#L2604
https://github.com/Sama34/OUGC-Custom-Re....php#L2080

To update the DB structure simply edit the second link line, deactivate, and activate back. But you will need to keep this change on mind if you ever update as you might lose data if I don't increase the allowed value myself.

Thank u !!! Smile Smile Smile and awesome addon
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)