当前位置: 首页>>代码示例>>PHP>>正文


PHP EB::getConfig方法代码示例

本文整理汇总了PHP中EB::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP EB::getConfig方法的具体用法?PHP EB::getConfig怎么用?PHP EB::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EB的用法示例。


在下文中一共展示了EB::getConfig方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getBlogComment

 /**
  * Retrieves a list of comments from a blog post
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function getBlogComment($id, $limitFrontEnd = 0, $sort = 'asc', $lite = false)
 {
     $db = EB::db();
     $config = EB::getConfig();
     $sort = $config->get('comment_sort', 'asc');
     if ($lite) {
         $query = 'SELECT a.* FROM `#__easyblog_comment` a';
         $query .= ' INNER JOIN #__users AS c ON a.`created_by` = c.`id`';
         $query .= ' WHERE a.`post_id` = ' . $db->Quote($id);
         $query .= ' AND a.`published` = 1';
     } else {
         $query = 'SELECT a.*, (count(b.id) - 1) AS `depth` FROM `#__easyblog_comment` AS a';
         $query .= ' INNER JOIN `#__easyblog_comment` AS b';
         $query .= ' LEFT JOIN `#__users` AS c ON a.`created_by` = c.`id`';
         $query .= ' WHERE a.`post_id` = ' . $db->Quote($id);
         $query .= ' AND b.`post_id` = ' . $db->Quote($id);
         $query .= ' AND a.`published` = 1';
         $query .= ' AND b.`published` = 1';
         $query .= ' AND a.`lft` BETWEEN b.`lft` AND b.`rgt`';
         $query .= ' GROUP BY a.`id`';
     }
     // prepare the query to get total comment
     $queryTotal = 'SELECT COUNT(1) FROM (';
     $queryTotal .= $query;
     $queryTotal .= ') AS x';
     // continue the query.
     $limit = $this->getState('limit');
     $limitstart = $this->getState('limitstart');
     switch ($sort) {
         case 'desc':
             $query .= ' ORDER BY a.`rgt` desc';
             break;
         default:
             $query .= ' ORDER BY a.`lft` asc';
             break;
     }
     if ($limitFrontEnd > 0) {
         $query .= ' LIMIT ' . $limitFrontEnd;
     } else {
         $query .= ' LIMIT ' . $limitstart . ',' . $limit;
     }
     if ($limitFrontEnd <= 0) {
         $db->setQuery($queryTotal);
         $this->_total = $db->loadResult();
         jimport('joomla.html.pagination');
         $this->_pagination = EB::pagination($this->_total, $limitstart, $limit);
     }
     // the actual content sql
     $db->setQuery($query);
     $result = $db->loadObjectList();
     if (!$result) {
         return $result;
     }
     // Format the comments
     $result = EB::comment()->format($result);
     return $result;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:65,代码来源:blog.php

示例2: __construct

 public function __construct()
 {
     $this->config = EB::getConfig();
     $this->jconfig = JFactory::getConfig();
     $this->app = JFactory::getApplication();
     $this->doc = JFactory::getDocument();
     $this->my = JFactory::getUser();
     $this->input = EB::request();
     $this->info = EB::info();
     $this->theme = EB::getTemplate(null, array('view' => $this, 'admin' => true));
     if ($this->doc->getType() == 'ajax') {
         $this->ajax = EB::ajax();
     }
     parent::__construct();
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:15,代码来源:views.php

示例3: getTotalComment

 /**
  * Method to get total comment post currently iregardless the status and associated blogs.
  *
  * @access public
  * @return integer
  */
 function getTotalComment($userId = 0)
 {
     $db = EB::db();
     $config = EB::getConfig();
     if ($config->get('comment_compojoom')) {
         $file = JPATH_ROOT . '/administrator/components/com_comment/plugin/com_easyblog/josc_com_easyblog.php';
         if (JFile::exists($file)) {
             require_once $file;
             $query = 'SELECT COUNT(1) FROM ' . $db->nameQuote('#__comment') . ' ' . 'WHERE ' . $db->nameQuote('component') . ' = ' . $db->Quote('com_easyblog') . ' ' . 'AND ' . $db->nameQuote('userid') . ' = ' . $db->Quote($userId) . ' ' . 'AND ' . $db->nameQuote('published') . ' = ' . $db->Quote(1);
             $db->setQuery($query);
             return $db->loadResult();
         }
     }
     $where = array();
     $query = 'SELECT COUNT(1) FROM ' . $db->nameQuote('#__easyblog_comment');
     if (!empty($userId)) {
         $where[] = '`created_by` = ' . $db->Quote($userId);
     }
     $extra = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
     $query = $query . $extra;
     $db->setQuery($query);
     $result = $db->loadResult();
     return empty($result) ? 0 : $result;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:30,代码来源:comment.php

示例4: migrateK2Images

 public function migrateK2Images(&$item, &$blog, $author)
 {
     jimport('joomla.filesystem.file');
     $name = md5('Image' . $item->id);
     $path = JPATH_ROOT . '/media/k2/items/src/' . $name . '.jpg';
     $config = EB::getConfig();
     $configStorage = str_ireplace('\\', '/', $config->get('main_image_path'));
     $newPath = JPATH_ROOT . '/' . rtrim($configStorage, '/') . '/' . $author->id;
     if (!JFolder::exists($newPath)) {
         JFolder::create($newPath);
     }
     if (JFile::exists($path)) {
         // Copy the full scaled image
         $large = JPATH_ROOT . '/media/k2/items/cache/' . $name . '_XL.jpg';
         $targetLarge = $newPath . '/' . $name . '.jpg';
         $targetURL = rtrim(JURI::root(), '/') . '/' . str_ireplace('\\', '/', $configStorage) . '/' . $author->id;
         $largeSrc = rtrim(JURI::root(), '/') . '/' . str_ireplace('\\', '/', $configStorage) . '/' . $author->id . '/' . $name . '.jpg';
         $file = getimagesize($large);
         $file['name'] = basename($large);
         $file['tmp_name'] = $large;
         $media = EB::mediamanager();
         $result = $media->upload($file, 'user:' . $author->id);
         $result = json_encode($result);
         $blog->image = $result;
     }
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:26,代码来源:k2.php

示例5: getLikesAuthors

 public static function getLikesAuthors($contentId, $type, $userId)
 {
     $db = EB::db();
     $config = EB::getConfig();
     $result = new stdClass();
     $displayFormat = $config->get('layout_nameformat');
     $displayName = '';
     switch ($displayFormat) {
         case "name":
             $displayName = 'a.name';
             break;
         case "username":
             $displayName = 'a.username';
             break;
         case "nickname":
         default:
             $displayName = 'b.nickname';
             break;
     }
     $query = 'select a.id as `user_id`, c.id, ' . $displayName . ' as `displayname`';
     $query .= ' FROM `#__users` as a';
     $query .= '  inner join `#__easyblog_users` as b';
     $query .= '    on a.id = b.id';
     $query .= '  inner join `#__easyblog_likes` as c';
     $query .= '    on a.id = c.created_by';
     $query .= ' where c.content_id = ' . $db->Quote($contentId);
     $query .= ' and c.`type` = ' . $db->Quote($type);
     $query .= ' order by c.id desc';
     $db->setQuery($query);
     $list = $db->loadObjectList();
     if (count($list) <= 0) {
         $result->string = '';
         $result->count = 0;
         return $result;
     }
     // else continue here
     $onwerInside = false;
     $names = array();
     for ($i = 0; $i < count($list); $i++) {
         if ($list[$i]->user_id == $userId) {
             $onwerInside = true;
             array_unshift($names, JText::_('COM_EASYBLOG_YOU'));
         } else {
             $names[] = $list[$i]->displayname;
         }
     }
     $max = 3;
     $total = count($names);
     $break = 0;
     if ($total == 1) {
         $break = $total;
     } else {
         if ($max >= $total) {
             $break = $total - 1;
         } elseif ($max < $total) {
             $break = $max;
         }
     }
     $main = array_slice($names, 0, $break);
     $remain = array_slice($names, $break);
     $stringFront = implode(", ", $main);
     $returnString = '';
     if (count($remain) > 1) {
         $returnString = JText::sprintf('COM_EASYBLOG_AND_OTHERS_LIKE_THIS', $stringFront, count($remain));
     } else {
         if (count($remain) == 1) {
             $returnString = JText::sprintf('COM_EASYBLOG_AND_LIKE_THIS', $stringFront, $remain[0]);
         } else {
             if (EasyBlogHelper::isLoggedIn() && $onwerInside) {
                 $returnString = JText::sprintf('COM_EASYBLOG_LIKE_THIS_SINGULAR', $stringFront);
             } else {
                 $returnString = JText::sprintf('COM_EASYBLOG_LIKE_THIS_PLURAL', $stringFront);
             }
         }
     }
     $result->count = $total;
     $result->string = $returnString;
     return $result;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:79,代码来源:easyblog.php

示例6: validate

 /**
  * Validates the comment
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function validate($type)
 {
     $config = EB::getConfig();
     if ($config->get('comment_requiretitle') && $type == 'title') {
         return JString::strlen($this->title) != 0;
     }
     if ($type == 'name') {
         return JString::strlen($this->name) != 0;
     }
     if ($type == 'email') {
         return JString::strlen($this->email) != 0;
     }
     if ($type == 'comment') {
         return JString::strlen($this->comment) != 0;
     }
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:25,代码来源:comment.php

示例7: processItems

 private static function processItems($posts, &$params)
 {
     $config = EB::getConfig();
     $results = array();
     $posts = EB::formatter('list', $posts);
     foreach ($posts as $data) {
         $row = EB::post($data->id);
         $row->bind($data);
         $row->author = EB::user($row->created_by);
         $row->commentCount = EB::getCommentCount($row->id);
         $row->featuredImage = '';
         if ($params->get('showfeatureimage', 1)) {
             $row->featuredImage = self::getFeaturedImage($row, $params);
         }
         self::prepareTooltipContent($row, $params);
         $results[] = $row;
     }
     return $results;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:19,代码来源:helper.php

示例8: migrateZooImages

 public function migrateZooImages($path, &$blog, $author)
 {
     jimport('joomla.filesystem.file');
     $path = JPATH_ROOT . '/' . $path;
     $config = EB::getConfig();
     $configStorage = str_ireplace('\\', '/', $config->get('main_image_path'));
     $newPath = JPATH_ROOT . '/' . rtrim($configStorage, '/') . '/' . $author->id;
     if (!JFolder::exists($newPath)) {
         JFolder::create($newPath);
     }
     if (JFile::exists($path)) {
         // Copy the full scaled image
         $large = $path;
         $targetURL = rtrim(JURI::root(), '/') . '/' . str_ireplace('\\', '/', $configStorage) . '/' . $author->id;
         $file = getimagesize($large);
         $file['name'] = basename($large);
         $file['tmp_name'] = $large;
         $result = EB::mediamanager()->upload($file, 'user:' . $author->id);
         if (isset($result->type)) {
             $relativeImagePath = $newPath . '/' . $file['name'];
             $result->path = $relativeImagePath;
         }
         $result = json_encode($result);
         $blog->image = $result;
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:26,代码来源:zoo.php

示例9: migrateBloggerImage

 function migrateBloggerImage($image, $userid, $content)
 {
     jimport('joomla.utilities.error');
     jimport('joomla.filesystem.file');
     jimport('joomla.filesystem.folder');
     $config = EB::getConfig();
     $main_image_path = $config->get('main_image_path');
     $main_image_path = rtrim($main_image_path, '/');
     $rel_upload_path = $main_image_path . '/' . $userid;
     $userUploadPath = JPATH_ROOT . DIRECTORY_SEPARATOR . str_ireplace('/', DIRECTORY_SEPARATOR, $main_image_path . DIRECTORY_SEPARATOR . $userid);
     $folder = JPath::clean($userUploadPath);
     $dir = $userUploadPath . DIRECTORY_SEPARATOR;
     $tmp_dir = JPATH_ROOT . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR;
     if (!JFolder::exists($dir)) {
         JFolder::create($dir);
     }
     //now let get the image from remove url.
     $segments = explode('/', $image);
     $fileName = $segments[count($segments) - 1];
     $fileName = JFile::makesafe($fileName);
     $tmpFileName = $tmp_dir . $fileName;
     $file['name'] = $fileName;
     $file['tmp_name'] = $tmpFileName;
     // write to JOOMLA tmp folder
     file_put_contents($tmpFileName, file_get_contents($image));
     $media = EB::mediamanager();
     $result = $media->upload($file, 'user:' . $userid);
     @JFile::delete($file['tmp_name']);
     if (isset($result->type)) {
         $relativeImagePath = $rel_upload_path . '/' . $file['name'];
         // lets replace the image from the content to this uploaded one.
         $content = str_replace($image, $relativeImagePath, $content);
     }
     return $content;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:35,代码来源:blogger_xml.php

示例10: _getAdsenseTemplate

 private static function _getAdsenseTemplate($bloggerId, $alignment = '')
 {
     $config = EB::getConfig();
     $my = JFactory::getUser();
     if ($config->get('integration_google_adsense_display_access') == 'members' && $my->id == 0) {
         return '';
     }
     if ($config->get('integration_google_adsense_display_access') == 'guests' && $my->id > 0) {
         return '';
     }
     if (!$config->get('integration_google_adsense_enable')) {
         return '';
     }
     if ($config->get('integration_google_adsense_centralized')) {
         $adminAdsenseCode = $config->get('integration_google_adsense_code');
         $adsenseResponsiveCode = $config->get('integration_google_adsense_responsive_code');
         $adminAdsenseDisplay = $config->get('integration_google_adsense_display');
         if (!empty($adminAdsenseCode) && !$config->get('integration_google_adsense_responsive')) {
             $defaultCode = $adminAdsenseCode;
             $defaultDisplay = $adminAdsenseDisplay;
         } else {
             $defaultCode = $adsenseResponsiveCode;
             $defaultDisplay = $adminAdsenseDisplay;
         }
     }
     //blogger adsense
     //now we check whether user enabled adsense or not.
     $bloggerAdsense = EB::table('Adsense');
     $bloggerAdsense->load($bloggerId);
     if (!empty($bloggerAdsense->code) && $bloggerAdsense->published) {
         $defaultCode = $bloggerAdsense->code;
         $defaultDisplay = $bloggerAdsense->display;
     }
     // @task: If the user did not enter any adsense codes, fallback to the site admin's code
     if (empty($defaultCode)) {
         $adminAdsenseCode = $config->get('integration_google_adsense_code');
         $adminAdsenseDisplay = $config->get('integration_google_adsense_display');
         if (!empty($adminAdsenseCode)) {
             $defaultCode = $adminAdsenseCode;
             $defaultDisplay = $adminAdsenseDisplay;
         }
     }
     if ($defaultDisplay != 'userspecified') {
         return '';
     }
     $responsive = $config->get('integration_google_adsense_responsive');
     $theme = EB::template();
     $theme->set('code', $defaultCode);
     $align = '';
     if (!empty($alignment)) {
         $align = $alignment == 'right' ? ' alignright' : ' alignleft';
     }
     $theme->set('alignment', $align);
     $namespace = 'site/adsense/responsive';
     if (!$responsive) {
         $namespace = 'site/adsense/code';
     }
     $adsenseHTML = $theme->output($namespace);
     return $adsenseHTML;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:60,代码来源:adsense.php

示例11: deletePostComments

 /**
  * Delete comments from particular post
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function deletePostComments($postId)
 {
     $db = EB::db();
     $config = EB::getConfig();
     // if komento exist and check the integration option
     $komentoEngine = JPATH_ROOT . '/components/com_komento/helpers/helper.php';
     if (JFile::exists($komentoEngine) && $config->get('comment_komento') == true) {
         require_once $komentoEngine;
         $model = Komento::getModel('comments');
         // delete comment based on the article id
         $model->deleteArticleComments('com_easyblog', $postId);
     }
     $query = array();
     $query[] = 'DELETE FROM ' . $db->quoteName('#__easyblog_comment');
     $query[] = 'WHERE ' . $db->quoteName('post_id') . '=' . $db->Quote($postId);
     $query = implode(' ', $query);
     $db->setQuery($query);
     return $db->Query();
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:27,代码来源:comments.php


注:本文中的EB::getConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。