本文整理汇总了PHP中EasyBlogHelper::getJoomlaVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::getJoomlaVersion方法的具体用法?PHP EasyBlogHelper::getJoomlaVersion怎么用?PHP EasyBlogHelper::getJoomlaVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::getJoomlaVersion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: confirmAutopost
public function confirmAutopost($type, $id)
{
$ajax = new Ejax();
$options = new stdClass();
$options->title = JText::_('COM_EASYBLOG_AUTOPOST_DIALOG_INFO');
$action = EasyBlogHelper::getJoomlaVersion() >= '1.6' ? 'Joomla.submitbutton(\'autopost\');' : 'submitbutton(\'autopost\')';
ob_start();
?>
<p><?php
echo JText::sprintf('COM_EASYBLOG_AUTOPOST_DIALOG_DESC', ucfirst($type));
?>
</p>
<div class="dialog-actions">
<input type="button" onclick="ejax.closedlg();" name="edialog-cancel" id="edialog-cancel" class="button" value="<?php
echo JText::_('COM_EASYBLOG_CANCEL_BUTTON');
?>
">
<input type="button" class="button" value="<?php
echo JText::_('COM_EASYBLOG_SHARE_BUTTON');
?>
" onclick="<?php
echo $action;
?>
">
</div>
<?php
$options->content = ob_get_contents();
ob_end_clean();
$ajax->script('$("#adminForm input[name=autopost_type]").val("' . $type . '");');
$ajax->script('$("#adminForm input[name=autopost_selected]").val("' . $id . '");');
$ajax->dialog($options);
$ajax->send();
}
示例2: display
function display($tpl = null)
{
// @rule: Test for user access if on 1.6 and above
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
if (!JFactory::getUser()->authorise('easyblog.manage.report', '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();
$result = $this->get('Data');
$pagination = $this->get('Pagination');
$reports = array();
if ($result) {
foreach ($result as $row) {
$report = EasyBlogHelper::getTable('Report');
$report->bind($row);
$reports[] = $report;
}
}
$this->assign('pagination', $pagination);
$this->assign('reports', $reports);
parent::display($tpl);
}
示例3: set
public function set($key, $value)
{
if (EasyBlogHelper::getJoomlaVersion() >= '2.5') {
return $this->registry->set($key, $value);
}
return $this->registry->setValue($key, $value);
}
示例4: get
public function get($key, $default = null)
{
if (EasyBlogHelper::getJoomlaVersion() >= '3.0') {
return $this->config->get($key, $default);
}
return $this->config->getValue($key, $default);
}
示例5: export
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;
}
示例6: sendOnPageLoad
function sendOnPageLoad($max = 5)
{
$db = EasyBlogHelper::db();
$config = EasyBlogHelper::getConfig();
$sendHTML = $config->get('main_mailqueuehtmlformat', 0);
// Delete existing mails that has already been sent.
$query = 'DELETE FROM ' . $db->nameQuote('#__easyblog_mailq') . ' WHERE ' . $db->nameQuote('status') . '=' . $db->Quote(1) . ' AND DATEDIFF(NOW(), `created`) >= 7';
$db->setQuery($query);
$db->Query();
$query = 'SELECT `id` FROM `#__easyblog_mailq` WHERE `status` = 0';
$query .= ' ORDER BY `created` ASC';
$query .= ' LIMIT ' . $max;
$db->setQuery($query);
$result = $db->loadObjectList();
if (!empty($result)) {
foreach ($result as $mail) {
$mailq = EasyBlogHelper::getTable('MailQueue', 'Table');
$mailq->load($mail->id);
// update the status to 1 == proccessed
$mailq->status = 1;
if ($mailq->store()) {
// Send emails out.
if (EasyBlogHelper::getJoomlaVersion() >= '3.0') {
$mail = JFactory::getMailer();
$mail->sendMail($mailq->mailfrom, $mailq->fromname, $mailq->recipient, $mailq->subject, $mailq->body, $sendHTML);
} else {
JUtility::sendMail($mailq->mailfrom, $mailq->fromname, $mailq->recipient, $mailq->subject, $mailq->body, $sendHTML);
}
}
}
}
}
示例7: display
public function display($tmpl = null)
{
JPluginHelper::importPlugin('easyblog');
$dispatcher = JDispatcher::getInstance();
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$config = EasyBlogHelper::getConfig();
//for trigger
$params = $mainframe->getParams('com_easyblog');
$joomlaVersion = EasyBlogHelper::getJoomlaVersion();
$blogId = $this->input->get('id', 0, 'int');
if (empty($blogId)) {
return JError::raiseError(404, JText::_('COM_EASYBLOG_BLOG_NOT_FOUND'));
}
$my = JFactory::getUser();
$blog = EB::table('Blog');
$blog->load($blogId);
$post = EB::post($blogId);
// Check if blog is password protected.
$protected = $this->isProtected($post);
if ($protected !== false) {
return;
}
// If the blog post is already deleted, we shouldn't let it to be accessible at all.
if ($post->isTrashed()) {
return JError::raiseError(404, JText::_('COM_EASYBLOG_ENTRY_BLOG_NOT_FOUND'));
}
// Check if the blog post is trashed
if (!$post->isPublished() && $this->my->id != $post->created_by && !EB::isSiteAdmin()) {
return JError::raiseError(404, JText::_('COM_EASYBLOG_ENTRY_BLOG_NOT_FOUND'));
}
// Check for team's privacy
$allowed = $this->checkTeamPrivacy($post);
if ($allowed === false) {
return JError::raiseError(404, JText::_('COM_EASYBLOG_TEAMBLOG_MEMBERS_ONLY'));
}
// Check if the blog post is accessible.
$accessible = $post->isAccessible();
if (!$accessible->allowed) {
echo $accessible->error;
return;
}
// Format the post
$post = EB::formatter('entry', $post);
$tags = $post->getTags();
$theme = EB::template();
$theme->set('post', $post);
$theme->set('tags', $tags);
$blogHtml = $theme->output('site/blogs/entry/pdf');
$pageTitle = EasyBlogHelper::getPageTitle($config->get('main_title'));
$document->setTitle($post->title . $pageTitle);
$document->setName($post->getPermalink());
// Fix phoca pdf plugin.
if (method_exists($document, 'setArticleText')) {
$document->setArticleText($blogHtml);
}
echo $blogHtml;
return;
}
示例8: display
function display($tmpl = null)
{
$config = EasyBlogHelper::getConfig();
$jConfig = EasyBlogHelper::getJConfig();
if (!$config->get('main_rss')) {
return;
}
$model = $this->getModel('Featured');
$data = $model->getFeaturedBlog();
$document = JFactory::getDocument();
$document->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=featured');
$document->setTitle(JText::_('COM_EASYBLOG_FEEDS_FEATURED_TITLE'));
$document->setDescription(JText::sprintf('COM_EASYBLOG_FEEDS_FEATURED_DESC', JURI::root()));
if (!empty($data)) {
for ($i = 0; $i < count($data); $i++) {
$row =& $data[$i];
$profile = EasyBlogHelper::getTable('Profile', 'Table');
$profile->load($row->created_by);
$created = EasyBlogDateHelper::dateWithOffSet($row->created);
$formatDate = true;
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
$langCode = EasyBlogStringHelper::getLangCode();
if ($langCode != 'en-GB' || $langCode != 'en-US') {
$formatDate = false;
}
}
// $row->created = ( $formatDate ) ? $created->toFormat( $config->get('layout_dateformat', '%A, %d %B %Y') ) : $created->toFormat();
$row->created = $created->toMySQL();
if ($config->get('main_rss_content') == 'introtext') {
$row->text = !empty($row->intro) ? $row->intro : $row->content;
//read more for feed
$row->text .= '<br /><a href=' . EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $row->id) . '>Read more</a>';
} else {
$row->text = $row->intro . $row->content;
}
$row->text = EasyBlogHelper::getHelper('Videos')->strip($row->text);
$row->text = EasyBlogGoogleAdsense::stripAdsenseCode($row->text);
$category = EasyBlogHelper::getTable('Category', 'Table');
$category->load($row->category_id);
// Assign to feed item
$title = $this->escape($row->title);
$title = html_entity_decode($title);
// load individual item creator class
$item = new JFeedItem();
$item->title = $title;
$item->link = EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $row->id);
$item->description = $row->text;
$item->date = $row->created;
$item->category = $category->title;
$item->author = $profile->getName();
if ($jConfig->get('feed_email') == 'author') {
$item->authorEmail = $profile->user->email;
} else {
$item->authorEmail = $jConfig->get('mailfrom');
}
$document->addItem($item);
}
}
}
示例9: get
/**
* Creates a new registry object.
*/
public function get($contents = '')
{
$version = EasyBlogHelper::getJoomlaVersion();
if ($version >= '1.6') {
return JFactory::getSession()->getFormToken();
}
return JUtility::getToken();
}
示例10: __construct
public function __construct()
{
$version = EasyBlogHelper::getJoomlaVersion();
$className = 'EasyBlogDBJoomla15';
if ($version >= '2.5') {
$className = 'EasyBlogDBJoomla30';
}
$this->helper = new $className();
}
示例11: nameQuote
public function nameQuote($str)
{
$db = EasyBlogHelper::db();
$version = EasyBlogHelper::getJoomlaVersion();
if ($version >= '2.5') {
return $db->quoteName($str);
}
return $db->nameQuote($str);
}
示例12: mapPost
public function mapPost($row, $strip_tags = '', $text_length = 0, $skip = array())
{
$config = EasyBlogHelper::getConfig();
$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;
}
}
$blog->created = $created->toMySQL();
$blog->text = $row->intro . $row->content;
$config->set('max_video_width', 320);
$config->set('max_video_width', 180);
$blog->text = EasyBlogHelper::getHelper('Videos')->processVideos($blog->text);
$blog->text = EasyBlogGoogleAdsense::stripAdsenseCode($blog->text);
$category = EasyBlogHelper::getTable('Category', 'Table');
$category->load($row->category_id);
$item = new PostSimpleSchema();
$item->textplain = $blog->text;
// @TODO : Take care of a case when strip tags and length are used together
if ($strip_tags) {
$item->textplain = strip_tags($blog->text, $strip_tags);
}
if ($text_length > 0) {
$pos = JString::strpos(strip_tags($item->textplain), ' ', $text_length);
$item->textplain = JString::substr(strip_tags($blog->text), 0, $pos);
}
$image_data = json_decode($blog->image);
$item->postid = $blog->id;
$item->title = $blog->title;
$item->text = $blog->text;
$item->textplain = $this->sanitize($item->textplain);
$item->image = $blog->getImage();
$item->image->url = $image_data->url;
$item->created_date = $blog->created;
$item->created_date_elapsed = EasyBlogDateHelper::getLapsedTime($blog->created);
$item->author->name = $profile->nickname;
$item->author->photo = JURI::root() . $profile->avatar;
$item->category->categoryid = $category->id;
$item->category->title = $category->title;
$item->url = JURI::root() . trim(EasyBlogRouter::_('index.php?option=com_easyblog&view=entry&id=' . $blog->id), '/');
// Tags
$modelPT = EasyBlogHelper::getModel('PostTag');
$item->tags = $modelPT->getBlogTags($blog->id);
foreach ($skip as $v) {
unset($item->{$v});
}
return $item;
}
示例13: toFormat
public function toFormat($format = '%Y-%m-%d %H:%M:%S')
{
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
if (JString::stristr($format, '%') !== false) {
$format = EasyBlogHelper::getHelper('date')->strftimeToDate($format);
}
return $this->date->format($format);
} else {
return $this->date->toFormat($format);
}
}
示例14: __construct
/**
* Creates a new instance of the Joomla parser.
*
* @since 1.0
* @access public
*/
public function __construct($contents = '', $isFile = false)
{
$this->version = EasyBlogHelper::getJoomlaVersion();
if ($this->version >= '3.0') {
$parser = JFactory::getXML($contents, $isFile);
} else {
$parser = JFactory::getXMLParser('Simple');
$parser->loadString($contents);
}
$this->parser = $parser;
return $this;
}
示例15: getMembersCount
function getMembersCount($teamId)
{
$db = EasyBlogHelper::db();
$query = 'SELECT COUNT(1) FROM `#__easyblog_team_users` ' . 'WHERE `team_id`=' . $db->Quote($teamId);
$db->setQuery($query);
$total = $db->loadResult();
// Now we need to calculate the group members.
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
$query = 'SELECT COUNT(1) ' . 'FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote('#__easyblog_team_groups') . ' AS a ' . 'INNER JOIN ' . EasyBlogHelper::getHelper('SQL')->nameQuote('#__user_usergroup_map') . ' AS b ' . 'ON a.`group_id` = b.`group_id` ' . 'WHERE a.' . EasyBlogHelper::getHelper('SQL')->nameQuote('team_id') . ' = ' . $db->Quote($teamId);
} else {
$query = 'SELECT COUNT(c.`value`) ' . 'FROM ' . EasyBlogHelper::getHelper('SQL')->nameQuote('#__easyblog_team_groups') . ' AS a ' . 'LEFT JOIN ' . EasyBlogHelper::getHelper('SQL')->nameQuote('#__core_acl_groups_aro_map') . ' AS b ' . 'ON a.`group_id` = b.`group_id` ' . 'INNER JOIN ' . EasyBlogHelper::getHelper('SQL')->nameQuote('#__core_acl_aro') . ' AS c ' . 'ON b.' . EasyBlogHelper::getHelper('SQL')->nameQuote('aro_id') . ' = c.' . EasyBlogHelper::getHelper('SQL')->nameQuote('id') . 'WHERE a.' . EasyBlogHelper::getHelper('SQL')->nameQuote('team_id') . ' = ' . $db->Quote($teamId);
}
$db->setQuery($query);
$groupsTotal = $db->loadResult();
if (!$groupsTotal) {
return $total;
}
return $total + $groupsTotal;
}