Index: /trunk/wifidog-auth/ChangeLog
===================================================================
--- /trunk/wifidog-auth/ChangeLog	(revision 564)
+++ /trunk/wifidog-auth/ChangeLog	(revision 565)
@@ -1,2 +1,5 @@
+2005-04-23 François Proulx <francois.proulx@gmail.com>
+	* Added Preferred Size support for Flickr pictures
+	
 2005-04-23 François Proulx <francois.proulx@gmail.com>
 	* Completed missing translations
Index: /trunk/wifidog-auth/wifidog/include/schema_validate.php
===================================================================
--- /trunk/wifidog-auth/wifidog/include/schema_validate.php	(revision 562)
+++ /trunk/wifidog-auth/wifidog/include/schema_validate.php	(revision 565)
@@ -339,4 +339,5 @@
            	$sql .= "\n\nUPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n";
             $sql .= "ALTER TABLE files ADD COLUMN url text;";
+            $sql .= "ALTER TABLE flickr_photostream ADD COLUMN preferred_size text;";
             $sql .= "CREATE TABLE embedded_content (
 				embedded_content_id text NOT NULL,
Index: /trunk/wifidog-auth/wifidog/local_content/default/stylesheet.css
===================================================================
--- /trunk/wifidog-auth/wifidog/local_content/default/stylesheet.css	(revision 562)
+++ /trunk/wifidog-auth/wifidog/local_content/default/stylesheet.css	(revision 565)
@@ -255,5 +255,5 @@
     background-color: #696969;
     color: white;
-    margin-left: 260px;
+	width: 140px;
 }
 .flickr_tags h3 {
Index: /trunk/wifidog-auth/wifidog/classes/Content/FlickrPhotostream.php
===================================================================
--- /trunk/wifidog-auth/wifidog/classes/Content/FlickrPhotostream.php	(revision 563)
+++ /trunk/wifidog-auth/wifidog/classes/Content/FlickrPhotostream.php	(revision 565)
@@ -54,4 +54,11 @@
 		const TAG_MODE_ALL = 'ALL_TAGS';
 
+		/* Sizes */
+		const SIZE_SQUARED_75x75 = 's';
+		const SIZE_THUMB_100x75 = 't';
+		const SIZE_SMALL_240x180 = 'm';
+		const SIZE_MEDIUM_500x375 = '';
+		const SIZE_ORIGINAL = 'o';
+
 		private $flickr_api;
 
@@ -67,5 +74,5 @@
 			{
 				/*Since the parent Content exists, the necessary data in content_group had not yet been created */
-				$sql = "INSERT INTO flickr_photostream (flickr_photostream_id) VALUES ('$content_id')";
+				$sql = "INSERT INTO flickr_photostream (flickr_photostream_id, preferred_size) VALUES ('$content_id', '".self :: SIZE_SMALL_240x180."')";
 				$db->ExecSqlUpdate($sql, false);
 
@@ -255,4 +262,27 @@
 				default :
 					throw new Exception("Illegal tag matching mode.");
+			}
+		}
+
+		public function getPreferredSize()
+		{
+			return $this->flickr_photostream_row['preferred_size'];
+		}
+
+		public function setPreferredSize($size)
+		{
+			switch ($size)
+			{
+				case self :: SIZE_SQUARED_75x75 :
+				case self :: SIZE_THUMB_100x75 :
+				case self :: SIZE_SMALL_240x180 :
+				case self :: SIZE_MEDIUM_500x375 :
+				case self :: SIZE_ORIGINAL :
+					$size = $this->mBd->EscapeString($size);
+					$this->mBd->ExecSqlUpdate("UPDATE flickr_photostream SET preferred_size = '$size' WHERE flickr_photostream_id = '".$this->getId()."'");
+					$this->refresh();
+					break;
+				default :
+					throw new Exception("Illegal size.");
 			}
 		}
@@ -416,4 +446,12 @@
 					$this->shouldDisplayDescription() ? $checked = 'CHECKED' : $checked = '';
 					$html .= "<input type='checkbox' name='$name' $checked>\n";
+					$html .= "</div>\n";
+					$html .= "</div>\n";
+
+					$html .= "<div class='admin_section_container'>\n";
+					$html .= "<div class='admin_section_title'>"._("Preferred size")." : </div>\n";
+					$html .= "<div class='admin_section_data'>\n";
+					$preferred_sizes = array (array (0 => self :: SIZE_SQUARED_75x75, 1 => _("Squared 75x75")), array (0 => self :: SIZE_THUMB_100x75, 1 => _("Thumbnail 100x75")), array (0 => self :: SIZE_SMALL_240x180, 1 => _("Small 240x180")), array (0 => self :: SIZE_MEDIUM_500x375, 1 => _("Medium 500x375")), array (0 => self :: SIZE_ORIGINAL, 1 => _("Original size")));
+					$html .= $generator->generateFromArray($preferred_sizes, $this->getPreferredSize(), "PreferredSize".$this->getID(), "FlickrPhotostream", false, null, "onChange='submit()'");
 					$html .= "</div>\n";
 					$html .= "</div>\n";
@@ -514,6 +552,8 @@
 				$name = "flickr_photostream_".$this->id."_display_description";
 				!empty ($_REQUEST[$name]) ? $this->setDisplayDescription(true) : $this->setDisplayDescription(false);
-			}
-
+				
+				if ($generator->isPresent("PreferredSize".$this->getID(), "FlickrPhotostream"))
+					$this->setPreferredSize($generator->getResult("PreferredSize".$this->getID(), "FlickrPhotostream"));
+			}
 		}
 
@@ -567,5 +607,8 @@
 						if ($this->shouldDisplayTitle())
 							$html .= '<div class="flickr_title"><h3>'.$photo->getTitle().'</h3></div>'."\n";
-						$html .= '<div class="flickr_photo"><a href="'.$photo->buildUrl().'"><img src="'.$photo->buildImgUrl().'"></a></div>'."\n";
+							$size = $this->getPreferredSize();
+							if(empty($size))
+								$size = null;
+						$html .= '<div class="flickr_photo"><a href="'.$photo->buildUrl().'"><img src="'.$photo->buildImgUrl($size).'"></a></div>'."\n";
 						if ($this->shouldDisplayTags())
 						{
Index: /trunk/wifidog-auth/wifidog/classes/Content/EmbeddedContent.php
===================================================================
--- /trunk/wifidog-auth/wifidog/classes/Content/EmbeddedContent.php	(revision 563)
+++ /trunk/wifidog-auth/wifidog/classes/Content/EmbeddedContent.php	(revision 565)
@@ -220,27 +220,14 @@
 
 		/*
-		 * 
-		 * <object classid="clsid:A12BCD3F-GH4I-56JK-xyz"
-		codebase="http://example.com/content.cab" 
-		width="100" height="80">
-		<param name="Movie" value="moviename.swf" />
-		<embed src="moviename.swf" width="100" height="80"
-		pluginspage="http://example.com/shockwave/download/" />
-		<noembed>
-		<img alt="Still from Movie" src="moviename.gif" 
-		width="100" height="80" />
-		</noembed>
-		</object>
-		 * 
-		 * 
+		 * Example
 		 * <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="400" height="316" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
-						<param name="SRC" value="/sponsors/airborne/400.mov">
-		
-						<param name="QTNEXT1" value="<http://stream.qtv.apple.com/qtv/endorphin/http/hydrogen3_ref.mov> T<myself>">
-						<param name="AUTOPLAY" value="true">
-						<param name="CONTROLLER" value="true">
-						<embed src="/sponsors/airborne/400.mov" qtnext1="<http://stream.qtv.apple.com/qtv/endorphin/http/hydrogen3_ref.mov> T<myself>" width="400" height="316" align="left" autoplay="true" controller="true" pluginspage="http://www.apple.com/quicktime/download/">
-						</embed>
-						</object>
+			<param name="SRC" value="/sponsors/airborne/400.mov">
+	
+			<param name="QTNEXT1" value="<http://stream.qtv.apple.com/qtv/endorphin/http/hydrogen3_ref.mov> T<myself>">
+			<param name="AUTOPLAY" value="true">
+			<param name="CONTROLLER" value="true">
+			<embed src="/sponsors/airborne/400.mov" qtnext1="<http://stream.qtv.apple.com/qtv/endorphin/http/hydrogen3_ref.mov> T<myself>" width="400" height="316" align="left" autoplay="true" controller="true" pluginspage="http://www.apple.com/quicktime/download/">
+			</embed>
+			</object>
 		 * 
 		 */
