" . $file; //echo "
" . $thumb; //echo "
" . $thumb_height; $img = getimagesize($file); if($img == false) { die("File '$file' does not appear to be an image"); } $mimtype = $img['mime']; //echo "
" . $mimtype; $width = $img[0]; $height =$img[1]; $new_width = $thumb_height * $width / $height; $image_p = imagecreatetruecolor($new_width, $thumb_height); switch($mimtype){ case 'image/jpeg': $thumbfile = $thumb . ".jpg"; if(file_exists($thumbfile)) { break; } $image = imagecreatefromjpeg($file); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $thumb_height, $width, $height); imagejpeg($image_p, $thumbfile, 100); break; case 'image/png': $thumbfile = $thumb . ".png"; if(file_exists($thumbfile)) { break; } $image = imagecreatefrompng($file); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $thumb_height, $width, $height); imagepng($image_p, $thumbfile, 100); break; case 'image/gif': $thumbfile = $thumb . ".gif"; if(file_exists($thumbfile)) { break; } $image = imagecreatefromgif($file); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $thumb_height, $width, $height); imagegif($image_p, $thumbfile, 100); echo "
" . $thumbfile; break; default: ; } // switch return $thumbfile; } ?> buildlog.net - CNC Laser Buildlogs
Active Build Logs

bdring's CNC Laser

Building BuildLog.net

XMOS Controller

BFLaser DIY Australian

UL-25E Rebuild

Totally DIY Laser Cutter

CNC Laser Project Buildlog Logo

DIY Aussie Laser

UL-25E

UL-25E

Recent Forum Posts

2 AND p.post_id = t.topic_last_post_id AND p.poster_id = u.user_id ORDER BY p.post_id DESC LIMIT $topicnumber"; $result = mysql_query($query) or die("Query failed"); print ""; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo ""; } print "

" . $row["topic_title"] . "

by: " . $row["username"] . "
"; mysql_free_result($result); $query = "SELECT * FROM $table_attachments a WHERE mimetype LIKE 'image%' ORDER BY a.filetime desc LIMIT 6"; //echo $query; $result = mysql_query($query) or die("Query failed"); echo "

Recent Forum Images -or- See Them All


"; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { $filebase = $row[physical_filename]; // concat the directory and file extension $file = "forum/files/" . $filebase; $new_height = 80; $thumbPrefix = "forum_thumbs/" . $filebase; $thumbfile = makeThumb($file,$thumbPrefix,$new_height); //echo ""; //'echo "$row[physical_filename]"; echo ""; echo " "; //echo "\n"; } mysql_free_result($result); $query = "SELECT s.session_user_id, s.session_time,u.username, u.user_id FROM $table_sessions s, $table_users u WHERE session_user_id = user_id and (UNIX_TIMESTAMP() - s.session_time) < (5 * 60)"; $result = mysql_query($query) or die("Query failed"); $anonymous = 0; $online_count = 0; $who_is_online = ""; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { if ($row[username_clean] != 'anonymous') { $who_is_online .= $row['username'] . ', '; $online_count ++; } else { $anonymous ++; $online_count++; } //echo " "; //echo "\n"; } if ($anonymous > 0) { $who_is_online .= 'guests(' . $anonymous . ')'; } if ($online_count > 0) { echo '

Who is online - '; echo $who_is_online; echo '

'; } mysql_free_result($result); mysql_close($link); ?>