本文整理汇总了PHP中EasyBlogHelper::getPageTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::getPageTitle方法的具体用法?PHP EasyBlogHelper::getPageTitle怎么用?PHP EasyBlogHelper::getPageTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::getPageTitle方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($tmpl = null)
{
JPluginHelper::importPlugin('easyblog');
$dispatcher = JDispatcher::getInstance();
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$config = EasyBlogHelper::getConfig();
//for trigger
$params = $mainframe->getParams('com_easyblog');
$joomlaVersion = EasyBlogHelper::getJoomlaVersion();
$blogId = $this->input->get('id', 0, 'int');
if (empty($blogId)) {
return JError::raiseError(404, JText::_('COM_EASYBLOG_BLOG_NOT_FOUND'));
}
$my = JFactory::getUser();
$blog = EB::table('Blog');
$blog->load($blogId);
$post = EB::post($blogId);
// Check if blog is password protected.
$protected = $this->isProtected($post);
if ($protected !== false) {
return;
}
// If the blog post is already deleted, we shouldn't let it to be accessible at all.
if ($post->isTrashed()) {
return JError::raiseError(404, JText::_('COM_EASYBLOG_ENTRY_BLOG_NOT_FOUND'));
}
// Check if the blog post is trashed
if (!$post->isPublished() && $this->my->id != $post->created_by && !EB::isSiteAdmin()) {
return JError::raiseError(404, JText::_('COM_EASYBLOG_ENTRY_BLOG_NOT_FOUND'));
}
// Check for team's privacy
$allowed = $this->checkTeamPrivacy($post);
if ($allowed === false) {
return JError::raiseError(404, JText::_('COM_EASYBLOG_TEAMBLOG_MEMBERS_ONLY'));
}
// Check if the blog post is accessible.
$accessible = $post->isAccessible();
if (!$accessible->allowed) {
echo $accessible->error;
return;
}
// Format the post
$post = EB::formatter('entry', $post);
$tags = $post->getTags();
$theme = EB::template();
$theme->set('post', $post);
$theme->set('tags', $tags);
$blogHtml = $theme->output('site/blogs/entry/pdf');
$pageTitle = EasyBlogHelper::getPageTitle($config->get('main_title'));
$document->setTitle($post->title . $pageTitle);
$document->setName($post->getPermalink());
// Fix phoca pdf plugin.
if (method_exists($document, 'setArticleText')) {
$document->setArticleText($blogHtml);
}
echo $blogHtml;
return;
}
示例2: 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');
}
示例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: display
/**
* Default search view for EasyBlog
*
* @since 4.0
* @access public
* @param string
* @return
*/
public function display($tmpl = null)
{
// Set the meta tags for search
EB::setMeta(META_ID_SEARCH, META_TYPE_SEARCH);
// Set the page title
$title = EasyBlogHelper::getPageTitle(JText::_('COM_EASYBLOG_SEARCH_PAGE_TITLE'));
$this->setPageTitle($title);
// Set the view's breadcrumbs
$this->setViewBreadcrumb('search');
// Get any existing query
$query = $this->input->get('query', '', 'default');
$Itemid = $this->input->get('Itemid', '', 'int');
$posts = array();
$pagination = '';
if (!empty($query)) {
// Get the model
$model = EB::model('Search');
$result = $model->getData();
$total = count($result);
if ($total > 0) {
$searchworda = preg_replace('#\\xE3\\x80\\x80#s', ' ', $query);
$searchwords = preg_split("/\\s+/u", $searchworda);
$needle = $searchwords[0];
$searchwords = array_unique($searchwords);
// var_dump($result[0]);
// Format the post
$posts = EB::formatter('list', $result);
// var_dump($posts[0]);
// exit;
// Remove all unecessary codes from the output
foreach ($posts as &$row) {
// var_dump($row->content);
// Strip videos
$row->intro = EB::videos()->strip($row->intro);
$row->content = EB::videos()->strip($row->content);
// strip gallery
$row->intro = EB::gallery()->strip($row->intro);
$row->content = EB::gallery()->strip($row->content);
// strip jomsocial album
$row->intro = EB::album()->strip($row->intro);
$row->content = EB::album()->strip($row->content);
// strip audio
$row->intro = EB::audio()->strip($row->intro);
$row->content = EB::audio()->strip($row->content);
// Format the content so that we can apply our search highlighting
$content = preg_replace('/\\s+/', ' ', strip_tags($row->content));
if (empty($content)) {
$content = preg_replace('/\\s+/', ' ', strip_tags($row->intro));
}
// We only want a snippet of the content
$content = JString::substr(strip_tags($content), 0, 350);
$pattern = '#(';
$x = 0;
foreach ($searchwords as $key => $value) {
$pattern .= $x == 0 ? '' : '|';
$pattern .= preg_quote($value, '#');
$x++;
}
$pattern .= ')#iu';
$row->title = preg_replace($pattern, '<span class="search-highlight">\\0</span>', $row->title);
$row->content = preg_replace($pattern, '<span class="search-highlight">\\0</span>', $content);
}
}
$pagination = $model->getPagination();
}
$this->set('query', $query);
$this->set('posts', $posts);
$this->set('pagination', $pagination);
$this->set('Itemid', $Itemid);
parent::display('search/default');
}
示例5: 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'])) {
//.........这里部分代码省略.........
示例6: 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');
}
示例7: listings
function listings()
{
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$config = EasyBlogHelper::getConfig();
$my = JFactory::getUser();
$acl = EasyBlogACLHelper::getRuleSet();
$sort = JRequest::getCmd('sort', $config->get('layout_postorder'));
$catId = JRequest::getCmd('id', '0');
$category = EasyBlogHelper::getTable('Category', 'Table');
$category->load($catId);
if ($category->id == 0) {
$category->title = JText::_('COM_EASYBLOG_UNCATEGORIZED');
}
// Set the meta description for the category
EasyBlogHelper::setMeta($category->id, META_TYPE_CATEGORY);
// Set the meta description for the category
// $doc->setMetadata( 'description' , strip_tags( $category->description ) );
//setting pathway
$pathway = $app->getPathway();
$privacy = $category->checkPrivacy();
$addRSS = true;
if (!$privacy->allowed) {
if ($my->id == 0 && !$config->get('main_allowguestsubscribe')) {
$addRSS = false;
}
}
if ($addRSS) {
// Add rss feed link
$doc->addHeadLink($category->getRSS(), 'alternate', 'rel', array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'));
$doc->addHeadLink($category->getAtom(), 'alternate', 'rel', array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'));
}
if (!EasyBlogRouter::isCurrentActiveMenu('categories', $category->id)) {
if (!EasyBlogRouter::isCurrentActiveMenu('categories')) {
$this->setPathway(JText::_('COM_EASYBLOG_CATEGORIES_BREADCRUMB'), EasyBlogRouter::_('index.php?option=com_easyblog&view=categories'));
}
//add the pathway for category
$this->setPathway($category->title, '');
}
//get the nested categories
$category->childs = null;
EasyBlogHelper::buildNestedCategories($category->id, $category, false, true);
// TODO: Parameterize initial subcategories to display. Ability to configure from backend.
$nestedLinks = '';
$initialLimit = $app->getCfg('list_limit') == 0 ? 5 : $app->getCfg('list_limit');
if (count($category->childs) > $initialLimit) {
$initialNestedLinks = '';
$initialRow = new stdClass();
$initialRow->childs = array_slice($category->childs, 0, $initialLimit);
EasyBlogHelper::accessNestedCategories($initialRow, $initialNestedLinks, '0', '', 'link', ', ');
$moreNestedLinks = '';
$moreRow = new stdClass();
$moreRow->childs = array_slice($category->childs, $initialLimit);
EasyBlogHelper::accessNestedCategories($moreRow, $moreNestedLinks, '0', '', 'link', ', ');
// Hide more nested links until triggered
$nestedLinks .= $initialNestedLinks;
$nestedLinks .= '<span class="more-subcategories-toggle"> ' . JText::_('COM_EASYBLOG_AND') . ' <a href="javascript: void(0);onclick="eblog.categories.loadMore( this );">' . JText::sprintf('COM_EASYBLOG_OTHER_SUBCATEGORIES', count($category->childs) - $initialLimit) . '</a></span>';
$nestedLinks .= '<span class="more-subcategories" style="display: none;">, ' . $moreNestedLinks . '</span>';
} else {
EasyBlogHelper::accessNestedCategories($category, $nestedLinks, '0', '', 'link', ', ');
}
$catIds = array();
$catIds[] = $category->id;
EasyBlogHelper::accessNestedCategoriesId($category, $catIds);
$category->nestedLink = $nestedLinks;
$modelC = $this->getModel('Category');
$category->cnt = $modelC->getTotalPostCount($category->id);
$modelPT = $this->getModel('PostTag');
$model = $this->getModel('Blog');
$modelCat = $this->getModel('Category');
$data = $model->getBlogsBy('category', $catIds, $sort, null, null, null, null, array(), null, null, null, array(), array(), null, EBLOG_PAGINATION_CATEGORIES);
$pagination = $model->getPagination();
$allowCat = $modelCat->allowAclCategory($category->id);
//for trigger
$params = $app->getParams('com_easyblog');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
if (!empty($data)) {
$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;
}
}
}
$teamBlogCount = $modelCat->getTeamBlogCount($category->id);
$title = EasyBlogHelper::getPageTitle(JText::_($category->title));
// @task: Set the page title
parent::setPageTitle($title, $pagination, $config->get('main_pagetitle_autoappend'));
$themes = new CodeThemes();
$themes->set('allowCat', $allowCat);
$themes->set('category', $category);
$themes->set('sort', $sort);
$themes->set('blogs', $data);
$themes->set('currentURL', 'index.php?option=com_easyblog&view=categories&layout=listings&id=' . $category->id);
$themes->set('pagination', $pagination->getPagesLinks());
$themes->set('config', $config);
//.........这里部分代码省略.........
示例8: microblog
/**
* Micro blogging layout
*
* @since 3.0.7706
* @access public
* @param null
* @return null
*/
public function microblog()
{
$mainframe = JFactory::getApplication();
$config = EasyBlogHelper::getConfig();
$acl = EasyBlogACLHelper::getRuleSet();
if (!EasyBlogHelper::isLoggedIn()) {
EasyBlogHelper::showLogin();
return;
}
$my = JFactory::getuser();
$user = EasyBlogHelper::getTable('Profile', 'Table');
$user->load($my->id);
// @rule: Test if microblogging is allowed
if (!$config->get('main_microblog')) {
EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_NOT_ALLOWED'), 'error');
JFactory::getApplication()->redirect(EasyBlogRouter::_('index.php?option=com_easyblog&view=dashboard', false));
}
// @rule: Test ACL if add entry is allowed
if (!$acl->rules->add_entry) {
$mainframe->redirect(EasyBlogRouter::_('index.php?option=com_easyblog&view=dashboard', false), JText::_('COM_EASYBLOG_NO_PERMISSION_TO_CREATE_BLOG'));
$mainframe->close();
}
$document = JFactory::getDocument();
$title = EasyBlogHelper::getPageTitle(JText::_('COM_EASYBLOG_DASHBOARD_SHARE_A_STORY_TITLE'));
// @task: Set the page title
parent::setPageTitle($title, false, $config->get('main_pagetitle_autoappend'));
// Add toolbar to the output
echo $this->showToolbar(__FUNCTION__, $user);
// Get active tabs
$activeType = JRequest::getVar('type', 'text');
// Add the breadcrumbs
$breadcrumbs = array(JText::_('COM_EASYBLOG_DASHBOARD_BREADCRUMB_SHARE_STORY') => '');
// @task: Retrieve existing categories
$categoryModel = $this->getModel('Categories');
$categories = EasyBlogHelper::populateCategories('', '', 'select', 'category_id', '', true, true, true);
// @task: Retrieve existing tags
$tagsModel = $this->getModel('Tags');
$tags = $tagsModel->getTags();
$template = new CodeThemes('dashboard');
$template->set('activeType', $activeType);
$template->set('categories', $categories);
$template->set('breadcrumbs', $breadcrumbs);
$template->set('tags', $tags);
echo $template->fetch('dashboard.microblog.php');
}
示例9: 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');
}
示例10: display
function display($tmpl = null)
{
JPluginHelper::importPlugin('easyblog');
$dispatcher = JDispatcher::getInstance();
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$config = EasyBlogHelper::getConfig();
//for trigger
$params = $mainframe->getParams('com_easyblog');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
$joomlaVersion = EasyBlogHelper::getJoomlaVersion();
$blogId = JRequest::getVar('id');
if (empty($blogId)) {
return JError::raiseError(404, JText::_('COM_EASYBLOG_BLOG_NOT_FOUND'));
}
$my = JFactory::getUser();
$blog = EasyBlogHelper::getTable('Blog', 'Table');
$blog->load($blogId);
//check if blog is password protected.
if ($config->get('main_password_protect', true) && !empty($blog->blogpassword)) {
if (!EasyBlogHelper::verifyBlogPassword($blog->blogpassword, $blog->id)) {
echo JText::_('COM_EASYBLOG_PASSWORD_PROTECTED_PDF_ERROR');
return false;
}
}
$blog->intro = EasyBlogHelper::getHelper('Videos')->strip($blog->intro);
$blog->content = EasyBlogHelper::getHelper('Videos')->strip($blog->content);
//onEasyBlogPrepareContent trigger start
$dispatcher->trigger('onEasyBlogPrepareContent', array(&$blog, &$params, $limitstart));
//onEasyBlogPrepareContent trigger end
//onPrepareContent trigger start
$blog->introtext = $blog->intro;
$blog->text = $blog->content;
if ($joomlaVersion >= '1.6') {
$dispatcher->trigger('onContentPrepare', array('easyblog.blog', &$blog, &$params, $limitstart));
} else {
$dispatcher->trigger('onPrepareContent', array(&$blog, &$params, $limitstart));
}
$blog->intro = $blog->introtext;
$blog->content = $blog->text;
//onPrepareContent trigger end
// @task: Retrieve tags output.
$modelPT = $this->getModel('PostTag');
$blogTags = $modelPT->getBlogTags($blog->id);
$theme = new CodeThemes();
$theme->set('tags', $blogTags);
$tags = $theme->fetch('tags.item.php');
//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);
$blogger->displayName = $blogger->getName();
}
//onAfterDisplayTitle, onBeforeDisplayContent, onAfterDisplayContent trigger start
$blog->event = new stdClass();
if ($joomlaVersion >= '1.6') {
$results = $dispatcher->trigger('onContentAfterTitle', array('easyblog.blog', &$blog, &$params, $limitstart));
$blog->event->afterDisplayTitle = JString::trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentBeforeDisplay', array('easyblog.blog', &$blog, &$params, $limitstart));
$blog->event->beforeDisplayContent = JString::trim(implode("\n", $results));
$results = $dispatcher->trigger('onContentAfterDisplay', array('easyblog.blog', &$blog, &$params, $limitstart));
$blog->event->afterDisplayContent = JString::trim(implode("\n", $results));
} else {
$results = $dispatcher->trigger('onAfterDisplayTitle', array(&$blog, &$params, $limitstart));
$blog->event->afterDisplayTitle = JString::trim(implode("\n", $results));
$results = $dispatcher->trigger('onBeforeDisplayContent', array(&$blog, &$params, $limitstart));
$blog->event->beforeDisplayContent = JString::trim(implode("\n", $results));
$results = $dispatcher->trigger('onAfterDisplayContent', array(&$blog, &$params, $limitstart));
$blog->event->afterDisplayContent = JString::trim(implode("\n", $results));
}
//onAfterDisplayTitle, onBeforeDisplayContent, onAfterDisplayContent trigger end
$tplB = new CodeThemes();
$tplB->set('blog', $blog);
$tplB->set('tags', $tags);
$tplB->set('config', $config);
$tplB->set('blogger', $blogger);
$blogHtml = $tplB->fetch('blog.read.pdf.php');
//pdf page setup
$pageTitle = EasyBlogHelper::getPageTitle($config->get('main_title'));
$document->setTitle($blog->title . $pageTitle);
$document->setName($blog->permalink);
// Fix phoca pdf plugin.
if (method_exists($document, 'setArticleText')) {
$document->setArticleText($blogHtml);
}
echo $blogHtml;
}