\n"; } /** * Special Footer Shortcode for dynamic menuarea templates. * @shortcode {---FOOTER---} * @return string */ function sc_footer() { return "\n"; /* return ' ';*/ } /* function sc_news_summary() { $sc = e107::getScBatch('news'); $data = $sc->getScVar('news_item'); return "".e107::getParser()->toHTML($data['news_summary'],'BODY').""; }*/ function sc_bootstrap_branding() { $pref = e107::pref('theme', 'branding'); switch($pref) { case 'logo': return e107::getParser()->parseTemplate('{SITELOGO: h=30}',true); break; case 'sitenamelogo': return "".e107::getParser()->parseTemplate('{SITELOGO: h=30}',true)."".SITENAME; break; case 'sitename': default: return SITENAME; break; } } function sc_bootstrap_nav_align() { $pref = e107::pref('theme', 'nav_alignment'); if($pref == 'right') { return "navbar-right"; } else { return ""; } } function sc_bootstrap_usernav($parm=null) { $placement = e107::pref('theme', 'usernav_placement', 'top'); if($parm['placement'] != $placement) { return ''; } e107::includeLan(e_PLUGIN."login_menu/languages/".e_LANGUAGE.".php"); $tp = e107::getParser(); $login_menu_shortcodes = null; require(e_PLUGIN."login_menu/login_menu_shortcodes.php"); // don't use 'require_once'. $direction = vartrue($parm['dir']) == 'up' ? ' dropup' : ''; $userReg = defset('USER_REGISTRATION'); if(!USERID) // Logged Out. { $text = ' "; return e107::getParser()->parseTemplate($text, true, $login_menu_shortcodes); } // Logged in. //TODO Generic LANS. (not theme LANs) $userNameLabel = !empty($parm['username']) ? USERNAME : ''; $text = ' '; return e107::getParser()->parseTemplate($text,true,$login_menu_shortcodes); } /* * @example shortcode to render news. */ function sc_bootstrap_news_example($parm=null) { $news = e107::getObject('e_news_tree'); // get news class. $sc = e107::getScBatch('news'); // get news shortcodes. $tp = e107::getParser(); // get parser. $newsCategory = 1; // null, number or array(1,3,4); $opts = array( 'db_order' =>'n.news_sticky DESC, n.news_datestamp DESC', //default is n.news_datestamp DESC 'db_where' => "FIND_IN_SET(0, n.news_render_type)", // optional 'db_limit' => '6', // default is 10 ); // load active news items. ie. the correct userclass, start/end time etc. $data = $news->loadJoinActive($newsCategory, false, $opts)->toArray(); // false to utilize the built-in cache. $TEMPLATE = "{NEWS_TITLE} : {NEWS_CATEGORY_NAME}
"; $text = ''; foreach($data as $row) { $sc->setScVar('news_item', $row); // send $row values to shortcodes. $text .= $tp->parseTemplate($TEMPLATE, true, $sc); // parse news shortcodes. } unset($parm); return $text; } /** * Mega-Menu Shortcode Example. * @usage Select "bootstrap_megamenu_example" in Admin > Sitelinks > Create/Edit > Function * @notes Changing the method name will require changing .theme-sc-bootstrap-megamenu-example in style.css * @param null $data Link data. * @return string */ function sc_bootstrap_megamenu_example($data) { // include a plugin, custom code, whatever you wish. // return print_a($data,true); $parm= array(); $parm['caption'] = ''; $parm['titleLimit'] = 25; // number of chars fo news title $parm['summaryLimit'] = 50; // number of chars for new summary $parm['source'] = 'latest'; // latest (latest news items) | sticky (news items) | template (assigned to news-grid layout) $parm['order'] = 'n.news_datestamp DESC'; // n.news_datestamp DESC $parm['limit'] = 4; // number of items $parm['layout'] = 'media-list'; // default | or any key as defined in news_grid_template.php $parm['featured'] = 0; unset($data); return '
'. e107::getObject('news')->render_newsgrid($parm) ."
"; } }