Einfache blätter function?

Begonnen von Sascha1981, 15 Juli 2004, 21:24:56

⏪ vorheriges - nächstes ⏩

0 Mitglieder und 2 Gäste betrachten dieses Thema.

Sascha1981

Hey @ll!!

Mal wieder eine frage!!!
Wie erstelle ich am besten eine einfache blätter function für diesen code???


 if (!eregi("modules.php", $PHP_SELF)) {
    die ("You can't access this file directly...");
}

require_once("mainfile.php");
global $prefix, $user_prefix,$user_cat,$uname,$user_from,$user_from1,$count,$sides,$sex,$result;
$index = 1;

$rows_per_side = 100;


if (!isset($startpos)){
 $startpos=0;
}


include("header.php");

opentable();

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

$result = sql_query("select uname,user_from,user_from1 from ".$user_prefix."_users WHERE (user_cat='3') AND (user_sexus ='2') order by uname DESC limit $startpos, $rows_per_side",$dbi);

####
echo"<table border=\"0\" width=\"100%\">";
  echo "  <tr>";
  echo "    <td width=\"30%\" valign=\"top\">";
 include_once("modules/Flirt/menu.php");
  echo "    <td width=\"87%\" valign=\"top\">";
 echo "      <table align=\"center\" border=\"0\" width=\"90%\">";
while (list($uname,$user_from,$user_from1) = sql_fetch_row($result, $dbi)) {
  echo "        <tr>";
  echo "          <td width=\"20%\"><a href=modules.php?name=Your_Account&op=userinfo&uname=$uname><b>$uname</b></a></td>";
  echo "          <td align=\"center\" width=\"20%\">Motto</td>";
  echo "          <td align=\"center\" width=\"20%\">$user_from</td>";
  echo "          <td align=\"center\" width=\"20%\">$user_from1</td>";
  echo "        </tr>";
  }
  echo "      </table>";
  echo "    </td>";
  echo "  </tr>";
  echo "</table>";

echo "<center>";

if ($startpos > 0) {
    echo "[<a href=\"modules.php?name=kanzeigen&file=list&cat=$cat&startpos=0\"><<</a>] ";
    $back=$startpos-$rows_per_side;
    if ($back < 0) {
     $back=0;
    }
    echo "[<a href=\"modules.php?name=kanzeigen&file=list&cat=$cat&startpos=$back\"><</a>] ";
  }
  if ($count > $rows_per_side){
    $sides=intval($count/$rows_per_side);
    if ($count%$rows_per_side) {
      $sides++;
     }
  }
  for ($i=1;$i<=$sides;$i++) {
    $fwd=($i-1)*$rows_per_side;
    echo "[<a href=\"modules.php?name=kanzeigen&file=list&cat=$cat&startpos=$fwd\">$i</a>] ";
  }
  if ($startpos < $count-$rows_per_side) {
    $fwd=$startpos+$rows_per_side;
    echo "[<a href=\"modules.php?name=kanzeigen&file=list&cat=$cat&startpos=$fwd\">></a>] ";
    $fwd=$count-$rows_per_side;
    echo "[<a href=\"modules.php?name=kanzeigen&file=list&cat=$cat&startpos=$fwd\">>></a>]";
  }
    echo "</center>";
closetable();
include("footer.php");


THX schon mal für die Antwort!!!



[Editiert am 15/7/2004 von Sascha1981]

jubilee

Hallo !
Scheint mir so, das da schon eine vorwärts/rückwärts - Blätterfunktion drin ist ?!
MfG
jubilee