/** * * $filtering * if index page: * category_id * filter * sort * query */ public function toHTML($viewpage = 'index', $doReplace = false) { $data = $this->getData(); if (count($data->pages) == $this->get('pages.total') && $this->get('pages.total') == '1' || $this->get('pages.total') == 0) { return false; } $queries = ''; if (!empty($data) && $doReplace) { $curPageLink = 'index.php?option=com_easyblog&view=' . $viewpage . $queries; foreach ($data->pages as $page) { if (!empty($page->link)) { $limitstart = !empty($page->base) ? '&limitstart=' . $page->base : ''; $page->link = EasyBlogRouter::_($curPageLink . $limitstart); } } // newer link if (!empty($data->next->link)) { $limitstart = !empty($data->next->base) ? '&limitstart=' . $data->next->base : ''; $data->next->link = EasyBlogRouter::_($curPageLink . $limitstart); } // older link if (!empty($data->previous->link)) { $limitstart = !empty($data->previous->base) ? '&limitstart=' . $data->previous->base : ''; $data->previous->link = EasyBlogRouter::_($curPageLink . $limitstart); } } $theme = new CodeThemes(); $theme->set('data', $data); return $theme->fetch('blog.pagination.php'); }
public function load($cid) { static $instances = array(); if (!isset($instances[$cid])) { $this->_item = EasyBlogHelper::getTable('Blog', 'Table'); if (!$this->_item->load($cid)) { return $this->onLoadArticleError($cid); } $blogger = EasyBlogHelper::getTable('Profile', 'Table'); $blogger->load($this->_item->created_by); $this->_item->blogger = $blogger; $link = 'index.php?option=com_easyblog&view=entry&id=' . $this->getContentId(); // forcefully get item id if request is ajax $format = JRequest::getString('format', 'html'); if ($format === 'ajax') { $itemid = JRequest::getInt('pageItemId'); if (!empty($itemid)) { $link .= '&Itemid=' . $itemid; } } $link = EasyBlogRouter::_($link); $this->_item->permalink = $this->prepareLink($link); $instances[$cid] = $this->_item; } $this->_item = $instances[$cid]; return $this; }
function links($rows, $team) { ?> <ul class="eblog_entry_links_list"> <?php for ($i = 1; $i < count($rows); $i++) { ?> <?php $item = $rows[$i]; ?> <li> <a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $item->id); ?> "> <?php echo JString::strlen($item->title) > 30 ? JString::substr(strip_tags($item->title), 0, 30) . '...' : strip_tags($item->title); ?> </a> <span><?php echo JString::strlen($item->content) > 100 ? JString::substr(strip_tags($item->content), 0, 100) . '...' : strip_tags($item->content); ?> </span> </li> <?php } //end for ?> </ul> <?php }
function display($tmpl = null) { $config = EasyBlogHelper::getConfig(); $jConfig = EasyBlogHelper::getJConfig(); if (!$config->get('main_rss')) { return; } $model = $this->getModel('Featured'); $data = $model->getFeaturedBlog(); $document = JFactory::getDocument(); $document->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=featured'); $document->setTitle(JText::_('COM_EASYBLOG_FEEDS_FEATURED_TITLE')); $document->setDescription(JText::sprintf('COM_EASYBLOG_FEEDS_FEATURED_DESC', JURI::root())); if (!empty($data)) { for ($i = 0; $i < count($data); $i++) { $row =& $data[$i]; $profile = EasyBlogHelper::getTable('Profile', 'Table'); $profile->load($row->created_by); $created = EasyBlogDateHelper::dateWithOffSet($row->created); $formatDate = true; if (EasyBlogHelper::getJoomlaVersion() >= '1.6') { $langCode = EasyBlogStringHelper::getLangCode(); if ($langCode != 'en-GB' || $langCode != 'en-US') { $formatDate = false; } } // $row->created = ( $formatDate ) ? $created->toFormat( $config->get('layout_dateformat', '%A, %d %B %Y') ) : $created->toFormat(); $row->created = $created->toMySQL(); if ($config->get('main_rss_content') == 'introtext') { $row->text = !empty($row->intro) ? $row->intro : $row->content; //read more for feed $row->text .= '<br /><a href=' . EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $row->id) . '>Read more</a>'; } else { $row->text = $row->intro . $row->content; } $row->text = EasyBlogHelper::getHelper('Videos')->strip($row->text); $row->text = EasyBlogGoogleAdsense::stripAdsenseCode($row->text); $category = EasyBlogHelper::getTable('Category', 'Table'); $category->load($row->category_id); // Assign to feed item $title = $this->escape($row->title); $title = html_entity_decode($title); // load individual item creator class $item = new JFeedItem(); $item->title = $title; $item->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $row->id); $item->description = $row->text; $item->date = $row->created; $item->category = $category->title; $item->author = $profile->getName(); if ($jConfig->get('feed_email') == 'author') { $item->authorEmail = $profile->user->email; } else { $item->authorEmail = $jConfig->get('mailfrom'); } $document->addItem($item); } } }
public function mapPost($row, $strip_tags = '', $text_length = 0, $skip = array()) { $config = EasyBlogHelper::getConfig(); $blog = EasyBlogHelper::getTable('Blog'); $blog->load($row->id); $profile = EasyBlogHelper::getTable('Profile', 'Table'); $profile->load($row->created_by); $created = EasyBlogDateHelper::dateWithOffSet($row->created); $formatDate = true; if (EasyBlogHelper::getJoomlaVersion() >= '1.6') { $langCode = EasyBlogStringHelper::getLangCode(); if ($langCode != 'en-GB' || $langCode != 'en-US') { $formatDate = false; } } $blog->created = $created->toMySQL(); $blog->text = $row->intro . $row->content; $config->set('max_video_width', 320); $config->set('max_video_width', 180); $blog->text = EasyBlogHelper::getHelper('Videos')->processVideos($blog->text); $blog->text = EasyBlogGoogleAdsense::stripAdsenseCode($blog->text); $category = EasyBlogHelper::getTable('Category', 'Table'); $category->load($row->category_id); $item = new PostSimpleSchema(); $item->textplain = $blog->text; // @TODO : Take care of a case when strip tags and length are used together if ($strip_tags) { $item->textplain = strip_tags($blog->text, $strip_tags); } if ($text_length > 0) { $pos = JString::strpos(strip_tags($item->textplain), ' ', $text_length); $item->textplain = JString::substr(strip_tags($blog->text), 0, $pos); } $image_data = json_decode($blog->image); $item->postid = $blog->id; $item->title = $blog->title; $item->text = $blog->text; $item->textplain = $this->sanitize($item->textplain); $item->image = $blog->getImage(); $item->image->url = $image_data->url; $item->created_date = $blog->created; $item->created_date_elapsed = EasyBlogDateHelper::getLapsedTime($blog->created); $item->author->name = $profile->nickname; $item->author->photo = JURI::root() . $profile->avatar; $item->category->categoryid = $category->id; $item->category->title = $category->title; $item->url = JURI::root() . trim(EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $blog->id), '/'); // Tags $modelPT = EasyBlogHelper::getModel('PostTag'); $item->tags = $modelPT->getBlogTags($blog->id); foreach ($skip as $v) { unset($item->{$v}); } return $item; }
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'); }
function request() { $mainframe = JFactory::getApplication(); if (!EasyBlogHelper::isLoggedIn()) { $mainframe->enqueueMessage(JText::_('COM_EASYBLOG_YOU_MUST_LOGIN_FIRST'), 'error'); $this->setRedirect(EasyBlogRouter::_('index.php?option=com_easyblog', false)); return; } $redirect = JRequest::getVar('redirect', ''); $type = JRequest::getCmd('type'); if (!empty($redirect)) { $redirect = '&redirect=' . $redirect; } $userId = JRequest::getVar('id'); // Flickr integration does not require user id. if (empty($userId)) { $mainframe->enqueueMessage(JText::_('Error, User not found.'), 'error'); $redirect = JRoute::_('index.php?option=com_easyblog&view=users', false); $this->setRedirect($redirect); return; } $call = JRequest::getWord('call'); $callUri = !empty($call) ? '&call=' . $call . '&id=' . $userId : '&id=' . $userId; $config = EasyBlogHelper::getConfig(); $key = $config->get('integrations_' . $type . '_api_key'); $secret = $config->get('integrations_' . $type . '_secret_key'); $callback = rtrim(JURI::root(), '/') . '/administrator/index.php?option=com_easyblog&c=oauth&task=grant&type=' . $type . $redirect . $callUri; $consumer = EasyBlogOauthHelper::getConsumer($type, $key, $secret, $callback); $request = $consumer->getRequestToken(); if (empty($request->token) || empty($request->secret)) { $mainframe->enqueueMessage(JText::_('COM_EASYBLOG_OAUTH_KEY_INVALID'), 'error'); $redirect = JRoute::_('index.php?option=com_easyblog&view=users', false); $this->setRedirect($redirect); return; } $oauth = EasyBlogHelper::getTable('Oauth', 'Table'); $oauth->user_id = $userId; $oauth->type = $type; $oauth->created = EasyBlogHelper::getDate()->toMySQL(); // Bind the request tokens $param = EasyBlogHelper::getRegistry(''); $param->set('token', $request->token); $param->set('secret', $request->secret); $oauth->request_token = $param->toString(); $oauth->store(); $this->setRedirect($consumer->getAuthorizationURL($request->token, false, 'popup')); }
function getFeedURL($url, $atom = false, $type = 'site') { $config = EasyBlogHelper::getConfig(); $enabled = $config->get('main_feedburner'); if ($enabled && $type == 'site' && $config->get('main_feedburner_url') != '') { $url = $config->get('main_feedburner_url'); if (!empty($url)) { return EasyBlogHelper::getHelper('String')->escape($url); } } require_once EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'router.php'; $sef = EasyBlogRouter::isSefEnabled(); $join = $sef ? '?' : '&'; $url = EasyBlogRouter::_($url) . $join . 'format=feed'; $url .= $atom ? '&type=atom' : '&type=rss'; return $url; }
function getObjectInfo($id, $language = null) { $info = new JCommentsObjectInfo(); $routerHelper = JPATH_ROOT . '/components/com_easyblog/helpers/router.php'; if (is_file($routerHelper)) { require_once $routerHelper; $db = JCommentsFactory::getDBO(); $db->setQuery('SELECT id, title, created_by FROM #__easyblog_post WHERE id = ' . $id); $row = $db->loadObject(); if (!empty($row)) { $info->title = $row->title; $info->userid = $row->created_by; $info->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $id); } } return $info; }
/** * Process report items. * * @access public * @param null **/ public function submitReport() { JRequest::checkToken() or die('Invalid Token'); $my = JFactory::getUser(); $config = EasyBlogHelper::getConfig(); if (!$my->id && !$config->get('main_reporting_guests')) { echo JText::_('COM_EASYBLOG_CATEGORIES_FOR_REGISTERED_USERS_ONLY'); exit; } $objId = JRequest::getInt('obj_id'); $objType = JRequest::getCmd('obj_type'); $reason = JRequest::getString('reason'); // @task: Ensure that the reason is never empty. if (empty($reason)) { EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_REPORT_PLEASE_SPECIFY_REASON'), 'error'); $this->setRedirect(EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $objId, false)); return; } $report = EasyBlogHelper::getTable('Report'); $report->set('obj_id', $objId); $report->set('obj_type', $objType); $report->set('reason', $reason); $report->set('created', EasyBlogHelper::getDate()->toMySQL()); $report->set('created_by', $my->id); $report->set('ip', @$_SERVER['REMOTE_ADDR']); if (!$report->store()) { $error = $report->getError(); EasyBlogHelper::setMessageQueue($error, 'error'); $this->setRedirect(EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $objId, false)); return; } // @TODO: Configurable report links switch ($objType) { case EBLOG_REPORTING_POST: default: $blog = EasyBlogHelper::getTable('Blog'); $blog->load($objId); $report->notify($blog); $message = JText::_('COM_EASYBLOG_THANKS_FOR_REPORTING'); $redirect = EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $objId, false); break; } EasyBlogHelper::setMessageQueue($message); $this->setRedirect($redirect); }
function display($tmpl = null) { $mainframe = JFactory::getApplication(); $my = JFactory::getuser(); if (empty($my->id)) { $return = JRequest::getVar('return', ''); EasyBlogHelper::showLogin($return); return; } else { $showPermissionMsg = JRequest::getVar('showpermissionmsg', ''); if ($showPermissionMsg) { EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_YOU_DO_NOT_HAVE_PERMISSION_TO_VIEW'), 'error'); } else { EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_YOU_ARE_ALREADY_LOGIN'), 'error'); $mainframe->redirect(EasyBlogRouter::_('index.php?option=com_easyblog&view=latest')); } } }
function unsubscribe() { $my = JFactory::getUser(); $redirectLInk = 'index.php?option=com_easyblog&view=subscription'; if ($my->id == 0) { $redirectLInk = 'index.php?option=com_easyblog&view=latest'; } //type=site - subscription type //sid=1 - subscription id //uid=42 - user id //token=0fd690b25dd9e4d2dc47a252d025dff4 - md5 subid.subdate $data = base64_decode(JRequest::getVar('data', '')); $param = EasyBlogHelper::getRegistry($data); $param->type = $param->get('type', ''); $param->sid = $param->get('sid', ''); $param->uid = $param->get('uid', ''); $param->token = $param->get('token', ''); $subtable = EasyBlogHelper::getTable($param->type, 'Table'); $subtable->load($param->sid); $token = md5($subtable->id . $subtable->created); $paramToken = md5($param->sid . $subtable->created); if ($subtable->id != 0) { if ($token != $paramToken) { EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_SUBSCRIPTION_UNSUBSCRIBE_FAILED'), 'error'); $this->setRedirect(EasyBlogRouter::_($redirectLInk, false)); return false; } if (!$subtable->delete($param->sid)) { EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_SUBSCRIPTION_UNSUBSCRIBE_FAILED_ERROR_DELETING_RECORDS'), 'error'); $this->setRedirect(EasyBlogRouter::_($redirectLInk, false)); return false; } } EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_SUBSCRIPTION_UNSUBSCRIBE_SUCCESS')); $this->setRedirect(EasyBlogRouter::_($redirectLInk, false)); return true; }
<div class="blog-password-input ptm"> <input type="password" name="blogpassword_<?php echo $row->id; ?> " id="blogpassword_<?php echo $row->id; ?> " value=""> <input type="submit" value="<?php echo JText::_('COM_EASYBLOG_PASSWORD_PROTECTED_BLOG_READ'); ?> "> <input type="hidden" name="option" value="com_easyblog"> <input type="hidden" name="controller" value="entry"> <input type="hidden" name="task" value="setProtectedCredentials"> <input type="hidden" name="id" value="<?php echo $row->id; ?> "> <input type="hidden" name="return" value="<?php echo base64_encode(EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $row->id, false)); ?> "> </div> </form> </div> </div> </div> </div> </div>
public static function getList($params) { $app = JFactory::getApplication(); $lang = JFactory::getLanguage(); $user = JFactory::getUser(); $db = JFactory::getDbo(); $query = $db->getQuery(true); // Source $source = $params->get('source', 'categories'); $exclude = $params->get('exclude', array()); $articles_k2 = $params->get('articles_k2', array()); $categories_k2 = $params->get('categories_k2', array()); // General $readmore = $params->get('readmore', ''); $ordering = $params->get('ordering', 'random'); $item_counts = $params->get('item_counts', 5); $skip_counts = $params->get('skip_counts', 0); $limit_intro = $params->get('limit_intro', 200); // Display $show_date = $params->get('show_date', 1); $show_hits = $params->get('show_hits', 1); $show_tags = $params->get('show_tags', 1); $show_image = $params->get('show_image', 1); $show_intro = $params->get('show_intro', 1); $show_title = $params->get('show_title', 1); $show_author = $params->get('show_author', 1); $show_avatar = $params->get('show_avatar', 1); $show_rating = $params->get('show_rating', 1); $show_profile = $params->get('show_profile', 1); $show_category = $params->get('show_category', 1); $show_comments = $params->get('show_comments', 1); // Date $date_type = $params->get('date_type', 'created'); $date_format = $params->get('date_format', 'd F Y'); // Image $image_width = $params->get('image_width', 200); $image_height = $params->get('image_height', 100); $image_quality = $params->get('image_quality', 100); $image_link = $params->get('image_link', 'none'); $image_title = $params->get('image_title', 1); $image_resize = $params->get('image_resize', 1); $image_source = $params->get('image_source', 'auto'); // 3rd-party $avatar_width = $params->get('avatar_width', 60); $avatar_height = $params->get('avatar_height', 60); $avatar_system = $params->get('avatar_system', 'kunena'); $profile_system = $params->get('profile_system', 'kunena'); $comments_system = $params->get('comments_system', 'komento'); // User access $authorised = implode(',', $user->getAuthorisedViewLevels()); // Clean HTML tags $clean_intro = $params->get('clean_intro', 1); $allowed_tags = str_replace(' ', '', $params->get('allowed_tags')); $allowed_tags = "<" . str_replace(',', '><', $allowed_tags) . ">"; // Content filtering $tags_k2 = $params->get('tags_k2', array()); $author = $params->get('author', array()); $featured = $params->get('featured', 0); // Featured label/ribbon $featured_label = $params->get('featured_label', 0); $featured_label_text = $params->get('featured_label_text', 'Featured'); $featured_label_color = $params->get('featured_label_color', '#e52626'); // Link $title_link = $params->get('title_link', 1); $category_link = $params->get('category_link', 1); if (JFile::exists(JPATH_SITE . '/components/com_k2/k2.php')) { if ($source == 'categories' && $categories_k2) { if ($categories_k2[0] != '') { $categories_k2 = count($categories_k2) == 1 ? ' = ' . $categories_k2[0] . '' : 'IN (' . implode(',', $categories_k2) . ')'; $query->where('a.catid ' . $categories_k2); } $exclude ? $query->where('a.id NOT IN (' . $exclude . ')') : ''; } else { if ($source == 'articles' && $articles_k2) { $query->where('a.id IN (' . implode(',', $articles_k2) . ')'); } else { echo JText::_('MOD_GIANTCONTENT_ERROR_SOURCE'); return; } } } else { echo JText::_('MOD_GIANTCONTENT_ERROR_TYPE_K2'); return; } // Ordering switch ($ordering) { case 'random': $orderBy = 'RAND()'; break; case 'id_asc': $orderBy = 'a.id ASC'; break; case 'id_desc': $orderBy = 'a.id DESC'; break; case 'title_asc': $orderBy = 'a.title ASC'; break; case 'title_desc': $orderBy = 'a.title DESC'; break; case 'popular_last': $orderBy = 'a.hits ASC'; break; case 'popular_first': $orderBy = 'a.hits DESC'; break; case 'created_oldest': $orderBy = 'date ASC'; break; case 'created_newest': $orderBy = 'date DESC'; break; case 'most_rated': $orderBy = 'rating_total DESC, r.rating_count DESC'; break; case 'least_rated': $orderBy = 'rating_total ASC, r.rating_count ASC'; break; case 'most_commented': $orderBy = 'comments_count DESC, comments_date DESC'; break; case 'latest_commented': $orderBy = 'comments_date DESC, date DESC'; break; } // Content $query->select('a.id, a.title, a.alias, a.introtext, a.fulltext, a.hits'); $query->from('#__k2_items AS a'); // Category $query->select('a.catid AS category_id, c.name AS category_name, c.alias AS category_alias'); $query->join('LEFT', '#__k2_categories AS c ON c.id = a.catid'); // Join user $query->select('u.id AS user_id, u.email AS user_email, u.name AS user_name, a.created_by_alias AS user_alias'); $query->join('LEFT', '#__users AS u ON u.id = a.created_by'); // Join rating $query->select('ROUND(AVG(r.rating_sum / r.rating_count), 2) AS rating_average, r.rating_count'); $query->join('LEFT', '#__k2_rating AS r ON r.itemID = a.id'); // Select date if ($date_type !== 'created') { $query->select('CASE WHEN a.' . $date_type . ' = "0000-00-00 00:00:00" THEN a.created ELSE a.' . $date_type . ' END AS date'); } else { $query->select('a.created AS date'); } // Join avatar for author if ($show_avatar) { switch ($avatar_system) { // K2 avatar integration - http://getk2.org case 'k2': if (JFile::exists(JPATH_SITE . '/components/com_k2/k2.php')) { $query->select('ua.image AS avatar_user'); $query->join('LEFT', '#__k2_users AS ua ON ua.userID = u.id'); $avatar_path = 'media/k2/users/'; } else { echo JText::_('MOD_GIANTCONTENT_ERROR_AVATAR_SYSTEM_K2'); return; } break; // Kunena avatar integration - http://kunena.org // Kunena avatar integration - http://kunena.org case 'kunena': if (JFile::exists(JPATH_SITE . '/components/com_kunena/kunena.php')) { $query->select('ua.avatar AS avatar_user'); $query->join('LEFT', '#__kunena_users AS ua ON ua.userid = u.id'); $avatar_path = 'media/kunena/avatars/'; } else { echo JText::_('MOD_GIANTCONTENT_ERROR_AVATAR_SYSTEM_KUNENA'); return; } break; // JomSocial avatar integration - http://jomsocial.com // JomSocial avatar integration - http://jomsocial.com case 'jomsocial': if (JFile::exists(JPATH_SITE . '/components/com_community/community.php')) { $query->select("ua.avatar AS avatar_user"); $query->join('LEFT', '#__community_users AS ua ON ua.userid = u.id'); $avatar_path = ''; } else { echo JText::_('MOD_GIANTCONTENT_ERROR_AVATAR_SYSTEM_JOMSOCIAL'); return; } break; // Comprofiler avatar integration - http://joomlapolis.com // Comprofiler avatar integration - http://joomlapolis.com case 'comprofiler': if (JFile::exists(JPATH_SITE . '/components/com_comprofiler/comprofiler.php')) { $query->select('ua.avatar AS avatar_user'); $query->join('LEFT', '#__comprofiler AS ua ON ua.user_id = u.id'); $avatar_path = 'images/comprofiler/'; } else { echo JText::_('MOD_GIANTCONTENT_ERROR_AVATAR_SYSTEM_COMPROFILER'); return; } break; // EasyBlog avatar integration - http://stackideas.com // EasyBlog avatar integration - http://stackideas.com case 'easyblog': if (JFile::exists(JPATH_SITE . '/components/com_easyblog/easyblog.php')) { $query->select("ua.avatar AS avatar_user"); $query->join('LEFT', '#__easyblog_users AS ua ON ua.id = u.id'); $avatar_path = 'images/easyblog_avatar/'; } else { echo JText::_('MOD_GIANTCONTENT_ERROR_AVATAR_SYSTEM_EASYBLOG'); return; } break; // EasySocial avatar integration - http://stackideas.com // EasySocial avatar integration - http://stackideas.com case 'easysocial': if (JFile::exists(JPATH_SITE . '/components/com_easysocial/easysocial.php')) { $query->select("ua.large AS avatar_user"); $query->join('LEFT', '#__social_avatars AS ua ON ua.uid = u.id'); $avatar_path = 'media/com_easysocial/avatars/users/'; } else { echo JText::_('MOD_GIANTCONTENT_ERROR_AVATAR_SYSTEM_EASYSOCIAL'); return; } break; // EasyDiscuss avatar integration - http://stackideas.com // EasyDiscuss avatar integration - http://stackideas.com case 'easydiscuss': if (JFile::exists(JPATH_SITE . '/components/com_easydiscuss/easydiscuss.php')) { $query->select("ua.avatar AS avatar_user"); $query->join('LEFT', '#__discuss_users AS ua ON ua.id = u.id'); $avatar_path = 'images/discuss_avatar/'; } else { echo JText::_('MOD_GIANTCONTENT_ERROR_AVATAR_SYSTEM_EASYDISCUSS'); return; } break; } } // Join comments for content if ($show_comments || $ordering == 'most_commented' || $ordering == 'latest_commented') { switch ($comments_system) { // Default comment system case 'default': $query->select('COUNT(cm.id) AS comments_count, MAX(cm.commentDate) AS comments_date'); $query->join('LEFT', '#__k2_comments AS cm ON cm.itemID = a.id AND cm.published = 1'); $comments_link = '#itemCommentsAnchor'; break; // Komento comment integration - http://stackideas.com // Komento comment integration - http://stackideas.com case 'komento': if (JFile::exists(JPATH_SITE . '/components/com_komento/komento.php')) { $query->select('COUNT(cm.id) AS comments_count, MAX(cm.created) AS comments_date'); $query->join('LEFT', '#__komento_comments AS cm ON cm.cid = a.id AND cm.component = "com_k2" AND cm.published = 1'); $comments_link = '#section-kmt'; } else { echo JText::_('MOD_GIANTCONTENT_ERROR_COMMENTS_SYSTEM_KOMENTO'); return; } break; // CComment comment integration - http://compojoom.com // CComment comment integration - http://compojoom.com case 'ccomment': if (JFile::exists(JPATH_SITE . '/components/com_comment/comment.php')) { $query->select('COUNT(cm.id) AS comments_count, MAX(cm.date) AS comments_date'); $query->join('LEFT', '#__comment AS cm ON cm.contentid = a.id AND cm.component = "com_k2" AND cm.published = 1'); $comments_link = '#!/ccomment'; } else { echo JText::_('MOD_GIANTCONTENT_ERROR_COMMENTS_SYSTEM_CCOMMENT'); return; } break; // JComments comment integration - http://joomlatune.com // JComments comment integration - http://joomlatune.com case 'jcomments': if (JFile::exists(JPATH_SITE . '/components/com_jcomments/jcomments.php')) { $query->select('COUNT(cm.id) AS comments_count, MAX(cm.date) AS comments_date'); $query->join('LEFT', '#__jcomments AS cm ON cm.object_id = a.id AND cm.object_group = "com_k2" AND cm.published = 1'); $comments_link = '#comments'; } else { echo JText::_('MOD_GIANTCONTENT_ERROR_COMMENTS_SYSTEM_JCOMMENTS'); return; } break; // JA Comment comment integration - http://joomlart.com // JA Comment comment integration - http://joomlart.com case 'jacomment': if (JFile::exists(JPATH_SITE . '/components/com_jacomment/jacomment.php')) { $query->select('COUNT(cm.id) AS comments_count, MAX(cm.date) AS comments_date'); $query->join('LEFT', '#__jacomment_items AS cm ON cm.contentid = a.id AND cm.option = "com_k2" AND cm.published = 1'); $comments_link = '#jac-wrapper'; } else { echo JText::_('MOD_GIANTCONTENT_ERROR_COMMENTS_SYSTEM_JACOMMENT'); return; } break; } } // Filter tags if ($tags_k2) { $query->join('INNER', '#__k2_tags_xref AS t ON t.itemID = a.id'); $query->where('t.tagID IN (' . implode(',', $tags_k2) . ')'); } // Filter author if ($author) { $query->where('a.created_by IN (' . implode(',', $author) . ')'); } // Filter featured if ($featured) { $query->where('a.featured = 1'); } // Access or published $query->where('a.trash = 0 AND c.trash = 0 AND a.published = 1 AND c.published = 1 AND a.access IN (' . $authorised . ') AND c.access IN (' . $authorised . ') AND a.publish_up <= "' . JFactory::getDate() . '"'); $query->group('a.id'); $query->order($orderBy); $db->setQuery($query, $skip_counts, $item_counts); $items = $db->loadObjectList(); $lists = array(); foreach ($items as $i => &$item) { $lists[$i] = new stdClass(); $lists[$i]->id = $item->id; $lists[$i]->date = ''; $lists[$i]->hits = ''; $lists[$i]->link = ''; $lists[$i]->tags = ''; $lists[$i]->intro = ''; $lists[$i]->image = ''; $lists[$i]->title = ''; $lists[$i]->author = ''; $lists[$i]->avatar = ''; $lists[$i]->rating = ''; $lists[$i]->featured = ''; $lists[$i]->category = ''; $lists[$i]->comments = ''; $lists[$i]->readmore = ''; $lists[$i]->fulltext = $item->fulltext; $lists[$i]->introtext = $item->introtext; $lists[$i]->category_id = $item->category_id; $lists[$i]->category_alias = $item->category_alias; // Content link $lists[$i]->link = JRoute::_(K2HelperRoute::getItemRoute($item->id . ':' . $item->alias, $item->category_id)); // Readmore link $lists[$i]->readmore = $readmore ? '<a href="' . $lists[$i]->link . '"><span>' . $readmore . '</span></a>' : ''; // Show content date $lists[$i]->date = $show_date ? JHtml::_('date', $item->date, $date_format) : ''; // Show content hits $lists[$i]->hits = $show_hits ? '<span>' . $item->hits . '</span>' : ''; // Show content image if ($show_image) { $img = array(); $image = md5("Image" . $item->id); if (JFile::exists(JPATH_SITE . '/media/k2/items/src/' . $image . '.jpg')) { $image = 'media/k2/items/src/' . $image . '.jpg'; } else { $image = ''; } if ($image_source == 'auto') { if (@$image) { $img_source = 'media'; } else { $img_source = 'content'; } } else { $img_source = $image_source; } if ($img_source == 'media') { if (@$image) { $img['src'] = $image; $img['alt'] = $item->title; $img['ttl'] = $item->title; } } else { $pattern = '/<img[^>]+>/i'; preg_match($pattern, $item->introtext, $img_tag); if (!count($img_tag)) { preg_match($pattern, $item->fulltext, $img_tag); } if (count($img_tag)) { preg_match_all('/(src|alt|title)\\s*=\\s*(["\'])(.*?)\\2/i', $img_tag[0], $img_elem); $img_elem = array_combine($img_elem[1], $img_elem[3]); if (@$img_elem['src']) { $img['src'] = trim(@$img_elem['src']); $img['alt'] = trim(@$img_elem['alt']); $img['ttl'] = trim(@$img_elem['title']); $item->introtext = preg_replace($pattern, '', $item->introtext, 1); } } } if (!@$img['src']) { // Default image $img['src'] = 'modules/mod_giantcontent/assets/images/default.png'; $img['alt'] = $item->title; } if ($img['src']) { $img_src = $img_attr = $img_title = ''; // Use timthumb to resize image if ($image_resize) { $img_src = JURI::base(true) . '/modules/mod_giantcontent/assets/libraries/includes/timthumb.php?src='; $img_attr = '&w=' . $image_width . '&h=' . $image_height . '&q=' . $image_quality; } $img_src = $img_src && strncasecmp($img['src'], "http", 4) !== 0 ? $img_src . JURI::base(true) . '/' : $img_src; $img['ttl'] = $image_title ? $item->title : @$img['ttl']; $img_title = $img['ttl'] ? 'title="' . $img['ttl'] . '"' : ''; $lists[$i]->image = '<img src="' . @$img_src . @$img['src'] . @$img_attr . '" alt="' . @$img['alt'] . '" ' . @$img_title . ' />'; switch ($image_link) { case 'none': $lists[$i]->image = $lists[$i]->image; break; case 'content': $lists[$i]->image = '<a href="' . $lists[$i]->link . '">' . $lists[$i]->image . '</a>'; break; case 'shadowbox': $lists[$i]->image = '<a href="' . @$img['src'] . '" rel="shadowbox" ' . @$img_title . '>' . $lists[$i]->image . '</a>'; break; } $lists[$i]->image_src = @$img['src']; $lists[$i]->image_alt = @$img['alt']; $lists[$i]->image_title = @$img['ttl']; } } // Show author profile if ($show_profile) { switch ($profile_system) { // K2 profile integration - http://getk2.org case 'k2': if (JFile::exists(JPATH_SITE . '/components/com_k2/k2.php')) { require_once JPATH_SITE . '/components/com_k2/helpers/route.php'; $profile_link = JRoute::_(K2HelperRoute::getUserRoute($item->user_id)); } else { echo JText::_('MOD_GIANTCONTENT_ERROR_PROFILE_SYSTEM_K2'); return; } break; // Kunena profile integration - http://kunena.org // Kunena profile integration - http://kunena.org case 'kunena': if (JFile::exists(JPATH_SITE . '/components/com_kunena/kunena.php')) { $profile_link = KunenaRoute::_('index.php?option=com_kunena&view=profile&userid=' . $item->user_id); } else { echo JText::_('MOD_GIANTCONTENT_ERROR_PROFILE_SYSTEM_KUNENA'); return; } break; // JomSocial profile integration - http://jomsocial.com // JomSocial profile integration - http://jomsocial.com case 'jomsocial': if (JFile::exists(JPATH_SITE . '/components/com_community/community.php')) { require_once JPATH_SITE . '/components/com_community/libraries/core.php'; $profile_link = CRoute::_('index.php?option=com_community&view=profile&userid=' . $item->user_id); } else { echo JText::_('MOD_GIANTCONTENT_ERROR_PROFILE_SYSTEM_JOMSOCIAL'); return; } break; // Comprofiler profile integration - http://joomlapolis.com // Comprofiler profile integration - http://joomlapolis.com case 'comprofiler': if (JFile::exists(JPATH_SITE . '/components/com_comprofiler/comprofiler.php')) { $profile_link = JRoute::_('index.php?option=com_comprofiler&task=userProfile&user='******'MOD_GIANTCONTENT_ERROR_PROFILE_SYSTEM_COMPROFILER'); return; } break; // EasyBlog profile integration - http://stackideas.com // EasyBlog profile integration - http://stackideas.com case 'easyblog': if (JFile::exists(JPATH_SITE . '/components/com_easyblog/easyblog.php')) { require_once JPATH_SITE . '/components/com_easyblog/helpers/router.php'; $profile_link = EasyBlogRouter::_('index.php?option=com_easyblog&view=blogger&layout=listings&id=' . $item->user_id); } else { echo JText::_('MOD_GIANTCONTENT_ERROR_PROFILE_SYSTEM_EASYBLOG'); return; } break; // EasySocial profile integration - http://stackideas.com // EasySocial profile integration - http://stackideas.com case 'easysocial': if (JFile::exists(JPATH_SITE . '/components/com_easysocial/easysocial.php')) { $profile_link = Foundry::user($item->user_id)->getPermalink(); } else { echo JText::_('MOD_GIANTCONTENT_ERROR_PROFILE_SYSTEM_EASYSOCIAL'); return; } break; // EasyDiscuss profile integration - http://stackideas.com // EasyDiscuss profile integration - http://stackideas.com case 'easydiscuss': if (JFile::exists(JPATH_SITE . '/components/com_easydiscuss/easydiscuss.php')) { require_once JPATH_SITE . '/components/com_easydiscuss/helpers/router.php'; $profile_link = DiscussHelper::getTable('Profile')->load($item->user_id)->getLink(); } else { echo JText::_('MOD_GIANTCONTENT_ERROR_PROFILE_SYSTEM_EASYDISCUSS'); return; } break; } } // Show content intro if ($show_intro) { // Clean HTML tags if ($clean_intro) { $item->introtext = strip_tags($item->introtext, $allowed_tags); $item->introtext = str_replace(' ', ' ', $item->introtext); $item->introtext = preg_replace('/\\s{2,}/u', ' ', trim($item->introtext)); } $lists[$i]->intro = $limit_intro ? self::truncateText($item->introtext, $limit_intro) : $item->introtext; } // Show content title if ($show_title) { $lists[$i]->title_name = $item->title; $lists[$i]->title = $title_link ? '<a href="' . $lists[$i]->link . '">' . $lists[$i]->title_name . '</a>' : $lists[$i]->title_name; } // Show content category if ($show_category) { $lists[$i]->category_name = $item->category_name; $lists[$i]->category_link = JRoute::_(K2HelperRoute::getCategoryRoute($item->category_id . ':' . $item->category_alias)); $lists[$i]->category = $category_link ? '<a href="' . $lists[$i]->category_link . '">' . $lists[$i]->category_name . '</a>' : $lists[$i]->category_name; } // Show content comments if ($show_comments) { $lists[$i]->comments_count = $item->comments_count; $lists[$i]->comments_link = $lists[$i]->link . $comments_link; $lists[$i]->comments = '<a href="' . $lists[$i]->comments_link . '">' . $item->comments_count . '</a>'; } // Show content author if ($show_author) { $lists[$i]->author_name = $item->user_alias ? $item->user_alias : $item->user_name; $lists[$i]->author = $show_profile ? '<a href="' . $profile_link . '">' . $lists[$i]->author_name . '</a>' : $lists[$i]->author_name; } // Show profile avatar if ($show_avatar) { $avatar_src = 'modules/mod_giantcontent/assets/libraries/includes/timthumb.php?src=' . JURI::base(true) . '/'; $avatar_attr = '&w=' . $avatar_width . '&h=' . $avatar_height; $avatar_default = '<img src="' . $avatar_src . '/modules/mod_giantcontent/assets/images/avatar.png' . $avatar_attr . '" alt="' . $item->user_name . '" />'; $lists[$i]->avatar_user = $item->avatar_user; if ($avatar_system == 'easysocial') { $avatar_img = $avatar_path . $item->user_id . '/' . $item->avatar_user; } else { $avatar_img = $avatar_path . $item->avatar_user; } if (JFile::exists($avatar_img)) { $lists[$i]->avatar = '<img src="' . $avatar_src . $avatar_img . $avatar_attr . '" alt="' . $item->user_name . '" />'; $lists[$i]->avatar = $show_profile ? '<a href="' . $profile_link . '">' . $lists[$i]->avatar . '</a>' : $lists[$i]->avatar; } else { $lists[$i]->avatar = $show_profile ? '<a href="' . $profile_link . '">' . $avatar_default . '</a>' : $avatar_default; } } // Show content rating if ($show_rating) { if ($item->rating_count > 0) { $lists[$i]->rating_count = $item->rating_count; $lists[$i]->rating_average = $item->rating_average; } else { $lists[$i]->rating_count = 0; $lists[$i]->rating_average = 0.0; } $rating_current = $item->rating_average * 20; $lists[$i]->rating = '<span class="gc-rating-list"><span style="width:' . $rating_current . '%;" class="gc-rating-current"></span></span>'; } // Show content tags if ($show_tags) { $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('t.id, t.name AS title'); $query->from('#__k2_tags AS t'); $query->join('LEFT', '#__k2_tags_xref AS tm ON tm.tagID = t.id'); $query->where('t.published = 1 AND tm.itemID = ' . $item->id); $db->setQuery($query); $tags = $db->loadObjectList(); $list_tags = ''; if ($tags) { foreach ($tags as $tag) { $link_tags = JRoute::_(K2HelperRoute::getTagRoute($tag->title)); $list_tags .= '<a class="gc-tag" href="' . $link_tags . '">' . $tag->title . '</a>'; } } $lists[$i]->tags = $list_tags; } // Show featured label if ($featured_label) { $db = JFactory::getDbo(); $db->setQuery('SELECT * FROM #__k2_items WHERE id = ' . $item->id . ' AND featured = 1'); $featured = $db->loadResult(); if ($featured) { $lists[$i]->featured = '<span class="gc-featured" style="background: ' . $featured_label_color . '">' . $featured_label_text . '</span>'; } } } return $lists; }
"> <div class="blog-text-date"> <?php echo $this->formatDate('%d %B %Y', $row->{$this->getParam('creation_source')}); ?> </div> </time> </div> <?php } ?> <div class="blog-tweet" itemprop="name"> <h3 class="blog-title rip"> <a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $entry->id); ?> " itemprop="url"> <?php echo EasyBlogHelper::getHelper('String')->linkTweets(EasyBlogHelper::getHelper('String')->url2link($this->escape($entry->text))); ?> </a> </h3> </div> <?php if ($this->getparam('show_tags', true) && !empty($entry->tags)) { ?> <div class="mts"> <?php echo $this->fetch('tags.item.php', array('tags' => $entry->tags));
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'); }
<!-- Creation date --> <span class="blog-created"> <time datetime="<?php echo $this->formatDate('%Y-%m-%d', $row->{$this->getParam('creation_source')}); ?> "> <span><?php echo $this->formatDate($system->config->get('layout_dateformat'), $row->{$this->getParam('creation_source')}); ?> </span> </time> </span> <?php } ?> <?php if ($this->getParam('show_category')) { ?> <!-- Category info --> <span class="blog-category"> <?php $categoryName = isset($row->category) ? JText::_($row->category) : $row->getCategoryName(); ?> <?php echo JText::sprintf('COM_EASYBLOG_IN', EasyBlogRouter::_('index.php?option=com_easyblog&view=categories&layout=listings&id=' . $row->category_id), $categoryName); ?> </span> <?php } }
foreach ($row->blogs as $entry) { ?> <?php echo $this->fetch('blog.item.simple' . EasyBlogHelper::getHelper('Sources')->getTemplateFile($entry->source) . '.php', array('entry' => $entry, 'customClass' => 'team')); ?> <?php } ?> <li class="post-listmore fwb"> <div> <span> <?php echo JText::_('COM_EASYBLOG_OTHER_ENTRIES_FROM'); ?> <a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=teamblog&layout=listings&id=' . $row->id); ?> "><?php echo $row->title; ?> </a> </span> </div> </li> </ul> <?php } //end if else ?> <?php }
/** * Creates a new stream for new comments in EasyBlog * * @since 1.0 * @access public * @param string * @return */ public function addIndexerNewBlog($blog) { if (!class_exists('Foundry')) { return; } $config = EasyBlogHelper::getConfig(); $indexer = Foundry::get('Indexer', 'com_easyblog'); $template = $indexer->getTemplate(); // getting the blog content $content = $blog->intro . $blog->content; $image = ''; // @rule: Try to get the blog image. if ($blog->getImage()) { $image = $blog->getImage()->getSource('small'); } if (empty($image)) { // @rule: Match images from blog post $pattern = '/<\\s*img [^\\>]*src\\s*=\\s*[\\""\']?([^\\""\'\\s>]*)/i'; preg_match($pattern, $content, $matches); $image = ''; if ($matches) { $image = isset($matches[1]) ? $matches[1] : ''; if (JString::stristr($matches[1], 'https://') === false && JString::stristr($matches[1], 'http://') === false && !empty($image)) { $image = rtrim(JURI::root(), '/') . '/' . ltrim($image, '/'); } } } if (!$image) { $image = rtrim(JURI::root(), '/') . '/components/com_easyblog/assets/images/default_facebook.png'; } // @task: Strip out video tags $content = EasyBlogHelper::getHelper('Videos')->strip($content); // @task: Strip out audio tags $content = EasyBlogHelper::getHelper('Audio')->strip($content); // @task: Strip out gallery tags $content = EasyBlogHelper::getHelper('Gallery')->strip($content); // @task: Strip out album tags $content = EasyBlogHelper::getHelper('Album')->strip($content); // @rule: Once the gallery is already processed above, we will need to strip out the gallery contents since it may contain some unwanted codes // @2.0: <input class="easyblog-gallery" // @3.5: {ebgallery:'name'} $content = EasyBlogHelper::removeGallery($content); $content = strip_tags($content); if (JString::strlen($content) > $config->get('integrations_easysocial_indexer_newpost_length', 250)) { $content = JString::substr($content, 0, $config->get('integrations_easysocial_indexer_newpost_length', 250)); } // lets include the title as the search snapshot. $content = $blog->title . ' ' . $content; $template->setContent($blog->title, $content); $url = EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $blog->id); // Remove /administrator/ from the url. $url = JString::str_ireplace('administrator/', '', $url); $template->setSource($blog->id, 'blog', $blog->created_by, $url); $template->setThumbnail($image); $template->setLastUpdate($blog->modified); $state = $indexer->index($template); return $state; }
} ?> </div> </div> </div> <div class="clear"></div> </li> <?php $i++; } ?> </ul> </div> <a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=' . $posttype . $menuItemId); ?> " class="showcase-more"><?php echo JText::_('MOD_SHOWCASE_VIEW_MORE_' . $posttype); ?> </a> <div class="showcase-navi"> <div class="showcase-a"> <?php for ($i = 1; $i <= count($entries); $i++) { ?> <a class="slider-navi-<?php echo $i; ?> item<?php echo $i == 1 ? ' active' : '';
:</label> <div> <img id="author-avatar" src="<?php echo empty($author) ? $user->getAvatar() : $author->getAvatar(); ?> " width="16" height="16" style="border:1px solid #555" class="avatar float-l mrm mts" /> <span class="ui-span mts"> <span> <?php if ($system->admin || !empty($this->acl->rules->moderate_entry) || isset($teamContribution) && $isCurrentTeamAdmin) { ?> <a href="javascript:void(0);" id="author-name" onclick="eblog.dashboard.changeAuthor('<?php echo JText::_('COM_EASYBLOG_DASHBOARD_DIALOG_CHANGE_AUTHOR_TITLE', true); ?> ','<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&controller=dashboard&task=listBloggers&tmpl=component&browse=1'); ?> ');"><?php echo empty($author) ? $user->getName() : $author->getName(); ?> </a> <?php } else { ?> <span id="author-name"><?php echo empty($author) ? $user->getName() : $author->getName(); ?> </span> <?php } ?>
echo $author; ?> </span> </div> <?php } ?> <span class="post-date"><?php echo $comment->dateString; ?> </span> </div> <div class="mod-post-title"> <a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $comment->post_id . $itemId); ?> #comment-<?php echo $comment->id; ?> "> <?php if ($params->get('showtitle')) { ?> <?php echo JString::strlen($comment->blog_title) > $maxTitleLen ? JString::substr($comment->blog_title, 0, $maxTitleLen) . '...' : $comment->blog_title; ?> <?php } else { ?> <span>#</span>
public function getPermalink() { $url = EasyBlogRouter::_('index.php?option=com_easyblog&view=blogger&layout=listings&id=' . $this->id); return $url; }
public static function getCommentHTML($blog, $comments = array(), $pagination = '') { $config = EasyBlogHelper::getConfig(); $path = EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'comments'; $registration = $config->get('comment_registeroncomment'); $commentSystems = array(); // Double check this with Joomla's registration component if ($registration) { $params = JComponentHelper::getParams('com_users'); $registration = $params->get('allowUserRegistration') == '0' ? false : $registration; } if ($config->get('comment_facebook')) { require_once $path . DIRECTORY_SEPARATOR . 'facebook.php'; $commentSystems['FACEBOOK'] = EasyBlogCommentFacebook::getHTML($blog); if (!$config->get('main_comment_multiple')) { return $commentSystems['FACEBOOK']; } } $easysocial = EasyBlogHelper::getHelper('EasySocial'); if ($config->get('comment_easysocial') && $easysocial->exists()) { $easysocial->init(); $commentSystems['EASYSOCIAL'] = $easysocial->getCommentHTML($blog); if (!$config->get('main_comment_multiple')) { return $commentSystems['EASYSOCIAL']; } } if ($config->get('comment_compojoom')) { $file = JPATH_ROOT . '/administrator/components/com_comment/plugin/com_easyblog/josc_com_easyblog.php'; if (JFile::exists($file)) { require_once $file; $commentSystems['COMPOJOOM'] = CommentEasyBlog::output($blog, array()); } $file = JPATH_ROOT . '/components/com_comment/helpers/utils.php'; if (JFile::exists($file)) { JLoader::discover('ccommentHelper', JPATH_ROOT . '/components/com_comment/helpers'); $commentSystems['COMPOJOOM'] = ccommentHelperUtils::commentInit('com_easyblog', $blog); } if (!$config->get('main_comment_multiple')) { return $commentSystems['COMPOJOOM']; } } if ($config->get('comment_intensedebate')) { require_once $path . DIRECTORY_SEPARATOR . 'intensedebate.php'; $commentSystems['INTENSEDEBATE'] = EasyBlogCommentIntenseDebate::getHTML($blog); if (!$config->get('main_comment_multiple')) { return $commentSystems['INTENSEDEBATE']; } } if ($config->get('comment_disqus')) { require_once $path . DIRECTORY_SEPARATOR . 'disqus.php'; $commentSystems['DISQUS'] = EasyBlogCommentDisqus::getHTML($blog); if (!$config->get('main_comment_multiple')) { return $commentSystems['DISQUS']; } } if ($config->get('comment_jomcomment')) { $file = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_jomcomment' . DIRECTORY_SEPARATOR . 'jomcomment.php'; // Test if jomcomment exists. if (JFile::exists($file)) { require_once $path . DIRECTORY_SEPARATOR . 'jomcomment.php'; $commentSystems['JOMCOMMENT'] = EasyBlogCommentJomComment::getHTML($blog); if (!$config->get('main_comment_multiple')) { return $commentSystems['JOMCOMMENT']; } } } if ($config->get('comment_livefyre')) { require_once $path . DIRECTORY_SEPARATOR . 'livefyre.php'; $commentSystems['LIVEFYRE'] = EasyBlogCommentLiveFyre::getHTML($blog); if (!$config->get('main_comment_multiple')) { return $commentSystems['LIVEFYRE']; } } if ($config->get('comment_jcomments')) { $file = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_jcomments' . DIRECTORY_SEPARATOR . 'jcomments.php'; if (JFile::exists($file)) { require_once $path . DIRECTORY_SEPARATOR . 'jcomments.php'; $commentSystems['JCOMMENTS'] = EasyBlogCommentJComments::getHTML($blog); if (!$config->get('main_comment_multiple')) { return $commentSystems['JCOMMENTS']; } } } if ($config->get('comment_rscomments')) { $file = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_rscomments' . DIRECTORY_SEPARATOR . 'rscomments.php'; if (JFile::exists($file)) { include_once $path . DIRECTORY_SEPARATOR . 'rscomments.php'; $commentSystems['RSCOMMENTS'] = EasyBlogCommentRSComments::getHTML($blog); if (!$config->get('main_comment_multiple')) { return $commentSystems['RSCOMMENTS']; } } } if ($config->get('comment_easydiscuss')) { $enabled = JPluginHelper::isEnabled('content', 'easydiscuss'); if ($enabled) { JPluginHelper::importPlugin('content', 'easydiscuss'); $articleParams = new stdClass(); $result = JFactory::getApplication()->triggerEvent('onDisplayComments', array(&$blog, &$articleParams)); if (isset($result[0]) || isset($result[1])) { // There could be komento running on the site if (isset($result[1]) && $result[1]) { $commentSystems['EASYDISCUSS'] = $result[1]; } else { $commentSystems['EASYDISCUSS'] = $result[0]; } if (!$config->get('main_comment_multiple')) { return $commentSystems['EASYDISCUSS']; } } } } if ($config->get('comment_komento')) { $file = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_komento' . DIRECTORY_SEPARATOR . 'bootstrap.php'; if (JFile::exists($file)) { include_once $file; $commentSystems['KOMENTO'] = Komento::commentify('com_easyblog', $blog, array('trigger' => 'onDisplayComments')); if (!$config->get('main_comment_multiple')) { return $commentSystems['KOMENTO']; } } } if (!$config->get('main_comment_multiple') || $config->get('comment_easyblog')) { //check if bbcode enabled or not. if ($config->get('comment_bbcode')) { EasyBlogCommentHelper::loadBBCode(); } // If all else fail, try to use the default comment system $theme = new CodeThemes(); // setup my own info to show in comment form area $my = JFactory::getUser(); $profile = EasyBlogHelper::getTable('Profile', 'Table'); $profile->load($my->id); $my->avatar = $profile->getAvatar(); $my->displayName = $profile->getName(); $my->url = $profile->url; $blogURL = base64_encode(EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $blog->id, false)); $loginURL = EasyBlogHelper::getLoginLink($blogURL); $enableRecaptcha = $config->get('comment_recaptcha'); $publicKey = $config->get('comment_recaptcha_public'); // check if the user has subcribed to this thread $subscriptionId = false; if ($my->id > 0) { $blogModel = EasyblogHelper::getModel('Blog'); $subscriptionId = $blogModel->isBlogSubscribedUser($blog->id, $my->id, $my->email); $subscriptionId = is_null($subscriptionId) ? false : $subscriptionId; } $theme->set('loginURL', $loginURL); $theme->set('blog', $blog); $theme->set('my', $my); $theme->set('config', $config); $theme->set('blogComments', $comments); $theme->set('pagination', $pagination); $theme->set('allowComment', true); $theme->set('canRegister', $registration); $theme->set('acl', EasyBlogACLHelper::getRuleSet()); $theme->set('subscriptionId', $subscriptionId); $commentSystems['EASYBLOGCOMMENTS'] = $theme->fetch('blog.comment.box.php'); } if (!$config->get('main_comment_multiple')) { return $commentSystems['EASYBLOGCOMMENTS']; } // If there's 1 system only, there's no point loading the tabs. if (count($commentSystems) == 1) { return $commentSystems[key($commentSystems)]; } unset($theme); // Reverse the comment systems array so that easyblog comments are always the first item. $commentSystems = array_reverse($commentSystems); $theme = new CodeThemes(); $theme->set('commentSystems', $commentSystems); return $theme->fetch('blog.comment.multiple.php'); }
<?php foreach ($category->blogs as $entry) { ?> <?php echo $this->fetch('blog.item.simple' . EasyBlogHelper::getHelper('Sources')->getTemplateFile($entry->source) . '.php', array('entry' => $entry, 'customClass' => 'category')); ?> <?php } ?> <li class="post-listmore fwb"> <div> <?php echo JText::_('COM_EASYBLOG_OTHER_ENTRIES_FROM'); ?> <a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&view=categories&layout=listings&id=' . $category->id); ?> "><?php echo $category->title; ?> </a> </div> </li> </ul> <?php } ?> </div> <?php }
function getList() { $params = &$this->_params; $titleMaxChars = $params->get('title_max_chars', '100'); $limit_title_by = $params->get('limit_title_by', 'char'); $descriptionMaxChars = $params->get('description_max_chars', 100); $limitDescriptionBy = $params->get('limit_description_by', 'char'); $isThumb = $params->get('image_thumb', 1); $thumbWidth = (int) $params->get('thumbnail_width', 280); $thumbHeight = (int) $params->get('thumbnail_height', 150); $showimage = $params->get('show_image', 1); $replacer = $params->get('replacer', '...'); $isStrips = $params->get("auto_strip_tags", 1); $limit = $params->get('limit_items', 12); $stringtags = ''; if ($isStrips) { $allow_tags = $params->get("allow_tags", ''); $stringtags = ''; if(!is_array($allow_tags)){ $allow_tags = explode(',',$allow_tags); } foreach ($allow_tags as $tag) { $stringtags .= '<' . $tag . '>'; } } if (!$params->get('default_thumb', 1)) { $this->_defaultThumb = ''; } $ordering = $params->get('ordering', 'created-asc'); $db = JFactory::getDbo(); $query = ' SELECT p.*, c.title as category_title, f.id as featured, f.created as featured_created , u.name as author FROM #__easyblog_post as p LEFT JOIN #__easyblog_category as c ON p.category_id = c.id LEFT JOIN #__easyblog_featured as f ON p.id = f.content_id AND f.type = \'post\' LEFT JOIN #__users as u ON p.created_by = u.id'; //build where $where = ' WHERE p.published = 1 '; $userId = JFactory::getUser()->get('id'); $where .=' AND (p.private = 0 OR (p.created_by = ' . $userId . ' AND p.private = 1)) '; // User filter switch ($params->get('user_id')) { case 'by_me': $where .= ' AND p.created_by = ' . $userId; break; case 'not_me': $where .= ' AND p.created_by <> ' . $userId; break; default: break; } // filter by featured params if ($params->get('show_featured', '1') == 2) { $where .= " AND f.id IS NULL "; } elseif ($params->get('show_featured', '1') == 3) { $where .= " AND f.id IS NOT NULL "; } // Set ordering $order = ''; $ordering = explode('-', $ordering); if (trim($ordering[0]) == 'rand') { $order = ' ORDER BY RAND() '; } else if (trim($ordering[0]) == 'featured'){ $order = ' ORDER BY f.created DESC ' ; } else { $order = ' ORDER BY p.' . $ordering[0] . ' ' . $ordering[1]; } //if category $source = trim($params->get('source', 'category')); $items = array(); if ($source == 'easyblog_category') { $category_ids = self::getCategoryIds(); if (!empty($category_ids) && $params->get('limit_items_for_each')) { foreach ($category_ids as $category_id) { $db->setQuery($query. $where . ' AND p.category_id = ' . $category_id . $order . ($limit ? ' LIMIT ' . $limit : ''), false); $itemsPerCategory = $db->loadObjectList(); $items = array_merge($items,$itemsPerCategory); } } else if(!empty($category_ids)){ // Category filter $where .= ' AND p.category_id IN (' . implode(',', $category_ids) . ') '; $db->setQuery($query. $where . $order . ($limit ? ' LIMIT ' . $limit : '')); $items = $db->loadObjectList(); }else{ $db->setQuery($query. $where . $order . ($limit ? ' LIMIT ' . $limit : '')); $items = $db->loadObjectList(); } //esle article_ids } else { $where .= ' AND p.id IN (' . $params->get('easyblog_article_ids') . ' ) '; $db->setQuery($query. $where . $order . ($limit ? ' LIMIT ' . $limit : '')); $items = $db->loadObjectList(); } foreach ($items as &$item) { $item->fulltext = $item->content; $item->introtext = $item->intro; $item->catid = $item->category_id; $item->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id='.$item->id . $this->getMenuItemId($item)); // format date $item->date = JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC2')); // thumbnail & caption $item->thumbnail = ''; $item->mainImage = ''; if ($showimage) { $item->images = $this->getImage($item); if($item->images){ $item->thumbnail = $item->images->getSource( 'frontpage' ); $item->mainImage = $item->images->getSource('original'); if ($isThumb){ $item->thumbnail = self::renderThumb($item->thumbnail, $thumbWidth, $thumbHeight, $isThumb); } }else{ $item = $this->generateImages($item, $isThumb); } } //var_dump($item->fulltext); // set category link $item->categoryLink = EasyBlogRouter::_('index.php?option=com_easyblog&view=categories&layout=listings&id='.$item->category_id . $this->getMenuItemId($item, 'category')); // cut title if ($limit_title_by == 'word' && $titleMaxChars > 0) { $item->title_cut = self::substrword($item->title, $titleMaxChars, $replacer, $isStrips); } elseif ($limit_title_by == 'char' && $titleMaxChars > 0) { $item->title_cut = self::substring($item->title, $titleMaxChars, $replacer, $isStrips); } // escape html characters $item->title = htmlspecialchars($item->title); // cut description if ($limitDescriptionBy == 'word' && $descriptionMaxChars > 0) { $item->description = self::substrword($item->intro, $descriptionMaxChars, $replacer, $isStrips, $stringtags); } elseif ($limitDescriptionBy == 'char' && $descriptionMaxChars > 0) { $item->description = self::substring($item->intro, $descriptionMaxChars, $replacer, $isStrips, $stringtags); } // import content prepare plugin if($params->get('content_plugin')){ $item->description = JHtml::_('content.prepare', $item->description); } // set authorlink empty $item->authorLink = EasyBlogRouter::_('index.php?option=com_easyblog&view=blogger&layout=listings&id=' . $item->created_by . $this->getMenuItemId($item, 'blogger')); } return $items; }
* @license GNU/GPL, see LICENSE.php * * EasyBlog is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ defined('_JEXEC') or die('Restricted access'); ?> <p><?php echo JText::_('COM_EASYBLOG_DASHBOARD_DRAFTS_CONFIRM_DELETE_MESSAGE'); ?> </p> <form id="dashboard" name="dashboard" method="post" action="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&controller=dashboard&task=deleteAllDrafts'); ?> "> <?php echo JHTML::_('form.token'); ?> <div class="dialog-actions"> <input type="button" value="<?php echo JText::_('COM_EASYBLOG_CANCEL_BUTTON'); ?> " class="button" id="edialog-cancel" name="edialog-cancel" onclick="ejax.closedlg();" /> <input type="submit" value="<?php echo JText::_('COM_EASYBLOG_PROCEED_BUTTON'); ?> " class="button" />
<?php /** * @package EasyBlog * @copyright Copyright (C) 2010 - 2013 Stack Ideas Sdn Bhd. All rights reserved. * @license Proprietary Use License http://stackideas.com/licensing.html * @author Stack Ideas Sdn Bhd */ defined('_JEXEC') or die('Unauthorized Access'); ?> <p><?php echo JText::_('COM_EASYBLOG_ARE_YOU_SURE_YOU_WANT_TO_UNSUBSCRIBE_POST'); ?> </p> <form id="dashboard" name="dashboard" method="post" action="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&controller=entry&task=unsubscribe'); ?> "> <input type="hidden" name="subscription_id" value="<?php echo $subscription_id; ?> " /> <input type="hidden" name="blog_id" value="<?php echo $blog_id; ?> " /> <?php echo JHTML::_('form.token'); ?> <div class="dialog-actions">
echo JText::_('COM_EASYBLOG_AUTOPOSTING_FACEBOOK_ACCESS'); ?> </span> </td> <td valign="top"> <?php if ($this->isAssociated) { ?> <div class="has-tip"> <div class="tip"><i></i><?php echo JText::_('COM_EASYBLOG_AUTOPOSTING_FACEBOOK_ACCESS_DESC'); ?> </div> <div style="margin-top:5px;"> <a href="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&c=autoposting&task=revoke&type=' . EBLOG_OAUTH_FACEBOOK . '&return=form'); ?> "><?php echo JText::_('COM_EASYBLOG_OAUTH_REVOKE_ACCESS'); ?> </a> </div> <p style="margin:15px 0 8px 0;"> <?php echo JText::_('COM_EASYBLOG_FACEBOOK_EXPIRE_TOKEN'); ?> <strong><?php echo $this->expire; ?> </strong>.
* @license GNU/GPL, see LICENSE.php * * EasyBlog is free software. This version may have been modified pursuant * to the GNU General Public License, and as distributed it includes or * is derivative of works licensed under the GNU General Public License or * other free or open source software licenses. * See COPYRIGHT.php for copyright notices and details. */ defined('_JEXEC') or die('Restricted access'); ?> <p><?php echo JText::_('COM_EASYBLOG_DASHBOARD_CATEGORIES_CONFIRM_DELETE_MESSAGE'); ?> </p> <form id="dashboard" name="dashboard" method="post" action="<?php echo EasyBlogRouter::_('index.php?option=com_easyblog&controller=dashboard&task=deleteCategory'); ?> "> <input type="hidden" name="categoryId" value="<?php echo $id; ?> " /> <input type="hidden" name="redirect" value="<?php echo $redirect; ?> " /> <?php echo JHTML::_('form.token'); ?> <div class="dialog-actions">