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


PHP DiscussHelper::getConfig方法代码示例

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


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

示例1: replace

 public static function replace($tmp, $text)
 {
     $config = DiscussHelper::getConfig();
     $pattern = '@(?i)\\b((?:https?://|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:\'".,<>?«»“”‘’]))@';
     preg_match_all($pattern, $tmp, $matches);
     $targetBlank = $config->get('main_link_new_window') ? ' target="_blank"' : '';
     if (!isset($matches[0]) || !is_array($matches[0])) {
         return;
     }
     // to avoid infinite loop, unique the matches
     $links = $matches[0];
     foreach ($links as &$link) {
         $link = JString::strtolower($link);
     }
     $uniques = array_unique($links);
     foreach ($uniques as $match) {
         $matchProtocol = $match;
         if (stristr($matchProtocol, 'http://') === false && stristr($matchProtocol, 'https://') === false && stristr($matchProtocol, 'ftp://') === false) {
             $matchProtocol = 'http://' . $matchProtocol;
         }
         $text = JString::str_ireplace($match, '<a href="' . $matchProtocol . '"' . $targetBlank . '>' . $match . '</a>', $text);
     }
     $text = JString::str_ireplace('&quot;', '"', $text);
     return $text;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:25,代码来源:url.php

示例2: display

 function display($tmpl = null)
 {
     $document = JFactory::getDocument();
     $config = DiscussHelper::getConfig();
     $doc = JFactory::getDocument();
     DiscussHelper::setPageTitle(JText::_('COM_EASYDISCUSS_MEMBERS_TITLE'));
     $this->setPathway(JText::_('COM_EASYDISCUSS_BREADCRUMBS_MEMBERS'));
     $model = $this->getModel('Users');
     $userQuery = JRequest::getString('userQuery', '');
     $result = $model->getData($userQuery);
     $pagination = $model->getPagination();
     $sort = JRequest::getString('sort', 'latest');
     $filteractive = JRequest::getString('filter', 'allposts');
     $users = DiscussHelper::formatUsers($result);
     $sort = JRequest::getCmd('sort', 'name');
     $uids = $config->get('main_exclude_members');
     if (!empty($uids)) {
         // Remove white space
         $uids = str_replace(' ', '', $uids);
         $excludeId = explode(',', $uids);
         $temp = array();
         foreach ($users as $user) {
             if (!in_array($user->id, $excludeId)) {
                 $temp[] = $user;
             }
         }
         $users = $temp;
     }
     $theme = new DiscussThemes();
     $theme->set('users', $users);
     $theme->set('pagination', $pagination);
     $theme->set('sort', $sort);
     $theme->set('userQuery', $userQuery);
     echo $theme->fetch('users.php');
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:35,代码来源:view.html.php

示例3: toMinimizePost

 public static function toMinimizePost($count)
 {
     $config = DiscussHelper::getConfig();
     $breakPoint = $config->get('layout_autominimisepost');
     $minimize = $count <= $breakPoint && $breakPoint != 0 ? true : false;
     return $minimize;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:7,代码来源:post.php

示例4: display

 public function display($tpl = null)
 {
     // @rule: Test for user access if on 1.6 and above
     if (DiscussHelper::getJoomlaVersion() >= '1.6') {
         if (!JFactory::getUser()->authorise('discuss.manage.settings', 'com_easydiscuss')) {
             JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
             JFactory::getApplication()->close();
         }
     }
     // Initialise variables
     $config = DiscussHelper::getConfig();
     $jconfig = DiscussHelper::getJConfig();
     $defaultSAId = DiscussHelper::getDefaultSAIds();
     $joomlaVersion = DiscussHelper::getJoomlaVersion();
     $joomlaGroups = DiscussHelper::getJoomlaUserGroups();
     $this->assignRef('config', $config);
     $this->assignRef('jconfig', $jconfig);
     $this->assignRef('defaultSAId', $defaultSAId);
     $this->assignRef('defaultLength', $defaultLength);
     $this->assignRef('joomlaversion', $joomlaVersion);
     $this->assignRef('joomlaGroups', $joomlaGroups);
     if ($this->getLayout() == 'default') {
         $app = JFactory::getApplication();
         $app->redirect('index.php?option=com_easydiscuss&view=settings&layout=default_main_workflow&child=general');
     }
     parent::display($tpl);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:27,代码来源:view.html.php

示例5: connect

 /**
  * Open an IMAP stream to a mailbox.
  * Return true on success, return false on error.
  */
 public function connect($username = '', $password = '')
 {
     $config = DiscussHelper::getConfig();
     if (!$this->initiated) {
         $this->init();
     }
     if (!$this->enabled || !function_exists('imap_open') || !function_exists('imap_fetchheader') || !function_exists('imap_body')) {
         $this->setError('PHP IMAP not available.');
         return false;
     }
     /*
      * Connect to mailbox
      */
     // if( !empty($username) && !empty($password) )
     // {
     echo JText::sprintf('COM_EASYDISCUSS_CONNECTING_TO', $username);
     $this->stream = imap_open($this->mailbox_params, $username, $password);
     // }
     // else
     // {
     // 	$this->stream	= imap_open( $this->mailbox_params, $this->username, $this->password );
     // }
     if ($this->stream === false) {
         $this->setError(imap_errors());
         return false;
     }
     return true;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:32,代码来源:mailbox.php

示例6: getButtonHTML

    public static function getButtonHTML($row, $position = 'vertical')
    {
        $config = DiscussHelper::getConfig();
        if (!$config->get('integration_digg')) {
            return '';
        }
        $dataURL = DiscussRouter::getRoutedURL('index.php?option=com_easydiscuss&view=post&id=' . $row->id, false, true);
        $dataURL = urlencode($dataURL);
        $html = '';
        if ($position == 'horizontal') {
            $class = 'DiggCompact';
        } else {
            $class = 'DiggMedium';
        }
        $html = '<script type="text/javascript">(function() {
		var s = document.createElement(\'SCRIPT\'), s1 = document.getElementsByTagName(\'SCRIPT\')[0];
		s.type = \'text/javascript\';
		s.async = true;
		s.src = \'http://widgets.digg.com/buttons.js\';
		s1.parentNode.insertBefore(s, s1);
		})();
		</script>
		<!-- Wide Button -->
		<div class="social-button digg-share"><a class="DiggThisButton ' . $class . '" href="https://digg.com/submit?url=' . $dataURL . '&amp;title=' . $row->title . '"></a></div>';
        return $html;
    }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:26,代码来源:digg.php

示例7: compile

 public function compile()
 {
     $config = DiscussHelper::getConfig();
     $less = DiscussHelper::getHelper('less');
     // Force compile
     $less->compileMode = 'force';
     $name = JRequest::getCmd('name', null, 'GET');
     $type = JRequest::getCmd('type', null, 'GET');
     $result = new stdClass();
     if (isset($name) && isset($type)) {
         switch ($type) {
             case "admin":
                 $result = $less->compileAdminStylesheet($name);
                 break;
             case "site":
                 $result = $less->compileSiteStylesheet($name);
                 break;
             case "module":
                 $result = $less->compileModuleStylesheet($name);
                 break;
             default:
                 $result->failed = true;
                 $result->message = "Stylesheet type is invalid.";
         }
     } else {
         $result->failed = true;
         $result->message = "Insufficient parameters provided.";
     }
     header('Content-type: text/javascript; UTF-8');
     echo json_encode($result);
     exit;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:32,代码来源:themes.php

示例8: __construct

 public function __construct()
 {
     $lang = JFactory::getLanguage();
     $lang->load('com_easydiscuss', JPATH_ROOT);
     self::$file = JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php';
     $this->exists = $this->exists();
     $this->config = DiscussHelper::getConfig();
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:8,代码来源:easysocial.php

示例9: display

 public function display($tmpl = null)
 {
     $config = DiscussHelper::getConfig();
     $jConfig = DiscussHelper::getJConfig();
     if (!$config->get('main_rss')) {
         return;
     }
     $filteractive = JRequest::getString('filter', 'allposts');
     $sort = JRequest::getString('sort', 'latest');
     if ($filteractive == 'unanswered' && ($sort == 'active' || $sort == 'popular')) {
         //reset the active to latest.
         $sort = 'latest';
     }
     $doc = JFactory::getDocument();
     $doc->link = JRoute::_('index.php?option=com_easydiscuss&view=index');
     // Load up the tag
     $tag = JRequest::getInt('id', 0);
     $table = DiscussHelper::getTable('Tags');
     $table->load($tag);
     // Set the title of the document
     $doc->setTitle($table->title);
     $doc->setDescription(JText::sprintf('COM_EASYDISCUSS_DISCUSSIONS_TAGGED_IN', $table->title));
     $postModel = $this->getModel('Posts');
     $posts = $postModel->getTaggedPost($tag, $sort, $filteractive);
     $pagination = $postModel->getPagination('0', $sort, $filteractive);
     $jConfig = DiscussHelper::getJConfig();
     $posts = DiscussHelper::formatPost($posts);
     foreach ($posts as $row) {
         // 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 = JRoute::_('index.php?option=com_easydiscuss&view=post&id=' . $row->id);
         $item->description = $row->content;
         $item->date = DiscussHelper::getDate($row->created)->toMySQL();
         if (!empty($row->tags)) {
             $tagData = array();
             foreach ($row->tags as $tag) {
                 $tagData[] = '<a href="' . JRoute::_('index.php?option=com_easydiscuss&view=tags&id=' . $tag->id) . '">' . $tag->title . '</a>';
             }
             $row->tags = implode(', ', $tagData);
         } else {
             $row->tags = '';
         }
         $item->category = $row->tags;
         $item->author = $row->user->getName();
         if ($jConfig->get('feed_email') != 'none') {
             if ($jConfig->get('feed_email') == 'author') {
                 $item->authorEmail = $row->user->email;
             } else {
                 $item->authorEmail = $jConfig->get('mailfrom');
             }
         }
         $doc->addItem($item);
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:58,代码来源:view.feed.php

示例10: getEmbedHTML

 public function getEmbedHTML($url)
 {
     $code = $this->getCode($url);
     $config = DiscussHelper::getConfig();
     $width = $config->get('bbcode_video_width');
     $height = $config->get('bbcode_video_height');
     if ($code) {
         return '<iframe src="http://player.vimeo.com/video/' . $code . '" width="' . $width . '" height="' . $height . '" frameborder="0"></iframe>';
     }
     return false;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:11,代码来源:vimeo.php

示例11: getEmbedHTML

 public function getEmbedHTML($url)
 {
     $code = $this->getCode($url);
     $config = DiscussHelper::getConfig();
     $width = $config->get('bbcode_video_width');
     $height = $config->get('bbcode_video_height');
     if ($code) {
         return '<script src="http://flash.revver.com/player/1.0/player.js?mediaId:' . $code . ';width:' . $width . ';height:' . $height . ';" type="text/javascript"></script>';
     }
     return false;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:11,代码来源:revver.php

示例12: getEmbedHTML

 public function getEmbedHTML($url)
 {
     $code = $this->getCode($url);
     $config = DiscussHelper::getConfig();
     $width = $config->get('bbcode_video_width');
     $height = $config->get('bbcode_video_height');
     if ($code) {
         return '<embed id=VideoPlayback src=http://video.google.com/googleplayer.swf?docid=' . $code . '&hl=en&fs=true style=width:' . $width . 'px;height:' . $height . 'px allowFullScreen=true allowScriptAccess=always type=application/x-shockwave-flash> </embed>';
     }
     return false;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:11,代码来源:google.php

示例13: getEmbedHTML

 public function getEmbedHTML($url)
 {
     $code = $this->getCode($url);
     $config = DiscussHelper::getConfig();
     $width = $config->get('bbcode_video_width');
     $height = $config->get('bbcode_video_height');
     if ($code) {
         return '<embed flashVars="playerVars=showStats=yes|autoPlay=no" src="http://www.metacafe.com/fplayer/' . $code . '/easyblog.swf" width="' . $width . '" height="' . $height . '" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_' . $code . '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>';
     }
     return false;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:11,代码来源:metacafe.php

示例14: getEmbedHTML

 public function getEmbedHTML($url)
 {
     $code = $this->getCode($url);
     $config = DiscussHelper::getConfig();
     $width = $config->get('bbcode_video_width');
     $height = $config->get('bbcode_video_height');
     if ($code) {
         return '<script src="http://ext.nicovideo.jp/thumb_watch/' . $code . '?w=' . $width . '&h=' . $height . '&n=1" type="text/javascript"></script><noscript>Javascript is required to load the player</noscript>';
     }
     return false;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:11,代码来源:nicovideo.php

示例15: getEmbedHTML

 public function getEmbedHTML($url)
 {
     $code = $this->getCode($url);
     $config = DiscussHelper::getConfig();
     $width = $config->get('bbcode_video_width');
     $height = $config->get('bbcode_video_height');
     if ($code) {
         return '<embed src="http://media.mtvnservices.com/mgid:uma:video:mtv.com:' . $code . '" width="' . $width . '" height="' . $height . '" type="application/x-shockwave-flash" flashVars="configParams=id%3D' . $code . '%26vid%3D' . $code . '%26uri%3Dmgid%3Auma%3Avideo%3Amtv.com%3A' . $code . '" allowFullScreen="true" allowScriptAccess="always" base="."></embed>';
     }
     return false;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:11,代码来源:mtv.php


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