コード例 #1
0
ファイル: pagination.php プロジェクト: Tommar/vino2
 public function getLimit($key = 'listlength')
 {
     $app = JFactory::getApplication();
     $default = EasyBlogHelper::getJConfig()->get('list_limit');
     if ($app->isAdmin()) {
         return $default;
     }
     $menus = JFactory::getApplication()->getMenu();
     $menu = $menus->getActive();
     $limit = -2;
     if (is_object($menu)) {
         $params = EasyBlogHelper::getRegistry();
         $params->load($menu->params);
         $limit = $params->get('limit', '-2');
     }
     // if menu did not specify the limit, then we use easyblog setting.
     if ($limit == '-2') {
         // Use default configurations.
         $config = EasyBlogHelper::getConfig();
         // @rule: For compatibility between older versions
         if ($key == 'listlength') {
             $key = 'layout_listlength';
         } else {
             $key = 'layout_pagination_' . $key;
         }
         $limit = $config->get($key);
     }
     // Revert to joomla's pagination if configured to inherit from Joomla
     if ($limit == '0' || $limit == '-1' || $limit == '-2') {
         $limit = $default;
     }
     return $limit;
 }
コード例 #2
0
ファイル: view.feed.php プロジェクト: Tommar/vino2
 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);
         }
     }
 }
コード例 #3
0
 public function addUser($values, $source = 'subscribe')
 {
     $userComponent = 'com_users';
     $config = EB::config();
     $usersConfig = JComponentHelper::getParams('com_users');
     $canRegister = $source == 'comment' ? $config->get('comment_registeroncomment', 0) : $config->get('main_registeronsubscribe', 0);
     if ($usersConfig->get('allowUserRegistration') == '0' || !$canRegister) {
         return JText::_('COM_EASYBLOG_REGISTRATION_DISABLED');
     }
     $username = $values['username'];
     $email = $values['email'];
     $fullname = $values['name'];
     $mainframe = JFactory::getApplication();
     $jConfig = EasyBlogHelper::getJConfig();
     $authorize = JFactory::getACL();
     $document = JFactory::getDocument();
     $user = clone JFactory::getUser();
     $pwdClear = $username . '123';
     $newUsertype = $usersConfig->get('new_usertype', 2);
     $userArr = array('username' => $username, 'name' => $fullname, 'email' => $email, 'password' => $pwdClear, 'password2' => $pwdClear, 'groups' => array($newUsertype), 'gid' => '0', 'id' => '0');
     if (!$user->bind($userArr, 'usertype')) {
         return $user->getError();
     }
     $date = EB::date();
     $user->set('registerDate', $date->toSql());
     //check if user require to activate the acct
     $useractivation = $usersConfig->get('useractivation');
     if ($useractivation == '1' || $useractivation == '2') {
         jimport('joomla.user.helper');
         $user->set('activation', md5(JUserHelper::genRandomPassword()));
         $user->set('block', '1');
     }
     JPluginHelper::importPlugin('user');
     $user->save();
     // Send registration confirmation mail
     $password = $pwdClear;
     $password = preg_replace('/[\\x00-\\x1F\\x7F]/', '', $password);
     //Disallow control chars in the email
     //load com_user language file
     $lang = JFactory::getLanguage();
     $lang->load('com_users');
     // Get the user id.
     $userId = $user->id;
     $this->sendMail($user, $password);
     return $userId;
 }
コード例 #4
0
ファイル: date.php プロジェクト: Tommar/vino2
 public static function getOffSet16($numberOnly = false)
 {
     jimport('joomla.form.formfield');
     $user = JFactory::getUser();
     $config = EasyBlogHelper::getConfig();
     $jConfig = EasyBlogHelper::getJConfig();
     // temporary ignore the dst in joomla 1.6
     if ($user->id != 0) {
         $userTZ = $user->getParam('timezone');
     }
     if (empty($userTZ)) {
         $userTZ = $jConfig->get('offset');
     }
     if ($numberOnly) {
         $newTZ = new DateTimeZone($userTZ);
         $dateTime = new DateTime("now", $newTZ);
         $offset = $newTZ->getOffset($dateTime) / 60 / 60;
         return $offset;
     } else {
         //timezone string
         return $userTZ;
     }
 }
コード例 #5
0
ファイル: ajax.php プロジェクト: Tommar/vino2
 public function send()
 {
     $jCfg = EasyBlogHelper::getJConfig();
     if ($jCfg->get('debug')) {
         if (ob_get_length() !== false) {
             while (@ob_end_clean()) {
             }
             if (function_exists('ob_clean')) {
                 @ob_clean();
             }
         }
     }
     header('Content-type: text/x-json; UTF-8');
     require_once EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'json.php';
     $json = new Services_JSON();
     $callback = JRequest::getVar('callback');
     if (isset($callback)) {
         echo $callback . '(' . $json->encode($this->commands) . ');';
     } else {
         echo $json->encode($this->commands);
     }
     exit;
 }
コード例 #6
0
ファイル: mailchimp.php プロジェクト: alexinteam/joomla3
 /**
  * Creates a new campaign and send it immediately.
  *
  * @since	3.7
  * @access	public
  */
 public function notify($emailTitle, $emailData, &$blog)
 {
     JFactory::getLanguage()->load('com_easyblog', JPATH_ROOT);
     $config = EasyBlogHelper::getConfig();
     if (!function_exists('curl_init')) {
         echo JText::_('COM_EASYBLOG_CURL_DOES_NOT_EXIST');
     }
     if (!$config->get('subscription_mailchimp')) {
         return;
     }
     $listId = $config->get('subscription_mailchimp_listid');
     if (!$listId) {
         return;
     }
     require_once EBLOG_CLASSES . '/MCAPI.class.php';
     $api = new MCAPI($this->key);
     $type = 'regular';
     $jConfig = EasyBlogHelper::getJConfig();
     $defaultEmailFrom = EasyBlogHelper::getJoomlaVersion() >= '1.6' ? $jConfig->get('mailfrom') : $jConfig->get('mailfrom');
     $defaultFromName = EasyBlogHelper::getJoomlaVersion() >= '1.6' ? $jConfig->get('fromname') : $jConfig->get('fromname');
     $fromEmail = $config->get('mailchimp_from_email', $defaultEmailFrom);
     $fromName = $config->get('mailchimp_from_name', $defaultFromName);
     $opts = array();
     $opts['list_id'] = $listId;
     $opts['from_email'] = $fromEmail;
     $opts['from_name'] = $fromName;
     $opts['subject'] = $emailTitle;
     $opts['tracking'] = array('opens' => true, 'html_clicks' => true, 'text_clicks' => false);
     $opts['authenticate'] = true;
     $opts['title'] = $blog->title;
     $content = array('html' => self::getTemplateContents('email.blog.new', $emailData, 'html'), 'text' => self::getTemplateContents('email.blog.new', $emailData, 'text'));
     $cid = $api->campaignCreate($type, $opts, $content);
     // Send this now!
     if (!$api->errorCode) {
         $api->campaignSendNow($cid);
     }
 }
コード例 #7
0
ファイル: helper.php プロジェクト: Tommar/vino2
 public static function getBaseUrl()
 {
     static $url;
     if (isset($url)) {
         return $url;
     }
     if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
         $uri = JFactory::getURI();
         $language = $uri->getVar('lang', 'none');
         $app = JFactory::getApplication();
         $config = EasyBlogHelper::getJConfig();
         $router = $app->getRouter();
         $url = rtrim(JURI::base(), '/');
         $url = $url . '/index.php?option=com_easyblog&lang=' . $language;
         if ($router->getMode() == JROUTER_MODE_SEF && JPluginHelper::isEnabled("system", "languagefilter")) {
             $rewrite = $config->get('sef_rewrite');
             $base = str_ireplace(JURI::root(true), '', $uri->getPath());
             $path = $rewrite ? $base : JString::substr($base, 10);
             $path = JString::trim($path, '/');
             $parts = explode('/', $path);
             if ($parts) {
                 // First segment will always be the language filter.
                 $language = reset($parts);
             } else {
                 $language = 'none';
             }
             if ($rewrite) {
                 $url = rtrim(JURI::root(), '/') . '/' . $language . '/?option=com_easyblog';
                 $language = 'none';
             } else {
                 $url = rtrim(JURI::root(), '/') . '/index.php/' . $language . '/?option=com_easyblog';
             }
         }
     } else {
         $url = rtrim(JURI::root(), '/') . '/index.php?option=com_easyblog';
     }
     $menu = JFactory::getApplication()->getmenu();
     if (!empty($menu)) {
         $item = $menu->getActive();
         if (isset($item->id)) {
             $url .= '&Itemid=' . $item->id;
         }
     }
     // Some SEF components tries to do a 301 redirect from non-www prefix to www prefix.
     // Need to sort them out here.
     $currentURL = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
     if (!empty($currentURL)) {
         // When the url contains www and the current accessed url does not contain www, fix it.
         if (stristr($currentURL, 'www') === false && stristr($url, 'www') !== false) {
             $url = str_ireplace('www.', '', $url);
         }
         // When the url does not contain www and the current accessed url contains www.
         if (stristr($currentURL, 'www') !== false && stristr($url, 'www') === false) {
             $url = str_ireplace('://', '://www.', $url);
         }
     }
     return $url;
 }
コード例 #8
0
ファイル: helper.php プロジェクト: Tommar/vino2
 /**
  * Shares a new content on Facebook
  **/
 public function share($blog, $message = '', $oauth, $useSystem = false)
 {
     $config = EasyBlogHelper::getConfig();
     $source = $config->get('integrations_facebook_source');
     $content = isset($blog->{$source}) && !empty($blog->{$source}) ? $blog->{$source} : $blog->intro . $blog->content;
     $content = EasyBlogHelper::getHelper('Videos')->strip($content);
     $image = '';
     // @rule: Ensure that only public posts are allowed
     if ($blog->private != 0) {
         return false;
     }
     // @rule: Try to get the blog image.
     if ($blog->getImage()) {
         $image = $blog->getImage()->getSource('frontpage');
     }
     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, '/');
             }
         }
     }
     $maxContentLen = $config->get('integrations_facebook_blogs_length');
     $text = strip_tags($content);
     if (!empty($maxContentLen)) {
         $text = JString::strlen($text) > $maxContentLen ? JString::substr($text, 0, $maxContentLen) . '...' : $text;
     }
     $url = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $blog->id, false, true);
     // If blog post is being posted from the back end and SH404 is installed, we should just use the raw urls.
     $sh404exists = EasyBlogRouter::isSh404Enabled();
     $mainframe = JFactory::getApplication();
     if ($mainframe->isAdmin() && $sh404exists) {
         $url = rtrim(JURI::root(), '/') . '/index.php?option=com_easyblog&view=entry&id=' . $blog->id;
     }
     preg_match('/expires=(.*)/i', $this->_access_token, $expires);
     if (isset($expires[1])) {
         $this->_access_token = str_ireplace('&expires=' . $expires[1], '', $this->_access_token);
     }
     // Remove adsense codes
     require_once EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'adsense.php';
     $text = EasyBlogGoogleAdsense::stripAdsenseCode($text);
     $jConfig = EasyBlogHelper::getJConfig();
     $params = array('link' => $url, 'name' => $blog->title, 'description' => $text, 'message' => $blog->title, 'access_token' => $this->_access_token);
     if (empty($image)) {
         $params['picture'] = rtrim(JURI::root(), '/') . '/components/com_easyblog/assets/images/default_facebook.png';
         $params['source'] = rtrim(JURI::root(), '/') . '/components/com_easyblog/assets/images/default_facebook.png';
     } else {
         $params['picture'] = $image;
         $params['source'] = $image;
     }
     // @rule: For system messages, we need to see if there's any pages associated.
     if ($oauth->system && $useSystem) {
         if ($config->get('integrations_facebook_impersonate_page') || $config->get('integrations_facebook_impersonate_group')) {
             if ($config->get('integrations_facebook_impersonate_page')) {
                 $pages = JString::trim($config->get('integrations_facebook_page_id'));
                 $pages = explode(',', $pages);
                 $total = count($pages);
                 // @rule: Test if there are any pages at all the user can access
                 $accounts = parent::api('/me/accounts', array('access_token' => $this->_access_token));
                 if (is_array($accounts) && isset($accounts['data'])) {
                     for ($i = 0; $i < $total; $i++) {
                         foreach ($accounts['data'] as $page) {
                             if ($page['id'] == $pages[$i]) {
                                 $params['access_token'] = $page['access_token'];
                                 $query = parent::api('/' . $page['id'] . '/feed', 'post', $params);
                             }
                         }
                     }
                 }
             }
             if ($config->get('integrations_facebook_impersonate_group')) {
                 $groupsId = JString::trim($config->get('integrations_facebook_group_id'));
                 $groupsId = explode(',', $groupsId);
                 $total = count($groupsId);
                 // @rule: Test if there are any groups at all the user can access
                 $accounts = parent::api('/me/groups', 'GET', array('access_token' => $this->_access_token));
                 $params['access_token'] = $this->_access_token;
                 if (is_array($accounts) && isset($accounts['data'])) {
                     for ($i = 0; $i < $total; $i++) {
                         foreach ($accounts['data'] as $group) {
                             if ($group['id'] == $groupsId[$i]) {
                                 $query = parent::api('/' . $group['id'] . '/feed', 'post', $params);
                             }
                         }
                     }
                 }
             }
         } else {
             // @rule: If this is just a normal posting, just post it on their page.
             $query = parent::api('/me/feed', 'post', $params);
         }
     } else {
         // @rule: If this is just a normal posting, just post it on their page.
         $query = parent::api('/me/feed', 'post', $params);
     }
     $success = isset($query['id']) ? true : false;
     return $success;
 }
コード例 #9
0
ファイル: router.php プロジェクト: alexinteam/joomla3
 public static function isSefEnabled()
 {
     $jConfig = EasyBlogHelper::getJConfig();
     $isSef = false;
     $isSef = self::isSh404Enabled();
     // if sh404sef not enabled, we check on joomla
     if (!$isSef) {
         $isSef = $jConfig->get('sef');
     }
     return $isSef;
 }
コード例 #10
0
					<td width="300" class="key">
					<span class="editlinktip" title="<?php 
echo JText::_('COM_EASYBLOG_MAILCHIMP_SENDER_EMAIL');
?>
">
						<?php 
echo JText::_('COM_EASYBLOG_MAILCHIMP_SENDER_EMAIL');
?>
					</span>
					</td>
					<td valign="top" class="value">
						<div class="has-tip">
							<div class="tip"><i></i><?php 
echo JText::_('COM_EASYBLOG_MAILCHIMP_SENDER_EMAIL_DESC');
?>
</div>
							<input type="text" name="mailchimp_from_email" value="<?php 
echo $this->config->get('mailchimp_from_email', EasyBlogHelper::getJConfig()->get('mailfrom'));
?>
" />
						</div>
					</td>
				</tr>
                </tbody>
			</table>
			</fieldset>
		</div>

	</div>
</div>
コード例 #11
0
ファイル: media.php プロジェクト: Tommar/vino2
				initialPlace: "user:<?php 
echo $system->my->id;
?>
",

				acl: {
					canUpload: <?php 
echo $this->acl->rules->upload_image ? 'true' : 'false';
?>
				},				

				layout: {

					iconMaxLoadThread: <?php 
echo EasyBlogHelper::getJConfig()->get('debug') ? 1 : 8;
?>
,
					maxIconPerPage: <?php 
echo $system->config->get('main_media_manager_items_per_page');
?>
				}
			},

			exporter: {
				image: {

					<?php 
if ($system->config->get('main_media_manager_image_panel_enable_lightbox')) {
    ?>
					zoom: "original",
コード例 #12
0
ファイル: view.feed.php プロジェクト: Tommar/vino2
 function display($tmpl = null)
 {
     $config = EasyBlogHelper::getConfig();
     $jConfig = EasyBlogHelper::getJConfig();
     if (!$config->get('main_rss')) {
         return;
     }
     require_once EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'date.php';
     require_once EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'helper.php';
     require_once EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'string.php';
     require_once EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'adsense.php';
     $sort = JRequest::getCmd('sort', $config->get('layout_postorder'));
     $model = $this->getModel('Blog');
     $data = $model->getBlogsBy('', '', $sort, 0, EBLOG_FILTER_PUBLISHED, null, true);
     $document = JFactory::getDocument();
     $document->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=latest');
     $document->setTitle(JText::_('COM_EASYBLOG_FEEDS_LATEST_TITLE'));
     $document->setDescription(JText::sprintf('COM_EASYBLOG_FEEDS_LATEST_DESC', JURI::root()));
     if (!empty($data)) {
         $modelPT = $this->getModel('PostTag');
         for ($i = 0; $i < count($data); $i++) {
             $row =& $data[$i];
             $blog = EasyBlogHelper::getTable('Blog');
             $blog->load($row->id);
             $user = JFactory::getUser($row->created_by);
             $profile = EasyBlogHelper::getTable('Profile', 'Table');
             $profile->load($user->id);
             $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;
                 $row->text .= '<br /><a href=' . EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $row->id) . '>' . JText::_('COM_EASYBLOG_READ_MORE') . '</a>';
             } else {
                 $row->text = $row->intro . $row->content;
                 //add read more in feed
             }
             $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);
             $image = '';
             if ($blog->getImage()) {
                 $image = '<img src="' . $blog->getImage()->getSource('frontpage') . '" />';
             }
             // 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 = $image . $row->text;
             $item->date = $row->created;
             $item->category = $category->title;
             $item->author = $profile->getName();
             if ($jConfig->get('feed_email') != 'none') {
                 if ($jConfig->get('feed_email') == 'author') {
                     $item->authorEmail = $user->email;
                 } else {
                     $item->authorEmail = $jConfig->get('mailfrom');
                 }
             }
             $document->addItem($item);
         }
     }
 }
コード例 #13
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.blog', 'com_easyblog')) {
             JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             JFactory::getApplication()->close();
         }
     }
     // Load the front end language file.
     $lang = JFactory::getLanguage();
     $lang->load('com_easyblog', JPATH_ROOT);
     // Initial variables.
     $doc = JFactory::getDocument();
     $my = JFactory::getUser();
     $app = JFactory::getApplication();
     $acl = EasyBlogACLHelper::getRuleSet();
     $config = EasyBlogHelper::getConfig();
     // Load the JEditor object
     $editor = JFactory::getEditor($config->get('layout_editor', 'tinymce'));
     // Enable datetime picker
     EasyBlogDateHelper::enableDateTimePicker();
     // required variable initiation.
     $meta = null;
     $blogContributed = array();
     $tags = null;
     $external = '';
     $extGroupId = '';
     // Event id state.
     $externalEventId = '';
     //Load blog table
     $blogId = JRequest::getVar('blogid', '');
     $blog = EasyBlogHelper::getTable('Blog', 'Table');
     $blog->load($blogId);
     $tmpBlogData = EasyBlogHelper::getSession('tmpBlogData');
     $loadFromSession = false;
     // Initialize default tags.
     $blog->tags = array();
     if (isset($tmpBlogData)) {
         $loadFromSession = true;
         $blog->bind($tmpBlogData);
         // reprocess the date offset here.
         $tzoffset = EasyBlogDateHelper::getOffSet();
         if (!empty($blog->created)) {
             $date = EasyBlogHelper::getDate($blog->created, $tzoffset);
             $blog->created = $date->toMySQL();
         }
         if (!empty($blog->publish_up) && $blog->publish_up != '0000-00-00 00:00:00') {
             $date = EasyBlogHelper::getDate($blog->publish_up, $tzoffset);
             $blog->publish_up = $date->toMySQL();
         }
         if (!empty($blog->publish_down) && $blog->publish_down != '0000-00-00 00:00:00') {
             $date = EasyBlogHelper::getDate($blog->publish_down, $tzoffset);
             $blog->publish_down = $date->toMySQL();
         }
         //bind the content from previous form
         $blog->content = $tmpBlogData['write_content'];
         if (isset($tmpBlogData['tags'])) {
             $blog->tags = $this->bindTags($tmpBlogData['tags']);
         }
         // metas
         $meta = new stdClass();
         $meta->id = '';
         $meta->keywords = isset($tmpBlogData['keywords']) ? $tmpBlogData['keywords'] : '';
         $meta->description = isset($tmpBlogData['description']) ? $tmpBlogData['description'] : '';
         if (isset($tmpBlogData['blog_contribute'])) {
             $blogContributed = $this->bindContribute($tmpBlogData['blog_contribute']);
         }
         $contributionSource = isset($tmpBlogData['blog_contribute_source']) ? $tmpBlogData['blog_contribute_source'] : '';
         if (!empty($contributionSource) && $contributionSource != 'easyblog') {
             $external = true;
             $extGroupId = $tmpBlogData['blog_contribute'];
             $externalEventId = $tmpBlogData['blog_contribute'];
         }
         $blog->unsaveTrackbacks = '';
         if (!empty($tmpBlogData['trackback'])) {
             $blog->unsaveTrackbacks = $tmpBlogData['trackback'];
         }
     }
     $draft = EasyBlogHelper::getTable('Draft', 'Table');
     $draft_id = JRequest::getVar('draft_id', '');
     $isDraft = false;
     $pending_approval = JRequest::getVar('approval', '');
     if (!empty($draft_id)) {
         //first check if the logged in user have the required acl or not.
         if (empty($acl->rules->add_entry) || empty($acl->rules->publish_entry) || empty($acl->rules->manage_pending)) {
             $message = JText::_('COM_EASYBLOG_BLOGS_BLOG_NO_PERMISSION_TO_CREATE_BLOG');
             $app->enqueueMessage($message, 'error');
             $app->redirect(JRoute::_('index.php?option=com_easyblog&view=blogs', false));
         }
         $draft->load($draft_id);
         $blog->load($draft->entry_id);
         $blog->bind($draft);
         $blog->tags = $this->bindTags(explode(',', $draft->tags));
         $blog->newtags = $blog->tags;
         $tags = $blog->tags;
         // metas
         $meta = new stdClass();
         $meta->id = '';
         $meta->keywords = $draft->metakey;
         $meta->description = $draft->metadesc;
         $blog->unsaveTrackbacks = '';
         if (!empty($draft->trackbacks)) {
             $blog->unsaveTrackbacks = $draft->trackbacks;
         }
         if ($draft->blog_contribute) {
             $blogContributed = $this->bindContribute($draft->blog_contribute);
         }
         $blog->set('id', $draft->entry_id);
         $blogId = $blog->id;
         $isDraft = true;
     }
     // set page title
     if (!empty($blogId)) {
         $doc->setTitle(JText::_('COM_EASYBLOG_BLOGS_EDIT_POST') . ' - ' . $config->get('main_title'));
         $editorTitle = JText::_('COM_EASYBLOG_BLOGS_EDIT_POST');
         // check if previous status is not Draft
         if ($blog->published != POST_ID_DRAFT) {
             $isEdit = true;
         }
     } else {
         $doc->setTitle(JText::_('COM_EASYBLOG_BLOGS_NEW_POST'));
         $editorTitle = JText::_('COM_EASYBLOG_BLOGS_NEW_POST');
         if (!$loadFromSession && !$isDraft) {
             // set to 'publish' for new blog in backend.
             $blog->published = $config->get('main_blogpublishing', '1');
         }
     }
     $author = null;
     if (!empty($blog->created_by)) {
         $creator = JFactory::getUser($blog->created_by);
         $author = EasyBlogHelper::getTable('Profile', 'Table');
         $author->setUser($creator);
         unset($creator);
     } else {
         $creator = JFactory::getUser($my->id);
         $author = EasyBlogHelper::getTable('Profile', 'Table');
         $author->setUser($creator);
         unset($creator);
     }
     //Get tag
     if (!$loadFromSession && !$isDraft) {
         $tagModel = EasyBlogHelper::getModel('PostTag', true);
         $tags = $tagModel->getBlogTags($blogId);
     }
     $tagsArray = array();
     if ($tags) {
         foreach ($tags as $data) {
             $tagsArray[] = $data->title;
         }
         $tagsString = implode(",", $tagsArray);
     }
     //prepare initial blog settings.
     $isPrivate = $config->get('main_blogprivacy', '0');
     $allowComment = $config->get('main_comment', 1);
     $allowSubscribe = $config->get('main_subscription', 1);
     $showFrontpage = $config->get('main_newblogonfrontpage', 0);
     $sendEmails = $config->get('main_sendemailnotifications', 0);
     $isSiteWide = isset($blog->issitewide) ? $blog->issitewide : '1';
     $tbModel = EasyBlogHelper::getModel('TeamBlogs', true);
     $teamBlogJoined = $tbModel->getTeamJoined($author->id);
     if (!empty($blog->id)) {
         $isPrivate = $blog->private;
         $allowComment = $blog->allowcomment;
         $allowSubscribe = $blog->subscription;
         $showFrontpage = $blog->frontpage;
         $sendEmails = $blog->send_notification_emails;
         //get user teamblog
         $teamBlogJoined = $tbModel->getTeamJoined($blog->created_by);
         if (!$isDraft) {
             $blogContributed = $tbModel->getBlogContributed($blog->id);
         }
     }
     if ($loadFromSession || $isDraft) {
         $isPrivate = $blog->private;
         $allowComment = $blog->allowcomment;
         $allowSubscribe = $blog->subscription;
         $showFrontpage = $blog->frontpage;
         $sendEmails = $blog->send_notification_emails;
     }
     if (count($blogContributed) > 0 && $blogContributed) {
         for ($i = 0; $i < count($teamBlogJoined); $i++) {
             $joined = $teamBlogJoined[$i];
             if ($joined->team_id == $blogContributed->team_id) {
                 $joined->selected = 1;
                 continue;
             }
         }
     }
     //get all tags ever created.
     $newTagsModel = EasyBlogHelper::getModel('Tags');
     if (isset($blog->newtags)) {
         $blog->newtags = array_merge($blog->newtags, $newTagsModel->getTags());
     } else {
         $blog->newtags = $newTagsModel->getTags();
     }
     //get tags used in this blog post
     if (!$loadFromSession && !$isDraft && $blogId) {
         $tagsModel = EasyBlogHelper::getModel('PostTag');
         $blog->tags = $tagsModel->getBlogTags($blogId);
     }
     //@task: List all trackbacks
     $trackbacksModel = EasyBlogHelper::getModel('TrackbackSent');
     $trackbacks = $trackbacksModel->getSentTrackbacks($blogId);
     // get meta tags
     if (!$loadFromSession && !$isDraft) {
         $metaModel = EasyBlogHelper::getModel('Metas');
         $meta = $metaModel->getPostMeta($blogId);
     }
     //perform some title string formatting
     $blog->title = $this->escape($blog->title);
     $blogger_id = !isset($blog->created_by) ? $my->id : $blog->created_by;
     $defaultCategory = empty($blog->category_id) ? EasyBlogHelper::getDefaultCategoryId() : $blog->category_id;
     $category = EasyBlogHelper::getTable('Category');
     $category->load($defaultCategory);
     $content = $blog->intro;
     // Append the readmore if necessary
     if (!empty($blog->intro) && !empty($blog->content)) {
         $content .= '<hr id="system-readmore" />';
     }
     $content .= $blog->content;
     //check if this is a external group contribution.
     $blog_contribute_source = 'easyblog';
     $external = false;
     $extGroupId = EasyBlogHelper::getHelper('Groups')->getGroupContribution($blog->id);
     $externalEventId = EasyBlogHelper::getHelper('Event')->getContribution($blog->id);
     $extGroupName = '';
     if (!empty($extGroupId)) {
         $external = $extGroupId;
         $blog_contribute_source = EasyBlogHelper::getHelper('Groups')->getGroupSourceType();
         $extGroupName = EasyBlogHelper::getHelper('Groups')->getGroupContribution($blog->id, $blog_contribute_source, 'name');
     }
     if (!empty($externalEventId)) {
         $external = $externalEventId;
         $blog_contribute_source = EasyBlogHelper::getHelper('Event')->getSourceType();
     }
     //site wide or team contribution
     $teamblogModel = EasyBlogHelper::getModel('TeamBlogs');
     $teams = !empty($blog->created_by) ? $teamblogModel->getTeamJoined($blog->created_by) : $teamblogModel->getTeamJoined($my->id);
     $this->assignRef('teams', $teams);
     $this->assignRef('isDraft', $isDraft);
     $joomlaVersion = EasyBlogHelper::getJoomlaVersion();
     $my = JFactory::getUser();
     $blogger_id = $my->id;
     $nestedCategories = '';
     $categoryselecttype = $config->get('layout_dashboardcategoryselect') == 'multitier' ? 'select' : $config->get('layout_dashboardcategoryselect');
     if ($categoryselecttype == 'select') {
         $nestedCategories = EasyBlogHelper::populateCategories('', '', 'select', 'category_id', $blog->category_id, true, true, false);
     }
     // Load media manager and get info about the files.
     require_once EBLOG_CLASSES . DIRECTORY_SEPARATOR . 'mediamanager.php';
     $mediamanager = new EasyBlogMediaManager();
     $userFolders = $mediamanager->getInfo(EasyBlogMediaManager::getAbsolutePath('', 'user'), 'folders');
     $userFiles = $mediamanager->getInfo(EasyBlogMediaManager::getAbsolutePath('', 'user'), 'files');
     $sharedFolders = $mediamanager->getInfo(EasyBlogMediaManager::getAbsolutePath('', 'shared'), 'folders');
     $sharedFiles = $mediamanager->getInfo(EasyBlogMediaManager::getAbsolutePath('', 'shared'), 'files');
     // @rule: Test if the user is already associated with Flickr
     $oauth = EasyBlogHelper::getTable('Oauth');
     $associated = $oauth->loadByUser($my->id, EBLOG_OAUTH_FLICKR);
     $jConfig = EasyBlogHelper::getJConfig();
     $this->set('flickrAssociated', $associated);
     $this->assignRef('userFolders', $userFolders);
     $this->assignRef('userFiles', $userFiles);
     $this->assignRef('sharedFolders', $sharedFolders);
     $this->assignRef('sharedFiles', $sharedFiles);
     $this->assignRef('jConfig', $jConfig);
     $this->assignRef('my', $my);
     $this->assignRef('content', $content);
     $this->assignRef('category', $category);
     $this->assignRef('blogger_id', $blogger_id);
     $this->assignRef('joomlaversion', $joomlaVersion);
     $this->assignRef('isEdit', $isEdit);
     $this->assignRef('editorTitle', $editorTitle);
     $this->assignRef('blog', $blog);
     $this->assignRef('meta', $meta);
     $this->assignRef('editor', $editor);
     $this->assignRef('tagsString', $tagsString);
     $this->assignRef('acl', $acl);
     $this->assignRef('isPrivate', $isPrivate);
     $this->assignRef('allowComment', $allowComment);
     $this->assignRef('subscription', $allowSubscribe);
     $this->assignRef('frontpage', $showFrontpage);
     $this->assignRef('trackbacks', $trackbacks);
     $this->assignRef('author', $author);
     $this->assignRef('nestedCategories', $nestedCategories);
     $this->assignRef('teamBlogJoined', $teamBlogJoined);
     $this->assignRef('isSiteWide', $isSiteWide);
     $this->assignRef('draft', $draft);
     $this->assignRef('config', $config);
     $this->assignRef('pending_approval', $pending_approval);
     $this->assignRef('external', $external);
     $this->assignRef('extGroupId', $extGroupId);
     $this->assignRef('externalEventId', $externalEventId);
     $this->assignRef('extGroupName', $extGroupName);
     $this->assignRef('blog_contribute_source', $blog_contribute_source);
     $this->assignRef('categoryselecttype', $categoryselecttype);
     $this->assignRef('send_notification_emails', $sendEmails);
     parent::display($tpl);
 }
コード例 #14
0
ファイル: view.html.php プロジェクト: Tommar/vino2
 function display($tmpl = null)
 {
     // set meta tags for latest post
     EasyBlogHelper::setMeta(META_ID_SEARCH, META_TYPE_SEARCH);
     $document = JFactory::getDocument();
     $document->setTitle(EasyBlogHelper::getPageTitle(JText::_('COM_EASYBLOG_SEARCH_PAGE_TITLE')));
     if (!EasyBlogRouter::isCurrentActiveMenu('search')) {
         $this->setPathway(JText::_('COM_EASYBLOG_SEARCH_BREADCRUMB'));
     }
     $query = JRequest::getVar('query');
     $Itemid = JRequest::getInt('Itemid');
     if (empty($query)) {
         $posts = array();
         $pagination = '';
     } else {
         $model = $this->getModel('Search');
         $result = $model->getData();
         if (count($result) > 0) {
             // strip out all the media code
             for ($i = 0; $i < count($result); $i++) {
                 $row =& $result[$i];
                 // strip videos
                 $row->intro = EasyBlogHelper::getHelper('Videos')->strip($row->intro);
                 $row->content = EasyBlogHelper::getHelper('Videos')->strip($row->content);
                 // strip gallery
                 $row->intro = EasyBlogHelper::getHelper('Gallery')->strip($row->intro);
                 $row->content = EasyBlogHelper::getHelper('Gallery')->strip($row->content);
                 // strip jomsocial album
                 $row->intro = EasyBlogHelper::getHelper('Album')->strip($row->intro);
                 $row->content = EasyBlogHelper::getHelper('Album')->strip($row->content);
                 // strip audio
                 $row->intro = EasyBlogHelper::getHelper('Audio')->strip($row->intro);
                 $row->content = EasyBlogHelper::getHelper('Audio')->strip($row->content);
             }
         }
         $posts = EasyBlogHelper::formatBlog($result);
         $pagination = $model->getPagination();
     }
     if (count($posts) > 0) {
         $searchworda = preg_replace('#\\xE3\\x80\\x80#s', ' ', $query);
         $searchwords = preg_split("/\\s+/u", $searchworda);
         $needle = $searchwords[0];
         $searchwords = array_unique($searchwords);
         for ($i = 0; $i < count($posts); $i++) {
             $row = $posts[$i];
             $content = preg_replace('/\\s+/', ' ', strip_tags($row->content));
             $pattern = '#(';
             $x = 0;
             foreach ($searchwords as $k => $hlword) {
                 $pattern .= $x == 0 ? '' : '|';
                 $pattern .= preg_quote($hlword, '#');
                 $x++;
             }
             $pattern .= ')#iu';
             $row->title = preg_replace($pattern, '<span class="search-highlight">\\0</span>', $row->title);
             $row->content = preg_replace($pattern, '<span class="search-highlight">\\0</span>', JString::substr(strip_tags($row->content), 0, 250));
         }
     }
     $jConfig = EasyBlogHelper::getJConfig();
     $theme = new CodeThemes();
     $theme->set('jConfig', $jConfig);
     $theme->set('query', $query);
     $theme->set('posts', $posts);
     $theme->set('pagination', $pagination);
     $theme->set('Itemid', $Itemid);
     echo $theme->fetch('search.php');
 }
コード例 #15
0
ファイル: view.feed.php プロジェクト: Tommar/vino2
 function display($tmpl = null)
 {
     $config = EasyBlogHelper::getConfig();
     $jConfig = EasyBlogHelper::getJConfig();
     if (!$config->get('main_rss')) {
         return;
     }
     $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;
     }
     if ($category->id == 0) {
         $category->title = JText::_('COM_EASYBLOG_UNCATEGORIZED');
     }
     //get the nested categories
     $category->childs = null;
     EasyBlogHelper::buildNestedCategories($category->id, $category);
     $linkage = '';
     EasyBlogHelper::accessNestedCategories($category, $linkage, '0', '', 'link', ', ');
     $catIds = array();
     $catIds[] = $category->id;
     EasyBlogHelper::accessNestedCategoriesId($category, $catIds);
     $category->nestedLink = $linkage;
     $model = $this->getModel('Blog');
     $sort = JRequest::getCmd('sort', $config->get('layout_postorder'));
     $data = $model->getBlogsBy('category', $catIds, $sort);
     $document = JFactory::getDocument();
     $document->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=categories&id=' . $id . '&layout=listings');
     $document->setTitle($this->escape($category->title));
     $document->setDescription(JText::sprintf('COM_EASYBLOG_FEEDS_CATEGORY_DESC', $this->escape($category->title)));
     if (empty($data)) {
         return;
     }
     for ($i = 0; $i < count($data); $i++) {
         $row =& $data[$i];
         $blog = EasyBlogHelper::getTable('Blog');
         $blog->load($row->id);
         $user = JFactory::getUser($row->created_by);
         $profile = EasyBlogHelper::getTable('Profile', 'Table');
         $profile->load($user->id);
         $created = EasyBlogHelper::getDate($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;
         } else {
             $row->text = $row->intro . $row->content;
         }
         $row->text = EasyBlogHelper::getHelper('Videos')->strip($row->text);
         $row->text = EasyBlogGoogleAdsense::stripAdsenseCode($row->text);
         $image = '';
         if ($blog->getImage()) {
             $image = '<img src="' . $blog->getImage()->getSource('frontpage') . '" />';
         }
         // load individual item creator class
         $item = new JFeedItem();
         $item->title = html_entity_decode($this->escape($row->title));
         $item->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $row->id);
         $item->description = $image . $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);
     }
 }
コード例 #16
0
ファイル: notification.php プロジェクト: Tommar/vino2
 /**
  * Sends an email out.
  **/
 public function send($emails, $emailTitle, $template, $data)
 {
     $config = EasyBlogHelper::getConfig();
     $app = JFactory::getApplication();
     $jConfig = EasyBlogHelper::getJConfig();
     $defaultEmailFrom = EasyBlogHelper::getJoomlaVersion() >= '1.6' ? $jConfig->get('mailfrom') : $jConfig->get('mailfrom');
     $defaultFromName = EasyBlogHelper::getJoomlaVersion() >= '1.6' ? $jConfig->get('fromname') : $jConfig->get('fromname');
     $fromEmail = $config->get('notification_from_email', $defaultEmailFrom);
     $fromName = $config->get('notification_from_name', $defaultFromName);
     if (empty($fromEmail)) {
         $fromEmail = $defaultEmailFrom;
     }
     if (empty($fromName)) {
         $fromName = $defaultFromName;
     }
     // @rule: Make sure there are only unique emails so we don't send duplicates.
     foreach ($emails as $email => $obj) {
         if ($obj->unsubscribe) {
             $data['unsubscribeLink'] = $obj->unsubscribe;
         }
         // Retrieve the template's contents.
         $output = $this->getTemplateContents($template, $data);
         $mailq = EasyBlogHelper::getTable('MailQueue');
         $mailq->mailfrom = $fromEmail;
         $mailq->fromname = $fromName;
         $mailq->recipient = $obj->email;
         $mailq->subject = $emailTitle;
         $mailq->body = $output;
         $mailq->created = EasyBlogHelper::getDate()->toMySQL();
         $mailq->store();
     }
 }
コード例 #17
0
ファイル: view.feed.php プロジェクト: Tommar/vino2
 function display($tmpl = null)
 {
     $config = EasyBlogHelper::getConfig();
     $jConfig = EasyBlogHelper::getJConfig();
     if (!$config->get('main_rss')) {
         return;
     }
     $mainframe = JFactory::getApplication();
     $menuParams = $mainframe->getParams();
     $date = EasyBlogHelper::getDate();
     $sort = 'latest';
     $model = $this->getModel('Archive');
     $year = $model->getArchiveMinMaxYear();
     $defaultYear = $menuParams->get('es_archieve_year', empty($year['maxyear']) ? $date->toFormat('%Y') : $year['maxyear']);
     $defaultMonth = $menuParams->get('es_archieve_month', $date->toFormat('%m'));
     $archiveYear = JRequest::getVar('archiveyear', $defaultYear, 'REQUEST');
     $archiveMonth = JRequest::getVar('archivemonth', $defaultMonth, 'REQUEST');
     $data = EasyBlogHelper::formatBlog($model->getArchive($archiveYear, $archiveMonth));
     $pagination = $model->getPagination();
     $params = $mainframe->getParams('com_easyblog');
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     $document = JFactory::getDocument();
     $viewDate = EasyBlogHelper::getDate($archiveYear . '-' . $archiveMonth . '-01');
     $document->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=archive');
     $document->setTitle(JText::sprintf('COM_EASYBLOG_FEEDS_ARCHIVE_TITLE', $viewDate->toFormat('%B %Y')));
     $document->setDescription(JText::sprintf('COM_EASYBLOG_FEEDS_ARCHIVE_DESC', $viewDate->toFormat('%B %Y')));
     if (!empty($data)) {
         for ($i = 0; $i < count($data); $i++) {
             $row =& $data[$i];
             $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;
                 }
             }
             //$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;
                 $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);
             $image = '';
             if ($blog->getImage()) {
                 $image = '<img src="' . $blog->getImage()->getSource('frontpage') . '" />';
             }
             $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 = $image . $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);
         }
     }
 }
コード例 #18
0
ファイル: view.feed.php プロジェクト: Tommar/vino2
 function display($tmpl = null)
 {
     $config = EasyBlogHelper::getConfig();
     $jConfig = EasyBlogHelper::getJConfig();
     if (!$config->get('main_rss')) {
         return;
     }
     $id = JRequest::getInt('id', 0);
     $blogger = EasyBlogHelper::getTable('Profile', 'Table');
     $blogger->load($id);
     $model = $this->getModel('Blog');
     $data = $model->getBlogsBy('blogger', $blogger->id);
     $document = JFactory::getDocument();
     $document->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=blogger&id=' . $id . '&layout=listings');
     $document->setTitle(JText::sprintf('COM_EASYBLOG_FEEDS_BLOGGER_TITLE', $blogger->getName()));
     $document->setDescription(strip_tags($blogger->description));
     if (!empty($data)) {
         $modelPT = $this->getModel('PostTag');
         for ($i = 0; $i < count($data); $i++) {
             $row =& $data[$i];
             $blog = EasyBlogHelper::getTable('Blog');
             $blog->load($row->id);
             $profile = EasyBlogHelper::getTable('Profile', 'Table');
             $user = JFactory::getUser($row->created_by);
             $profile->load($user->id);
             $created = EasyBlogHelper::getDate($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;
                 $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);
             $image = '';
             if ($blog->getImage()) {
                 $image = '<img src="' . $blog->getImage()->getSource('frontpage') . '" />';
             }
             $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 = $image . $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);
         }
     }
 }
コード例 #19
0
ファイル: easyblog.php プロジェクト: alexinteam/joomla3
}
/*
 * Processing email batch sending.
 */
$config = EasyBlogHelper::getConfig();
if ($config->get('main_mailqueueonpageload')) {
    $mailq = EasyBlogHelper::getMailQueue();
    $mailq->sendOnPageLoad($config->get('main_mail_total'));
}
// @task: Publish scheduled posts
EasyBlogHelper::processScheduledPost();
// @task: Unpublish scheduled post.
EasyBlogHelper::unPublishPost();
$mainframe = JFactory::getApplication();
if (JRequest::getWord('rsd') == 'RealSimpleDiscovery') {
    $config = EasyBlogHelper::getJConfig();
    $title = $config->get('sitename');
    $link = rtrim(JURI::root(), '/') . '/index.php?option=com_easyblog';
    $xmlrpc = rtrim(JURI::root(), '/') . '/index.php?option=com_easyblog&amp;controller=xmlrpc';
    header('Content-Type: text/xml; charset=UTF-8', true);
    echo '<?xml version="1.0" encoding="UTF-8"?' . '>';
    ?>
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
	<service>
		<engineName>EasyBlog!</engineName>
		<engineLink>www.stackideas.com</engineLink>
		<siteName><?php 
    echo $title;
    ?>
</siteName>
		<homePageLink><?php 
コード例 #20
0
    if ($system->config->get('layout_search', 1)) {
        ?>
					<li class="toolbar-item toolbar-search <?php 
        echo $views->search;
        ?>
">
						<form method="get" action="<?php 
        echo EasyBlogRouter::_('index.php?option=com_easyblog&view=search&layout=parsequery');
        ?>
">
							<input id="ezblog-search" type="text" name="query" class="input text" alt="query" autocomplete="off" />
							<button class="submit-search" type="submit"><i class="fa fa-search"></i></button>


							<?php 
        if (EasyBlogHelper::getJConfig()->get('sef') != 1) {
            ?>
							<input type="hidden" name="option" value="com_easyblog" />
							<input type="hidden" name="view" value="search" />
							<input type="hidden" name="layout" value="parsequery" />
							<input type="hidden" name="Itemid" value="<?php 
            echo $Itemid;
            ?>
" />
							<?php 
        }
        ?>

						</form>
					</li>
					<?php