本文整理汇总了PHP中EasyBlogRouter::isCurrentActiveMenu方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogRouter::isCurrentActiveMenu方法的具体用法?PHP EasyBlogRouter::isCurrentActiveMenu怎么用?PHP EasyBlogRouter::isCurrentActiveMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogRouter
的用法示例。
在下文中一共展示了EasyBlogRouter::isCurrentActiveMenu方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tmpl = null)
{
$my = JFactory::getUser();
if ($my->id < 1) {
EasyBlogHelper::showLogin();
return;
}
JPluginHelper::importPlugin('easyblog');
$dispatcher = JDispatcher::getInstance();
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$acl = EasyBlogACLHelper::getRuleSet();
$config = EasyBlogHelper::getConfig();
$sort = JRequest::getCmd('sort', $config->get('layout_postorder'));
$blogger = EasyBlogHelper::getTable('Profile', 'Table');
$blogger->load($my->id);
// set meta tags for blogger
EasyBlogHelper::setMeta($my->id, META_ID_BLOGGERS);
if (!EasyBlogRouter::isCurrentActiveMenu('myblog', $my->id)) {
$this->setPathway(JText::_('COM_EASYBLOG_BLOGGERS_BREADCRUMB'), EasyBlogRouter::_('index.php?option=com_easyblog&view=blogger'));
$this->setPathway($blogger->getName());
}
$model = $this->getModel('Blog');
$data = $model->getBlogsBy('blogger', $blogger->id, $sort);
$pagination = $model->getPagination();
$pageNumber = $pagination->get('pages.current');
$pageText = $pageNumber == 1 ? '' : ' - ' . JText::sprintf('COM_EASYBLOG_PAGE_NUMBER', $pageNumber);
$document->setTitle($blogger->getName() . $pageText . EasyBlogHelper::getPageTitle(JText::_('COM_EASYBLOG_MY_BLOG_PAGE_TITLE')));
$data = EasyBlogHelper::formatBlog($data, false, true, true, true);
if ($config->get('layout_showcomment', false)) {
for ($i = 0; $i < count($data); $i++) {
$row =& $data[$i];
$maxComment = $config->get('layout_showcommentcount', 3);
$comments = EasyBlogHelper::getHelper('Comment')->getBlogComment($row->id, $maxComment, 'desc');
$comments = EasyBlogHelper::formatBlogCommentsLite($comments);
$row->comments = $comments;
}
}
$rssURL = EasyBlogRouter::_('index.php?option=com_easyblog&view=blogger&task=rss');
//twitter follow me link
$twitterFollowMelink = EasyBlogSocialShareHelper::getLink('twitter', $blogger->id);
$theme = new CodeThemes();
$theme->set('rssURL', $rssURL);
$theme->set('blogger', $blogger);
$theme->set('sort', $sort);
$theme->set('blogs', $data);
$theme->set('currentURL', 'index.php?option=com_easyblog&view=latest');
$theme->set('pagination', $pagination->getPagesLinks());
$theme->set('twitterFollowMelink', $twitterFollowMelink);
$theme->set('my', $my);
$theme->set('acl', $acl);
echo $theme->fetch('blog.blogger.php');
}
示例2: display
/**
* Displays the default categories layout
*
* @since 4.0
* @access public
* @param string
* @return
*/
public function display($tmpl = null)
{
// Set meta tags for bloggers
EB::setMeta(META_ID_GATEGORIES, META_TYPE_VIEW);
// If the active menu is this view, we should not make the breadcrumb linkable.
if (EasyBlogRouter::isCurrentActiveMenu('categories')) {
$this->setPathway(JText::_('COM_EASYBLOG_CATEGORIES_BREADCRUMB'), '');
}
// Sorting options
$defaultSorting = $this->config->get('layout_sorting_category', 'latest');
$sort = $this->input->get('sort', $defaultSorting, 'cmd');
// Load up our own models
$model = EB::model('Category');
// Test if there's any explicit inclusion of categories
$menu = $this->app->getMenu()->getActive();
$inclusion = '';
if (is_object($menu) && stristr($menu->link, 'view=categories') !== false) {
$inclusion = EB::getCategoryInclusion($menu->params->get('inclusion'));
}
// Get the number of categories to show per page
$limit = $this->config->get('layout_pagination_categories_per_page');
// Get the categories
$categories = $model->getCategories($sort, $this->config->get('main_categories_hideempty'), $limit, $inclusion);
// Get the pagination
$pagination = $model->getPagination();
$pagination = $pagination->getPagesLinks();
// Format the categories
$categories = EB::formatter('categories', $categories);
// 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_CATEGORIES_PAGE_TITLE'));
$this->setPageTitle($title, $pagination, $this->config->get('main_pagetitle_autoappend'));
// Add canonical URLs.
$this->canonical('index.php?option=com_easyblog&view=categories');
// Get the default pagination limit for authors
$limit = $this->app->getCfg('list_limit');
$limit = $limit == 0 ? 5 : $limit;
$this->set('limit', $limit);
$this->set('categories', $categories);
$this->set('sort', $sort);
$this->set('pagination', $pagination);
$namespace = 'blogs/categories/default';
if ($this->getLayout() == 'simple') {
$namespace = 'blogs/categories/default.simple';
}
parent::display($namespace);
}
示例3: statistic
function statistic()
{
JPluginHelper::importPlugin('easyblog');
$dispatcher = JDispatcher::getInstance();
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$config = EasyBlogHelper::getConfig();
$my = JFactory::getUser();
$acl = EasyBlogACLHelper::getRuleSet();
// Add noindex for tags view by default.
$document->setMetadata('robots', 'noindex,follow');
$sort = JRequest::getCmd('sort', $config->get('layout_postorder'));
$bId = JRequest::getCmd('id', '0');
//stats type
$statType = JRequest::getString('stat', '');
$statId = $statType == 'tag' ? JRequest::getString('tagid', '') : JRequest::getString('catid', '');
$statObject = null;
if ($statType == 'category') {
$statObject = EasyBlogHelper::getTable('Category', 'Table');
$statObject->load($statId);
} else {
JTable::addIncludePath(EBLOG_TABLES);
$statObject = EasyBlogHelper::getTable('Tag', 'Table');
$statObject->load($statId);
}
$blogger = EasyBlogHelper::getTable('Profile', 'Table');
$blogger->load($bId);
// set meta tags for blogger
if ($acl->rules->allow_seo) {
EasyBlogHelper::setMeta($blogger->id, META_TYPE_BLOGGER, true);
}
if (!EasyBlogRouter::isCurrentActiveMenu('blogger')) {
$this->setPathway(JText::_('COM_EASYBLOG_BLOGGERS'), EasyBlogRouter::_('index.php?option=com_easyblog&view=blogger'));
}
if (!EasyBlogRouter::isCurrentActiveMenu('blogger', $blogger->id)) {
$this->setPathway($blogger->getName());
}
$model = $this->getModel('Blog');
$data = $model->getBlogsBy('blogger', $blogger->id, $sort);
$pagination = $model->getPagination();
$data = EasyBlogHelper::formatBlog($data);
$rssURL = EasyBlogRouter::_('index.php?option=com_easyblog&view=blogger&task=rss');
if ($config->get('layout_showcomment', false)) {
for ($i = 0; $i < count($data); $i++) {
$row =& $data[$i];
$maxComment = $config->get('layout_showcommentcount', 3);
$comments = EasyBlogHelper::getHelper('Comment')->getBlogComment($row->id, $maxComment, 'desc');
$comments = EasyBlogHelper::formatBlogCommentsLite($comments);
$row->comments = $comments;
}
}
$twitterFollowMelink = EasyBlogSocialShareHelper::getLink('twitter', $blogger->id);
if ($config->get('main_rss')) {
if ($config->get('main_feedburner') && $config->get('main_feedburnerblogger')) {
$document->addHeadLink($blogger->getRSS(), 'alternate', 'rel', array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'));
} else {
// Add rss feed link
$document->addHeadLink($blogger->getRSS(), 'alternate', 'rel', array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'));
$document->addHeadLink($blogger->getAtom(), 'alternate', 'rel', array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'));
}
}
$pageTitle = EasyBlogHelper::getPageTitle($config->get('main_title'));
$pageNumber = $pagination->get('pages.current');
$pageText = $pageNumber == 1 ? '' : ' - ' . JText::sprintf('COM_EASYBLOG_PAGE_NUMBER', $pageNumber);
$statTitle = '';
if (isset($statType)) {
if ($statType == 'tag') {
$statTitle = ' - ' . JText::sprintf('COM_EASYBLOG_BLOGGER_STAT_TAG', $statObject->title);
} else {
$statTitle = ' - ' . JText::sprintf('COM_EASYBLOG_BLOGGER_STAT_CATEGORY', $statObject->title);
}
}
$document->setTitle($blogger->getName() . $statTitle . $pageText . $pageTitle);
$tpl = new CodeThemes();
$tpl->set('blogger', $blogger);
$tpl->set('sort', $sort);
$tpl->set('blogs', $data);
$tpl->set('config', $config);
$tpl->set('siteadmin', EasyBlogHelper::isSiteAdmin());
$tpl->set('pagination', $pagination->getPagesLinks());
$tpl->set('twitterFollowMelink', $twitterFollowMelink);
$tpl->set('my', $my);
$tpl->set('acl', $acl);
$tpl->set('currentURL', ltrim('/', JRequest::getURI()));
$tpl->set('statType', $statType);
$tpl->set('statObject', $statObject);
echo $tpl->fetch('blog.blogger.php');
}
示例4: setViewBreadcrumb
/**
* Sets view in breadcrumbs
*
* @since 4.0
* @access public
* @param string
* @return
*/
public function setViewBreadcrumb($view)
{
if (!EasyBlogRouter::isCurrentActiveMenu($view)) {
$this->setPathway(JText::_('COM_EASYBLOG_BREADCRUMB_' . strtoupper($view)));
return true;
}
return false;
}
示例5: listings
function listings()
{
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$config = EasyBlogHelper::getConfig();
$theme = $config->get('layout_theme');
$my = JFactory::getUser();
$acl = EasyBlogACLHelper::getRuleSet();
//setting pathway
$pathway = $mainframe->getPathway();
$id = JRequest::getInt('id', 0);
if ($id == 0) {
echo JText::_('COM_EASYBLOG_TEAMBLOG_INVALID_ID');
return;
}
// set meta tags for teamblog view
EasyBlogHelper::setMeta($id, META_TYPE_TEAM);
$team = EasyBlogHelper::getTable('TeamBlog', 'Table');
$team->load($id);
$team->avatar = $team->getAvatar();
$gid = EasyBlogHelper::getUserGids();
$isMember = $team->isMember($my->id, $gid);
//check if the logged in user a teammember when the team set to member only.
if ($team->access == EBLOG_TEAMBLOG_ACCESS_MEMBER) {
$isMember = $team->isMember($my->id, $gid);
}
$team->isMember = $isMember;
$team->isActualMember = $team->isMember($my->id, $gid, false);
if ($team->access == EBLOG_TEAMBLOG_ACCESS_EVERYONE || $team->isMember) {
// Add rss feed link
$document->addHeadLink($team->getRSS(), 'alternate', 'rel', array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'));
$document->addHeadLink($team->getAtom(), 'alternate', 'rel', array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'));
}
// check if team description is emtpy or not. if yes, show default message.
if (empty($team->description)) {
$team->description = JText::_('COM_EASYBLOG_TEAMBLOG_NO_DESCRIPTION');
}
//add the pathway for teamblog
if (!EasyBlogRouter::isCurrentActiveMenu('teamblog', $team->id)) {
if (!EasyBlogRouter::isCurrentActiveMenu('teamblog')) {
$this->setPathway(JText::_('COM_EASYBLOG_TEAMBLOG'), EasyBlogRouter::_('index.php?option=com_easyblog&view=teamblog'));
}
$this->setPathway($team->title, '');
}
$tbModel = $this->getModel('TeamBlogs');
$model = $this->getModel('Blog');
$blogs = $model->getBlogsBy('teamblog', $team->id);
$blogs = EasyBlogHelper::formatBlog($blogs, true);
$pagination = $model->getPagination();
//now get the teams info
$members = $tbModel->getTeamMembers($team->id);
$teamMembers = EasyBlogHelper::formatTeamMembers($members);
$isFeatured = EasyBlogHelper::isFeatured('teamblog', $team->id);
$title = EasyBlogHelper::getPageTitle($team->title);
// @task: Set the page title
parent::setPageTitle($title, $pagination, $config->get('main_pagetitle_autoappend'));
EasyBlogHelper::storeSession($team->id, 'EASYBLOG_TEAMBLOG_ID');
$tpl = new CodeThemes();
$tpl->set('team', $team);
$tpl->set('teamMembers', $teamMembers);
$tpl->set('data', $blogs);
$tpl->set('isFeatured', $isFeatured);
$tpl->set('pagination', $pagination->getPagesLinks());
$tpl->set('siteadmin', EasyBlogHelper::isSiteAdmin());
$tpl->set('currentURL', 'index.php?option=com_easyblog&view=teamblog&layout=listings&id=' . $team->id);
$tpl->set('config', $config);
$tpl->set('my', $my);
$tpl->set('acl', $acl);
echo $tpl->fetch('blog.teamblogs.php');
}
示例6: preview
function preview()
{
JPluginHelper::importPlugin('easyblog');
$dispatcher = JDispatcher::getInstance();
$mainframe = JFactory::getApplication();
$acl = EasyBlogACLHelper::getRuleSet();
$config = EasyBlogHelper::getConfig();
$document = JFactory::getDocument();
$my = JFactory::getUser();
$params = $mainframe->getParams('com_easyblog');
if (!EasyBlogHelper::isLoggedIn()) {
EasyBlogHelper::showLogin();
return;
}
$draftId = JRequest::getVar('draftid', '');
$draft = EasyBlogHelper::getTable('Draft', 'Table');
$draft->load($draftId);
$blog = EasyBlogHelper::getTable('Blog', 'Table');
$blog->bind($draft);
$blogger = null;
if ($blog->created_by != 0) {
$blogger = EasyBlogHelper::getTable('Profile', 'Table');
$blogger->load($blog->created_by);
}
// @rule: Set the author object into the table.
$blog->author = $blogger;
$blog->blogger = $blogger;
$blogId = empty($draft->entry_id) ? $draft->id : $draft->entry_id;
$limitstart = '0';
$notice = '';
$team = '';
$blog->tags = empty($draft->tags) ? array() : $this->bindTags(explode(',', $draft->tags));
// metas
$meta = new stdClass();
$meta->id = '';
$meta->keywords = $draft->metakey;
$meta->description = $draft->metadesc;
$pageTitle = EasyBlogHelper::getPageTitle($config->get('main_title'));
$document->setTitle($blog->title . $pageTitle);
// process the video here if nessary
$blog->intro = EasyBlogHelper::getHelper('Videos')->processVideos($blog->intro);
$blog->content = EasyBlogHelper::getHelper('Videos')->processVideos($blog->content);
// @rule: Process audio files.
$blog->intro = EasyBlogHelper::getHelper('Audio')->process($blog->intro);
$blog->content = EasyBlogHelper::getHelper('Audio')->process($blog->content);
// @rule: Before any trigger happens, try to replace the gallery first and append it at the bottom.
$blog->intro = EasyBlogHelper::getHelper('Gallery')->process($blog->intro, $blog->created_by);
$blog->content = EasyBlogHelper::getHelper('Gallery')->process($blog->content, $blog->created_by);
// Process jomsocial album's.
$blog->intro = EasyBlogHelper::getHelper('Album')->process($blog->intro, $blog->created_by);
$blog->content = EasyBlogHelper::getHelper('Album')->process($blog->content, $blog->created_by);
// @trigger: onEasyBlogPrepareContent
EasyBlogHelper::triggerEvent('easyblog.prepareContent', $blog, $params, $limitstart);
//onPrepareContent trigger start
$blog->introtext = $blog->intro;
$blog->text = $blog->intro . $blog->content;
// @trigger: onEasyBlogPrepareContent
EasyBlogHelper::triggerEvent('prepareContent', $blog, $params, $limitstart);
$blog->intro = $blog->introtext;
$blog->content = $blog->text;
$isFeatured = false;
//page setup
$blogHtml = '';
$commentHtml = '';
$blogHeader = '';
$blogFooter = '';
$adsenseHtml = '';
$trackbackHtml = '';
$blogger = null;
if ($blog->created_by != 0) {
$blogger = EasyBlogHelper::getTable('Profile', 'Table');
$blogger->load($blog->created_by);
}
//onAfterDisplayTitle, onBeforeDisplayContent, onAfterDisplayContent trigger start
$blog->event = new stdClass();
// @trigger: onAfterDisplayTitle / onContentAfterTitle
$results = EasyBlogHelper::triggerEvent('afterDisplayTitle', $blog, $params, $limitstart);
$blog->event->afterDisplayTitle = JString::trim(implode("\n", $results));
// @trigger: onBeforeDisplayContent / onContentBeforeDisplay
$results = EasyBlogHelper::triggerEvent('beforeDisplayContent', $blog, $params, $limitstart);
$blog->event->beforeDisplayContent = JString::trim(implode("\n", $results));
// @trigger: onAfterDisplayContent / onContentAfterDisplay
EasyBlogHelper::triggerEvent('afterDisplayContent', $blog, $params, $limitstart);
$blog->event->afterDisplayContent = JString::trim(implode("\n", $results));
if (!EasyBlogRouter::isCurrentActiveMenu('blogger', $blogger->id)) {
$this->setPathway($blogger->getName(), $blogger->getLink());
}
if (!EasyBlogRouter::isCurrentActiveMenu('entry', $blog->id)) {
$this->setPathway($blog->title, '');
}
$blog->totalComments = 0;
// Facebook Like integrations
require_once EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'facebook.php';
$facebookLike = EasyBlogFacebookLikes::getLikeHTML($blog);
$url = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $blog->id, false, true);
//get blog navigation object
$blogNav = EasyBlogHelper::getBlogNavigation($blog->id, $blog->created, $team, 'team');
//$team
$prevLink = array();
if (!empty($blogNav['prev'])) {
//.........这里部分代码省略.........
示例7: tag
/**
* Displays blog listings by specific tags on the site
*
* @since 4.0
* @access public
* @param string
* @return
*/
public function tag()
{
// Get the tag id
$id = $this->input->get('id', '', 'default');
// Add noindex for tags listing by default
$this->doc->setMetadata('robots', 'noindex,follow');
// Load the tag object
$tag = EB::table('Tag');
$tag->load($id);
// The tag could be a permalink
if (!$tag->id) {
$tag->load($id, true);
}
// Set page title
$this->setPageTitle($tag->getTitle(), '', $this->config->get('main_pagetitle_autoappend'));
// set meta tags for tags view
EB::setMeta(META_ID_TAGS, META_TYPE_VIEW, $tag->getTitle() . ' - ' . EB::getPageTitle($this->config->get('main_title')));
// Set breadcrumb
if (!EasyBlogRouter::isCurrentActiveMenu('tags')) {
$this->setPathway(JText::_('COM_EASYBLOG_TAGS_BREADCRUMB'), EBR::_('index.php?option=com_easyblog&view=tags'));
}
$this->setPathway($tag->getTitle());
// Get the blogs model
$blogModel = EB::model('Blog');
$tagModel = EB::model('Tags');
// Get the blog posts now
$rows = $blogModel->getTaggedBlogs($tag->id, false, '');
// Get the pagination
$pagination = $blogModel->getPagination();
// Get total number of private blog posts
$privateCount = 0;
// Get total number of team blog count
$teamblogCount = 0;
if ($this->my->guest) {
$privateCount = $tagModel->getTagPrivateBlogCount($id);
}
// Determines if we should get the team blog count
if (!$this->config->get('main_includeteamblogpost')) {
$teamblogCount = $tagModel->getTeamBlogCount($id);
}
// Format the blog posts using the standard list formatter
$posts = EB::formatter('list', $rows);
$return = base64_encode($tag->getPermalink());
$this->set('return', $return);
$this->set('tag', $tag);
$this->set('posts', $posts);
$this->set('pagination', $pagination);
$this->set('private', $privateCount);
$this->set('team', $teamblogCount);
parent::display('tags/item');
}
示例8: calendar
function calendar($tmpl = null)
{
JPluginHelper::importPlugin('easyblog');
$dispatcher = JDispatcher::getInstance();
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$config = EasyBlogHelper::getConfig();
$my = JFactory::getUser();
$acl = EasyBlogACLHelper::getRuleSet();
//setting pathway
$pathway = $mainframe->getPathway();
if (!EasyBlogRouter::isCurrentActiveMenu('archive')) {
$pathway->addItem(JText::_('COM_EASYBLOG_ARCHIVE_BREADCRUMB'), '');
}
EasyBlogHelper::getHelper('Feeds')->addHeaders('index.php?option=com_easyblog&view=archive');
$menuParams = $mainframe->getParams();
$defaultYear = $menuParams->get('es_archieve_year', 0);
$defaultMonth = $menuParams->get('es_archieve_month', 0);
$archiveYear = JRequest::getVar('archiveyear', $defaultYear, 'REQUEST');
$archiveMonth = JRequest::getVar('archivemonth', $defaultMonth, 'REQUEST');
$archiveDay = JRequest::getVar('archiveday', 0, 'REQUEST');
$itemId = JRequest::getInt('Itemid', 0);
if (empty($archiveYear) || empty($archiveMonth)) {
// @task: Set the page title
$title = EasyBlogHelper::getPageTitle(JText::_('COM_EASYBLOG_ARCHIVE_PAGE_TITLE'));
parent::setPageTitle($title, false, $config->get('main_pagetitle_autoappend'));
$tpl = new CodeThemes();
$tpl->set('itemId', $itemId);
echo $tpl->fetch('calendar.php');
return;
}
$date = EasyBlogHelper::getDate();
$sort = 'latest';
$model = $this->getModel('Archive');
$year = $model->getArchiveMinMaxYear();
$data = $model->getArchive($archiveYear, $archiveMonth, $archiveDay);
$pagination = $model->getPagination();
$params = $mainframe->getParams('com_easyblog');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
$data = EasyBlogHelper::formatBlog($data);
//if day is empty
if (empty($archiveDay)) {
$archiveDay = '01';
$dateformat = '%B %Y';
$emptyPostMsg = JText::_('COM_EASYBLOG_ARCHIVE_NO_ENTRIES_ON_MONTH');
} else {
$dateformat = '%d %B %Y';
$emptyPostMsg = JText::_('COM_EASYBLOG_ARCHIVE_NO_ENTRIES_ON_DAY');
}
$archiveDay = strlen($archiveDay) < 2 ? '0' . $archiveDay : $archiveDay;
$viewDate = EasyBlogHelper::getDate($archiveYear . '-' . $archiveMonth . '-' . $archiveDay);
$formatedDate = $viewDate->toFormat($dateformat);
$archiveTitle = JText::sprintf('COM_EASYBLOG_ARCHIVE_HEADING_TITLE', $formatedDate);
// @task: Set the page title
$title = EasyBlogHelper::getPageTitle(JText::sprintf('COM_EASYBLOG_ARCHIVE_HEADING_TITLE', $formatedDate));
parent::setPageTitle($title, false, $config->get('main_pagetitle_autoappend'));
// set meta tags for featured view
EasyBlogHelper::setMeta(META_ID_ARCHIVE, META_TYPE_VIEW, JText::_('COM_EASYBLOG_ARCHIVE_PAGE_TITLE') . ' - ' . $formatedDate);
// set meta tags for featured view
EasyBlogHelper::setMeta(META_ID_ARCHIVE, META_TYPE_VIEW, JText::_('COM_EASYBLOG_ARCHIVE_PAGE_TITLE') . ' - ' . $formatedDate);
$tpl = new CodeThemes();
$tpl->set('data', $data);
$tpl->set('pagination', $pagination->getPagesLinks());
$tpl->set('siteadmin', EasyBlogHelper::isSiteAdmin());
$tpl->set('archiveYear', $archiveYear);
$tpl->set('archiveMonth', $archiveMonth);
$tpl->set('archiveDay', $archiveDay);
$tpl->set('config', $config);
$tpl->set('my', $my);
$tpl->set('acl', $acl);
$tpl->set('archiveTitle', $archiveTitle);
$tpl->set('emptyPostMsg', $emptyPostMsg);
echo $tpl->fetch('blog.archive.php');
}
示例9: teamblogs
function teamblogs()
{
$mainframe = JFactory::getApplication();
$acl = EasyBlogACLHelper::getRuleSet();
$config = EasyBlogHelper::getConfig();
$document = JFactory::getDocument();
$my = JFactory::getUser();
$title = EasyBlogHelper::getPageTitle(JText::_('COM_EASYBLOG_DASHBOARD_TEAMBLOG_PAGE_TITLE'));
// @task: Set the page title
parent::setPageTitle($title, false, $config->get('main_pagetitle_autoappend'));
if (!EasyBlogRouter::isCurrentActiveMenu('dashboard')) {
$this->setPathway(JText::_('COM_EASYBLOG_DASHBOARD_BREADCRUMB'), EasyBlogRouter::_('index.php?option=com_easyblog&view=dashboard'));
}
$this->setPathway(JText::_('COM_EASYBLOG_DASHBOARD_TEAMBLOG_BREADCRUMB'), '');
if (!EasyBlogHelper::isLoggedIn()) {
EasyBlogHelper::showLogin();
return;
}
if (!EasyBlogHelper::isTeamAdmin()) {
EasyBlogHelper::showAccessDenied();
return;
}
// get all the team request that this user assigned as admin.
$tbRequest = $this->getModel('TeamBlogs');
$myId = EasyBlogHelper::isSiteAdmin() ? '' : $my->id;
$requests = $tbRequest->getTeamBlogRequest($myId);
$pagination = $tbRequest->getPagination();
// Add the breadcrumbs
$breadcrumbs = array(JText::_('COM_EASYBLOG_DASHBOARD_BREADCRUMB_TEAM_REQUEST') => '');
$user = EasyBlogHelper::getTable('Profile', 'Table');
$user->load($my->id);
echo $this->showToolbar(__FUNCTION__, $user);
$tpl = new CodeThemes('dashboard');
$tpl->set('user', $user);
$tpl->set('requests', $requests);
$tpl->set('pagination', $pagination);
$tpl->set('breadcrumbs', $breadcrumbs);
echo $tpl->fetch('dashboard.teamblog.request.php');
}
示例10: tag
/**
* Display specific tag from the site.
**/
function tag()
{
$document = JFactory::getDocument();
$config = EasyBlogHelper::getConfig();
$my = JFactory::getUser();
$acl = EasyBlogACLHelper::getRuleSet();
$id = JRequest::getVar('id', '', 'REQUEST');
JTable::addIncludePath(EBLOG_TABLES);
// Add noindex for tags view by default.
$document->setMetadata('robots', 'noindex,follow');
$tag = EasyBlogHelper::getTable('Tag', 'Table');
$tag->load($id);
$title = EasyBlogHelper::getPageTitle($tag->title);
// @task: Set the page title
parent::setPageTitle($title, false, $config->get('main_pagetitle_autoappend'));
// set meta tags for tags view
EasyBlogHelper::setMeta(META_ID_TAGS, META_TYPE_VIEW, JText::_($tag->title) . ' - ' . EasyBlogHelper::getPageTitle($config->get('main_title')));
if (!EasyBlogRouter::isCurrentActiveMenu('tags')) {
$this->setPathway(JText::_('COM_EASYBLOG_TAGS_BREADCRUMB'), EasyBlogRouter::_('index.php?option=com_easyblog&view=tags'));
}
$this->setPathway(JText::_($tag->title));
$blogModel = $this->getModel('Blog');
$tagModel = $this->getModel('Tags');
$rows = $blogModel->getTaggedBlogs($id);
$pagination = $blogModel->getPagination();
$privateBlogCount = 0;
$teamBlogCount = 0;
if ($my->id == 0) {
$privateBlogCount = $tagModel->getTagPrivateBlogCount($id);
}
if (!$config->get('main_includeteamblogpost')) {
$teamBlogCount = $tagModel->getTeamBlogCount($id);
}
//for trigger only
JPluginHelper::importPlugin('easyblog');
$dispatcher = JDispatcher::getInstance();
$mainframe = JFactory::getApplication();
$params = $mainframe->getParams('com_easyblog');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
if (!empty($rows)) {
$rows = EasyBlogHelper::formatBlog($rows, true, true, true, true);
for ($i = 0; $i < count($rows); $i++) {
$row =& $rows[$i];
$row->category = $blogModel->getCategoryName($row->category_id);
// $row->readmore = JText::_('COM_EASYBLOG_CONTINUE_READING');
if ($config->get('layout_showcomment', false)) {
$maxComment = $config->get('layout_showcommentcount', 3);
$comments = EasyBlogHelper::getHelper('Comment')->getBlogComment($row->id, $maxComment, 'desc');
$comments = EasyBlogHelper::formatBlogCommentsLite($comments);
$row->comments = $comments;
}
}
}
$theme = new CodeThemes();
$theme->set('tag', $tag);
$theme->set('rows', $rows);
$theme->set('pagination', $pagination);
$theme->set('currentURL', 'index.php?option=com_easyblog&view=tags&layout=tag&id=' . $tag->id);
$theme->set('privateBlogCount', $privateBlogCount);
$theme->set('teamBlogCount', $teamBlogCount);
echo $theme->fetch('blog.tags.php');
}