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


PHP JHTML::iframe方法代码示例

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


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

示例1: onContentPrepare

 /**
  * Plugin that loads module positions within content
  *
  * @param   string $context The context of the content being passed to the plugin.
  * @param   object &$article The article object.  Note $article->text is also available
  * @param   mixed &$params The article params
  * @param   integer $page The 'page' number
  *
  * @return  mixed   true if there is an error. Void otherwise.
  *
  * @since   1.6
  */
 public function onContentPrepare($context, &$article, &$params, $page = 0)
 {
     // Don't run this plugin when the content is being indexed
     if ($context == 'com_finder.indexer') {
         return true;
     }
     // require_once( JURI::root(true).'/includes/domit/xml_saxy_lite_parser.php' );//xml_domit_lite_parser.php
     //$live_site = JURI::base();
     // Start IFRAME Replacement
     // define the regular expression for the bot
     $plugin = JPluginHelper::getPlugin('content', 'iframe');
     $pluginParams = new JRegistry($plugin->params);
     $regex = "#{iframe*(.*?)}(.*?){/iframe}#s";
     $plugin_enabled = $pluginParams->get('enabled', '1');
     if ($plugin_enabled == "0") {
         $article->text = preg_replace($regex, '', $article->text);
     } else {
         if (preg_match_all($regex, $article->text, $matches, PREG_SET_ORDER) > 0) {
             $db = JFactory::getDBO();
             //Ket noi CSDL
             $url = JRequest::getCmd('src');
             //JRequest::getCmd
             foreach ($matches as $match) {
                 $params0 = JUtility::parseAttributes($match[1]);
                 $params0['src'] = @$params0['src'] ? $params0['src'] : $pluginParams->get('src', 'http://www.luyenkim.net');
                 if ($url != '') {
                     if (strpos($url, 'http://') == false) {
                         $params0['src'] = 'http://' . $url;
                     }
                 }
                 //$params0['src'] = filter_var($params0['src'], FILTER_SANITIZE_URL);
                 $params0['height'] = @$params0['height'] ? $params0['height'] : $pluginParams->get('height', '400');
                 $params0['width'] = @$params0['width'] ? $params0['width'] : $pluginParams->get('width', '100%');
                 $params0['marginheight'] = @$params0['marginheight'] ? $params0['marginheight'] : $pluginParams->get('marginheight', '0');
                 $params0['marginwidth'] = @$params0['marginwidth'] ? $params0['marginwidth'] : $pluginParams->get('marginwidth', '0');
                 $params0['scrolling'] = @$params0['scrolling'] ? $params0['scrolling'] : $pluginParams->get('scrolling', '0');
                 $params0['frameborder'] = @$params0['frameborder'] ? $params0['frameborder'] : $pluginParams->get('frameborder', '0');
                 $params0['align'] = @$params0['align'] ? $params0['align'] : $pluginParams->get('align', 'bottom');
                 $params0['name'] = @$params0['name'] ? $params0['name'] : $pluginParams->get('name', '');
                 $params0['noframes'] = @$params0['noframes'] ? $params0['noframes'] : $pluginParams->get('noframes', '');
                 if (@$match[2]) {
                     $url = $match[2];
                 } else {
                     $url = $params0['src'];
                 }
                 $url = strip_tags(rtrim(ltrim($url)));
                 $name = $params0['name'];
                 $noframes = $params0['noframes'];
                 unset($params0['src']);
                 unset($params0['name']);
                 unset($params0['noframes']);
                 $article->text = preg_replace($regex, JHTML::iframe($url, $name, $params0, $noframes), $article->text, 1);
                 unset($params0);
             }
         }
         // End IFRAME Replacement
     }
     //end of else enable
 }
开发者ID:logic24,项目名称:plg_iframe,代码行数:71,代码来源:iframe.php

示例2: fbLikeButton

 static function fbLikeButton($user)
 {
     $cfg = BidsHelperTools::getConfig();
     if (!$cfg->bid_opt_fblikebutton) {
         return;
     }
     $iframeURL = 'https://www.facebook.com/plugins/like.php?href=' . urlencode(self::userProfileURL($user));
     $iframeAttribs = 'scrolling="no" frameborder="0" class="bidsFbLikeButton"';
     return JHTML::iframe($iframeURL, APP_EXTENSION . '_fbLikeButton_' . $user->userid, $iframeAttribs);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:10,代码来源:userprofile.php


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