b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.8) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Procedural File: _category.funcs.php

Source Location: /blogs/inc/MODEL/collections/_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.5.2.2 2006/07/02 00:30:58 fplanque Exp $
Copyright:  

(c)2003-2006 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
blog_copy_cats  [line 825]

void blog_copy_cats( $srcblog, $destblog  )

Copy the catagory structure from one blog to another

The four cat_copy_* functions after blog_copy_cats are required by blog_copy_cats()

Parameters:
   $srcblog: 
   $destblog: 


[ Top ]
blog_has_cats  [line 633]

boolean blog_has_cats( integer $blog_ID  )

Does a given bog have categories?

Parameters:
integer   $blog_ID:  Blog ID


[ Top ]
cat_children  [line 548]

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: 


[ Top ]
cat_copy_after_each  [line 864]

void cat_copy_after_each( $cat_ID, $level  )

callback to display sublist element

Parameters:
   $cat_ID: 
   $level: 


[ Top ]
cat_copy_after_last  [line 872]

void cat_copy_after_last( $parent_cat_ID, $level  )

callback to end sublist

Parameters:
   $parent_cat_ID: 
   $level: 


[ Top ]
cat_copy_before_each  [line 852]

void cat_copy_before_each( $cat_ID, $level  )

callback to display sublist element

Parameters:
   $cat_ID: 
   $level: 


[ Top ]
cat_copy_before_first  [line 845]

void cat_copy_before_first( $parent_cat_ID, $level  )

callback to start sublist

Parameters:
   $parent_cat_ID: 
   $level: 


[ Top ]
cat_create  [line 55]

void cat_create( $cat_name, $cat_parent_ID, [ $cat_blog_ID = NULL]  )

cat_create(-)

Create a new category This funtion has to handle all needed DB dependencies!

fplanque: created

Parameters:
   $cat_name: 
   $cat_parent_ID: 
   $cat_blog_ID: 


[ Top ]
cat_delete  [line 111]

void cat_delete( $cat_ID  )

Delete a category

This funtion has to handle all needed DB dependencies!

Parameters:
   $cat_ID: 

Information Tags:
Todo:  BUG: it is possible to create loops and lose branch in some situations :(

[ Top ]
cat_load_cache  [line 325]

void cat_load_cache( [string $cat_load_postcounts = 'none'], [ $dbtable_items = 'T_posts'], [ $dbprefix_items = 'post_'], [ $dbIDname_items = 'post_ID']  )

Load cache for category definitions.

TODO: replace LEFT JOIN with UNION when switching to MySQL 4 This will prevent empty cats from displaying "(1)" as postcount.

Parameters:
string   $cat_load_postcounts:  'none'|'context'|'canonic'
   $dbtable_items: 
   $dbprefix_items: 
   $dbIDname_items: 


[ Top ]
cat_load_postcats_cache  [line 474]

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

[ Top ]
cat_load_postcounts  [line 385]

void cat_load_postcounts( [string $cat_load_postcounts = 'canonic'], [ $dbtable = 'T_posts'], [ $dbprefix = 'post_'], [ $dbIDname = 'post_ID']  )

Load the post counts

Parameters:
string   $cat_load_postcounts:  'context'|'canonic'
   $dbtable: 
   $dbprefix: 
   $dbIDname: 


[ Top ]
cat_query  [line 660]

void cat_query( [string $load_postcounts = 'none'], [ $dbtable_items = 'T_posts'], [ $dbprefix_items = 'post_'], [ $dbIDname_items = 'post_ID']  )

Query for the cats

Parameters:
string   $load_postcounts:  'none'|'context'|'canonic'
   $dbtable_items: 
   $dbprefix_items: 
   $dbIDname_items: 


[ Top ]
cat_req  [line 947]

void cat_req( $parent_cat_ID, $level  )
Parameters:
   $parent_cat_ID: 
   $level: 


[ Top ]
cat_req_dummy  [line 963]

void cat_req_dummy( )


[ Top ]
cat_update  [line 86]

void cat_update( $cat_ID, $cat_name, [ $cat_parent_ID = 0], [ $cat_blog_ID = '']  )
Parameters:
   $cat_ID: 
   $cat_name: 
   $cat_parent_ID: 
   $cat_blog_ID: 


[ Top ]
compile_cat_array  [line 885]

void compile_cat_array( strinf $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:
strinf   $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


[ Top ]
get_catblog  [line 285]

void get_catblog( $cat_ID  )
Parameters:
   $cat_ID: 


[ Top ]
get_catname  [line 310]

void get_catname( $cat_ID  )
Parameters:
   $cat_ID: 


[ Top ]
get_catparent  [line 298]

void get_catparent( $cat_ID  )
Parameters:
   $cat_ID: 


[ Top ]
get_the_category  [line 270]

void get_the_category( )


[ Top ]
get_the_category_by_ID  [line 242]

void get_the_category_by_ID( integer $cat_ID, [ $die = true], boolean die()  )

get_the_category_by_ID(-)

Get category name+blog_id for specified cat ID

fplanque: reused "R. U. Serious" optimization here fplanque: added blog ID stuff TODO: move. dis is not a template tag

Parameters:
boolean   die():  if category does not exist? (default: true)
integer   $cat_ID:  category ID
   $die: 


[ Top ]
postcats_get_byID  [line 521]

void postcats_get_byID( $post_ID  )
Parameters:
   $post_ID: 


[ Top ]
the_categories  [line 697]

void the_categories( [ $link_title = '#'], [ $before_main = '<strong>'], [ $after_main = '</strong>'], [ $before_other = ''], [ $after_other = ''], [ $before_external = '<em>'], [ $after_external = '</em>'], [ $separator = ', '], [ $format_each = 'raw'], [ $format_list = 'htmlbody']  )

the_categories(-)

lists all the category names

fplanque: created fplanque: 0.8.3: changed defaults

Parameters:
   $link_title: 
   $before_main: 
   $after_main: 
   $before_other: 
   $after_other: 
   $before_external: 
   $after_external: 
   $separator: 
   $format_each: 
   $format_list: 

API Tags:
Deprecated:  deprecated by Item::categories()


[ Top ]
the_categories_IDs  [line 786]

void the_categories_IDs( )

lists the category IDs for current post

fplanque: created



[ Top ]
the_category  [line 680]

void the_category( [ $format = 'htmlbody']  )

the_category(-)

echoes the main category name the name of the main category the post belongs to. you can as an admin add categories, and rename them if needed. default category is 'General', you can rename it too.

Parameters:
   $format: 

API Tags:
Deprecated:  deprecated by Item::main_category()


[ Top ]
the_category_head  [line 806]

void the_category_head( [ $before = ''], [ $after = '']  )
Parameters:
   $before: 
   $after: 


[ Top ]
the_category_ID  [line 774]

void the_category_ID( )

Echoes the main category ID for current post

The ID (number) of the category the post belongs to. This is static data that you can use, for example to associate a category to an image, or a css style.



[ Top ]


Documentation generated on Tue, 18 Dec 2007 23:11:11 +0100 by phpDocumentor 1.4.0