function simplecache_pageend() { global $simplecache_conf; //caching enabled? if ($simplecache_conf['enabled'] == 'Y') { // check for pages to not cache if (!in_array(return_page_slug(), array_merge(array('404'), $simplecache_conf['nocache']))) { $simplecache_dir = GSDATAOTHERPATH . 'simplecache_cache/'; if (is_dir($simplecache_dir) === FALSE) { mkdir($simplecache_dir, 0755) or exit('Unable to create .../data/other/simplecache_cache folder, check GetSimple privileges.'); } if (is_dir($simplecache_dir)) { $simplecache_file = $simplecache_dir . md5(return_page_slug()) . '.cache'; // open the cache file for writing $fp = fopen($simplecache_file, 'w') or exit('Unable to save ' . $simplecache_file . ', check GetSimple privileges.'); echo "\n<!-- Page cached by SimpleCache on " . date('F d Y H:i:s', time()) . ' -->'; // save the contents of output buffer to the file fwrite($fp, ob_get_contents()); // close the file fclose($fp); } // Send the output to the browser ob_end_flush(); } } }
function return_disqus() { global $disqus_conf; $new_content = '<div id="disqus_thread"></div>'; $new_content .= '<script type="text/javascript">'; $new_content .= "var disqus_shortname = '" . $disqus_conf['shortname'] . "';"; $new_content .= "var disqus_developer = '" . $disqus_conf['developer'] . "';"; $new_content .= "var disqus_identifier = '" . return_page_slug() . "';"; $new_content .= "var disqus_url = '" . get_page_url(True) . "';"; $new_content .= "var disqus_title = '" . return_page_title() . "';"; $new_content .= <<<INLINECODE (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> INLINECODE; return $new_content; }
function sa_toolbar($login = null) { // todo : refactor this a bit, whew global $SATB, $SA_ADMINPATH, $SITEURL, $LANG, $USR, $datau, $SATB_MENU_ADMIN, $SATB_MENU_STATIC; $EMAIL = isset($datau) ? $datau->EMAIL : ''; $gstarget = '_blank'; // logo $logo = '<li><ul class="satb_nav"><li class="satb_menu satb_icon"><a class="satb_logo" title="GetSImple CMS ver. ' . GSVERSION . '" href="#"><img src="' . $SATB['PLUGIN_PATH'] . 'assets/img/gsicon.png"></a><ul id="satb_logo_sub">'; // $logo .= '<li class=""><a href="http://get-simple.info" target="'.$gstarget.'">GetSimple CMS</a></li>'; $logo .= '<li class=""><a href="http://get-simple.info/forums" target="' . $gstarget . '">Forums<span class="iconright">▸</span></a>'; $logo .= '<ul><li class=""><a href="http://get-simple.info/forum/search/new/" target="' . $gstarget . '">New Posts</a></li>'; $logo .= '</ul></li>'; // $logo .= '<li class=""><a href="http://get-simple.info/extend/" target="'.$gstarget.'">Extend</a></li>'; $logo .= '<li class=""><a href="http://get-simple.info/wiki/" target="' . $gstarget . '">Wiki</a></li>'; $logo .= '<li class=""><a href="https://github.com/GetSimpleCMS/GetSimpleCMS" target="' . $gstarget . '">SVN</a></li>'; // $logo .= '<li class=""><a class="" href="http://get-simple.info/forum/topic/4141/sa-gs-admin-toolbar/" target="'.$gstarget.'"><i class="cssicon info"></i>About SA_toolbar</a></li>'; // icon test /* $test = '<li class=""><a class="" href="http://get-simple.info/forum/topic/4141/sa-gs-admin-toolbar/" target="'.$target.'"><i class="cssicon info"></i>Info Icon</a></li>'; $test .= '<li class=""><a class="" href="http://get-simple.info/forum/topic/4141/sa-gs-admin-toolbar/" target="'.$target.'"><i class="cssicon help"></i>Help Icon</a></li>'; $test .= '<li class=""><a class="" href="http://get-simple.info/forum/topic/4141/sa-gs-admin-toolbar/" target="'.$target.'"><i class="cssicon success"></i>Success Icon</a></li>'; $test .= '<li class=""><a class="" href="http://get-simple.info/forum/topic/4141/sa-gs-admin-toolbar/" target="'.$target.'"><i class="cssicon success-alt"></i>Success Alt Icon</a></li>'; $test .= '<li class=""><a class="" href="http://get-simple.info/forum/topic/4141/sa-gs-admin-toolbar/" target="'.$target.'"><i class="cssicon alert"></i>Alert Icon</a></li>'; $test .= '<li class=""><a class="" href="http://get-simple.info/forum/topic/4141/sa-gs-admin-toolbar/" target="'.$target.'"><i class="cssicon warning"></i>Warning Icon</a></li>'; $test .= '<li class=""><a class="" href="http://get-simple.info/forum/topic/4141/sa-gs-admin-toolbar/" target="'.$target.'"><i class="cssicon denied"></i>Denied Icon</a></li>'; $test .= '<li class=""><a class="" href="http://get-simple.info/forum/topic/4141/sa-gs-admin-toolbar/" target="'.$target.'"><i class="cssicon ribbon"></i>Ribbon Icon</a></li>'; */ $logo .= '</ul></ul></li>'; // login form if ($login) { echo '<div id="sa_toolbar"><ul class="">' . $logo . '</ul> <ul class="right"> <ul class="satb_nav"> <li id="satb_login" class="satb_menu"> <a id="satb_login_link" href="#">' . i18n_r('LOGIN') . '</a> <ul id="satb_login_menu"> <form action="' . $SA_ADMINPATH . 'index.php?redirect=' . $_SERVER['REQUEST_URI'] . '" method="post"> <b>Username:</b><input type="text" id="userid" name="userid"> <b>Password:</b><input type="password" id="pwd" name="pwd"> <input class="submit" id="satb_login_submit" type="submit" name="submitted" value="Login"> </form> </ul> </li> <li class="satb_menu tb_close"><a href="' . $SA_ADMINPATH . 'logout.php?toolbar&close" title="Remove Bar"><strong>×</strong></a></li> </ul> </ul> </div>'; satb_jsOutput(); return; } $editpath = $SA_ADMINPATH . 'edit.php'; if (function_exists('return_page_slug')) { $pageslug = return_page_slug(); } else { $pageslug = ''; } $tm = array(); // holds all tabs $sm = array(); // holds all sidemenus $ptabs = sa_tb_get_PluginTabs(); // hold plugin tabs // tabs $tm = sa_tb_addMenu($tm, 'pages', 'TAB_PAGES', $SA_ADMINPATH . 'pages.php'); $tm = sa_tb_addMenu($tm, 'files', 'TAB_FILES', $SA_ADMINPATH . 'upload.php'); $tm = sa_tb_addMenu($tm, 'theme', 'TAB_THEME', $SA_ADMINPATH . 'theme.php'); $tm = sa_tb_addMenu($tm, 'backups', 'TAB_BACKUPS', $SA_ADMINPATH . 'backups.php'); $tm = sa_tb_addMenu($tm, 'plugins', 'PLUGINS_NAV', $SA_ADMINPATH . 'plugins.php'); // merge in plugin nav-tabs $tm = array_merge($tm, $ptabs); $tm = sa_tb_addMenu($tm, 'support', 'TAB_SUPPORT', $SA_ADMINPATH . 'support.php'); // custom $tm = sa_tb_addMenu($tm, 'settings', 'TAB_SETTINGS', $SA_ADMINPATH . 'settings.php'); // custom $tm = sa_tb_addMenu($tm, 'logs', 'LOGS', $SA_ADMINPATH . 'log.php'); // custom # satb_debugLog($ptabs); # satb_debugLog($tm); // default sidemenus $sm = sa_tb_addMenu($sm, 'pages', 'SIDE_VIEW_PAGES', $SA_ADMINPATH . 'pages.php'); $sm = sa_tb_addMenu($sm, 'pages', 'SIDE_CREATE_NEW', $SA_ADMINPATH . 'edit.php'); $sm = sa_tb_addMenu($sm, 'pages', 'MENU_MANAGER', $SA_ADMINPATH . 'menu-manager.php'); $sm = sa_tb_addMenu($sm, 'files', 'FILE_MANAGEMENT', $SA_ADMINPATH . 'upload.php'); $sm = sa_tb_addMenu($sm, 'theme', 'SIDE_CHOOSE_THEME', $SA_ADMINPATH . 'theme.php'); $sm = sa_tb_addMenu($sm, 'theme', 'SIDE_EDIT_THEME', $SA_ADMINPATH . 'theme-edit.php'); $sm = sa_tb_addMenu($sm, 'theme', 'SIDE_COMPONENTS', $SA_ADMINPATH . 'components.php'); $sm = sa_tb_addMenu($sm, 'theme', 'SIDE_VIEW_SITEMAP', '../sitemap.xml'); $sm = sa_tb_addMenu($sm, 'backups', 'SIDE_PAGE_BAK', $SA_ADMINPATH . 'backups.php'); $sm = sa_tb_addMenu($sm, 'backups', 'SIDE_WEB_ARCHIVES', $SA_ADMINPATH . 'archive.php'); $sm = sa_tb_addMenu($sm, 'plugins', 'SHOW_PLUGINS', $SA_ADMINPATH . 'plugins.php'); // $sm = sa_tb_addMenu($sm,'plugins','anonymous_data/ANONY_TITLE',$SA_ADMINPATH.'load.php?id=anonymous_data'); // oops, forgot this was a plugin $sm = sa_tb_addMenu($sm, 'support', 'SUPPORT', $SA_ADMINPATH . 'support.php'); $sm = sa_tb_addMenu($sm, 'support', 'WEB_HEALTH_CHECK', $SA_ADMINPATH . 'health-check.php'); $sm = sa_tb_addMenu($sm, 'settings', 'GENERAL_SETTINGS', $SA_ADMINPATH . 'settings.php'); $sm = sa_tb_addMenu($sm, 'settings', 'SIDE_USER_PROFILE', $SA_ADMINPATH . 'settings.php#profile'); $sm = sa_tb_addMenu($sm, 'logs', 'VIEW_FAILED_LOGIN', $SA_ADMINPATH . 'log.php?log=failedlogins.log'); // custom $sm = sa_tb_get_PluginMenus($sm); // add plugin sidemenus to core sidemenus // these core sidemenus go at bottom // $sm = sa_tb_addMenu($sm,'plugins','GET_PLUGINS_LINK','http://get-simple.info/extend'); $sm = sa_tb_addMenu($sm, 'settings', 'TAB_LOGOUT', $SA_ADMINPATH . 'logout.php?toolbar'); // logout for convienence $logoutitem = $sm['settings'][count($sm['settings']) - 1]; // logout is always last item $profileitem = $sm['settings'][1]; satb_automerge(array_merge($sm, $ptabs)); // auto load language files for found lang tokens // define menu parts // link target $target = satb_is_frontend() ? '_blank' : '_self'; // init master admin menu $menu = '<li><ul class="satb_nav"> <li class="satb_menu"><a href="#">Admin ▾</a> <ul> '; // DO HOOKS $SATB_MENU_ADMIN = $sm; // assign to global $SATB_MENU_STATIC['new'] = array('title' => '+ ' . satb_cleanStr(satb_geti18n('NEW_PAGE')), 'url' => $editpath); if (function_exists('return_page_slug')) { $SATB_MENU_STATIC['edit'] = array('title' => satb_cleanStr(satb_geti18n('EDIT')), 'url' => $editpath . '?id=' . return_page_slug()); } exec_action('sa_toolbar_disp'); // call hook $sm = $SATB_MENU_ADMIN; // set back from global $separator = '<li class="separator"></li>'; // debug mode indicator $debugicon = '<li class="satb_icon" title="' . ucwords(satb_cleanStr(satb_geti18n('DEBUG_MODE'))) . ' ON"><img src="' . $SATB['PLUGIN_PATH'] . 'assets/img/sa_tb_debugmode.png"></li>'; // welcome user $sig = '<ul class="satb_nav"><a id="avatar" href="http://gravatar.com/emails/"><li class="satb_menu"><img src="' . satb_get_gravatar($EMAIL, 20, 'mm', 'g', false) . '" style="width:20px;height:20px;" /></a>'; $sig .= '<a class="welcome" href="#">' . i18n_r('WELCOME') . ', <strong>' . $USR . '</strong></a><ul>'; $sig .= '<li class=""><a href="' . $profileitem['func'] . '" target="' . $target . '">' . satb_cleanStr(satb_geti18n($profileitem['title'])) . '</a></li>'; $sig .= '<li class=""><a href="' . $logoutitem['func'] . '"><i class="cssicon alert"></i>' . satb_cleanStr(satb_geti18n($logoutitem['title'])) . '</a></li>'; $sig .= '</ul></li>'; $tm = satb_update_tabs($tm); // handle any empty or new tabs satb_debugLog('tabs array', $tm); satb_debugLog('sidemenus array', $sm); foreach ($tm as $key => $page) { // loop tabs array $iscustomtab = sa_tb_array_index(sa_tb_array_index($page, 0), 'iscustom'); // check if tab is plugin tab // picky note: built in tabs all use the first level sidemenu item as the default action, all plugins should follow this, arghhh if (isset($ptabs[$key])) { // tab is plugin, so convert lang wrapped titles only and set func and action url parts $tablink = $SA_ADMINPATH . 'load.php?id=' . sa_tb_array_index(sa_tb_array_index($ptabs[$key], 0), 'func'); $tablink .= '&' . sa_tb_array_index(sa_tb_array_index($ptabs[$key], 0), 'action'); $title_i18n = true; } else { // tab is core $tablink = sa_tb_array_index(sa_tb_array_index($page, 0), 'func'); // is tab custom if ($iscustomtab) { $title_i18n = true; } else { $title_i18n = false; } } if ($key != 'link') { $menu .= '<li' . (isset($ptabs[$key]) ? ' class="plugin" ' : '') . '><a href="' . $tablink . '" target="' . $target . '">' . satb_cleanStr(satb_geti18n($tm[$key][0]['title'], $title_i18n)); $menu .= count($page) > 0 ? '<span class="iconright">▸</span></a><ul>' : '</a><ul>'; } // loop sidemenus for page if (isset($sm[$key])) { foreach ($sm[$key] as $submenu) { $iscustomsm = sa_tb_array_index($submenu, 'iscustom'); $ispluginsm = sa_tb_array_index($submenu, 'isplugin'); if (isset($submenu['isplugin']) and $submenu['isplugin'] == true or $iscustomtab or $iscustomsm) { $title = satb_cleanStr(satb_geti18n($submenu['title'], true)); $class = $iscustomtab || $iscustomsm ? 'custom' : 'plugin'; if ($iscustomtab and $key == 'link') { $menu .= '<li class="' . $class . '"><a href="' . $SA_ADMINPATH . 'load.php?id=' . $submenu['func'] . (isset($submenu['action']) ? '&' . $submenu['action'] : '') . '" target="' . $target . '">' . $title . '</a></li>'; } else { $menu .= '<li class="' . $class . '"><a href="' . $SA_ADMINPATH . 'load.php?id=' . $submenu['func'] . (isset($submenu['action']) ? '&' . $submenu['action'] : '') . '" target="' . $target . '">' . $title . '</a></li>'; } } else { $title = satb_cleanStr(satb_geti18n($submenu['title'])); $menu .= '<li><a href="' . $submenu['func'] . '" target="' . $target . '">' . $title . '</a></li>'; } } } if ($key == 'link') { $menu .= '</li>'; } else { $menu .= '</ul></li>'; } } $menu .= '</ul></li></ul>'; echo '<div id="sa_toolbar"> <ul class="">'; echo $logo; echo $menu; echo $separator; // create top menu foreach ($SATB_MENU_STATIC as $key => $menutop) { echo '<li class="satb_menu top_' . $key . '"><a href="' . $menutop['url'] . '" target="' . $target . '">' . $menutop['title'] . '</a></li>'; echo $separator; } echo '</ul>'; echo '<ul class="right">' . $sig . '</ul>'; // debug indicator logic if (defined('GSDEBUG') and GSDEBUG == 1) { echo '<ul class="right">'; echo $debugicon; echo '</ul>'; } echo '</div>'; satb_jsOutput(); }
<!-- HEADER --> <?php include 'inc/header.php'; ?> <!-- SITE CONTENT --> <h2 class="title"><?php get_page_title(); ?> </h2> <div class="flex fullwidth"> <nav class="side sidenav"> <div class="sidemenu root"> <?php get_i18n_navigation(return_page_slug(), 1, 1, I18N_SHOW_MENU, "navbar"); ?> </div> </nav> <?php ?> <div class="content"> <div class="page-text"> <?php get_page_content(); ?> </div> </div> <?php if ($sidebar) { ?>
function sc_get_component($page) { $content = returnPageContent(return_page_slug(), 'content', false, true); $content = strip_decode($content); if (!preg_match('#\\[sc_form(.*)\\]#', $content)) { getPageContent($page); } }
<?php global $SITEURL; require_once GSPLUGINPATH . 'i18n_search/viewer.class.php'; $i18n =& $params; // alias for i18n parsing $slug = array_key_exists('slug', $params) ? $params['slug'] : return_page_slug(); $showTags = array_key_exists('showTags', $params) ? $params['showTags'] : true; $minTagSizePercent = array_key_exists('minTagSize', $params) ? (int) $params['minTagSize'] : 100; $maxTagSizePercent = array_key_exists('maxTagSize', $params) ? (int) $params['maxTagSize'] : 250; $addTags = array_key_exists('addTags', $params) ? $params['addTags'] : ''; $goText = @$i18n['GO']; $is_ajax = !isset($params['ajax']) || $params['ajax']; $live = $is_ajax && isset($params['live']) && $params['live']; $url = function_exists('find_i18n_url') ? find_i18n_url($slug, null) : find_url($slug, null); $method = strpos($url, '?') !== false ? 'POST' : 'GET'; // with GET the parameters are not submitted! $language = isset($params['lang']) ? $params['lang'] : null; $placeholderText = @$params['PLACEHOLDER']; // languages $reqlangs = null; if (function_exists('return_i18n_languages')) { $deflang = return_i18n_default_language(); $languages = $language ? array($language) : return_i18n_languages(); foreach ($languages as $lang) { if ($lang == $deflang) { $lang = ''; } $reqlangs = $reqlangs === null ? $lang : $reqlangs . ',' . $lang; } }
function clientfiles_display($contents) { global $SITEURL; global $url; global $parent; global $PRETTYURLS; $tmp_content = $contents; /* Set this to control the number of items per page to display to the logged in client*/ $perpage = 5; $location = stripos($tmp_content, "(% clientfiles %)"); if ($location !== FALSE) { $tmp_content = str_replace("(% clientfiles %)", "", $tmp_content); $start_content = substr($tmp_content, 0, $location); $end_content = substr($tmp_content, $location, strlen($tmp_content) - $location); $goodlogin = FALSE; $clientfiles_content = ''; if (isset($_POST['submitlogout'])) { if (isset($_SESSION['cf_client'])) { unset($_SESSION['cf_client']); } if (isset($_SESSION['cf_password'])) { unset($_SESSION['cf_password']); } } if (clientfiles_checkloggedin() === TRUE) { $goodlogin = TRUE; } if (isset($_POST['submitlogin'])) { $goodlogin = clientfiles_checkpass($_POST['client'], sha1($_POST['pass'])); if ($goodlogin === FALSE) { $clientfiles_content .= 'Incorrect Login!<br /><br />'; // message } } if ($goodlogin === FALSE) { $clientfiles_content .= 'Please log is to view client files.<br /><br />'; // login form $clientfiles_content .= '<form name="login" action="#clientlogin" method="post">'; $clientfiles_content .= 'Name: <input type="text" style="width: 150px" name="client" value="">'; $clientfiles_content .= ' Password: <input type="password" style="width: 150px" name="pass" value="">'; $clientfiles_content .= ' <input type="submit" name="submitlogin" value="Client Log In" />'; $clientfiles_content .= '</form></br>'; } else { $clientfiles_dir = GSDATAOTHERPATH . 'clientfiles/'; $client = $_SESSION['cf_client']; $client_dir = $clientfiles_dir . $client . '/'; // // display list of client files // $dir_handle = @opendir($client_dir) or exit('Unable to open the folder ' . $client_dir . ', check the folder privileges.'); $filearray = array(); while ($filename = readdir($dir_handle)) { if (!is_dir($client_dir . $filename) && substr($filename, 0, 1) != '.') { $filearray[] = array($filename, date("Y/m/d H:i:s", filemtime($client_dir . $filename)), '(' . clientfiles_format_bytes(filesize($client_dir . $filename)) . ')'); } } // paginate the list if (isset($_GET['cfpage'])) { $cfpage = (int) $_GET['cfpage']; } else { $cfpage = 0; } $cfpage = max(0, min($cfpage, floor((count($filearray) - 1) / $perpage))); $fullcount = count($filearray); $filearray = array_slice($filearray, $cfpage * $perpage, $perpage); // // display client page if it exists - slug must be same as the client name, page set to Private, // and be a child of the page the clientfil plugin is displayed on. // $userpage_file = GSDATAPAGESPATH . $client . '.xml'; if (file_exists($userpage_file)) { $userpage_data = getXML($userpage_file); if ((string) $userpage_data->private == 'Y' && (string) $userpage_data->parent == return_page_slug()) { $clientfiles_content .= stripslashes(html_entity_decode($userpage_data->content, ENT_QUOTES, 'UTF-8')); } } $clientfiles_content .= '<table id="cf_table">'; $clientfiles_content .= '<caption>Client: ' . $client . '</caption>'; $clientfiles_content .= '<thead><tr><th>File</th><th>Date</th></tr></head>'; // generate client area list: $clientfiles_content .= '<tbody>'; $filecount = count($filearray); if ($filecount > 0) { $rowclass = ""; } sort($filearray); foreach ($filearray as $clientfile) { $clientfiles_content .= '<tr' . $rowclass . '><td><a href="' . $SITEURL . 'plugins/clientfiles/dlfile.php?client=' . urlencode($client) . '&getfile=' . urlencode($clientfile[0]) . '" title="Download File">' . $clientfile[0] . '</a> ' . $clientfile[2] . '</td><td>' . $clientfile[1] . '</td></tr>'; if ($rowclass == "") { $rowclass = ' class="alt"'; } else { $rowclass = ""; } } $clientfiles_content .= '<tr' . $rowclass . '><td colspan="2">'; if ($fullcount == 1) { $clientfiles_content .= "{$fullcount} file"; } else { $clientfiles_content .= "{$fullcount} files"; } $clientfiles_content .= '</td></tr>'; // generate pagination if (floor(($fullcount - 1) / $perpage) > 0) { if ($rowclass == "") { $rowclass = ' class="alt"'; } else { $rowclass = ""; } $thispage = find_url($url, $parent) . ((string) $PRETTYURLS === "1") ? '?' : '&'; $clientfiles_content .= '<tr' . $rowclass . '>'; if ($cfpage > 0) { $clientfiles_content .= '<td><a href="' . $thispage . 'cfpage=' . ($cfpage - 1) . '">< Previous Page</a></td>'; } else { $clientfiles_content .= '<td></td>'; } if (floor(($fullcount - 1) / $perpage) > $cfpage) { $clientfiles_content .= '<td align="right"><a href="' . $thispage . 'cfpage=' . ($cfpage + 1) . '">Next Page ></a></td>'; } else { $clientfiles_content .= '<td></td>'; } $clientfiles_content .= '</tr>'; } $clientfiles_content .= '</tbody></table><br />'; // logout form $clientfiles_content .= '<form name="logout" action="#clientlogout" method="post">'; $clientfiles_content .= '<input type="submit" name="submitlogout" value="Client Log Out" />'; $clientfiles_content .= '</form></br>'; #Uncomment this line if you want to use the external comment plugin on a per-client basis # $clientfiles_content .= return_external_comments( return_page_slug() . ':' . $client, get_page_url(True) . '?client=' . $client, return_page_title(). ' ' . $client); } // build page $tmp_content = $start_content . $clientfiles_content . $end_content; } return $tmp_content; }
function set_blog_title() { global $title, $blogSettings, $post; // Declare GLOBAL variables $slug = base64_encode(return_page_slug()); // What page are we on? if ($slug == base64_encode($blogSettings["blogurl"])) { // If we're on the blog page... if (isset($_GET['post']) && !empty($post)) { // If viewing a post... $title = (string) $post->title; // Set title of post } else { if (isset($_GET['archive'])) { // If viewing an archive... // Set the archive title $title = (string) i18n_r(BLOGFILE . '/ARCHIVE_PRETITLE') . date('F Y', strtotime($_GET['archive'])); } else { if (isset($_GET['category'])) { // If viewing a category... $title = (string) i18n_r(BLOGFILE . '/CATEGORY_PRETITLE') . $_GET['category']; // Set category title } } } } $title = strip_tags(strip_decode($title)); // Clean the title variable }
<![endif]--> <!--[if gte IE 9]> <style type="text/css"> .gradient { filter: none; } </style> <![endif]--> </head> <body id="<?php get_page_slug(); ?> " > <div class="navbar navbar-default navbar-static-top" role="navigation"> <div class="container"> <div class="navbar-header"> <div class="navbar-brand"><?php get_site_name(); ?> </div> <button type="button" class="navbar-toggle btn-primary" data-toggle="collapse" data-target=".navbar-collapse">menu</button> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <?php get_i18n_navigation(return_page_slug(FALSE), 0, 1, I18N_SHOW_MENU); ?> </ul> </div> </div> </div>
function return_external_comments($PostID = '', $PageURL = '', $PageTitle = '') { global $external_comments_conf; if ($PostID == '') { $PostID = return_page_slug(); } if ($PageURL == '') { $PageURL = get_page_url(True); } if ($PageTitle == '') { $PageTitle = return_page_title(); } $PostID = addslashes($PostID); $PageURL = addslashes($PageURL); $PageTitle = addslashes($PageTitle); $new_content = "\n<!-- START: external_coments plugin embed code -->\n"; switch ($external_comments_conf['provider']) { case 'Disqus': $new_content .= '<div id="disqus_thread"></div>'; $new_content .= '<script type="text/javascript">'; $new_content .= "var disqus_shortname = '" . $external_comments_conf['shortname'] . "';"; $new_content .= "var disqus_developer = '" . $external_comments_conf['developer'] . "';"; $new_content .= "var disqus_identifier = '" . $PostID . "';"; $new_content .= "var disqus_url = '" . $PageURL . "';"; $new_content .= "var disqus_title = '" . $PageTitle . "';"; $new_content .= <<<INLINECODE (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a> INLINECODE; break; case 'ID': $new_content .= '<script>'; $new_content .= "var idcomments_acct = '" . $external_comments_conf['shortname'] . "';"; $new_content .= "var idcomments_post_id = '" . $PostID . "';"; $new_content .= "var idcomments_post_url = '" . $PageURL . "';"; $new_content .= "</script>"; $new_content .= '<span id="IDCommentsPostTitle" style="display:none"></span>'; $new_content .= "<script type='text/javascript' src='http://www.intensedebate.com/js/genericCommentWrapperV2.js'></script>"; break; case 'livefyre': $new_content .= "<script type='text/javascript' src='http://livefyre.com/wjs/javascripts/livefyre.js'></script>"; $new_content .= "<script type='text/javascript'>var fyre = LF({site_id: " . $external_comments_conf['shortname']; $new_content .= ", article_id: '" . $PostID . "', version: '1.0' }); </script>"; break; case 'vk': $new_content .= "<script type='text/javascript'>VK.init({apiId: " . $external_comments_conf['shortname'] . ", onlyWidgets: true });</script>"; $new_content .= "<div id='vk_comments'></div>"; $new_content .= "<script type='text/javascript'>VK.Widgets.Comments('vk_comments', {page_id: '" . $PostID . "'}); </script>"; break; case 'facebook': $new_content .= '<div id="fb-root"></div>'; $new_content .= '<script src="http://connect.facebook.net/en_US/all.js#appId=APP_ID&xfbml=1"></script>'; $new_content .= '<fb:comments href="' . $PageURL . '" num_posts="" width=""></fb:comments>'; break; } $new_content .= "\n<!-- END: external_coments plugin embed code -->\n"; return $new_content; }
/** * bootstrap_get_breadcrumbs() * * This creates the list for breadcrumbs to the current page. Requires * i18n Navigation plugin for full breadcrumbs list else it creates * a list with only Home / %parent% / %child% * This function support the following plugins: * - i18n Navigation (Supported but doesn't format well unless modified) * - SimpleBreadcrumbs v1.0+ (Preferred) * * @return (string) : String containing HTML <ul> list of breadcrumb data */ function bootstrap_get_breadcrumbs() { if (function_exists('get_breadcrumbs')) { # SimpleBreadcrumbs v1.0+ get_breadcrumbs(return_page_slug()); } elseif (!function_exists('get_i18n_breadcrumbs')) { # i18n Navigation plugin echo '<li><a href="' . get_site_url(FALSE) . '">Home</a></li>'; echo '<li class="current">'; get_i18n_breadcrumbs(return_page_slug()); echo '</li>'; } else { # No supported plugins found! $parent = (string) get_parent(FALSE); echo '<li><a href="' . get_site_url(FALSE) . '">Home</a></li>'; if (!empty($parent) && $parent != 'index') { $file = GSDATAPAGESPATH . $parent . '.xml'; if (file_exists($file)) { $p = getXML($file); $p_title = $p->title; $p_slug = $p->slug; echo '<li><a href="' . find_url($parent, '') . '">' . $p_title . '</a></li>'; } } echo '<li class="active">' . get_page_clean_title(FALSE) . '</li>'; } }
<?php } if ($twitter_creator) { ?> <meta name="twitter:creator" content="@<?php echo $twitter_creator; ?> " /> <?php } ?> <meta name="twitter:title" content="<?php echo get_page_clean_title(); ?> " /> <meta name="twitter:description" content="<?php echo get_page_meta_desc(); ?> " /> <?php if ($this->imageExists(get_theme_url(false) . "/" . $general_image_path . return_page_slug() . '.jpg')) { ?> <meta name="twitter:image" content="<?php echo get_theme_url(false) . "/" . $general_image_path . return_page_slug() . '.jpg'; ?> " /> <?php } ?>
<?php $page = isset($_GET["page"]) ? $_GET["page"] : ""; $setlang = isset($_GET["setlang"]); $result = array(); if ($page == "" || $page == "init" || $setlang) { if (!$setlang) { $page = "index"; } $result["langs"] = return_i18n_languages(); $result["tabs"] = return_i18n_menu_data(return_page_slug(), 0, 0, I18N_SHOW_MENU); //echo $other_lang; } $content = ""; $title = ""; $url = $page; if (isset($pagesArray[$page])) { $data_index = return_i18n_page_data($page); $content = strip_decode($data_index->content); $content = exec_filter('content', $content); $title = strip_decode($data_index->title); $url = strip_decode($data_index->url); } $page_content = array(); $children = return_i18n_menu_data($page, 1, 1, I18N_SHOW_MENU); if (!is_null($children)) { $page_content["children"] = $children; } $page_content["title"] = $title; $page_content["content"] = $content; $result["url"] = $url;
/** * Conditionals to display posts/search/archive/tags/category/importer on front end of website * * @return void */ function blog_display_posts() { global $content, $blogSettings; $Blog = new Blog(); $slug = base64_encode(return_page_slug()); $blogSettings = $Blog->getSettingsData(); $blog_slug = base64_encode($blogSettings["blogurl"]); if ($slug == $blog_slug) { $content = ''; ob_start(); if ($blogSettings["displaycss"] == 'Y') { echo "<style>\n"; echo $blogSettings["csscode"]; echo "\n</style>"; } switch (true) { case isset($_GET['post']) == true: $post_file = BLOGPOSTSFOLDER . $_GET['post'] . '.xml'; show_blog_post($post_file); break; case isset($_POST['search_blog']) == true: search_posts($_POST['keyphrase']); break; case isset($_GET['archive']) == true: $archive = $_GET['archive']; show_blog_archive($archive); break; case isset($_GET['tag']) == true: $tag = $_GET['tag']; show_blog_tag($tag); break; case isset($_GET['category']) == true: $category = $_GET['category']; show_blog_category($category); break; case isset($_GET['import']): auto_import(); break; default: show_all_blog_posts(); break; } $content = ob_get_contents(); ob_end_clean(); } return $content; // legacy support for non filter hook calls to this function }
</div> </div> </div> </div> </div> </div> <div class="container-fluid no-padding"> <div id="sticky-bar" class="logo-slide"> <div class="row"> <div class="col-md-12"> <div class="container"> <ul class="nav nav-pills"> <?php get_navigation(return_page_slug(FALSE)); ?> </ul> <div id="sticky-controls"> <a id="back-to-top" href="#top" class="info theme-icon-up-open" title="" data-placement="bottom" data-original-title="Top" style="display: none;"></a> <div class="register-wrapper"> <a id="sticky-register" class="info-bottom theme-icon-register sticky-button" title="" data-original-title="Register"></a> <div class="sticky-form" id="sticky-register-form" style="display: none;"> <div class="loading"><span class="theme-icon-spin2"></span></div> <form method="post" action="http://www.industrialthemes.com/explicit/wp-login.php?action=register" class="sticky-register-form"><div id="sticky-register-submit" class="sticky-submit register"><span class="theme-icon-check"></span>REGISTER</div><div class="input-group"><span class="input-group-addon theme-icon-username"></span><input type="text" name="user_login" value="" id="user_register" tabindex="11" placeholder="username"></div><div class="input-group"><span class="input-group-addon at-symbol">@</span><input type="text" name="user_email" value="" id="user_email" tabindex="12" placeholder="email"></div><input type="hidden" name="redirect_to" value="/explicit/?register=true"><input type="hidden" name="user-cookie" value="1"> </form> </div>
/** * Get Page/POST Title * This function is a modified version of the core get_page_clean_title() function. It will function normally on all pages except individual blog posts, where the post title will be placed in instead of the page title. * * @return void */ function get_blog_title($echo = true) { global $title, $blogSettings, $post; $slug = base64_encode(return_page_slug()); if ($slug == base64_encode($blogSettings["blogurl"])) { if (isset($_GET['post']) && !empty($post)) { $title = (string) $post->title; } } $myVar = strip_tags(strip_decode($title)); if ($echo) { echo $myVar; } else { return $myVar; } }
function go_child_pages() { $newline = "\r\n"; $active_page = return_page_slug(); $cashepath = GSDATAOTHERPATH . 'child_pages_cache/' . $active_page . '.cache'; if (is_file($cashepath . "nofile")) { echo file_get_contents($cashepath); } else { global $PRETTYURLS; $dir_handle = @opendir(GSDATAPAGESPATH) or exit('Unable to open ...getsimple/data/pages folder'); $active_parent = return_parent(); if (strlen($active_parent) == 0) { $active_parent = return_page_slug(); } $filenames = array(); while ($filename = readdir($dir_handle)) { $filenames[] = $filename; } if (count($filenames) != 0) { sort($filenames); //Sort according to page Slug/URL $arrChildPages = array(); $childmenusortarray = array(); $slugsortorder = 21; //Loop through all pages foreach ($filenames as $file) { if (!($file == '.' || $file == '..' || is_dir(GSDATAPAGESPATH . $file) || $file == '.htaccess')) { $thisfile = file_get_contents(GSDATAPAGESPATH . $file); $XMLdata = simplexml_load_string($thisfile); if ($XMLdata->private != 'Y' and strcmp($XMLdata->parent, $active_parent) == 0) { //Check if not current page if (strcmp($XMLdata->url, $active_page) != 0) { //child pages must be only in parent page if (strcmp($active_parent, $active_page) == 0) { //Build the child menu array $arrChildPages[] = '<p parent="' . $active_parent . '" activepage="' . $active_page . '"><a href="index.php?id=' . $XMLdata->url . '">' . stripslashes(htmlspecialchars_decode($XMLdata->title)) . '</a></p>'; } } } } } //end loop //Sort the child menu numerically according to menu order //array_multisort($childmenusortarray,SORT_ASC,SORT_NUMERIC,$arrChildPages); $strChildPages = ""; foreach ($arrChildPages as $strChildPage) { $strChildPages = $strChildPages . $strChildPage; } if (strlen($strChildPages) > 0) { $strChildPages = '<div id="child_pages">' . $strChildPages . '</div>'; echo '<!-- un-cached -->' . $strChildPages; } else { $strChildPages = ''; //$thismenu='<div id="child_menu"></div>'; //If you want the child menu div even if there is no child menu. } //Check if cache folder exists. if (is_dir(GSDATAOTHERPATH . 'child_pages_cache') == false) { mkdir(GSDATAOTHERPATH . 'child_pages_cache', 0755) or exit('Unable to create ...getsimple/data/other/child_pages_cache folder'); } //Save cached child pages file. $fp = @fopen($cashepath, 'w') or exit('Unable to save ...getsimple/data/other/child_pages_cache/' . $active_page); fwrite($fp, $strChildPages); fclose($fp); } } }
<div class="col-xs-12 logo"> <div class="container"> <div class="row"> <div class="col-xs-3 col-xs-offset-2 text-center"> </div> </div> </div> </div> </div> </div> <div class="separator"></div> <?php if (return_page_slug() != 'news') { ?> <div class="container"> <div class="row"> <?php nm_set_custom_excerpt(150); ?> <?php nm_set_custom_maxposts(3); ?> <?php nm_custom_display_recent(' <div class="col-xs-12 col-sm-4 recentnews-block"> <a href="{{ post_link }}"> <h4>{{ post_title }}</h4> <span class="my_excerpt">{{ post_excerpt }}</span>
/** * Check to see if a front end page is for members only * Display protected message if page is members only and user is not logged in * * @return bool */ public function checkPerm() { //Get Current Page Slug And XML File $the_page_slug_xml = GSDATAPAGESPATH . return_page_slug() . '.xml'; $page_data = getXML($the_page_slug_xml); //Check If Page Is For Members Only if ($page_data->memberonly == "yes") { //If The Page Is For Members Only And The User Is Not Logged In Display protected Message if (!isset($_SESSION['LoggedIn'])) { return false; } else { return true; } } else { return true; } }
<img src="<?php echo $themeurl; ?> /images/sidebar2.png" width="83" height="65" alt="open sidebar menu button" /> </div> <div id="horizon-logo"> <img src="<?php echo $themeurl; ?> /images/logo_banner.png" width="930" height="210" alt="Kevin Finnegan Logo" /> </div> <ul id="navibar"> <?php get_navigation(return_page_slug()); ?> </ul> </div> </div> <!--CONTAINER DIV--> <div id="container" style="background-image:url(<?php echo $themeurl; ?> /images/noise_pale.jpg)"> <!--MAIN CMS CONTENT--> <?php get_page_content(); ?>
if (count($languages) > 1) { $other_lang = $languages[1]; } else { $other_lang = $languages[0]; } $txt = "English"; if ($other_lang != "en") { $txt = "Français"; } ?> <a href="<?php echo return_i18n_setlang_url($other_lang); ?> "><?php echo $txt; ?> </a> </div> </div> <!-- NAVIGATION BAR --> <nav class="topnav hw-auto center right upper"> <label for="show-menu" class="show-menu">Menu</label> <input id="show-menu" type="checkbox" role="button"> <div id="navmenu" class="topmenu root"> <?php get_i18n_navigation(return_page_slug(), 0, 2, I18N_SHOW_MENU, 'navbar'); ?> </div> </nav> </div>