Difference between revisions of "Moderation Functions"

From GeeklogWiki
Jump to: navigation, search
m (Reverted edit of Icq628, changed back to last version by Tomw)
Line 52: Line 52:
  
 
[[Category:Plugin Development]]
 
[[Category:Plugin Development]]
 
--------------
 
==link==
 
[http://ganzao.68l.com dry]
 
[http://ganzao.68l.com/map.htm map]
 
[http://ganzao.68l.com/index.htm index]
 
[http://ganzao.68l.com/ganzao.htm ganzao]
 
[http://ganzao.68l.com/liuhecai/liuhecai.htm liuhecai]
 
[http://ganzao.68l.com/liuhecai/liuhecai518.htm liuhecai518]
 
[http://ganzao.68l.com/tuliao/tuliao.htm tuliao]
 
[http://ganzao.68l.com/tuliao/tuliaojieshao.htm tuliaojieshao]
 
[http://ganzao.68l.com/dengju/dengju.htm dengju]
 
[http://ganzao.68l.com/cryp/chengrenyongping.htm chengrenyongping]
 
[http://ganzao.68l.com/cryp/cryp1.htm cryp1]
 
[http://ganzao.68l.com/sljx/suliaojixie.htm suliaojixie]
 
[http://ganzao.68l.com/jiansuji/jiansuji.htm jiansuji]
 
[http://ganzao.68l.com/wajueji/wajueji.htm wajueji]
 
[http://ganzao.68l.com/yimin/yimin.htm yimin]
 
[http://ganzao.68l.com/tanhuang/tanhuang.htm tanhuang]
 

Revision as of 18:42, 11 December 2004

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.