本文整理汇总了PHP中EasyBlogHelper::getHelper方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::getHelper方法的具体用法?PHP EasyBlogHelper::getHelper怎么用?PHP EasyBlogHelper::getHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::getHelper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tmpl = null)
{
$config = EasyBlogHelper::getConfig();
$id = JRequest::getInt('id');
$my = JFactory::getUser();
if (!$id) {
echo JText::_('COM_EASYBLOG_ENTRY_BLOG_NOT_FOUND');
exit;
}
// @task: Do not allow access to read when configured to.
if ($my->id <= 0 && $config->get('main_login_read')) {
echo JText::_('You are not allowed to read this');
exit;
}
// @task: Do not allow users to read password protected entries
if ($config->get('main_password_protect', true) && !empty($blog->blogpassword)) {
echo JText::_('Password protected entries are not allowed yet.');
exit;
}
$blog = EasyBlogHelper::getTable('Blog');
$blog->load($id);
$weever = EasyBlogHelper::getHelper('Weever')->getDetailsFeed();
$weever->map($blog);
$weever->toJSON(true, JRequest::getVar('callback'));
}
示例2: getHTML
/**
* Shares a story through 3rd party oauth clients
*
* @param TableBlog $blog A blog table object
* @param string $type The type of oauth client
*
* @return boolean True on success and false otherwise.
**/
public function getHTML($bloggerid = "")
{
$html = '';
$my = JFactory::getUser();
$config = EasyBlogHelper::getConfig();
if ($config->get('main_jomsocial_messaging') && $my->id != $bloggerid) {
$file_core = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'core.php';
$file_messaging = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'messaging.php';
if (file_exists($file_core) && file_exists($file_messaging)) {
require_once $file_core;
require_once $file_messaging;
CMessaging::load();
$html = '<a href="javascript:void(0);" onclick="' . CMessaging::getPopup($bloggerid) . '" class="author-message" title="' . JText::_('COM_EASYBLOG_MESSAGE_AUTHOR') . '"><span>' . JText::_('COM_EASYBLOG_MESSAGE_AUTHOR') . '</span></a>';
}
}
$easysocial = EasyBlogHelper::getHelper('EasySocial');
if ($config->get('integrations_easysocial_conversations') && $easysocial->exists() && $my->id != $bloggerid) {
$easysocial->init();
$user = Foundry::user($bloggerid);
$theme = new CodeThemes();
$theme->set('user', $user);
$html = $theme->fetch('easysocial.conversation.php');
}
return $html;
}
示例3: buildcategorytier
public function buildcategorytier()
{
$ajax = EasyBlogHelper::getHelper('Ajax');
$id = JRequest::getInt('id');
if (empty($id)) {
return $ajax->fail();
}
$loop = true;
$scategory = EasyBlogHelper::getTable('Category');
$scategory->load($id);
$model = $this->getModel('categories');
$tier = array();
$searchId = $scategory->parent_id;
while ($loop) {
if (empty($searchId)) {
$loop = false;
} else {
$category = EasyBlogHelper::getTable('Category');
$category->load($searchId);
$tier[] = $category;
$searchId = $category->parent_id;
}
}
// get the root tier
$root = array_pop($tier);
//reverse the array order
$tier = array_reverse($tier);
array_push($tier, $scategory);
// echo '<pre>';
// print_r($tier);
// echo '</pre>';
// exit;
$categories = array();
foreach ($tier as $cat) {
$pItem = new stdClass();
$pItem->id = $cat->id;
$pItem->parent_id = $cat->parent_id;
$pItem->hasChild = 1;
$model = $this->getModel('categories');
$items = $model->getChildCategories($cat->parent_id, true, true);
if (!$items) {
$pItem->hasChild = 0;
$categories[] = $pItem;
continue;
}
for ($i = 0; $i < count($items); $i++) {
$item = $items[$i];
$category = EasyBlogHelper::getTable('Category');
$category->load($item->id);
$item->hasChild = $category->getChildCount();
}
$pItem->childs = $items;
$categories[] = $pItem;
}
// echo '<pre>';
// print_r($categories);
// echo '</pre>';
// exit;
$ajax->success($categories);
}
示例4: store
public function store()
{
// @task: Load language file from the front end.
JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT);
$this->clear($this->draft_id);
// @rule: Send notification to the author of the post.
$draft = EasyBlogHelper::getTable('Draft');
$draft->load($this->draft_id);
$author = EasyBlogHelper::getTable('Profile');
$author->load($draft->created_by);
$data['blogTitle'] = $draft->title;
$data['blogAuthor'] = $author->getName();
$data['blogAuthorAvatar'] = $author->getAvatar();
$data['blogEditLink'] = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=dashboard&layout=write&draft_id=' . $draft->id, false, true);
$data['blogAuthorEmail'] = $author->user->email;
$data['rejectMessage'] = $this->message;
// If blog post is being posted from the back end and SH404 is installed, we should just use the raw urls.
$sh404exists = EasyBlogRouter::isSh404Enabled();
if (JFactory::getApplication()->isAdmin() && $sh404exists) {
$data['blogEditLink'] = JURI::root() . 'index.php?option=com_easyblog&view=dashboard&layout=write&draft_id=' . $draft->id;
}
$emailTitle = JText::_('COM_EASYBLOG_EMAIL_TITLE_NEW_BLOG_REJECTED');
$obj = new StdClass();
$obj->unsubscribe = false;
$obj->email = $author->user->email;
$emails = array($obj);
$notification = EasyBlogHelper::getHelper('Notification');
$notification->send($emails, $emailTitle, 'email.blog.rejected', $data);
return parent::store();
}
示例5: get
public function get()
{
$input = JFactory::getApplication()->input;
$model = EasyBlogHelper::getModel('Blog');
$category = EasyBlogHelper::getTable('Category', 'Table');
$id = $input->get('id', null, 'INT');
$search = $input->get('search', null, 'STRING');
$posts = array();
if (!isset($id)) {
$categoriesmodel = EasyBlogHelper::getModel('Categories');
$categories = $categoriesmodel->getCategoryTree('ordering');
$this->plugin->setResponse($categories);
return;
}
$category->load($id);
// private category shouldn't allow to access.
$privacy = $category->checkPrivacy();
if (!$category->id || !$privacy->allowed) {
$this->plugin->setResponse($this->getErrorResponse(404, 'Category not found'));
return;
}
$catIds = array();
$catIds[] = $category->id;
EasyBlogHelper::accessNestedCategoriesId($category, $catIds);
$sorting = $this->plugin->params->get('sorting', 'latest');
$rows = $model->getBlogsBy('category', $catIds, $sorting, 0, EBLOG_FILTER_PUBLISHED, $search);
foreach ($rows as $k => $v) {
$item = EasyBlogHelper::getHelper('SimpleSchema')->mapPost($v, '', 100, array('text'));
$item->isowner = $v->created_by == $this->plugin->get('user')->id ? true : false;
$posts[] = $item;
}
$this->plugin->setResponse($posts);
}
示例6: get
public function get()
{
$input = JFactory::getApplication()->input;
$model = EasyBlogHelper::getModel('Blog');
$config = EasyBlogHelper::getConfig();
$id = $input->get('id', null, 'INT');
// If we have an id try to fetch the user
$blog = EasyBlogHelper::getTable('Blog');
$blog->load($id);
if (!$id) {
$this->plugin->setResponse($this->getErrorResponse(404, 'Blog id cannot be blank'));
return;
}
if (!$blog->id) {
$this->plugin->setResponse($this->getErrorResponse(404, 'Blog not found'));
return;
}
$item = EasyBlogHelper::getHelper('SimpleSchema')->mapPost($blog, '<p><br><pre><a><blockquote><strong><h2><h3><em><ul><ol><li><iframe>');
$item->isowner = $blog->created_by == $this->plugin->get('user')->id ? true : false;
// Tags
$modelPT = EasyBlogHelper::getModel('PostTag');
$item->tags = $modelPT->getBlogTags($blog->id);
//created by vishal - for show extra images
//$item->text = preg_replace('/"images/i', '"'.JURI::root().'images', $item->text );
$item->text = str_replace('href="', 'href="' . JURI::root(), $item->text);
$item->text = str_replace('src="', 'src="' . JURI::root(), $item->text);
$this->plugin->setResponse($item);
}
示例7: exists
function exists()
{
$db = EasyBlogHelper::db();
$query = 'SELECT COUNT(1) FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote($this->_tbl) . ' ' . 'WHERE `team_id`=' . $db->Quote($this->team_id) . ' ' . 'AND `group_id`=' . $db->Quote($this->group_id);
$db->setQuery($query);
return $db->loadResult() > 0 ? true : false;
}
示例8: 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);
}
}
}
示例9: display
function display()
{
JTable::addIncludePath(EBLOG_TABLES);
$document = JFactory::getDocument();
$viewType = $document->getType();
$config = EasyBlogHelper::getConfig();
$id = JRequest::getInt('post_id', 0);
if (!$config->get('main_trackbacks')) {
echo JText::_('Trackback disabled');
return;
}
if ($id == 0) {
echo JText::_('COM_EASYBLOG_TRACKBACK_INVALID_BLOG_ENTRY_PROVIDED');
return;
}
$blog = EasyBlogHelper::getTable('Blog', 'Table');
$blog->load($id);
header('Content-Type: text/xml');
require_once EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'trackback.php';
$data = JRequest::get('REQUEST');
$trackback = EasyBlogHelper::getTable('Trackback', 'Table');
$trackback->bind($data);
$title = JString::trim($trackback->title);
$excerpt = JString::trim($trackback->excerpt);
$url = JString::trim($trackback->url);
$tb = new EasyBlogTrackback('', '', 'UTF-8');
//@task: We must have at least the important information
if (empty($title)) {
echo $tb->receive(false, JText::_('COM_EASYBLOG_TRACKBACK_INVALID_TITLE_PROVIDED'));
exit;
}
//@task: We must have at least the important information
if (empty($excerpt)) {
echo $tb->receive(false, JText::_('COM_EASYBLOG_TRACKBACK_INVALID_EXCERT_PROVIDED'));
exit;
}
//@task: We must have at least the important information
if (empty($url)) {
echo $tb->receive(false, JText::_('COM_EASYBLOG_TRACKBACK_INVALID_URL_PROVIDED'));
exit;
}
// Check for spams with Akismet
if ($config->get('comment_akismet_trackback')) {
$data = array('author' => $title, 'email' => '', 'website' => JURI::root(), 'body' => $excerpt, 'permalink' => $url);
if (EasyBlogHelper::getHelper('Akismet')->isSpam($data)) {
echo $tb->receive(false, JText::_('COM_EASYBLOG_TRACKBACK_MARKED_AS_SPAM'));
exit;
}
}
$trackback->created = EasyBlogHelper::getDate()->toMySQL();
$trackback->published = '0';
$trackback->ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
if ($trackback->store()) {
echo $tb->receive(true);
exit;
}
echo $tb->receive(false, JText::_('COM_EASYBLOG_ERROR'));
exit;
}
示例10: getDescription
public function getDescription($rule)
{
$db = EasyBlogHelper::db();
$query = 'SELECT ' . EasyBlogHelper::getHelper('SQL')->nameQuote('description') . ' ' . 'FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote('#__easyblog_acl') . ' ' . 'WHERE ' . EasyBlogHelper::getHelper('SQL')->nameQuote('action') . '=' . $db->Quote($rule);
$db->setQuery($query);
$description = $db->loadResult();
return $description;
}
示例11: _buildQueryWhere
function _buildQueryWhere($userId)
{
$mainframe = JFactory::getApplication();
$db = EasyBlogHelper::db();
$where[] = 'a.' . EasyBlogHelper::getHelper('SQL')->nameQuote('user_id') . '=' . $db->Quote($userId);
$where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
return $where;
}
示例12: loadByOauthId
function loadByOauthId($blogId, $id)
{
$db = $this->getDBO();
$query = 'SELECT * FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote($this->_tbl) . ' ' . 'WHERE ' . EasyBlogHelper::getHelper('SQL')->nameQuote('oauth_id') . '=' . $db->Quote($id) . ' ' . 'AND ' . EasyBlogHelper::getHelper('SQL')->nameQuote('post_id') . '=' . $db->Quote($blogId);
$db->setQuery($query);
$result = $db->loadResult();
return $this->bind($result);
}
示例13: loadBySource
function loadBySource($postId, $key, $source)
{
$db = EasyBlogHelper::db();
$query = 'SELECT * FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote($this->_tbl) . ' ' . 'WHERE ' . EasyBlogHelper::getHelper('SQL')->nameQuote('uid') . '=' . $db->Quote($key) . ' ' . 'AND ' . EasyBlogHelper::getHelper('SQL')->nameQuote('post_id') . '=' . $db->Quote($postId) . ' ' . 'AND ' . EasyBlogHelper::getHelper('SQL')->nameQuote('source') . '=' . $db->Quote($source);
$db->setQuery($query);
$obj = $db->loadObject();
return parent::bind($obj);
}
示例14: getLanguageTitle
public function getLanguageTitle($code)
{
$db = EasyBlogHelper::db();
$query = 'SELECT ' . EasyBlogHelper::getHelper('SQL')->nameQuote('title') . ' FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote('#__languages') . ' WHERE ' . EasyBlogHelper::getHelper('SQL')->nameQuote('lang_code') . '=' . $db->Quote($code);
$db->setQuery($query);
$title = $db->loadResult();
return $title;
}
示例15: getGroupTitle
function getGroupTitle($user_id)
{
$db = EasyBlogHelper::db();
$sql = "SELECT title FROM " . EasyBlogHelper::getHelper('SQL')->nameQuote('#__usergroups') . " ug left join " . EasyBlogHelper::getHelper('SQL')->nameQuote('#__user_usergroup_map') . " map on (ug.id = map.group_id)" . " WHERE map.user_id=" . $db->Quote($user_id);
$db->setQuery($sql);
$result = $db->loadResultArray();
return nl2br(implode("\n", $result));
}