Avatar billede crapmaster Nybegynder
03. december 2005 - 09:36 Der er 3 kommentarer og
1 løsning

Vælg flere måder at sortere en liste på

Hej allesammen!

Jeg ligger inde med en liste af mine dvdfilm, det jeg godt kunne tænke mig er at kunne ( sortere ) min liste på flere måder,

____________________________________________________
Feks. en dropdown menu i toppen hvor jeg kan tage.
Fra A - Å
Kategori
Nyeste film
Årstal
____________________________________________________


<<<<<KODE>>>>>>

<head>
<script type='text/javascript' src='../../includes/jscript.js'></script>
</head>
  <body>
<?php
/*---------------------------------------------------
PHP-Fusion 5 - Content Management System
-------------------------------------------
© Nick Jones (Digitanium) 2002-2005
http://www.php-fusion.co.uk
nick@php-fusion.co.uk
-------------------------------------------
Released under the terms and conditions of
the GNU General Public License (Version 2)
---------------------------------------------------*/
require_once "../../maincore.php";
require_once "../../subheader.php";
require_once "../../side_left.php";
@include INFUSIONS."dvdinfos_system/lang/".$settings['language'].".php";
@include INFUSIONS."dvdinfos_system/lang/English.php";

if (isset($dvdinfos_id)) {
$result = dbquery("UPDATE ".$db_prefix."dvdinfos SET dvdinfos_count=dvdinfos_count+1 WHERE dvdinfos_id='$dvdinfos_id'");
$result = dbquery("SELECT dvdinfos_cover FROM ".$db_prefix."dvdinfos WHERE dvdinfos_id='$dvdinfos_id'");
$data = dbarray($result);
header ("Location: ".$data['dvdinfos_cover'].$data['dvdinfos_cover2'].$data['dvdinfos_cover3']);
}
$items = dbrows(dbquery("SELECT * FROM ".$db_prefix."dvdinfos"));
if ($items != 0) {
if (empty($cat_id)) {

/*opentable(DVD_400);
$result = dbquery("SELECT * FROM ".$db_prefix."dvdinfos_cats ORDER BY dvdinfos_cat_name");
$rows = dbrows($result);
if ($rows != 0) {
$columns = 3;
$counter = 0;
echo "<table width='100%' cellspacing='0' cellpadding='0' class='tbl'>\n<tr>\n";
while($data = dbarray($result)) {
if ($counter != 0) {
if($counter % $columns == 0) echo "</tr>\n<tr>\n";
}
$result2 = dbquery("SELECT count(dvdinfos_cat) FROM ".$db_prefix."dvdinfos WHERE dvdinfos_cat='".$data['dvdinfos_cat_id']."'");
$num = dbresult($result2, 0);
echo "<td align='center' valign='top'><a href='$PHP_SELF?cat_id=".$data['dvdinfos_cat_id']."'>".$data['dvdinfos_cat_name']."</a> <span class='small2'>($num)</span>";
if ($data[dvdinfos_cat_description] != "") {
echo "<br>
<span class='small'>".$data['dvdinfos_cat_description']."</span>";
}
echo "</td>\n";
$counter++;
}
echo "</tr>\n</table>\n";
} else {
echo "<center><br>
".DVD_430."<br><br>
</center>\n";
}
closetable();
tablebreak();
            */    /*
opentable(DVD_483);
$result=dbquery("SELECT * FROM ".$db_prefix."dvdinfos, ".$db_prefix."dvdinfos_cats where dvdinfos_cat=dvdinfos_cat_id ORDER BY dvdinfos_datestamp DESC LIMIT 3");

echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">";

while($data=dbarray($result)){

echo "<tr>\n<td class=\"small\" align=\"center\"><hr>\n</td>\n</tr>\n";
echo "<tr>\n<td class=\"small\" align=\"center\"><b><font size=3>$data[dvdinfos_name]</b></font></td>\n</tr>\n";
echo "<tr>\n<td class=\"small\" align=\"center\"><hr>\n</td>\n</tr>\n";
echo "<tr>\n<td class=\"small\" align=\"center\"><img src=".$data[dvdinfos_cover]." width='170' height='100'>                                      </td>\n</tr>\n";
echo "<tr>\n<td class=\"small\" align=\"center\"><hr>\n</td>\n</tr>\n";
echo "<tr>\n<td class=\"small\" align=\"center\">$data[dvdinfos_description]</td>\n</tr>\n";

}
echo "</table>";

closetable();*/


/*
openside("5 Nyeste dvdfilm");
$result=dbquery("SELECT * FROM ".$db_prefix."dvdinfos, ".$db_prefix."dvdinfos_cats where dvdinfos_cat=dvdinfos_cat_id ORDER BY dvdinfos_datestamp DESC LIMIT 5");
if (dbrows($result) != 0) {
echo "<center><table>";
while($data = dbarray($result)) {

echo "&nbsp;<a href='".BASEDIR."viewpage.php?page_id=10&dvdinfos_id=".$data['dvdinfos_id']."'>
<img src=".$data[dvdinfos_cover]."  width='80' height='110'>&nbsp;</a>\n";

    }
    echo "</table></center>";
} else {
    echo "<center>".LAN_04."</center>\n";
}
closeside();
    */
     
//tablebreak();

$rows2show = 30;
if(!isset($rowstart)) $rowstart = 0;
$result = dbquery("SELECT * FROM ".$db_prefix."dvdinfos, ".$db_prefix."dvdinfos_cats where dvdinfos_cat=dvdinfos_cat_id");
$numrows = dbrows($result);

opentable(DVD_417);
$result = dbquery("SELECT * FROM ".$db_prefix."dvdinfos, ".$db_prefix."dvdinfos_cats where dvdinfos_cat=dvdinfos_cat_id ORDER BY dvdinfos_nr ASC LIMIT ".$rowstart.", ".$rows2show);
if(dbrows($result)!=0){

echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\">";

while($data=dbarray($result)){

//HER LAVES LINKET TIL DEN SIDE DER VISER SELVE FILM INFOÈN
echo "<tr><td class='small' align='left'><a href='".BASEDIR."viewpage.php?page_id=10&dvdinfos_id=".$data['dvdinfos_id']."'  onmouseover=\"showhide('".$data[dvdinfos_cover]."')\" onmouseout=\"showhide('');\" onmousemove=\"moveCoverImage(this,event);\">".$data['dvdinfos_name']."</b></a></td>";





//echo "<tr><td class='small' align='left'><img src=".$data[dvdinfos_cover]." width='80' height='110' onmouseover=\"showhide(this.src)\" onmouseout=\"showhide('');\" onmousemove=\"moveCoverImage(this,event);\"><a href='".BASEDIR."viewpage.php?page_id=10&dvdinfos_id=".$data['dvdinfos_id']."'>".$data['dvdinfos_name']."</b></a></td>";


// ORG FILM    list:
//echo "<tr><td class='small' align='left'><a href='".BASEDIR."viewpage.php?page_id=10&dvdinfos_id=".$data['dvdinfos_id']."'>".$data['dvdinfos_name']."</b></a></td>";




echo "<td class=\"small\" align=\"left\">".trimlink($data[dvdinfos_alter], 30)."</td>\n";
echo "<td class=\"small\" align=\"left\">$data[dvdinfos_cat_name]</td>\n";
echo "<td class=\"small\" align=\"right\">$data[dvdinfos_count]</td>\n</tr>\n";
/*Mig der leger med en skuespillerliste*/


/*".$data['dvdinfos_name']."*/

}
}
echo "</table>";
closetable();

tablebreak();
echo "<div align='center' style='margin-top:5px;margin-bottom:5px;'> \n ".makePageNav($rowstart,$rows2show,$numrows,3)." \n </div> \n ";
tablebreak();

/*opentable(DVD_418);
$filmcount = dbquery("SELECT count(dvdinfos_id) FROM ".$db_prefix."dvdinfos");
$filmkategoriecount = dbquery("SELECT count(dvdinfos_cat_id) FROM ".$db_prefix."dvdinfos_cats");

echo "<center>".DVD_419."<span class='alt'>".dbresult($filmkategoriecount, 0)."</span><br>";
echo "".DVD_420."<span class='alt'>".dbresult($filmcount, 0)."</span></center>";

closetable();
tablebreak();  */



} else {
$result = dbquery("SELECT * FROM ".$db_prefix."dvdinfos_cats WHERE dvdinfos_cat_id='$cat_id'");
$data = dbarray($result);
opentable(DVD_400.": ".$data['dvdinfos_cat_name']);
//Her sætter du hvilken tal du vil have der skal vises på siden.
$itemsperpage = 4;
$result = dbquery("SELECT * FROM ".$db_prefix."dvdinfos WHERE dvdinfos_cat='$cat_id'");
$rows = dbrows($result);

if (!$rowstart) {
$rowstart = 0;
}
if ($rows != 0) {
//Her kan du rette så info listen stå med navnet føst, i
//( dvdinfos_cat='$cat_id' ORDER BY dvdinfos_nr ASC LIMIT )
//HUSK IKKE AT RETTE NÅDET ANDET
$result = dbquery("SELECT * FROM ".$db_prefix."dvdinfos WHERE dvdinfos_cat='$cat_id' ORDER BY dvdinfos_nr ASC LIMIT $rowstart,$itemsperpage");
$numrows = dbrows($result);
$i = 1;
while ($data = dbarray($result)) {
$dateposted = strftime("%d.%m.%y", $data['dvdinfos_datestamp']+($settings['timeoffset']*3600));

if ($data['dvdinfos_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span class='small'>".DVD_410."</span>";
} else {
$new = "";
}

echo "<font size=2><b>".$data['dvdinfos_name']."</font></b></a>$new<br>\n";
if ($data['dvdinfos_description'] != "") {

echo $data['dvdinfos_description']."<br><br>\n";
}

echo "<span class='small'><font class='alt'>".DVD_411."</font> $dateposted |
<font class='alt'>".DVD_506."</font> ".$data['dvdinfos_alter']." |
<font class='alt'>".DVD_507."</font> ".$data['dvdinfos_time']." |
<font class='alt'>".DVD_508."</font> ".$data['dvdinfos_count']." |
<br><br>
<class=\"small\" align=\"center\"><img src=".$data[dvdinfos_cover2]." width='150' height='70'>&nbsp;&nbsp;<img src=".$data[dvdinfos_cover3]." width='150' height='70'>
<class=\"small\" align=\"left\"><hr>
</span>\n";

if ($i != $numrows) {
echo "\n";
} else {
echo "\n";
}
$i++;
}
closetable();
echo "<br>\n";
echo "<div align='center'>\n";
echo "<a href='dvdinfos.php' target='_self'>Tilbage til DVD Kategorier</a>\n";
echo "</div>\n";
echo "<br>\n";
echo "<div align='center' style='margin-top:5px;'>
".makePageNav($rowstart,$itemsperpage,$rows,3,"$PHP_SELF?cat_id=$cat_id&")."
</div>\n";
} else {
echo DVD_431."\n";
closetable();
}
}

} else {
opentable('Keine DVD Infos');
echo 'Keine DVD Infos im System vorhanden';
closetable();
}
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>
<img src="" id="cover" style="position:absolute;display:none;width:90px;height:120px">
</body>

<<<<<SLUT KODE>>>>>
Avatar billede Slettet bruger
03. december 2005 - 10:35 #1
Konceptuelt skal du lave et submit når der er en onchange på den select-box, på serversiden ændre du så den order by du har på din select.
Avatar billede crapmaster Nybegynder
03. december 2005 - 10:37 #2
Jeg er ikke den støste hej, kan du ikke være sød at vise mig hvordan jeg skal gøre det ?
Avatar billede crapmaster Nybegynder
04. december 2005 - 14:00 #3
Er der ikke en der vil hjælpe mig.....
Avatar billede crapmaster Nybegynder
05. december 2005 - 18:09 #4
//LUKKER
Da der ikke er nogel der vil svare, echo " :-( ";
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester