コード例 #1
0
ファイル: spools.php プロジェクト: alexinteam/joomla3
 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);
 }
コード例 #2
0
ファイル: easydiscuss.php プロジェクト: Tommar/vino2
 public function __construct()
 {
     $lang = JFactory::getLanguage();
     $lang->load('com_easyblog', JPATH_ROOT);
     $this->exists = $this->exists();
     $this->config = EasyBlogHelper::getConfig();
 }
コード例 #3
0
ファイル: view.ejax.php プロジェクト: alexinteam/joomla3
    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();
    }
コード例 #4
0
ファイル: trackback.php プロジェクト: alexinteam/joomla3
 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();
 }
コード例 #5
0
ファイル: subscription.php プロジェクト: alexinteam/joomla3
 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;
 }
コード例 #6
0
ファイル: view.html.php プロジェクト: alexinteam/joomla3
 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);
 }
コード例 #7
0
ファイル: twitter.php プロジェクト: alexinteam/joomla3
 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;
 }
コード例 #8
0
ファイル: view.ejax.php プロジェクト: alexinteam/joomla3
    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();
    }
コード例 #9
0
ファイル: lib.php プロジェクト: knigherrant/decopatio
 /**
  * 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;
 }
コード例 #10
0
ファイル: view.weever.php プロジェクト: Tommar/vino2
 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'));
 }
コード例 #11
0
ファイル: view.html.php プロジェクト: alexinteam/joomla3
 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();
 }
コード例 #12
0
ファイル: view.html.php プロジェクト: alexinteam/joomla3
 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);
 }
コード例 #13
0
 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);
 }
コード例 #14
0
ファイル: postreject.php プロジェクト: alexinteam/joomla3
 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();
 }
コード例 #15
0
ファイル: view.html.php プロジェクト: Tommar/vino2
 /**
  * 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');
 }
コード例 #16
0
 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');
     }
 }
コード例 #17
0
ファイル: view.weever.php プロジェクト: Tommar/vino2
 function display($tmpl = null)
 {
     $config = EasyBlogHelper::getConfig();
     $id = JRequest::getCmd('id', '0');
     $category = EasyBlogHelper::getTable('Category', 'Table');
     $category->load($id);
     // private category shouldn't allow to access.
     $privacy = $category->checkPrivacy();
     if (!$privacy->allowed) {
         return;
     }
     $catIds = array();
     $catIds[] = $category->id;
     EasyBlogHelper::accessNestedCategoriesId($category, $catIds);
     $model = $this->getModel('Blog');
     $posts = $model->getBlogsBy('category', $catIds);
     $weever = EasyBlogHelper::getHelper('Weever')->getMainFeed();
     $weever->set('description', JText::sprintf('COM_EASYBLOG_FEEDS_CATEGORY_DESC', $this->escape($category->title)));
     $weever->set('url', EasyBlogRouter::getRoutedUrl('index.php?option=com_easyblog&view=categories&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'));
 }
コード例 #18
0
ファイル: registry.php プロジェクト: Tommar/vino2
 public function set($key, $value)
 {
     if (EasyBlogHelper::getJoomlaVersion() >= '2.5') {
         return $this->registry->set($key, $value);
     }
     return $this->registry->setValue($key, $value);
 }
コード例 #19
0
 function getAllRuleItems()
 {
     $db = EasyBlogHelper::db();
     $query = 'select * from `#__easyblog_category_acl_item` order by id';
     $db->setQuery($query);
     return $db->loadObjectList();
 }
コード例 #20
0
ファイル: fields.php プロジェクト: knigherrant/decopatio
 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;
 }
コード例 #21
0
ファイル: jconfig.php プロジェクト: knigherrant/decopatio
 public function get($key, $default = null)
 {
     if (EasyBlogHelper::getJoomlaVersion() >= '3.0') {
         return $this->config->get($key, $default);
     }
     return $this->config->getValue($key, $default);
 }
コード例 #22
0
ファイル: tweetmeme.php プロジェクト: Tommar/vino2
    public static function getHTML($row)
    {
        $config = EasyBlogHelper::getConfig();
        if (!$config->get('main_tweetmeme')) {
            return '';
        }
        $service = $config->get('main_tweetmeme_url');
        $style = $config->get('main_tweetmeme_style');
        $source = $config->get('main_tweetmeme_rtsource');
        $buttonSize = 'social-button-';
        switch ($style) {
            case 'normal':
                $buttonSize .= 'large';
                break;
            case 'compact':
            default:
                $buttonSize .= 'small';
                break;
        }
        $url = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $row->id, false, true);
        $title = addslashes($row->title);
        $placeholder = 'sb-' . rand();
        $html = '<div class="social-button ' . $buttonSize . ' tweetmeme"><span id="' . $placeholder . '"></span></div>';
        $html .= EasyBlogHelper::addScriptDeclarationBookmarklet('$("#' . $placeholder . '").bookmarklet("tweetMeme", {
			service: "' . $service . '",
			style: "' . $style . '",
			url: "' . $url . '",
			title: "' . $title . '",
			source: "' . $source . '"
		});');
        return $html;
    }
コード例 #23
0
ファイル: view.html.php プロジェクト: alexinteam/joomla3
 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.tag', '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();
     // Render modal
     JHTML::_('behavior.modal');
     $tagId = JRequest::getVar('tagid', '');
     $tag = EasyBlogHelper::getTable('Tag', 'Table');
     $tag->load($tagId);
     $tag->title = JString::trim($tag->title);
     $tag->alias = JString::trim($tag->alias);
     $this->tag = $tag;
     // Set default values for new entries.
     if (empty($tag->created)) {
         $date = EasyBlogDateHelper::getDate();
         $now = EasyBlogDateHelper::toFormat($date);
         $tag->created = $now;
         $tag->published = true;
     }
     $this->assignRef('my', $user);
     $this->assignRef('tag', $tag);
     parent::display($tpl);
 }
コード例 #24
0
ファイル: messaging.php プロジェクト: Tommar/vino2
 /**
  * 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;
 }
コード例 #25
0
ファイル: teambloggroup.php プロジェクト: alexinteam/joomla3
 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;
 }
コード例 #26
0
ファイル: oauth.php プロジェクト: Tommar/vino2
 /**
  * Detects where the system has been setup before
  */
 public function isAssociated($type)
 {
     $db = EasyBlogHelper::db();
     $query = 'SELECT COUNT(1) FROM ' . $db->nameQuote('#__easyblog_oauth') . ' ' . 'WHERE ' . $db->nameQuote('system') . '=' . $db->Quote(1) . ' ' . 'AND ' . $db->nameQuote('type') . '=' . $db->Quote($type) . ' ' . 'AND ' . $db->nameQuote('access_token') . ' !=""';
     $db->setQuery($query);
     return $db->loadResult() > 0;
 }
コード例 #27
0
ファイル: view.weever.php プロジェクト: Tommar/vino2
 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'));
 }
コード例 #28
0
ファイル: view.html.php プロジェクト: alexinteam/joomla3
 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.trackback', '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();
     $filter_state = $mainframe->getUserStateFromRequest('com_easyblog.trackbacks.filter_state', 'filter_state', '*', 'word');
     $search = $mainframe->getUserStateFromRequest('com_easyblog.trackbacks.search', 'search', '', 'string');
     $search = trim(JString::strtolower($search));
     $order = $mainframe->getUserStateFromRequest('com_easyblog.trackbacks.filter_order', 'filter_order', 'created', 'cmd');
     $orderDirection = $mainframe->getUserStateFromRequest('com_easyblog.trackbacks.filter_order_Dir', 'filter_order_Dir', '', 'word');
     //Get data from the model
     $trackbacks = $this->get('Data');
     $pagination = $this->get('Pagination');
     $this->assignRef('trackbacks', $trackbacks);
     $this->assignRef('pagination', $pagination);
     $this->assign('state', $this->getFilterState($filter_state));
     $this->assign('search', $search);
     $this->assign('order', $order);
     $this->assign('orderDirection', $orderDirection);
     parent::display($tpl);
 }
コード例 #29
0
ファイル: view.raw.php プロジェクト: alexinteam/joomla3
 public function export()
 {
     // @rule: Test for user access if on 1.6 and above
     if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
         if (!JFactory::getUser()->authorise('easyblog.manage.setting', 'com_easyblog')) {
             JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             JFactory::getApplication()->close();
         }
     }
     $db = JFactory::getDBO();
     $query = 'SELECT `params` FROM ' . $db->quoteName('#__easyblog_configs') . ' WHERE `name` = ' . $db->Quote('config');
     $db->setQuery($query);
     $data = $db->loadResult();
     // Get the file size
     $size = strlen($data);
     header('Content-Description: File Transfer');
     header('Content-Type: application/octet-stream');
     header('Content-Disposition: attachment; filename=settings.json');
     header('Content-Transfer-Encoding: binary');
     header('Expires: 0');
     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
     header('Pragma: public');
     header('Content-Length: ' . $size);
     ob_clean();
     flush();
     echo $data;
     exit;
 }
コード例 #30
0
ファイル: publishtools.php プロジェクト: Tommar/vino2
 function getHTML($blogId)
 {
     $config = EasyBlogHelper::getConfig();
     $my = JFactory::getUser();
     $pdfEnabled = $config->get('layout_enablepdf');
     $printEnabled = $config->get('layout_enableprint');
     // check if pdf enabled
     if ($pdfEnabled == '2') {
         if ($my->id == 0) {
             $pdfEnabled = 0;
         }
     }
     // check if pdf enabled
     if ($printEnabled == '2') {
         if ($my->id == 0) {
             $printEnabled = 0;
         }
     }
     $theme = new CodeThemes();
     $theme->set('blogId', $blogId);
     $theme->set('pdfEnabled', $pdfEnabled);
     $theme->set('printEnabled', $printEnabled);
     $theme->set('pdfLinkProperties', EasyBlogHelper::getPDFlinkProperties());
     $html = $theme->fetch('blog.publishing.tool.php');
     $bookmark = EasyBlogBookmark::getHTML();
     return $html . $bookmark;
 }