Changeset 2651
- Timestamp:
- 06/30/08 02:26:07 (12 months ago)
- Location:
- branches/release-41/php
- Files:
-
- 7 modified
-
lib/MTUtil.php (modified) (2 diffs)
-
lib/function.mtassetthumbnaillink.php (modified) (1 diff)
-
lib/function.mtauthoruserpic.php (modified) (1 diff)
-
lib/function.mtcommenteruserpic.php (modified) (1 diff)
-
lib/function.mtentryauthoruserpic.php (modified) (1 diff)
-
lib/thumbnail_lib.php (modified) (2 diffs)
-
mt.php.pre (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-41/php/lib/MTUtil.php
r2595 r2651 1301 1301 $dest; 1302 1302 $thumb_name = $static_file_path.DIRECTORY_SEPARATOR.$image_path.DIRECTORY_SEPARATOR.$format; 1303 $thumb->get_thumbnail($dest, $thumb_w, $thumb_h, $scale, $thumb_name, 'png'); 1303 if (!$thumb->get_thumbnail($dest, $thumb_w, $thumb_h, $scale, $thumb_name, 'png')) { 1304 return ''; 1305 } 1304 1306 $basename = basename($dest); 1305 1307 … … 1345 1347 $thumb_h = $height; 1346 1348 $dest; 1347 $thumb->get_thumbnail($dest, $thumb_w, $thumb_h, $scale, $thumb_name); 1349 if (!$thumb->get_thumbnail($dest, $thumb_w, $thumb_h, $scale, $thumb_name)) { 1350 return ''; 1351 } 1348 1352 1349 1353 # make url -
branches/release-41/php/lib/function.mtassetthumbnaillink.php
r1174 r2651 28 28 29 29 list($thumb, $thumb_w, $thumb_h) = get_thumbnail_file($asset, $blog, $width, $height, $scale); 30 if (empty($thumb)) { 31 return ''; 32 } 33 30 34 $target = ""; 31 35 if (isset($args['new_window'])) -
branches/release-41/php/lib/function.mtauthoruserpic.php
r2356 r2651 26 26 require_once("MTUtil.php"); 27 27 $userpic_url = userpic_url($asset[0], $blog, $author); 28 if (empty($userpic_url)) 29 return ''; 28 30 $asset_path = asset_path($asset[0]['asset_file_path'], $blog); 29 31 list($src_w, $src_h, $src_type, $src_attr) = getimagesize($asset_path); -
branches/release-41/php/lib/function.mtcommenteruserpic.php
r1174 r2651 22 22 require_once("MTUtil.php"); 23 23 $userpic_url = userpic_url($asset[0], $blog, $cmntr); 24 if (empty($userpic_url)) 25 return ''; 26 24 27 $asset_path = asset_path($asset[0]['asset_file_path'], $blog); 25 28 list($src_w, $src_h, $src_type, $src_attr) = getimagesize($asset_path); -
branches/release-41/php/lib/function.mtentryauthoruserpic.php
r1174 r2651 23 23 require_once("MTUtil.php"); 24 24 $userpic_url = userpic_url($asset[0], $blog, $author); 25 if (empty($userpic_url)) 26 return ''; 25 27 $asset_path = asset_path($asset[0]['asset_file_path'], $blog); 26 28 list($src_w, $src_h, $src_type, $src_attr) = getimagesize($asset_path); -
branches/release-41/php/lib/thumbnail_lib.php
r2580 r2651 16 16 function Thumbnail ($src) { 17 17 $this->src_file = $src; 18 } 19 20 # Can we use function of GD? 21 function is_available () { 22 return extension_loaded('gd'); 18 23 } 19 24 … … 90 95 if (empty($this->src_file)) return false; 91 96 if (!file_exists($this->src_file)) return false; 97 if (!$this->is_available()) { 98 global $mt; 99 $mt->warning_log($mt->translate('GD support has not been available. Please install GD support.')); 100 return false; 101 } 92 102 93 103 # Get source image information -
branches/release-41/php/mt.php.pre
r2479 r2651 30 30 var $conditional = false; 31 31 var $log = array(); 32 var $warning = array(); 32 33 var $id; 33 34 var $request; … … 597 598 echo $output; 598 599 600 // if warnings found, show it. 601 if (!empty($this->warning)) { 602 $this->_dump($this->warning); 603 } 604 599 605 if ($this->debugging) { 600 606 $this->log("Queries: ".$mtdb->num_queries); … … 688 694 } 689 695 690 function log_dump() {696 function _dump($dump) { 691 697 if ($_SERVER['REMOTE_ADDR']) { 692 698 // web view... 693 699 echo "<div class=\"debug\" style=\"border:1px solid red; margin:0.5em; padding: 0 1em; text-align:left; background-color:#ddd; color:#000\"><pre>"; 694 echo implode("\n", $ this->log);700 echo implode("\n", $dump); 695 701 echo "</pre></div>\n\n"; 696 702 } else { 697 703 // console view... 698 704 $stderr = fopen('php://stderr', 'w'); 699 fwrite($stderr,implode("\n", $ this->log));700 echo (implode("\n", $ this->log));705 fwrite($stderr,implode("\n", $dump)); 706 echo (implode("\n", $dump)); 701 707 fclose($stderr); 702 708 } 709 } 710 711 function log_dump() { 712 $this->_dump($this->log); 703 713 } 704 714 … … 793 803 return $out; 794 804 } 805 806 function warning_log($str) { 807 $this->warning[] = $str; 808 } 795 809 } 796 810
