ofi Posted February 13, 2007 Share Posted February 13, 2007 Hi What am i doing wrong //get total images for the gallery $mytotal = fim_query_numrows($_GET['album']); $fim .= "<p>"; if( $o < 0 ) $o = 0; $fim .= “<a href="?offset=".($o-$c)."&count=".$c.">Previous</a>“; } /*if there are images still remaining, show next*/ if(($mytotal-($o+$c))>0){ $fim .=”<a href="?offset=".($o+$c)."&count=".$c.">Next</a>“; } $fim .=”< /p >“; $fim .= “</div >“; return $fim; Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 13, 2007 Share Posted February 13, 2007 Neither are we, unless you tell us what the problem is. Your quotes are funky. Are you using a normal text-editor? The quotes at the end are a weird character, not normal quotes. You also have closing } brackets before opening ones. if( $o < 0 ){ $o = 0; $fim .= '<a href="?offset="'.($o-$c).'&count='.$c.'">Previous</a>'; } You have several quote issues - make sure if you use quotes inside a string they are escaped, or the opposite kind. Quote Link to comment Share on other sites More sharing options...
ofi Posted February 13, 2007 Author Share Posted February 13, 2007 hi what i am trying to do is, when i enter gallery, i want to have only "Next" link on first page at botton, when i click that link i get to next page, and at botton should be "Next - Prev" etc etc, and when i enter last page it should only show "Prev" link only. the pagination works fine, just wanna add this in, just not sure, here is the pagination code i am using now. $fim .= "<p>"; if( $o < 0 ) $o = 0; $fim .= "<a href=\"?offset=".$o."&count=".$c."\">< Fyrri síða</a> "; $fim .="<a href=\"?offset=".($o+$c)."&count=".$c."\">Næsta síða ></a>"; $fim .="</p>"; $fim .= "<p><a href='".get_url("")."'>".__(' ', 'fgallery')."</a></p>"; $fim .= "</div>"; return $fim; gallery http://www.koddinn.com/myndir/album/born/ Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 13, 2007 Share Posted February 13, 2007 When you have an if, it needs to have open and close {} if you want it to apply to more than one line. Put your new statements each on their own line. Quote Link to comment Share on other sites More sharing options...
ofi Posted February 13, 2007 Author Share Posted February 13, 2007 ok, almost there, only thing not working is, when i enter last page with "Prev" link, when i click that, it wont take me back. last page http://www.koddinn.com/myndir/album/born/?offset=40&count=20 <?php //get total images for the gallery $mytotal = fim_query_numrows($_GET['album']); $fim .= "<p>"; if( $o < 0 ) $o = 0; /*if there are previous images, show previous*/ if(($o-$c)>=0){$fim .= "<a href=\"?offset=".$o."&count=".$c."\">< Fyrri síða</a> "; } /*if there are images still remaining, show next*/ if(($mytotal-($o+$c))>0){$fim .="<a href=\"?offset=".($o+$c)."&count=".$c."\">Næsta síða ></a>"; } $fim .="</p>"; $fim .= "</div>"; return $fim; ?> Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 13, 2007 Share Posted February 13, 2007 I think this: if(($o-$c)>=0){$fim .= "<a href=\"?offset=".$o."&count=".$c."\">< Fyrri síða</a> "; } Needs to be this: if(($o-$c)>=0){ $fim .= "<a href=\"?offset=".($o-$c)."&count=".$c."\">< Fyrri síða</a> "; } Quote Link to comment Share on other sites More sharing options...
ofi Posted February 13, 2007 Author Share Posted February 13, 2007 worked fine thx for helping Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.