Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
SimplePress 5 - CubePoints Integration Plugin
Avatar
cubehouse
Member
Free Members
sp_UserOfflineSmall Offline
Jul 6, 2011 - 4:59 pm

I'm actually getting $newpost['poststatus'] = 0 all the time. Even though it's posting correctly D:

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 6, 2011 - 5:28 pm

whoops. have that backwards..... posts needing moderation have post_status == 1 Wink

and only posts required by your permissions to be moderated will go through moderation...

Avatar
cubehouse
Member
Free Members
sp_UserOfflineSmall Offline
Jul 6, 2011 - 6:15 pm

haha, great, that explains a *lot*

Avatar
cubehouse
Member
Free Members
sp_UserOfflineSmall Offline
Jul 7, 2011 - 9:57 am

Ok, I'm trying to use the "sph_post_delete" hook. It returns a single integer which is the post_id that just got deleted.

Any thoughts on the best way of pulling the user_id from that? Or is there a more sensible hook?

Edit: Also, I think "sph_topic_delete" doesn't call the "sph_post_delete" hook for each post? Should this be a separate case?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 7, 2011 - 11:37 am

try an svn up...

have updated both hooks... 

the post delete hook will now pass an object of the post row that was deleted...

the topic delete hook will now pass an object with all the post rows that were deleted...

you can get what you need from them...

but yes, delete topic and delete posts are two different things... easier/quicker/more efficient to delete a topic then delete each post individually...

for some points implementations, you get more points for starting at topic than replying... Wink

one word of caution - not sure you care...  but, if you delete a post, and its the only post in that topic, you will instead get a topic deletion hook fired and not the post deletion hook...

Avatar
cubehouse
Member
Free Members
sp_UserOfflineSmall Offline
Jul 7, 2011 - 11:48 am

Spotted you're using poststatus in post_new and post_status in post_remove

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 7, 2011 - 12:13 pm

sorry, not following you...

Avatar
cubehouse
Member
Free Members
sp_UserOfflineSmall Offline
Jul 7, 2011 - 12:23 pm

The objects returned by the post_create and post_delete hooks are using different object naming conventions. create uses poststatus, userid etc. and delete uses post_status, user_id etc.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jul 7, 2011 - 12:28 pm

oh, the creation is just a variable name... the deletion is the actual column in the db table...

Avatar
cubehouse
Member
Free Members
sp_UserOfflineSmall Offline
Jul 7, 2011 - 4:28 pm

Updated plugin:

http://cubehouse.org/blog/wp-c.....Points.zip

Features:

  • Configurable points awarded for new posts and topics
  • Configurable choice to log details to the CubePoints log file
  • Choose if you want to remove points when deleting posts and topics
  • Fail-safe detection of CubePoints plugin, will give warning if required plugin not found
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625