本文整理汇总了PHP中EB::isFeatured方法的典型用法代码示例。如果您正苦于以下问题:PHP EB::isFeatured方法的具体用法?PHP EB::isFeatured怎么用?PHP EB::isFeatured使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EB
的用法示例。
在下文中一共展示了EB::isFeatured方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
if (!$this->items) {
return $this->items;
}
// cache teamblogs
EB::cache()->insertTeams($this->items);
$teams = array();
// Load up the blogs model
$model = EB::model('TeamBlogs');
// Get the current user's group id's
$gid = EB::getUserGids();
foreach ($this->items as $item) {
$team = EB::table('TeamBlog');
$team->load($item->id);
// Check if the logged in user is a member of the group
$team->isMember = $team->isMember($this->my->id, $gid);
$team->isActualMember = $team->isMember($this->my->id, $gid, false);
$team->members = $model->getAllMembers($team->id, 5);
// total member count ( including actual members and users from asociated joomla group.)
$team->memberCount = $team->getAllMembersCount();
// post count associated with this teamblog.
$team->postCount = $team->getPostCount();
// Get the list of blog posts form this team
$blogs = array();
if ($team->access != EBLOG_TEAMBLOG_ACCESS_MEMBER || $team->isMember || EB::isSiteAdmin()) {
$blogs = $model->getPosts($team->id, EASYBLOG_TEAMBLOG_LISTING_NO_POST);
$blogs = EB::formatter('list', $blogs);
}
$team->blogs = $blogs;
// Get the list of tags
// $team->tags = $team->getTags();
// Get categories used in this team
// $team->categories = $team->getCategories();
// Determines if the team is featured
if (isset($item->isfeatured)) {
$team->isFeatured = $item->isfeatured;
} else {
$team->isFeatured = EB::isFeatured('teamblog', $team->id);
}
// 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');
}
// Determines if the viewer is subscribed to this team
$team->isTeamSubscribed = $model->isTeamSubscribedEmail($team->id, $this->my->email);
// If the user is subscribed, we need to get his subscription id
$team->subscription_id = $team->isTeamSubscribed;
$teams[] = $team;
}
return $teams;
}
示例2: listings
/**
* Displays a list of blog posts from a specific team
*
* @since 4.0
* @access public
* @param string
* @return
*/
public function listings()
{
// Get the team id that is being accessed now
$id = $this->input->get('id', 0, 'int');
$team = EB::table('TeamBlog');
$team->load($id);
if (!$id || !$team->id) {
return JError::raiseError(404, JText::_('COM_EASYBLOG_TEAMBLOG_INVALID_ID'));
}
// set meta tags for teamblog view
EB::setMeta($id, META_TYPE_TEAM);
$gid = EB::getUserGids();
$isMember = $team->isMember($this->my->id, $gid);
$team->isMember = $isMember;
$team->isActualMember = $team->isMember($this->my->id, $gid, false);
// Add rss feed link
if ($team->access == EBLOG_TEAMBLOG_ACCESS_EVERYONE || $team->isMember) {
$this->doc->addHeadLink($team->getRSS(), 'alternate', 'rel', array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'));
$this->doc->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');
}
// Set the breadcrumbs for this view
$this->setViewBreadcrumb('teamblog');
$this->setPathway($team->getTitle());
// Retrieve the model
$model = EB::model('TeamBlogs');
$posts = $model->getPosts($team->id);
$posts = EB::formatter('list', $posts);
// Get the pagination
$pagination = $model->getPagination();
// Retrieve team's information
$members = $model->getTeamMembers($team->id);
// Determines if the team blog is featured
$team->isFeatured = EB::isFeatured('teamblog', $team->id);
// Set the page title
$title = EB::getPageTitle($team->title);
$this->setPageTitle($title, $pagination, $this->config->get('main_pagetitle_autoappend'));
// Check if subscribed
$isTeamSubscribed = $model->isTeamSubscribedEmail($team->id, $this->my->email);
// Get the current url
$return = $team->getPermalink();
$this->set('return', $return);
$this->set('team', $team);
$this->set('members', $members);
$this->set('pagination', $pagination->getPagesLinks());
$this->set('posts', $posts);
$this->set('isTeamSubscribed', $isTeamSubscribed);
parent::display('teamblogs/item');
}
示例3: formatBlog
public static function formatBlog($data, $loadComments = false, $removeFeaturedImage = true, $loadVideo = true, $frontpage = false, $loadGallery = true)
{
// Ensures that we only proceed to format items if there's real data.
if (!$data) {
return $data;
}
$app = JFactory::getApplication();
$params = $app->getParams('com_easyblog');
$model = EB::model('Blog');
$config = EB::config();
// Get the tags relation model
$modelPT = EB::model('PostTag');
// Initialize a default array set
$result = array();
// Some benchmark says that counting it here would be faster
$total = count($data);
for ($i = 0; $i < $total; $i++) {
$row = $data[$i];
$blog = EB::table('Blog');
$blog->bind($row);
// Since the $blog object does not contain 'team_id', we need to set this here.
if ($raw->source_type == EASYBLOG_POST_SOURCE_TEAM) {
$blog->team_id = $row->source_id;
}
// Since the $blog object does not contain 'category', we need to set this here.
$blog->category = $row->category;
$blog->featuredImage = isset($row->featuredImage) ? $row->featuredImage : '';
// Load the author's profile
$author = EB::user($blog->created_by);
// @Assign dynamic properties that must exist everytime formatBlog is called
// We can't rely on ->author because CB plugins would mess things up.
$blog->author = $author;
$blog->blogger = $author;
$blog->isFeatured = EB::isFeatured('post', $blog->id);
$blog->category = empty($blog->category) ? JText::_('COM_EASYBLOG_UNCATEGORIZED') : JText::_($blog->category);
// @task: Detect password protections.
$requireVerification = false;
$tmpTitle = $blog->title;
if ($config->get('main_password_protect', true) && !empty($blog->blogpassword)) {
$blog->title = JText::sprintf('COM_EASYBLOG_PASSWORD_PROTECTED_BLOG_TITLE', $blog->title);
$requireVerification = true;
}
// @rule: If user already authenticated with the correct password, we will hide the password
if ($requireVerification && EB::verifyBlogPassword($blog->blogpassword, $blog->id)) {
$blog->title = $tmpTitle;
$blog->blogpassword = '';
}
// @rule: Initialize all variables
$blog->videos = array();
$blog->galleries = array();
$blog->albums = array();
$blog->audios = array();
// @rule: Before anything get's processed we need to format all the microblog posts first.
if (!empty($blog->posttype)) {
self::formatMicroblog($blog);
}
// @rule: Detect if the content requires a read more link.
$blog->readmore = EasyBlogHelper::requireReadmore($blog);
// @rule: Remove any adsense codes from the content.
$blog->intro = EB::adsense()->strip($blog->intro);
$blog->content = EB::adsense()->strip($blog->content);
// Truncate content
EB::truncateContent($blog, $loadVideo, $frontpage, $loadGallery);
// Assign tags to the custom properties.
$blog->tags = $modelPT->getBlogTags($blog->id);
// Facebook Like integrations
$facebookLike = EB::facebook()->getLikeHTML($blog);
$blog->facebookLike = $facebookLike;
$result[] = $blog;
}
return $result;
}
示例4: postSave
/**
* Post processing when a blog post is saved
*
* @since 5.0
* @access public
* @param string
* @return
*/
public function postSave()
{
// do not do anything if the post is a blank post.
if ($this->isBlank()) {
return;
}
// Whenever the blog post is stored, we need to clear the cache.
$this->clearCache();
// Triggers plugins after the post is stored
$this->triggerAfterSave();
// When this post is being submitted for approval we want to notify site administrator's
if ($this->isBeingSubmittedForApproval()) {
$this->notify(true, false);
}
// Add activity stream for Jomsocial, regardless if it is being published or not, we should let the client check this.
if (!$this->isDraft() && !$this->isPending() && !$this->isScheduled()) {
EB::jomsocial()->insertActivity($this);
}
// When this post is saved and published we need to perform the auto posting for the system
if ($this->isPublished()) {
EB::autoposting()->shareSystem($this);
}
// When this post is saved, we might need to perform the auto posting
if ($this->autoposting && $this->isPublished()) {
EB::autoposting()->shareUser($this, $this->autoposting);
}
// When this post is being published, we should add post actions here.
if ($this->isBeingPublished()) {
// Send notifications to subscribers
if (!$this->isPasswordProtected() && !$this->saveOptions['skipNotifications']) {
$this->notify();
}
// EasySocial Integrations
// If $this->isBeingPublished, it will be always a new post.
if (!isset($this->saveOptions['saveFromEasysocialStory'])) {
EB::easysocial()->createBlogStream($this, true);
}
EB::easysocial()->updateBlogPrivacy($this->post);
EB::easysocial()->assignPoints('blog.create', $this->created_by);
EB::easysocial()->notifySubscribers($this, 'new.post');
EB::easysocial()->addIndexerNewBlog($this);
EB::easysocial()->assignBadge('blog.create', JText::_('COM_EASYBLOG_EASYSOCIAL_BADGE_CREATE_BLOG_POST'));
// EasyDiscuss Integrations
EB::easydiscuss()->log('easyblog.new.blog', $this->created_by, JText::sprintf('COM_EASYBLOG_EASYDISCUSS_HISTORY_NEW_BLOG', $this->title));
EB::easydiscuss()->addPoint('easyblog.new.blog', $this->created_by);
EB::easydiscuss()->addBadge('easyblog.new.blog', $this->created_by);
EB::easydiscuss()->insertNotification('new.blog', $this);
// Alpha User Points
EB::aup()->assignPoints('plgaup_easyblog_add_blog', $this->created_by, JText::sprintf('COM_EASYBLOG_AUP_NEW_BLOG_CREATED', $this->getPermalink(), $this->title));
// Points should only be rewarded when the post is being published
EB::jomsocial()->assignPoints('com_easyblog.blog.add', $this->created_by);
// Ping to Pingomatic args: $post, $debug.
EB::pingomatic()->ping($this, false);
// Automatically feature the blog post if required
$isFeaturedAuthor = EB::isFeatured('blogger', $this->created_by);
$isFeaturedPost = EB::isFeatured('post', $this->id);
if ($this->config->get('main_autofeatured', 0) && $isFeaturedAuthor && !$isFeaturedPost) {
$this->setFeatured('post', $this->id);
}
} else {
if ($this->isPublished()) {
// This action is an edit post
EB::easysocial()->createBlogStream($this, false);
}
}
// When the post is approved, we want to notify the author
if ($this->isBeingApproved()) {
// We do not need to notify the world that the post is published because it's already handled above under
$this->notify(false, '1', false, true);
}
// When this post is being unpublished, we should add triggers here.
if ($this->isBeingUnpublished()) {
// If the post is being unpublished, remove them from the stream
EB::jomsocial()->removePostStream($this);
}
// When this post is rejected by the moderator, we should add triggers here
if ($this->isBeingRejected()) {
// When a post is rejected, add the necessary data on the reject table so we can determine why it's being rejected
$reject = EB::table('PostReject');
$reject->post_id = $this->id;
$reject->created_by = $this->created_by;
$reject->created = EB::date()->toSql();
// @TODO: How should we get the reject message from the composer?
$reject->message = $this->input->get('message', '', 'default');
$reject->store();
// Send notify
$reject->notify();
}
}
示例5: store
//.........这里部分代码省略.........
$filterAttributes = EasyBlogHelper::getHelper('Acl')->getFilterAttributes();
// @rule: Apply filtering on contents
jimport('joomla.filter.filterinput');
$inputFilter = JFilterInput::getInstance($filterTags, $filterAttributes, 1, 1, 0);
$inputFilter->tagBlacklist = $filterTags;
$inputFilter->attrBlacklist = $filterAttributes;
$filterTpe = EasyBlogHelper::getJoomlaVersion() >= '1.6' ? 'html' : 'string';
if (count($filterTags) > 0 && !empty($filterTags[0]) || count($filterAttributes) > 0 && !empty($filterAttributes[0])) {
$this->intro = $inputFilter->clean($this->intro, $filterTpe);
$this->content = $inputFilter->clean($this->content, $filterTpe);
}
// @rule: Process badword filters for content here.
$blockedWord = EasyBlogHelper::getHelper('String')->hasBlockedWords($this->intro . $this->content);
if ($blockedWord !== false) {
$this->setError(JText::sprintf('COM_EASYBLOG_BLOG_POST_CONTAIN_BLOCKED_WORDS', $blockedWord));
return false;
}
// @rule: Test for the empty-ness
if (empty($this->intro) && empty($this->content)) {
$this->setError(JText::_('COM_EASYBLOG_DASHBOARD_SAVE_CONTENT_ERROR'));
}
$state = parent::store();
$source = JRequest::getVar('blog_contribute_source', 'easyblog');
// if this is blog edit, then we should see the column isnew to determine
// whether the post is really new or not.
if (!$isNew) {
$isNew = $this->isnew;
}
// this one is needed for the trigger to work properly.
$this->isnew = $isNew;
// @trigger: onAfterSave
$this->triggerAfterSave();
// @task: If auto featured is enabled, we need to feature the blog post automatically since the blogger is featured.
if ($config->get('main_autofeatured', 0) && EB::isFeatured('blogger', $this->created_by) && !EB::isFeatured('post', $this->id)) {
// just call the model file will do as we do not want to create stream on featured action at this migration.
$modelF = EB::model('Featured');
$modelF->makeFeatured('post', $this->id);
}
// @task: This is when the blog is either created or updated.
if ($source == 'easyblog' && $state && $this->published == EASYBLOG_POST_PUBLISHED && $log) {
$category = EB::table('Category');
$category->load($this->category_id);
$easysocial = EasyBlogHelper::getHelper('EasySocial');
if ($category->private == 0) {
// @rule: Add new stream item in jomsocial
EB::jomsocial()->addBlogActivity($this, $isNew);
}
// @rule: Add stream for easysocial
if ($config->get('integrations_easysocial_stream_newpost') && $easysocial->exists() && $isNew) {
$easysocial->createBlogStream($this, $isNew);
}
// update privacy in easysocial.
if ($config->get('integrations_easysocial_privacy') && $easysocial->exists()) {
$easysocial->updateBlogPrivacy($this);
}
}
if ($source == 'easyblog' && $state && $this->published == EASYBLOG_POST_PUBLISHED && $isNew && $log) {
// @rule: Send email notifications out to subscribers.
$author = EB::user($this->created_by);
// Ping pingomatic
EB::pingomatic()->ping($this);
// Assign EasySocial points
$easysocial = EasyBlogHelper::getHelper('EasySocial');
if ($easysocial->exists()) {
$easysocial->assignPoints('blog.create', $this->created_by);
}
示例6: isFeatured
/**
* Determines if the team is featured
*
* @since 4.0
* @access public
* @param string
* @return
*/
public function isFeatured()
{
$featured = EB::isFeatured('teamblog', $this->id);
return $featured;
}