Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Blättern über mehrere Seiten

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
Eistee
Smarty Rookie


Joined: 18 Jun 2004
Posts: 10

PostPosted: Tue Jun 29, 2004 12:10 pm    Post subject: Blättern über mehrere Seiten Reply with quote

Ist es mit Smarty auch möglich, eine Pger-Funktion zu realisieren?
Ich habe berreits ein wenig hier im Forum gesucht, aber leider noch keine Diskussion auf Deutsch gefunden.
Z.Z. bin ich dabei mein GB-Script auf Smarty umzustellen.
Die entsprechende Funktion zum Blättern, sieht so aus, Funktioniert mit der Smarty-Variante aber nicht mehr.
Wie kann ich die Funktion auf Smarty umstricken?

[php:1:82202e04f8]
<?php
$show_entries = 10; // Wieviele Einträge sollen pro Seite angezeigt werden?

if(!isset($start)) $start = 0;

$sqlab = "SELECT * FROM guestbook";
$res = mysql_query($sqlab);
$num = mysql_num_rows($res);
$sqlab = "SELECT * FROM guestbook ORDER BY id DESC LIMIT $start, $show_entries";
$res = mysql_query($sqlab);

$num_pages = ceil($num/$show_entries);
$curr_page = $start/$show_entries;

...

// Folgende Paging-Funktion soll eingebaut werden:
if($curr_page != 0)
{
echo "[<a href=\"?open=gbook&start=".($start-$show_entries)."\"><</a>] ";
}

for($a=0; $a<$num_pages; $a++)
{
if($a != $curr_page)
{
echo "[<a href=\"?open=gbook&start=".($a*$show_entries)."\">".($a+1)."</a>] ";
}
else
{
echo "(".($a+1).") ";
}
}

if(($start+$show_entries)<$num)
{
echo "[<a href=\"?open=gbook&start=".($start+$show_entries)."\">></a>]";
}
}
?>
[/php:1:82202e04f8]

Ich hoffe, ihr versteht was ich meine und könnt mir helfen.
Danke.
Back to top
View user's profile Send private message
kills
Smarty Elite


Joined: 28 May 2004
Posts: 493

PostPosted: Tue Jun 29, 2004 12:28 pm    Post subject: Reply with quote

http://www.phpinsider.com/smarty-forum/viewtopic.php?t=2327&highlight=browse
Back to top
View user's profile Send private message
Eistee
Smarty Rookie


Joined: 18 Jun 2004
Posts: 10

PostPosted: Tue Jun 29, 2004 12:42 pm    Post subject: Reply with quote

Ich hab grade auch noch was Interessantes gefunden.

http://www.phpinsider.com/smarty-forum/viewtopic.php?t=494&highlight=paging

Da stellt sich mir nur noch die frage, wie muss meine MySQL-Abfrage in der PHP-datei ausschauen und wie muss ich die Funktion richtig aufrufen?
Wäre super, wenn mir das noch jemand erklären könnte.
hab leider noch nicht so den Durchblick bei smarty... Wink
Back to top
View user's profile Send private message
Eistee
Smarty Rookie


Joined: 18 Jun 2004
Posts: 10

PostPosted: Tue Jun 29, 2004 6:33 pm    Post subject: Reply with quote

Wäre echt klasse, wenn mir dabei nochmal jemand helfen könnte... Sad
Hier noch einmal eine genaue Beschreibung meines Problems:

http://www.phpinsider.com/smarty-forum/viewtopic.php?p=11394#11394

Brauche dringend Hilfe.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP