function showGallery() { // Builds main gallery page global $file, $gallery_address, $gallery_root, $user_level, $lg_text_domain; get_currentuserinfo(); echo "<div id='gallery'>"; // get_image_comments(); if (!validateFile()) { echo "<div class='error'>"; echo "<p><b>" . __('WARNING', $lg_text_domain) . ": </b>" . __('Unable to access to the Gallery Folder', $lg_text_domain); echo "</p>"; echo "<p>" . __('Check your settings', $lg_text_domain); if ($user_level >= 8) { echo "<a href='" . get_option('siteurl') . "/wp-admin/" . LG_ADM_PAGE . "'>"; _e('here', $lg_text_domain); echo "</a>"; } echo "</p></div>"; return; } createNavigation(); $path = pathinfo($file); if ($path['extension'] == '') { //Display Dir(s) (if any) showDirs(); //Display Thumb(s) (if any) showThumbs(); } else { showSlide($file); } if ($user_level >= 8) { echo "<div class='lg_admin'>"; echo "<a href='" . get_option('siteurl') . "/wp-admin/" . LG_ADM_PAGE . "'>"; _e('» Administrate Gallery', $lg_text_domain); echo "</a>"; echo "</div>"; } //echo "<div id='lg_powered'> // <div class='lgpow'>Powered by <a href='http://lazyest.keytwo.net'>Lazyest Gallery ". LG_VERSION ."</a> - Copyright (C) <a href='http://www.keytwo.net'>Keytwo.net</a></div> // </div>"; // comments_template(); echo "</div>"; }
/** * Page break mambot * * <b>Usage:</b> * <code>{mospagebreak}</code> * <code>{mospagebreak title=The page title}</code> * or * <code>{mospagebreak heading=The first page}</code> * or * <code>{mospagebreak title=The page title&heading=The first page}</code> * or * <code>{mospagebreak heading=The first page&title=The page title}</code> * */ function botMosPaging($published, &$row, &$params, $page = 0) { global $mainframe, $Itemid, $database, $_MAMBOTS; // simple performance check to determine whether bot should process further if (strpos($row->text, 'mospagebreak') === false) { return true; } // expression to search for $regex = '/{(mospagebreak)\\s*(.*?)}/i'; // check whether mambot has been unpublished if (!$published || $params->get('intro_only') || $params->get('popup')) { $row->text = preg_replace($regex, '', $row->text); return; } // find all instances of mambot and put in $matches $matches = array(); preg_match_all($regex, $row->text, $matches, PREG_SET_ORDER); // split the text around the mambot $text = preg_split($regex, $row->text); // count the number of pages $n = count($text); // we have found at least one mambot, therefore at least 2 pages if ($n > 1) { // check if param query has previously been processed if (!isset($_MAMBOTS->_content_mambot_params['mospaging'])) { // load mambot params info $query = "SELECT params" . "\n FROM #__mambots" . "\n WHERE element = 'mospaging'" . "\n AND folder = 'content'"; $database->setQuery($query); $database->loadObject($mambot); // save query to class variable $_MAMBOTS->_content_mambot_params['mospaging'] = $mambot; } // pull query data from class variable $mambot = $_MAMBOTS->_content_mambot_params['mospaging']; $botParams = new mosParameters($mambot->params); $title = $botParams->def('title', 1); // adds heading or title to <site> Title if ($title) { $page_text = $page + 1; $row->page_title = _PN_PAGE . ' ' . $page_text; if (!$page) { // processing for first page parse_str(html_entity_decode($matches[0][2]), $args); if (@$args['heading']) { //$row->page_title = $args['heading']; $row->page_title = ''; } else { $row->page_title = ''; } } else { if ($matches[$page - 1][2]) { parse_str(html_entity_decode($matches[$page - 1][2]), $args); if (@$args['title']) { $row->page_title = ': ' . stripslashes($args['title']); } } } } // reset the text, we already hold it in the $text array $row->text = ''; $hasToc = $mainframe->getCfg('multipage_toc'); if ($hasToc) { // display TOC createTOC($row, $matches, $page); } else { $row->toc = ''; } // traditional mos page navigation require_once $GLOBALS['mosConfig_absolute_path'] . '/includes/pageNavigation.php'; $pageNav = new mosPageNav($n, $page, 1); // page counter $row->text .= '<div class="pagenavcounter">'; $row->text .= $pageNav->writeLeafsCounter(); $row->text .= '</div>'; // page text $row->text .= $text[$page]; $row->text .= '<br />'; $row->text .= '<div class="pagenavbar">'; // adds navigation between pages to bottom of text if ($hasToc) { createNavigation($row, $page, $n); } // page links shown at bottom of page if TOC disabled if (!$hasToc) { $row->text .= $pageNav->writePagesLinks('index.php?option=com_content&task=view&id=' . $row->id . '&Itemid=' . $Itemid); } $row->text .= '</div><br />'; } return true; }
/** * Page break mambot * * <strong>Usage:</strong> * <code>{mospagebreak}</code> * <code>{mospagebreak title=The page title}</code> * or * <code>{mospagebreak heading=The first page}</code> * or * <code>{mospagebreak title=The page title&heading=The first page}</code> * or * <code>{mospagebreak heading=The first page&title=The page title}</code> * */ function botMosPaging($published, &$row, &$cparams, $page = 0, $params) { global $mainframe, $Itemid, $database, $configuration; if (strtolower(get_class($row)) != 'mosextendedcontent') { return; } // expression to search for $regex = '/{(mospagebreak)\\s*(.*?)}/i'; if (!$published || $cparams->get('intro_only') || $cparams->get('popup')) { $row->text = preg_replace($regex, '', $row->text); return; } // find all instances of mambot and put in $matches $matches = array(); preg_match_all($regex, $row->text, $matches, PREG_SET_ORDER); // split the text around the mambot $text = preg_split($regex, $row->text); $matches[0][2] = @html_entity_decode($matches[0][2], ENT_QUOTES, strtoupper($configuration->current_language->charset)); // count the number of pages $n = count($text); // we have found at least one mambot, therefore at least 2 pages if ($n > 1) { // load mambot params info $title = $params->def('title', 1); // adds heading or title to <site> Title if ($title) { $page_text = $page + 1; $row->page_title = T_('Page') . ' ' . $page_text; if (!$page) { // processing for first page parse_str($matches[0][2], $args); if (@$args['heading']) { $row->page_title = $args['heading']; } else { $row->page_title = ''; } } else { if ($matches[$page - 1][2]) { parse_str($matches[$page - 1][2], $args); if (@$args['title']) { $row->page_title = $args['title']; } } } } // reset the text, we already hold it in the $text array $row->text = ''; $hasToc = $mainframe->getCfg('multipage_toc'); if ($hasToc) { // display TOC createTOC($row, $matches, $page); } else { $row->toc = ''; } // traditional mos page navigation require_once $GLOBALS['mosConfig_absolute_path'] . '/includes/pageNavigation.php'; $pageNav = new mosPageNav($n, $page, 1); // page counter $row->text .= '<div class="pagenavcounter">'; $row->text .= $pageNav->writeLeafsCounter(); $row->text .= '</div>'; // page text $row->text .= $text[$page]; $row->text .= '<br />'; $row->text .= '<div class="pagenavbar">'; // adds navigation between pages to bottom of text if ($hasToc) { createNavigation($row, $page, $n); } // page links shown at bottom of page if TOC disabled if (!$hasToc) { $row->text .= $pageNav->writePagesLinks('index.php?option=com_content&task=view&id=' . $row->id . '&Itemid=' . $Itemid); } $row->text .= '</div><br />'; } return true; }