Example #1
0
 /**
  * Available parameters (GET string format)
  * - cols (integer): number of items per column, default 1
  * - no_fill_empty (boolean): don't fill last column with empty items (if required), default 0
  * - tablestyle (string): mode to be used with <code>tablerender()</code>, default 'featurebox'
  * - notablestyle (null): if isset - disable <code>tablerender()</code>
  * - force (boolean): force category model load , default false
  * - ids (string): comma separated id list - load specific featurebox items, default empty 
  * 
  * @param string $parm parameters
  * @param string $mod category template
  * @example {FEATUREBOX=cols=2|tabs}
  */
 function sc_featurebox($parm = null, $mod = '')
 {
     if ($parm == null && $mod == '') {
         $type = vartrue(e107::getPlugPref('featurebox', 'menu_category'), 'bootstrap_carousel');
         $text = e107::getParser()->parseTemplate("{FEATUREBOX|" . $type . "}");
         return $text;
     }
     // TODO cache
     if (!e107::isInstalled('featurebox')) {
         return '';
     }
     if (!$mod) {
         $ctemplate = 'default';
     } else {
         $ctemplate = $mod;
     }
     parse_str($parm, $parm);
     $category = $this->getCategoryModel($ctemplate, vartrue($parm['force']) ? true : false);
     $defopt = array('force' => 0, 'no_fill_empty' => 0, 'tablestyle' => 'featurebox', 'cols' => 1, 'ids' => '', 'notablestyle' => null);
     // reset to default, update current
     $category->setParams($defopt)->updateParams($parm);
     if (!$category->hasData()) {
         return '';
     }
     $tmpl = $this->getFboxTemplate($ctemplate);
     $type = vartrue($tmpl['js_type'], '');
     // Legacy support (prototype.js)
     if (vartrue($tmpl['js'])) {
         $tmp = explode(',', $tmpl['js']);
         foreach ($tmp as $file) {
             e107::js('footer', $file, $type);
         }
     }
     $tp = e107::getParser();
     if (vartrue($tmpl['js_inline'])) {
         $data = $tp->toText($category->getData('fb_category_parms'));
         $jsInline = str_replace("{FEATUREBOX_PARMS}", "{" . trim($data) . "}", $tmpl['js_inline']);
         e107::js('footer-inline', $jsInline, $type, 3);
     }
     // Fix - don't use tablerender if no result (category could contain hidden items)
     $ret = $this->render($category, $ctemplate, $parm);
     if (empty($ret)) {
         e107::getMessage()->addDebug('Featurebox returned nothing.')->addDebug('Category: ' . print_a($category, true))->addDebug('Template: ' . $ctemplate)->addDebug('Param: ' . print_a($parm, true));
         return '';
     }
     $ret = $tp->parseTemplate($tmpl['list_start'], true, $category) . $ret . $tp->parseTemplate($tmpl['list_end'], true, $category);
     if (isset($parm['notablestyle'])) {
         return $ret;
     }
     return e107::getRender()->tablerender(LAN_PLUGIN_FEATUREBOX_NAME, $ret, vartrue($parm['tablestyle'], 'featurebox'), true);
 }
Example #2
0
$qs = explode('.', e_QUERY);
$action = varset($qs[0], 'inbox');
if (!$action) {
    $action = 'inbox';
}
if ($action == 'textarea' || $action == 'input') {
    if ($qs[1] == 'pm_to') {
        require_once e_HANDLER . 'user_select_class.php';
        $us = new user_select();
        $us->popup();
        exit;
    }
}
$pm_proc_id = intval(varset($qs[1], 0));
//$pm_prefs = $sysprefs->getArray('pm_prefs');
$pm_prefs = e107::getPlugPref('pm');
$pm_prefs['perpage'] = intval($pm_prefs['perpage']);
if ($pm_prefs['perpage'] == 0) {
    $pm_prefs['perpage'] = 10;
}
if (!isset($pm_prefs['pm_class']) || !check_class($pm_prefs['pm_class'])) {
    require_once HEADERF;
    $ns->tablerender(LAN_PM, LAN_PM_12);
    require_once FOOTERF;
    exit;
}
//setScVar('pm_handler_shortcodes','pmPrefs', $pm_prefs);
$pmManager = new pmbox_manager($pm_prefs);
//setScVar('pm_handler_shortcodes','pmManager', &$pmManager);
class pm_extended extends private_message
{
Example #3
0
 /**
  * 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;
 }
Example #4
0
 function sc_gallery_slideshow($parm = '')
 {
     $this->sliderCat = $parm ? $parm : vartrue(e107::getPlugPref('gallery', 'slideshow_category'), 1);
     $template = e107::getTemplate('gallery', 'gallery', 'SLIDESHOW_WRAPPER');
     return e107::getParser()->parseTemplate($template);
 }
Example #5
0
 public function actionList()
 {
     $request = $this->getRequest();
     // use only filtered variables
     $cid = $request->getRequestParam('cat');
     if ($cid && !isset($this->catList[$cid])) {
         // get ID by SEF
         $_cid = null;
         foreach ($this->catList as $id => $row) {
             if ($cid === $row['media_cat_sef']) {
                 $_cid = $id;
                 break;
             }
         }
         $cid = $_cid;
     }
     if (empty($cid) || !isset($this->catList[$cid])) {
         $this->_forward('category');
         return;
     }
     $tp = e107::getParser();
     $template = e107::getTemplate('gallery');
     $template = array_change_key_case($template);
     $sc = e107::getScBatch('gallery', TRUE);
     if (defset('BOOTSTRAP') === true || defset('BOOTSTRAP') === 2) {
         $template['list_start'] = str_replace('row', 'row-fluid', $template['list_start']);
     }
     $sc->total = e107::getMedia()->countImages($cid);
     $sc->amount = e107::getPlugPref('gallery', 'perpage', 12);
     // TODO Add Pref. amount per page.
     $sc->curCat = $cid;
     $sc->from = $request->getRequestParam('frm', 0);
     $list = e107::getMedia()->getImages($cid, $sc->from, $sc->amount);
     $catname = $tp->toHtml($this->catList[$cid]['media_cat_title'], false, 'defs');
     $cat = $this->catList[$cid];
     $inner = "";
     foreach ($list as $row) {
         $sc->setVars($row)->addVars($cat);
         $inner .= $tp->parseTemplate($template['list_item'], TRUE, $sc);
     }
     $text = $tp->parseTemplate($template['list_start'], TRUE, $sc);
     $text .= $inner;
     $text .= $tp->parseTemplate($template['list_end'], TRUE, $sc);
     if (isset($template['list_caption'])) {
         $title = $tp->parseTemplate($template['list_caption'], TRUE, $sc);
         $this->addTitle($title)->addBody($text);
     } else {
         $this->addTitle($catname)->addTitle(LAN_PLUGIN_GALLERY_TITLE)->addBody($text);
     }
 }
Example #6
0
<?php

/*
* Copyright (c) 2014 e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
*
* Gallery Template 
*/
if (!defined('e107_INIT')) {
    exit;
}
// e107::Lan('featurebox', 'front');
$type = vartrue(e107::getPlugPref('featurebox', 'menu_category'), 'bootstrap_carousel');
$text = e107::getParser()->parseTemplate("{FEATUREBOX|" . $type . "}");
if (!$text) {
    echo "<div class='alert alert-block alert-warning'>There are no featurebox items assigned to the " . $type . " template</div>";
    //	e107::getMessage()->addDebug("There are no featurebox items using the ".$type." template");
}
echo $text;
unset($text);
Example #7
0
<?php

/*
* Copyright (c) 2012 e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: e_shortcode.php 12438 2011-12-05 15:12:56Z secretr $
*
* Gallery Template 
*/
if (!defined('e107_INIT')) {
    exit;
}
e107::plugLan('gallery', 'front');
$gp = e107::getPlugPref('gallery');
e107::js('gallery', 'jslib/prettyPhoto/js/jquery.prettyPhoto.js', 'jquery');
e107::css('gallery', 'jslib/prettyPhoto/css/prettyPhoto.css', 'jquery');
e107::css('gallery', 'gallery_style.css');
// Work-around for indent issue. see: https://github.com/twitter/bootstrap/issues/4890
e107::css('inline', "\r\n\r\n.thumbnails .span2:nth-child(6n+1) {\r\nmargin-left:0;\r\n}", 'jquery');
$prettyPhoto = <<<JS
\$(document).ready(function(){
    \$("a[data-gal^='prettyPhoto']").prettyPhoto(
\t    {
\t    \thook: 'data-gal',
\t    \ttheme: 'pp_default',
\t    \toverlay_gallery: false,
\t    \tdeeplinking: false
\t    }
    );
  });
JS;
e107::js('footer-inline', $prettyPhoto, 'jquery');
Example #8
0
 function sc_emailnotify()
 {
     global $threadInfo, $action, $eaction;
     $pref = e107::getPlugPref('forum');
     if ($eaction == true) {
         return;
     }
     if ($pref['notify'] && $action == 'nt' && USER) {
         if (isset($_POST['fpreview'])) {
             $chk = $_POST['notify'] ? "checked = 'checked'" : '';
         } else {
             if (isset($threadInfo)) {
                 // no reference of 'head' $threadInfo['head']['thread_active']
                 $chk = $threadInfo['thread_active'] == 99 ? "checked='checked'" : '';
             } else {
                 $chk = $pref['notify_on'] ? "checked='checked'" : '';
             }
         }
         return "<br /><input type='checkbox' name='notify' value='1' {$chk} />&nbsp;<span class='defaulttext'>" . LAN_380 . "</span>";
     }
     return '';
 }
Example #9
0
 public function __construct()
 {
     $pm_prefs = e107::getPlugPref('pm');
     $this->pmManager = new pmbox_manager($pm_prefs);
     $this->pmPrefs = $pm_prefs;
     // print_a($pm_prefs);
     require_once e_PLUGIN . "pm/pm_class.php";
     $pmClass = new private_message($pm_prefs);
     $blocks = $pmClass->block_get_user();
     foreach ($blocks as $usr) {
         if ($usr['pm_block_to'] == USERID) {
             $this->pmBlocks[] = $usr['pm_block_from'];
         }
     }
 }
Example #10
0
 public function __construct($prefs)
 {
     $this->pmDB = e107::getDb();
     // $this->pmPrefs = $prefs;
     $this->pmPrefs = e107::getPlugPref('pm');
 }
Example #11
0
 public function actionList()
 {
     $request = $this->getRequest();
     // use only filtered variables
     $cid = $request->getRequestParam('cat');
     if ($cid && !isset($this->catList[$cid])) {
         // get ID by SEF
         $_cid = null;
         foreach ($this->catList as $id => $row) {
             if ($cid === $row['media_cat_title']) {
                 $_cid = $id;
                 break;
             }
         }
         $cid = $_cid;
     }
     if (empty($cid) || !isset($this->catList[$cid])) {
         $this->_forward('category');
         return;
     }
     $tp = e107::getParser();
     $template = e107::getTemplate('gallery');
     $sc = e107::getScBatch('gallery', TRUE);
     $sc->total = e107::getMedia()->countImages($cid);
     $sc->amount = e107::getPlugPref('gallery', 'perpage', 12);
     // TODO Add Pref. amount per page.
     $sc->curCat = $cid;
     $sc->from = $request->getRequestParam('frm', 0);
     $list = e107::getMedia()->getImages($cid, $sc->from, $sc->amount);
     $catname = $tp->toHtml($this->catList[$cid]['media_cat_title'], false, 'defs');
     $cat = $this->catList[$cid];
     $inner = "";
     foreach ($list as $row) {
         $sc->setVars($row)->addVars($cat);
         $inner .= $tp->parseTemplate($template['LIST_ITEM'], TRUE);
     }
     $text = $tp->parseTemplate($template['LIST_START'], TRUE);
     $text .= $inner;
     $text .= $tp->parseTemplate($template['LIST_END'], TRUE);
     $this->addTitle($catname)->addTitle(GALLERY_LAN_TITLE)->addBody($text);
 }