Difference between revisions of "Moderation Functions"

From GeeklogWiki
Jump to: navigation, search
m (wikified - no change in content)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
First note that there are limitations in the current Geeklog codebase that  
+
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  
will force you to name your plugin tables used for submission in a  
+
table. So for example, if you are writing a book review plugin that allows users to submit book reviews then we will pick <tt>bookreviews</tt> for your main table (this '''must''' also be your plugin name you pick) and then your submission table '''must''' be named <tt>bookreviewssubmission</tt>.
specific manner.&nbsp; All moderated Geeklog items such as stories and  
 
links are comprised of two tables.&nbsp; The first is a main table where  
 
all visible items are stored.&nbsp; The second is a submission table where  
 
submitted user items sit until an administrator approves them.&nbsp; When  
 
approved the item is moved from the submission table to the main  
 
table.&nbsp;    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.&nbsp; Why
 
force the names? Because in  the geeklog code the submission table for all
 
stories is coded as &lt;main  name&gt;submission.&nbsp; So since we picked
 
bookreviews for our main table  (and plugin name) the submission table
 
must be named&nbsp; bookreviewssubmission.
 
  
If you want your plugin to be moderated like Geeklog stories  
+
Why force the names? Because in the Geeklog code the submission table for all stories is coded as <tt>&lt;main name&gt;submission</tt>. So since we picked
and links then you must implement these functions.</p>
+
<tt>bookreviews</tt> for our main table (and plugin name) the submission table
 +
must be named <tt>bookreviewssubmission</tt>.
 +
 
 +
If you want your plugin to be moderated like Geeklog stories and links then you must implement these functions:
  
 
<table cellpadding="2" cellspacing="2" border="1" width="90%" align="center">
 
<table cellpadding="2" cellspacing="2" border="1" width="90%" align="center">
Line 45: Line 35:
 
<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]]
 
--------------
 
==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]
 

Latest revision as of 18:20, 18 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:

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.