Merging in some breadcrumb crap from Nighthawk with the search engine updates from Scribus
authorDan
Sat, 24 Nov 2007 11:41:40 -0500
changeset 14 e47e4be549ad
parent 12 3893b99cd443 (diff)
parent 13 f6ca7cead82c (current diff)
child 15 ac7d3dedcc44
Merging in some breadcrumb crap from Nighthawk with the search engine updates from Scribus
plugins/gallery/browser.php
--- a/plugins/gallery/browser.php	Wed Nov 21 15:22:13 2007 -0500
+++ b/plugins/gallery/browser.php	Sat Nov 24 11:41:40 2007 -0500
@@ -361,16 +361,16 @@
   }
   
   // From here, this breadcrumb stuff is a piece of... sourdough French bread :-) *smacks lips*
-  echo '<div class="tblholder" style="padding: 4px; margin-bottom: 7px;">';
+  echo '<div class="breadcrumbs" style="padding: 4px; margin-bottom: 7px;">';
   // Upload image link for admins
   if ( $session->user_level >= USER_LEVEL_ADMIN )
   {
     echo '<div style="float: right; font-size: smaller;">';
-    echo '<b><a href="' . makeUrlNS('Special', 'GalleryUpload') . '">Upload new image(s)</a></b>';
+    echo '<a href="' . makeUrlNS('Special', 'GalleryUpload') . '">Upload new image(s)</a>';
     echo '</div>';
   }
   // The actual breadcrumbs
-  echo '<b><small>' . implode(' &raquo; ', $breadcrumbs) . '</small></b>';
+  echo '<small>' . implode(' &raquo; ', $breadcrumbs) . '</small>';
   echo '</div>';
   
   // "Edit all" link
--- a/plugins/gallery/upload.php	Wed Nov 21 15:22:13 2007 -0500
+++ b/plugins/gallery/upload.php	Sat Nov 24 11:41:40 2007 -0500
@@ -139,12 +139,8 @@
                 $errors[] = "Could not delete $thumb_filename";
                 break 2;
               }
-              $magick = getConfig('imagemagick_path');
-              $command = "$magick '{$filename}' -resize ".'"'."80x80>".'"'." -quality 85 $thumb_filename";
               
-              @system($command, $stat);
-              
-              if ( !file_exists($thumb_filename) )
+              if ( !scale_image($filename, $thumb_filename, 80, 80) )
               {
                 $errors[] = 'Couldn\'t scale image '.$i.': ImageMagick failed us';
                 break 2;
@@ -157,16 +153,13 @@
                 $errors[] = "Could not delete $preview_filename";
                 break 2;
               }
-              $magick = getConfig('imagemagick_path');
-              $command = "$magick '{$filename}' -resize ".'"'."640x640>".'"'." -quality 85 $preview_filename";
               
-              @system($command, $stat);
-              
-              if ( !file_exists($preview_filename) )
+              if ( !scale_image($filename, $preview_filename, 640, 480) )
               {
                 $errors[] = 'Couldn\'t scale image '.$i.': ImageMagick failed us';
                 break 2;
               }
+              
               $to_update['img_time_mod'] = strval(time());
             }
           }
@@ -737,9 +730,6 @@
           // Time for some unzipping fun.
           //
           
-          // for debugging only
-          system('rm -fr ' . ENANO_ROOT . '/cache/temp');
-          
           error_reporting(E_ALL);
           
           mkdir(ENANO_ROOT . '/cache/temp') or $errors[] = 'Could not create temporary directory for extraction.';
@@ -837,14 +827,19 @@
             
             $idlist[] = $db->insert_id();
             
+            //
+            // Create scaled images
+            //
+            
             // Create thumbnail image
             $thumb_filename = ENANO_ROOT . '/cache/' . $stored_name . '-thumb.jpg';
-            $magick = getConfig('imagemagick_path');
-            $command = "$magick '{$store}' -resize ".'"'."80x80>".'"'." -quality 85 $thumb_filename";
+            if ( !unlink($thumb_filename) )
+            {
+              $errors[] = "Could not delete $thumb_filename";
+              break 2;
+            }
             
-            @system($command, $stat);
-            
-            if ( !file_exists($thumb_filename) )
+            if ( !scale_image($store, $thumb_filename, 80, 80) )
             {
               $errors[] = 'Couldn\'t scale image '.$i.': ImageMagick failed us';
               break 2;
@@ -852,12 +847,13 @@
             
             // Create preview image
             $preview_filename = ENANO_ROOT . '/cache/' . $stored_name . '-preview.jpg';
-            $magick = getConfig('imagemagick_path');
-            $command = "$magick '{$store}' -resize ".'"'."640x640>".'"'." -quality 85 $preview_filename";
+            if ( !unlink($preview_filename) )
+            {
+              $errors[] = "Could not delete $preview_filename";
+              break 2;
+            }
             
-            @system($command, $stat);
-            
-            if ( !file_exists($preview_filename) )
+            if ( !scale_image($store, $preview_filename, 640, 640) )
             {
               $errors[] = 'Couldn\'t scale image '.$i.': ImageMagick failed us';
               break 2;
--- a/plugins/gallery/viewimage.php	Wed Nov 21 15:22:13 2007 -0500
+++ b/plugins/gallery/viewimage.php	Sat Nov 24 11:41:40 2007 -0500
@@ -189,9 +189,9 @@
   $breadcrumbs[] = htmlspecialchars($row['img_title']);
   
   // From here, this breadcrumb stuff is a piece of... sourdough French bread :-) *smacks lips*
-  echo '<div class="tblholder" style="padding: 4px; margin-bottom: 7px;">';
+  echo '<div class="breadcrumbs" style="padding: 4px; margin-bottom: 7px;">';
   // The actual breadcrumbs
-  echo '<b><small>' . implode(' &raquo; ', $breadcrumbs) . '</small></b>';
+  echo '<small>' . implode(' &raquo; ', $breadcrumbs) . '</small>';
   echo '</div>';
   
   echo '<div style="text-align: center; margin: 10px auto; border: 1px solid #DDDDDD; padding: 7px 10px; display: table;">';