Ik ben bezig met het in elkaar zetten van een blog systeem.
Nu is het zo dat via admin.php text in MySQL zet en dat in index.php terug komt.
Nu wil ik ook bij iedere nieuwe blog entry een uniek plaatje toevoegen, wat ik samen met de text upload naar de index pagina.
index.php
[code=php]while ($row = mysql_fetch_array($myResult, MYSQL_ASSOC)) {
$thisCat= $row['category_name'];
if ($lastCat<>$thisCat) { // true first time($lastCat not set), and each time a new category is found
//then write out a table heading with the category name
//temporary foreach loop to display the returned records
print '<div>'; //heading spans all columns of table
echo '<img src="http://www.overdatum.nl/testt/thumbs/'.$thumb_name.'" />';
print "<h2>".$row['category_name']."</h2>"; // print the next category heading
print "</div>\n";
}
print '<div><h1>'.$row['topic_name'].'</h1><br /><br /><br />'."\n";
print ''.$row['topic_desc'].''."\n";
print '<p><a href="'.$row['topic_url'].'">'.(substr($row['topic_url'],0,29));
if ((strlen($row['topic_url']) > 30)) {print "…";}
print'</a></p></div>';[/code=php]
Het plaatje komt niet tevoorschijn.
Terwijl dit plaatje na het uploaden wel automatisch door een script wordt ge-resized en geupload naar map thumb op de server.
Voorbeeld van het script in werking:
@ www.overdatum.nl/testt/create_thumb.php
Nu is het zo dat via admin.php text in MySQL zet en dat in index.php terug komt.
Nu wil ik ook bij iedere nieuwe blog entry een uniek plaatje toevoegen, wat ik samen met de text upload naar de index pagina.
index.php
[code=php]while ($row = mysql_fetch_array($myResult, MYSQL_ASSOC)) {
$thisCat= $row['category_name'];
if ($lastCat<>$thisCat) { // true first time($lastCat not set), and each time a new category is found
//then write out a table heading with the category name
//temporary foreach loop to display the returned records
print '<div>'; //heading spans all columns of table
echo '<img src="http://www.overdatum.nl/testt/thumbs/'.$thumb_name.'" />';
print "<h2>".$row['category_name']."</h2>"; // print the next category heading
print "</div>\n";
}
print '<div><h1>'.$row['topic_name'].'</h1><br /><br /><br />'."\n";
print ''.$row['topic_desc'].''."\n";
print '<p><a href="'.$row['topic_url'].'">'.(substr($row['topic_url'],0,29));
if ((strlen($row['topic_url']) > 30)) {print "…";}
print'</a></p></div>';[/code=php]
Het plaatje komt niet tevoorschijn.
Terwijl dit plaatje na het uploaden wel automatisch door een script wordt ge-resized en geupload naar map thumb op de server.
Voorbeeld van het script in werking:
@ www.overdatum.nl/testt/create_thumb.php
[ Voor 43% gewijzigd door Zakkenwasser op 17-10-2008 01:06 . Reden: duidenlijker uitgelegd ]
PSP 1000 @ 6.60 Pro C2 [+256GB]
PSVita @ Henkaku Enso [+256GB]
3DS @ Luma (B9S) [+160GB]
Nintendo Switch 3.0.1 [+256GB]