changeset 0:561c0b0f3234

initial add
author paulo@twcdns.fastsearch.net
date Wed, 21 Jul 2010 00:11:54 -0700
parents
children c749eccf9edc
files index.php pics/browse.php pics/common.php pics/index.php thule_fit_kits/index.php
diffstat 5 files changed, 274 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/index.php	Wed Jul 21 00:11:54 2010 -0700
     1.3 @@ -0,0 +1,59 @@
     1.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     1.5 +<HTML>
     1.6 +<HEAD>
     1.7 +<META NAME="generator" CONTENT="http://txt2tags.sf.net">
     1.8 +<LINK REL="stylesheet" TYPE="text/css" HREF="index.css">
     1.9 +<TITLE>-[pauloang.com]-</TITLE>
    1.10 +</HEAD>
    1.11 +<BODY>
    1.12 +
    1.13 +<DIV CLASS="header" ID="header">
    1.14 +<H1>-[pauloang.com]-</H1>
    1.15 +</DIV>
    1.16 +
    1.17 +<DIV CLASS="body" ID="body">
    1.18 +<DL>
    1.19 +
    1.20 +<?php
    1.21 +
    1.22 +	include('../login.php');
    1.23 +	$database = 'pauloang_index';
    1.24 +	
    1.25 +	$link = mysql_connect('localhost', $username, $password);
    1.26 +	if (!$link)
    1.27 +		die('Could not connect to MySQL server: ' . mysql_error());
    1.28 +	
    1.29 +	$db_selected = mysql_select_db($database, $link);
    1.30 +	if (!$db_selected)
    1.31 +		die('Could not select database: ' . mysql_error());
    1.32 +	
    1.33 +	$query = 'SELECT * FROM Links';
    1.34 +	$results = mysql_query($query);
    1.35 +	
    1.36 +	while ($row = mysql_fetch_assoc($results)) {
    1.37 +		echo '<DT>';
    1.38 +		echo '<A HREF="'.$row['URL'].'">'.$row['Title'].'</A>';
    1.39 +		echo '</DT>'."\n";
    1.40 +		echo '<DD>';
    1.41 +		echo '<DIV CLASS="index_date">';
    1.42 +		echo 'First added: '.$row['FirstMod'].' '.'<BR>';
    1.43 +		echo 'Last modified: '.$row['LastMod'];
    1.44 +		echo '</DIV>';
    1.45 +		echo '</DD>'."\n";
    1.46 +	}
    1.47 +	
    1.48 +	mysql_free_result($results);
    1.49 +	mysql_close($link);
    1.50 +?>
    1.51 +
    1.52 +</DL>
    1.53 +
    1.54 +<DIV CLASS="email">
    1.55 +<P><A HREF="mailto:pbba13@gmail.com">pbba13@gmail.com</A></P>
    1.56 +</DIV>
    1.57 +
    1.58 +</DIV>
    1.59 +
    1.60 +<!-- html code generated by txt2tags 2.4 (http://txt2tags.sf.net) -->
    1.61 +<!-- cmdline: txt2tags index.t2t -->
    1.62 +</BODY></HTML>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/pics/browse.php	Wed Jul 21 00:11:54 2010 -0700
     2.3 @@ -0,0 +1,23 @@
     2.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     2.5 +<HTML>
     2.6 +<HEAD>
     2.7 +<META NAME="generator" CONTENT="http://txt2tags.sf.net">
     2.8 +<LINK REL="stylesheet" TYPE="text/css" HREF="index.css">
     2.9 +<?php $title = basename(getcwd()) ?>
    2.10 +<TITLE><?php echo $title ?></TITLE>
    2.11 +</HEAD>
    2.12 +<BODY>
    2.13 +
    2.14 +<DIV CLASS="body" ID="body">
    2.15 +
    2.16 +<?php
    2.17 +	include('../common.php');
    2.18 +
    2.19 +	browse();
    2.20 +?>
    2.21 +
    2.22 +</DIV>
    2.23 +
    2.24 +<!-- html code generated by txt2tags 2.4 (http://txt2tags.sf.net) -->
    2.25 +<!-- cmdline: txt2tags index.t2t -->
    2.26 +</BODY></HTML>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/pics/common.php	Wed Jul 21 00:11:54 2010 -0700
     3.3 @@ -0,0 +1,80 @@
     3.4 +<?php
     3.5 +	$thumbs_dir = "thumbs/";
     3.6 +	$browse_dir = "browse/";
     3.7 +
     3.8 +	function listThumbs($thumbs_dir) {
     3.9 +		$dh = opendir($thumbs_dir);
    3.10 +		if ($dh) {
    3.11 +			while (($file = readdir($dh)) !== false) {
    3.12 +			   if (strncmp($file, ".", 1) != 0)
    3.13 +			      $files[] = $file;
    3.14 +			}
    3.15 +			
    3.16 +			sort($files, SORT_NUMERIC);
    3.17 +			foreach ($files as $file)
    3.18 +			   echo '<A HREF="browse.php?id=' . $file . '"><IMG SRC="' . $thumbs_dir . $file . '"></A> ' . "\n";
    3.19 +			
    3.20 +			closedir($dh);
    3.21 +		}
    3.22 +	}
    3.23 +
    3.24 +	function browse($browse_dir, $thumbs_dir) {
    3.25 +		include('../../../login.php');
    3.26 +
    3.27 +		$database = 'pauloang_pics';
    3.28 +
    3.29 +		$link = mysql_connect('localhost', $username, $password);
    3.30 +		if (!$link)
    3.31 +			die('Could not connect to MySQL server: ' . mysql_error());
    3.32 +	
    3.33 +		$db_selected = mysql_select_db($database, $link);
    3.34 +		if (!$db_selected)
    3.35 +			die('Could not select database: ' . mysql_error());
    3.36 +	
    3.37 +
    3.38 +		foreach ($_GET as $getKey => $getValue) {
    3.39 +			if ($getKey == "id" && !empty($_GET[$getKey])) {
    3.40 +				$dh = opendir($browse_dir);
    3.41 +				if ($dh) {
    3.42 +					while (($file = readdir($dh)) !== false) {
    3.43 +						if (strncmp($file, ".", 1) != 0)
    3.44 +							$files[] = $file;
    3.45 +					}
    3.46 +				}
    3.47 +				closedir($dh);
    3.48 +
    3.49 +				sort($files, SORT_NUMERIC);
    3.50 +				for ($i = 0, $size = sizeof($files); $i < $size; $i++) {
    3.51 +					if ($files[$i] == $getValue) {
    3.52 +						if ($i > 0) {
    3.53 +							echo '<A HREF=browse.php?id=' . $files[$i - 1] . '>';
    3.54 +							echo '<IMG SRC="' . $thumbs_dir . $files[$i - 1]. '">';
    3.55 +							echo '</A>' . "\n";
    3.56 +						}
    3.57 +						if ($i < $size - 1) {
    3.58 +							echo '<A HREF=browse.php?id=' . $files[$i + 1] . '>';
    3.59 +							echo '<IMG SRC="' . $thumbs_dir . $files[$i + 1]. '">';
    3.60 +							echo '</A>' . "\n";
    3.61 +						}
    3.62 +						echo '<br>' . "\n";
    3.63 +						echo '<A HREF="./">';
    3.64 +						echo '<IMG SRC="' . $browse_dir . $files[$i] . '"> ';
    3.65 +						echo '</A>' . "\n";
    3.66 +
    3.67 +						$query = 'SELECT * FROM '. basename(getcwd()) . ' WHERE id = "' . $getValue . '"';
    3.68 +						$results = mysql_query($query);
    3.69 +
    3.70 +						if ($results) {
    3.71 +							$row = mysql_fetch_assoc($results);
    3.72 +							$caption = $row['caption'];
    3.73 +							echo '<P>' . $caption . '</P>' . "\n";
    3.74 +						}
    3.75 +
    3.76 +						break;
    3.77 +					}
    3.78 +				}
    3.79 +				break;
    3.80 +			}
    3.81 +		}
    3.82 +	}
    3.83 +?>
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/pics/index.php	Wed Jul 21 00:11:54 2010 -0700
     4.3 @@ -0,0 +1,31 @@
     4.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     4.5 +<HTML>
     4.6 +<HEAD>
     4.7 +<META NAME="generator" CONTENT="http://txt2tags.sf.net">
     4.8 +<LINK REL="stylesheet" TYPE="text/css" HREF="index.css">
     4.9 +<?php $title = basename(getcwd()) ?>
    4.10 +<TITLE><?php echo $title ?></TITLE>
    4.11 +</HEAD>
    4.12 +<BODY>
    4.13 +
    4.14 +<DIV CLASS="header" ID="header">
    4.15 +<H1><?php echo $title ?></H1>
    4.16 +</DIV>
    4.17 +
    4.18 +<DIV CLASS="body" ID="body">
    4.19 +
    4.20 +<P>
    4.21 +This was me (Paulo Ang) and a couple of friends (Vinh Huynh, Daniel Rohrlick) riding our bikes from Santa Ana to Newport Beach to San Diego on the weekend of October 2-3, 2009.
    4.22 +</P>
    4.23 +
    4.24 +<?php
    4.25 +	include('../common.php');
    4.26 +
    4.27 +	listThumbs();
    4.28 +?>
    4.29 +
    4.30 +</DIV>
    4.31 +
    4.32 +<!-- html code generated by txt2tags 2.4 (http://txt2tags.sf.net) -->
    4.33 +<!-- cmdline: txt2tags index.t2t -->
    4.34 +</BODY></HTML>
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/thule_fit_kits/index.php	Wed Jul 21 00:11:54 2010 -0700
     5.3 @@ -0,0 +1,81 @@
     5.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     5.5 +<HTML>
     5.6 +<HEAD>
     5.7 +<META NAME="generator" CONTENT="http://txt2tags.sf.net">
     5.8 +<LINK REL="stylesheet" TYPE="text/css" HREF="index.css">
     5.9 +<TITLE>Thule Fit Kit Database</TITLE>
    5.10 +</HEAD>
    5.11 +<BODY>
    5.12 +
    5.13 +<DIV CLASS="header" ID="header">
    5.14 +<H1>Thule Fit Kit Database</H1>
    5.15 +</DIV>
    5.16 +
    5.17 +<DIV CLASS="body" ID="body">
    5.18 +
    5.19 +<P>
    5.20 +Trying to figure out if you can reuse those Thule fit kit rubber pads or mounting brackets on another car?  Here's a database you can check, with PDF installation instruction manuals.
    5.21 +</P>
    5.22 +
    5.23 +<TABLE>
    5.24 +<TR>
    5.25 +<TH>Kit Number</TH>
    5.26 +<TH>Cars</TH>
    5.27 +<TH>Rubber Pad Number</TH>
    5.28 +<TH>Bracket Number</TH>
    5.29 +<TH>Miscellaneous Parts</TH>
    5.30 +</TR>
    5.31 +
    5.32 +<?php
    5.33 +	
    5.34 +	include('../../login.php');
    5.35 +	$database = 'pauloang_fitkits';
    5.36 +
    5.37 +	$link = mysql_connect('localhost', $username, $password);
    5.38 +	if (!$link)
    5.39 +		die('Could not connect to MySQL server: ' . mysql_error());
    5.40 +
    5.41 +	$db_selected = mysql_select_db($database, $link);
    5.42 +	if (!$db_selected)
    5.43 +		die('Could not select database: ' . mysql_error());
    5.44 +
    5.45 +	$query = 'SELECT * FROM Thule ORDER BY kit_id';
    5.46 +	$results = mysql_query($query);
    5.47 +
    5.48 +	while ($row = mysql_fetch_assoc($results)) {
    5.49 +		echo '<TR>';
    5.50 +		echo '<TD><A HREF="pdf/thule-fit-kit-' . $row['kit_id'] . '-instructions.pdf">' . $row['kit_id'] . '</A></TD>';
    5.51 +		echo '<TD>';
    5.52 +		$cars = explode(';', $row['car']);
    5.53 +		foreach ($cars as $car)
    5.54 +			echo $car . '<br>';
    5.55 +		echo '</TD>';
    5.56 +		echo '<TD>' . $row['rubber_pad'] . '</TD>';
    5.57 +		echo '<TD>' . $row['bracket'] . '</TD>';
    5.58 +		echo '<TD>';
    5.59 +		$misc = explode(',', $row['misc']);
    5.60 +		foreach ($misc as $misc_item) {
    5.61 +			if ($misc_item) {
    5.62 +				$misc_item = trim($misc_item);
    5.63 +				$misc_filename = 'misc_' . $misc_item . '.png';
    5.64 +				if (file_exists($misc_filename))
    5.65 +					echo '<IMG SRC="' . $misc_filename . '" ALT="' . $misc_item . '"> ';
    5.66 +				else
    5.67 +					echo $misc_item . ',';
    5.68 +			}
    5.69 +		}
    5.70 +		echo '</TD>';
    5.71 +		echo '</TR>' . "\n";
    5.72 +	}
    5.73 +
    5.74 +	mysql_free_result($results);
    5.75 +	mysql_close($link);
    5.76 +
    5.77 +?>
    5.78 +
    5.79 +</TABLE>
    5.80 +</DIV>
    5.81 +
    5.82 +<!-- html code generated by txt2tags 2.4 (http://txt2tags.sf.net) -->
    5.83 +<!-- cmdline: txt2tags index.t2t -->
    5.84 +</BODY></HTML>