From: Oscar Renalias <phunkphorce@us...> - 2004-04-21 18:45:32
Update of /cvsroot/plog/plog/class/controller
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17379/class/controller
Added support for custom fields
Custom fields can be used to add fields for certain functions that we would like to have in each post. For example,
we can add a custom field called "I'm feeling" (Ã¡la Livejournal) and plog will automatically display a textbox
in the "New Post" page so that we can assign a value to that field. The value of the field will be stored
in the database, with a reference to the article. The we only need to make certain modifications to the templates
to make them show the values of those fields, using very simple methods such as
And so on.
At the moment it works but the following items are still lacking:
- support for removing fields
- support for editing fields (name, description, etc)
- fields can only be used when adding a new post. If the "preview" functionality is used,
the value of the field will be lost and it will have to retyped again.
- When editing the field, is not possible to get the value of the fields.
- It is not integrated with the search feature.
All these shortcomings will be fixed as soon as I have the time :)
There are two new talbes in the database: one to hold the definition of each field (name, description, type), and
another one to hold the values given to those fields for each article. In order to get it working, please rerun the
wizard script so that the new tables are initialized. Also, have a look at the templates/blueish/post.template
for an example of how to show the values of the fields.
RCS file: /cvsroot/plog/plog/class/controller/admincontrollermap.properties.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** admincontrollermap.properties.php 18 Apr 2004 18:09:56 -0000 1.16
--- admincontrollermap.properties.php 21 Apr 2004 18:44:50 -0000 1.17
*** 256,258 ****
--- 256,264 ----
// null action
$actions["emptyAction"] = "AdminEmptyAction";
+ // show the form to add a new custom field
+ $actions["newCustomField"] = "AdminNewCustomFieldAction";
+ // add the custom field
+ $actions["addCustomField"] = "AdminAddCustomFieldAction";
+ // list the custom fields
+ $actions["blogCustomFields"] = "AdminBlogCustomFieldsAction";