Multiple Categories
| General Plugin info | |
|---|---|
| Author: | Anand |
| Current Version: | 0.1 / 0.5.1j |
| Download: | - |
| Code: | 0.1:PluginCode 0.5.1j: PluginCode |
| Demo: | - |
| Forum Thread: | - |
Save the 0.1 PluginCode/0.5.1j PluginCode as NP_MultipleCategories.php in your plugins folder.
v. 0.5.1j: Save the folder “multiplecategories” to your plugins folder.
v. 0.1: If you want to make it work for existing items, you must open ITEM.php in your libs folder and make a change. At around 156 you will find a call to PreUpdateItem which will be followed by a query for updating the item. After that line, add the following line,
$manager->notify('PostUpdateItem',array('itemid' => $itemid));
So after editing my item.php looks like,
$manager->notify('PreUpdateItem',array('itemid' => $itemid, 'title' => &$title, 'body' => &$body, 'more' => &$more, 'blog' => &$blog, 'closed' => &$closed, 'catid' => &$catid)); // update item itsself $query = 'UPDATE '.sql_table('item') . ' SET' . " ibody='". addslashes($body) ."'," . " ititle='" . addslashes($title) . "'," . " imore='" . addslashes($more) . "'," . " iclosed=" . intval($closed) . "," . " icat=" . intval($catid); $manager->notify('PostUpdateItem',array('itemid' => $itemid));
Note : I am using the item.php from 2.5 cvs. In 2.5 beta, the lines might look different. Only the new line I asked you to enter matters.
All versions: Go to add item edit and scroll down. You will see how to assign multiple categories.
Instead of <%blog..%> in your skin, You can use any of the following,
<%MultipleCategories(template_name)%> <%MultipleCategories(template_name,number_of_entries)%> <%MultipleCategories(template_name,number_of_entries,category_name)%>
In your template;
Put <%MultipleCategories%> instead of the categories link and name.
Tip By TrenT: If you use wbloggar to post to your Nucleus weblog, you can do this. Check out this software at http://www.wbloggar.com
Plugin dependency reported by adityak: You must update to the latest version - 0.5.1j (maintained here : http://japan.nucleuscms.org/wiki/plugins:multiplecategories if you are using this plugin along with customurl version 0.3.7 This will avoid failure in customurl