當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eHelper::scParams方法代碼示例

本文整理匯總了PHP中eHelper::scParams方法的典型用法代碼示例。如果您正苦於以下問題:PHP eHelper::scParams方法的具體用法?PHP eHelper::scParams怎麽用?PHP eHelper::scParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在eHelper的用法示例。


在下文中一共展示了eHelper::scParams方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sc_cpageauthor

 function sc_cpageauthor($parm)
 {
     $parms = eHelper::scParams($parm);
     $author = '';
     $url = e107::getUrl()->create('user/profile/view', array('name' => $this->var['user_name'], 'id' => $this->var['user_id']));
     if (isset($parms['url'])) {
         return $url;
     }
     if ($this->var['page_author']) {
         // currently this field used as Real Name, no matter what the db name says
         if ($this->var['user_login'] && !isset($parms['user'])) {
             $author = $this->var['user_login'];
         } elseif ($this->var['user_name']) {
             $author = preg_replace('/[^\\w\\pL\\s]+/u', ' ', $this->var['user_name']);
         }
     }
     if (empty($author)) {
         return '';
     }
     if (isset($parms['nolink'])) {
         return $author;
     }
     //TODO title lan
     return '<a class="cpage-author" href="' . $url . '" title="">' . $author . '</a>';
 }
開發者ID:JBeezygit,項目名稱:e107,代碼行數:25,代碼來源:page_shortcodes.php

示例2: toHTML

 /**
  *	Translate to <p> tag
  */
 function toHTML($code_text, $parm)
 {
     if ($parm && !strpos($parm, '=')) {
         $parm = 'class=' . $parm;
     }
     $code_text = trim($code_text);
     $parms = eHelper::scParams($parm);
     $class = " " . e107::getBB()->getClass('p');
     // consistent classes across all themes.
     $id = varsettrue($parms['id']) ? ' id="' . eHelper::secureIdAttr($parms['id']) . '"' : '';
     $style = varsettrue($parms['style']) ? ' style="' . eHelper::secureStyleAttr($parms['style']) . '"' : '';
     return "<p{$id}{$class}{$style}>" . $code_text . '</p>';
 }
開發者ID:notzen,項目名稱:e107,代碼行數:16,代碼來源:bb_p.php

示例3: toHTML

 /**
  *	Translate youtube bbcode into the appropriate HTML
  */
 function toHTML($code_text, $parm)
 {
     // transform to class, equal sign at 0 position is not well formed parm string
     if ($parm && !strpos($parm, '=')) {
         $parm = 'class=' . $parm;
     }
     $parms = eHelper::scParams($parm);
     $class = " " . e107::getBB()->getClass('block');
     $id = varsettrue($parms['id']) ? ' id=' . eHelper::secureIdAttr($parms['id']) : '';
     $style = varsettrue($parms['style']) ? ' style="' . eHelper::secureStyleAttr($parms['style']) . '"' : '';
     if (empty($code_text)) {
         $code_text = '<!-- -->';
     }
     return '<div' . $id . $class . $style . '>' . $code_text . '</div>';
 }
開發者ID:notzen,項目名稱:e107,代碼行數:18,代碼來源:bb_block.php

示例4: toDB

 function toDB($code_text, $parm)
 {
     $parms = eHelper::scParams($parm);
     $safe = array();
     if (vartrue($parms['class'])) {
         $safe['class'] = eHelper::secureClassAttr($parms['class']);
     }
     if (vartrue($parms['id'])) {
         $safe['id'] = eHelper::secureIdAttr($parms['id']);
     }
     if (vartrue($parms['style'])) {
         $safe['style'] = eHelper::secureStyleAttr($parms['style']);
     }
     if ($safe) {
         return '[img ' . eHelper::buildAttr($safe) . ']' . $code_text . '[/img]';
     }
     return '[img]' . $code_text . '[/img]';
 }
開發者ID:armpit,項目名稱:e107,代碼行數:18,代碼來源:bb_img.php

示例5: sc_gallery_portfolio

 /**
  * Display a Grid of thumbnails - useful for home pages. 
  * Amount per row differs according to device, so they are not set here, only the amount.  
  * @example {GALLERY_PORTFOLIO: placeholder=1&category=2}
  */
 function sc_gallery_portfolio($parms = '')
 {
     $ns = e107::getRender();
     $parm = eHelper::scParams($parms);
     $cat = $parm['category'] ? $parm['category'] : vartrue(e107::getPlugPref('gallery', 'slideshow_category'), 1);
     //TODO Separate pref?
     $tmpl = e107::getTemplate('gallery', 'gallery');
     $limit = vartrue($parm['limit'], 6);
     $list = e107::getMedia()->getImages('gallery_' . $cat . '|gallery_image_' . $cat, 0, $limit);
     if (count($list) < 1 && vartrue($parm['placeholder'])) {
         $list = array();
         for ($i = 0; $i < $limit; $i++) {
             $list[] = array('media_url' => '');
         }
     }
     //NOTE: Using tablerender() allows the theme developer to set the number of columns etc using col-xx-xx
     foreach ($list as $val) {
         $this->var = $val;
         $text .= $ns->tablerender('', $this->sc_gallery_thumb('class=gallery_thumb img-responsive img-home-portfolio'), 'gallery_portfolio', true);
     }
     return $text;
 }
開發者ID:armpit,項目名稱:e107,代碼行數:27,代碼來源:e_shortcode.php

示例6: sc_gallery_cat_thumb

 function sc_gallery_cat_thumb($parm = '')
 {
     $parms = eHelper::scParams($parm);
     $w = vartrue($parms['w']) ? $parms['w'] : 190;
     $h = vartrue($parms['h']) ? $parms['h'] : 150;
     $att = 'aw=' . $w . '&ah=' . $h . '&x=1';
     // 'aw=190&ah=150';
     $url = e107::getUrl()->create('gallery/index/list', $this->var);
     if (isset($parms['thumbsrc'])) {
         return e107::getParser()->thumbUrl($this->var['media_cat_image'], $att);
     }
     $text = "<a href='" . $url . "'>";
     $text .= "<img src='" . e107::getParser()->thumbUrl($this->var['media_cat_image'], $att) . "' alt='' />";
     $text .= "</a>";
     return $text;
 }
開發者ID:notzen,項目名稱:e107,代碼行數:16,代碼來源:e_shortcode.php

示例7: switch

<?php

/*
 * e107 website system
 *
 * Copyright (C) 2008-2013 e107 Inc (e107.org)
 * Released under the terms and conditions of the
 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
 *
*/
if (!defined('e107_INIT')) {
    exit;
}
//FIXME XXX - This menu should call the {PAGE_NAVIGATION} shortcode instead of duplicating its code and automatically display all links.
$parm = eHelper::scParams($parm);
$tmpl = e107::getCoreTemplate('chapter', 'nav', true, true);
// always merge and allow override
$template = $tmpl['showPage'];
$request = e107::getRegistry('core/pages/request');
if ($request && is_array($request)) {
    switch ($request['action']) {
        case 'listChapters':
            $parm['cbook'] = $request['id'];
            $template = $tmpl['listChapters'];
            break;
        case 'listPages':
            $parm['cchapter'] = $request['id'];
            $template = $tmpl['listPages'];
            break;
        case 'showPage':
            $parm['cpage'] = $request['id'];
開發者ID:armpit,項目名稱:e107,代碼行數:31,代碼來源:page_navigation_menu.php

示例8: sc_link_button

 function sc_link_button($parm = '')
 {
     global $rowl;
     $tp = e107::getParser();
     if (!$this->plugPrefs['link_icon']) {
         return "";
     }
     $parms = eHelper::scParams($parm);
     $w = vartrue($parms['w']) ? $parms['w'] : $tp->thumbWidth();
     // 190; // 160;
     $h = vartrue($parms['h']) ? $parms['h'] : $tp->thumbHeight();
     // 130;
     $x = vartrue($parms['x']) ? $parms['h'] : 0;
     $crop = vartrue($parms['crop']) ? $parms['crop'] : 1;
     $class = varset($parms['class'], '');
     $caption = $tp->toAttribute($rowl['link_name']);
     $att = array('w' => $w, 'h' => $h, 'class' => $class, 'alt' => $caption, 'x' => $x, 'crop' => $crop);
     $LINK_BUTTON = "&nbsp;";
     if (vartrue($this->plugPrefs['link_icon'])) {
         if ($rowl['link_button']) {
             $LINK_BUTTON = $tp->toImage($rowl['link_button'], $att);
         }
     }
     return $LINK_BUTTON;
 }
開發者ID:Jimmi08,項目名稱:links_page,代碼行數:25,代碼來源:links_page_shortcodes.php


注:本文中的eHelper::scParams方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。