php - How to change current pagination to show "back" and "next" instead of page numbers? -


I just want to be able to show "back" if the user is on another page but page # 1 and then "Next" should be shown on all pages, except for the last page / * Setup for page wars * / if ($ page == 0) $ page = 1; // If no page is given var, for default 1. // next page page + 1 $ lastpage = roof ($ total_pages / $ limit); // Last page = Total page / page per page, rounded. $ Lpm1 = $ last page - 1; // Final page zero 1 / * Now we apply our rules and attract the object of panning the page. We are actually saving the code in a variable, if we want to attract it more than once. * / $ Paging = ""; If ($ lastpage & gt; 1) {$ points on the page. = "& Lt; div class = \" endorsement \ "& gt; & lt; / div & gt;"; // If the last button ($ page & gt; 1) $ endorsement = ""; And $ Pagination = ""; // pages ($ lastpage & lt; 7 + ($ impending * 2)) // There are not enough pages to break it ($ counter = 1; $ counter & lt; = $ lastpage; $ counter ++) { If ($ counter == $ page) $ page pagination = "& Lt; an id = \" numeriographer \ "href = \" $ targetpage? Page = $ counter \ "& gt; back & amp; nbsp; & lt; / a & gt;"; Paging on other $ page = "& Lt; an id = \" number hier glower \ "href = \" $ targetpage? Page = $ counter \ "& gt; next & amp; nbsp; & lt; / a & gt;"; }} Elseif ($ lastpage> 5 + ($ impending * 2)) // There are enough pages to hide some pages {// close to the beginning; Hide only the following pages if ($ page & lt; 1 + ($ adjacent * 2)) {for ($ counter = 1; $ counter <4 + ($ adjacents * 2); $ counter ++) { Pagination on $ ($ counter == $ page) $ page = "& Lt; span class = \" current \ "& gt; $ counter & amp; nbsp; & lt; / span & gt;"; And $ Pagination = "& Lt; a href = \" $ targetpage? Page = $ counter \ "& gt; $ counter & amp; nbsp; & lt; / a & gt;"; } $ Page calculation. = "..."; $ Pagination = "& Lt; a href = \" $ targetpage? Page = $ lpm1 \ "& gt; $ lpm1 & lt; / a & gt;"; $ Pagination = "& Lt; a href = \" $ targetpage? Page = $ lastpage \ "& gt; $ end page & lt; / a & gt;"; } //middle of; Some $$$$$$$ page & amp; Amp; $ Page & gt; ($ Imminent * 2)) $ {$ pageagin = "& Lt; a href = \" $? Targetpage page = 1 \ "& gt; 1 & lt; / a & gt;"; $ Pagination = "& Lt; a href = \" $ targetpage? Page = 2 \ "& gt; 2 & lt; / a & gt;"; $ Endorsement = "..."; ($ Counter = $ page - $ adjacents; $ counter & lt; = $ page + $ adjacents; $ counter ++) {if ($ counter == $ page) $ endorsement = "& Lt; span class = \" current \ "& gt; $ counter & lt; / span & gt;"; And $ Pagination = "& Lt; a href = \" $ targetpage? Page = $ counter \ "& gt; $ counter & lt; / a & gt;"; } $ Page calculation. = "..."; $ Pagination = "& Lt; a href = \" $ targetpage? Page = $ lpm1 \ "& gt; $ lpm1 & lt; / a & gt;"; $ Pagination = "& Lt; a href = \" $ targetpage? Page = $ lastpage \ "& gt; $ end page & lt; / a & gt;"; } // close to ending; Hide only the initial pages {$ Paginagan. = "& Lt; a href = \" $ targetpage? Page = 1 \ "& gt; 1 & lt; / a & gt;"; $ Pagination = "& Amp; nbsp & amp; nbsp; & amp; nbsp; & lt; a href = \" $ targetpage? Page = 2 \ "& gt; 2 & amp; amp; & lt; / a & gt;"; $ Endorsement = "..."; $ Counter = $ lastpage - (2 + ($ imminent * 2)); $ Counter & lt; = $ Lastpage; $ Counter ++) {if ($ counter == $ page) $ endorsement = "& Lt; span class = \" current \ "& gt; $ counter & lt; / span & gt;"; And $ Pagination = "& Lt; a href = \" $ targetpage? Page = $ counter \ "& gt; $ counter & lt; / a & gt;"; }} // Next button if ($ page <$ counter - 1) $ endorsement = ""; And $ Pagination = ""; }

? & Gt;

First of all, specify code> $ next and then specify the total page number $ Next = $ total_pages

then check

  if ($ next == $ total_pages + 1) {nothing ....} And { Echo "and    

Comments