本文整理汇总了PHP中EasyBlogHelper::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::getConfig方法的具体用法?PHP EasyBlogHelper::getConfig怎么用?PHP EasyBlogHelper::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::getConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHTML
/**
* Shares a story through 3rd party oauth clients
*
* @param TableBlog $blog A blog table object
* @param string $type The type of oauth client
*
* @return boolean True on success and false otherwise.
**/
public function getHTML($bloggerid = "")
{
$html = '';
$my = JFactory::getUser();
$config = EasyBlogHelper::getConfig();
if ($config->get('main_jomsocial_messaging') && $my->id != $bloggerid) {
$file_core = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'core.php';
$file_messaging = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_community' . DIRECTORY_SEPARATOR . 'libraries' . DIRECTORY_SEPARATOR . 'messaging.php';
if (file_exists($file_core) && file_exists($file_messaging)) {
require_once $file_core;
require_once $file_messaging;
CMessaging::load();
$html = '<a href="javascript:void(0);" onclick="' . CMessaging::getPopup($bloggerid) . '" class="author-message" title="' . JText::_('COM_EASYBLOG_MESSAGE_AUTHOR') . '"><span>' . JText::_('COM_EASYBLOG_MESSAGE_AUTHOR') . '</span></a>';
}
}
$easysocial = EasyBlogHelper::getHelper('EasySocial');
if ($config->get('integrations_easysocial_conversations') && $easysocial->exists() && $my->id != $bloggerid) {
$easysocial->init();
$user = Foundry::user($bloggerid);
$theme = new CodeThemes();
$theme->set('user', $user);
$html = $theme->fetch('easysocial.conversation.php');
}
return $html;
}
示例2: 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;
}
示例3: bind
/**
* Responsible to perform the blog mappings
*/
public function bind(&$blog)
{
$videoSource = JRequest::getVar('videoSource');
$desc = JRequest::getVar('content');
$title = JRequest::getVar('title', '');
// If title is not set, we use the image name as the title
if ($title == JText::_('COM_EASYBLOG_MICROBLOG_TITLE_OPTIONAL', true) || empty($title)) {
$date = EasyBlogHelper::getHelper('Date')->dateWithOffSet(EasyBlogHelper::getDate()->toMySQL());
$dateString = EasyBlogHelper::getHelper('Date')->toFormat($date, '%d-%m-%Y');
// Define a generic video title
$title = JText::sprintf('COM_EASYBLOG_MICROBLOG_VIDEO_TITLE_GENERIC', $dateString);
}
// Get the default settings
$config = EasyBlogHelper::getConfig();
$width = $config->get('dashboard_video_width');
$height = $config->get('dashboard_video_height');
// Now we need to embed the image URL into the blog content.
$content = '[embed=videolink]{"video":"' . $videoSource . '","width":"' . $width . '","height":"' . $height . '"}[/embed]';
// @task: If user specified some description, append it into the content.
if (!empty($desc)) {
// @task: Replace newlines with <br /> tags since the form is a plain textarea.
$desc = nl2br($desc);
$content .= '<p>' . $desc . '</p>';
}
$blog->set('title', $title);
$blog->set('content', $content);
$blog->set('source', EBLOG_MICROBLOG_VIDEO);
}
示例4: display
/**
* Displays the files and folders that are in the media manager.
*/
public function display($tpl = null)
{
$config = EasyBlogHelper::getConfig();
$document = JFactory::getDocument();
$my = JFactory::getUser();
$app = JFactory::getApplication();
$profile = EasyBlogHelper::getTable('Profile');
$profile->load($my->id);
if ($my->id <= 0) {
echo JText::_('COM_EASYBLOG_NOT_ALLOWED');
exit;
}
$user = JFactory::getUser();
$document->setTitle(JText::_('COM_EASYBLOG_MEDIA_MANAGER'));
// Only allow admin to impersonate anyone.
if (EasyBlogHelper::isSiteAdmin()) {
$user = JFactory::getUser(JRequest::getVar('blogger_id', $my->id));
}
$debug = $config->get('debug_javascript') || JRequest::getVar('ebjsdebug') == 1 ? 'true' : 'false';
$theme = new CodeThemes(true);
$theme->set('debug', $debug);
$theme->set('session', JFactory::getSession());
$theme->set('blogger_id', $user->id);
// @rule: Test if the user is already associated with Flickr
$oauth = EasyBlogHelper::getTable('Oauth');
$associated = $oauth->loadByUser($my->id, EBLOG_OAUTH_FLICKR);
$theme->set('flickrAssociated', $associated);
echo $theme->fetch('media.php');
}
示例5: display
function display($tmpl = null)
{
$config = EasyBlogHelper::getConfig();
$id = JRequest::getCmd('id', '0');
$category = EasyBlogHelper::getTable('Category', 'Table');
$category->load($id);
// private category shouldn't allow to access.
$privacy = $category->checkPrivacy();
if (!$privacy->allowed) {
return;
}
$catIds = array();
$catIds[] = $category->id;
EasyBlogHelper::accessNestedCategoriesId($category, $catIds);
$model = $this->getModel('Blog');
$posts = $model->getBlogsBy('category', $catIds);
$weever = EasyBlogHelper::getHelper('Weever')->getMainFeed();
$weever->set('description', JText::sprintf('COM_EASYBLOG_FEEDS_CATEGORY_DESC', $this->escape($category->title)));
$weever->set('url', EasyBlogRouter::getRoutedUrl('index.php?option=com_easyblog&view=categories&id=' . $id . '&format=weever', false, true));
$weever->set('thisPage', 1);
$weever->set('lastPage', 1);
if ($posts) {
foreach ($posts as $post) {
$blog = EasyBlogHelper::getTable('Blog');
$blog->load($post->id);
$weever->addChild($blog);
}
}
$weever->toJSON(true, JRequest::getVar('callback'));
}
示例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: getHTML
/**
* Retrieves the html codes for the ratings.
*
* @param int $uid The unique id for the item that is being rated
* @param string $type The unique type for the item that is being rated
* @param string $command A textual representation to request user to vote for this item.
* @param string $element A dom element id.
**/
public function getHTML($uid, $type, $command, $elementId, $disabled = false)
{
$config = EasyBlogHelper::getConfig();
if (!$config->get('main_ratings')) {
return false;
}
$language = JFactory::getLanguage();
$language->load('com_easyblog', JPATH_ROOT);
// Add ratings to the page
$document = JFactory::getDocument();
$rating = EasyBlogHelper::getTable('Ratings', 'Table');
$my = JFactory::getUser();
$hash = $my->id > 0 ? '' : JFactory::getSession()->getId();
$voted = $rating->fill($my->id, $uid, $type, $hash);
$locked = $voted || $my->id < 1 && !$config->get('main_ratings_guests') || $disabled;
$model = EasyBlogHelper::getModel('Ratings');
$ratingValue = $model->getRatingValues($uid, $type);
$theme = new CodeThemes();
$theme->set('voted', $voted);
$theme->set('elementId', $elementId);
$theme->set('rating', $ratingValue->ratings);
$theme->set('total', $ratingValue->total);
$theme->set('locked', $locked);
$theme->set('command', $command);
$theme->set('uid', $uid);
$theme->set('type', $type);
return $theme->fetch('ratings.form.php');
}
示例8: getHTML
public static function getHTML($row)
{
$config = EasyBlogHelper::getConfig();
if (!$config->get('main_tweetmeme')) {
return '';
}
$service = $config->get('main_tweetmeme_url');
$style = $config->get('main_tweetmeme_style');
$source = $config->get('main_tweetmeme_rtsource');
$buttonSize = 'social-button-';
switch ($style) {
case 'normal':
$buttonSize .= 'large';
break;
case 'compact':
default:
$buttonSize .= 'small';
break;
}
$url = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $row->id, false, true);
$title = addslashes($row->title);
$placeholder = 'sb-' . rand();
$html = '<div class="social-button ' . $buttonSize . ' tweetmeme"><span id="' . $placeholder . '"></span></div>';
$html .= EasyBlogHelper::addScriptDeclarationBookmarklet('$("#' . $placeholder . '").bookmarklet("tweetMeme", {
service: "' . $service . '",
style: "' . $style . '",
url: "' . $url . '",
title: "' . $title . '",
source: "' . $source . '"
});');
return $html;
}
示例9: sendModerationEmail
public function sendModerationEmail()
{
// @rule: Send email to the team admin's.
$team = EasyBlogHelper::getTable('TeamBlog');
$team->load($this->team_id);
$notification = EasyBlogHelper::getHelper('Notification');
$emails = array();
$config = EasyBlogHelper::getConfig();
if ($config->get('custom_email_as_admin')) {
$notification->getCustomEmails($emails);
} else {
$notification->getAdminEmails($emails);
}
$notification->getTeamAdminEmails($emails, $team->id);
$user = EasyBlogHelper::getTable('Profile');
$user->load($this->user_id);
$date = EasyBlogDateHelper::dateWithOffSet($this->created);
if (count($emails) > 0) {
$data = array('teamName' => $team->title, 'authorAvatar' => $user->getAvatar(), 'authorLink' => EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=blogger&layout=listings&id=' . $user->id, false, true), 'authorName' => $user->getName(), 'requestDate' => EasyBlogDateHelper::toFormat($date, '%A, %B %e, %Y'), 'reviewLink' => EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=dashboard&layout=teamblogs', 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();
if (JFactory::getApplication()->isAdmin() && $sh404exists) {
$data['authorLink'] = JURI::root() . 'index.php?option=com_easyblog&view=blogger&layout=listings&id=' . $user->id;
$data['reviewLink'] = JURI::root() . 'index.php?option=com_easyblog&view=dashboard&layout=teamblogs';
}
$emailTitle = JText::_('COM_EASYBLOG_TEAMBLOG_NEW_REQUEST');
$notification->send($emails, $emailTitle, 'email.teamblog.request', $data);
}
}
示例10: addCard
public static function addCard(&$blog, $rawIntroText)
{
$cfg = EasyBlogHelper::getConfig();
// @rule: Check if user really wants to append the opengraph tags on the headers.
if (!$cfg->get('main_twitter_cards')) {
return false;
}
// Get the absolute permalink for this blog item.
$url = EasyBlogRouter::getRoutedURL('index.php?option=com_easyblog&view=entry&id=' . $blog->id, false, true);
// Get the image of the blog post.
$image = self::getImage($blog, $rawIntroText);
// @task: Get Joomla's document object.
$doc = JFactory::getDocument();
// Add card definition.
$doc->addCustomTag('<meta property="twitter:card" content="summary" />');
$doc->addCustomTag('<meta property="twitter:url" content="' . $url . '" />');
$doc->addCustomTag('<meta property="twitter:title" content="' . $blog->title . '" />');
$text = EasyBlogHelper::stripEmbedTags($rawIntroText);
$text = strip_tags($text);
$text = str_ireplace("\r\n", "", $text);
// Remove any " in the content as this would mess up the headers.
$text = str_ireplace('"', '', $text);
$maxLength = 137;
if (!empty($maxLength)) {
$text = JString::strlen($text) > $maxLength ? JString::substr($text, 0, $maxLength) . '...' : $text;
}
$text = EasyBlogStringHelper::escape($text);
$doc->addCustomTag('<meta property="twitter:description" content="' . $text . '" />');
if ($image) {
$doc->addCustomTag('<meta property="twitter:image" content="' . $image . '"/> ');
}
return true;
}
示例11: getHTML
function getHTML($blogId)
{
$config = EasyBlogHelper::getConfig();
$my = JFactory::getUser();
$pdfEnabled = $config->get('layout_enablepdf');
$printEnabled = $config->get('layout_enableprint');
// check if pdf enabled
if ($pdfEnabled == '2') {
if ($my->id == 0) {
$pdfEnabled = 0;
}
}
// check if pdf enabled
if ($printEnabled == '2') {
if ($my->id == 0) {
$printEnabled = 0;
}
}
$theme = new CodeThemes();
$theme->set('blogId', $blogId);
$theme->set('pdfEnabled', $pdfEnabled);
$theme->set('printEnabled', $printEnabled);
$theme->set('pdfLinkProperties', EasyBlogHelper::getPDFlinkProperties());
$html = $theme->fetch('blog.publishing.tool.php');
$bookmark = EasyBlogBookmark::getHTML();
return $html . $bookmark;
}
示例12: __construct
public function __construct()
{
$lang = JFactory::getLanguage();
$lang->load('com_easyblog', JPATH_ROOT);
$this->exists = $this->exists();
$this->config = EasyBlogHelper::getConfig();
}
示例13: init
/**
* Initiate class variables
*/
public function init()
{
$this->config = EasyBlogHelper::getConfig();
$this->enabled = $this->config->get('main_remotepublishing_mailbox');
$this->server = $this->config->get('main_remotepublishing_mailbox_remotesystemname');
$this->port = $this->config->get('main_remotepublishing_mailbox_port');
$this->mailbox_name = $this->config->get('main_remotepublishing_mailbox_mailboxname');
$this->service = $this->config->get('main_remotepublishing_mailbox_service');
$this->username = $this->config->get('main_remotepublishing_mailbox_username');
$this->password = $this->config->get('main_remotepublishing_mailbox_password');
$this->ssl = $this->config->get('main_remotepublishing_mailbox_ssl');
$this->subject_prefix = $this->config->get('main_remotepublishing_mailbox_prefix');
$this->check_interval = $this->config->get('main_remotepublishing_mailbox_run_interval');
$this->validate_cert = $this->config->get('main_remotepublishing_mailbox_validate_cert');
$this->flags = '';
$this->flags .= $this->service ? '/' . $this->service : '';
$this->flags .= $this->ssl ? '/ssl' : '';
$this->flags .= $this->debug ? '/debug' : '';
$this->flags .= $this->norch ? '/norch' : '';
$this->flags .= $this->validate_cert ? '' : '/novalidate-cert';
//$this->flags .= $this->tls ? '/tls' : '/notls';
$this->flags .= $this->readonly ? '/readonly' : '';
$this->mailbox_params = '{' . $this->server . ':' . $this->port . $this->flags . '}' . $this->mailbox_name;
$this->initiated = true;
}
示例14: get
public function get()
{
$input = JFactory::getApplication()->input;
$model = EasyBlogHelper::getModel('Blog');
$config = EasyBlogHelper::getConfig();
$id = $input->get('id', null, 'INT');
// If we have an id try to fetch the user
$blog = EasyBlogHelper::getTable('Blog');
$blog->load($id);
if (!$id) {
$this->plugin->setResponse($this->getErrorResponse(404, 'Blog id cannot be blank'));
return;
}
if (!$blog->id) {
$this->plugin->setResponse($this->getErrorResponse(404, 'Blog not found'));
return;
}
//$item = EasyBlogHelper::getHelper( 'SimpleSchema' )->mapPost($blog, '<p><br><pre><a><blockquote><strong><h2><h3><em><ul><ol><li><iframe>');
$scm_obj = new EasyBlogSimpleSchema_4();
$item = $scm_obj->mapPost($blog, '<p><br><pre><a><blockquote><strong><h2><h3><em><ul><ol><li><iframe>');
$item->isowner = $blog->created_by == $this->plugin->get('user')->id ? true : false;
$item->allowcomment = $blog->allowcomment;
$item->allowsubscribe = $blog->subscription;
// Tags
$modelPT = EasyBlogHelper::getModel('PostTag');
$item->tags = $modelPT->getBlogTags($blog->id);
//created by vishal - for show extra images
//$item->text = preg_replace('/"images/i', '"'.JURI::root().'images', $item->text );
$item->text = str_replace('href="', 'href="' . JURI::root(), $item->text);
$item->text = str_replace('src="', 'src="' . JURI::root(), $item->text);
$this->plugin->setResponse($item);
}
示例15: __construct
public function __construct(&$subject, $config = array())
{
parent::__construct($subject, $config = array());
$easyblog = JPATH_ROOT . '/administrator/components/com_easyblog/easyblog.php';
if (!JFile::exists($easyblog) || !JComponentHelper::isEnabled('com_easysocial', true)) {
ApiError::raiseError(404, 'Easyblog not installed');
return;
}
// Load Easyblog language & bootstrap files
$language = JFactory::getLanguage();
$language->load('com_easyblog');
require_once JPATH_ROOT . '/components/com_easyblog/constants.php';
require_once EBLOG_HELPERS . '/helper.php';
// Set resources & access
ApiResource::addIncludePath(dirname(__FILE__) . '/easyblog');
$this->setResourceAccess('latest', 'public', 'get');
$this->setResourceAccess('category', 'public', 'get');
$this->setResourceAccess('blog', 'public', 'get');
$this->setResourceAccess('blog', 'public', 'post');
$this->setResourceAccess('comments', 'public', 'get');
$this->setResourceAccess('easyblog_users', 'public', 'get');
$config = EasyBlogHelper::getConfig();
if ($config->get('main_allowguestcomment')) {
$this->setResourceAccess('comments', 'public', 'post');
}
}