Note: This is for CubePoints 3.0 and above
I’ve made this a little easier, no need to edit core files anymore. First do the following:
Find the file sf-hook-template.txt (simple-forum/forum/hooks/sf-hook-template.txt) and rename it to sf-hook-template.php. Save it in the same directory that sf-hook-template.txt was located in.
Search for this:
function sf_hook_post_save($newpost, $action) {
Add this code right after that. The 25 is for how many points a new forum topic is worth and 5 is for a new reply in a existing topic.
global $current_user; if ($action=="topic") { cp_points('cp_spf_new_topic', cp_currentUser(), get_option('cp_spf_new_topic'), ""); } if ($action=="post") { cp_points('cp_spf_new_reply', cp_currentUser(), get_option('cp_spf_new_reply'), ""); }
Last step is saving extendcb.txt and renaming it as extendcb.php and placing it in this folder.
/wp-content/plugins/cubepoints/modules/
Then activate the module from the CubePoints Modules Page.
NOTE: THE BELOW ONLY WORKS ON CUBEPOINTS 2.1.4 OR BELOW
Want to give points for people that contribute to your Simple:Press Forum (SPF) using CubePoints? I’ve been using this method for the past few versions of SPF and it still works. Only downside is that you need to edit the file again after you upgrade SPF. It’s actually pretty easy, you just need to modify 1 file.
Go to /wp-content/plugins/simple-forum/library/sf-post.php
Since line numbers may change from version to version. Just search for this in the code:
# save the new topic record to dbHere is the original:
# save the new topic record to db $newpost = sf_write_topic($newpost); if(!$newpost['db']) { update_sfnotice('sfmessage', __("Unable to Save New Topic Record", "sforum")); return; } else { # lets grab the new topic id $newpost['topicid'] = $wpdb->insert_id; }
Here is the modified code chunk:
# save the new topic record to db $newpost = sf_write_topic($newpost); if(!$newpost['db']) { update_sfnotice('sfmessage', __("Unable to Save New Topic Record", "sforum")); return; } else { # lets grab the new topic id $newpost['topicid'] = $wpdb->insert_id; // Cubepoints Support if( function_exists('cp_alterPoints') && is_user_logged_in() ){ cp_alterPoints(cp_currentUser(), 25); cp_log('Forum Topic Creation', cp_currentUser(), 25, Forum); } }
Now users will get 25 points for a creating a topic in your forum.
With Simple:Press Forum when topics/replies are added there is a pop-up message. I like to edit this saying how many points they earned.
Search for this:
update_sfnotice('sfmessage', '0@'.__("New Topic Saved", "sforum").$newpost['submsg'].' '.$newpost['emailmsg']);
This is how I edited mine:
update_sfnotice('sfmessage', '0@'.__("New Topic Saved and 25 Points Earned", "sforum").$newpost['submsg'].' '.$newpost['emailmsg']);
Next we need to give points for regular replies. Search for this:
# Write the postHere is the original:
# Write the post $newpost = sf_write_post($newpost); if(!$newpost['db']) { update_sfnotice('sfmessage', __("Unable to Save New Post Message", "sforum")); return; }
Here is the modified code chunk:
# Write the post $newpost = sf_write_post($newpost); if(!$newpost['db']) { update_sfnotice('sfmessage', __("Unable to Save New Post Message", "sforum")); return; } else { // Cubepoints Support if( function_exists('cp_alterPoints') && is_user_logged_in() ){ cp_alterPoints(cp_currentUser(), 5); cp_log('Forum Reply', cp_currentUser(), 5, Forum); } }
Pop up message for adding a reply.
Original:
update_sfnotice('sfmessage', '0@'.__("New Post Saved", "sforum").$newpost['submsg'].' '.$newpost['emailmsg']);
Modified:
update_sfnotice('sfmessage', '0@'.__("New Post Saved and 5 Points Earned", "sforum").$newpost['submsg'].' '.$newpost['emailmsg']);
If you want to change how many points are given change only the number values above and NOTHING else. I have this working with the latest version of Simple:Press Forum (4.2.2) and CubePoints (2.1.1) running WordPress 2.9.2
Download CubePoints | Download Simple:Press Forum
Thanks to the support at Simple:Press Forum for helping me and others figure this out.

May 13th, 2010 on 6:14 am
Thanks a lot for this! This is awesome! One question though, the number of points awarded for these two things, does that show up anywhere? For e.g. in the cubepoints “configure” tab it mentions how many points users get for each action. Does this show up like that anywhere or is it a background thing?
Thanks again.
May 13th, 2010 on 12:52 pm
No it doesn’t show up in the config screen on CubePoints, it’s just a background thing. But it does show up in the CubePoints logs.
July 10th, 2010 on 9:13 pm
WOW!
Works like a charm, thank you!
Stang
August 16th, 2010 on 5:59 pm
Thank you very much for this info. i’ve done what you put and it works perfectly.
I was wondering if there was away to subtract points from the profile if admin had to delete the topic or post due to spam content.
August 16th, 2010 on 6:03 pm
@Twisted Fang That’s still something I’m trying to figure out. Once I figure it out I’ll update this post. I haven’t had a spam issue (knock on wood) yet.
When I tried some things it would delete the points from the admin or moderator instead of the user. If you have any ideas lets hear it
August 16th, 2010 on 6:18 pm
LOL, ya I tried a few things as well and it pulled the points from me instead of the Original poster.
the current user part must be the culprit.
wonder if there is some sort of id tracker for the forum that could be used?
August 16th, 2010 on 6:25 pm
Look at this forum topic, let me know of any ideas. So we need to find the user id of the poster. I’m xberserker over there btw.
http://simple-press.com/support-forum/spf-version-4/integrating-cubepoints-into-simplepress-40/page-3/
August 16th, 2010 on 7:45 pm
well, I have it so it works when deleting a post. But it’s not working on deleting a topic
October 6th, 2010 on 5:58 pm
I think the latest integration update broke this function. I double check my file, and the changes are still there. Anyone else see this?
Stang
October 6th, 2010 on 6:02 pm
@Stang5_0 I’m on the current version of CubePoints Buddypress Integration (1.7.6.6) and my members still get points for new forum topic/replies in the simple press forum.
I have thought about including a field in the plugin to update the values from there if there is interest in that.
October 26th, 2010 on 7:20 pm
Thanks SlySpyder! This is exactly what I was looking for. Works great.
December 23rd, 2010 on 5:09 pm
Thanks, i will try to do on My installation version with WPMU 1.2.6 to 3.3 bp BP-default theme and simple press forum 4.3.5 (activated, but not the entire network activated)-language es_ES
.. and i will back to tell about.
thanks.
December 23rd, 2010 on 5:14 pm
PERFECT !!! Work very well with the last versions.
Thanks you very much to all
March 5th, 2011 on 6:09 pm
Hi,
Thank you for this great plugin! I am trying to add the CubePoints rating beneath the user avatar inside the Simple Press. I am totally lost. Hopefully you can help
March 7th, 2011 on 1:46 pm
I’m not sure how to do this, I’d post a topic in the simple press support forums about it.
June 17th, 2011 on 5:42 am
Thanks so much for this tip… I just integrated it into my site and I tested it by adding a new post and replying to a post… got my 25 and 5.
Take care!
-Anthony
July 6th, 2011 on 1:24 pm
It’s not working for me. Activates fine in cubepoints, but the points aren’t being added. Any thoughts?
July 6th, 2011 on 4:46 pm
Did you follow the first part of the directions? The module alone won’t cut it.
July 23rd, 2011 on 12:37 am
I just implemented Cubepoints for SimplePress and Buddypress and I noticed that in the under “My Points” it does not show a Description. How can I set this up?
July 25th, 2011 on 1:06 pm
I never looked into that, if I figure it out I’ll update this post.
September 7th, 2011 on 5:41 pm
I have just completed everything you listed in the top instructions and I am getting this error:
Warning: Cannot modify header information – headers already sent by (output started at /home/beta/public_html/wp-content/plugins/simple-forum/forum/hooks/sf-hook-template.php:1) in /home/beta/public_html/wp-includes/pluggable.php on line 934
Let me make sure I did it right. I changed sf-hook-template.txt to sf-hook-template.php and added your code in the appropriate space. I created the modules file and added it as well. The module worked and I activated it in cubepoints admin. Now the whole forum does not show up.
I have version 4.4.5 of simple press running and version 3.0.3 cube points.
Any ideas?
September 7th, 2011 on 6:37 pm
Nevermind I got it working. I must have done something to the sf-hook-template.php file. I ended up downloading a fresh sf-hook-template.txt and then changed it and fixed the issue.
September 7th, 2011 on 7:56 pm
Sorry to bother you again….I have a question. Is there a way to limit how many posts per day that a user can get points when posting in the forums? I want to deter spamming the forums to build points.
September 7th, 2011 on 8:02 pm
Not that I’m aware of. But doesn’t mean it’s not possible. Good place to ask is the official CubePoints support forum – http://cubepoints.com/forums
December 2nd, 2011 on 6:09 pm
i have a problem with simple press 4.4.5 and cubepoints 3.
I see your description for configurated but should not be.
And after this problem,i have other problem,how can i see photo and username in widget?
Please help
December 2nd, 2011 on 6:29 pm
Not sure about the widget. Try posting on cubepoints.com
On simple:press 4.4.5 it should work. Do it award points at least. Did you use a code editor? If so which one?
March 2nd, 2012 on 10:53 am
Does anyone know if this works on the new simplepress? (5.0)
Thanks