Hi ,
bin ganz neu hier. Ich habe grade erst angefangen mich mit Php zubeschäftigen.
Bin grade an einem Gallery/Script dran. Komme aber nicht weiter.
Habe Folgendes Problem ich möchte gerne Bilder nebeneinnander machen, bekomme es aber nicht hin. Bekomme Sie immer nur untereinander gezeigt.
Und ich möchte denn Fileinfo text gerne im Bild angezeigt bekommen.
siehe webseite beispiel
Sorry für meine Rechtschreibun ich bin grade erst 1 jahr in Deutschland
Hier mein Script.
<?php
include ("db_connect.php");
$item_count = 20;
if ( strlen ($query1) >= 2 ) $queryArray[] = '%'.$query1.'%';
if ( strlen ($query2) >= 2 ) $queryArray[] = '%'.$query2.'%';
if ( strlen ($query3) >= 2 ) $queryArray[] = '%'.$query3.'%';
for ( $i = 0; $i < count ($queryArray); $i++ ) {
$querystring = "schlagzeile like '$queryArray[$i]' ";
$querystring .= "or infotext like '$queryArray[$i]' ";
$querystring .= "or kategorie like '$queryArray[$i]' ";
$querystring .= "or fotograf like '$queryArray[$i]'";
$tmpArray[] = '('.$querystring.')';
}
if ( count ($queryArray) > 0 )
$querystring = join (" and ", $tmpArray);
else
$querystring = "0 = 1";
$select_count = "select count(ID) as count from fdb_birger_fotodaten ";
$select_count .= "where $querystring";
$tmpArray = mysql2assoc ($select_count);
$result_count = $tmpArray[0][count];
if ( empty ($offset) ) $offset = 0;
$select = "select *, unix_timestamp(date_added) as date_added_ts from fdb_birger_fotodaten ";
$select .= "where $querystring order by date_added desc, ID desc ";
$select .= "limit $offset, $item_count";
$fotoArray = mysql2assoc ($select);
?>
<html>
<head>
<script language="JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<title>Gallery Dieter</title></head>
<link rel="stylesheet" type="text/css" href="main.css" >
</style>
<base target="_self">
<body bgcolor=#CCCCCC onLoad="MM_preloadImages('for.gif','eis.gif','ne.gif','top_strukt.gif')"
>
<div id="Layer1" style="position:absolute; left:0; top:0; width:591; height:265; z-index:1">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="573" id="AutoNumber1" height="246">
<tr>
<td width="10" height="246"> </td>
<td width="588" height="246">
<table cellSpacing="2" cellPadding="2" width="581" border="0" height="230">
<tr vAlign="top">
<td borderColor="#cccccc" colSpan="3" width="712" height="214">
<font face="Arial, Helvetica, sans-serif" size="1"><b>Search results
(<?php echo $result_count; ?>) </b><br>
</font><hr color="#000000" size="1">
<table cellSpacing="0" cellPadding="0" width="579" border="0">
<?php if ( 0 == count ($fotoArray) ): ?>
<tr>
<td vAlign="top" width="398">
<font size="1" face="Arial"><b>No photos found!</b></font>
<font face="Arial, Helvetica, sans-serif" size="1"><br>
<br>
<font face="Verdana" size="1"><b></a></td>
<td vAlign="top" align="middle" width="181">
</td>
</tr>
<?php else: /* if ( 0 == count ($fotoArray) ): */ ?>
<?php for ( $i = 0; $i < count ($fotoArray); $i++ ): ?>
<tr>
<td vAlign="top" width="398">
<font size="1" face="Arial"><b><?php echo $fotoArray[$i][schlagzeile]; ?></b></font>
<font face="Arial, Helvetica, sans-serif" size="1"><br>
</font>
<img height="10" src="diagram/point.gif" width="10" border="0"><font face="Arial, Helvetica, sans-serif" size="1"><br>
<font face="Verdana" size="1"><b><?php echo date ("d/m/Y", $fotoArray[$i][date_added_ts]); ?></b> <?php echo $fotoArray[$i][infotext]; ?></font> <font color="#999999"> </font><a href="fotodetail.php?sid=<?php echo $sid; ?>&id=<?php echo $fotoArray[$i][ID]; ?>"><font size="1" color="#666666">download....</font></a></td>
<td vAlign="top" align="middle" width="181">
<font size="1" face="Arial, Helvetica, sans-serif">
<a href="fotodetail.php?sid=<?php echo $sid; ?>&id=<?php echo $fotoArray[$i][ID]; ?>"><img alt="<?php echo $fotoArray[$i][filename]; ?>" src="public_img/<?php echo "thumb_".$fotoArray[$i][filename]; ?>" border="0"></a><br>
<img height="35" src="" width="1"></font></td>
</tr>
<?php endfor; /* for ( $i = 0; $i < count ($fotoArray); $i++ ): */ ?>
<?php endif; /* if ( 0 == count ($fotoArray) ): */ ?>
</table>
</font><hr color="#000000" size="1">
<p>
<b><font face="Arial, Helvetica, sans-serif" size="1">
<?php
$max = floor ($result_count/$item_count);
$recent = floor ($offset/$item_count);
$von = max ($recent - 4, 0);
$bis = $von + 9;
if ( $bis > $max ) {
$bis = $max;
$von = max ($max - 9, 0);
}
?>
<?php if ( $result_count > $item_count ): ?>
<!-- Doppelpfeil links -->
<?php if ( 0 != $offset ): ?>
<a href="fotosearch.php?sid=<?php echo $sid; ?>&query1=<?php echo $query1; ?>&query2=<?php echo $query2; ?>&query3=<?php echo $query3; ?>&offset=<?php echo max ($offset - $item_count*10, 0); ?>">
<font color="#ffffff"><<</font>
</a>
<a href="fotosearch.php?sid=<?php echo $sid; ?>&query1=<?php echo $query1; ?>&query2=<?php echo $query2; ?>&query3=<?php echo $query3; ?>&offset=<?php echo $recent*$item_count - $item_count; ?>">
<font color="#ffffff"><</font>
</a>
<?php endif; /* if ( 0 != $offset ): */ ?>
<!-- Skala mittig -->
<?php for ( $i = $von; $i <= $bis; $i++ ): ?>
<?php if ( $i != $recent ): ?>
<a href="fotosearch.php?sid=<?php echo $sid; ?>&query1=<?php echo $query1; ?>&query2=<?php echo $query2; ?>&query3=<?php echo $query3; ?>&offset=<?php echo $i*$item_count; ?>">
<font color="#ffffff"><?php echo $i+1; ?></font>
</a>
<?php else: /* if ( $i != $recent ): */ ?>
<font color="#0000FF"><?php echo $i+1; ?></font>
<?php endif; /* if ( $i != $recent ): */ ?>
<?php endfor; /* for ( $i = $von; $i < $bis; $i++ ): */ ?>
<!-- Doppelpfeil rechts -->
<?php if ( $max > $recent ): ?>
<a href="fotosearch.php?sid=<?php echo $sid; ?>&query1=<?php echo $query1; ?>&query2=<?php echo $query2; ?>&query3=<?php echo $query3; ?>&offset=<?php echo $recent*$item_count + $item_count; ?>">
<font color="#ffffff">></font>
</a>
<a href="fotosearch.php?sid=<?php echo $sid; ?>&query1=<?php echo $query1; ?>&query2=<?php echo $query2; ?>&query3=<?php echo $query3; ?>&offset=<?php echo min ($offset + $item_count*10, $max*$item_count); ?>">
<font color="#ffffff">>></font>
</a>
<?php endif; /* if ( 0 != $offset ): */ ?>
<?php endif; /* if ( $result_count > $item_count ): */ ?> </font></b>
<p>
<B><FONT face=Arial color=#7a1e33 size=1><A
href="javascript:history.back()">back</A></FONT></B></P></td>
</tr>
<tr> <td borderColor="#cccccc" width="704" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html
bin ganz neu hier. Ich habe grade erst angefangen mich mit Php zubeschäftigen.
Bin grade an einem Gallery/Script dran. Komme aber nicht weiter.
Habe Folgendes Problem ich möchte gerne Bilder nebeneinnander machen, bekomme es aber nicht hin. Bekomme Sie immer nur untereinander gezeigt.
Und ich möchte denn Fileinfo text gerne im Bild angezeigt bekommen.
siehe webseite beispiel
Sorry für meine Rechtschreibun ich bin grade erst 1 jahr in Deutschland
Hier mein Script.
<?php
include ("db_connect.php");
$item_count = 20;
if ( strlen ($query1) >= 2 ) $queryArray[] = '%'.$query1.'%';
if ( strlen ($query2) >= 2 ) $queryArray[] = '%'.$query2.'%';
if ( strlen ($query3) >= 2 ) $queryArray[] = '%'.$query3.'%';
for ( $i = 0; $i < count ($queryArray); $i++ ) {
$querystring = "schlagzeile like '$queryArray[$i]' ";
$querystring .= "or infotext like '$queryArray[$i]' ";
$querystring .= "or kategorie like '$queryArray[$i]' ";
$querystring .= "or fotograf like '$queryArray[$i]'";
$tmpArray[] = '('.$querystring.')';
}
if ( count ($queryArray) > 0 )
$querystring = join (" and ", $tmpArray);
else
$querystring = "0 = 1";
$select_count = "select count(ID) as count from fdb_birger_fotodaten ";
$select_count .= "where $querystring";
$tmpArray = mysql2assoc ($select_count);
$result_count = $tmpArray[0][count];
if ( empty ($offset) ) $offset = 0;
$select = "select *, unix_timestamp(date_added) as date_added_ts from fdb_birger_fotodaten ";
$select .= "where $querystring order by date_added desc, ID desc ";
$select .= "limit $offset, $item_count";
$fotoArray = mysql2assoc ($select);
?>
<html>
<head>
<script language="JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<title>Gallery Dieter</title></head>
<link rel="stylesheet" type="text/css" href="main.css" >
</style>
<base target="_self">
<body bgcolor=#CCCCCC onLoad="MM_preloadImages('for.gif','eis.gif','ne.gif','top_strukt.gif')"
>
<div id="Layer1" style="position:absolute; left:0; top:0; width:591; height:265; z-index:1">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="573" id="AutoNumber1" height="246">
<tr>
<td width="10" height="246"> </td>
<td width="588" height="246">
<table cellSpacing="2" cellPadding="2" width="581" border="0" height="230">
<tr vAlign="top">
<td borderColor="#cccccc" colSpan="3" width="712" height="214">
<font face="Arial, Helvetica, sans-serif" size="1"><b>Search results
(<?php echo $result_count; ?>) </b><br>
</font><hr color="#000000" size="1">
<table cellSpacing="0" cellPadding="0" width="579" border="0">
<?php if ( 0 == count ($fotoArray) ): ?>
<tr>
<td vAlign="top" width="398">
<font size="1" face="Arial"><b>No photos found!</b></font>
<font face="Arial, Helvetica, sans-serif" size="1"><br>
<br>
<font face="Verdana" size="1"><b></a></td>
<td vAlign="top" align="middle" width="181">
</td>
</tr>
<?php else: /* if ( 0 == count ($fotoArray) ): */ ?>
<?php for ( $i = 0; $i < count ($fotoArray); $i++ ): ?>
<tr>
<td vAlign="top" width="398">
<font size="1" face="Arial"><b><?php echo $fotoArray[$i][schlagzeile]; ?></b></font>
<font face="Arial, Helvetica, sans-serif" size="1"><br>
</font>
<img height="10" src="diagram/point.gif" width="10" border="0"><font face="Arial, Helvetica, sans-serif" size="1"><br>
<font face="Verdana" size="1"><b><?php echo date ("d/m/Y", $fotoArray[$i][date_added_ts]); ?></b> <?php echo $fotoArray[$i][infotext]; ?></font> <font color="#999999"> </font><a href="fotodetail.php?sid=<?php echo $sid; ?>&id=<?php echo $fotoArray[$i][ID]; ?>"><font size="1" color="#666666">download....</font></a></td>
<td vAlign="top" align="middle" width="181">
<font size="1" face="Arial, Helvetica, sans-serif">
<a href="fotodetail.php?sid=<?php echo $sid; ?>&id=<?php echo $fotoArray[$i][ID]; ?>"><img alt="<?php echo $fotoArray[$i][filename]; ?>" src="public_img/<?php echo "thumb_".$fotoArray[$i][filename]; ?>" border="0"></a><br>
<img height="35" src="" width="1"></font></td>
</tr>
<?php endfor; /* for ( $i = 0; $i < count ($fotoArray); $i++ ): */ ?>
<?php endif; /* if ( 0 == count ($fotoArray) ): */ ?>
</table>
</font><hr color="#000000" size="1">
<p>
<b><font face="Arial, Helvetica, sans-serif" size="1">
<?php
$max = floor ($result_count/$item_count);
$recent = floor ($offset/$item_count);
$von = max ($recent - 4, 0);
$bis = $von + 9;
if ( $bis > $max ) {
$bis = $max;
$von = max ($max - 9, 0);
}
?>
<?php if ( $result_count > $item_count ): ?>
<!-- Doppelpfeil links -->
<?php if ( 0 != $offset ): ?>
<a href="fotosearch.php?sid=<?php echo $sid; ?>&query1=<?php echo $query1; ?>&query2=<?php echo $query2; ?>&query3=<?php echo $query3; ?>&offset=<?php echo max ($offset - $item_count*10, 0); ?>">
<font color="#ffffff"><<</font>
</a>
<a href="fotosearch.php?sid=<?php echo $sid; ?>&query1=<?php echo $query1; ?>&query2=<?php echo $query2; ?>&query3=<?php echo $query3; ?>&offset=<?php echo $recent*$item_count - $item_count; ?>">
<font color="#ffffff"><</font>
</a>
<?php endif; /* if ( 0 != $offset ): */ ?>
<!-- Skala mittig -->
<?php for ( $i = $von; $i <= $bis; $i++ ): ?>
<?php if ( $i != $recent ): ?>
<a href="fotosearch.php?sid=<?php echo $sid; ?>&query1=<?php echo $query1; ?>&query2=<?php echo $query2; ?>&query3=<?php echo $query3; ?>&offset=<?php echo $i*$item_count; ?>">
<font color="#ffffff"><?php echo $i+1; ?></font>
</a>
<?php else: /* if ( $i != $recent ): */ ?>
<font color="#0000FF"><?php echo $i+1; ?></font>
<?php endif; /* if ( $i != $recent ): */ ?>
<?php endfor; /* for ( $i = $von; $i < $bis; $i++ ): */ ?>
<!-- Doppelpfeil rechts -->
<?php if ( $max > $recent ): ?>
<a href="fotosearch.php?sid=<?php echo $sid; ?>&query1=<?php echo $query1; ?>&query2=<?php echo $query2; ?>&query3=<?php echo $query3; ?>&offset=<?php echo $recent*$item_count + $item_count; ?>">
<font color="#ffffff">></font>
</a>
<a href="fotosearch.php?sid=<?php echo $sid; ?>&query1=<?php echo $query1; ?>&query2=<?php echo $query2; ?>&query3=<?php echo $query3; ?>&offset=<?php echo min ($offset + $item_count*10, $max*$item_count); ?>">
<font color="#ffffff">>></font>
</a>
<?php endif; /* if ( 0 != $offset ): */ ?>
<?php endif; /* if ( $result_count > $item_count ): */ ?> </font></b>
<p>
<B><FONT face=Arial color=#7a1e33 size=1><A
href="javascript:history.back()">back</A></FONT></B></P></td>
</tr>
<tr> <td borderColor="#cccccc" width="704" height="4"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html
Kommentar