Procedural File: _category.funcs.php
Source Location: /blogs/inc/collections/model/_category.funcs.php
Page Details
This file implements Category handling functions.
This file is part of the evoCore framework - http://evocore.net/ See also http://sourceforge.net/projects/evocms/.
| Author: | blueyed: Daniel HAHLER. |
| Author: | jwedgeco: Jason EDGECOMBE (for hire by UNC-Charlotte) |
| Author: | fplanque: Francois PLANQUE. |
| Author: | edgester: Jason EDGECOMBE (personal contributions, not for hire) |
| Version: | $Id: _category.funcs.php,v 1.12 2010/02/08 17:52:09 efy-yury Exp $ |
| Copyright: | (c)2003-2010 by Francois PLANQUE - http://fplanque.net/ Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - http://thequod.de/contact. Parts of this file are copyright (c)2004 by The University of North Carolina at Charlotte as contributed by Jason Edgecombe http://tst.uncc.edu/team/members/jason_bio.php. |
| Todo: | implement CategoryCache based on LinkCache |
| Filesource: | Source Code for this file |
Functions
boolean blog_has_cats(
integer $blog_ID
)
|
|
Does a given blog have categories?
Parameters:
|
integer |
$blog_ID: |
Blog ID |
string cat_children(
array $ccats, integer $blog_ID, integer $parent_ID, string|array $callback_before_first, string|array $callback_before_each, string|array $callback_after_each, string|array $callback_after_last, [integer $level = 0], [ $root_call = true]
)
|
|
Taking a recursive walk in the category park...
Parameters:
|
array |
$ccats: |
PHP requires this stupid cloning of the cache_categories array in order to be able to perform foreach on it |
|
integer |
$blog_ID: |
|
|
integer |
$parent_ID: |
|
|
string|array |
$callback_before_first: |
Callback for first category |
|
string|array |
$callback_before_each: |
Callback before each category |
|
string|array |
$callback_after_each: |
Callback after each category |
|
string|array |
$callback_after_last: |
Callback after last category |
|
integer |
$level: |
Caller nesting level, just to keep track of how far we go :) |
|
|
$root_call: |
|
void cat_create(
string $cat_name, string $cat_parent_ID, [integer|NULL $cat_blog_ID = NULL]
)
|
|
Create a new category
This funtion has to handle all needed DB dependencies!
Parameters:
|
string |
$cat_name: |
Category name |
|
string |
$cat_parent_ID: |
Category ID ('NULL' as string(!) for root) |
|
integer|NULL |
$cat_blog_ID: |
Blog ID (will be taken from parent cat, if empty) |
cat_load_cache [line 138]
Load cache for category definitions.
Warning: this loads all categories for ALL blogs
cat_load_postcats_cache [line 214]
void cat_load_postcats_cache(
)
|
|
Load cache for category associations with current posts
Information Tags:
| Todo: | put this into main post query when MySQL 4.0 commonly available |
| Todo: | dh> why is this limited to the _global_ $postIDlist?! Really ridiculous, trying to get a list of category names for an Item (which is not in $postIDlist for example.. :/) fp> This is legacy from a quick b2/cafelog hack. This will de deprecated. dh> Only used in ItemLight::get_Chapters now - move it there for now? fp> no it should stay close to $cache_postcats handling until teh whole thing dies. |
void cat_req(
$parent_cat_ID, $level
)
|
|
Callback used in compile_cat_array()
Parameters:
Callback used in compile_cat_array()
compile_cat_array [line 397]
void compile_cat_array(
string $cat, array $catsel, array &$cat_array, string &$cat_modifier, [integer $restrict_to_blog = 0]
)
|
|
Compiles the cat array from $cat (recursive + optional modifiers) and $catsel[] (non recursive)
Parameters:
|
string |
$cat: |
|
|
array |
$catsel: |
|
|
array |
&$cat_array: |
by ref, will be modified |
|
string |
&$cat_modifier: |
by ref, will be modified |
|
integer |
$restrict_to_blog: |
blog number to restrict to |
integer get_catblog(
$cat_ID
)
|
|
Get blog ID for a given cat.
This halts on error.
Parameters:
get_the_category_by_ID [line 100]
void get_the_category_by_ID(
integer $cat_ID, [ $die = true], boolean die()
)
|
|
Get category name+blog_id for specified cat ID
fplanque: reused "R. U. Serious" optimization here fplanque: added blog ID stuff
Parameters:
|
boolean |
die(): |
if category does not exist? (default: true) |
|
integer |
$cat_ID: |
category ID |
|
|
$die: |
|
API Tags:
| Deprecated: | since 3.1.0-alpha. Use ChapterCache instead. |
postcats_get_byID [line 257]
void postcats_get_byID(
$post_ID
)
|
|
Get category associations with given post
Parameters: