FUEL CMS User Guide : Version 1.5.2


Fuel Blog Class

This class extends the Fuel_advanced_module class.

Properties Reference

Property Default Value Description
protected
_settings N/A
_current_post N/A

Function Reference [+]

$this->fuel->blog->title()

Returns the title of the blog specified in the settings.

Returns

string

$this->fuel->blog->description()

Returns the descripton of the blog specified in the settings.

Returns

string

$this->fuel->blog->language(['$code'=FALSE])

Returns the language abbreviation currently used in CodeIgniter.

Returns

string

Parameters

(boolean) $code 

$this->fuel->blog->domain()

Returns the domain to be used for the blog based on the FUEL configuration. If empty it will return whatever $_SERVER['SERVER_NAME']. Needed for Atom feeds.

Returns

string

$this->fuel->blog->url(['$uri'=''])

Returns the blog specific URL.

Returns

string

Parameters

(string) $uri 

$this->fuel->blog->uri(['$uri'=''])

Returns the blog specific URI.

Returns

string

Parameters

(string) $uri 

$this->fuel->blog->uri_segment('$n', ['$default'=FALSE], ['$rerouted'=TRUE], ['$strip_lang'=TRUE])

Returns the blog specific URI.

Returns

string

Parameters

(string) $n 

$this->fuel->blog->feed(['$type'='rss'], ['$slug'=''])

Returns the blog specific RSS feed URL.

Returns

string

Parameters

(string) $type 
(string) $slug 

$this->fuel->blog->feed_header()

Sets the HTTP headers needed for the RSS feed.

Returns

string

$this->fuel->blog->feed_output(['$type'='rss'], ['$slug'=NULL])

Returns the output for the RSS feed.

Returns

string

Parameters

(string) $type 
(string) $slug 

$this->fuel->blog->feed_data(['$slug'=NULL], ['$type'='categories'], ['$limit'=10])

Returns the data need for the blog feed.

Returns

array

Parameters

(string) $slug 
(string) $type 

$this->fuel->blog->last_updated()

Returns last updated blog post.

Returns

string

$this->fuel->blog->theme_path()

Returns the path to the theme view files.

Returns

string

$this->fuel->blog->layout()

Returns name of the theme layout file to use.

Returns

string

$this->fuel->blog->image_path('$image', ['$variable'=NULL], ['$is_server'=FALSE])

Returns an image based on the assets upload path.

Returns

string

Parameters

(string) $image 
(string) $variable 
(boolean) $is_server 

$this->fuel->blog->is_home()

Returns a boolean value whether it is the home page.

Returns

boolean

$this->fuel->blog->header([$vars=array()], ['$return'=TRUE])

Returns header of the blog.

Returns

string

Parameters

(string) $vars 

$this->fuel->blog->view('$view', [$vars=array()], ['$return'=TRUE])

Returns a view for the blog.

Returns

string

Parameters

(string) $view 
(array) $vars 
(boolean) $return 

$this->fuel->blog->block('$block', [$vars=array()], ['$return'=TRUE])

Returns a block view file for the blog.

Returns

string

Parameters

(string) $block 
(array) $vars 
(boolean) $return 

$this->fuel->blog->model(['$model'=NULL])

Returns a the specified blog model object. Options are posts, categories, comments, settings and links.

Returns

object

Parameters

(string) $model 

$this->fuel->blog->sidemenu([$blocks=array([0]=>search[1]=>categories)])

Returns the sidemenu for the blog.

Returns

string

Parameters

(array) $blocks 

$this->fuel->blog->current_post()

Returns the current post for the page. Only set when viewing a single post.

Returns

object

$this->fuel->blog->get_recent_posts(['$limit'=5], [$where=array()])

Returns the most recent posts.

Returns

array

Parameters

(int) $limit 

Returns the most popular posts.

Returns

array

Parameters

(int) $limit 

$this->fuel->blog->get_category_posts(['$category'=''], ['$order_by'='publish_date desc'], ['$limit'=NULL], ['$offset'=NULL], ['$return_method'=NULL], ['$assoc_key'=NULL])

Returns the most recent posts for a given category.

Returns

array

Parameters

(string) $category 
(string) $order_by 
(int) $limit 
(int) $offset 
(string) $return_method 
(string) $assoc_key 

$this->fuel->blog->get_category_posts_by_date('$category', ['$year'=NULL], ['$month'=NULL], ['$day'=NULL], ['$limit'=NULL], ['$offset'=NULL], ['$order_by'='sticky, publish_date desc'], ['$return_method'=NULL], ['$assoc_key'=NULL])

Returns posts by providing a given date.

Returns

array

Parameters

(string) $category 
(int) $year 
(int) $month 
(int) $day 
(string) $limit 
(int) $offset 
(int) $order_by 
(string) $return_method 
(string) $assoc_key 

$this->fuel->blog->get_tag_posts(['$tag'=''], ['$order_by'='publish_date desc'], ['$limit'=NULL], ['$offset'=NULL], ['$return_method'=NULL], ['$assoc_key'=NULL])

Returns the most recent posts for a given category.

Returns

array

Parameters

(string) $tag 
(string) $order_by 
(int) $limit 
(int) $offset 
(string) $return_method 
(string) $assoc_key 

$this->fuel->blog->get_tag_posts_by_date('$tag', ['$year'=NULL], ['$month'=NULL], ['$day'=NULL], ['$limit'=NULL], ['$offset'=NULL], ['$order_by'='sticky, publish_date desc'], ['$return_method'=NULL], ['$assoc_key'=NULL])

Returns posts by providing a given date.

Returns

array

Parameters

(string) $tag 
(int) $year 
(int) $month 
(int) $day 
(string) $limit 
(int) $offset 
(int) $order_by 
(string) $return_method 
(string) $assoc_key 

$this->fuel->blog->get_posts_by_date(['$year'=NULL], ['$month'=NULL], ['$day'=NULL], ['$slug'=NULL], ['$limit'=NULL], ['$offset'=NULL], ['$order_by'='sticky, publish_date desc'], ['$return_method'=NULL], ['$assoc_key'=NULL])

Returns posts by providing a given date.

Returns

array

Parameters

(int) $year 
(int) $month 
(int) $day 
(string) $slug 
(int) $limit 
(int) $offset 
(string) $order_by 
(string) $return_method 

$this->fuel->blog->get_posts_by_date_count(['$year'=NULL], ['$month'=NULL], ['$day'=NULL], ['$slug'=NULL], ['$limit'=NULL], ['$offset'=NULL], ['$order_by'='sticky, publish_date desc'], ['$return_method'=NULL], ['$assoc_key'=NULL])

Returns posts count by providing a given date.

Returns

int

Parameters

(int) $year 
(int) $month 
(int) $day 
(string) $slug 
(int) $limit 
(int) $offset 
(string) $order_by 
(string) $return_method 

$this->fuel->blog->get_posts([$where=array()], ['$order_by'='sticky, publish_date desc'], ['$limit'=NULL], ['$offset'=NULL], ['$return_method'=NULL], ['$assoc_key'=NULL])

Returns posts based on specific query parameters.

Returns

array

Parameters

(mixed) $where 
(string) $order_by 
(int) $limit 
(int) $offset 
(string) $return_method 
(string) $assoc_key 

$this->fuel->blog->get_posts_count([$where=array()])

Returns the number of posts.

Returns

array

Parameters

(mixed) $where 

$this->fuel->blog->get_posts_by_page(['$limit'=NULL], ['$offset'=NULL], ['$return_method'=NULL], ['$assoc_key'=NULL])

Returns posts to be displayed for a specific page. Used for pagination mostly.

Returns

array

Parameters

(int) $limit 
(int) $offset 
(string) $return_method 
(string) $assoc_key 

$this->fuel->blog->get_post_archives([$where=array()], ['$limit'=NULL], ['$offset'=NULL])

Returns posts grouped by the year/month.

Returns

array

Parameters

(array) $where 
(int) $limit 
(int) $offset 

$this->fuel->blog->get_post_by_date_slug('$slug', ['$year'=NULL], ['$month'=NULL], ['$day'=NULL], ['$order_by'=NULL], ['$return_method'=NULL])

Returns a single post.

Returns

object

Parameters

(mixed) $slug can be id or slug
(string) $year 
(string) $month 
(string) $day 
(string) $order_by 
(string) $return_method 

$this->fuel->blog->get_post('$slug', ['$order_by'=NULL], ['$return_method'=NULL])

Returns a single post.

Returns

object

Parameters

(mixed) $slug can be id or slug
(string) $order_by 
(string) $return_method 

$this->fuel->blog->get_next_post('$current_post', ['$return_method'=NULL])

Returns the next post (if any) from a given date.

Returns

object

Parameters

(object) $current_post The current post
(string) $return_method The return type of the object (array or object)

$this->fuel->blog->get_prev_post('$current_post', ['$return_method'=NULL])

Returns the previous post (if any) from a given date.

Returns

object

Parameters

(object) $current_post The current post
(string) $return_method The return type of the object (array or object)

$this->fuel->blog->get_categories([$where=array()], ['$order_by'=NULL], ['$limit'=NULL], ['$offset'=NULL], ['$return_method'=NULL], ['$assoc_key'=NULL])

Returns a list of blog categories.

Returns

array

Parameters

(mixed) $where 
(int) $order_by 
(int) $limit 
(string) $offset 
(string) $return_method 

$this->fuel->blog->get_category('$category', ['$order_by'=NULL], ['$return_method'=NULL])

Returns a single blog category.

Returns

object

Parameters

(string) $category 
(string) $order_by 
(string) $return_method 

$this->fuel->blog->get_published_categories(['$language'=NULL])

Returns a list of published categories.

Returns

object

Parameters

(string) $language 

$this->fuel->blog->get_tags([$where=array()], ['$order_by'=NULL], ['$limit'=NULL], ['$offset'=NULL], ['$return_method'=NULL], ['$assoc_key'=NULL])

Returns a list of blog tags.

Returns

array

Parameters

(mixed) $where 
(int) $order_by 
(int) $limit 
(string) $offset 
(string) $return_method 

$this->fuel->blog->get_tag('$category', ['$order_by'=NULL], ['$return_method'=NULL])

Returns a single blog tag.

Returns

array

Parameters

(string) $category 
(string) $order_by 
(string) $return_method 

$this->fuel->blog->get_published_tags(['$language'=NULL])

Returns a list of published tags.

Returns

array

Parameters

(string) $language 

$this->fuel->blog->search_posts('$term', ['$order_by'='publish_date desc'], ['$limit'=NULL], ['$offset'=NULL])

Searches posts for a specific term.

Returns

array

Parameters

(string) $term 
(string) $order_by 
(int) $limit 
(int) $offset 

$this->fuel->blog->get_comments([$where=array()], ['$order_by'='date_added desc'], ['$limit'=NULL], ['$offset'=NULL], ['$return_method'=NULL], ['$assoc_key'=NULL])

Returns comments. Usually specify a post in the where parameter.

Returns

array

Parameters

(mixed) $where 
(string) $order_by 
(int) $limit 
(int) $offset 
(string) $return_method 
(string) $assoc_key 

$this->fuel->blog->get_comment('$id')

Returns a single comment.

Returns

array

Parameters

(int) $id 

Returns links.

Returns

array

Parameters

(mixed) $where 
(string) $order_by 
(int) $limit 
(int) $offset 
(string) $return_method 
(string) $assoc_key 

$this->fuel->blog->get_user('$id')

Returns a FUEL author/user.

Returns

object

Parameters

(int) $id 

$this->fuel->blog->get_users([$where=array()], ['$order_by'=NULL], ['$limit'=NULL], ['$offset'=NULL], ['$return_method'=NULL], ['$assoc_key'=NULL])

Returns FUEL users/authors.

Returns

array

Parameters

(mixed) $where 
(string) $order_by 
(int) $limit 
(int) $offset 
(string) $return_method 
(string) $assoc_key 

$this->fuel->blog->logged_in_user()

Returns the logged in information array of the currently logged in FUEL user.

Returns

mixed

$this->fuel->blog->is_logged_in()

Returns whether you are logged into FUEL or not.

Returns

boolean

$this->fuel->blog->pagination('$post_count', ['$base_url'=''])

Returns pagination stuff.

Returns

string

$this->fuel->blog->use_cache()

Returns whether cache should be used based on the blog settings.

Returns

boolean

$this->fuel->blog->get_cache('$cache_id', ['$cache_group'=NULL], ['$skip_checking'=FALSE])

Returns a cached file if it exists.

Returns

mixed

Parameters

(string) $cache_id 

$this->fuel->blog->save_cache('$cache_id', '$data', ['$cache_group'=NULL], ['$ttl'=NULL])

Saves output to the cache.

Returns

void

Parameters

(string) $cache_id 
(string) $data 

$this->fuel->blog->remove_cache(['$cache_id'=NULL])

Removes page from cache.

Returns

void

Parameters

(string) $cache_id 

$this->fuel->blog->page_title(['$title'=''], ['$sep'=NULL], ['$order'='right'])

Returns the page title.

Returns

string

Parameters

(string) $title 
(string) $sep 
(string) $order 

$this->fuel->blog->is_spam('$comment', ['$log'=TRUE])

Returns TRUE/FALSE as to whether the passed parameters get through Akismet. Used during validation.

Returns

boolean

Parameters

(string) $comment A blog_comment_model object
(boolean) $log Determines whether to log errors or not  (optional)

$this->fuel->blog->process_stopforumspam('$name', ['$email'=NULL], ['$ip'=NULL], ['$log'=TRUE])

Returns TRUE/FALSE as to whether the passed parameters get through Akismet. Used during validation. Credit goes to stopforumspam plugin used for Vanilla (http://vanillaforums.org/addon/stopforumspam-plugin).

Returns

boolean

Parameters

(string) $name A blog_comment_model object or the name of the person submitting the form. Will pull from post
(string) $email The email address of the person submitting the comment (optional)
(string) $ip The IP address of the author submitting the comment (optional)
(boolean) $log Determines whether to log errors or not (optional)

$this->fuel->blog->process_akismet('$name', ['$email'=NULL], ['$msg'=''], ['$log'=TRUE])

Returns TRUE/FALSE as to whether the passed parameters get through Akismet. Used during validation.

Returns

boolean

Parameters

(string) $name A blog_comment_model object  or the name of the person submitting the form. Will pull from post
(string) $email The email address of the person submitting the comment (optional)
(string) $msg The comment being submitted (optional)
(boolean) $log Determines whether to log errors or not (optional)

$this->fuel->blog->comment_form('$post', ['$parent_comment'=NULL], [$values=array()], [$form_params=array()])

Returns either an array of fields for the comment form or the HTML.

Returns

mixed

Parameters

(object) $post 
(object) $parent_comment 
(mixed) $values 

$this->fuel->blog->captcha()

$this->fuel->blog->get_encryption('$word')

$this->fuel->blog->run_hook('$hook', [$params=array()])

Runs a specific blog hook.

Returns

string

Parameters

(string) $hook 
(array) $params 

$this->fuel->blog->__call('$name', $args)

Convenience magic method if you want to drop the "get" from the method.

Returns

string

Parameters

(string) $name 
(array) $args