Categories > TinyButStrong general >

Help with Display By Pages e Navigator Bar

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Marcos Borges
Date: 2006-07-14
Time: 17:38

Help with Display By Pages e Navigator Bar

PHP CODE:
define("POR_PAGINA","10");
###########################################
# Begin - Page Control                  #
###########################################
    if (!isset($_GET)) $_GET=&$HTTP_GET_VARS ;

    if (isset($_GET['PageNum'])) {
        $_SESSION['Paginacao'][$PATH]['PageNum'] = $_GET['PageNum'] ;
    } elseif(!isset($_SESSION['$Paginacao'][$PATH])) {
        $_SESSION['Paginacao'][$PATH]['PageNum'] = 1 ;
    }
   
    if (isset($_GET['RecCnt'])) {
      $_SESSION['Paginacao'][$PATH]['RecCnt'] = intval($_GET['RecCnt']);
    } else {
        $_SESSION['Paginacao'][$PATH]['RecCnt'] = -1;
    }
###########################################
# End - Page Control                  #
###########################################

$blkModulos = mysql_query("SELECT * FROM TB_MODULOS");

$objTBS->PlugIn(TBS_BYPAGE,POR_PAGINA,$_SESSION['Paginacao'][$PATH]['PageNum'],$_SESSION['$Paginacao'][$PATH]['RecCnt']);
$_SESSION['$Paginacao'][$PATH]['RecCnt'] = $objTBS->MergeBlock('blkModulo',$blkModulos);
$objTBS->PlugIn(TBS_NAVBAR,'nv','',$_SESSION['Paginacao'][$PATH]['PageNum'],$_SESSION['$Paginacao'][$PATH]['RecCnt'],POR_PAGINA);
$objTBS->Show();

HTML CODE

<table  align="center" cellpadding="2" cellspacing="1" style="border:1px solid #000066;">
[blkModulo;block=begin]
  <tr>
    <td class="item_menu">[blkModulo.id]</td>
    <td class="item_menu">[blkModulo.nome]</td>
    <td align="center" class="item_menu">[blkModulo.datahora; frm=dd/mm/yyyy]</td>
  </tr>
[blkModulo;block=end]
</table>
<table  align="center" cellpadding="2" cellspacing="1" style="border:1px solid #000066;">
  <tr align="center">
    <td width="16" bgcolor="#EEEEEE"><a href="[var..script_name]?PageNum=[nv.first;endpoint;magnet=a;mtype=m+m]">|&lt;</a></td>
    <td width="16" bgcolor="#EEEEEE"><a href="[var..script_name]?PageNum=[nv.prev;endpoint;magnet=a;mtype=m+m]">&lt;</a></td>
    <td width="16" bgcolor="#EEEEEE"><a href="[var..script_name]?PageNum=[nv.page;block=td;navsize=3;navpos=centred]">[nv.page]</a></td>
    <td width="16" bgcolor="#C4E1E1"><strong>[nv.page;block=td;currpage]</strong></td>
    <td width="16" bgcolor="#EEEEEE"><a href="[var..script_name]?PageNum=[nv.next;endpoint;magnet=a;mtype=m+m]">&gt;</a></td>
    <td width="16" bgcolor="#EEEEEE"><a href="[var..script_name]?PageNum=[nv.last;endpoint;magnet=a;mtype=m+m]">&gt;|</a></td>
  </tr>
</table>


MY TBS VERSION IS 3.1.0
The big problem is that my "tbs navigator bar", is showing one page. But i have 120 records  by 10 i will have 12 pages

Can you help me ???
By: Skrol29
Date: 2006-07-14
Time: 21:14

Re: Help with Display By Pages e Navigator Bar

Can you just check that the variable   $_SESSION['$Paginacao'][$PATH]['RecCnt']
contains the expected value 120 just before to use $objTBS->PlugIn(TBS_NAVBAR,...) when you have the problem ?