NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 04-24-2006 22:29:30

sfox8
Member

Drop Down menu for Wax

Well I wasn't sure whether to put this in Wax forum or this one but since I need help with a Feature, I'll put it here >o>

So I've been working on oevista and such, adding things and cleaning up my horribly messy code, when I thought it would be quite nice to have a drop-down menu for the page numbers.

It took me a while to get the page numbers to even appear in the drop down menu. It works and it sends you to the page you ask but the problem I'm having is that once I change the page FROM page 1 (or pageno 0) it will never go back to page 1 (pageno 0) unless i manually enter "pageno=0" in the address bar.

http://oekaki.oevista.org/indt.php?pageno=0 you can try it there.

If I go to page 2, it'll send me to page 2 and it'll show option 1, but if you click page 1, it will just refresh page 2 again (pageno 1).

Then when you go to any number past 2, it'll work but it'll have two of the same number above it.

So for example, if I go to page 10, when it sends me there, it will have two 9's above 10, and it won't show page 1. It stops at 2.

I've tried to fix it but I have no idea what to change/add. Here's my code:

Code:

            <b><? if ($pageno > 0) { ?>
    <a href="index.php?pageno=<?=$pageno - 1; ?><?=$tempsort?><?=$tempartist?>">PREV</a> <?
} else {
    ?>
    PREV | <?
}
if($pageno > 0 && $pageno < ($pages - 1)){
    echo '| ';
}
if($pageno < ($pages - 1)){
    ?><a href="index.php?pageno=<?=$pageno + 1; ?><?=$tempsort?><?=$tempartist?>">NEXT</a><?
} else {
    ?>| NEXT
<?
}
echo "</b>\n";
?>

<form name="jump">
<select name="menu" style="background-color: <?php print $bgColor; ?>; BORDER-BOTTOM: inset; BORDER-LEFT: 
inset; BORDER-RIGHT: inset; BORDER-TOP: inset; COLOR: #0066FF; FONT-FAMILY: <?php print $fontFace; ?>; FONT-SIZE: <?php print $fontSize; ?>;>

<?
$i4 = 0;
while ($i4 < $pages) {
    if($i4 != $pageno) {
?>
            <option value="indt.php?pageno=<?=$i4?><?=$tempsort?><?=$tempartist?>"><?= $i4 + 1; ?></a>
<?
    } else {
?>
            <option selected value="indt.php?pageno=<?=$i4?><?=$tempsort?><?=$tempartist?>"><b><?=$i4?></b></option>

<option selected value="indt.php?pageno=<?=$i4?><?=$tempsort?><?=$tempartist?>"><b><?= $i4 + 1; ?></b></option>
<? }
    $i4++;
}
?>
</option>
</select>
<input type="button" onClick="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO">
</form>

I'm not great at explaining this so it's better for you to see for yourself at the link ^^;; Help would be greatly appreciated >o<
Thanks

Offline

#2 04-25-2006 03:54:45

Waccoon
Administrator

Re: Drop Down menu for Wax

Try this code:

Code:

<form name="jump">
<select name="menu" style="background-color: <?php print $bgColor; ?>; BORDER-BOTTOM: inset; BORDER-LEFT: 
inset; BORDER-RIGHT: inset; BORDER-TOP: inset; COLOR: #0066FF; FONT-FAMILY: <?php print $fontFace; ?>; FONT-SIZE: <?php print $fontSize; ?>;">

<?
$i4 = 0;
while ($i4 < $pages) {
    if($i4 != $pageno) {
?>
        <option value="indt.php?pageno=<?=$i4?><?=$tempsort?><?=$tempartist?>"><?= $i4 + 1; ?></a>
<?
    } else {
?>
        <option selected value="indt.php?pageno=<?=$i4?><?=$tempsort?><?=$tempartist?>"><b><?= $i4 + 1; ?></b></option>
<? }
    $i4++;
}

First, you were missing a double quote after "print $fontSize;?>;" at the top.  This caused the HTML to parse incorrectly, which is probably what caused page number 1 not to work.

The page number being printed twice was because of an extra line in the else condition.  See it?  wink

Offline

#3 04-30-2006 00:10:04

sfox8
Member

Re: Drop Down menu for Wax

big_smile thanks waccoon. It worked. And yeah I see it now xD I should have known. Thanks again though ^^

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB