本文整理汇总了PHP中EasyBlogHelper::showLogin方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::showLogin方法的具体用法?PHP EasyBlogHelper::showLogin怎么用?PHP EasyBlogHelper::showLogin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::showLogin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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'])) {
//.........这里部分代码省略.........
示例3: 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');
}