Topic RSS
no access to code currently – at work.. so cant tell where you ahve the hook…
in sf-post.php there is two code sections, one for new topics and one for new posts… make sure you didnt put it in the new topics section…
Giving points for topic creation and replies works now! Even logging works within cubepoints :D
But when I delete a post/topic. It deletes the points from my account and not from the user that replied in the topic, lol. Any ideas?
how did you do the delete?? you probably need to modify the deletion code put in the delete hook and make sure its using the right id…
This is in my sf-hook-template.php file. How would I make sure it's deleting the points from the user that posted in the forum?
function sf_hook_topic_delete($topicid, $forumid)
{
if( function_exists('cp_alterPoints') && is_user_logged_in() ){
cp_alterPoints(cp_currentUser(), -20);
cp_log('Forum Reply Deleted', cp_currentUser(), -20, Forum);
}
return;
}
function sf_hook_post_delete($postid, $topicid, $forumid)
{
if( function_exists('cp_alterPoints') && is_user_logged_in() ){
cp_alterPoints(cp_currentUser(), -5);
cp_log('Forum Reply Deleted', cp_currentUser(), -5, Forum);
}
return;
}
when you delete the topic or post, you need to grab the poster id and return that to the alter points instead of the current user…
you have the postid and topic id, so do a db query to grab the poster id…
I updated my code. Still not deducting points from the forum poster.
I dont know how that cubepoints works, but…
the first one, why would you check logged in??? that would require the topic starter to be logged in for points to be deducted… and do you want to deduct just for the topic starter or all posters in the topic?
the second one, you are checking the topics table, but you want to check the posts table and the post id… and same question about logged in check…
True, you wouldn't need to check if they are logged in for deletion of forum topics/replys.
topic?
I guess the topic starter.
Most Users Ever Online: 444
Currently Online: Yellow Swordfish, SPQC, steve.engelking, irlandes1, MacBravO
54 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
-Radio-: 1251
Lee H: 606
Luffer: 535
Conrad_Farlow: 502
jim: 478
neon: 263
ovizii: 240
Tal: 240
Member Stats:
Guest Posters: 2626
Members: 7363
Moderators: 1
Admins: 2
Forum Stats:
Groups: 5
Forums: 16
Topics: 10895
Posts: 79576
Newest Members: Rick Thomas, joelrob, ndc, MacBravO, irlandes1, triphop, betokan, Jonathan Yovani Muñoz, somosguatemala, ahcreate
Moderators: Brandon C (162)
Administrators: Yellow Swordfish (22236), Mr Papa (23688)
Log In
Register
Home
Add Reply
Add Topic
Offline




Quote
Visit

Privacy Policy
Yellow Swordfish


