本文整理汇总了PHP中EasyBlogHelper::getJConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::getJConfig方法的具体用法?PHP EasyBlogHelper::getJConfig怎么用?PHP EasyBlogHelper::getJConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::getJConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLimit
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: display
function display($tmpl = null)
{
$config = EasyBlogHelper::getConfig();
$jConfig = EasyBlogHelper::getJConfig();
if (!$config->get('main_rss')) {
return;
}
$model = $this->getModel('Featured');
$data = $model->getFeaturedBlog();
$document = JFactory::getDocument();
$document->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=featured');
$document->setTitle(JText::_('COM_EASYBLOG_FEEDS_FEATURED_TITLE'));
$document->setDescription(JText::sprintf('COM_EASYBLOG_FEEDS_FEATURED_DESC', JURI::root()));
if (!empty($data)) {
for ($i = 0; $i < count($data); $i++) {
$row =& $data[$i];
$profile = EasyBlogHelper::getTable('Profile', 'Table');
$profile->load($row->created_by);
$created = EasyBlogDateHelper::dateWithOffSet($row->created);
$formatDate = true;
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
$langCode = EasyBlogStringHelper::getLangCode();
if ($langCode != 'en-GB' || $langCode != 'en-US') {
$formatDate = false;
}
}
// $row->created = ( $formatDate ) ? $created->toFormat( $config->get('layout_dateformat', '%A, %d %B %Y') ) : $created->toFormat();
$row->created = $created->toMySQL();
if ($config->get('main_rss_content') == 'introtext') {
$row->text = !empty($row->intro) ? $row->intro : $row->content;
//read more for feed
$row->text .= '<br /><a href=' . EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $row->id) . '>Read more</a>';
} else {
$row->text = $row->intro . $row->content;
}
$row->text = EasyBlogHelper::getHelper('Videos')->strip($row->text);
$row->text = EasyBlogGoogleAdsense::stripAdsenseCode($row->text);
$category = EasyBlogHelper::getTable('Category', 'Table');
$category->load($row->category_id);
// Assign to feed item
$title = $this->escape($row->title);
$title = html_entity_decode($title);
// load individual item creator class
$item = new JFeedItem();
$item->title = $title;
$item->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $row->id);
$item->description = $row->text;
$item->date = $row->created;
$item->category = $category->title;
$item->author = $profile->getName();
if ($jConfig->get('feed_email') == 'author') {
$item->authorEmail = $profile->user->email;
} else {
$item->authorEmail = $jConfig->get('mailfrom');
}
$document->addItem($item);
}
}
}
示例3: addUser
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: getOffSet16
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: send
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: notify
/**
* 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: getBaseUrl
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: share
/**
* 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 {
//.........这里部分代码省略.........
示例9: isSefEnabled
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:
<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:
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: display
//.........这里部分代码省略.........
$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);
}
示例13: display
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');
}
示例14: send
/**
* 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();
}
}
示例15: rtrim
}
/*
* 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&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