コード例 #1
0
ファイル: theme.php プロジェクト: ringmaster/NSTheme
 public function add_template_vars()
 {
     if (!$this->template_engine->assigned('pages')) {
         $this->assign('pages', Posts::get('page_list'));
     }
     //For Asides loop in sidebar.php
     $this->assign('asides', Posts::get('asides'));
     if ($this->request->display_entries_by_tag) {
         if (count($this->include_tag) && count($this->exclude_tag) == 0) {
             $this->tags_msg = _t('Posts tagged with %s', array(Format::tag_and_list($this->include_tag)));
         } else {
             if (count($this->exclude_tag) && count($this->include_tag) == 0) {
                 $this->tags_msg = _t('Posts not tagged with %s', array(Format::tag_and_list($this->exclude_tag)));
             } else {
                 $this->tags_msg = _t('Posts tagged with %s and not with %s', array(Format::tag_and_list($this->include_tag), Format::tag_and_list($this->exclude_tag)));
             }
         }
     }
     parent::add_template_vars();
 }
コード例 #2
0
ファイル: theme.php プロジェクト: ringmaster/system
 /**
  * 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.
  *
  *  Note that the variables added here should possibly *always* be added,
  *  especially 'user'.
  *
  *  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()
 {
     if (!$this->template_engine->assigned('pages')) {
         $this->assign('pages', Posts::get(array('content_type' => 'page', 'status' => Post::status('published'))));
     }
     //For Asides loop in sidebar.php
     $this->assign('asides', Posts::get(array('vocabulary' => array('tags:term' => 'aside'), 'limit' => 5)));
     if ($this->request->display_entries_by_tag) {
         if (count($this->include_tag) && count($this->exclude_tag) == 0) {
             $this->tags_msg = _t('Posts tagged with %s', array(Format::tag_and_list($this->include_tag)));
         } else {
             if (count($this->exclude_tag) && count($this->include_tag) == 0) {
                 $this->tags_msg = _t('Posts not tagged with %s', array(Format::tag_and_list($this->exclude_tag)));
             } else {
                 $this->tags_msg = _t('Posts tagged with %s and not with %s', array(Format::tag_and_list($this->include_tag), Format::tag_and_list($this->exclude_tag)));
             }
         }
     }
     parent::add_template_vars();
 }
コード例 #3
0
ファイル: post.php プロジェクト: ringmaster/criticalhit_theme
		<h1 itemprop="name"><a href="<?php 
echo $content->permalink;
?>
" itemprop="url"><?php 
echo $content->title_out;
?>
</a></h1>
		<div class="metadata">
			<p class="pubdata">
				<?php 
_e('Created on %1$s by %2$s.', array('<time datetime="' . $content->pubdate->format('Y-m-d\\TH:i:s\\Z') . '" pubdate itemprop="datePublished">' . $content->pubdate->format(Options::get('dateformat') . ' ' . Options::get('timeformat')) . '</time>', '<span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">' . $content->author->username . '</span></span>'));
?>
			</p>
			<p itemprop="keywords" class="tags">
				<?php 
_e('Categorised under: %1$s', array(Format::tag_and_list($content->tags, ', ', ', and ')));
?>
			</p>
		</div>
	</header>

	<section class="content" itemprop="articleBody">
		<?php 
echo $content->content_out;
?>
	</section>

	<?php 
if ($request->display_entry) {
    ?>
	<section class="comments" itemprop="comment">
コード例 #4
0
ファイル: theme.php プロジェクト: ringmaster/system
 /**
  * Add some variables to the template output
  */
 public function add_template_vars()
 {
     // Use theme options to set values that can be used directly in the templates
     $opts = Options::get_group(__CLASS__);
     $this->assign('show_title_image', $opts['show_title_image']);
     $this->assign('home_label', $opts['home_label']);
     $this->assign('show_powered', $opts['show_powered']);
     $this->assign('display_login', $opts['display_login']);
     $this->assign('tags_in_multiple', $opts['tags_in_multiple']);
     $this->assign('post_class', 'post' . (!$opts['show_entry_paperclip'] ? ' alt' : ''));
     $this->assign('page_class', 'post' . (!$opts['show_page_paperclip'] ? ' alt' : ''));
     $this->assign('show_post_nav', $opts['show_post_nav']);
     $this->assign('loggedin', User::identify()->loggedin);
     $locale = Options::get('locale');
     if (file_exists(Site::get_dir('theme', true) . $locale . '.css')) {
         $this->assign('localized_css', $locale . '.css');
     } else {
         $this->assign('localized_css', false);
     }
     if (!$this->template_engine->assigned('pages')) {
         $this->assign('pages', Posts::get(array('content_type' => 'page', 'status' => 'published', 'nolimit' => 1)));
     }
     $this->assign('post_id', isset($this->post) && $this->post->content_type == Post::type('page') ? $this->post->id : 0);
     if ($this->request->display_entries_by_tag) {
         if (count($this->include_tag) && count($this->exclude_tag) == 0) {
             $this->tags_msg = _t('Displaying posts tagged: %s', array(Format::tag_and_list($this->include_tag)));
         } else {
             if (count($this->exclude_tag) && count($this->include_tag) == 0) {
                 $this->tags_msg = _t('Displaying posts not tagged: %s', array(Format::tag_and_list($this->exclude_tag)));
             } else {
                 $this->tags_msg = _t('Displaying posts tagged: %s and not %s', array(Format::tag_and_list($this->include_tag), Format::tag_and_list($this->exclude_tag)));
             }
         }
     }
     // Add FormUI template placing the input before the label
     $this->add_template('charcoal_text', dirname(__FILE__) . '/formcontrol_text.php');
 }
コード例 #5
0
ファイル: post.php プロジェクト: ringmaster/izaw
		<div class="pubdata">
			<span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name"><?php 
echo $content->author->username;
?>
</span></span>
			<time datetime="<?php 
echo $content->pubdate->format('Y-m-d\\TH:i:s\\Z');
?>
" itemprop="datePublished"><?php 
echo $content->pubdate->format(Options::get('dateformat') . ' ' . Options::get('timeformat'));
?>
</time>
		</div>
		<div itemprop="keywords" class="tags">
			<?php 
echo Format::tag_and_list($content->tags, ', ', ', and ');
?>
		</div>
	</header>

	<?php 
echo $theme->content($content->author);
?>

	<div class="content" itemprop="articleBody">
		<?php 
echo $content->excerpt;
?>
	</div>

	<?php 
コード例 #6
0
 /**
  * filters display of tags for posts to hide any that begin with "@" from display
  **/
 public function filter_post_tags_out($tags)
 {
     $tags = array_filter($tags, create_function('$a', 'return $a{0} != "@";'));
     $tags = Format::tag_and_list($tags);
     return $tags;
 }
コード例 #7
0
">s</i>
								<i class="icon-rating top"><span class="amount <?php 
        echo $class2;
        ?>
">s</span></i>
							</div>
						<?php 
    }
    ?>
					</div>
				</div>
				<div class="body columns eight">
					<p>
					<?php 
    if (count($addon->tags) > 0) {
        echo _t('Tagged %s', array(Format::tag_and_list($addon->tags, ', ', ', ')));
    }
    ?>
					</p>
					<p><?php 
    echo $addon->content_excerpt;
    ?>
</p>
				</div>
			</div>
		<?php 
}
?>
		</div>
		<div id="page-selector" class="bottom sixteen columns">
			<?php 
コード例 #8
0
 public function theme_post_tags($theme)
 {
     if (isset($theme->post)) {
         return Format::tag_and_list($theme->post->tags, ', ', ', and ');
     }
 }
コード例 #9
0
			<?php 
echo $post->content_out;
?>
		</div><!-- end entry -->
	</div><!-- end id post-* -->

	<div class="entryMeta">	
		<p>
			<?php 
if (count($post->tags)) {
    ?>
				<?php 
    _e('This entry is filed under');
    ?>
 <?php 
    echo Format::tag_and_list($post->tags, ', ', ', and ');
    ?>
. 
			<?php 
}
?>
			<?php 
_e('You can follow any responses to this entry through the');
?>
			<a href="<?php 
echo $post->comment_feed_link;
?>
"> feed</a>
			<?php 
if (!$post->info->comments_disabled) {
    ?>
コード例 #10
0
ファイル: theme.php プロジェクト: wwxgitcat/habari
 /**
  * Add some variables to the template output
  */
 public function add_template_vars()
 {
     parent::add_template_vars();
     // Use theme options to set values that can be used directly in the templates
     $opts = Options::get_group(__CLASS__);
     $this->assign('show_title_image', $opts['show_title_image']);
     $this->assign('home_label', $opts['home_label']);
     $this->assign('show_powered', $opts['show_powered']);
     $this->assign('display_login', $opts['display_login']);
     $this->assign('tags_in_multiple', $opts['tags_in_multiple']);
     $this->assign('post_class', 'post' . (!$opts['show_entry_paperclip'] ? ' alt' : ''));
     $this->assign('page_class', 'post' . (!$opts['show_page_paperclip'] ? ' alt' : ''));
     $this->assign('show_post_nav', $opts['show_post_nav']);
     $this->assign('loggedin', User::identify()->loggedin);
     $locale = Options::get('locale');
     if ($this->get_url($locale . '.css')) {
         $this->assign('localized_css', $locale . '.css');
     } else {
         $this->assign('localized_css', false);
     }
     if ($opts['show_title_image']) {
         if ($this->get_url('images.' . $locale . '/title-image.png')) {
             $this->assign('title_image', 'images.' . $locale . '/title-image.png');
         } else {
             if ($this->get_url('images/title-image.png')) {
                 $this->assign('title_image', 'images/title-image.png');
             } else {
                 $this->assign('title_image', 'images/sample-title.png');
             }
         }
     }
     if (!$this->template_engine->assigned('pages')) {
         $this->assign('pages', Posts::get('page_list'));
     }
     $this->assign('post_id', isset($this->post) && $this->post->content_type == Post::type('page') ? $this->post->id : 0);
     if (is_object($this->request) && $this->request->display_entries_by_tag) {
         if (count($this->include_tag) && count($this->exclude_tag) == 0) {
             $this->tags_msg = _t('Displaying posts tagged: %s', array(Format::tag_and_list($this->include_tag)));
         } else {
             if (count($this->exclude_tag) && count($this->include_tag) == 0) {
                 $this->tags_msg = _t('Displaying posts not tagged: %s', array(Format::tag_and_list($this->exclude_tag)));
             } else {
                 $this->tags_msg = _t('Displaying posts tagged: %s and not %s', array(Format::tag_and_list($this->include_tag), Format::tag_and_list($this->exclude_tag)));
             }
         }
     }
 }
コード例 #11
0
echo _n(" ", "", count($post->info->licenses));
?>
 <?php 
echo AddonCatalogPlugin::name_url_list($post->info->licenses);
?>
</div>
						</li>
						<?php 
if (count($post->tags) > 0) {
    ?>
						<li>
							<div style="float:left;margin-right: 5px;"><i class="icon-tags">t</i></div>
							<div style="float:left;width:185px;">
								<?php 
    if (count($post->tags) > 0) {
        echo _t('%s', array(Format::tag_and_list($post->tags, ', ', ', ')));
    }
    ?>
							</div>
						</li>
						<?php 
}
?>
						<li>
							<?php 
echo $theme->area('plugin_sidebar');
?>
						</li>
					</ul>
				</div>
			</div>