本文整理汇总了PHP中EasyBlogRouter::_方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogRouter::_方法的具体用法?PHP EasyBlogRouter::_怎么用?PHP EasyBlogRouter::_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogRouter
的用法示例。
在下文中一共展示了EasyBlogRouter::_方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toHTML
/**
*
* $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');
}
示例2: load
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;
}
示例3: links
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
}
示例4: display
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);
}
}
}
示例5: mapPost
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;
}
示例6: 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');
}
示例7: request
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'));
}
示例8: getFeedURL
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;
}
示例9: getObjectInfo
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;
}
示例10: submitReport
/**
* 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);
}
示例11: unsubscribe
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;
}
示例12: base64_encode
<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>
示例13: getList
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';
//.........这里部分代码省略.........
示例14: array
">
<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));
示例15: statistic
function statistic()
{
JPluginHelper::importPlugin('easyblog');
$dispatcher = JDispatcher::getInstance();
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$config = EasyBlogHelper::getConfig();
$my = JFactory::getUser();
$acl = EasyBlogACLHelper::getRuleSet();
// Add noindex for tags view by default.
$document->setMetadata('robots', 'noindex,follow');
$sort = JRequest::getCmd('sort', $config->get('layout_postorder'));
$bId = JRequest::getCmd('id', '0');
//stats type
$statType = JRequest::getString('stat', '');
$statId = $statType == 'tag' ? JRequest::getString('tagid', '') : JRequest::getString('catid', '');
$statObject = null;
if ($statType == 'category') {
$statObject = EasyBlogHelper::getTable('Category', 'Table');
$statObject->load($statId);
} else {
JTable::addIncludePath(EBLOG_TABLES);
$statObject = EasyBlogHelper::getTable('Tag', 'Table');
$statObject->load($statId);
}
$blogger = EasyBlogHelper::getTable('Profile', 'Table');
$blogger->load($bId);
// set meta tags for blogger
if ($acl->rules->allow_seo) {
EasyBlogHelper::setMeta($blogger->id, META_TYPE_BLOGGER, true);
}
if (!EasyBlogRouter::isCurrentActiveMenu('blogger')) {
$this->setPathway(JText::_('COM_EASYBLOG_BLOGGERS'), EasyBlogRouter::_('index.php?option=com_easyblog&view=blogger'));
}
if (!EasyBlogRouter::isCurrentActiveMenu('blogger', $blogger->id)) {
$this->setPathway($blogger->getName());
}
$model = $this->getModel('Blog');
$data = $model->getBlogsBy('blogger', $blogger->id, $sort);
$pagination = $model->getPagination();
$data = EasyBlogHelper::formatBlog($data);
$rssURL = EasyBlogRouter::_('index.php?option=com_easyblog&view=blogger&task=rss');
if ($config->get('layout_showcomment', false)) {
for ($i = 0; $i < count($data); $i++) {
$row =& $data[$i];
$maxComment = $config->get('layout_showcommentcount', 3);
$comments = EasyBlogHelper::getHelper('Comment')->getBlogComment($row->id, $maxComment, 'desc');
$comments = EasyBlogHelper::formatBlogCommentsLite($comments);
$row->comments = $comments;
}
}
$twitterFollowMelink = EasyBlogSocialShareHelper::getLink('twitter', $blogger->id);
if ($config->get('main_rss')) {
if ($config->get('main_feedburner') && $config->get('main_feedburnerblogger')) {
$document->addHeadLink($blogger->getRSS(), 'alternate', 'rel', array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'));
} else {
// Add rss feed link
$document->addHeadLink($blogger->getRSS(), 'alternate', 'rel', array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'));
$document->addHeadLink($blogger->getAtom(), 'alternate', 'rel', array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'));
}
}
$pageTitle = EasyBlogHelper::getPageTitle($config->get('main_title'));
$pageNumber = $pagination->get('pages.current');
$pageText = $pageNumber == 1 ? '' : ' - ' . JText::sprintf('COM_EASYBLOG_PAGE_NUMBER', $pageNumber);
$statTitle = '';
if (isset($statType)) {
if ($statType == 'tag') {
$statTitle = ' - ' . JText::sprintf('COM_EASYBLOG_BLOGGER_STAT_TAG', $statObject->title);
} else {
$statTitle = ' - ' . JText::sprintf('COM_EASYBLOG_BLOGGER_STAT_CATEGORY', $statObject->title);
}
}
$document->setTitle($blogger->getName() . $statTitle . $pageText . $pageTitle);
$tpl = new CodeThemes();
$tpl->set('blogger', $blogger);
$tpl->set('sort', $sort);
$tpl->set('blogs', $data);
$tpl->set('config', $config);
$tpl->set('siteadmin', EasyBlogHelper::isSiteAdmin());
$tpl->set('pagination', $pagination->getPagesLinks());
$tpl->set('twitterFollowMelink', $twitterFollowMelink);
$tpl->set('my', $my);
$tpl->set('acl', $acl);
$tpl->set('currentURL', ltrim('/', JRequest::getURI()));
$tpl->set('statType', $statType);
$tpl->set('statObject', $statObject);
echo $tpl->fetch('blog.blogger.php');
}