/** * Writes the html limit # input box */ function writeLimitBox() { echo mosPageNav::getLimitBox(); }
/** * Writes the html limit # input box * @param string The basic link to include in the href */ function writeLimitBox($link) { echo mosPageNav::getLimitBox($link); }
/** * 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; }
$and = ''; // administrator check if ($my->gid == 24) { $and = "\n AND userid != '25'"; } // manager check if ($my->gid == 23) { $and = "\n AND userid != '25'"; $and .= "\n AND userid != '24'"; } // get the total number of records $query = "SELECT COUNT(*)" . "\n FROM #__session" . "\n WHERE userid != 0" . $and . "\n ORDER BY usertype, username"; $database->setQuery($query); $total = $database->loadResult(); // page navigation $pageNav = new mosPageNav($total, $limitstart, $limit); $query = "SELECT *" . "\n FROM #__session" . "\n WHERE userid != 0" . $and . "\n ORDER BY usertype, username"; $database->setQuery($query, $pageNav->limitstart, $pageNav->limit); $rows = $database->loadObjectList(); ?> <table class="adminlist"> <tr> <th colspan="4"> Currently Logged in Users </th> </tr> <?php $i = 0; foreach ($rows as $row) { if ($acl->acl_check('administration', 'manage', 'users', $my->usertype, 'components', 'com_users')) { $link = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id=' . $row->userid;
function BlogOutput(&$rows, &$params, $gid, &$access, $pop, &$menu, $archive = NULL) { global $mainframe, $Itemid, $task, $id, $option, $database, $mosConfig_live_site; // parameters if ($params->get('page_title', 1)) { $header = $params->def('header', $menu->name); } else { $header = ''; } $columns = $params->def('columns', 2); if ($columns == 0) { $columns = 1; } $intro = $params->def('intro', 4); $leading = $params->def('leading', 1); $links = $params->def('link', 4); $pagination = $params->def('pagination', 2); $pagination_results = $params->def('pagination_results', 1); $pagination_results = $params->def('pagination_results', 1); $descrip = $params->def('description', 1); $descrip_image = $params->def('description_image', 1); // needed for back button for page $back = $params->get('back_button', $mainframe->getCfg('back_button')); // needed to disable back button for item $params->set('back_button', 0); $params->def('pageclass_sfx', ''); $params->set('intro_only', 1); $total = count($rows); // pagination support $limitstart = intval(mosGetParam($_REQUEST, 'limitstart', 0)); $limit = $intro + $leading + $links; if ($total <= $limit) { $limitstart = 0; } $i = $limitstart; // needed to reduce queries used by getItemid $ItemidCount['bs'] = $mainframe->getBlogSectionCount(); $ItemidCount['bc'] = $mainframe->getBlogCategoryCount(); $ItemidCount['gbs'] = $mainframe->getGlobalBlogSectionCount(); // used to display section/catagory description text and images // currently not supported in Archives if ($menu->componentid && ($descrip || $descrip_image)) { switch ($menu->type) { case 'content_blog_section': $description = new mosSection($database); $description->load($menu->componentid); break; case 'content_blog_category': $description = new mosCategory($database); $description->load($menu->componentid); break; case 'content_blog_category': case 'components': default: $menu->componentid = 0; break; } } // Page Output // page header if ($header) { echo '<div class="componentheading' . $params->get('pageclass_sfx') . '">' . $header . '</div>'; } if ($archive) { echo '<br />'; echo mosHTML::monthSelectList('month', 'size="1" class="inputbox"', $params->get('month')); echo mosHTML::integerSelectList(2000, 2010, 1, 'year', 'size="1" class="inputbox"', $params->get('year'), "%04d"); echo '<input type="submit" class="button" />'; } // checks to see if there are there any items to display if ($total) { $col_with = 100 / $columns; // width of each column $width = 'width="' . $col_with . '%"'; if ($archive) { // Search Success message $msg = sprintf(_ARCHIVE_SEARCH_SUCCESS, $params->get('month'), $params->get('year')); echo "<br /><br /><div align='center'>" . $msg . "</div><br /><br />"; } echo '<table class="' . $params->get('pageclass_sfx') . '" cellpadding="0" cellspacing="0">'; // Secrion/Category Description & Image if ($menu->componentid && ($descrip || $descrip_image)) { $link = $mosConfig_live_site . '/images/stories/' . $description->image; echo '<tr>'; echo '<td valign="top">'; if ($descrip_image) { echo '<img src="' . $link . '" align="' . $description->image_position . '" hspace="6" alt="" />'; } if ($descrip) { echo $description->description; } echo '<br/><br/>'; echo '</td>'; echo '</tr>'; } // Leading story output if ($leading) { echo '<tr>'; echo '<td valign="top">'; for ($z = 0; $z < $leading; $z++) { if ($i >= $total) { // stops loop if total number of items is less than the number set to display as leading break; } echo '<div>'; show($rows[$i], $params, $gid, $access, $pop, $option, $ItemidCount); echo '</div>'; $i++; } echo '</td>'; echo '</tr>'; } if ($intro && $i < $total) { echo '<tr>'; echo '<td valign="top">'; echo '<table width="100%" cellpadding="0" cellspacing="0">'; // intro story output for ($z = 0; $z < $intro; $z++) { if ($i >= $total) { // stops loop if total number of items is less than the number set to display as intro + leading break; } if (!($z % $columns) || $columns == 1) { echo '<tr>'; } echo '<td valign="top" ' . $width . '>'; // outputs either intro or only a link if ($z < $intro) { show($rows[$i], $params, $gid, $access, $pop, $option, $ItemidCount); } else { echo '</td>'; echo '</tr>'; break; } echo '</td>'; if (!(($z + 1) % $columns) || $columns == 1) { echo '</tr>'; } $i++; } // this is required to output a final closing </tr> tag when the number of items does not fully // fill the last row of output - a blank column is left if ($intro % $columns) { echo '</tr>'; } echo '</table>'; echo '</td>'; echo '</tr>'; } // Links output if ($links && $i < $total) { echo '<tr>'; echo '<td valign="top">'; echo '<div class="blog_more' . $params->get('pageclass_sfx') . '">'; HTML_content::showLinks($rows, $links, $total, $i, 1, $ItemidCount); echo '</div>'; echo '</td>'; echo '</tr>'; } // Pagination output if ($pagination) { if ($pagination == 2 && $total <= $limit) { // not visible when they is no 'other' pages to display } else { // get the total number of records $limitstart = $limitstart ? $limitstart : 0; require_once $GLOBALS['mosConfig_absolute_path'] . '/includes/pageNavigation.php'; $pageNav = new mosPageNav($total, $limitstart, $limit); if ($option == 'com_frontpage') { $link = 'index.php?option=com_frontpage&Itemid=' . $Itemid; } else { if ($archive) { $year = $params->get('year'); $month = $params->get('month'); $link = 'index.php?option=com_content&task=' . $task . '&id=' . $id . '&Itemid=' . $Itemid . '&year=' . $year . '&month=' . $month; } else { $link = 'index.php?option=com_content&task=' . $task . '&id=' . $id . '&Itemid=' . $Itemid; } } echo '<tr>'; echo '<td valign="top" align="center">'; echo $pageNav->writePagesLinks($link); echo '<br /><br />'; echo '</td>'; echo '</tr>'; if ($pagination_results) { echo '<tr>'; echo '<td valign="top" align="center">'; echo $pageNav->writePagesCounter(); echo '</td>'; echo '</tr>'; } } } echo '</table>'; } else { if ($archive && !$total) { // Search Failure message for Archives $msg = sprintf(_ARCHIVE_SEARCH_FAILURE, $params->get('month'), $params->get('year')); echo '<br /><br /><div align="center">' . $msg . '</div><br />'; } else { // Generic blog empty display echo _EMPTY_BLOG; } } // Back Button $params->set('back_button', $back); mosHTML::BackButton($params); }
/** * Page break mambot * * <b>Usage:</b> * <code>{mospagebreak}</code> * <code>{mospagebreak title="The page title"}</code> * <code>{mospagebreak title="The page title" toc="1"}</code> * * Note that the following syntax is deprecated * <code>{mospagebreak title=The page title&toc=1}</code> * * If <i>title</i> is specified, then a page sub-title is included * * If <i>toc</i> is specified, then a table of contents is included */ function botMosPaging($published, &$row, &$params, $page = 0) { global $mosConfig_live_site; global $mainframe, $Itemid; if (!$published || $params->get('intro_only') || $params->get('popup')) { $row->text = preg_replace('/{mospagebreak\\s*.*?}/i', '', $row->text); return; } // $bots holds all the mospagebreak mambots preg_match_all('/{(mospagebreak)\\s*(.*?)}/i', $row->text, $bots, PREG_SET_ORDER); // split the text around the mambot $text = preg_split('/{(mospagebreak)\\s*(.*?)}/i', $row->text); // count the number of pages $n = count($text); if ($n > 1) { // we have found at least one mambot, therefore at least 2 pages // reset the text, we already hold it in the $text array $row->text = ""; $hasToc = false; $hasTitle = false; $args = array(); if (@$bots[$page - 1]) { // we have a mambot for this page if (@$bots[$page - 1][2]) { // the mambot has arguments parse_str(str_replace('&', '&', $bots[$page - 1][2]), $args); if (@$args['toc'] == '1' || @$args['toc'] == 'yes') { $hasToc = true; } if (@$args['title']) { $hasTitle = true; } } } $hasToc = $mainframe->getCfg('multipage_toc'); if ($hasToc) { $link = 'index.php?option=com_content&task=view&id=' . $row->id . '&Itemid=' . $Itemid; $row->toc = '<table cellpadding="0" cellspacing="0" class="contenttoc" align="right">'; $row->toc .= '<tr>'; $row->toc .= '<th>' . _TOC_JUMPTO . '</th>'; $row->toc .= '</tr>'; $row->toc .= '<tr>'; $row->toc .= '<td><a href="' . sefRelToAbs($link) . '" class="toclink">' . $row->title . '</a></td>'; $row->toc .= '</tr>'; $i = 2; $nextTitle = _PN_PAGE . ' ' . ($page + 2); foreach ($bots as $bot) { $link2 = $link . '&limit=1&limitstart=' . ($i - 1); if (@$bot[2]) { parse_str(str_replace('&', '&', $bot[2]), $args2); if (@$args2['title']) { $row->toc .= '<tr><td><a href="' . sefRelToAbs($link2) . '" class="toclink">' . $args2['title'] . '</a></td></tr>'; if ($page == $i - 2) { $nextTitle = $args2['title']; } } else { $row->toc .= '<tr><td><a href="' . sefRelToAbs($link2) . '" class="toclink">' . _PN_PAGE . ' ' . $i . '</a></td></tr>'; } } else { $row->toc .= '<tr><td><a href="' . sefRelToAbs($link2) . '" class="toclink">' . _PN_PAGE . ' ' . $i . '</a></td></tr>'; } $i++; } $row->toc .= '</table>'; } 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>'; // the page text $row->text .= $text[$page]; $row->text .= '<br />'; $row->text .= '<div class="pagenavbar">'; if ($hasToc) { $link = 'index.php?option=com_content&task=view&id=' . $row->id . '&Itemid=' . $Itemid; if ($page < $n - 1) { $link_next = $link . '&limit=1&limitstart=' . ($page + 1); //$nextTitle = mosGetParam( $_REQUEST, 'nextTitle ', 0 ); // hack to hide undefined var when error reporting on max //$name = isset($args2['title']) ? $nextTitle : ""; $next = "<a href=\"" . sefRelToAbs($link_next) . "\">" . _CMN_NEXT . _CMN_NEXT_ARROW . "</a>"; } else { $next = _CMN_NEXT; } if ($page > 0) { $link_prev = $link . '&limit=1&limitstart=' . ($page - 1); $prev = "<a href=\"" . sefRelToAbs($link_prev) . "\">" . _CMN_PREV_ARROW . _CMN_PREV . "</a>"; } else { $prev = _CMN_PREV; } $row->text .= '<div>' . $prev . " - " . $next . '</div>'; } // the page links 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; }
function showBook($Itemid, $book, $verses, $limitstart, $pageNav) { global $Itemid, $my, $HTTP_SERVER_VARS; global $mosConfig_hideAuthor, $mosConfig_offset, $mosConfig_live_site; $link = sefRelToAbs("index.php?option=bible&task=viewBook&id=" . $book->ordering . "&Itemid=" . $Itemid); $showNav = !strpos($HTTP_SERVER_VARS['PHP_SELF'], "index2.php"); require_once $GLOBALS['mosConfig_absolute_path'] . '/includes/pageNavigation.php'; if ($showNav) { $pageNav = new mosPageNav($book->qtdChapters, $limitstart, 1); } if ($sectionid != 0) { $id = $sectionid; } if (get_class($title) == 'mossection') { $catid = 0; } else { $catid = $title->id; } ?> <div class="contentheading"> <span style="float: right" class="small"> <?php if ($showNav) { $chapters = array(); for ($i = 0; $i < $book->qtdChapters; $i++) { $chapters[] = mosHTML::makeOption("{$i}", $i + 1); } // build the html select list $link = sefRelToAbs($link . '&limitstart=\' + (this.options[selectedIndex].value) + \''); echo mosHTML::selectList($chapters, 'limitstart', 'class="inputbox" size="1" onchange="document.location.href=\'' . $link . '\';"', 'value', 'text', $limitstart); } ?> </span> <?php echo $book->bookName . " " . ($limitstart + 1); ?> </div> <table class="contentpaneopen"> <?php if ($verses) { ?> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="3"> <?php foreach ($verses as $row) { ?> <tr><td valign='top'><i><a name='<?php echo $row->verse; ?> '><?php echo $row->verse; ?> </a></i></td><td><?php echo $row->verseText; ?> </td></tr> <?php } ?> </table> </td> </tr> <?php } ?> </table> <?php if ($showNav) { ?> <div class="small"> <span style="float: right"> <?php echo $pageNav->writePagesCounter(); ?> </span> <?php echo "\n<a href=\"" . sefRelToAbs("index.php?option=bible&task=viewBooks&Itemid=" . $Itemid) . "\" class=\"readon\">" . _BIBLE_SELECT_BOOK . "</a>"; ?> </div> <div class="small" style="text-align: center;"> <?php if ($showNav) { echo $pageNav->writePagesLinks(sefRelToAbs("index.php?option=bible&task=viewBook&id=" . $book->ordering . "&Itemid=" . $Itemid)); } ?> </div> <?php } }