Difference between revisions of "Moderation Functions"

From GeeklogWiki
Jump to: navigation, search
m (Reverted edit of Icq628, changed back to last version by Tomw)
m (Fixed formatting)
Line 45: Line 45:
 
<tr>
 
<tr>
 
   <td valign="top" class="codeheader">plugin_moderationvalues_&lt;plugin name&gt;</td>
 
   <td valign="top" class="codeheader">plugin_moderationvalues_&lt;plugin name&gt;</td>
   <td valign="top" class="code">Returns the primary key column name, the main  
+
   <td valign="top" class="code">Returns the primary key column name, the main table name (called &lt;plugin name&gt;) and the list of fields from that table that you'd like to have show up on the moderation page.</td>
    table name (called &lt;plugin name&gt;) and the list of fields from that  
 
    table that you'd like to have show up on the moderation page.</td>
 
 
   </tr>
 
   </tr>
 
</table>
 
</table>
 +
  
 
[[Category:Plugin Development]]
 
[[Category:Plugin Development]]

Revision as of 07:42, 6 May 2009

First note that there are limitations in the current Geeklog codebase that will force you to name your plugin tables used for submission in a specific manner.  All moderated Geeklog items such as stories and links are comprised of two tables.  The first is a main table where all visible items are stored.  The second is a submission table where submitted user items sit until an administrator approves them.  When approved the item is moved from the submission table to the main table.  So for example, if you are writing a book review plugin that allows users to submit book reviews then we will pick bookreviews for your main table (this MUST also be your plugin name you pick) and then your submission table MUST be named bookreviewssubmission.  Why force the names? Because in the geeklog code the submission table for all stories is coded as <main name>submission.  So since we picked bookreviews for our main table (and plugin name) the submission table must be named  bookreviewssubmission.

If you want your plugin to be moderated like Geeklog stories and links then you must implement these functions.</p>

Table 1. Moderation functions
Function Description of Function
plugin_submit_<plugin name> Shows the submission form for your plugin.
plugin_itemlist_<plugin name> Shows any items needing moderation for your plugin on moderation.php
plugin_savesubmission_<plugin name> Saves submitted item from a user in <plugin name>submission table
plugin_moderationdelete_<plugin name> Takes an ID into <plugin name>submission table and deletes it
plugin_moderationapprove_<plugin name> Takes an ID into <plugin name>submission and moves it to the main table called <plugin name>
plugin_moderationvalues_<plugin name> Returns the primary key column name, the main table name (called <plugin name>) and the list of fields from that table that you'd like to have show up on the moderation page.