本文整理汇总了PHP中EasyBlogHelper类的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper类的具体用法?PHP EasyBlogHelper怎么用?PHP EasyBlogHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EasyBlogHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: remove
function remove()
{
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// @task: Check for acl rules.
$this->checkAccess('mail');
$mails = JRequest::getVar('cid', '', 'POST');
$message = '';
$type = 'info';
if (empty($mails)) {
$message = JText::_('COM_EASYBLOG_NO_MAIL_ID_PROVIDED');
$type = 'error';
} else {
$table = EasyBlogHelper::getTable('MailQueue', 'Table');
foreach ($mails as $id) {
$table->load($id);
if (!$table->delete()) {
$message = JText::_('COM_EASYBLOG_SPOOLS_DELETE_ERROR');
$type = 'error';
$this->setRedirect('index.php?option=com_easyblog&view=spools', $message, $type);
return;
}
}
$message = JText::_('COM_EASYBLOG_SPOOLS_DELETE_SUCCESS');
}
$this->setRedirect('index.php?option=com_easyblog&view=spools', $message);
}
开发者ID:alexinteam,项目名称:joomla3,代码行数:27,代码来源:spools.php
示例2: __construct
public function __construct()
{
$lang = JFactory::getLanguage();
$lang->load('com_easyblog', JPATH_ROOT);
$this->exists = $this->exists();
$this->config = EasyBlogHelper::getConfig();
}
开发者ID:Tommar,项目名称:vino2,代码行数:7,代码来源:easydiscuss.php
示例3: getNews
public function getNews()
{
$news = EasyBlogHelper::getRecentNews();
$content = '';
ob_start();
if ($news) {
foreach ($news as $item) {
?>
<li>
<b><span><?php
echo $item->title . ' - ' . $item->date;
?>
</span></b>
<div><?php
echo $item->desc;
?>
</div>
</li>
<?php
}
} else {
?>
<li><?php
echo JText::_('Unable to contact news server');
?>
</li>
<?php
}
$content = ob_get_contents();
@ob_end_clean();
$ajax = new Ejax();
$ajax->assign('news-items', $content);
// $ajax->script( "$('#news-items").html(\'' . addslashes( $content ) . '\');');
$ajax->send();
}
开发者ID:alexinteam,项目名称:joomla3,代码行数:35,代码来源:view.ejax.php
示例4: save
function save()
{
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// @task: Check for acl rules.
$this->checkAccess('trackback');
$mainframe = JFactory::getApplication();
$message = '';
$type = 'message';
if (JRequest::getMethod() != 'POST') {
$mainframe->redirect('index.php?option=com_easyblog&view=trackbacks', JText::_('COM_EASYBLOG_TRACKBACKS_INVALID_REQUEST'), 'error');
$mainframe->close();
}
$post = JRequest::get('POST');
$my = JFactory::getUser();
$id = JRequest::getInt('id', 0);
JTable::addIncludePath(EBLOG_TABLES);
$trackback = EasyBlogHelper::getTable('Trackback', 'Table');
$trackback->load($id);
$trackback->bind($post);
if (!$trackback->store()) {
$mainframe->redirect('index.php?option=com_easyblog&view=trackbacks', JText::_('COM_EASYBLOG_TRACKBACKS_SAVE_ERROR'), 'error');
$mainframe->close();
}
$mainframe->redirect('index.php?option=com_easyblog&view=trackbacks', JText::_('COM_EASYBLOG_TRACKBACKS_SAVE_SUCCESS'));
$mainframe->close();
}
开发者ID:alexinteam,项目名称:joomla3,代码行数:27,代码来源:trackback.php
示例5: store
public function store()
{
$isNew = empty($this->id) ? true : false;
$state = parent::store();
if ($state && $isNew) {
$blog = EasyBlogHelper::getTable('Blog');
$blog->load($this->post_id);
$profile = EasyBlogHelper::getTable('Profile');
$profile->load($blog->created_by);
$obj = new stdClass();
$obj->blogtitle = $blog->title;
$obj->blogauthor = $profile->getName();
$obj->subscribername = $this->fullname;
$obj->subscriberemail = $this->email;
$activity = new stdClass();
$activity->actor_id = empty($this->user_id) ? '0' : $this->user_id;
$activity->target_id = $blog->created_by;
$activity->context_type = 'post';
$activity->context_id = $this->post_id;
$activity->verb = 'subscribe';
$activity->source_id = $this->id;
$activity->uuid = serialize($obj);
EasyBlogHelper::activityLog($activity);
}
return $state;
}
开发者ID:alexinteam,项目名称:joomla3,代码行数:26,代码来源:subscription.php
示例6: display
function display($tpl = null)
{
// @rule: Test for user access if on 1.6 and above
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
if (!JFactory::getUser()->authorise('easyblog.manage.comment', 'com_easyblog')) {
JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
JFactory::getApplication()->close();
}
}
//initialise variables
$document = JFactory::getDocument();
$user = JFactory::getUser();
$mainframe = JFactory::getApplication();
//Load pane behavior
jimport('joomla.html.pane');
$commentId = JRequest::getVar('commentid', '');
$comment = EasyBlogHelper::getTable('Comment', 'Table');
$comment->load($commentId);
$this->comment = $comment;
// Set default values for new entries.
if (empty($comment->created)) {
$date = EasyBlogDateHelper::getDate();
$now = EasyBlogDateHelper::toFormat($date);
$comment->created = $now;
$comment->published = true;
}
$this->assignRef('comment', $comment);
parent::display($tpl);
}
开发者ID:alexinteam,项目名称:joomla3,代码行数:29,代码来源:view.html.php
示例7: addCard
public static function addCard(&$blog, $rawIntroText)
{
$cfg = EasyBlogHelper::getConfig();
// @rule: Check if user really wants to append the opengraph tags on the headers.
if (!$cfg->get('main_twitter_cards')) {
return false;
}
// Get the absolute permalink for this blog item.
$url = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $blog->id, false, true);
// Get the image of the blog post.
$image = self::getImage($blog, $rawIntroText);
// @task: Get Joomla's document object.
$doc = JFactory::getDocument();
// Add card definition.
$doc->addCustomTag('<meta property="twitter:card" content="summary" />');
$doc->addCustomTag('<meta property="twitter:url" content="' . $url . '" />');
$doc->addCustomTag('<meta property="twitter:title" content="' . $blog->title . '" />');
$text = EasyBlogHelper::stripEmbedTags($rawIntroText);
$text = strip_tags($text);
$text = str_ireplace("\r\n", "", $text);
// Remove any " in the content as this would mess up the headers.
$text = str_ireplace('"', '', $text);
$maxLength = 137;
if (!empty($maxLength)) {
$text = JString::strlen($text) > $maxLength ? JString::substr($text, 0, $maxLength) . '...' : $text;
}
$text = EasyBlogStringHelper::escape($text);
$doc->addCustomTag('<meta property="twitter:description" content="' . $text . '" />');
if ($image) {
$doc->addCustomTag('<meta property="twitter:image" content="' . $image . '"/> ');
}
return true;
}
开发者ID:alexinteam,项目名称:joomla3,代码行数:33,代码来源:twitter.php
示例8: confirmAutopost
public function confirmAutopost($type, $id)
{
$ajax = new Ejax();
$options = new stdClass();
$options->title = JText::_('COM_EASYBLOG_AUTOPOST_DIALOG_INFO');
$action = EasyBlogHelper::getJoomlaVersion() >= '1.6' ? 'Joomla.submitbutton(\'autopost\');' : 'submitbutton(\'autopost\')';
ob_start();
?>
<p><?php
echo JText::sprintf('COM_EASYBLOG_AUTOPOST_DIALOG_DESC', ucfirst($type));
?>
</p>
<div class="dialog-actions">
<input type="button" onclick="ejax.closedlg();" name="edialog-cancel" id="edialog-cancel" class="button" value="<?php
echo JText::_('COM_EASYBLOG_CANCEL_BUTTON');
?>
">
<input type="button" class="button" value="<?php
echo JText::_('COM_EASYBLOG_SHARE_BUTTON');
?>
" onclick="<?php
echo $action;
?>
">
</div>
<?php
$options->content = ob_get_contents();
ob_end_clean();
$ajax->script('$("#adminForm input[name=autopost_type]").val("' . $type . '");');
$ajax->script('$("#adminForm input[name=autopost_selected]").val("' . $id . '");');
$ajax->dialog($options);
$ajax->send();
}
开发者ID:alexinteam,项目名称:joomla3,代码行数:33,代码来源:view.ejax.php
示例9: init
/**
* Initiate class variables
*/
public function init()
{
$this->config = EasyBlogHelper::getConfig();
$this->enabled = $this->config->get('main_remotepublishing_mailbox');
$this->server = $this->config->get('main_remotepublishing_mailbox_remotesystemname');
$this->port = $this->config->get('main_remotepublishing_mailbox_port');
$this->mailbox_name = $this->config->get('main_remotepublishing_mailbox_mailboxname');
$this->service = $this->config->get('main_remotepublishing_mailbox_service');
$this->username = $this->config->get('main_remotepublishing_mailbox_username');
$this->password = $this->config->get('main_remotepublishing_mailbox_password');
$this->ssl = $this->config->get('main_remotepublishing_mailbox_ssl');
$this->subject_prefix = $this->config->get('main_remotepublishing_mailbox_prefix');
$this->check_interval = $this->config->get('main_remotepublishing_mailbox_run_interval');
$this->validate_cert = $this->config->get('main_remotepublishing_mailbox_validate_cert');
$this->flags = '';
$this->flags .= $this->service ? '/' . $this->service : '';
$this->flags .= $this->ssl ? '/ssl' : '';
$this->flags .= $this->debug ? '/debug' : '';
$this->flags .= $this->norch ? '/norch' : '';
$this->flags .= $this->validate_cert ? '' : '/novalidate-cert';
//$this->flags .= $this->tls ? '/tls' : '/notls';
$this->flags .= $this->readonly ? '/readonly' : '';
$this->mailbox_params = '{' . $this->server . ':' . $this->port . $this->flags . '}' . $this->mailbox_name;
$this->initiated = true;
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:28,代码来源:lib.php
示例10: display
function display($tmpl = null)
{
$config = EasyBlogHelper::getConfig();
$id = JRequest::getInt('id');
$team = EasyBlogHelper::getTable('TeamBlog');
$team->load($id);
if ($team->access != EBLOG_TEAMBLOG_ACCESS_EVERYONE) {
return;
}
$model = $this->getModel('Blog');
$posts = $model->getBlogsBy('teamblog', $team->id);
$weever = EasyBlogHelper::getHelper('Weever')->getMainFeed();
$weever->set('description', JText::sprintf('COM_EASYBLOG_FEEDS_TEAMBLOGS_DESC', $team->title));
$weever->set('url', EasyBlogRouter::getRoutedUrl('index.php?option=com_easyblog&view=teamblog&id=' . $id . '&format=weever', false, true));
$weever->set('thisPage', 1);
$weever->set('lastPage', 1);
if ($posts) {
foreach ($posts as $post) {
$blog = EasyBlogHelper::getTable('Blog');
$blog->load($post->id);
$weever->addChild($blog);
}
}
$weever->toJSON(true, JRequest::getVar('callback'));
}
开发者ID:Tommar,项目名称:vino2,代码行数:25,代码来源:view.weever.php
示例11: getPostCount
function getPostCount($id)
{
$db = EasyBlogHelper::db();
$query = 'SELECT COUNT(1) FROM #__easyblog_post ' . 'WHERE `created_by`=' . $db->Quote($id);
$db->setQuery($query);
return $db->loadResult();
}
开发者ID:alexinteam,项目名称:joomla3,代码行数:7,代码来源:view.html.php
示例12: form
public function form($tpl = null)
{
JHTML::_('behavior.modal', 'a.modal');
$feed = EasyBlogHelper::getTable('Feed', 'Table');
JToolBarHelper::title(JText::_('COM_EASYBLOG_BLOGS_FEEDS_CREATE_NEW_TITLE'), 'feeds');
JToolBarHelper::custom('save', 'save.png', 'save_f2.png', 'COM_EASYBLOG_SAVE', false);
JToolbarHelper::cancel();
$cid = JRequest::getVar('cid', '', 'REQUEST');
if (!empty($cid)) {
$feed->load($cid);
}
$post = JRequest::get('POST');
if (!empty($post)) {
$feed->bind($post);
}
$categoryName = '';
$authorName = '';
if (!empty($feed->item_category)) {
$categoryName = $feed->getCategoryName();
}
if (!empty($feed->item_creator)) {
$author = JFactory::getUser($feed->item_creator);
$authorName = $author->name;
}
$params = EasyBlogHelper::getRegistry($feed->params);
$this->assignRef('params', $params);
$this->assignRef('feed', $feed);
$this->assignRef('categoryName', $categoryName);
$this->assignRef('authorName', $authorName);
parent::display($tpl);
}
开发者ID:alexinteam,项目名称:joomla3,代码行数:31,代码来源:view.html.php
示例13: 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);
}
开发者ID:beingsane,项目名称:com_api-plugins,代码行数:33,代码来源:category.php
示例14: 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();
}
开发者ID:alexinteam,项目名称:joomla3,代码行数:30,代码来源:postreject.php
示例15: display
/**
* Displays the files and folders that are in the media manager.
*/
public function display($tpl = null)
{
$config = EasyBlogHelper::getConfig();
$document = JFactory::getDocument();
$my = JFactory::getUser();
$app = JFactory::getApplication();
$profile = EasyBlogHelper::getTable('Profile');
$profile->load($my->id);
if ($my->id <= 0) {
echo JText::_('COM_EASYBLOG_NOT_ALLOWED');
exit;
}
$user = JFactory::getUser();
$document->setTitle(JText::_('COM_EASYBLOG_MEDIA_MANAGER'));
// Only allow admin to impersonate anyone.
if (EasyBlogHelper::isSiteAdmin()) {
$user = JFactory::getUser(JRequest::getVar('blogger_id', $my->id));
}
$debug = $config->get('debug_javascript') || JRequest::getVar('ebjsdebug') == 1 ? 'true' : 'false';
$theme = new CodeThemes(true);
$theme->set('debug', $debug);
$theme->set('session', JFactory::getSession());
$theme->set('blogger_id', $user->id);
// @rule: Test if the user is already associated with Flickr
$oauth = EasyBlogHelper::getTable('Oauth');
$associated = $oauth->loadByUser($my->id, EBLOG_OAUTH_FLICKR);
$theme->set('flickrAssociated', $associated);
echo $theme->fetch('media.php');
}
开发者ID:Tommar,项目名称:vino2,代码行数:32,代码来源:view.html.php
示例16: __construct
public function __construct(&$subject, $config = array())
{
parent::__construct($subject, $config = array());
$easyblog = JPATH_ROOT . '/administrator/components/com_easyblog/easyblog.php';
if (!JFile::exists($easyblog) || !JComponentHelper::isEnabled('com_easysocial', true)) {
ApiError::raiseError(404, 'Easyblog not installed');
return;
}
// Load Easyblog language & bootstrap files
$language = JFactory::getLanguage();
$language->load('com_easyblog');
require_once JPATH_ROOT . '/components/com_easyblog/constants.php';
require_once EBLOG_HELPERS . '/helper.php';
// Set resources & access
ApiResource::addIncludePath(dirname(__FILE__) . '/easyblog');
$this->setResourceAccess('latest', 'public', 'get');
$this->setResourceAccess('category', 'public', 'get');
$this->setResourceAccess('blog', 'public', 'get');
$this->setResourceAccess('blog', 'public', 'post');
$this->setResourceAccess('comments', 'public', 'get');
$this->setResourceAccess('easyblog_users', 'public', 'get');
$config = EasyBlogHelper::getConfig();
if ($config->get('main_allowguestcomment')) {
$this->setResourceAccess('comments', 'public', 'post');
}
}
开发者ID:beingsane,项目名称:com_api-plugins,代码行数:26,代码来源:easyblog.php
示例17: set
public function set($key, $value)
{
if (EasyBlogHelper::getJoomlaVersion() >= '2.5') {
return $this->registry->set($key, $value);
}
return $this->registry->setValue($key, $value);
}
开发者ID:Tommar,项目名称:vino2,代码行数:7,代码来源:registry.php
示例18: getAllRuleItems
function getAllRuleItems()
{
$db = EasyBlogHelper::db();
$query = 'select * from `#__easyblog_category_acl_item` order by id';
$db->setQuery($query);
return $db->loadObjectList();
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:7,代码来源:categoryaclitem.php
示例19: getItems
public function getItems()
{
$mainframe = JFactory::getApplication();
$db = EasyBlogHelper::db();
$filter_groups = $mainframe->getUserStateFromRequest('com_easyblog.fields.filter_groups', 'filter_groups', '', 'string');
$search = $mainframe->getUserStateFromRequest('com_easyblog.fields.search', 'search', '', 'string');
$search = $db->getEscaped(trim(JString::strtolower($search)));
$query = array();
$pagination = $this->getPagination();
$query[] = 'SELECT * FROM ' . $db->quoteName('#__easyblog_fields');
$where = array();
if ($filter_groups) {
$where[] = $db->quoteName('id') . '=' . $db->Quote($filter_groups);
}
if ($search) {
$where[] = 'LOWER(' . $db->quoteName('title') . ') LIKE \'%' . $search . '%\' ';
}
$where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
$query[] = $where;
$query[] = 'LIMIT ' . $pagination->limitstart . ',' . $pagination->limit;
$query = implode(' ', $query);
$db->setQuery($query);
$data = $db->loadObjectList();
return $data;
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:25,代码来源:fields.php
示例20: get
public function get($key, $default = null)
{
if (EasyBlogHelper::getJoomlaVersion() >= '3.0') {
return $this->config->get($key, $default);
}
return $this->config->getValue($key, $default);
}
开发者ID:knigherrant,项目名称:decopatio,代码行数:7,代码来源:jconfig.php
注:本文中的EasyBlogHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论