b2evolution

Multilingual multiuser multiblog engine

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

Class: Item

Source Location: /blogs/inc/MODEL/items/_item.class.php

Class Item

Class Overview

Item Class

Located in /blogs/inc/MODEL/items/_item.class.php [line 86]

DataObject
   |
   --Item
Author(s):
Information Tags:
Version:  beta

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From DataObject

DataObject::$delete_cascades
DataObject::$delete_restrictions
DataObject::$ID

Inherited From DataObject

DataObject::DataObject()
Constructor
DataObject::check_delete()
Check relations for restrictions before deleting
DataObject::check_relations()
Check relations for restrictions or cascades
DataObject::confirm_delete()
Displays form to confirm deletion of this object
DataObject::dbchange()
Records a change that will need to be updated in the db
DataObject::dbdelete()
Delete object from DB.
DataObject::dbinsert()
Insert object into DB based on previously recorded changes.
DataObject::dbsave()
Inserts or Updates depending on object state.
DataObject::dbupdate()
Update the DB based on previously recorded changes
DataObject::dget()
Get a ready-to-display member param by its name
DataObject::disp()
Display a member param by its name
DataObject::get()
Get a member param by its name
DataObject::history_info_icon()
Create icon with dataobject history
DataObject::ID()
Template function: Displays object ID.
DataObject::set()
Set param value
DataObject::set_from_Request()
Set a parameter from a Request form value.
DataObject::set_param()
Set param value.

[ Top ]
Property Summary
User|NULL   $assigned_User   The assigned User to the item.
integer|NULL   $assigned_user_ID  
User   $Author  
Blog   $Blog   The Blog of the Item (lazy filled, use get_Blog() to access it.
integer   $blog_ID   Derived from $main_cat_ID
string   $comment_status   Comments status
mixed   $content  
mixed   $content_pages   Lazy filled, use split_page()
array|NULL   $content_prerendered   Pre-rendered content, cached by format/validated renderers.
User   $creator_User   The User who has created the Item (lazy-filled).
integer   $creator_user_ID  
mixed   $deadline  
NULL|array   $extra_cat_IDs  
string   $issue_date  
array   $Links   Array of Links attached to this item.
string   $locale   Locale code for the Item content.
integer   $main_cat_ID  
mixed   $mod_date  
integer   $notifications_ctsk_ID   Which cron task is responsible for handling notifications?
string   $notifications_status   Have post processing notifications been handled?
mixed   $priorities  
mixed   $priority  
string   $renderers  
string   $status   The visibility status of the item.
mixed   $st_ID  
mixed   $title  
mixed   $typ_ID  
string   $url   External URL the item links to (if any).
mixed   $urltitle  
mixed   $wordcount  

[ Top ]
Method Summary
Item   Item()   Constructor
boolean   add_renderer()   Add a renderer (by code) to the Item.
void   anchor()   Template function: display anchor for permalinks to refer to
void   assigned_to()   Template function: display assignee of item
void   assigned_user_options()   Template function: display list of assigned user options
void   assign_to()  
void   assign_to_first_cat_for_collection()   Assign the item to the first category we find in the requested collection
void   author()   Template function: display author/creator of item
void   blog_name()   Template function: Display the main blog name.
boolean   can_comment()   Template function: Check if user can leave comment on this post or display error
boolean   can_see_comments()   Check if user can see comments on this post, which he cannot if they are disabled for the Item or never allowed for the blog.
void   categories()   Template function: list all the category names
void   content()   Template function: display content of item
boolean   dbdelete()   Trigger event AfterItemDelete after calling parent method.
boolean   dbinsert()   Insert object into DB based on previously recorded changes
boolean   dbupdate()   Update the DB based on previously recorded changes
void   deadline_date()   Template function: display deadline date (datetime) of Item
void   deadline_time()   Template function: display deadline time (datetime) of Item
void   delete_link()   Displays button for deleting the Item if user has proper rights
void   deprecate_link()   Display link to deprecate a post if user has edit rights
void   edit_link()  
void   extra_status()   Template function: display extra status of item
void   feedback_link()   Template function: Displays link to feedback page (under some conditions)
void   feedback_moderation()   Template function: Displays feeback moderation info
mixed   get()   Get a member param by its name
User|NULL   get_assigned_User()   Get the User who is assigned to the Item.
void   get_assigned_user_options()   Template function: get list of assigned user options
Blog   &get_Blog()   Get the Blog object for the Item.
string   get_content()   Template function: get content of item.
void   get_content_page()   Get a specific page to display
User   &get_creator_User()   Get the User who created the Item.
void   get_delete_link()   Gets button for deleting the Item if user has proper rights
void   get_deprecate_link()   Provide link to deprecate a post if user has edit rights
void   get_edit_link()   Provide link to edit a post if user has edit rights
void   get_issue_date()   returns issue date (datetime) of Item
void   &get_Links()   Get reference to array of Links
void   get_permanent_link()   Returns a permalink link to the Item
void   get_permanent_url()   Generate the permalink for the item.
string   get_prerendered_content()   Get the rendered content. If it has not been generated yet, it will.
void   get_publish_link()   Provide link to publish a post if user has edit rights
array   get_renderers()   Get the list of renderers for this Item.
array   get_renderers_validated()   Get the list of validated renderers for this Item. This includes stealth plugins etc.
string   get_trackback_url()   Template function: get url to use to trackback this item
string   get_views()   Template function: Display the number of times the Item has been viewed
void   handle_post_processing()   Execute or schedule post(=after) processing tasks
boolean   inc_viewcount()   Increment the view count of the item directly in DB (if the item's Author is not $current_User).
void   insert()   Create a new Item/Post and insert it into the DB
void   insert_update_extracats()  
void   issue_date()   Template function: display issue date (datetime) of Item
void   issue_time()   Template function: display issue time (datetime) of Item
void   lang()   Template function: display locale for item
void   language()   Template function: display language name for item
void   linkcount()   Template function: display number of links attached to this Item
void   load_Blog()   Load the Blog object for the Item, without returning it.
boolean   load_from_Request()   Load data from Request form fields.
void   load_links()   Load links if they were not loaded yet.
void   locale()   Template function: display locale for item
void   main_category()   Template function: display main category name
void   mod_date()   Template function: display last mod date (datetime) of Item
void   mod_time()   Template function: display last mod time (datetime) of Item
boolean   msgform_link()   Template function: Provide link to message form for this Item's author.
boolean   msgform_link_assigned()   Template function: Provide link to message form for this Item's assigned User.
void   permanent_link()   Displays a permalink link to the Item
void   permanent_url()   Template function: display permalink for item
void   priority()   Template function: display priority of item
void   priority_options()   Template function: display list of priority options
void   publish_link()  
boolean   remove_renderer()   Remove a renderer (by code) from the Item.
void   renderer_checkboxes()   Template function: display checkable list of renderers
void   send_email_notifications()   Send email notifications to subscribed users
void   send_outbound_pings()   Send outbound pings for a post
boolean   set()   Set param value
boolean   set_creator_User()   Set the Author of the Item.
void   set_prerendered_content()   Set the pre-rendered content.
boolean   set_renderers()   Set the renderers of the Item.
void   split_pages()   Make sure, the pages are split up
void   status()   Template function: display status of item
void   title()   Template function: display title for item and link to related URL
void   trackback_rdf()   Template function: Displays trackback autodiscovery information
void   trackback_url()   Template function: displays url to use to trackback this item
void   type()   Template function: display type of item
void   update()   Update a post and save to DB
boolean   update_renderers_from_Plugins()   Trigger Plugin::ItemApplyAsRenderer() event and adjust renderers according to return value.
void   url_link()   Template function: Display link to item related url
integer   views()   Template function: Display a phrase about the number of Item views.
void   wordcount()   Template function: Display the number of words in the post

[ Top ]
Properties
User|NULL   $assigned_User [line 118]

The assigned User to the item.

API Tags:
See:  Item::get_assigned_User()
See:  Item::assign_to()
Access:  protected


[ Top ]
integer|NULL   $assigned_user_ID [line 123]

[ Top ]
User   $Author [line 102]
API Tags:
Deprecated:  by $creator_User


[ Top ]
Blog   $Blog [line 202]

The Blog of the Item (lazy filled, use get_Blog() to access it.

API Tags:
Access:  protected


[ Top ]
integer   $blog_ID [line 196]

Derived from $main_cat_ID


[ Top ]
string   $comment_status [line 164]

Comments status


[ Top ]
mixed   $content [line 146]

[ Top ]
mixed   $content_pages = NULL [line 151]

Lazy filled, use split_page()


[ Top ]
array|NULL   $content_prerendered [line 228]

Pre-rendered content, cached by format/validated renderers.

API Tags:
See:  Item::get_prerendered_content()
Access:  protected


[ Top ]
User   $creator_User [line 95]

The User who has created the Item (lazy-filled).

API Tags:
See:  Item::get_creator_User()
See:  Item::set_creator_User()
Access:  protected


[ Top ]
integer   $creator_user_ID [line 108]

[ Top ]
mixed   $deadline = '' [line 172]

[ Top ]
NULL|array   $extra_cat_IDs = NULL [line 207]

[ Top ]
string   $issue_date [line 128]

[ Top ]
array   $Links = NULL [line 217]

Array of Links attached to this item.

NULL when not initialized.

API Tags:
Access:  public


[ Top ]
string   $locale [line 142]

Locale code for the Item content.

Examples: en-US, zh-CN-utf-8


[ Top ]
integer   $main_cat_ID = 0 [line 189]

[ Top ]
mixed   $mod_date [line 129]

[ Top ]
integer   $notifications_ctsk_ID [line 184]

Which cron task is responsible for handling notifications?


[ Top ]
string   $notifications_status [line 179]

Have post processing notifications been handled?


[ Top ]
mixed   $priorities [line 220]

[ Top ]
mixed   $priority [line 173]

[ Top ]
string   $renderers [line 159]
API Tags:
Access:  protected


[ Top ]
string   $status [line 134]

The visibility status of the item.


[ Top ]
mixed   $st_ID [line 171]

[ Top ]
mixed   $title [line 143]

[ Top ]
mixed   $typ_ID [line 170]

[ Top ]
string   $url [line 169]

External URL the item links to (if any).


[ Top ]
mixed   $urltitle [line 144]

[ Top ]
mixed   $wordcount [line 154]

[ Top ]
Methods
Constructor Item  [line 244]

  Item Item( [object table $db_row = NULL], [string $dbtable = 'T_posts'], [string $dbprefix = 'post_'], [string $dbIDname = 'post_ID'], [string $objtype = 'Item'], [string $datecreated_field = 'datecreated'], [string $datemodified_field = 'datemodified'], [string $creator_field = 'creator_user_ID'], [string $lasteditor_field = 'lastedit_user_ID']  )

Constructor

Parameters:
object table   $db_row:  Database row
string   $dbtable: 
string   $dbprefix: 
string   $dbIDname: 
string   $objtype:  for derived classes
string   $datecreated_field:  datetime field name
string   $datemodified_field:  datetime field name
string   $creator_field:  User ID field name
string   $lasteditor_field:  User ID field name


[ Top ]
add_renderer  [line 3241]

  boolean add_renderer( string $renderer_code  )

Add a renderer (by code) to the Item.

Parameters:
string   $renderer_code:  Renderer code to add for this item

API Tags:
Return:  True if renderers have changed


[ Top ]
anchor  [line 623]

  void anchor( [string $mode = '']  )

Template function: display anchor for permalinks to refer to

Parameters:
string   $mode:  'id' or 'title'

Information Tags:
Todo:  archives modes in clean mode

[ Top ]
assigned_to  [line 658]

  void assigned_to( [string $before = ''], [string $after = ''], [string $format = 'htmlbody']  )

Template function: display assignee of item

Parameters:
string   $before: 
string   $after: 
string   $format:  Output format, see format_to_output()


[ Top ]
assigned_user_options  [line 672]

  void assigned_user_options( )

Template function: display list of assigned user options



[ Top ]
assign_to  [line 334]

  void assign_to( $user_ID, [ $dbupdate = true]  )

Parameters:
   $user_ID: 
   $dbupdate: 

Information Tags:
Todo:  use extended dbchange instead of set_param...
Todo:  Normalize to set_assigned_User!?

[ Top ]
assign_to_first_cat_for_collection  [line 3194]

  void assign_to_first_cat_for_collection( integer $collection_ID  )

Assign the item to the first category we find in the requested collection

Parameters:
integer   $collection_ID: 


[ Top ]
author  [line 376]

  void author( [string $before = ''], [string $after = ''], [string $format = 'htmlbody']  )

Template function: display author/creator of item

Parameters:
string   $before:  String to display before author name
string   $after:  String to display after author name
string   $format:  Output format, see format_to_output()


[ Top ]
blog_name  [line 705]

  void blog_name( [string $format = 'htmlbody']  )

Template function: Display the main blog name.

Parameters:
string   $format:  Output format. See format_to_output().

API Tags:
Deprecated:  since 1.9

Information Tags:
Todo:  is it possible to use {$Item->get_Blog()}->name() instead? (we can't possibly duplicate all sub-object functions here!!!) blueyed>> not with PHP4 and {$Item->get_Blog()}->name() (with curly brackets) not even in PHP5!

[ Top ]
can_comment  [line 830]

  boolean can_comment( [string|NULL $before_error = '<p><em>'], [string $after_error = '</em></p>'], [string $non_published_msg = '#'], [string $closed_msg = '#']  )

Template function: Check if user can leave comment on this post or display error

Parameters:
string|NULL   $before_error:  string to display before any error message; NULL to not display anything, but just return boolean
string   $after_error:  string to display after any error message
string   $non_published_msg:  error message for non published posts, '#' for default
string   $closed_msg:  error message for closed comments posts, '#' for default

API Tags:
Return:  true if user can post, false if s/he cannot


[ Top ]
can_see_comments  [line 809]

  boolean can_see_comments( )

Check if user can see comments on this post, which he cannot if they are disabled for the Item or never allowed for the blog.



[ Top ]
categories  [line 727]

  void categories( [string $link_title = '#'], [string $before_main = '<strong>'], [string $after_main = '</strong>'], [string $before_other = ''], [string $after_other = ''], [string $before_external = '<em>'], [string $after_external = '</em>'], [string $separator = ', '], [string $format = 'htmlbody']  )

Template function: list all the category names

Parameters:
string   $link_title:  link title, '#' for default, false if you want no links
string   $before_main:  string fo display before the MAIN category, 'hide' to ignore main cat
string   $after_main:  string fo display after the MAIN category, 'hide' to ignore main cat
string   $before_other:  string fo display before OTHER categories, 'hide' to ignore other cats
string   $after_other:  string fo display after OTHER categories, 'hide' to ignore other cats
string   $before_external:  string fo display before EXTERNAL categories, 'hide' to ignore external cats
string   $after_external:  string fo display after EXTERNAL categories, 'hide' to ignore external cats
string   $separator:  separator string
string   $format:  Output format for each cat, see format_to_output()


[ Top ]
content  [line 1091]

  void content( [mixed $disppage = '#'], [mixed $dispmore = '#'], [string $more_link_text = '#'], [string $more_anchor = '#'], [string $before_more = '#'], [string $after_more = '#'], [string $format = 'htmlbody'], [integer $cut = 0], [boolean $stripteaser = false], [string $more_file = '']  )

Template function: display content of item

Calling this with "MORE" (i-e displaying full content) will increase the view counter, except on special occasions, see Hit::is_new_view().

WARNING: parameter order is different from deprecated the_content(...)

Parameters:
mixed   $disppage:  page number to display specific page, # for url parameter
mixed   $dispmore:  true to display 'more' text (which means "full post"), false not to display, # for url parameter
string   $more_link_text:  text to display as the more link
string   $more_anchor:  text to display as the more anchor (once the more link has been clicked)
string   $before_more:  string to display before more link/anchor
string   $after_more:  string to display after more link/anchor
string   $format:  Output format, see format_to_output()
integer   $cut:  max number of words
boolean   $stripteaser:  true if you don't want to repeat teaser after more link was pressed
string   $more_file:  filename to use to display more

API Tags:
Uses:  Item::get_content()

Information Tags:
Todo:  fp> Param order and cleanup!

[ Top ]
dbdelete  [line 2709]

  boolean dbdelete( )

Trigger event AfterItemDelete after calling parent method.


API Tags:
Return:  true on success


Redefinition of:
DataObject::dbdelete()
Delete object from DB.

[ Top ]
dbinsert  [line 2545]

  boolean dbinsert( )

Insert object into DB based on previously recorded changes


API Tags:
Return:  true on success


Redefinition of:
DataObject::dbinsert()
Insert object into DB based on previously recorded changes.

[ Top ]
dbupdate  [line 2660]

  boolean dbupdate( )

Update the DB based on previously recorded changes


API Tags:
Return:  true on success


Redefinition of:
DataObject::dbupdate()
Update the DB based on previously recorded changes

[ Top ]
deadline_date  [line 1256]

  void deadline_date( [string $format = ''], [boolean $useGM = false]  )

Template function: display deadline date (datetime) of Item

Parameters:
string   $format:  date/time format: leave empty to use locale default date format
boolean   $useGM:  true if you want GMT


[ Top ]
deadline_time  [line 1271]

  void deadline_time( [string $format = ''], [boolean $useGM = false]  )

Template function: display deadline time (datetime) of Item

Parameters:
string   $format:  date/time format: leave empty to use locale default time format
boolean   $useGM:  true if you want GMT


[ Top ]
delete_link  [line 1815]

  void delete_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [boolean $button = false], [string $actionurl = '#']  )

Displays button for deleting the Item if user has proper rights

Parameters:
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name
boolean   $button:  true to make this a button instead of a link
string   $actionurl:  page url for the delete action


[ Top ]
deprecate_link  [line 1965]

  void deprecate_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $glue = '&amp;']  )

Display link to deprecate a post if user has edit rights

Parameters:
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name
string   $glue:  glue between url params


[ Top ]
edit_link  [line 1866]

  void edit_link( [ $before = ' '], [ $after = ' '], [ $text = '#'], [ $title = '#'], [ $class = ''], [ $actionurl = '#']  )

Parameters:
   $before: 
   $after: 
   $text: 
   $title: 
   $class: 
   $actionurl: 

API Tags:
See:  Item::get_edit_link()


[ Top ]
extra_status  [line 2158]

  void extra_status( [string $before = ''], [string $after = ''], [string $format = 'htmlbody']  )

Template function: display extra status of item

Parameters:
string   $before: 
string   $after: 
string   $format:  Output format, see format_to_output()


[ Top ]
feedback_link  [line 1584]

  void feedback_link( [string $type = 'feedbacks'], [string $before = ''], [string $after = ''], [string $zero = '#'], [string $one = '#'], [string $more = '#'], [string $title = '#'], [string $status = 'published'], [boolean $use_popup = '#'], [boolean $hideifnone = '#'], [string $mode = ''], [string $blogurl = '']  )

Template function: Displays link to feedback page (under some conditions)

Parameters:
string   $type:  Type of feedback to link to (feedbacks (all)/comments/trackbacks/pingbacks)
string   $before:  String to display before the link (if comments are to be displayed)
string   $after:  String to display after the link (if comments are to be displayed)
string   $zero:  Link text to display when there are 0 comments
string   $one:  Link text to display when there is 1 comment
string   $more:  Link text to display when there are >1 comments (include %d for # of comments)
string   $title:  Link title
string   $status:  Status of feedbacks to count
boolean   $use_popup:  true to use a popup windows ('#' to use if comments_popup_windows() is there)
boolean   $hideifnone:  true to hide if no feedback ('#' for default)
string   $mode:  'pid' or 'title'; 'none' for NO LINK
string   $blogurl:  url to use


[ Top ]
feedback_moderation  [line 1704]

  void feedback_moderation( [string $type = 'feedbacks'], [string $before = ''], [string $after = ''], [string $zero = '#'], [string $one = '#'], [string $more = '#'], [string $edit_comments_link = '#'], [boolean $hideifnone = true]  )

Template function: Displays feeback moderation info

Parameters:
string   $type:  Type of feedback to link to (feedbacks (all)/comments/trackbacks/pingbacks)
string   $before:  String to display before the link (if comments are to be displayed)
string   $after:  String to display after the link (if comments are to be displayed)
string   $zero:  Link text to display when there are 0 comments
string   $one:  Link text to display when there is 1 comment
string   $more:  Link text to display when there are >1 comments (include %d for # of comments)
string   $edit_comments_link:  Link
boolean   $hideifnone:  true to hide if no feedback


[ Top ]
get  [line 3137]

  mixed get( mixed $parname  )

Get a member param by its name

Parameters:
mixed   $parname:  Name of parameter

API Tags:
Return:  Value of parameter


Redefinition of:
DataObject::get()
Get a member param by its name

[ Top ]
get_assigned_User  [line 2813]

  User|NULL get_assigned_User( )

Get the User who is assigned to the Item.


API Tags:
Return:  NULL if no user is assigned.


[ Top ]
get_assigned_user_options  [line 686]

  void get_assigned_user_options( )

Template function: get list of assigned user options



[ Top ]
get_Blog  [line 2848]

  Blog &get_Blog( )

Get the Blog object for the Item.



[ Top ]
get_content  [line 1130]

  string get_content( [mixed $disppage = '#'], [mixed $dispmore = '#'], [string $more_link_text = '#'], [string $more_anchor = '#'], [string $before_more = '#'], [string $after_more = '#'], [string $format = 'htmlbody'], [integer $cut = 0], [boolean $stripteaser = false], [string $more_file = '']  )

Template function: get content of item.

Calling this with "MORE" (i-e displaying full content) will increase the view counter, except on special occasions, see Hit::is_new_view().

WARNING: parameter order is different from deprecated the_content(...)

Parameters:
mixed   $disppage:  page number to display specific page, # for url parameter
mixed   $dispmore:  true to display 'more' text (which means "full post"), false not to display, # for url parameter
string   $more_link_text:  text to display as the more link
string   $more_anchor:  text to display as the more anchor (once the more link has been clicked)
string   $before_more:  string to display before more link/anchor
string   $after_more:  string to display after more link/anchor
string   $format:  Output format, see format_to_output()
integer   $cut:  max number of words
boolean   $stripteaser:  true if you don't want to repeat teaser after more link was pressed
string   $more_file:  filename to use to display more

API Tags:
Usedby:  Item::content()

Information Tags:
Todo:  fp> Param order and cleanup!

[ Top ]
get_content_page  [line 1050]

  void get_content_page( integer $page, [string $format = 'htmlbody']  )

Get a specific page to display

Parameters:
integer   $page:  Page number
string   $format:  Format, used to retrieve the matching cache; see format_to_output()


[ Top ]
get_creator_User  [line 2830]

  User &get_creator_User( )

Get the User who created the Item.



[ Top ]
get_delete_link  [line 1749]

  void get_delete_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [boolean $button = false], [string $actionurl = '#']  )

Gets button for deleting the Item if user has proper rights

Parameters:
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name
boolean   $button:  true to make this a button instead of a link
string   $actionurl:  page url for the delete action


[ Top ]
get_deprecate_link  [line 1929]

  void get_deprecate_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $glue = '&amp;']  )

Provide link to deprecate a post if user has edit rights

Parameters:
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name
string   $glue:  glue between url params


[ Top ]
get_edit_link  [line 1831]

  void get_edit_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $actionurl = '#']  )

Provide link to edit a post if user has edit rights

Parameters:
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name
string   $actionurl:  page url for the delete action


[ Top ]
get_issue_date  [line 1298]

  void get_issue_date( [string $format = ''], [boolean $useGM = false]  )

returns issue date (datetime) of Item

Parameters:
string   $format:  date/time format: leave empty to use locale default date format
boolean   $useGM:  true if you want GMT


[ Top ]
get_Links  [line 1283]

  void &get_Links( )

Get reference to array of Links



[ Top ]
get_permanent_link  [line 1517]

  void get_permanent_link( [string $text = '#'], [string $title = '#'], [string $class = '']  )

Returns a permalink link to the Item

Note: If you only want the permalink URL, use Item::get_permanent_url()

Parameters:
string   $text:  link text or special value: '#', '#icon#', '#text#', '#title#'
string   $title:  link title
string   $class:  class name


[ Top ]
get_permanent_url  [line 496]

  void get_permanent_url( [string $mode = ''], [string $blogurl = ''], [boolean $force_single = false], [string $glue = '&amp;']  )

Generate the permalink for the item.

Note: Each item has an unique permalink at any given time. Some admin settings may however change the permalinks for previous items. Note: This actually only returns the URL, to get a real link, use Item::get_permanent_link()

Parameters:
string   $mode:  'urltitle', 'pid', 'archive#id' or 'archive#title'
string   $blogurl:  url to use
boolean   $force_single:  true to force single post on destination page
string   $glue:  glue between url params

Information Tags:
Todo:  archives modes in clean mode

[ Top ]
get_prerendered_content  [line 918]

  string get_prerendered_content( string $format  )

Get the rendered content. If it has not been generated yet, it will.

Parameters:
string   $format:  Format, see format_to_output(). Only "htmlbody", "entityencoded", "xml" and "text" get cached.

Information Tags:
Todo:  dh> Currently this makes up one query per displayed item. Probably the cache should get pre-fetched by ItemList2? fp> DEFINITELY!!! Preloading all pre-rendered contents for the current Itemlistpage is paramount!
Todo:  

dh> In general, $content_prerendered gets only queried once per item, so it seems like a memory waste to cache the query result..!

NOTE: This calls Item::dbupdate(), if renderers get changed (from Plugin hook).


[ Top ]
get_publish_link  [line 1886]

  void get_publish_link( [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = ''], [string $glue = '&amp;']  )

Provide link to publish a post if user has edit rights

Note: publishing date will be updated

Parameters:
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name
string   $glue:  glue between url params


[ Top ]
get_renderers  [line 3215]

  array get_renderers( )

Get the list of renderers for this Item.



[ Top ]
get_renderers_validated  [line 3225]

  array get_renderers_validated( )

Get the list of validated renderers for this Item. This includes stealth plugins etc.


API Tags:
Return:  List of validated renderer codes


[ Top ]
get_trackback_url  [line 2282]

  string get_trackback_url( )

Template function: get url to use to trackback this item



[ Top ]
get_views  [line 2349]

  string get_views( [string $zero = '#'], [string $one = '#'], [string $more = '#']  )

Template function: Display the number of times the Item has been viewed

Note: viewcount is incremented whenever the Item's content is displayed with "MORE" (i-e full content), see Item::content().

Viewcount is NOT incremented on page reloads and other special cases, see Hit::is_new_view()

%d gets replaced in all params by the number of views.

Parameters:
string   $zero:  Link text to display when there are 0 views
string   $one:  Link text to display when there is 1 views
string   $more:  Link text to display when there are >1 views

API Tags:
Return:  The phrase about the number of views.


[ Top ]
handle_post_processing  [line 2879]

  void handle_post_processing( [ $display = true]  )

Execute or schedule post(=after) processing tasks

Includes notifications & pings

Parameters:
   $display: 


[ Top ]
inc_viewcount  [line 2786]

  boolean inc_viewcount( )

Increment the view count of the item directly in DB (if the item's Author is not $current_User).

This method serves TWO purposes (that would break if we used dbupdate() ) :

  • Increment the viewcount WITHOUT affecting the lastmodified date and user.
  • Increment the viewcount in an ATOMIC manner (even if several hits on the same Item occur simultaneously).
This also triggers the plugin event 'ItemViewsIncreased' if the view count has been increased.


API Tags:
Return:  Did we increase view count?


[ Top ]
insert  [line 2480]

  void insert( $author_user_ID, $post_title, $post_content, $post_timestamp, [ $main_cat_ID = 1], [ $extra_cat_IDs = array()], [ $post_status = 'published'], [ $post_locale = '#'], [ $post_urltitle = ''], [ $post_url = ''], [ $post_comment_status = 'open'], [ $post_renderers = array('default')], [ $item_typ_ID = 1], [ $item_st_ID = NULL]  )

Create a new Item/Post and insert it into the DB

This function has to handle all needed DB dependencies!

Parameters:
   $author_user_ID: 
   $post_title: 
   $post_content: 
   $post_timestamp: 
   $main_cat_ID: 
   $extra_cat_IDs: 
   $post_status: 
   $post_locale: 
   $post_urltitle: 
   $post_url: 
   $post_comment_status: 
   $post_renderers: 
   $item_typ_ID: 
   $item_st_ID: 

Information Tags:
Todo:  cleanup the set() calls

[ Top ]
insert_update_extracats  [line 2745]

  void insert_update_extracats( string $mode  )

Parameters:
string   $mode:  'insert' | 'update'


[ Top ]
issue_date  [line 1313]

  void issue_date( [string $format = ''], [boolean $useGM = false]  )

Template function: display issue date (datetime) of Item

Parameters:
string   $format:  date/time format: leave empty to use locale default date format
boolean   $useGM:  true if you want GMT


[ Top ]
issue_time  [line 1325]

  void issue_time( [string $format = ''], [boolean $useGM = false]  )

Template function: display issue time (datetime) of Item

Parameters:
string   $format:  date/time format: leave empty to use locale default time format
boolean   $useGM:  true if you want GMT


[ Top ]
lang  [line 1337]

  void lang( )

Template function: display locale for item



[ Top ]
language  [line 1382]

  void language( [string $format = 'htmlbody']  )

Template function: display language name for item

Parameters:
string   $format:  Output format, see format_to_output()


[ Top ]
linkcount  [line 1346]

  void linkcount( )

Template function: display number of links attached to this Item



[ Top ]
load_Blog  [line 2864]

  void load_Blog( )

Load the Blog object for the Item, without returning it.

This is needed for Results object callbacks.



[ Top ]
load_from_Request  [line 395]

  boolean load_from_Request( [boolean $force_edit_date = false]  )

Load data from Request form fields.

This requires the blog (e.g. $blog_ID or $main_cat_ID to be set).

Parameters:
boolean   $force_edit_date:  true to force edit date (as long as perms permit)

API Tags:
Return:  true if loaded data seems valid.


[ Top ]
load_links  [line 1358]

  void load_links( )

Load links if they were not loaded yet.



[ Top ]
locale  [line 1371]

  void locale( )

Template function: display locale for item



[ Top ]
main_category  [line 797]

  void main_category( [string $format = 'htmlbody']  )

Template function: display main category name

Parameters:
string   $format:  Output format, see format_to_output()


[ Top ]
mod_date  [line 1470]

  void mod_date( [string $format = ''], [boolean $useGM = false]  )

Template function: display last mod date (datetime) of Item

Parameters:
string   $format:  date/time format: leave empty to use locale default date format
boolean   $useGM:  true if you want GMT


[ Top ]
mod_time  [line 1485]

  void mod_time( [string $format = ''], [boolean $useGM = false]  )

Template function: display last mod time (datetime) of Item

Parameters:
string   $format:  date/time format: leave empty to use locale default time format
boolean   $useGM:  true if you want GMT


[ Top ]
msgform_link  [line 1401]

  boolean msgform_link( string $form_url, [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = '']  )

Template function: Provide link to message form for this Item's author.

Parameters:
string   $form_url:  url of the message form
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name

API Tags:
Return:  true, if a link was displayed; false if there's no email address for the Item's author.


[ Top ]
msgform_link_assigned  [line 1441]

  boolean msgform_link_assigned( string $form_url, [string $before = ' '], [string $after = ' '], [string $text = '#'], [string $title = '#'], [string $class = '']  )

Template function: Provide link to message form for this Item's assigned User.

Parameters:
string   $form_url:  url of the message form
string   $before:  to display before link
string   $after:  to display after link
string   $text:  link text
string   $title:  link title
string   $class:  class name

API Tags:
Return:  true, if a link was displayed; false if there's no email address for the assigned User.


[ Top ]
permanent_link  [line 1562]

  void permanent_link( [string $text = '#'], [string $title = '#'], [string $class = '']  )

Displays a permalink link to the Item

Note: If you only want the permalink URL, use Item::permanent_url()

Parameters:
string   $text:  link text or special value: '#', '#icon#', '#text#', '#title#'
string   $title:  link title
string   $class:  class name


[ Top ]
permanent_url  [line 1502]

  void permanent_url( [string $mode = ''], [string $blogurl = '']  )

Template function: display permalink for item

Note: This actually only outputs the URL, to display a real link, use Item::permanent_link()

Parameters:
string   $mode:  'post', 'archive#id' or 'archive#title'
string   $blogurl:  url to use


[ Top ]
priority  [line 1977]

  void priority( [string $before = ''], [string $after = '']  )

Template function: display priority of item

Parameters:
string   $before: 
string   $after: 


[ Top ]
priority_options  [line 1991]

  void priority_options( $field_value, $allow_none  )

Template function: display list of priority options

Parameters:
   $field_value: 
   $allow_none: 


[ Top ]
publish_link  [line 1913]

  void publish_link( [ $before = ' '], [ $after = ' '], [ $text = '#'], [ $title = '#'], [ $class = ''], [ $glue = '&amp;']  )

Parameters:
   $before: 
   $after: 
   $text: 
   $title: 
   $class: 
   $glue: 


[ Top ]
remove_renderer  [line 3262]

  boolean remove_renderer( string $renderer_code  )

Remove a renderer (by code) from the Item.

Parameters:
string   $renderer_code:  Renderer code to remove for this item

API Tags:
Return:  True if renderers have changed


[ Top ]
renderer_checkboxes  [line 2018]

  void renderer_checkboxes( [array|NULL $item_renderers = NULL]  )

Template function: display checkable list of renderers

Parameters:
array|NULL   $item_renderers:  If given, assume these renderers to be checked.


[ Top ]
send_email_notifications  [line 2990]

  void send_email_notifications( [ $display = true]  )

Send email notifications to subscribed users

Parameters:
   $display: 

Information Tags:
Todo:  fp>> shall we notify suscribers of blog were this is in extra-cat? blueyed>> IMHO yes.

[ Top ]
send_outbound_pings  [line 3091]

  void send_outbound_pings( [boolean $display = true]  )

Send outbound pings for a post

Parameters:
boolean   $display:  Display?


[ Top ]
set  [line 2396]

  boolean set( string $parname, mixed $parvalue, [boolean $make_null = false]  )

Set param value

By default, all values will be considered strings

Parameters:
string   $parname:  parameter name
mixed   $parvalue:  parameter value
boolean   $make_null:  true to set to NULL if empty value

API Tags:
Return:  true, if a value has been set; false if it has not changed

Information Tags:
Todo:  extra_cat_IDs recording

Redefinition of:
DataObject::set()
Set param value

[ Top ]
set_creator_User  [line 2465]

  boolean set_creator_User( User &$creator_User  )

Set the Author of the Item.

Parameters:
User   &$creator_User:  (Do NOT set to NULL or you may kill the current_User)

API Tags:
Return:  true, if it has been set; false if it has not changed


[ Top ]
set_prerendered_content  [line 987]

  void set_prerendered_content( string $content, string $cache_key  )

Set the pre-rendered content.

This is meant to get called by ItemList2, which would do a single query for all items.

Parameters:
string   $content:  Pre-rendered content
string   $cache_key:  Cache-Key ($format.'/'.$renderers). See Item::get_prerendered_content() for the appropriate query skeleton.


[ Top ]
set_renderers  [line 2453]

  boolean set_renderers( array $renderers  )

Set the renderers of the Item.

Parameters:
array   $renderers:  List of renderer codes.

API Tags:
Return:  true, if it has been set; false if it has not changed


[ Top ]
split_pages  [line 1033]

  void split_pages( [string $format = 'htmlbody']  )

Make sure, the pages are split up

Parameters:
string   $format:  Format, used to retrieve the matching cache; see format_to_output()


[ Top ]
status  [line 2136]

  void status( [string $format = 'htmlbody']  )

Template function: display status of item

Statuses:

  • published
  • deprecated
  • protected
  • private
  • draft

Parameters:
string   $format:  Output format, see format_to_output()


[ Top ]
title  [line 2209]

  void title( [string $before = ''], [string $after = ''], [boolean $add_link = true], [string $format = 'htmlbody']  )

Template function: display title for item and link to related URL

Parameters:
string   $before:  String to display before the title if there is something to display
string   $after:  String to display after the title if there is something to display
boolean   $add_link:  false if you don't want to link to related URL (if applicable)
string   $format:  Output format, see format_to_output()


[ Top ]
trackback_rdf  [line 2241]

  void trackback_rdf( )

Template function: Displays trackback autodiscovery information



[ Top ]
trackback_url  [line 2272]

  void trackback_url( )

Template function: displays url to use to trackback this item



[ Top ]
type  [line 2178]

  void type( [string $before = ''], [string $after = ''], [string $format = 'htmlbody']  )

Template function: display type of item

Parameters:
string   $before: 
string   $after: 
string   $format:  Output format, see format_to_output()


[ Top ]
update  [line 2609]

  void update( string $post_title, string $post_content, [string $post_timestamp = ''], [integer $main_cat_ID = 1], [array $extra_cat_IDs = array()], [string $post_status = 'published'], [string $post_locale = '#'], [mixed $post_trackbacks = ''], [integer $autobr = 0], [boolean $pingsdone = true], [string $post_urltitle = ''], [string $post_url = ''], [string $post_comment_status = 'open'], [array $post_renderers = array()], [integer $item_typ_ID = 0], [integer $item_st_ID = 0]  )

Update a post and save to DB

This function has to handle all needed DB dependencies!

Parameters:
string   $post_title:  Title
string   $post_content:  Content
string   $post_timestamp:  Timestamp ('Y-m-d H:i:s')
integer   $main_cat_ID:  Main category ID
array   $extra_cat_IDs:  List of extra cats
string   $post_status:  Status ('published', 'deprecated', 'protected', 'private' or 'draft'). Empty to not change it.
string   $post_locale:  Locale. '#' to not change it.
mixed   $post_trackbacks:  Not used
integer   $autobr:  OBSOLETE
boolean   $pingsdone:  Pings done?
string   $post_urltitle:  URL title
string   $post_url:  URL
string   $post_comment_status:  Post comment status
array   $post_renderers:  Renderers
integer   $item_typ_ID:  Typ ID
integer   $item_st_ID:  Status(?) ID

API Tags:
Deprecated:  since 1.9 - not used in the core anymore


[ Top ]
update_renderers_from_Plugins  [line 998]

  boolean update_renderers_from_Plugins( )

Trigger Plugin::ItemApplyAsRenderer() event and adjust renderers according to return value.


API Tags:
Return:  True if renderers got changed.


[ Top ]
url_link  [line 2306]

  void url_link( [string $before = ''], [string $after = ''], [string $text = '%s'], [array $attribs = array()], [string $format = 'htmlbody']  )

Template function: Display link to item related url

Parameters:
string   $before:  string to display before the link (if exists)
string   $after:  string to display after the link (if exists)
string   $text:  Link text to use (%s gets replaced by the URL).
array   $attribs:  Attributes for the <a> tag (if the href attribute is set, %s gets replaced by the URL).
string   $format:  Output format, see format_to_output()


[ Top ]
views  [line 2376]

  integer views( [string $zero = '#'], [string $one = '#'], [string $more = '#']  )

Template function: Display a phrase about the number of Item views.

Parameters:
string   $zero:  Link text to display when there are 0 views
string   $one:  Link text to display when there is 1 views
string   $more:  Link text to display when there are >1 views (include %d for # of views)

API Tags:
Return:  Number of views.


[ Top ]
wordcount  [line 2328]

  void wordcount( )

Template function: Display the number of words in the post



[ Top ]

Documentation generated on Tue, 20 May 2008 01:41:45 +0200 by phpDocumentor 1.4.2