Ejemplo n.º 1
0
 function BaseBlogData(&$info)
 {
     $request = Project::getRequest();
     $request_user_id = (int) Project::getUser()->getShowedUser()->id;
     if ($request_user_id <= 0) {
         Project::getResponse()->redirect($request->createUrl('Index', 'Index', null, false));
     }
     $user_id = (int) Project::getUser()->getDbUser()->id;
     if ($request_user_id === $user_id) {
         $v = new BlogView();
         $v->ControlPanel();
         $info['control_panel'] = $v->parse();
         $info['blog_owner'] = true;
     } else {
         $info['control_panel'] = null;
         $info['blog_owner'] = false;
     }
     //	$info['tab_list'] = TabController::getOwnTabs(false, false, false, false, false, false, true, false);
     $info['tab_list'] = TabController::getOwnTabs(false, false, false, true);
     // User blog tree
     $blog_model = Project::getUser()->getShowedUser()->getBlog();
     $tree_model = new BlogTreeModel();
     $info['branch_list'] = $tree_model->getBranchList($blog_model->id, $user_id);
     $info['blog_info']['title'] = $blog_model->title;
 }
 /**
  * renders this view
  *
  * @return nothing
  */
 function render()
 {
     // if our view is cached, there is not much to do here...
     if ($this->isCached()) {
         parent::render();
         return true;
     }
     // get the next and previous articles, based on the article we're going to show
     $article = $this->getValue('post');
     // notify of certain events
     $postText = $article->getIntroText();
     $postExtendedText = $article->getExtendedText();
     $this->_pm->notifyEvent(EVENT_TEXT_FILTER, array('text' => &$postText));
     $this->_pm->notifyEvent(EVENT_TEXT_FILTER, array('text' => &$postExtendedText));
     $article->setIntroText($postText);
     $article->setExtendedText($postExtendedText);
     // and yet one event more
     $this->_pm->notifyEvent(EVENT_POST_LOADED, array('article' => &$article));
     // once ready, put the article back to the context of the view
     $this->setValue('post', $article);
     $this->setValue('comments', $article->getComments());
     $this->setValue('user', $article->getUser());
     $this->setValue('trackbacks', $article->getTrackbacks());
     // render the main view
     parent::render();
 }
 /** 
  * renders the error message
  */
 function render()
 {
     if (!empty($this->_message)) {
         $this->setValue("message", $this->_message);
     }
     parent::render();
 }
 /**
  * Renders the view. It simply gets all the parameters we've been adding to it
  * and puts them in the context of the template renderer so that they can be accessed
  * as normal parameters from within the template
  *
  * @return Returns a rendered template
  */
 function render()
 {
     // assign all the values
     $blogSettings = $this->_blogInfo->getSettings();
     $templateSet = $blogSettings->getValue("template");
     $this->_template->assign($this->_params->getAsArray());
     $ts = new TemplateSets();
     $storage = new TemplateSetStorage();
     if ($ts->isBlogTemplate($templateSet, $this->_blogInfo->getId())) {
         $blogTemplate = $storage->getTemplateFolder($templateSet, $this->_blogInfo->getId());
     } else {
         $blogTemplate = $storage->getTemplateFolder($templateSet);
     }
     $this->_template->assign("blogtemplate", $blogTemplate);
     parent::render();
 }
 /**
  * This view shows a list of the posts for the blog.
  *
  * The blog we are going to show is determined by:
  * 1) blogId parameter in the $_REQUEST
  * 2) blogId parameter in the session
  * 3) default_blog_id parameter from the configuration file
  */
 function render()
 {
     // load the contents into the template context
     $blogSettings = $this->_blogInfo->getSettings();
     // we have to keep in mind that the things below only need to be done
     // in case that the view is not cached, otherwise we will get a warning message
     // because there are no posts to process! (the action will not load any data if the
     // view is cached)
     if (!$this->isCached()) {
         // check if we have to cut the posts to a determined amount of words and
         // then show the "show more" link...
         //if( $blogSettings->getValue( 'show_more_enabled' ) == true && !$this->isCached()) {
         if ($blogSettings->getValue('show_more_enabled') == true) {
             $this->_addShowMoreLink();
         }
     }
     parent::render();
 }
Ejemplo n.º 6
0
?>
</a> <a href="rss/blog/tags/Community%20News%20for%20the%20frontpage"><img src="images/icons/feed.png" alt="<?php 
echo $words->getSilent('GetRSSFeed');
?>
"></a><?php 
echo $words->flushBuffer();
?>
</h3>
                <div class="floatbox">
                    <?php 
$i = 1;
foreach ($postIt as $blog) {
    $i++;
    if ($i <= 3) {
        $Blog = new Blog();
        $View = new BlogView($Blog);
        $txt = $View->blogText($blog->blog_text);
        ?>
                        <h4 class="news"><a href="blog/<?php 
        echo $blog->user_handle;
        ?>
/<?php 
        echo $blog->blog_id;
        ?>
"><?php 
        echo htmlentities($blog->blog_title, ENT_COMPAT, 'utf-8');
        ?>
</a></h4>
                        <span class="small grey"><?php 
        echo $words->get('written_by');
        ?>
Ejemplo n.º 7
0
/**
 * tags
 *
 * defined vars:
 * $tag  - the tag the user has been searching for.
 *
 * @package blog
 * @subpackage template
 * @author The myTravelbook Team <http://www.sourceforge.net/projects/mytravelbook>
 * @copyright Copyright (c) 2005-2006, myTravelbook Team
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License (GPL)
 * @version $Id$
 */
$Blog = new Blog();
$BlogView = new BlogView($Blog);
$errors = array();
$tagsText = array();
$i18n = new MOD_i18n('apps/blog/tags.php');
$tagsText = $i18n->getText('tagsText');
$words = new MOD_words();
?>
<div id="blog-tags">
    <h2><?php 
echo $words->get('TagsTitle');
?>
</h2>
    <?php 
if (!$tag) {
    // display only overview of all tags.
    $minstyle = 0;
Ejemplo n.º 8
0
echo date($format['short'], $blog->unix_created);
?>
 
<?php 
if ($blog->flags & Blog::FLAG_VIEW_PRIVATE) {
    echo ' <img src="images/icons/lock.png" alt="' . $words->get('is_private') . '" title="' . $words->get('is_private') . '" />';
} elseif ($blog->flags & Blog::FLAG_VIEW_PROTECTED) {
    echo ' <img src="images/icons/shield.png" alt="' . $words->get('is_protected') . '" title="' . $words->get('is_protected') . '" />';
}
?>
    </div>
    <div class="floatbox">
    <div class="text">
<?php 
$Blog = new Blog();
$View = new BlogView($Blog);
$txt = $View->blogText($blog->blog_text, false);
$tags = $Blog->getPostTagsIt($blog->blog_id);
if ($tags->numRows() > 0) {
    ?>
    <div class="tags">
        <span><?php 
    echo $words->get('tagged_with');
    ?>
:</span>
<?php 
    foreach ($tags as $tag) {
        echo '&nbsp;<a href="blog/tags/' . rawurlencode($tag->name) . '">' . htmlentities($tag->name, ENT_COMPAT, 'utf-8') . '</a>&nbsp;';
    }
    ?>
    </div>