Author Topic: Cottage!  (Read 4939 times)

0 Members and 1 Guest are viewing this topic.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Cottage!
« 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.

trust

  • Guest
Re: Cottage!
« Reply #1 on: August 31, 2005, 09:10:51 pm »
Stupid rich boy and your lake house. gtfo.

Offline AntiVirus

  • Legendary
  • x86
  • Hero Member
  • *****
  • Posts: 2521
  • Best
    • View Profile
Re: Cottage!
« Reply #2 on: August 31, 2005, 09:15:09 pm »
:(
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
The once grove of splendor,
Aforetime crowned by lilac and lily,
Lay now forevermore slender;
And all winds that liven
Silhouette a lone existence;
A leafless oak grasping at eternity.


"They say that I must learn to kill before I can feel safe, but I rather kill myself then turn into their slave."
- The Rasmus

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Cottage!
« Reply #3 on: September 03, 2005, 11:50:00 am »
Yes, daddy

Offline Blaze

  • x86
  • Hero Member
  • *****
  • Posts: 7136
  • Canadian
    • View Profile
    • Maide
Re: Cottage!
« Reply #4 on: September 03, 2005, 03:41:12 pm »
And like a fool I believed myself, and thought I was somebody else...

Offline Joe

  • B&
  • x86
  • Hero Member
  • *****
  • Posts: 10319
  • In Soviet Russia, text read you!
    • View Profile
    • Github
Re: Cottage!
« Reply #5 on: September 03, 2005, 05:23:41 pm »
Uh, his cottage is just over the bridge. Everyone knows that. =p
I'd personally do as Joe suggests

You might be right about that, Joe.


Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity

Offline Blaze

  • x86
  • Hero Member
  • *****
  • Posts: 7136
  • Canadian
    • View Profile
    • Maide
Re: Cottage!
« Reply #7 on: September 05, 2005, 03:52:41 pm »
So how was [size=0pt]WoW/[/size] the cottage?
And like a fool I believed myself, and thought I was somebody else...

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Cottage!
« Reply #8 on: September 05, 2005, 04:56:56 pm »
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. 

Offline Blaze

  • x86
  • Hero Member
  • *****
  • Posts: 7136
  • Canadian
    • View Profile
    • Maide
Re: Cottage!
« Reply #9 on: September 05, 2005, 06:07:44 pm »

Gallery.php
Code: [Select]
<?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

Code: [Select]
<?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);
}
?>

And like a fool I believed myself, and thought I was somebody else...

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Cottage!
« Reply #10 on: September 05, 2005, 09:04:51 pm »
A better version of the edit file:
thumb.php.inc

Code: [Select]
<?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$im0000$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_array0sizeof($__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.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Cottage!
« Reply #11 on: September 06, 2005, 12:12:54 am »
I'm going to write it myself.  It'll do me good to use php.  I've read about it, but never used it.

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: Cottage!
« Reply #12 on: September 07, 2005, 05:46:00 pm »
Now you have additional references!  :D

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: Cottage!
« Reply #13 on: September 07, 2005, 05:57:41 pm »
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.