Clan x86
Member Forums => iago's forum => Topic started by: iago on August 31, 2005, 08:51:26 pm
-
All right!
Remember this thread:
http://www.x86labs.org/forum/index.php/topic,2443.new/boardseen.html#new
Tonight, I need to pack, eat, and get to bed.
I'm leaving at about 7am tomorrow morning, with my garndparents. It's a 4 hour drive there, then unpacking and stuff. Tomorrow and Friday should be nice, then on the weekend we're re-roofing with sheet metal. That'll be a long sweaty painful day. But it'll all be good.
I hope to do some fishing, cycling, reading, and take lots of pictures. It'll be all family there, no friends or anything. So it'll be nice. :)
I should be back Monday afternoon, then Monday evening I'm going to Therion. I should be back late Monday, probably dead tired.
I start University on Thursday.
Everybody, be good.
Also, I might take down the server a bit today for maintenance. Just to clean it out and stuff to make sure nothing horrible happens while I'm gone.
And if you want to hack me, this week is a good time. There's no electricity, phones, plumbing, or Internet.
-
Stupid rich boy and your lake house. gtfo.
-
:(
Now I am going to be a lost and confused American boy with out my Canadian here to help me when I get stuck!
Have fun. :D
-
Yes, daddy
-
http://www.javaop.com/uploads/guest/IAGOLIED.gif
iago sucks!
-
Uh, his cottage is just over the bridge. Everyone knows that. =p
-
http://www.javaop.com/uploads/guest/IAGOLIED.gif
iago sucks!
Get help
-
So how was [size=0pt]WoW/[/size] the cottage?
-
Hot...
I got tons of pictures, but I don't want to just directly upload them. I might throw together/download a photo-album-style thing.
-
Gallery.php
<?php
/*
Code by Blaze
Copyright 2004 Ian Fox
*/
//This will be the only page I will add comments to ever.
//Purpose: Either show an image, or show the gallery of images
if (isset($_GET[image])) //check if they requsted an image already
{
echo "<center><img src=images/$_GET[image]></center>";//show the requested image
echo "<br><br><center><a href=?page=gallery><l>Back<l></a></center>";//Show the link back to main gallery page
}
else
{
//show the gallery page with thumbnails
$directory = opendir("images/"); //open a directory handle so we can see whats in the images folder
$filled = 0; //The actual amount of pictures we have added to a row
$capacity = 5; //The max amount of pictures we can have in a row
echo "<h1><center><u>Image Gallery</u></center></h1>";//Title the Gallery
echo "<table border=\"0\" width=\"726\" style=\"padding-left: 0\" height=\"229\">\n";//Start a table to put all the images in
echo "<tr>\n";//Create the first row
while($file = readdir($directory)) //set file as the current image/file that we are looking at.
{
switch ($file)
{
case ".";
//ignore this
break;
case "..";
//ignore that
break;
case "index.php";
//just the redirecting index page
break;
case "Thumbs.db";
//The Stupid MS Generated thumbnail list
break;
case "unknown.jpg";
//the erorr image for pictures other then jpg
break;
default;
//this is an image, use it
if ($filled==$capacity) //If We have the max amount of images on that row
{
//We have filled a row to its max capacity,
echo "</tr>\n<tr>\n";//Get a new container
$filled = 0;//Relize that the container is empty
}
echo "<td width=\"29%\" align=\"center\">";//create a cell for the image, and make it centered
echo "<a href=?page=gallery&image=$file><img src=thumb.php?image=".$file."></a>"; //show the thumbnail and give a link to the real image
echo "</td>\n"; //close the cell that we just created
$filled++;//We added an image to the container
//say that we added another image to the row
}
}
echo "</tr>\n"; //Close whatever row that we are in
echo "</table>"; //close the table
closedir($directory); //Close the current directory handle
}
/*Todo:
-Add Pages
*/
?>
thumb.php (Its an edit of a page I found
<?php
error_reporting(0);
header("Content-type: image/jpeg");
if (!isset($_GET[width]))
{
$new_width = 150;
}
else
{
$new_width = $_GET[width];
}
if (!isset($_GET[height]))
{
$new_height = 150;
}
else
{
$new_height = $_GET[height];
}
$source_path="images/";
$image_name = $_GET[image];
if ($image_name=="")
{
echo "Hey!";
exit;
}
$destimg=imagecreatetruecolor($new_width,$new_height) or $fail = true;
$srcimg=ImageCreateFromJPEG($source_path.$image_name) or $fail = true;
ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg)) or $fail = true;
if ($fail==true)
{
$image_name = "unknown.jpg";
$destimg=imagecreate($new_width,$new_height);
$srcimg=ImageCreateFromJPEG($source_path.$image_name);
ImageCopyResized($destimg,$srcimg,0,0,0,0,$new_width,$new_height,ImageSX($srcimg),ImageSY($srcimg));
ImageJPEG($destimg);
}
else
{
ImageJPEG($destimg);
}
?>
-
A better version of the edit file:
thumb.php.inc
<?php
/* *********************************************************
* thumb.php.inc
* Author - Chris Mullins
* Date - Summer, 2005
* Purpose - Resizes a specified image and saves a thumbnail
* - of that image.
* ********************************************************* */
function createthumb($source, $fname, $x, $y) {
$xy = getimagesize($source);
if(!$x && !$y) { return 0; }
else {
$_e = explode('.', $source);
$e = $_e[sizeof($_e) - 1];
switch(strtolower($e)) {
case 'jpg':
case 'jpeg':
$im = imagecreatefromjpeg($source);
break;
case 'gif':
$im = imagecreatefromgif($source);
break;
case 'wbmp':
$im = imagecreatefromwbmp($source);
break;
case 'png':
$im = imagecreatefrompng($source);
break;
}
$im_x = imagesx($im);
$im_y = imagesy($im);
if($y == 0) {
$scale_x = $x / ($im_x - 1);
$scaley = $im_y * $scale_x;
}
else if($x == 0) {
$scale_y = $y / ($im_y - 1);
$scalex = $im_x & $scale_y;
}
/*
* Minimize strech distortions
*/
$hw = $im_y / $im_x;
if($hw > 1) {
$d_x = (int)($x / $hw);
$d_y = $y;
} else {
$d_y = (int)($y * $hw);
$d_x = $x;
}
echo "The image was resized to (".$d_x."x".$d_y.") to prevent size distortions<br /><br />";
$ot_im = imagecreatetruecolor($d_x, $d_y);
imagecopyresized($ot_im, $im, 0, 0, 0, 0, $d_x, $d_y, $im_x, $im_y);
imagedestroy($im);
/*
$o_im = imagecreatetruecolor($x, $y);
imagecopy($o_im, $ot_im, (($x - $d_x)/2), (($y - $d_y)/2), 0, 0, $x, $y);
imagedestroy($ot_im);
*/
$__turl_array = explode('.', $source);
$__turl_string = implode('.', array_splice($__turl_array, 0, sizeof($__turl_array) - 1));
$__turl_ext = $__turl_array[sizeof($__turl_array) - 1];
$url = $__turl_string . '.thumb.' . $__turl_ext;
/*
$background_color = imagecolorallocate($o_im, 0xFF, 0xFF, 0xFF);
if($x > $d_x) {
/*imagefilledrectangle($o_im, 0, 0, (($x - $d_x)/2), $y, $background_color);
imagefilledrectangle($o_im, ($x-(($x - $d_x)/2)), 0, $x, $y, $background_color);
$f_im = imagecreatetruecolor($d_x, $d_y);
} else {
imagefilledrectangle($o_im, 0, 0, $x, (($y - $d_y)/2), $background_color);
imagefilledrectangle($o_im, 0, ($y-(($y - $d_y)/2)), $x, $y, $background_color);
}
*/
imagejpeg($ot_im, $url);
imagedestroy($ot_im);
echo "Success! A <b>$e</b> thumbnail was generated for <a href=\"$source\"><b>$source</b></a> <br />";
}
}
?>
I'd post all my other gallery code, but it's split up into several files and I don't feel like searching for it.
-
I'm going to write it myself. It'll do me good to use php. I've read about it, but never used it.
-
Now you have additional references! :D
-
I've made good progress, and I haven't looked at them. :)
I'm trying to be fairly complete, like user-accounts and stuff. It should be pretty neat when I'm done.