Пример #1
0
 /**
  * Default display method for featured listings
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return	
  */
 public function display($tmpl = null)
 {
     // Set the meta tags for this page
     EB::setMeta(META_ID_FEATURED, META_TYPE_VIEW);
     // Add the RSS headers on the page
     EB::feeds()->addHeaders('index.php?option=com_easyblog&view=featured');
     // Add breadcrumbs on the site menu.
     $this->setPathway('COM_EASYBLOG_FEATURED_BREADCRUMB');
     // Get the model
     $model = EB::model('Featured');
     // Get a list of featured posts
     $posts = $model->getPosts();
     // Get the pagination
     $pagination = $model->getPagination();
     // Format the posts
     $posts = EB::formatter('list', $posts);
     // Set the page title
     $title = EB::getPageTitle(JText::_('COM_EASYBLOG_FEATURED_PAGE_TITLE'));
     $this->setPageTitle($title, $pagination, $this->config->get('main_pagetitle_autoappend'));
     // Get the current url
     $return = EBR::_('index.php?option=com_easyblog', false);
     $this->set('return', $return);
     $this->set('posts', $posts);
     $this->set('pagination', $pagination);
     parent::display('blogs/featured/default');
 }
Пример #2
0
 /**
  * Default display method for my blog listings
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function display($tmpl = null)
 {
     // Require user to be logged in to access this page
     EB::requireLogin();
     // Get the default sorting behavior
     $sort = $this->input->get('sort', $this->config->get('layout_postorder'), 'cmd');
     // Load up the author profile
     $author = EB::user($this->my->id);
     // Set meta tags for blogger
     EB::setMeta($this->my->id, META_ID_BLOGGERS);
     // Set the breadcrumbs
     $this->setPathway(JText::_('COM_EASYBLOG_BLOGGERS_BREADCRUMB'), EB::_('index.php?option=com_easyblog&view=blogger'));
     $this->setPathway($author->getName());
     $menu = JFactory::getApplication()->getMenu();
     $categoryInclusion = array();
     if ($menu) {
         $active = $menu->getActive();
         $categoryInclusion = $active->params->get('inclusion');
     }
     $model = EB::model('Blog');
     $posts = $model->getBlogsBy('blogger', $author->id, $sort, 0, EBLOG_FILTER_PUBLISHED, false, false, array(), false, false, true, array(), $categoryInclusion);
     // Get the pagination
     $pagination = $model->getPagination();
     // Set the page title
     $title = $author->getName() . ' - ' . EB::getPageTitle(JText::_('COM_EASYBLOG_MY_BLOG_PAGE_TITLE'));
     $this->setPageTitle($title, $pagination, $this->config->get('main_pagetitle_autoappend'));
     // Format the posts
     $posts = EB::formatter('list', $posts);
     // Add the RSS headers on the page
     EB::feeds()->addHeaders('index.php?option=com_easyblog&view=myblog');
     // Determines if the viewer already subscribed to the author
     $subscribed = false;
     $bloggerModel = EB::model('Blogger');
     if ($bloggerModel->isBloggerSubscribedUser($author->id, $this->my->id, $this->my->email)) {
         $subscribed = true;
     }
     // Get the current url
     $return = EBR::_('index.php?option=com_easyblog', false);
     $this->set('return', $return);
     $this->set('subscribed', $subscribed);
     $this->set('author', $author);
     $this->set('posts', $posts);
     $this->set('sort', $sort);
     $this->set('pagination', $pagination);
     parent::display('blogs/myblog/default');
 }
Пример #3
0
 /**
  * Allows caller to import feeds
  *
  * @since	4.0
  * @access	public
  */
 public function download()
 {
     // Get the id's from the request.
     $id = $this->input->get('id', 0, 'int');
     // Load the feed data
     $feed = EB::table('Feed');
     $feed->load($id);
     if (!$id || !$feed->id) {
         return $this->ajax->reject(JText::_('COM_EASYBLOG_FEEDS_INVALID_FEED_ID_PROVIDED'));
     }
     // Set this into processing mode first.
     $feed->flag = true;
     // $feed->store();
     // Import the feed
     $result = EB::feeds()->import($feed);
     // Set the last import date
     $feed->last_import = EB::date()->toSql();
     // Reset the flag
     $feed->flag = false;
     // Store the feed item now
     $feed->store();
     return $this->ajax->resolve($result);
 }
Пример #4
0
 /**
  * Retrieves rss link for the category
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function getRssLink()
 {
     return EB::feeds()->getFeedURL('index.php?option=com_easyblog&view=categories&id=' . $this->id, false, 'category');
 }
Пример #5
0
				<?php 
    }
    ?>
			<?php 
}
?>

			<?php 
if ($params->get('showrss', true)) {
    ?>
			<div class="mod-small">
				<a class="eb-brand-rss" title="<?php 
    echo JText::_('MOD_EASYBLOGCATEGORIES_SUBSCRIBE_FEEDS');
    ?>
" href="<?php 
    echo EB::feeds()->getFeedURL('index.php?option=com_easyblog&view=categories&id=' . $category->id, false, 'category');
    ?>
">
					<i class="fa fa-rss-square"></i>
					<?php 
    echo JText::_('MOD_EASYBLOGCATEGORIES_SUBSCRIBE_FEEDS');
    ?>
				</a>
			</div>
			<?php 
}
?>
	
		</div>
	</div>
</div>
Пример #6
0
    // // Process scheduled posts
    $result['scheduler_publish'] = EB::scheduler()->publish();
    // // Process scheduled unpublish posts
    $result['scheduler_unpublish'] = EB::scheduler()->unpublish();
    // Process the garbage collector. Remove the records from #__easyblog_uploader_tmp which exceed 120 minutes.
    $result['scheduler_remove_tmp_files'] = EB::scheduler()->removeTmpFiles();
    // Process the garbage collector. Remove BLANK post from from #__easyblog_post which exceed 3 days.
    $result['scheduler_remove_blank_posts'] = EB::scheduler()->removeBlankPosts();
    // var_dump($result);exit;
    header('Content-type: text/x-json; UTF-8');
    echo json_encode(cronOutPut($result));
    exit;
}
// If there's a task to execute cron feeds, execute it here
if ($task == 'cronfeed') {
    $result['feeds'] = EB::feeds()->cron();
    header('Content-type: text/x-json; UTF-8');
    echo json_encode(cronOutPut($result));
    exit;
}
function cronOutPut($results)
{
    $output = array();
    foreach ($results as $key => $data) {
        $newdata = new stdClass();
        $newdata->status = '';
        $newdata->type = '';
        $newdata->message = '';
        if ($data instanceof EasyBlogException) {
            $item = $data->toArray();
            $newdata->status = $item['code'];
Пример #7
0
	                        <span class="eb-text"><?php 
        echo JText::_('COM_EASYBLOG_SUBSCRIPTION_UNSUBSCRIBE_TO_SITE');
        ?>
</span>
	                    </a>
	                </li>
	            <?php 
    }
    ?>

	            <?php 
    if ($this->config->get('main_rss') && $this->acl->get('allow_subscription_rss')) {
        ?>
	    		<li>
	    			<a class="eb-brand-rss" href="<?php 
        echo EB::feeds()->getFeedURL('index.php?option=com_easyblog');
        ?>
"
	    				data-original-title="<?php 
        echo JText::_('COM_EASYBLOG_SUBSCRIBE_FEEDS');
        ?>
"
						data-placement="bottom"
						data-eb-provide="tooltip"
					>
	    				<i class="fa fa-rss-square"></i>
	    				<span class="eb-text"><?php 
        echo JText::_('COM_EASYBLOG_SUBSCRIBE_FEEDS');
        ?>
</span>
	    			</a>
Пример #8
0
?>

<?php 
if ($tags) {
    ?>
<div class="eb-tags-list clearfix">
	<?php 
    foreach ($tags as $tag) {
        ?>
	<div class="eb-tags-grid">
		<div class="eb-tags-item">
			<?php 
        if ($this->config->get('main_rss') && $this->params->get('tag_rss', true)) {
            ?>
			<a href="<?php 
            echo EB::feeds()->getFeedURL('index.php?option=com_easyblog&view=tags&layout=tag&id=' . $tag->getAlias(), false, 'tag');
            ?>
">
				<i class="fa fa-rss-square"></i>
			</a>
			<?php 
        }
        ?>

			<a href="<?php 
        echo $tag->getPermalink();
        ?>
" title="<?php 
        echo $this->html('string.escape', $tag->title);
        ?>
">
Пример #9
0
        ?>
</a>
				</span>
				<?php 
    }
    ?>
			<?php 
}
?>

			<?php 
if (($team->access != EBLOG_TEAMBLOG_ACCESS_MEMBER || $team->isMember || EB::isSiteAdmin()) && $this->config->get('main_rss')) {
    ?>
			<span>
				<a class="link-rss" href="<?php 
    echo EB::feeds()->getFeedURL('index.php?option=com_easyblog&view=teamblog&id=' . $team->id);
    ?>
" title="<?php 
    echo JText::_('COM_EASYBLOG_SUBSCRIBE_FEEDS');
    ?>
">
					<?php 
    echo JText::_('COM_EASYBLOG_SUBSCRIBE_FEEDS');
    ?>
				</a>
			</span>
			<?php 
}
?>

Пример #10
0
 /**
  * Retrieves rss link for the category
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function getRssLink()
 {
     $config = EB::config();
     if ($config->get('main_feedburnerblogger')) {
         $feedburner = EB::table('Feedburner');
         $feedburner->load($this->id);
         if (!empty($feedburner->url)) {
             $rssLink = $feedburner->url;
             return $rssLink;
         }
     }
     return EB::feeds()->getFeedURL('index.php?option=com_easyblog&view=blogger&id=' . $this->id, false, true);
 }
Пример #11
0
 /**
  * Displays the frontpage blog listings on the site.
  *
  * @since	5.0
  * @access	public
  */
 public function display($tmpl = null)
 {
     // Add the RSS headers on the page
     EB::feeds()->addHeaders('index.php?option=com_easyblog');
     // Add breadcrumbs on the site menu.
     $this->setPathway('COM_EASYBLOG_LATEST_BREADCRUMB');
     // Get the current active menu's properties.
     $params = $this->theme->params;
     $inclusion = '';
     if ($params) {
         // Get a list of category inclusions
         $inclusion = EB::getCategoryInclusion($params->get('inclusion'));
         if ($params->get('includesubcategories', 0) && !empty($inclusion)) {
             $tmpInclusion = array();
             foreach ($inclusion as $includeCatId) {
                 // Retrieve nested categories
                 $category = new stdClass();
                 $category->id = $includeCatId;
                 $category->childs = null;
                 EB::buildNestedCategories($category->id, $category);
                 $linkage = '';
                 EB::accessNestedCategories($category, $linkage, '0', '', 'link', ', ');
                 $catIds = array();
                 $catIds[] = $category->id;
                 EB::accessNestedCategoriesId($category, $catIds);
                 $tmpInclusion = array_merge($tmpInclusion, $catIds);
             }
             $inclusion = $tmpInclusion;
         }
     }
     // Sorting for the posts
     $sort = $this->input->get('sort', $this->config->get('layout_postorder'), 'cmd');
     $model = EB::model('Blog');
     $tobeCached = array();
     // Retrieve a list of featured blog posts on the site.
     $featured = $model->getFeaturedBlog($inclusion);
     $excludeIds = array();
     // Test if user also wants the featured items to be appearing in the blog listings on the front page.
     // Otherwise, we'll need to exclude the featured id's from appearing on the front page.
     if (!$this->theme->params->get('post_include_featured', true)) {
         foreach ($featured as $item) {
             $excludeIds[] = $item->id;
         }
     }
     // Admin might want to display the featured blogs on all pages.
     $start = $this->input->get('start', 0, 'int');
     $limitstart = $this->input->get('limitstart', 0, 'int');
     if (!$this->theme->params->get('featured_slider_all_pages') && ($start != 0 || $limitstart != 0)) {
         $featured = array();
     }
     if ($featured) {
         $tobeCached = array_merge($tobeCached, $featured);
     }
     // Try to retrieve any categories to be excluded.
     $excludedCategories = $this->config->get('layout_exclude_categories');
     $excludedCategories = empty($excludedCategories) ? '' : explode(',', $excludedCategories);
     // Fetch the blog entries.
     $data = $model->getBlogsBy('', '', $sort, 0, EBLOG_FILTER_PUBLISHED, null, true, $excludeIds, false, false, true, $excludedCategories, $inclusion, null, 'listlength', $this->theme->params->get('post_pin_featured', false));
     if ($data) {
         $tobeCached = array_merge($tobeCached, $data);
     }
     // we will cache it here.
     if ($tobeCached) {
         EB::cache()->insert($tobeCached);
     }
     // Get the pagination
     $pagination = $model->getPagination();
     if ($featured) {
         // Format the featured items without caching
         $featured = EB::formatter('featured', $featured, false);
     }
     // Perform blog formatting without caching
     $posts = EB::formatter('list', $data, false);
     // Update the title of the page if navigating on different pages to avoid Google marking these title's as duplicates.
     $title = EB::getPageTitle(JText::_('COM_EASYBLOG_LATEST_PAGE_TITLE'));
     // Set the page title
     $this->setPageTitle($title, $pagination, $this->config->get('main_pagetitle_autoappend'));
     // Add canonical URLs.
     $this->canonical('index.php?option=com_easyblog');
     // Retrieve the pagination for the latest view
     $pagination = $pagination->getPagesLinks();
     // Meta should be set later because formatter would have cached the post already.
     EB::setMeta(META_ID_LATEST, META_TYPE_VIEW);
     // Get the current url
     $return = EBR::_('index.php?option=com_easyblog', false);
     $this->set('return', $return);
     $this->set('posts', $posts);
     $this->set('featured', $featured);
     $this->set('pagination', $pagination);
     parent::display('blogs/latest/default');
 }
Пример #12
0
 /**
  * Retrieves rss link for the category
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function getRssLink()
 {
     return EB::feeds()->getFeedURL('index.php?option=com_easyblog&view=teamblog&layout=listings&id=' . $this->id, false, 'teamblog');
 }
Пример #13
0
		<div class="joms-tab__content">
			<div class="app-box" id="community-group-blogs">

				<div class="app-box-content">
					<div id="ezblog-body">
						<ul class="blog-items reset-ul">
<?php 
}
?>

						<?php 
if ($showRss) {
    ?>
							<div class="blog-group-blog-rss">
								<a href="<?php 
    echo EB::feeds()->getFeedURL('index.php?option=com_easyblog&view=latest');
    ?>
&amp;group=<?php 
    echo $id;
    ?>
" class="subscribe-rss" target="_blank">
									<?php 
    echo JText::_('GROUP_EASYBLOG_SUBSCRIBE_TO_RSS');
    ?>
								</a>
							</div>
						<?php 
}
?>