Jump to content

jirimail

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jirimail's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, i think i start understanding The thing is that this first script shows all the pages function page($url) { global $page; $pages=1; for ($starter=0; $this->total>$starter; $starter+=$this->limit) { if ($pages != $page) echo "<a href=\"".$url.$pages."\" class=\"page\">$pages</a> \n"; else echo "<b>[ $pages ]</b> \n"; $pages++; } } And than i though, if i add this code that should cut off the rest of the pages and shows etc: 5 6 7 [8] 9 10 11 if ($pages < $page - 3 && $pages > $page + 3) return; but it still goes: 1 2 3 4 5 ...65 [66] 67 68 still not taking care of the first pages..
  2. continue and than? another if? Im not so advanced in php, normally it takes ma a day, to customize simple script
  3. Thank you for that, but it seems that still only one half of the line is working.. I keeps ignoring the left side of the script.. Any onter suggestions??
  4. Hope someone could help, should be easy I have this code to limit number of shown pages for my pagination, but it doesnt work. Any other ideas how to set condiditin AND codition?? As in this code: if ($pages < $page - 3 || $pages > $page + 3) return; The whole script is: should work, but it doest, going mad from it ??? function page($url) { global $page; $pages=1; for ($starter=0; $this->total>$starter; $starter+=$this->limit) { if ($pages != $page) echo "<a href=\"".$url.$pages."\" class=\"page\">$pages</a> \n"; else echo "<b>[ $pages ]</b> \n"; $pages++; if ($pages < $page - 3 || $pages > $page + 3) return; } }
  5. Hey guys, hope someone could help me with this. Im guite new to php. Actully just doing it to customize some script on my server. I need to show only few pages on my site, so i have this script wich it does for me, but only on one side: if ($pages < $page-3) return; but need add to it the other side as well: ($pages > $page+3) When i tried elseif, that didnt work.. Here is the whole script: function page($url) { global $page; $pages=1; for ($starter=0; $this->total>$starter; $starter+=$this->limit) { if ($pages != $page) echo "<a href=\"".$url.$pages."\" class=\"page\">$pages</a> \n"; else echo "<b>[ $pages ]</b> \n"; $pages++; if ($pages < $page-3) return; } } Anyone could help? Im honestly lost.. Thank you Jiri
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.