本文整理汇总了PHP中EasyBlogHelper::isMineBlog方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::isMineBlog方法的具体用法?PHP EasyBlogHelper::isMineBlog怎么用?PHP EasyBlogHelper::isMineBlog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::isMineBlog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
//.........这里部分代码省略.........
$commentHtml = $config->get('comment_jcomments') ? '' : '<a id="comments"></a>';
$commentHtml .= EasyBlogCommentHelper::getCommentHTML($blog, $comments, $commtPagination);
}
$blog->totalComments = EasyBlogHelper::getHelper('Comment')->getCommentCount($blog);
//get related blog post
$blogRelatedPost = '';
if ($config->get('main_relatedpost', true)) {
$blogRelatedPost = $blogModel->getRelatedBlog($blogId);
}
//get author's recent posts.
$authorRecentPosts = '';
if ($config->get('main_showauthorinfo') && $config->get('main_showauthorposts')) {
$authorPostLimit = $config->get('main_showauthorpostscount');
$authorRecentPosts = $blogModel->getBlogsBy('blogger', $blog->created_by, 'latest', $authorPostLimit);
}
// Facebook Like integrations
require_once EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'facebook.php';
$facebookLike = EasyBlogFacebookLikes::getLikeHTML($blog, $rawIntroText);
$url = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $blog->id, false, true);
// @rule: Add opengraph tags if required.
if ($config->get('main_facebook_opengraph')) {
EasyBlogFacebookLikes::addOpenGraphTags($blog, $rawIntroText);
}
// Add Twitter card details on page.
EasyBlogHelper::getHelper('Twitter')->addCard($blog, $rawIntroText);
// @task: Add canonical URLs.
if ($config->get('main_canonical_entry')) {
$canonicalUrl = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $blog->id, false, true, true);
$document->addCustomTag('<link rel="canonical" href="' . $canonicalUrl . '"/>');
}
// @task: Add rel="nofollow" if necessary.
if ($config->get('main_anchor_nofollow')) {
$blog->content = EasyBlogHelper::addNoFollow($blog->content);
}
$prevLink = array();
$nextLink = array();
// construct prev & next link
//get blog navigation object
if ($config->get('layout_navigation')) {
$blogNav = EasyBlogHelper::getBlogNavigation($blogId, $blog->created, $team, 'team');
//$team
$prevLink = array();
if (!empty($blogNav['prev'])) {
$prevLink['id'] = $blogNav['prev'][0]->id;
$prevLink['title'] = JString::strlen($blogNav['prev'][0]->title) > 50 ? JString::substr($blogNav['prev'][0]->title, 0, 50) . '...' : $blogNav['prev'][0]->title;
}
$nextLink = array();
if (!empty($blogNav['next'])) {
$nextLink['id'] = $blogNav['next'][0]->id;
$nextLink['title'] = JString::strlen($blogNav['next'][0]->title) > 50 ? JString::substr($blogNav['next'][0]->title, 0, 50) . '...' : $blogNav['next'][0]->title;
}
}
// @rule: Mark notifications item in EasyDiscuss when the blog entry is viewed
if ($config->get('integrations_easydiscuss_notification_blog')) {
EasyBlogHelper::getHelper('EasyDiscuss')->readNotification($blog->id, EBLOG_NOTIFICATIONS_TYPE_BLOG);
}
if ($config->get('integrations_easydiscuss_notification_comment')) {
EasyBlogHelper::getHelper('EasyDiscuss')->readNotification($blog->id, EBLOG_NOTIFICATIONS_TYPE_COMMENT);
}
if ($config->get('integrations_easydiscuss_notification_rating')) {
EasyBlogHelper::getHelper('EasyDiscuss')->readNotification($blog->id, EBLOG_NOTIFICATIONS_TYPE_RATING);
}
//get social bookmark provider.
require_once EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'bookmark.php';
$bookmark = EasyBlogBookmark::getHTML();
// @task: As we are standardizing the admin tools, we fix the necessary properties here.
$blog->isFeatured = $isFeatured;
$theme->set('currentURL', EasyBlogRouter::_('index.php?option=com_easyblog&view=latest'));
$theme->set('facebookLike', $facebookLike);
$theme->set('notice', $notice);
$theme->set('team', $team);
$theme->set('blog', $blog);
$theme->set('tags', $tags);
$theme->set('blogger', $blogger);
$theme->set('prevLink', $prevLink);
$theme->set('nextLink', $nextLink);
$theme->set('blogRelatedPost', $blogRelatedPost);
$theme->set('authorRecentPosts', $authorRecentPosts);
$theme->set('isFeatured', $isFeatured);
$theme->set('isMineBlog', EasyBlogHelper::isMineBlog($blog->created_by, $my->id));
$theme->set('acl', $acl);
$theme->set('url', $url);
$theme->set('commentHTML', $commentHtml);
$theme->set('bookmark', $bookmark);
$theme->set('pdfLinkProperties', EasyBlogHelper::getPDFlinkProperties());
$theme->set('ispreview', false);
// @task: trackbacks
$trackbacks = $blogModel->getTrackback($blogId);
$theme->set('trackbackURL', EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=trackback&post_id=' . $blog->id, true, true));
$theme->set('trackbacks', $trackbacks);
//google adsense
$adsense = EasyBlogGoogleAdsense::getHTML($blogger->id);
$blogHeader = $adsense->header;
$blogFooter = $adsense->footer;
$theme->set('adsenseHTML', $adsense->beforecomments);
$blogHtml = $theme->fetch('blog.read' . EasyBlogHelper::getHelper('Sources')->getTemplateFile($blog->source) . '.php');
echo $blogHeader;
echo $blogHtml;
echo $blogFooter;
}
示例2: foreach
<?php
if (isset($statType)) {
?>
<div>
<h2><?php
echo $statType == 'tag' ? JText::sprintf('COM_EASYBLOG_BLOGGER_STAT_TAG', $statObject->title) : JText::sprintf('COM_EASYBLOG_BLOGGER_STAT_CATEGORY', $statObject->title);
?>
</h2>
</div>
<?php
}
?>
<?php
if (!empty($blogs)) {
foreach ($blogs as $row) {
$isMineBlog = EasyBlogHelper::isMineBlog($row->created_by, $system->my->id);
$team = isset($teamId) && !empty($teamId) ? $teamId : '';
$this->set('team', $team);
$this->set('data', array($row));
echo $this->fetch('blog.item' . EasyBlogHelper::getHelper('Sources')->getTemplateFile($row->source) . '.php', array('row' => $row));
}
} else {
?>
<div class="eblog-message info"><?php
echo JText::sprintf('COM_EASYBLOG_BLOGGERS_NO_POST_YET', $blogger->getName());
?>
</div>
<?php
}
?>
示例3: pending
/**
* Responsible to output a list of pending blog posts.
*
*/
function pending($isReview = false)
{
$app = JFactory::getApplication();
$my = JFactory::getUser();
$acl = EasyBlogACLHelper::getRuleSet();
$config = EasyBlogHelper::getConfig();
$doc = JFactory::getDocument();
if (!EasyBlogHelper::isLoggedIn()) {
$uri = JFactory::getURI();
$return = $uri->toString();
$component = EasyBlogHelper::getJoomlaVersion() >= '1.6' ? 'com_users' : 'com_user';
$url = 'index.php?option=' . $userComponent . '&view=login';
$url .= '&return=' . base64_encode($return);
$app->redirect(EasyBlogRouter::_($url, false), JText::_('COM_EASYBLOG_YOU_MUST_LOGIN_FIRST'));
}
if (!$isReview) {
if (empty($acl->rules->manage_pending) || empty($acl->rules->publish_entry)) {
EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_NOT_ALLOWED'), 'error');
$app->redirect(EasyBlogRouter::_('index.php?option=com_easyblog&view=dashboard', false));
return;
}
}
// @task: Set the page title.
self::setPageTitle(JText::_('COM_EASYBLOG_DASHBOARD_PENDING_PAGE_TITLE'), null, true);
// @task: Add breadcrumbs
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_PENDING_BREADCRUMB'), '');
// @task: Add the internal breadcrumbs for EasyBlog
$breadcrumbs = array(JText::_('COM_EASYBLOG_DASHBOARD_BREADCRUMB_PENDING_YOUR_REVIEW') => '');
if ($isReview) {
$breadcrumbs = array(JText::_('COM_EASYBLOG_DASHBOARD_BREADCRUMB_POST_UNDER_REVIEWS') => '');
}
// @task: Render user object
$user = EasyBlogHelper::getTable('Profile', 'Table');
$user->load($my->id);
$typeId = $isReview ? $my->id : '';
// @task: Get the current search value
$search = JRequest::getString('post-search', false, 'POST');
// @task: Retrieve the data
$model = $this->getModel('Blog');
$entries = $model->getPending($typeId, 'latest', 0, $search, false, '', true);
$pagination = $model->getPagination();
$entries = EasyBlogHelper::formatDraftBlog($entries);
for ($i = 0; $i < count($entries); $i++) {
$row =& $entries[$i];
$row->isOwner = EasyBlogHelper::isMineBlog($my->id, $row->created_by);
$profile = EasyBlogHelper::getTable('Profile', 'Table');
$profile->load($row->created_by);
$row->author = $profile;
$row->displayName = $profile->getName();
$row->avatar = $profile->getAvatar();
}
$oauthModel = $this->getModel('Oauth');
$data = $oauthModel->getConsumers($my->id);
$consumers = array();
if (count($data) > 0) {
for ($i = 0; $i < count($data); $i++) {
$row =& $data[$i];
$consumer = EasyBlogHelper::getTable('Oauth', 'Table');
$consumer->bind($row);
$consumers[] = $consumer;
}
}
echo $this->showToolbar(__FUNCTION__, $user);
$tpl = new CodeThemes('dashboard');
$tpl->set('breadcrumbs', $breadcrumbs);
$tpl->set('entries', $entries);
$tpl->set('pagination', $pagination);
$tpl->set('search', $search);
$tpl->set('consumers', $consumers);
$tpl->set('isReview', $isReview);
echo $tpl->fetch('dashboard.pending.php');
}