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>'; }
/** * 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>'; }
/** * 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>'; }
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]'; }
/** * 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; }
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; }
<?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'];
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 = " "; if (vartrue($this->plugPrefs['link_icon'])) { if ($rowl['link_button']) { $LINK_BUTTON = $tp->toImage($rowl['link_button'], $att); } } return $LINK_BUTTON; }