Changeset 565

Show
Ignore:
Timestamp:
04/23/05 23:40:00 (8 years ago)
Author:
fproulx
Message:

2005-04-23 Fran��ois Proulx <francois.proulx@…>

  • Added Preferred Size support for Flickr pictures
Location:
trunk/wifidog-auth
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/ChangeLog

    r564 r565  
     12005-04-23 François Proulx <francois.proulx@gmail.com> 
     2        * Added Preferred Size support for Flickr pictures 
     3         
    142005-04-23 François Proulx <francois.proulx@gmail.com> 
    25        * Completed missing translations 
  • trunk/wifidog-auth/wifidog/classes/Content/EmbeddedContent.php

    r563 r565  
    220220 
    221221                /* 
    222                  *  
    223                  * <object classid="clsid:A12BCD3F-GH4I-56JK-xyz" 
    224                 codebase="http://example.com/content.cab"  
    225                 width="100" height="80"> 
    226                 <param name="Movie" value="moviename.swf" /> 
    227                 <embed src="moviename.swf" width="100" height="80" 
    228                 pluginspage="http://example.com/shockwave/download/" /> 
    229                 <noembed> 
    230                 <img alt="Still from Movie" src="moviename.gif"  
    231                 width="100" height="80" /> 
    232                 </noembed> 
    233                 </object> 
    234                  *  
    235                  *  
     222                 * Example 
    236223                 * <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" width="400" height="316" codebase="http://www.apple.com/qtactivex/qtplugin.cab"> 
    237                                                 <param name="SRC" value="/sponsors/airborne/400.mov"> 
    238                  
    239                                                 <param name="QTNEXT1" value="<http://stream.qtv.apple.com/qtv/endorphin/http/hydrogen3_ref.mov> T<myself>"> 
    240                                                 <param name="AUTOPLAY" value="true"> 
    241                                                 <param name="CONTROLLER" value="true"> 
    242                                                 <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/"> 
    243                                                 </embed> 
    244                                                 </object> 
     224                        <param name="SRC" value="/sponsors/airborne/400.mov"> 
     225         
     226                        <param name="QTNEXT1" value="<http://stream.qtv.apple.com/qtv/endorphin/http/hydrogen3_ref.mov> T<myself>"> 
     227                        <param name="AUTOPLAY" value="true"> 
     228                        <param name="CONTROLLER" value="true"> 
     229                        <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/"> 
     230                        </embed> 
     231                        </object> 
    245232                 *  
    246233                 */ 
  • trunk/wifidog-auth/wifidog/classes/Content/FlickrPhotostream.php

    r563 r565  
    5454                const TAG_MODE_ALL = 'ALL_TAGS'; 
    5555 
     56                /* Sizes */ 
     57                const SIZE_SQUARED_75x75 = 's'; 
     58                const SIZE_THUMB_100x75 = 't'; 
     59                const SIZE_SMALL_240x180 = 'm'; 
     60                const SIZE_MEDIUM_500x375 = ''; 
     61                const SIZE_ORIGINAL = 'o'; 
     62 
    5663                private $flickr_api; 
    5764 
     
    6774                        { 
    6875                                /*Since the parent Content exists, the necessary data in content_group had not yet been created */ 
    69                                 $sql = "INSERT INTO flickr_photostream (flickr_photostream_id) VALUES ('$content_id')"; 
     76                                $sql = "INSERT INTO flickr_photostream (flickr_photostream_id, preferred_size) VALUES ('$content_id', '".self :: SIZE_SMALL_240x180."')"; 
    7077                                $db->ExecSqlUpdate($sql, false); 
    7178 
     
    255262                                default : 
    256263                                        throw new Exception("Illegal tag matching mode."); 
     264                        } 
     265                } 
     266 
     267                public function getPreferredSize() 
     268                { 
     269                        return $this->flickr_photostream_row['preferred_size']; 
     270                } 
     271 
     272                public function setPreferredSize($size) 
     273                { 
     274                        switch ($size) 
     275                        { 
     276                                case self :: SIZE_SQUARED_75x75 : 
     277                                case self :: SIZE_THUMB_100x75 : 
     278                                case self :: SIZE_SMALL_240x180 : 
     279                                case self :: SIZE_MEDIUM_500x375 : 
     280                                case self :: SIZE_ORIGINAL : 
     281                                        $size = $this->mBd->EscapeString($size); 
     282                                        $this->mBd->ExecSqlUpdate("UPDATE flickr_photostream SET preferred_size = '$size' WHERE flickr_photostream_id = '".$this->getId()."'"); 
     283                                        $this->refresh(); 
     284                                        break; 
     285                                default : 
     286                                        throw new Exception("Illegal size."); 
    257287                        } 
    258288                } 
     
    416446                                        $this->shouldDisplayDescription() ? $checked = 'CHECKED' : $checked = ''; 
    417447                                        $html .= "<input type='checkbox' name='$name' $checked>\n"; 
     448                                        $html .= "</div>\n"; 
     449                                        $html .= "</div>\n"; 
     450 
     451                                        $html .= "<div class='admin_section_container'>\n"; 
     452                                        $html .= "<div class='admin_section_title'>"._("Preferred size")." : </div>\n"; 
     453                                        $html .= "<div class='admin_section_data'>\n"; 
     454                                        $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"))); 
     455                                        $html .= $generator->generateFromArray($preferred_sizes, $this->getPreferredSize(), "PreferredSize".$this->getID(), "FlickrPhotostream", false, null, "onChange='submit()'"); 
    418456                                        $html .= "</div>\n"; 
    419457                                        $html .= "</div>\n"; 
     
    514552                                $name = "flickr_photostream_".$this->id."_display_description"; 
    515553                                !empty ($_REQUEST[$name]) ? $this->setDisplayDescription(true) : $this->setDisplayDescription(false); 
    516                         } 
    517  
     554                                 
     555                                if ($generator->isPresent("PreferredSize".$this->getID(), "FlickrPhotostream")) 
     556                                        $this->setPreferredSize($generator->getResult("PreferredSize".$this->getID(), "FlickrPhotostream")); 
     557                        } 
    518558                } 
    519559 
     
    567607                                                if ($this->shouldDisplayTitle()) 
    568608                                                        $html .= '<div class="flickr_title"><h3>'.$photo->getTitle().'</h3></div>'."\n"; 
    569                                                 $html .= '<div class="flickr_photo"><a href="'.$photo->buildUrl().'"><img src="'.$photo->buildImgUrl().'"></a></div>'."\n"; 
     609                                                        $size = $this->getPreferredSize(); 
     610                                                        if(empty($size)) 
     611                                                                $size = null; 
     612                                                $html .= '<div class="flickr_photo"><a href="'.$photo->buildUrl().'"><img src="'.$photo->buildImgUrl($size).'"></a></div>'."\n"; 
    570613                                                if ($this->shouldDisplayTags()) 
    571614                                                { 
  • trunk/wifidog-auth/wifidog/include/schema_validate.php

    r562 r565  
    339339                $sql .= "\n\nUPDATE schema_info SET value='$new_schema_version' WHERE tag='schema_version';\n"; 
    340340            $sql .= "ALTER TABLE files ADD COLUMN url text;"; 
     341            $sql .= "ALTER TABLE flickr_photostream ADD COLUMN preferred_size text;"; 
    341342            $sql .= "CREATE TABLE embedded_content ( 
    342343                                embedded_content_id text NOT NULL, 
  • trunk/wifidog-auth/wifidog/local_content/default/stylesheet.css

    r562 r565  
    255255    background-color: #696969; 
    256256    color: white; 
    257     margin-left: 260px; 
     257        width: 140px; 
    258258} 
    259259.flickr_tags h3 {