public function action_init_theme() { Format::apply('tag_and_list', 'post_tags_out', ', ', ', '); Format::apply_with_hook_params('more', 'post_content_out', 'More ›', null, 1); Stack::add('template_stylesheet', array(Site::get_url('theme') . '/css/screen.css', 'screen, projection'), 'screen'); Stack::add('template_stylesheet', array(Site::get_url('theme') . '/css/style.css', 'screen, projection'), 'style'); }
public function test_format_priority() { Format::apply(function ($v) { return $v . '7'; }, 'test_filter_7'); Format::apply(function ($v) { return $v . '8'; }, 'test_filter'); $result = Plugins::filter('test_filter', 'test'); $this->assert_equal('test78', $result); Format::apply(function ($v, $c) { return $v . '7' . $c; }, 'test_filter2_7', 'a'); Format::apply(function ($v, $c) { return $v . '8' . $c; }, 'test_filter2', 'b'); $result = Plugins::filter('test_filter2', 'test'); $this->assert_equal('test7a8b', $result); Format::apply_with_hook_params(function ($v, $h, $c) { return $v . '7' . $h . $c; }, 'test_filter3_7', 'a'); Format::apply_with_hook_params(function ($v, $h, $c) { return $v . '8' . $h . $c; }, 'test_filter3', 'b'); $result = Plugins::filter('test_filter3', 'test', 'h'); $this->assert_equal('test7ha8hb', $result); }
public function action_init_theme() { // Apply Format::autop() to post content: Format::apply('autop', 'post_content_out'); // Apply Format::autop() to comment content: Format::apply('autop', 'comment_content_out'); /*DELETE ME Format::apply( 'nice_date', 'post_updated_date', 'F j, Y' ); Format::apply( 'nice_date', 'post_updated_time', 'g:ia' ); Format::apply( 'nice_date', 'post_pubdate_wday', 'l' ); Format::apply( 'nice_date', 'post_pubdate_day', 'j' ); Format::apply( 'nice_date', 'post_pubdate_month', 'F' ); Format::apply( 'nice_date', 'post_pubdate_monthno', 'm' ); Format::apply( 'nice_date', 'post_pubdate_year', 'Y' ); Format::apply( 'nice_date', 'post_pubdate_time', 'g:ia' ); // Apply Format::nice_date() to comment date: Format::apply( 'nice_date', 'comment_date', 'F j, Y' ); Format::apply( 'nice_date', 'comment_time', 'g:ia' ); /DELETEME */ // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Truncate content excerpt at "more" or 56 characters: //Format::apply_with_hook_params( 'more', 'post_content_excerpt','',600, 0 ); //Initial options $configured = Options::get('darkautumn__configured') ? true : false; if (!$configured) { $this->set_default_options(); } }
/** * Execute on theme init to apply these filters to output */ public function action_init_theme() { // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Truncate content excerpt at "more" or 56 characters... Format::apply('autop', 'post_content_excerpt'); Format::apply_with_hook_params('more', 'post_content_excerpt', '', 56, 1); }
/** * Execute on theme init to apply these filters to output */ public function action_init_theme() { // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Remove the comment on the following line to limit post length on the home page to 1 paragraph or 100 characters //Format::apply_with_hook_params( 'more', 'post_content_out', _t('more'), 100, 1 ); }
/** * Execute on theme init to apply these filters to output */ public function action_init_theme() { // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Truncate content excerpt at "more" or 56 characters... Format::apply('autop', 'post_content_excerpt'); Format::apply_with_hook_params('more', 'post_content_excerpt', '', 56, 1); // Add FormUI template placing the input before the label $this->add_template('charcoal_text', dirname(__FILE__) . '/formcontrol_text.php'); }
public function action_init_theme() { // Apply Format::autop() to post content... Format::apply('autop', 'post_content_out'); // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Apply Format::nice_date() to post date... Format::apply('nice_date', 'post_pubdate_out', 'F jS, Y'); }
public function action_init_theme() { $this->load_text_domain('sp'); // Apply Format::autop() to comment content. Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Only triggered by <!--more--> tag, not by length. Format::apply_with_hook_params('more', 'post_content_out', _t('--More--', 'sp')); // Excerpt output. echo $post->content_excerpt. Format::apply_with_hook_params('more', 'post_content_excerpt', _t('--More--', 'sp'), 60, 1); }
public function action_init_theme() { // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Only uses the <!--more--> tag, with the 'more' as the link to full post Format::apply_with_hook_params('more', 'post_content_out', 'more'); // Creates an excerpt option. echo $post->content_excerpt; Format::apply('autop', 'post_content_excerpt'); Format::apply_with_hook_params('more', 'post_content_excerpt', 'more', 60, 1); $this->autoCompileLess(dirname(__FILE__) . "/less/bootstrap.less", dirname(__FILE__) . "/css/bootstrap.css"); $this->autoCompileLess(dirname(__FILE__) . "/less/custom.less", dirname(__FILE__) . "/css/custom.css"); }
/** * Execute on theme init to apply these filters to output */ public function action_init_theme() { if (!Plugins::is_loaded('HabariMarkdown')) { // Apply Format::autop() to post content... Format::apply('autop', 'post_content_out'); } // Truncate content excerpt at "<!--more-->"... Format::apply_with_hook_params('more', 'post_content_out'); // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); $this->load_text_domain('demorgan'); }
public function action_init_theme() { // Apply Format::autop() to comment content... Format::apply( 'autop', 'comment_content_out' ); // Apply Format::tag_and_list() to post tags... Format::apply( 'tag_and_list', 'post_tags_out' ); // Only uses the <!--more--> tag, with the 'more' as the link to full post Format::apply_with_hook_params( 'more', 'post_content_out', 'more' ); // Creates an excerpt option. echo $post->content_excerpt; Format::apply( 'autop', 'post_content_excerpt' ); Format::apply_with_hook_params( 'more', 'post_content_excerpt', 'more',60, 1 ); // Format the calendar like date for home, entry.single and entry.multiple templates Format::apply( 'format_date', 'post_pubdate_out','<span class="calyear">{Y}</span><br><span class="calday">{j}</span><br><span class="calmonth">{F}</span>' ); }
public function action_init() { if (!class_exists('MarkdownExtra')) { require_once 'php-markdown/Michelf/Markdown.php'; require_once 'php-markdown/Michelf/MarkdownExtra.php'; } if (!function_exists('SmartyPants') && Options::get('habarimarkdown__smarty', false)) { require_once 'php-smartypants/smartypants.php'; } Format::apply('markdown', 'post_content_out_7'); Format::apply('markdown', 'post_content_summary_7'); Format::apply('markdown', 'post_content_more_7'); Format::apply('markdown', 'post_content_excerpt_7'); Format::apply('comment_safe_markdown', 'comment_content_out_7'); }
/** * Execute on theme init to apply these filters to output */ public function action_init_theme() { // Apply Format::autop() to post content... Format::apply('autop', 'post_content_out'); Format::apply('autop', 'post_content_excerpt'); // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Apply Format::nice_date() to post date... Format::apply('nice_date', 'post_pubdate_out', 'F j, Y g:ia'); // Apply Format::nice_date() to comment date... Format::apply('nice_date', 'comment_date_out', 'F j, Y g:ia'); // Truncate content excerpt at "more" or 75 characters... Format::apply_with_hook_params('more', 'post_content_excerpt', 'Read More', 75); }
/** * Add default output filters **/ public function action_init_theme() { // Apply Format::autop() to post content... Format::apply('autop', 'post_content_out'); // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Apply Format::nice_date() to post date... Format::apply('format_date', 'post_pubdate_out', '{F} {j}, {Y} {g}:{i}{a}'); // Apply Format::more to post content... Plugins::register(array($this, 'more'), 'filter', 'post_content_out'); // Apply Format::search_highlight to post content... Format::apply('search_highlight', 'post_content_out'); //Session::error('Sample error', 'sample'); }
public function action_init_theme() { // Apply Format::autop() to post content... Format::apply('autop', 'post_content_out'); // Only uses the <!--more--> tag, with the 'more' as the link to full post Format::apply_with_hook_params('more', 'post_content_out', 'more'); // Creates an excerpt option. echo $post->content_excerpt; Format::apply_with_hook_params('more', 'post_content_excerpt', 'more', 60, 1); // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Apply Format::nice_date() to comment date... Format::apply('nice_date', 'comment_date_out', 'F jS, Y'); // Apply Format::nice_date() to post date... Format::apply('nice_date', 'post_pubdate_out', 'F jS, Y'); }
/** * Execute on theme init to apply these filters to output */ public function action_init_theme() { // Apply Format::autop() to post content Format::apply('autop', 'post_content_out'); // Apply Format::autop() to comment content Format::apply('autop', 'comment_content_out'); // Apply Format::nice_date() to post date... Format::apply('nice_date', 'post_pubdate_out', 'j-M-Y'); // Apply Format::nice_date() to post date time... Format::apply('nice_date', 'post_pubdate_time', '\\a\\t g:ia'); // Apply Format::nice_date() to post date excerpt... Format::apply('nice_date', 'post_pubdate_excerpt', 'l, F jS, Y'); // Apply Format::nice_date() to comment date... //Format::apply( 'nice_date', 'comment_date', 'l, F jS, Y \a\t g:ia' ); // Truncate content excerpt at "more" or 56 characters... Format::apply_with_hook_params('more', 'post_content_excerpt', '', 256, 1); }
/** * Constructor for AtomHandler class. * Set some default formatting for Atom output. */ public function __construct() { Plugins::act('init_atom'); /** * The following Format::apply calls should be moved into a plugin that is * active by default. They apply autop formatting to the Atom content * that preserves line breaks in the feed output. * * These formatters should probably not be applied in the case of APP usage, * since you'll want to edit the actual raw data, and not an autop'ed * version of that data. * Currently, we use the user login to determine if the Atom is being used * for APP instead of a feed, but maybe there should be a separate * feed URL? */ if (!$this->is_auth()) { Format::apply('autop', 'post_content_atom'); } }
/** * Add additional template variables to the template output. * * You can assign additional output values in the template here, instead of * having the PHP execute directly in the template. The advantage is that * you would easily be able to switch between template types (RawPHP/Smarty) * without having to port code from one to the other. * * You could use this area to provide "recent comments" data to the template, * for instance. * * Also, this function gets executed *after* regular data is assigned to the * template. So the values here, unless checked, will overwrite any existing * values. */ public function add_template_vars() { // Add FormUI template placing the input before the label $this->add_template('formcontrol_text', dirname(__FILE__) . '/forms/formcontrol_text.php', true); $this->habari = Site::get_url('habari'); if (!$this->posts) { $this->posts = Posts::get(array('content_type' => 'entry', 'status' => Post::status('published'))); } $this->top_posts = array_slice((array) $this->posts, 0, 2); $params = array('content_type' => 'entry', 'status' => Post::status('published'), 'limit' => 7); $this->previous_posts = array_slice((array) Posts::get($params), 2, 5); if (!$this->user) { $this->user = User::identify(); } if (!$this->page) { $this->page = isset($page) ? $page : 1; } if (!$this->tags) { $this->tags = Tags::vocabulary()->get_tree(); } if (!$this->pages) { $this->pages = Posts::get(array('content_type' => 'page', 'status' => Post::status('published'))); } // Use the configured data format $date_format = Options::get('blossom_date_format'); if ($date_format == 'american') { // Apply Format::nice_date() to post date - US style Format::apply('nice_date', 'post_pubdate_out', 'g:ia m/d/Y'); } else { // Apply Format::nice_date() to post date - European style Format::apply('nice_date', 'post_pubdate_out', 'g:ia d/m/Y'); } // del.icio.us username. $delicious_username = Options::get('blossom_delicious_username'); if ($delicious_username == '') { $delicious_username = '******'; } $this->delicious = $delicious_username; // Default to hidden $this->show_interests = (bool) Options::get('show_interests'); $this->show_other_news = (bool) Options::get('show_other_news'); parent::add_template_vars(); }
function action_init_theme($theme) { // Apply Format::autop() to post content... Format::apply('autop', 'post_content_out'); // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Only uses the <!--more--> tag, with the 'more' as the link to full post Format::apply_with_hook_params('more', 'post_content_out', 'more'); // Creates an excerpt option. echo $post->content_excerpt; Format::apply('autop', 'post_content_excerpt'); Format::apply_with_hook_params('more', 'post_content_excerpt', '<span class="more">Read more</span>', 150, 1); // Excerpt for lead article Format::apply('autop', 'post_content_lead'); Format::apply_with_hook_params('more', 'post_content_lead', '<span class="more">Read more</span>', 400, 1); // Apply Format::nice_date() to post date... Format::apply('nice_date', 'post_pubdate_out', 'F j, Y'); // Apply Format::nice_time() to post date... //Format::apply( 'nice_time', 'post_pubdate_out', 'g:ia' ); // Apply Format::nice_date() to comment date Format::apply('nice_date', 'comment_date_out', 'F j, Y g:ia'); }
/** * Execute on theme init to apply these filters to output */ public function action_init_theme() { if (!Plugins::is_loaded('HabariMarkdown')) { // Apply Format::autop() to post content... Format::apply('autop', 'post_content_out'); } // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Apply Format::nice_date() to post date... Format::apply('nice_date', 'post_pubdate_out', 'F j, Y'); // Apply Format::nice_date() to post date... Format::apply('nice_date', 'post_pubdate_time', 'g:i a'); // Format post date to ISO-8601... Format::apply('nice_date', 'post_pubdate_iso', 'c'); // Apply Format::nice_date() to comment date... Format::apply('nice_date', 'comment_date_out', 'F j, Y ‒ g:i a'); // Format comment date to ISO-8601... Format::apply('nice_date', 'comment_date_iso', 'c'); // Truncate content excerpt at "more" or 100 characters... Format::apply_with_hook_params('more', 'post_content_excerpt', '', 100, 1); //Format::apply_with_hook_params( 'more', 'post_content_out', 'more', 100, 1 ); }
/** * Execute on theme init to apply these filters to output */ public function action_init_theme() { Format::apply('nice_date', 'post_pubdate_out', 'l jS F Y'); }
<?php Format::apply_with_hook_params('more', 'post_content_out', 'Read the rest »'); Format::apply('autop', 'post_content_out'); Format::apply('autop', 'comment_content_out'); Format::apply('nice_date', 'comment_date_out'); Format::apply('tag_and_list', 'post_tags_out', ' , ', ' and '); Format::apply('nice_date', 'post_pubdate_out', 'F j'); // We must tell Habari to use MyTheme as the custom theme class: define('THEME_CLASS', 'MyTheme'); /** * A custom theme for K2 output */ class MyTheme extends Theme { public function add_template_vars() { if (!$this->template_engine->assigned('pages')) { $this->assign('pages', Posts::get(array('content_type' => 'page', 'status' => Post::status('published')))); } if (!$this->template_engine->assigned('user')) { $this->assign('user', User::identify()); } if (!$this->template_engine->assigned('page')) { $this->assign('page', isset($page) ? $page : 1); } //for recent comments loop in sidebar.php $this->assign('recent_comments', Comments::get(array('limit' => 8, 'status' => Comment::STATUS_APPROVED, 'orderby' => 'date DESC'))); parent::add_template_vars(); } }
/** * Apply the default Formatters on init. */ public function action_init() { Format::apply('tabasamu', 'post_content_out'); Format::apply('tabasamu', 'comment_content_out'); }
<?php /** * MyTheme is a custom Theme class for the Hemingway theme. * * @package Habari */ /** * @todo This stuff needs to move into the custom theme class: */ // Apply Format::autop() to post content... Format::apply('autop', 'post_content_out'); // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Apply Format::nice_date() to post date... // Format::apply( 'nice_date', 'post_pubdate_out', 'm.j' ); // Format::apply( 'nice_date', 'post_pubdate_home', 'm/d/y' ); // Format::apply( 'nice_time', 'post_pubdate_time', 'ga' ); // Apply Format::nice_date() to comment date... // Format::apply( 'nice_date', 'comment_date', 'F jS, Y' ); // Limit post length to 1 paragraph or 100 characters. As currently implemented // in home.php and entry.multiple.php, the first post will be displayed in full // and subsequent posts will be excerpts. search.php uses excerpts for all posts. // Comment out this line to have full posts. //Format::apply_with_hook_params( 'more', 'post_content_excerpt', '', 100, 1 ); Format::apply_with_hook_params('more', 'post_content_out', '', 100, 4); // We must tell Habari to use MyTheme as the custom theme class: define('THEME_CLASS', 'MyTheme'); /**
* * @package Habari */ /** * @todo This stuff needs to move into the custom theme class: */ // Apply Format::autop() to post content... Format::apply('autop', 'post_content_out'); // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Apply Format::nice_date() to post date... Format::apply('nice_date', 'post_pubdate_out', 'F j, Y g:ia'); // Apply Format::nice_date() to comment date... Format::apply('nice_date', 'comment_date_out', 'F jS, Y'); // Limit post length to 1 paragraph or 100 characters. As currently implemented // in home.php and entry.multiple.php, the first post will be displayed in full // and subsequent posts will be excerpts. search.php uses excerpts for all posts. // Comment out this line to have full posts. //Format::apply_with_hook_params( 'more', 'post_content_excerpt', '<div class="more">[read more]</div>', 100, 1 ); // We must tell Habari to use MyTheme as the custom theme class: define('THEME_CLASS', 'MyTheme'); /** * A custom theme for PhoenixBlue output */ class MyTheme extends Theme { /** * Add additional template variables to the template output. *
public function action_init() { spl_autoload_register(array(__CLASS__, '_autoload')); Format::apply('do_highlight', 'post_content_out'); Format::apply('do_highlight', 'comment_content_out'); }
*/ /** * @todo This stuff needs to move into the custom theme class: */ // Apply Format::autop() to post content... Format::apply('autop', 'post_content_out'); // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Only uses the <!--more--> tag, with the 'more' as the link to full post Format::apply_with_hook_params('more', 'post_content_out', 'more'); // Creates an excerpt option. echo $post->content_excerpt; Format::apply_with_hook_params('more', 'post_content_excerpt', 'more', 60, 1); //Format the calendar like date for home, entry.single and entry.multiple templates Format::apply('format_date', 'post_pubdate_out', '<span class="calyear">{Y}</span><br><span class="calday">{j}</span><br><span class="calmonth">{F}</span>'); // We must tell Habari to use MyTheme as the custom theme class: define('THEME_CLASS', 'CornerStone'); /** * A custom theme for mzingi output */ class CornerStone extends Theme { /** * Add additional template variables to the template output. * * You can assign additional output values in the template here, instead of * having the PHP execute directly in the template. The advantage is that * you would easily be able to switch between template types (RawPHP/Smarty) * without having to port code from one to the other. *
public function action_init_theme() { Format::apply('tag_and_list', 'post_tags_out', ' : ', ' : '); Format::apply_with_hook_params('more', 'post_content_excerpt', '', 56, 1); }
* MyTheme is a custom Theme class for the Lace theme. * * @package Habari */ /** * @todo This stuff needs to move into the custom theme class: */ // Apply Format::autop() to post content... Format::apply('autop', 'post_content_out'); // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Apply Format::nice_date() to dates... Format::apply('nice_date', 'post_pubdate_out', 'F j, Y g:ia'); Format::apply('nice_date', 'comment_date_out', 'F j, Y g:ia'); // Add calls for curvycorners and jquery Stack::add('template_header_javascript', Site::get_url('scripts') . '/jquery.js', 'jquery'); Stack::add('template_header_javascript', Site::get_url('theme') . '/js/jquery.curvycorners.js'); Stack::add('template_stylesheet', array(Site::get_url('3rdparty') . '/blueprint/screen.css', 'screen,projection')); Stack::add('template_stylesheet', array(Site::get_url('3rdparty') . '/blueprint/print.css', 'print')); // Remove the comment on the following line to limit post length on the home page to 1 paragraph or 100 characters //Format::apply_with_hook_params( 'more', 'post_content_out', 'more', 100, 1 ); // We must tell Habari to use MyTheme as the custom theme class: define('THEME_CLASS', 'MyTheme'); class MyTheme extends Theme { /** * Add additional template variables to the template output. * *You can assign additional output values in the template here, instead of
<?php /** * @package Ic3berg */ // Apply Format::autop() to post content... Format::apply('autop', 'post_content_out'); // Apply Format::autop() to comment content... Format::apply('autop', 'comment_content_out'); // Apply Format::tag_and_list() to post tags... Format::apply('tag_and_list', 'post_tags_out'); // Apply Format::nice_date() to post date... Format::apply('nice_date', 'post_pubdate_out', 'F j, Y g:ia'); // Excerpt titles in the quickbar Format::apply('post_title_excerpt', 'post_title'); // Remove the comment on the following line to limit post length on the home page to 1 paragraph or 100 characters Format::apply_with_hook_params('more', 'post_content_out', _t('Read more...'), 100, 1); // We must tell Habari to use MyTheme as the custom theme class: define('THEME_CLASS', 'Ic3berg'); /** * A custom theme for K2 output */ class Ic3berg extends Theme { public function add_template_vars() { //Theme Options $this->assign('show_author', true); //Display author in posts // How many months should be displayed by the RN Archives plugin $this->assign('rn_archives_months', 2);