phpDocumentor collections
[ class tree: collections ] [ index: collections ] [ all elements ]

Class: Blog

Source Location: /qp_inc/collections/model/_blog.class.php

Class Blog

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
mixed   $access_type  
mixed   $advanced_perms  
mixed   $allowblogcss  
mixed   $allowcomments  
mixed   $allowtrackbacks  
mixed   $allowusercss  
CollectionSettings   $CollectionSettings   Additional settings for the collection. lazy filled.
mixed   $default_cat_ID  
mixed   $in_bloglist  
mixed   $keywords  
mixed   $links_blog_ID  
mixed   $locale  
mixed   $longdesc  
mixed   $media_fullpath  
mixed   $media_location  
mixed   $media_subdir  
mixed   $media_url  
mixed   $name  
mixed   $notes  
User   $owner_User   Lazy filled.
mixed   $owner_user_ID  
mixed   $shortdesc  
mixed   $shortname  
mixed   $siteurl  
mixed   $stub  
mixed   $tagline  
mixed   $template_ID  
mixed   $UID  
mixed   $urlname  

[ Top ]
Method Summary
static string   kind_name()  
Blog   Blog()   Constructor
void   contact_link()   T-Tag: displays a link to the contact form for the owner of the current Blog
void   credits_link()   T-Tag: Display a link to the current blog's credits page
void   dbdelete()   Delete a blog and dependencies from database
void   dbinsert()   Insert into the DB
void   dbupdate()   Update the DB based on previously recorded changes
void   footer_text()   T-Tag: Display the footer text for the current Blog
string   gen_archive_link()   Generate link to archive
void   gen_archive_url()   Generate archive page URL
void   gen_baseurl()   Generate the baseurl of the blog (URL of the folder where the blog lives)
void   gen_blogurl()   Generate blog URL
void   gen_tag_url()   Generate a tag url on this blog
false|string   get()   Get a param.
string   get_allowed_item_status()   Get allowed post status for current user in this blog
void   get_archive_url()   Get archive page URL
void   get_comment_feed_url()   Get URL to display the blog comments in an XML feed.
void   get_contact_url()  
void   get_default_cat_ID()   Get default category for current blog
void   get_filemanager_link()   Get link to edit files
void   get_item_feed_url()   Get URL to display the blog posts in an XML feed.
string   get_maxlen_name()   Get the max length of the blog name
string   get_media_dir()   Get the blog's media directory (and create it if necessary).
string   get_media_url()   Get the URL to the media folder
string   get_name()   Get the name of the blog
User   &get_owner_User()   Resolve user ID of owner
string|false|NULL   get_setting()   Get a setting.
string   get_sql_where_aggregate_coll_IDs()   Get SQL expression to match the list of aggregates collection IDs.
string   get_tag_link()   Get a link (<a href>) to the tag page of a given tag.
void   get_tag_post_count()   Get # of posts for a given tag
void   get_viewmode_url()   Get URL to display the blog with a temporary template.
void   init_by_kind()  
void   load_CollectionSettings()   Make sure collection settings are loaded
boolean   load_from_Request()   Load data from Request form fields.
void   longdesc()   T-Tag: Display the current blog's long description
void   name()   T-Tag: Display the current blog's name
string   replace_callback()   Callback function for footer_text()
boolean   set()   Set param value
void   set_media_fullpath()   Set the full path of the media folder
void   set_media_subdir()   Set the media folder's subdir
void   set_media_url()   Set the full URL of the media folder
boolean   set_setting()   Set a setting.
void   tagline()   T-Tag: Display the current blog's tagline

[ Top ]
Properties
mixed   $access_type [line 79]

[ Top ]
mixed   $advanced_perms = 0 [line 77]

[ Top ]
mixed   $allowblogcss = 0 [line 88]

[ Top ]
mixed   $allowcomments = 'post_by_post' [line 86]

[ Top ]
mixed   $allowtrackbacks = 0 [line 87]

[ Top ]
mixed   $allowusercss = 0 [line 89]

[ Top ]
CollectionSettings   $CollectionSettings [line 62]

Additional settings for the collection. lazy filled.

Any non vital params should go into there (this includes many of the above).

API Tags:
See:  Blog::load_CollectionSettings()
See:  Blog::set_setting()
See:  Blog::get_setting()


[ Top ]
mixed   $default_cat_ID [line 97]

[ Top ]
mixed   $in_bloglist = 1 [line 91]

[ Top ]
mixed   $keywords [line 85]

[ Top ]
mixed   $links_blog_ID = 0 [line 83]

[ Top ]
mixed   $locale [line 78]

[ Top ]
mixed   $longdesc [line 75]

[ Top ]
mixed   $media_fullpath = '' [line 95]

[ Top ]
mixed   $media_location = 'default' [line 93]

[ Top ]
mixed   $media_subdir = '' [line 94]

[ Top ]
mixed   $media_url = '' [line 96]

[ Top ]
mixed   $name [line 72]

[ Top ]
mixed   $notes [line 84]

[ Top ]
User   $owner_User = NULL [line 69]

Lazy filled.

API Tags:
See:  Blog::get_owner_User()
Access:  protected


[ Top ]
mixed   $owner_user_ID [line 76]

[ Top ]
mixed   $shortdesc [line 74]

[ Top ]
mixed   $shortname [line 71]

[ Top ]
mixed   $siteurl [line 80]

[ Top ]
mixed   $stub [line 81]

[ Top ]
mixed   $tagline [line 73]

[ Top ]
mixed   $template_ID [line 90]

[ Top ]
mixed   $UID [line 92]

[ Top ]
mixed   $urlname [line 82]

[ Top ]
Methods
static method kind_name  [line 1263]

  static string kind_name( string $kind  )

Parameters:
string   $kind: 


[ Top ]
Constructor Blog  [line 104]

  Blog Blog( [object DB $db_row = NULL]  )

Constructor

Parameters:
object DB   $db_row:  row


[ Top ]
contact_link  [line 250]

  void contact_link( [ $params = array()]  )

T-Tag: displays a link to the contact form for the owner of the current Blog

  1.  $params array_mergearray(
  2.    'before' => '',
  3.    'after'  => ' ',
  4.    'text'   => T_('Contact'),
  5.    'title'  => T_('Send a message to the owner of this blog...'),
  6.  )$params );

Parameters:
   $params: 

Information Tags:
Todo:  EdB: one day this needs a 'class' param instead of assuming "contact_link"

[ Top ]
credits_link  [line 193]

  void credits_link( [ $params = array()]  )

T-Tag: Display a link to the current blog's credits page

  1.  $params array_mergearray(
  2.    'before' => '',
  3.    'after' => ' ',
  4.    'credits_text' => T_('software credits'),
  5.    'credits_title' => T_('see who wrote the code that helps make this website'),
  6.    'powered_text' => T_('powered by'),
  7.    'powered_title' => T_('this website is powered by Quam Plures'),
  8.    'class' => '',
  9.  )$params );

Parameters:
   $params: 


[ Top ]
dbdelete  [line 282]

  void dbdelete( [boolean $echo = false]  )

Delete a blog and dependencies from database

Includes WAY TOO MANY requests because we try to be compatible with MySQL 3.23, bleh!

Parameters:
boolean   $echo:  true if you want to echo progress


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

[ Top ]
dbinsert  [line 365]

  void dbinsert( )

Insert into the DB



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

[ Top ]
dbupdate  [line 392]

  void dbupdate( )

Update the DB based on previously recorded changes



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

[ Top ]
footer_text  [line 419]

  void footer_text( $params  )

T-Tag: Display the footer text for the current Blog

  1.  $params array_mergearray(
  2.    'before' => '',
  3.    'after'  => ' ',
  4.  )$params );

Parameters:
   $params: 


[ Top ]
gen_archive_link  [line 448]

  string gen_archive_link( $text, $title, $year, [ $month = NULL], [ $day = NULL], [ $week = NULL], [ $glue = '&amp;'], [ $paged = 1]  )

Generate link to archive

Parameters:
   $text: 
   $title: 
   $year: 
   $month: 
   $day: 
   $week: 
   $glue: 
   $paged: 

API Tags:
Return:  HTML A tag
Uses:  Blog::gen_archive_url()


[ Top ]
gen_archive_url  [line 481]

  void gen_archive_url( string $year, [string $month = NULL], [string $day = NULL], [string $week = NULL], [ $glue = '&amp;'], [ $paged = 1]  )

Generate archive page URL

Note: there ate two similar functions here.

Parameters:
string   $year:  year
string   $month:  month
string   $day:  day
string   $week:  week
   $glue: 
   $paged: 

API Tags:
See:  Blog::get_archive_url()
Usedby:  Blog::get_archive_url()
Usedby:  Blog::gen_archive_link()


[ Top ]
gen_baseurl  [line 547]

  void gen_baseurl( )

Generate the baseurl of the blog (URL of the folder where the blog lives)


Information Tags:
Todo:  test

[ Top ]
gen_blogurl  [line 587]

  void gen_blogurl( [string $type = 'default']  )

Generate blog URL

Parameters:
string   $type:  default|dynamic|static


[ Top ]
gen_tag_url  [line 634]

  void gen_tag_url( $tag, [ $paged = 1], [ $glue = '&amp;']  )

Generate a tag url on this blog

Parameters:
   $tag: 
   $paged: 
   $glue: 


[ Top ]
get  [line 692]

  false|string get( string $parname  )

Get a param.

Parameters:
string   $parname:  Parameter name

API Tags:
Return:  The value as string or false in case of error (e.g. media dir is disabled).


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

[ Top ]
get_allowed_item_status  [line 813]

  string get_allowed_item_status( [string $status = NULL]  )

Get allowed post status for current user in this blog

Parameters:
string   $status:  status to start with. Empty to use default.

API Tags:
Return:  authorized status; NULL if none

Information Tags:
Todo:  make default a Blog param

[ Top ]
get_archive_url  [line 878]

  void get_archive_url( string $date, [ $glue = '&amp;']  )

Get archive page URL

Note: there are two similar functions here.

Parameters:
string   $date:  monthly, weekly, daily
   $glue: 

API Tags:
Uses:  Blog::gen_archive_url()


[ Top ]
get_comment_feed_url  [line 907]

  void get_comment_feed_url( string $template_folder_name  )

Get URL to display the blog comments in an XML feed.

Parameters:
string   $template_folder_name: 


[ Top ]
get_contact_url  [line 916]

  void get_contact_url( [boolean $with_redirect = true]  )

Parameters:
boolean   $with_redirect:  do we want to redirect back to where we came from after message?


[ Top ]
get_default_cat_ID  [line 937]

  void get_default_cat_ID( )

Get default category for current blog


Information Tags:
Todo:  fp> this is a super lame stub, but it's still better than nothing. Should be user configurable.

[ Top ]
get_filemanager_link  [line 981]

  void get_filemanager_link( string 0  )

Get link to edit files

Parameters:
string   0:  link (false on error)


[ Top ]
get_item_feed_url  [line 995]

  void get_item_feed_url( string $template_folder_name  )

Get URL to display the blog posts in an XML feed.

Parameters:
string   $template_folder_name: 


[ Top ]
get_maxlen_name  [line 1006]

  string get_maxlen_name( [ $maxlen = 50]  )

Get the max length of the blog name

Parameters:
   $maxlen: 


[ Top ]
get_media_dir  [line 1022]

  string get_media_dir( [boolean $create = true]  )

Get the blog's media directory (and create it if necessary).

If we're on an admin page, it adds status messages.

Parameters:
boolean   $create:  Create the directory, if it does not exist yet?

API Tags:
Return:  path string on success, false if the dir could not be created

Information Tags:
Todo:  These status messages should rather go to a "syslog" and not be displayed to a normal user
Todo:  dh> refactor this into e.g. create_media_dir() and use it for Blog::get_media_dir, too.

[ Top ]
get_media_url  [line 1095]

  string get_media_url( )

Get the URL to the media folder


API Tags:
Return:  the URL


[ Top ]
get_name  [line 1130]

  string get_name( )

Get the name of the blog



[ Top ]
get_owner_User  [line 166]

  User &get_owner_User( )

Resolve user ID of owner



[ Top ]
get_setting  [line 1141]

  string|false|NULL get_setting( $parname  )

Get a setting.

Parameters:
   $parname: 

API Tags:
Return:  value as string on success; NULL if not found; false in case of error


[ Top ]
get_sql_where_aggregate_coll_IDs  [line 1207]

  string get_sql_where_aggregate_coll_IDs( string $field  )

Get SQL expression to match the list of aggregates collection IDs.

This resolves as follows:

  • empty: current blog only
  • "*": all blogs (returns "1" as in "WHERE 1")
  • other: as present in DB

Parameters:
string   $field:  SQL field name

API Tags:
Return:  e.g. "$field IN (1,5)"


[ Top ]
get_tag_link  [line 1157]

  string get_tag_link( string $tag, [string $text = NULL], [array $attribs = array()]  )

Get a link (<a href>) to the tag page of a given tag.

Parameters:
string   $tag:  Tag
string   $text:  Link text (defaults to tag name)
array   $attribs:  Additional attributes for the A tag (href gets overridden).

API Tags:
Return:  The <a href> link


[ Top ]
get_tag_post_count  [line 1180]

  void get_tag_post_count( $tag  )

Get # of posts for a given tag

Parameters:
   $tag: 


[ Top ]
get_viewmode_url  [line 854]

  void get_viewmode_url( string $template_folder_name, [string $additional_params = ''], [boolean $halt_on_error = false]  )

Get URL to display the blog with a temporary template.

This is used to construct the various RSS/Atom feeds

Parameters:
string   $template_folder_name: 
string   $additional_params: 
boolean   $halt_on_error: 


[ Top ]
init_by_kind  [line 1228]

  void init_by_kind( string $kind, [ $name = NULL], [ $shortname = NULL], [ $urlname = NULL]  )

Parameters:
string   $kind: 
   $name: 
   $shortname: 
   $urlname: 


[ Top ]
load_CollectionSettings  [line 1283]

  void load_CollectionSettings( )

Make sure collection settings are loaded



[ Top ]
load_from_Request  [line 1299]

  boolean load_from_Request( [array $groups = array()]  )

Load data from Request form fields.

Parameters:
array   $groups:  groups of params to load

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


[ Top ]
longdesc  [line 1726]

  void longdesc( [ $params = array()]  )

T-Tag: Display the current blog's long description

  1.  $params array_mergearray(
  2.    'before' => '',
  3.    'after'  => ' ',
  4.    'format' => 'htmlbody',
  5.  )$params );

Parameters:
   $params: 


[ Top ]
name  [line 1755]

  void name( [ $params = array()]  )

T-Tag: Display the current blog's name

  1.  $params array_mergearray(
  2.    'before' => '',
  3.    'after'  => ' ',
  4.    'format' => 'htmlbody',
  5.  )$params );

Parameters:
   $params: 


[ Top ]
replace_callback  [line 1778]

  string replace_callback( array $matches  )

Callback function for footer_text()

Parameters:
array   $matches: 


[ Top ]
set  [line 1814]

  boolean set( string $parname, $parvalue  )

Set param value

Parameters:
string   $parname:  Parameter name
   $parvalue: 

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


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

[ Top ]
set_media_fullpath  [line 1842]

  void set_media_fullpath( string $path  )

Set the full path of the media folder

Parameters:
string   $path:  the full path


[ Top ]
set_media_subdir  [line 1864]

  void set_media_subdir( string $path  )

Set the media folder's subdir

Parameters:
string   $path:  the subdirectory


[ Top ]
set_media_url  [line 1853]

  void set_media_url( string $url  )

Set the full URL of the media folder

Parameters:
string   $url:  the full URL


[ Top ]
set_setting  [line 1875]

  boolean set_setting( $parname, $value, [ $make_null = false]  )

Set a setting.

Parameters:
   $parname: 
   $value: 
   $make_null: 

API Tags:
Return:  true, if the value has been set, false if it has not changed.


[ Top ]
tagline  [line 1900]

  void tagline( [ $params = array()]  )

T-Tag: Display the current blog's tagline

  1.  $params array_mergearray(
  2.    'before' => '',
  3.    'after'  => ' ',
  4.    'format' => 'htmlbody',
  5.  )$params );

Parameters:
   $params: 


[ Top ]