Verfasst: 03.08.2005 00:04
sorry, xs Mod habe ich nie benutzt
ich hätte die Variable per Array belegt...
ich hätte die Variable per Array belegt...
phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
Code: Alles auswählen
[1] [2] [3] [4]
[5] [6] [7] [8]
...
Code: Alles auswählen
[1]
[2]
[3]
[4]
...
Code: Alles auswählen
$zeilen = count($cnt_alb);
for ($x = 1; $x <= $zeilen; $x++)
{
$template->assign_block_vars('zeile', array(
));
$y = $x;
for ($y = $x; $y <= $x + 4; $y++)
{
$template->assign_block_vars('zeile.bild', array(
'THMIMG' => $img_url,
));
$x++;
if(!isset($cnt_alb[$x]))
break;
}
}
Code: Alles auswählen
<!-- BEGIN zeile -->
<tr>
<!-- BEGIN bild -->
<td> {zeile.bild.THMIMG}</td>
<!-- END bild -->
</tr>
<!-- END zeile -->
Code: Alles auswählen
<tr>
<td> <a href=gallery_pic.php?pic_id=6><img src="gallery/gal00002/_thm/DSC00001.JPG"></a><br></td>
</tr>
<tr>
<td> <a href=gallery_pic.php?pic_id=7><img src="gallery/gal00002/_thm/DSC00002.JPG"></a><br></td>
</tr>
<tr>
<td> <a href=gallery_pic.php?pic_id=8><img src="gallery/gal00002/_thm/DSC00003.JPG"></a><br></td>
</tr>
wie was wo ?shwepsi hat geschrieben: 1.)
und in der Schleife
$y = $x; durch $y = $x;
Code: Alles auswählen
$img_url = "<a href=gallery_pic.php?pic_id=" . $akt_ptid . "><img src="gallery/" . $alb_row['ordner'] . "/_thm/" . $alb_row['dateiname'] . ""></a><br>";
$zeilen = count($cnt_alb);
$end = $x + 4;
for ($x = 1; $x <= $zeilen; $x++)
{
$template->assign_block_vars('zeile', array(
));
$start = $x;
for ($y = $x; $y <= $end; $y++)
{
$template->assign_block_vars('zeile.bild', array(
'THMIMG' => $img_url,
'CNT_CMTS' => $cnt_cmt
));
$x++;
if(!isset($cnt_alb[$x])){
echo "<!-- Abbruch -->" . "\n";
break;
}
}
}
Code: Alles auswählen
<!-- Abbruch -->
<!-- Abbruch -->
<!-- Abbruch -->
<table width="100%">
<tr>
<td><center>
<span class="genbig"><b>Gallery</b></span><br><br>
<table class="forumline" width="60%" cellspacing="0" cellpadding="0" align="center">
<tr>
<th class="catHead" height="25" align="left"> Sonntag, 10. April 2005</th>
</tr>
<tr>
<td class="row1">
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr>
<td class="row2"><span class="genmed"><i><b>TEST</a></b></i><br> Fotograf: <a href="profile.php?mode=viewprofile&u=Oli">Oli</a></span></td>
</tr>
<tr>
<td class="row1"> <br>
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr>
<td> <a href=gallery_pic.php?pic_id=9><img src="gallery/gal00003/_thm/DSC00001.JPG"></a><br><span class="gensmall">0 Kommentare</span><br></td>
</tr>
<tr>
<td> <a href=gallery_pic.php?pic_id=10><img src="gallery/gal00003/_thm/DSC00002.JPG"></a><br><span class="gensmall">2 Kommentare</span><br></td>
</tr>
<tr>
<td> <a href=gallery_pic.php?pic_id=11><img src="gallery/gal00003/_thm/DSC00003.JPG"></a><br><span class="gensmall">0 Kommentare</span><br></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
Code: Alles auswählen
<!-- BEGIN zeile -->
<tr>
<!-- BEGIN bild -->
<td> {zeile.bild.THMIMG}<span class="gensmall">{zeile.bild.CNT_CMTS} Kommentare</span><br></td>
{zeile.bild.ABBRUCH}
<!-- END bild -->
</tr>
<!-- END zeile -->
Code: Alles auswählen
$img_url = "<a href=gallery_pic.php?pic_id=" . $akt_ptid . "><img src=\"gallery/" . $alb_row['ordner'] . "/_thm/" . $alb_row['dateiname'] . "\"></a><br>";
$zeilen = count($cnt_alb);
$end = $x + 4;
for ($x = 1; $x <= $zeilen; $x++)
{
$template->assign_block_vars('zeile', array(
));
$start = $x;
for ($y = $start; $y <= $end; $y++)
{
$template->assign_block_vars('zeile.bild', array(
'THMIMG' => $img_url,
'CNT_CMTS' => $cnt_cmt
));
$x++;
if(!isset($cnt_alb[$x])){
$template->assign_block_vars('zeile.bild', array(
'ABBRUCH' => '<!-- Abbruch -->'
));
break;
}
else {
$template->assign_block_vars('zeile.bild', array(
'ABBRUCH' => '<!-- ok, zählt hoch -->'
));
}
}
}
}
Code: Alles auswählen
<tr>
<td><center>
<span class="genbig"><b>Gallery</b></span><br><br>
<table class="forumline" width="60%" cellspacing="0" cellpadding="0" align="center">
<tr>
<th class="catHead" height="25" align="left"> Sonntag, 10. April 2005</th>
</tr>
<tr>
<td class="row1">
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr>
<td class="row2"><span class="genmed"><i><b>Millennium München</a></b></i><br> Fotograf: <a href="profile.php?mode=viewprofile&u=Oli">Oli</a></span></td>
</tr>
<tr>
<td class="row1"> <br>
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr>
<td> <a href=gallery_pic.php?pic_id=9><img src="gallery/gal00003/_thm/DSC00001.JPG"></a><br><span class="gensmall">0 Kommentare</span><br></td>
<td> <span class="gensmall"> Kommentare</span><br></td>
<!-- Abbruch --> </tr>
<tr>
<td> <a href=gallery_pic.php?pic_id=10><img src="gallery/gal00003/_thm/DSC00002.JPG"></a><br><span class="gensmall">2 Kommentare</span><br></td>
<td> <span class="gensmall"> Kommentare</span><br></td>
<!-- Abbruch --> </tr>
<tr>
<td> <a href=gallery_pic.php?pic_id=11><img src="gallery/gal00003/_thm/DSC00003.JPG"></a><br><span class="gensmall">0 Kommentare</span><br></td>
<td> <span class="gensmall"> Kommentare</span><br></td>
<!-- Abbruch --> </tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
Code: Alles auswählen
$alb_sql = 'SELECT * FROM `gallery_pix` WHERE `album_id` = ' . $gal_id . ' ORDER BY `id` ASC LIMIT ' . $start . ', 24';
if(!$alb_result = $db->sql_query($alb_sql)) {
message_die(GENERAL_ERROR, 'Fehler beim Auslesen der Album-Informationen', '', __LINE__, __FILE__, $alb_sql);
}
while($alb_row = $db->sql_fetchrow($alb_result)) {
...
dein code ist innerhalb der schleife
}
Code: Alles auswählen
$img_url = "<a href=gallery_pic.php?pic_id=" . $akt_ptid . "><img src=\"gallery/" . $alb_row['ordner'] . "/_thm/" . $alb_row['dateiname'] . "\"></a><br>";
Code: Alles auswählen
Array ( [id] => 9 [album_id] => 3 [ordner] => gal00003 [dateiname] => DSC00001.JPG ) Array ( [id] => 10 [album_id] => 3 [ordner] => gal00003 [dateiname] => DSC00002.JPG ) Array ( [id] => 11 [album_id] => 3 [ordner] => gal00003 [dateiname] => DSC00003.JPG