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

Link to comment
Share on other sites

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/

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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