Class categories

Description

Category class to perform the majority of category functions in ILance.

  • author: ILance
  • version: $Revision: 1.0.0 $

Located in /api/class.categories.inc.php (line 23)


	
			
Direct descendents
Class Description
categories_parser Category parser class to perform the majority of category parsing functions within ILance.
categories_pulldown Category pulldown class to perform the majority of category pulldown menus and other related parsing functions within ILance.
categories_skills Category Skills class to perform the majority of category skill related functions within ILance.
Variable Summary
mixed $buildarray
mixed $cats
mixed $cat_map
mixed $custom
mixed $fetch
mixed $subs
Method Summary
categories categories ([bool $buildarray = false], [string $cattype = 'service'], [string $slng = 'eng'], [integer $categorymode = 0], [boolean $propersort = true])
string api_multicategory_select ([string $cattype = ''], [string $selected = ''], [bool $singlepulldown = false], [bool $hideallcats = false], [string $selectname = 'cid'], [bool $pleaseselect = false], [integer $level = 0])
integer auctioncount ([string $cattype = ''], [integer $cid = 0])
integer bestmatch_auction_count ([string $cid = 0], [string $cattype = 'service'], [integer $sqlquery = array()])
string bidamounttypes ([integer $cid = 0])
string bidgroupdisplay ([integer $cid = 0])
string bidgrouping ([integer $cid = 0])
array breadcrumb ([integer $cid = 0], [string $cattype = 'service'], [string $slng = 'eng'])
void budgetgroup ([ $cid = 0])
array build_array ([string $cattype = 'service'], [string $slng = 'eng'], [string $categorymode = 0], [bool $propersort = true], [string $extra = ''], [string $extra2 = ''], [integer $counter = 0], [integer $limit = -1], [integer $level = 10], [integer $cid = 0], [string $title = ''], [integer $visible = 1])
string can_post ([string $slng = 'eng'], [string $cattype = ''], [integer $cid = 0])
string cattype ([string $slng = 'eng'], [integer $cid = 0])
string construct_categories ([string $mode = ''], [integer $columns = 3], [integer $cid = 0], [integer $storeid = ''])
mixed description ([string $slng = 'eng'], [integer $cid = 0])
string display_children ([integer $parentid = 0], [integer $level = 0], [string $cattype = ''], [string $optgroups = ''], [string $addspaces = ''])
string fetch_children ([integer $cid = 0], [string $cattype = 'service'])
string fetch_children_ids ([string $cid = 'all'], [string $cattype = 'service'], [ $extraquery = ''])
string fetch_level_padding ([integer $level = 0])
string fetch_parent_ids ([string $cid = 0], [string $extraquery = ''])
integer fetch_portfolio_count ([integer $cid = 0])
integer fetch_profile_answer_count ([integer $cid = 0], [integer $userid = 0])
integer fetch_profile_question_count ([integer $cid = 0])
integer fetch_profile_verification_count ([integer $cid = 0], [integer $userid = 0])
void finalvaluegroup ([ $cid = 0])
string fixedfeeamount ([integer $cid = 0])
nothing get_cats (array $result, [integer $parentid = 0], [integer $level = 1], [ $counter = 0])
nothing get_cats_recursive (array $result, [integer $parentid = 0], [integer $level = 1], [integer $counter = 0])
string incrementgroup ([integer $cid = 0])
void insertiongroup ([ $cid = 0])
mixed keywords ([string $slng = 'eng'], [integer $cid = 0], [boolean $commaafter = false], [boolean $showinputkeywords = false])
mixed level ([string $slng = 'eng'], [string $cattype = ''], [integer $cid = 0])
void nondisclosefeeamount ([ $cid = 0])
integer parentid ([integer $cid = 0])
string print_category_jump_js ([string $formid1 = 'ilform'], [string $formid2 = 'ilform2'], [string $cidid = 'cid'], [ $page = 1], [ $page2 = 1])
string print_category_newicon ([integer $cid = 0], [bool $cattype = ''], [bool $recursive = true])
string print_searchable_questions ([integer $cid = 0], [bool $showcount = 1], [integer $level = 0], [integer $viewlevel = -1], [boolean $forcelinks = false], [string $cattype = ''], [string $title = ''])
void propersort ([string $slng = 'eng'], [string $cattype = 'service'], [integer $categorymode = 0], [ $counter = 0])
string proxy_bid_ready ([string $slng = 'eng'], [string $cattype = ''], [integer $cid = 0])
void rebuild_category_tree ([integer $parentid = 0], [integer $left = 1], [ $cattype = 'product'], [ $slng = 'eng'])
string recursive ([integer $cid = 0], [string $cattype = 'service'], [string $slng = 'eng'], [boolean $nourls = 0], [string $customurl = ''], [boolean $seourls = 0])
integer searchable_question_count ([integer $qid = 0], [string $choice = ''], [string $cattype = ''], [array $sqlquery = array()])
void set_levels ()
nothing set_levels_update (integer $cid, integer $parentid, integer $level, [integer $cid_save = ''])
mixed title ([string $slng = 'eng'], [integer $cid = 0])
string usefixedfees ([integer $cid = 0])
mixed useproxybid ([string $slng = 'eng'], [integer $cid = 0])
void usereserveprice ([ $cid = 0])
mixed visible ([string $cid = 0], string 1, integer 2)
string wantads_in_category ([integer $cid = 0])
Variables
mixed $buildarray = false (line 30)
mixed $cats = array() (line 25)

Redefined in descendants as:
mixed $cat_map = array() (line 29)
mixed $custom = array() (line 27)
mixed $fetch = array() (line 26)
mixed $subs = null (line 28)
Methods
Constructor categories (line 41)

Constructor

categories categories ([bool $buildarray = false], [string $cattype = 'service'], [string $slng = 'eng'], [integer $categorymode = 0], [boolean $propersort = true])
  • bool $buildarray: build the array on load? default = false
  • string $cattype: category type (service, product, experts, portfolio, serviceprovider)
  • string $slng: short language identifier? default = user session lang.
  • integer $categorymode: category mode (0 = all, 1 = portfolio, 2 = rss, 3 = newsletters)
  • boolean $propersort: enable proper category sorting (builds $this->cat & $this->fetch internally) (default true)
api_multicategory_select (line 1873)

Function to provide add-on products with a useable API bridge allowing the generation of multi-select fields such as categories.

  • return: Returns HTML formatted pulldown/select menu
string api_multicategory_select ([string $cattype = ''], [string $selected = ''], [bool $singlepulldown = false], [bool $hideallcats = false], [string $selectname = 'cid'], [bool $pleaseselect = false], [integer $level = 0])
  • string $cattype: category type
  • string $selected: selected category
  • bool $singlepulldown: single pulldown mode?
  • bool $hideallcats: hide all categories? (default false)
  • string $selectname: select field name
  • bool $pleaseselect: show "Please Select: " option in the pulldown (default false)
  • integer $level: category level (used for pulldown option spacing) (default 1)
auctioncount (line 466)

Function to fetch the auction count for a category.

  • return: Returns parentid of a category or 0 otherwise
integer auctioncount ([string $cattype = ''], [integer $cid = 0])
  • string $cattype: category type (service/product)
  • integer $cid: category id
bestmatch_auction_count (line 703)

Function to fetch a category count based on a set of search options per specific category.

For example, say Web Design normally by itself has 300 auctions. If a user enters a search for keyword "template" and 35 results were found, "35" would be that category's counter: Web Design (35) even though the current category selected is "Programming". This can be considered a mini-internal search engine for category listing counts.

  • return: Returns category counter number
integer bestmatch_auction_count ([string $cid = 0], [string $cattype = 'service'], [integer $sqlquery = array()])
  • string $cid: category id
  • string $cattype: category type (service/product/serviceprovider)
  • integer $sqlquery: search sql query (array)
bidamounttypes (line 583)

Function to fetch the bid amount types for a category

  • return: Returns a serialized string holding array with information on bid types enabled for the category.
string bidamounttypes ([integer $cid = 0])
  • integer $cid: category id
bidgroupdisplay (line 535)

Function to fetch the category bid group display logic for a category

  • return: Returns the category bid group display (lowest or highest)
string bidgroupdisplay ([integer $cid = 0])
  • integer $cid: category id
bidgrouping (line 519)

Function to determine if a category bid grouping logic is enabled or disabled

  • return: Returns true or false
string bidgrouping ([integer $cid = 0])
  • integer $cid: category id
breadcrumb (line 949)

Function to generate the main header breadcrumb category trail.

  • return: Returns array $navcrumb breadcrumb trail
array breadcrumb ([integer $cid = 0], [string $cattype = 'service'], [string $slng = 'eng'])
  • integer $cid: category id
  • string $cattype: category type (service/product)
  • string $slng: short language identifier (default eng)
budgetgroup (line 610)
void budgetgroup ([ $cid = 0])
  • $cid
build_array (line 68)

Function to fetch and build the array of the category structure. This will internally build our $ilance->categories->fetch[] array.

Additionally this function can sort the array using an internal sorting method if required.

  • return: Returns category array structure
array build_array ([string $cattype = 'service'], [string $slng = 'eng'], [string $categorymode = 0], [bool $propersort = true], [string $extra = ''], [string $extra2 = ''], [integer $counter = 0], [integer $limit = -1], [integer $level = 10], [integer $cid = 0], [string $title = ''], [integer $visible = 1])
  • string $cattype: category type (service/product)
  • string $slng: short language identifier (default eng)
  • string $categorymode: category mode (0 = all, 1 = portfolio, 2 = rss, 3 = newsletters)
  • bool $propersort: enable proper category/parent/child sorting on the fly? (default yes)
  • string $extra: extra 1
  • string $extra2: extra 2
  • integer $counter: page counter (default 0)
  • integer $limit: per page limit (default 10)
  • integer $level: category id level depth selector (default 10)
  • integer $cid: category id selector (extra logic)
  • string $title: category title we're searching for (extra logic)
  • integer $visible: category visibility (admincp usage mainly) (default 1)
can_post (line 646)

Function to determine if a category is a postable auction category.

  • return: Returns true or false response
string can_post ([string $slng = 'eng'], [string $cattype = ''], [integer $cid = 0])
  • string $slng: short language identifier (default eng)
  • string $cattype: category type (service/product)
  • integer $cid: category id
cattype (line 487)

Function to fetch the category type of a category.

  • return: Returns the category type (service/product)
string cattype ([string $slng = 'eng'], [integer $cid = 0])
  • string $slng: short language identifier (default eng)
  • integer $cid: category id
construct_categories (line 1800)

Function to bridge the category system for usage with Want Ads and other add on products like Stores

  • return: Returns HTML formatted category output display
string construct_categories ([string $mode = ''], [integer $columns = 3], [integer $cid = 0], [integer $storeid = ''])
  • string $mode: category mode
  • integer $columns: columns (default 3)
  • integer $cid: category id
  • integer $storeid: store id (optional)
description (line 384)

Function to fetch the description text of a category.

  • return: Returns category array structure (or All Categories) text otherwise
mixed description ([string $slng = 'eng'], [integer $cid = 0])
  • string $slng: short language identifier (default eng)
  • integer $cid: category id
display_children (line 1821)

Function to

  • return: Returns xxx
string display_children ([integer $parentid = 0], [integer $level = 0], [string $cattype = ''], [string $optgroups = ''], [string $addspaces = ''])
  • integer $parentid: parent category id
  • integer $level: current level
  • string $cattype: category type (service/product)
  • string $optgroups: option groupns
  • string $addspaces: add spaces (optional)
fetch_children (line 2116)

Function to fetch all children category id numbers returns in comma separated values.

  • return: Returns category id's in comma separate values (ie: 1,3,4,6)
string fetch_children ([integer $cid = 0], [string $cattype = 'service'])
  • integer $cid: category id number (or all)
  • string $cattype: category type (service/product)
fetch_children_ids (line 1992)

Function to fetch all children category id numbers recursivly in comma separated values based on a parent category id number.

This function is useful because it reads from the cache and does not hit the database.

  • return: Returns category id's in comma separate values (ie: 1,3,4,6)
string fetch_children_ids ([string $cid = 'all'], [string $cattype = 'service'], [ $extraquery = ''])
  • string $cid: category id number (or all)
  • string $cattype: category type (service or product)
  • $extraquery
fetch_level_padding (line 1687)

Function to fetch the padding based on a particular category level we're currently viewing

  • return: Returns HTML formatted table with category results
string fetch_level_padding ([integer $level = 0])
  • integer $level: level
fetch_parent_ids (line 2072)

Function to fetch all parent category id numbers recursivly in comma separated values based on a child category id number.

This function is useful because it reads from the cache and does not hit the database.

  • return: Returns category id's in comma separate values (ie: 1,3,4,6)
string fetch_parent_ids ([string $cid = 0], [string $extraquery = ''])
  • string $cid: category id number (or all)
  • string $extraquery: category type (service or product)
fetch_portfolio_count (line 1207)

Function to fetch the number of portfolio items within a particular category

  • return: Returns xxx
integer fetch_portfolio_count ([integer $cid = 0])
  • integer $cid: category id
fetch_profile_answer_count (line 1236)

Function to fetch the answer count for the profile question within a category for a particular user.

  • return: Returns xxx
integer fetch_profile_answer_count ([integer $cid = 0], [integer $userid = 0])
  • integer $cid: category id
  • integer $userid: user id
fetch_profile_question_count (line 1168)

Function to fetch the entire profile count within any category.

  • return: Returns xxx
integer fetch_profile_question_count ([integer $cid = 0])
  • integer $cid: category id
fetch_profile_verification_count (line 1117)

Function to fetch the profile verification count for a user within a particular category.

  • return: Returns xxx
integer fetch_profile_verification_count ([integer $cid = 0], [integer $userid = 0])
  • integer $cid: category id
  • integer $userid: user id
finalvaluegroup (line 619)
void finalvaluegroup ([ $cid = 0])
  • $cid
fixedfeeamount (line 567)

Function to fetch the fixed fee amount of a particular category

  • return: Returns fee amount
string fixedfeeamount ([integer $cid = 0])
  • integer $cid: category id
get_cats (line 250)

Function to process and fetch categories

nothing get_cats (array $result, [integer $parentid = 0], [integer $level = 1], [ $counter = 0])
  • array $result: category results array
  • integer $parentid: parent id
  • integer $level: category level
  • $counter

Redefined in descendants as:
get_cats_recursive (line 273)

Function to process and fetch categories recusively

nothing get_cats_recursive (array $result, [integer $parentid = 0], [integer $level = 1], [integer $counter = 0])
  • array $result: category results array
  • integer $parentid: category parent id
  • integer $level: category level
  • integer $counter: counter (default 0)

Redefined in descendants as:
incrementgroup (line 503)

Function to fetch the category increment group for a category.

  • return: Returns the category increment group name
string incrementgroup ([integer $cid = 0])
  • integer $cid: category id
insertiongroup (line 601)
void insertiongroup ([ $cid = 0])
  • $cid
keywords (line 407)

Function to fetch the meta tag keywords text of a category.

  • return: Returns category array structure (or All Categories) text otherwise
mixed keywords ([string $slng = 'eng'], [integer $cid = 0], [boolean $commaafter = false], [boolean $showinputkeywords = false])
  • string $slng: short language identifier (default eng)
  • integer $cid: category id
  • boolean $commaafter: add comma after? (default false)
  • boolean $showinputkeywords: show input keywords? (default false)

Redefined in descendants as:
level (line 342)

Function to fetch the true level of a category within the category structure.

  • return: Returns category level for the selected category
mixed level ([string $slng = 'eng'], [string $cattype = ''], [integer $cid = 0])
  • string $slng: short language identifier (default eng)
  • string $cattype: category type (service/product)
  • integer $cid: category id
nondisclosefeeamount (line 592)
void nondisclosefeeamount ([ $cid = 0])
  • $cid
parentid (line 445)

Function to fetch the parentid of a category.

  • return: Returns parentid of a category or 0 otherwise
integer parentid ([integer $cid = 0])
  • integer $cid: category id

Redefined in descendants as:
print_category_jump_js (line 2148)

Function to print the category jump edit/delete/actions menu from within the AdminCP > Category Manager

  • return: Returns HTML formatted pulldown jump menu
string print_category_jump_js ([string $formid1 = 'ilform'], [string $formid2 = 'ilform2'], [string $cidid = 'cid'], [ $page = 1], [ $page2 = 1])
  • string $formid1: form 1 id
  • string $formid2: form 2 id
  • string $cidid: category id field
  • $page
  • $page2
print_category_newicon (line 1713)

Function to print a category's "new" icon representing any new auctions posted within that category

  • return: Returns xxx
string print_category_newicon ([integer $cid = 0], [bool $cattype = ''], [bool $recursive = true])
  • integer $cid: category id
  • bool $cattype: category type (service/product)
  • bool $recursive: decide if we will show icon on parents (that have children with new items posted) (default true)
print_searchable_questions (line 1430)

Function to print an html formatted representation of the searchable question category genres under a specific category when viewing the search results

  • return: Returns HTML formatted searchable question output
string print_searchable_questions ([integer $cid = 0], [bool $showcount = 1], [integer $level = 0], [integer $viewlevel = -1], [boolean $forcelinks = false], [string $cattype = ''], [string $title = ''])
  • integer $cid: category id
  • bool $showcount: show category counters
  • integer $level: current level
  • integer $viewlevel: current show view level
  • boolean $forcelinks: force showing of links for category maps (default false)
  • string $cattype: category type (optional if forcing links)
  • string $title: category title (optional if forcing links)
propersort (line 180)

Function to fetch the entire category cache and make it a proper formatted result set for various areas within ILance

void propersort ([string $slng = 'eng'], [string $cattype = 'service'], [integer $categorymode = 0], [ $counter = 0])
  • string $slng: short language identifier
  • string $cattype: category type (service or product)
  • integer $categorymode: category mode (0 = all, 1 = portfolio, 2 = rss, 3 = newsletters)
  • $counter
proxy_bid_ready (line 666)

Function to determine if a category is proxy bid ready (if proxy bidding is enabled)

  • return: Returns true or false response
string proxy_bid_ready ([string $slng = 'eng'], [string $cattype = ''], [integer $cid = 0])
  • string $slng: short language identifier (default eng)
  • string $cattype: category type (service/product)
  • integer $cid: category id
rebuild_category_geometry (line 2355)

Function to rebuild the category structure geometry for ultra fast database queries

void rebuild_category_geometry ()
rebuild_category_geometry_install (line 2367)
void rebuild_category_geometry_install ()
rebuild_category_tree (line 2318)

Function to rebuild a nested category structure in the database

void rebuild_category_tree ([integer $parentid = 0], [integer $left = 1], [ $cattype = 'product'], [ $slng = 'eng'])
  • integer $parentid: parent category id number (default 0)
  • integer $left: lft node (default 1)
  • $cattype
  • $slng
recursive (line 781)

Function to print a recursive category breadcrumb trail.

  • return: Returns HTML formatted version of the breadcrumb trail
string recursive ([integer $cid = 0], [string $cattype = 'service'], [string $slng = 'eng'], [boolean $nourls = 0], [string $customurl = ''], [boolean $seourls = 0])
  • integer $cid: category id
  • string $cattype: category type (service/product)
  • string $slng: short language identifier (default eng)
  • boolean $nourls: no urls flag (default off)
  • string $customurl: custom url (optional)
  • boolean $seourls: enable seo urls (default off)
searchable_question_count (line 1295)

Function to print the searchable category questions auction count sum.

For example, if a seller posted an item under DVD and answered "Horror" as the question, Horror (1) would be shown. Additionally, this counter would be affected if and when the searcher enters existing search patterns such as selecting another category question at the same time or keywords being used.

  • return: Returns item count
integer searchable_question_count ([integer $qid = 0], [string $choice = ''], [string $cattype = ''], [array $sqlquery = array()])
  • integer $qid: question id
  • string $choice: choice
  • string $cattype: category type (service/product)
  • array $sqlquery: current search sql info (optional)
set_levels (line 1914)

Function to set all the levels in proper format for the main category system

void set_levels ()
set_levels_update (line 1950)

Function to set all levels and to handle the updating

nothing set_levels_update (integer $cid, integer $parentid, integer $level, [integer $cid_save = ''])
  • integer $cid: category id
  • integer $parentid: parent id
  • integer $level: level
  • integer $cid_save: category id to save
title (line 298)

Function to fetch the title of a category.

  • return: Returns category array structure (or All Categories) text otherwise
mixed title ([string $slng = 'eng'], [integer $cid = 0])
  • string $slng: short language identifier (default eng)
  • integer $cid: category id
usefixedfees (line 551)

Function to determine if a category uses fixed fees

  • return: Returns true or false
string usefixedfees ([integer $cid = 0])
  • integer $cid: category id
useproxybid (line 363)

Function to determine if a specific product category has proxy bidding enabled.

  • return: Returns category array structure (or All Categories) text otherwise
mixed useproxybid ([string $slng = 'eng'], [integer $cid = 0])
  • string $slng: short language identifier (default eng)
  • integer $cid: category id
usereserveprice (line 628)
void usereserveprice ([ $cid = 0])
  • $cid
visible (line 320)

Function to fetch the visibility of a category.

  • return: Returns true or false based on visibility
mixed visible ([string $cid = 0], string 1, integer 2)
  • string 1: category type (service/product)
  • integer 2: category id
  • string $cid: short language identifier (default eng)
wantads_in_category (line 1770)

Function to count the number of ads within a Want Ads category

  • return: Returns xxx
string wantads_in_category ([integer $cid = 0])
  • integer $cid: category id

Documentation generated on Mon, 08 Aug 2011 17:40:51 +0200 by phpDocumentor 1.4.1