Thread: [Picfinity-commit] SF.net SVN: picfinity: [34] trunk/index.php
Status: Beta
Brought to you by:
espadav8
From: <esp...@us...> - 2007-08-13 17:49:53
|
Revision: 34 http://picfinity.svn.sourceforge.net/picfinity/?rev=34&view=rev Author: espadav8 Date: 2007-08-13 10:49:32 -0700 (Mon, 13 Aug 2007) Log Message: ----------- Check for the thumbnail at the same time as we check $create_thumbnails. Should avoid a function call, not sure if this really saves time Modified Paths: -------------- trunk/index.php Modified: trunk/index.php =================================================================== --- trunk/index.php 2007-08-13 13:47:37 UTC (rev 33) +++ trunk/index.php 2007-08-13 17:49:32 UTC (rev 34) @@ -157,7 +157,7 @@ if (in_array($ext, $valid_image_formats)) { // create a thumbnail if we've been told to - if ($create_thumbnails) + if (($create_thumbnails) && (!file_exists('.thumbs/' . $folder . '/' . $folder_entry))) { create_thumbnail($folder, $folder_entry, $ext); } @@ -223,11 +223,6 @@ global $thumbnail_width; global $thumbnail_height; - if (file_exists('.thumbs/'.$folder.'/'.$image)) - { - // if it already exists, do nothing - return; - } if (!is_dir('.thumbs/'.$folder)) { MakeDirectory('.thumbs/'.$folder, 0777); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esp...@us...> - 2007-08-14 00:06:33
|
Revision: 35 http://picfinity.svn.sourceforge.net/picfinity/?rev=35&view=rev Author: espadav8 Date: 2007-08-13 17:06:33 -0700 (Mon, 13 Aug 2007) Log Message: ----------- Update the location of the DTD. This will end up on the sf.net home page Modified Paths: -------------- trunk/index.php Modified: trunk/index.php =================================================================== --- trunk/index.php 2007-08-13 17:49:32 UTC (rev 34) +++ trunk/index.php 2007-08-14 00:06:33 UTC (rev 35) @@ -105,7 +105,7 @@ if ($name == "") $folder_layout_xml = "<?xml version=\"1.0\"?>" . "\n" - . "<!DOCTYPE layout PUBLIC \"-//picfinity//Gallery Layout//EN\" \"http://www.sunset-cigarette.co.uk/gallery/gallery.dtd\">" + . "<!DOCTYPE layout PUBLIC \"-//picfinity//Gallery Layout//EN\" \"http://www.espadav8.co.uk/gallery/gallery.dtd\">" . "\n" . "<layout id=\"$folder_id\" name=\"\">\n"; else @@ -312,7 +312,7 @@ 'scalarAsAttributes' => true, 'doctype' => array ( 'id' => '-//picfinity//Gallery Layout//EN', - 'uri' => 'http://www.sunset-cigarette.co.uk/gallery/gallery.dtd' + 'uri' => 'http://www.espadav8.co.uk/gallery/gallery.dtd' ) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esp...@us...> - 2007-08-14 21:12:09
|
Revision: 38 http://picfinity.svn.sourceforge.net/picfinity/?rev=38&view=rev Author: espadav8 Date: 2007-08-14 14:12:12 -0700 (Tue, 14 Aug 2007) Log Message: ----------- Fix imagepg() -> imagepng() Modified Paths: -------------- trunk/index.php Modified: trunk/index.php =================================================================== --- trunk/index.php 2007-08-14 16:10:39 UTC (rev 37) +++ trunk/index.php 2007-08-14 21:12:12 UTC (rev 38) @@ -272,7 +272,7 @@ switch ($ext) { case 'png': - imagepg($dst_img, '.thumbs/'.$folder.'/'.$image); + imagepng($dst_img, '.thumbs/'.$folder.'/'.$image); break; case 'jpg': case 'jpeg': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esp...@us...> - 2007-08-18 16:07:11
|
Revision: 44 http://picfinity.svn.sourceforge.net/picfinity/?rev=44&view=rev Author: espadav8 Date: 2007-08-18 09:07:11 -0700 (Sat, 18 Aug 2007) Log Message: ----------- Switch the test around for the .themes folder (saves calling is_dir many times) Modified Paths: -------------- trunk/index.php Modified: trunk/index.php =================================================================== --- trunk/index.php 2007-08-16 12:58:09 UTC (rev 43) +++ trunk/index.php 2007-08-18 16:07:11 UTC (rev 44) @@ -123,8 +123,8 @@ while (list(,$folder_entry) = each($folder_contents)) { // if it's a folder and the path of it is ./.themes then create the list of themes - if ((is_dir($folder . '/' . $folder_entry)) && - (($folder . '/' . $folder_entry) == "./.themes") && + if ((($folder . '/' . $folder_entry) == "./.themes") && + (is_dir('./themes')) && $enable_themes) { if ($use_pear) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esp...@us...> - 2007-08-27 16:30:10
|
Revision: 57 http://picfinity.svn.sourceforge.net/picfinity/?rev=57&view=rev Author: espadav8 Date: 2007-08-25 07:55:36 -0700 (Sat, 25 Aug 2007) Log Message: ----------- Make some possible inputs safe Modified Paths: -------------- trunk/index.php Modified: trunk/index.php =================================================================== --- trunk/index.php 2007-08-25 10:27:14 UTC (rev 56) +++ trunk/index.php 2007-08-25 14:55:36 UTC (rev 57) @@ -131,7 +131,7 @@ // create the XML if ($name == "") - $folder_layout_xml = "<?xml version=\"1.0\"?>\n" + $folder_layout_xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" . "<!DOCTYPE layout PUBLIC \"-//picfinity//Gallery Layout//EN\" \"http://www.espadav8.co.uk/gallery/gallery.dtd\">\n" . "<layout id=\"$folder_id\" name=\"\">\n"; else @@ -189,7 +189,7 @@ add_image_to_db($image_id); } - if (($use_db) && ($image_id == $post_id)) + if (($use_db) && ($image_id === $post_id)) { $folder_layout_xml .= "\t<image id=\"$image_id\" file=\"$folder_entry\">\n" . get_comments($image_id) @@ -242,14 +242,14 @@ { while ($row = mysql_fetch_assoc($result)) { - $comments_xml .= "<comment>" - . "<name>$row[user_name]</name>" - . "<www>$row[user_www]</www>" - . "<email>$row[user_email]</email>" - . "<comment_text>$row[user_comment]</comment_text>" - . "<rating>$row[comment_rating]</rating>" - . "<added>$row[date_added]</added>" - . "</comment>"; + $comments_xml .= "<comment>\n" + . "<name>$row[user_name]</name>\n" + . "<www>$row[user_www]</www>\n" + . "<email>$row[user_email]</email>\n" + . "<comment_text>".htmlspecialchars($row['user_comment'])."</comment_text>\n" + . "<rating>$row[comment_rating]</rating>\n" + . "<added>$row[date_added]</added>\n" + . "</comment>\n"; } return $comments_xml; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <esp...@us...> - 2007-09-06 10:26:33
|
Revision: 68 http://picfinity.svn.sourceforge.net/picfinity/?rev=68&view=rev Author: espadav8 Date: 2007-09-06 03:26:33 -0700 (Thu, 06 Sep 2007) Log Message: ----------- Move all the config options to the top Add the option 'rescan_folders' if this is set to false, and the gallery.xml file exists, then just load the xml file to pass to the xsl if set to false, or the gallery.xml file doesn't exist, run as normal and recreate the whole xml, saving it if needed Add 'default_theme' as a option as well, to save having to look for the right place to change the string Modified Paths: -------------- trunk/index.php Modified: trunk/index.php =================================================================== --- trunk/index.php 2007-09-02 17:52:28 UTC (rev 67) +++ trunk/index.php 2007-09-06 10:26:33 UTC (rev 68) @@ -2,6 +2,37 @@ // site options $site_name = "Picfinity"; + // default theme + $deault_theme = "clean"; + + // create thumbnails for images that don't have one already + $create_thumbnails = true; + + // create a flat HTML version of the page + $create_html = false; + + // rescan the folders (and thus recreate the XML for each page request) + $rescan_folders = false; + + // create the gallery.xml file (for use by themes) + $create_xml = true; + + // Allow the users to change the theme + // this needs the PHP version of the page + $enable_themes = true; + + // thumbnail sizes + $thumbnail_width = 100; + $thumbnail_height = 100; + + // use the database + $use_db = true; + + // valid images to be shown + $valid_image_formats = array('png', 'gif', 'jpg', 'jpeg', 'bmp'); + + + // here we either get the theme posted in // or if there's one stored in the cookie use that one // otherwise use the default one @@ -17,7 +48,7 @@ else { // set the name of the default theme here - $theme = "db" ; + $theme = $deault_theme; } if ($_GET['id']) @@ -29,72 +60,63 @@ $post_id = 0; } - // create thumbnails for images that don't have one already - $create_thumbnails = true; - - // create a flat HTML version of the page - $create_html = false; - - // create the gallery.xml file (for use by themes - $create_xml = true; - - // Allow the users to change the theme - // this needs the PHP version of the page - $enable_themes = true; - - // thumbnail sizes - $thumbnail_width = 100; - $thumbnail_height = 100; - - // use the database - $use_db = true; - - if ($use_db) + if (($rescan_folders) || !file_exists("gallery.xml")) { - require_once ('db.inc'); - if (!$db_connection) + if ($use_db) { - $use_db = false; - } - else - { - if ($selected_table) + require_once ('db.inc'); + if (!$db_connection) { - $result = mysql_query("SELECT image_md5 FROM images"); - if (!$result) + $use_db = false; + } + else + { + if ($selected_table) { - echo 'Invalid query: ' . mysql_error() . "\n"; - echo 'Whole query: ' . $query; - $use_db = false; + $result = mysql_query("SELECT image_md5 FROM images"); + if (!$result) + { + echo 'Invalid query: ' . mysql_error() . "\n"; + echo 'Whole query: ' . $query; + $use_db = false; + } + else + { + $current_images = array(); + while ($row = mysql_fetch_row($result)) + { + $current_images[] = $row[0]; + } + mysql_free_result($result); + } } else { - $current_images = array(); - while ($row = mysql_fetch_row($result)) - { - $current_images[] = $row[0]; - } - mysql_free_result($result); + $use_db = false; } } - else - { - $use_db = false; - } } - } - // valid images to be shown - $valid_image_formats = array('png', 'gif', 'jpg', 'jpeg', 'bmp'); + // get the layout of the current dir + $site_layout_xml = create_folder_layout('.'); - // get the layout of the current dir - $site_layout_xml = create_folder_layout('.'); + // create the XML file if we've been told to + if ($create_xml) + { + $fh = fopen("gallery.xml", "w"); + fwrite($fh, $site_layout_xml); + fclose($fh); + } - // create the XML file if we've been told to - if ($create_xml) + if ($use_db) + { + mysql_close($db_connection); + } + } + else { - $fh = fopen("gallery.xml", "w"); - fwrite($fh, $site_layout_xml); + $fh = fopen("gallery.xml", "r"); + $site_layout_xml = fread($fh, filesize("gallery.xml")); fclose($fh); } @@ -109,11 +131,6 @@ fclose($fh); } - if ($use_db) - { - mysql_close($db_connection); - } - // echo the HTML to the screen echo $html; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |