Jump to content

[SOLVED] Not sure what i am doing wrong


ofi

Recommended Posts

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;

Link to comment
https://forums.phpfreaks.com/topic/38322-solved-not-sure-what-i-am-doing-wrong/
Share on other sites

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.

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/

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;
?>

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>   ";

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.