hallo leute,
hab ein mega problem. hab mir heute die csgallerie gezogen und wollte ein paar kleine veränderungen vornehmen aber so wie ich das will funzt es net, oder besser gesagt ich hab keine ahnung was ich wo machen soll...
mein prob: ich möchte in der bild ausgabe nach drei bildern einen zeilenumbruch haben. also spricht für ne schleife. aber wo da hier meine kenntnisse zu ende gehn.
PHP-Code:
//gibt einen Bilderordner formatiert auf dem Browser aus
function showalbum($album) {
@include('config.inc.php');
if ($securemode && file_exists($album.'/code.php') && $_SESSION['album']!=$album) die('<div style="color:red;margin-top:20px;text-align:center">Netter Versuch! Aber daran habe ich gedacht!</div>');
if (!isset($_GET['pos'])) $_GET['pos']=1;
if ($anzahlthumbs==0) $anzahlthumbs=1000;
$IPfile=$album.'/ips.dat';
$clickfile=$album.'/clicks.dat';
if (file_exists($clickfile)) {
$fp=fopen($clickfile,'r+');
$str=fread($fp,filesize($clickfile));
rewind($fp);
if (!checkIPforFileClick($IPfile)) {
fwrite($fp,$str+1);
saveIPforFileClick($IPfile);
}
fclose($fp);
}
else {
clearstatcache();
if (decoct(fileperms($album))!="40777" && decoct(fileperms($album))!="100777")
die("keine Schreibrechte,bitte Verzeichnisrechte manuell auf 777 ändern");
$fp=fopen($clickfile,'w');
fwrite($fp,1);
fclose($fp);
chmod($clickfile, 0600);
}
$bilder=getJPGThumbnails($album);
echo ('<table width="100%" style="border-bottom:1px solid black"><tr><td style="vertical-align:middle"><form action="'.$_SERVER['PHP_SELF'].'" method="POST"><input type="image" src="bilder/ordnerback.gif"><input type="hidden" name="todo" value="showalben"></form></td>');
echo ('<td width="100%" class="albumueberschrift">'.substr(strrchr($album,'/'),1).' - '.getJPGanzahl($bilder[0]).' Fotos - '.$str.' mal betrachtet </td></tr></table>
');
for ($i=$_GET['pos'];$i<sizeof($bilder) && $i<($_GET['pos']+$anzahlthumbs);$i++) {
$pic=$bilder[0].'/'.getBigPicture($bilder[$i]);
$clicks=trim(getImageClicks($pic));
$CommentArray=getComments($pic);
if ($usecomments) $tooltip='<table width="100%" class="tooltipueberschrift"><tr><td style="border-bottom:black solid 1px;text-align:center">'.$clicks.' mal betrachtet</td></tr><tr><th>Kommentare</th></tr>';
else $tooltip='<table width="100%" class="tooltipueberschrift"><tr><td style="text-align:center">'.$clicks.' mal betrachtet</td></tr>';
if ($usecomments) {
for ($j=0;$j<sizeof($CommentArray);$j++) {
$tooltip=$tooltip.'<tr><td><table width="100%" class="tooltipkommentare" style="border:1px solid black"><tr><td style="text-decoration:underline">'.stringumwandeln($CommentArray[$j]['name']).'</td></tr><tr><td>'.stringumwandeln($CommentArray[$j]['comment']).'</td></tr></table></td></tr>';
}
}
$tooltip=$tooltip.'</table>';
//hier findet die Bildausgabe statt
if ($usetooltip) echo '[url="'.$_SERVER['PHP_SELF'].'?todo=showPicture&stelle='.$i.'&album='.$album.'"][img]'.$bilder[0].[/img][/url]';
else echo '[url="'.$_SERVER['PHP_SELF'].'?todo=showPicture&stelle='.$i.'&album='.$album.'"][img]'.$bilder[0].[/img][/url]';
}
echo ('<table width="100%" style="border-bottom:1px solid black"><tr><td></td></tr></table>');
$views=ceil((sizeof($bilder)-1)/$anzahlthumbs);
echo('<table width="1" align="center"><tr>');
if ($_GET['pos']!=1) echo('<td>[url="'.$_SERVER['PHP_SELF'].'?todo=showalbum&album='.$album.'&pos='.($_GET['pos']-$anzahlthumbs).'"][img]bilder/links.gif[/img][/url]</td>');
if ($views!=1) {
for ($j=1;$j<=$views;$j++) {
if ((($j-1)*$anzahlthumbs+1)!=$_GET['pos']){
echo ('<td>[url="'.$_SERVER['PHP_SELF'].'?todo=showalbum&album='.$album.'&pos='.(($j-1)*$anzahlthumbs+1).'"]'.$j.'[/url]</td>');
}
else echo ('<td>'.$j.'</td>');
}
}
if (sizeof($bilder)-1-$_GET['pos']>=$anzahlthumbs) echo('<td>[url="'.$_SERVER['PHP_SELF'].'?todo=showalbum&album='.$album.'&pos='.($_GET['pos']+$anzahlthumbs).'"][img]bilder/rechts.gif[/img][/url]</td>');
echo('</tr></table>');
$space=round(fetchDirectorySize($album)/1000000,1);
echo ('<table width="100%" align="center" class="speicherverbrauch"><tr><td>verbrauchter Speicherplatz: '.$space.' Megabyte</td></tr></table>');
echo ('<div align="center" style="color:#000000;font-size:8pt;margin-top:10px">© [url="http://www.cschneider.info"]www.cschneider.info[/url]</div>');
}
vielen dank für eure hilfe im voraus