[3879] trunk/htdocs/system/plugins/habarisilo: Add a default image to display if we can't create a thumbnail.

0 views
Skip to first unread message

svn-N...@habariproject.org

unread,
Dec 13, 2009, 12:14:07 AM12/13/09
to habar...@googlegroups.com
Revision
3879
Author
michaeltwofish
Date
2009-12-13 05:14:06 +0000 (Sun, 13 Dec 2009)

Log Message

Add a default image to display if we can't create a thumbnail.

Modified Paths

Added Paths

Diff

Modified: trunk/htdocs/system/plugins/habarisilo/habarisilo.plugin.php (3878 => 3879)


--- trunk/htdocs/system/plugins/habarisilo/habarisilo.plugin.php	2009-12-13 00:36:09 UTC (rev 3878)
+++ trunk/htdocs/system/plugins/habarisilo/habarisilo.plugin.php	2009-12-13 05:14:06 UTC (rev 3879)
@@ -10,6 +10,7 @@
 {
 	protected $root = null;
 	protected $url = null;
+	protected $default_thumbnail = null;
 
 	const SILO_NAME = 'Habari';
 
@@ -23,6 +24,7 @@
 		$user_path = HABARI_PATH . '/' . Site::get_path('user', true);
 		$this->root = $user_path . 'files'; //Options::get('simple_file_root');
 		$this->url = Site::get_url('user', true) . 'files';  //Options::get('simple_file_url');
+		$this->default_thumbnail = $this->get_url('user', true) . 'images/default_thumbnail.png';
 
 		if ( !$this->check_files() ) {
 			Session::error( _t( "Habari Silo activation failed. The web server does not have permission to create the 'files' directory for the Habari Media Silo." ) );
@@ -131,7 +133,8 @@
 
 				if ( !file_exists( dirname( $item ) . '/' . $thumbnail_suffix ) ) {
 					if ( !$this->create_thumbnail( $item ) ) {
-						// Do something if we can't create a thumbnail, like return a default image
+						// We can't create a thumbnail, return a default image
+						$thumbnail_url = $this->default_thumbnail;
 					}
 				}
 				$props = array_merge(

Added: trunk/htdocs/system/plugins/habarisilo/images/default_thumbnail.png


(Binary files differ)
Property changes on: trunk/htdocs/system/plugins/habarisilo/images/default_thumbnail.png ___________________________________________________________________

Added: svn:mime-type

Reply all
Reply to author
Forward
0 new messages