Support > cpg1.5 plugins

Plugin hook suggestions for cpg1.5.x

<< < (7/7)

gmc:

--- Quote from: Αndré on February 11, 2014, 08:55:40 am ---Without reviewing the core code parts or your patch file yet, some hook names should be replaced in my opinion:


* Replace comment_posted_anonymous and comment_posted_registered with comment_posted, or is there a good reason to use 2 different hook names?

* Replace comment_approval_processed and comment_multiple_approvals with comment_approved, or is there a good reason to use 2 different hook names?
--- End quote ---
Thanks for the input...
For #1, I can easily change to one name.  I didn't need the distinction, was just thinking about other possible uses, but enough data is passed (or will be in next revision) for the plugin to easily determine if needed.

For #2, the parameters passed are quite different... (as is the core code)
For single comment, I was passing the 'single approval array' from base code while for the multiple, an array containing 2 strings - list of approved and list of rejected as generated by the base code...  I could reformat the single case to look like the multiple if a single hook name is desired...

I'll do a little testing with it and post a revised patch.

gmc:
Revised proposal:
Looking for hookpoints in db_input.php and reviewcom.php...
A zip of patch file based on SVN 8668 is attached to detail my thoughts.  All 'action' plugins with no data returned.
Addition of 3 hookpoints:

    'comment_updated' in db_input.php - called when an existing comment is updated in database
    'comment_posted' in db_input.php - called when a comment is inserted to the database
    'comment_approvals' in reviewcom.php - called when a comment(s) are approved/rejected with list of approved/rejected comments

I've syntax checked - but haven't yet written the plugin code to process (convert existing mod code with some additional features)...
If acceptable to add these hooks, I will proceed.
Greg

Αndré:
I slightly renamed all hooks and the variable names of the comment_approve hook (formerly comment_approvals) for consistency reasons. Patch file attached.

I had no closer look at the hooks (i.e. if the submitted data is sufficient), so please report if we can use them as they are and I'll commit them to our SVN repository.

gmc:
Modifications look fine (of course :) )
Name changes are fine in hooknames and variables (I almost made that variable change myself... ) - and moving cpg_db_last_insert_id() into the API call makes sense over a separate assignment.

Plugin now on the 'todo' list... :)

Αndré:
Added plugin hooks 'comment_update', 'comment_add' and 'comment_approve' in SVN revision 8671.

Navigation

[0] Message Index

[*] Previous page

Go to full version