Adding Custom Reputation

4.74K viewsGeneral
1

I’m stumped, I know I can add a custom reputation option via Anspress > Reputation.

But how do I use this in a function?

 

I’ve already got a button hooked up to ajax, so a function is called on click. I just need to have it trigger the action/hook/filter to register the extra reputation but despite trawling through the code, docs, support I can’t find anything to work out what’s required to connect the custom rep event and the code I have.

Any suggestions or examples would be very, very helpful.

0

Hello Alex,

Check this file:

https://github.com/anspress/anspress/blob/master/addons/free/reputation.php#L192

commented on answer

Ah, nice, thanks. Can you tell me, does this include handing duplicates? So if I were to add rep for a user for post x, then tried to add it again, would it let me?

(Also does the post have to be a real post ID, or could it signify something else i.e. a unique id in a separate database table column ).

You have to check duplicates before adding new reputation. Our reputation function does not check for duplicates.

You are viewing 1 out of 1 answers, click here to view all answers.