close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

truncate pagination

Thread began 12/03/2018 1:50 am by Jamie | Last modified 12/17/2018 8:27 am by Jamie | 2013 views | 7 replies

Jamie

truncate pagination

Hey Ray

Am trying to figure out how to get my pagination code

<div class="container paginationContainer">
<?php if ($Categories->PageNum > 0) { // Show if mysqli not first page ?>
<a href="<?php echo $Categories->getFirstPageLink(); ?>" class="link-text paginationLink">&lt;&lt;</a>
<?php } // Show if mysqli not first page ?>
<?php if ($Categories->PageNum > 0) { // Show if mysqli not first page ?>
<a href="<?php echo $Categories->getPrevPageLink(); ?>" class="link-text paginationLink">&lt;</a>
<?php } // Show if mysqli not first page ?>
<?php

$totalRows_Categories = $Categories_Total;

$pageNum_Categories = 0;
if (isset($_GET['pageNum_Categories'])) {
$pageNum_Categories = $_GET['pageNum_Categories'];
}

$incdone = false;
if ($maxRows_Categories == 0)
{
$maxRows_Categories =1;
$incdone = true;
}

$totalPages_Categories = ceil($totalRows_Categories/$maxRows_Categories)-1;


if($totalPages_Categories > 0 && !$incdone )
{
$elems = array();
for ($i=0;$i<$Req_Pages;$i++)
{
if ($i==$pageNum_Categories)
{

$elems[] = "<span class=\"paginationLinkActive\">".($i+1)."</span>";
}
else
{
$elems[] = "<a href=\"".$Categories->getPageLink($i)."\" class=\"link-text paginationLink\">".($i+1)."</a>";
}
}

echo implode(" ",$elems);
}
?>
<?php if ($Categories->PageNum < $Categories->TotalPages) { // Show if mysqli not last page ?>
<a href="<?php echo $Categories->getNextPageLink(); ?>" class="link-text paginationLink">&gt;</a>
<?php } // Show if mysqli not first page ?>
<?php if ($Categories->PageNum < $Categories->TotalPages) { // Show if mysqli not last page ?>
<a href="<?php echo $Categories->getLastPageLink(); ?>" class="link-text paginationLink">&gt;&gt;</a>
<?php } // Show if mysqli not first page ?>
</div>

which looks like this http://prntscr.com/lq09yc so that it outputs like the top demo on this codepen https://codepen.io/allicarn/pen/jPowab (the one title '12 Elements') and has the same sort of function as you click through

Many thanks

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...