b2evolution

Multilingual multiuser multiblog engine

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

Class: Item

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

Class Item

Class Overview
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  
User   $creator_User   The User who has created the Item (lazy-filled).
integer   $creator_user_ID  
mixed   $deadline  
NULL|array   $extra_cat_IDs  
mixed   $flags  
string   $issue_date  
array   $Links   Array of Links attached to this item.
string   $locale   Locale code for the Item content.
mixed   $main_cat_ID  
mixed   $mod_date  
mixed   $priorities  
mixed   $priority  
string   $renderers  
string   $status   The visibility status of the item.
mixed   $st_ID  
mixed   $title  
mixed   $typ_ID  
mixed   $url  
mixed   $urltitle  
mixed   $wordcount  

[ Top ]
Method Summary
Item   Item()   Constructor
void   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.
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.
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.
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
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()  
void   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
boolean   set()   Set param value
boolean   set_creator_User()   Set the Author of the Item.
boolean   set_renderers()   Set the renderers of the Item.
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
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 117]

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 122]

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


[ Top ]
Blog   $Blog [line 175]

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

API Tags:
Access:  protected


[ Top ]
integer   $blog_ID [line 169]

Derived from $main_cat_ID


[ Top ]
string   $comment_status [line 157]

Comments status


[ Top ]
mixed   $content [line 145]

[ Top ]
User   $creator_User [line 94]

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 107]

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

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

[ Top ]
mixed   $flags [line 148]

[ Top ]
string   $issue_date [line 127]

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

Array of Links attached to this item.

NULL when not initialized.

API Tags:
Access:  public


[ Top ]
string   $locale [line 141]

Locale code for the Item content.

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


[ Top ]
mixed   $main_cat_ID = 0 [line 147]

[ Top ]
mixed   $mod_date [line 128]

[ Top ]
mixed   $priorities [line 193]

[ Top ]
mixed   $priority [line 162]

[ Top ]
string   $renderers [line 152]

[ Top ]
string   $status [line 133]

The visibility status of the item.


[ Top ]
mixed   $st_ID [line 160]

[ Top ]
mixed   $title [line 142]

[ Top ]
mixed   $typ_ID [line 159]

[ Top ]
mixed   $url [line 158]

[ Top ]
mixed   $urltitle [line 143]

[ Top ]
mixed   $wordcount = 0 [line 146]

[ Top ]
Methods
Constructor Item  [line 209]

  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 2765]

  void add_renderer( string $renderer_code  )

Add a renderer (by code) to the Item.

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


[ Top ]
anchor  [line 553]

  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 588]

  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 602]

  void assigned_user_options( )

Template function: display list of assigned user options



[ Top ]
assign_to  [line 298]

  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 2734]

  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 340]

  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 635]

  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 757]

  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 736]

  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 655]

  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 852]

  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

Information Tags:
Todo:  Param order and cleanup

[ Top ]
dbdelete  [line 2421]

  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 2285]

  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 2380]

  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 1001]

  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 1016]

  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 1563]

  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 1713]

  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 1614]

  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 1899]

  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 1328]

  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 1452]

  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 2678]

  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 2513]

  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 616]

  void get_assigned_user_options( )

Template function: get list of assigned user options



[ Top ]
get_Blog  [line 2548]

  Blog &get_Blog( )

Get the Blog object for the Item.



[ Top ]
get_creator_User  [line 2530]

  User &get_creator_User( )

Get the User who created the Item.



[ Top ]
get_delete_link  [line 1497]

  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 1677]

  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 1579]

  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 1043]

  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 1028]

  void &get_Links( )

Get reference to array of Links



[ Top ]
get_permanent_link  [line 1261]

  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 426]

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

Generate the permalink for the item.

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_publish_link  [line 1634]

  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 2755]

  array get_renderers( )

Get the list of renderers for this Item.



[ Top ]
get_trackback_url  [line 2021]

  string get_trackback_url( )

Template function: get url to use to trackback this item



[ Top ]
get_views  [line 2088]

  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 ]
inc_viewcount  [line 2486]

  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 2222]

  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_trackbacks = ''], [ $autobr = 0], [ $pingsdone = true], [ $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_trackbacks: 
   $autobr: 
   $pingsdone: 
   $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 2445]

  void insert_update_extracats( string $mode  )

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


[ Top ]
issue_date  [line 1058]

  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 1070]

  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 1082]

  void lang( )

Template function: display locale for item



[ Top ]
language  [line 1127]

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

Template function: display language name for item

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


[ Top ]
linkcount  [line 1091]

  void linkcount( )

Template function: display number of links attached to this Item



[ Top ]
load_Blog  [line 2564]

  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 357]

  boolean load_from_Request( [boolean $force_edit_date = false]  )

Load data from Request form fields.

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 1103]

  void load_links( )

Load links if they were not loaded yet.



[ Top ]
locale  [line 1116]

  void locale( )

Template function: display locale for item



[ Top ]
main_category  [line 724]

  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 1214]

  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 1229]

  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 1146]

  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 1185]

  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 1306]

  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 1246]

  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 1725]

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

Template function: display priority of item

Parameters:
string   $before: 
string   $after: 


[ Top ]
priority_options  [line 1739]

  void priority_options( $field_value, $allow_none  )

Template function: display list of priority options

Parameters:
   $field_value: 
   $allow_none: 


[ Top ]
publish_link  [line 1661]

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

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


[ Top ]
remove_renderer  [line 2782]

  void remove_renderer( string $renderer_code  )

Remove a renderer (by code) from the Item.

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


[ Top ]
renderer_checkboxes  [line 1764]

  void renderer_checkboxes( )

Template function: display checkable list of renderers



[ Top ]
send_email_notifications  [line 2580]

  void send_email_notifications( [ $display = true]  )

Send email notifications to subscribed users

Parameters:
   $display: 

Information Tags:
Todo:  shall we notify suscribers of blog were this is in extra-cat? blueyed>> IMHO yes. fp>>why not but is this important? blueyed>> Not really, just have answered.. :)

[ Top ]
set  [line 2135]

  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 2207]

  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_renderers  [line 2195]

  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 ]
status  [line 1877]

  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 1950]

  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 1982]

  void trackback_rdf( )

Template function: Displays trackback autodiscovery information



[ Top ]
trackback_url  [line 2011]

  void trackback_url( )

Template function: displays url to use to trackback this item



[ Top ]
type  [line 1919]

  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 2328]

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

Update a post and save to DB

This function has to handle all needed DB dependencies!

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

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


[ Top ]
url_link  [line 2045]

  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 2115]

  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 2067]

  void wordcount( )

Template function: Display the number of words in the post



[ Top ]

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