[pLog-svn] r1062 - in plugins/trunk: delicious delicious/install/templates delicious/locale flickr flickr/install/templates flickr/locale

mark at devel.plogworld.net mark at devel.plogworld.net
Sun Feb 13 16:03:11 GMT 2005


Author: mark
Date: 2005-02-13 16:03:11 +0000 (Sun, 13 Feb 2005)
New Revision: 1062

Modified:
   plugins/trunk/delicious/install/templates/delicious.template
   plugins/trunk/delicious/locale/locale_en_UK.php
   plugins/trunk/delicious/locale/locale_zh_TW.php
   plugins/trunk/delicious/plugindelicious.class.php
   plugins/trunk/flickr/install/templates/flickr.template
   plugins/trunk/flickr/locale/locale_en_UK.php
   plugins/trunk/flickr/locale/locale_zh_TW.php
   plugins/trunk/flickr/pluginflickr.class.php
Log:
Update template to show an error message when the plugin does not enabled.

Modified: plugins/trunk/delicious/install/templates/delicious.template
===================================================================
--- plugins/trunk/delicious/install/templates/delicious.template	2005-02-13 15:17:47 UTC (rev 1061)
+++ plugins/trunk/delicious/install/templates/delicious.template	2005-02-13 16:03:11 UTC (rev 1062)
@@ -1,8 +1,12 @@
 {include file="$blogtemplate/header.template"}
+{if $delicious->isEnabled()}
  {assign var=tagId value=$smarty.request.tag}
  {assign var=deliciousTags value=$delicious->getTagList()}
  {foreach item=deliciousTag from=$deliciousTags}
   {math equation="ceil(x/y)+1" assign=fontsize x=$deliciousTag.count y=5}
   <font size={$fontsize}><a href="{$deliciousTag.deliciousUrl}" style="border-bottom: 0px;" title="{$deliciousTag.count} Posts">{$deliciousTag.id}</a></font>&nbsp;&nbsp;&nbsp;&nbsp;
  {/foreach}
+{else}
+ {$locale->tr("error_delicious_not_enabled")}
+{/if}
 {include file="$blogtemplate/footer.template"}
\ No newline at end of file

Modified: plugins/trunk/delicious/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/delicious/locale/locale_en_UK.php	2005-02-13 15:17:47 UTC (rev 1061)
+++ plugins/trunk/delicious/locale/locale_en_UK.php	2005-02-13 16:03:11 UTC (rev 1062)
@@ -10,6 +10,7 @@
 $messages["delicious_settings_saved_ok"] = "Del.icio.us settings saved successfully!";
 $messages["delicious_error_username"] = "User Name can not be empty!";
 $messages["delicious_error_password"] = "Password can not be empty!";
+$messages["error_delicious_not_enabled"] = "Please kindly enable Del.icio.us plugin first.";
 
 $messages["label_username"] = "User Name";
 $messages["label_password"] = "Password";

Modified: plugins/trunk/delicious/locale/locale_zh_TW.php
===================================================================
--- plugins/trunk/delicious/locale/locale_zh_TW.php	2005-02-13 15:17:47 UTC (rev 1061)
+++ plugins/trunk/delicious/locale/locale_zh_TW.php	2005-02-13 16:03:11 UTC (rev 1062)
@@ -10,6 +10,7 @@
 $messages["delicious_settings_saved_ok"] = "Del.icio.us 設定儲存成功。";
 $messages["delicious_error_username"] = "帳號錯誤!不可為空白。";
 $messages["delicious_error_password"] = "密碼錯誤!不可為空白。";
+$messages["error_delicious_not_enabled"] = "請您先啟動 Del.icio.us 外掛程式。";
 
 $messages["label_username"] = "帳號";
 $messages["label_password"] = "密碼";

Modified: plugins/trunk/delicious/plugindelicious.class.php
===================================================================
--- plugins/trunk/delicious/plugindelicious.class.php	2005-02-13 15:17:47 UTC (rev 1061)
+++ plugins/trunk/delicious/plugindelicious.class.php	2005-02-13 16:03:11 UTC (rev 1062)
@@ -57,6 +57,11 @@
 			$this->userName = $blogSettings->getValue( "plugin_delicious_username" );
             $this->password = $blogSettings->getValue( "plugin_delicious_password" );
 		}
+	    
+	    function isEnabled()
+	    {
+	        return $this->pluginEnabled;
+	    }
 
         function pluginTemplatePage( $template )
         {

Modified: plugins/trunk/flickr/install/templates/flickr.template
===================================================================
--- plugins/trunk/flickr/install/templates/flickr.template	2005-02-13 15:17:47 UTC (rev 1061)
+++ plugins/trunk/flickr/install/templates/flickr.template	2005-02-13 16:03:11 UTC (rev 1062)
@@ -1,36 +1,40 @@
 {include file="$blogtemplate/header.template"} 
-{assign var=albumId value=$smarty.request.album}
-{assign var=photoId value=$smarty.request.photo}
-{assign var=secretId value=$smarty.request.secret}
-{if $albumId != NULL && $photoId != NULL && secretId != NULL}
-    {assign var=flickrPhotoInfo value=$flickr->getPhotoInfo($photoId,$secretId)}
-    <h3>{$locale->tr("flickr_photo_title")} {$flickrPhotoInfo.title}</h3>
-    <a href="{$flickrPhotoInfo.originalimageUrl}"><img class="annotated" src="{$flickrPhotoInfo.resizeimageUrl}" alt="" usemap="imgmap" /></a><br />
-    {assign var=flickrNotes value=$flickrPhotoInfo.notes}
-    <map id="imgmap">
-    {foreach item=flickrNote from=$flickrNotes}
-        <area alt="" title="{$flickrNote.noteDesc}" nohref="nohref" shape="rect" coords="{$flickrNote.noteX},{$flickrNote.noteY},{$flickrNote.noteX+$flickrNote.noteW-1},{$flickrNote.noteY+$flickrNote.noteH-1}" />
-    {/foreach}
-    </map> 
-    {assign var=flickrTags value=$flickrPhotoInfo.tags}
-    {$locale->tr("flickr_photo_description")} {$flickrPhotoInfo.description}<br />
-    {$locale->tr("flickr_photo_date")} {$flickrPhotoInfo.date}<br />
-    {$locale->tr("flickr_photo_tag")} {foreach item=flickrTag from=$flickrTags}<a href="{$flickrTag.tagUrl}">{$flickrTag.tagName}</a> {/foreach}<br />
-    {$locale->tr("flickr_photo_url")} <a href="{$flickrPhotoInfo.flickrUrl}">{$locale->tr("flickr_photo_see_url")} ({$flickrPhotoInfo.comments} {$locale->tr("comments")})</a><br />
-{elseif $albumId != NULL && ($photoId == NULL || secretId == NULL)}
-    {assign var=flickrPhotos value=$flickr->getPhotos($albumId)}
-    {foreach item=flickrPhoto from=$flickrPhotos}
-        <a href="{$flickrPhoto.photoUrl}"><img src="{$flickrPhoto.thumbnailUrl}" alt="" /></a>
-    {/foreach}
+{if $flickr->isEnabled()}
+    {assign var=albumId value=$smarty.request.album}
+    {assign var=photoId value=$smarty.request.photo}
+    {assign var=secretId value=$smarty.request.secret}
+    {if $albumId != NULL && $photoId != NULL && secretId != NULL}
+        {assign var=flickrPhotoInfo value=$flickr->getPhotoInfo($photoId,$secretId)}
+        <h3>{$locale->tr("flickr_photo_title")} {$flickrPhotoInfo.title}</h3>
+        <a href="{$flickrPhotoInfo.originalimageUrl}"><img class="annotated" src="{$flickrPhotoInfo.resizeimageUrl}" alt="" usemap="imgmap" /></a><br />
+        {assign var=flickrNotes value=$flickrPhotoInfo.notes}
+        <map id="imgmap">
+        {foreach item=flickrNote from=$flickrNotes}
+            <area alt="" title="{$flickrNote.noteDesc}" nohref="nohref" shape="rect" coords="{$flickrNote.noteX},{$flickrNote.noteY},{$flickrNote.noteX+$flickrNote.noteW-1},{$flickrNote.noteY+$flickrNote.noteH-1}" />
+        {/foreach}
+        </map> 
+        {assign var=flickrTags value=$flickrPhotoInfo.tags}
+        {$locale->tr("flickr_photo_description")} {$flickrPhotoInfo.description}<br />
+        {$locale->tr("flickr_photo_date")} {$flickrPhotoInfo.date}<br />
+        {$locale->tr("flickr_photo_tag")} {foreach item=flickrTag from=$flickrTags}<a href="{$flickrTag.tagUrl}">{$flickrTag.tagName}</a> {/foreach}<br />
+        {$locale->tr("flickr_photo_url")} <a href="{$flickrPhotoInfo.flickrUrl}">{$locale->tr("flickr_photo_see_url")} ({$flickrPhotoInfo.comments} {$locale->tr("comments")})</a><br />
+    {elseif $albumId != NULL && ($photoId == NULL || secretId == NULL)}
+        {assign var=flickrPhotos value=$flickr->getPhotos($albumId)}
+        {foreach item=flickrPhoto from=$flickrPhotos}
+            <a href="{$flickrPhoto.photoUrl}"><img src="{$flickrPhoto.thumbnailUrl}" alt="" /></a>
+        {/foreach}
+    {else}
+        {assign var=flickrAlbums value=$flickr->getPhotoList()}
+        {foreach name=flickrAlbum item=flickrAlbum from=$flickrAlbums}
+             <a href="{$flickrAlbum.albumUrl}"><img src="{$flickrAlbum.thumbnailUrl}" alt="{$flickrAlbum.title}" /></a><br />
+             {$locale->tr("flickr_album_title")} {$flickrAlbum.title} <br />
+             {$locale->tr("flickr_album_description")} {$flickrAlbum.description} <br />
+             {$locale->tr("flickr_album_photos")} <a href="{$flickrAlbum.albumUrl}">{$flickrAlbum.photos}</a> <br />
+             {$locale->tr("flickr_album_url")} <a href="{$flickrAlbum.flickrUrl}">{$locale->tr("flickr_album_see_url")}</a> <br /><br />
+        {/foreach}
+        {assign var=totalAlbums value=$smarty.foreach.flickrAlbum.total}
+    {/if}
 {else}
-    {assign var=flickrAlbums value=$flickr->getPhotoList()}
-    {foreach name=flickrAlbum item=flickrAlbum from=$flickrAlbums}
-         <a href="{$flickrAlbum.albumUrl}"><img src="{$flickrAlbum.thumbnailUrl}" alt="{$flickrAlbum.title}" /></a><br />
-         {$locale->tr("flickr_album_title")} {$flickrAlbum.title} <br />
-         {$locale->tr("flickr_album_description")} {$flickrAlbum.description} <br />
-         {$locale->tr("flickr_album_photos")} <a href="{$flickrAlbum.albumUrl}">{$flickrAlbum.photos}</a> <br />
-         {$locale->tr("flickr_album_url")} <a href="{$flickrAlbum.flickrUrl}">{$locale->tr("flickr_album_see_url")}</a> <br /><br />
-    {/foreach}
-    {assign var=totalAlbums value=$smarty.foreach.flickrAlbum.total}
-{/if}
+    {$locale->tr("error_flickr_not_enabled")}
+{/if}    
 {include file="$blogtemplate/footer.template"} 
\ No newline at end of file

Modified: plugins/trunk/flickr/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/flickr/locale/locale_en_UK.php	2005-02-13 15:17:47 UTC (rev 1061)
+++ plugins/trunk/flickr/locale/locale_en_UK.php	2005-02-13 16:03:11 UTC (rev 1062)
@@ -20,6 +20,7 @@
 $messages["flickr_error_password"] = "Password can not be empty!";
 $messages["flickr_error_aliasname"] = "Alias Name can not be empty";
 $messages["flickr_error_expiredtime"] = "To reduce the loading of Flickr server, the expired time can not shorter then 3600 secs.";
+$messages["error_flickr_not_enabled"] = "Please kindly enable Flickr plugin first.";
 
 $messages["label_email"] = "E-Mail";
 $messages["label_password"] = "Password";

Modified: plugins/trunk/flickr/locale/locale_zh_TW.php
===================================================================
--- plugins/trunk/flickr/locale/locale_zh_TW.php	2005-02-13 15:17:47 UTC (rev 1061)
+++ plugins/trunk/flickr/locale/locale_zh_TW.php	2005-02-13 16:03:11 UTC (rev 1062)
@@ -20,6 +20,7 @@
 $messages["flickr_error_password"] = "密碼錯誤!不可為空白。";
 $messages["flickr_error_aliasname"] = "代名錯誤!不可為空白。";
 $messages["flickr_error_expiredtime"] = "為防止 Flickr 伺服器負荷過重。最短的暫存檔有效期為 3600 秒。";
+$messages["error_flickr_not_enabled"] = "請您先啟動 Flickr 外掛程式。";
 
 $messages["label_email"] = "帳號";
 $messages["label_password"] = "密碼";

Modified: plugins/trunk/flickr/pluginflickr.class.php
===================================================================
--- plugins/trunk/flickr/pluginflickr.class.php	2005-02-13 15:17:47 UTC (rev 1061)
+++ plugins/trunk/flickr/pluginflickr.class.php	2005-02-13 16:03:11 UTC (rev 1062)
@@ -82,6 +82,11 @@
             $this->showNote = $blogSettings->getValue( "plugin_flickr_shownote" );
             $this->expiredTime = $blogSettings->getValue( "plugin_flickr_expiredtime" );
 		}
+
+	    function isEnabled()
+	    {
+	        return $this->pluginEnabled;
+	    }
 		
         function pluginTemplatePage( $template )
         {




More information about the pLog-svn mailing list