[pLog-svn] r4259 - in plugins/branches/lifetype-1.1: . randomimage unported

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Wed Nov 8 03:31:28 GMT 2006


Author: jondaley
Date: 2006-11-08 03:31:27 +0000 (Wed, 08 Nov 2006)
New Revision: 4259

Added:
   plugins/branches/lifetype-1.1/randomimage/
   plugins/branches/lifetype-1.1/randomimage/pluginrandomimage.class.php
   plugins/branches/lifetype-1.1/randomimage/readme.txt
Removed:
   plugins/branches/lifetype-1.1/randomimage/pluginrandomimage.class.php
   plugins/branches/lifetype-1.1/randomimage/readme.txt
   plugins/branches/lifetype-1.1/unported/randomimage/
Log:
updated for 1.1

Copied: plugins/branches/lifetype-1.1/randomimage (from rev 4257, plugins/branches/lifetype-1.1/unported/randomimage)

Deleted: plugins/branches/lifetype-1.1/randomimage/pluginrandomimage.class.php
===================================================================
--- plugins/branches/lifetype-1.1/unported/randomimage/pluginrandomimage.class.php	2006-11-08 03:18:34 UTC (rev 4257)
+++ plugins/branches/lifetype-1.1/randomimage/pluginrandomimage.class.php	2006-11-08 03:31:27 UTC (rev 4259)
@@ -1,94 +0,0 @@
-<?php
-
-    include_once( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
-    include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
-    include_once( PLOG_CLASS_PATH."class/gallery/dao/galleryalbums.class.php" );
-
-define("RANDOMIMAGE_DEBUG", 1);
-
-    /**
-     * Plugin returns a randomly selected image from a given album
-     */
-    class PluginRandomImage extends PluginBase
-    {
-        function PluginRandomImage(){
-            $this->PluginBase();
-  
-            $this->id = "randomimage";
-            $this->author = "Jon Daley";
-            $this->desc = "This plugin offers a random image from a specific album.";
-  
-            $this->locales = Array( "en_UK" );
-        }
-
-        /**
-         * Returns the URL to a random image in $albumName
-         * previewType can be "PREVIEW", "MEDIUM" or "FULL"
-         */
-        function getImage($albumName, $previewType){
-            $albums = new GalleryAlbums();
-            $album = $albums->getAlbumByName($albumName);
-            if(!$album){
-                if(RANDOMIMAGE_DEBUG)
-                    return "no album '$albumName'";
-                else
-                    return "";
-            }
-
-            $resources = new GalleryResources();
-
-
-            $numResources = $resources->getNumUserResources(
-                $this->blogInfo->getOwner(), $album->getId(), GALLERY_RESOURCE_IMAGE);
-                
-            if($numResources <= 0){
-                if(RANDOMIMAGE_DEBUG)
-                    return "no resources in album: ".
-                        $this->blogInfo->getOwner()." ". $album->getId()." ".GALLERY_RESOURCE_IMAGE;
-                else
-                    return "";
-            }
-            
-            $whichResource = rand(0, $numResources-1);
-            
-            $query = "SELECT id FROM ".Db::getPrefix()."gallery_resources ".
-                "WHERE album_id = '".$album->getId()."' ".
-                "AND resource_type='".GALLERY_RESOURCE_IMAGE."' ".
-                "LIMIT $whichResource, 1";
-
-            $result = $albums->_db->Execute($query);
-            
-            if(!$result){
-                if(RANDOMIMAGE_DEBUG)
-                    return "bad query '".$query."'";
-                else
-                    return "";
-            }
-
-            if(!($row = $result->FetchRow())){
-                if(RANDOMIMAGE_DEBUG)
-                    return "no results";
-                else
-                    return "";
-            }
-
-            $resource = $resources->getResource($row["id"]);
-            if(!$resource){
-                if(RANDOMIMAGE_DEBUG)
-                    return "bad resource: '".$row["id"]."'";
-                else
-                    return "";
-            }
-
-            $rg = $this->blogInfo->getBlogRequestGenerator();
-            if($previewType == "FULL")
-                return $rg->resourceDownloadLink($resource);
-            else if($previewType == "MEDIUM")
-                return $rg->resourceMediumSizePreviewLink($resource);
-            else
-                return $rg->resourcePreviewLink($resource);
-
-        }
-        
-    }
-?>
\ No newline at end of file

Copied: plugins/branches/lifetype-1.1/randomimage/pluginrandomimage.class.php (from rev 4258, plugins/branches/lifetype-1.1/unported/randomimage/pluginrandomimage.class.php)

Deleted: plugins/branches/lifetype-1.1/randomimage/readme.txt
===================================================================
--- plugins/branches/lifetype-1.1/unported/randomimage/readme.txt	2006-11-08 03:18:34 UTC (rev 4257)
+++ plugins/branches/lifetype-1.1/randomimage/readme.txt	2006-11-08 03:31:27 UTC (rev 4259)
@@ -1,37 +0,0 @@
-Random Image plugin for LifeType
-Author: Jon Daley
-Contact URL: http://limedaley.com/
-
-Example URL using this plugin: http://groshlink.net/ 
-  (click into any of the categories to see the images on the right)
-
-
-Example template code:
-
-{if $randomimage}
-  <li>
-    <a title="Eden (2006)" href="http://groshlink.net/album/eden_06">
-      <img src="{$randomimage->getImage("eden_06", "PREVIEW")}" border="0" />
-    </a>
-  </li>
-  <li>
-    <a title="Graduate & Faculty Ministry" href="http://groshlink.net/album/graduate__faculty_ministry">
-      <img src="{$randomimage->getImage("graduate__faculty_ministry", "PREVIEW")}" border="0" />
-    </a>
-  </li>
-  <li>
-    <a title="Pittsburgh" href="http://groshlink.net/album/pittsburgh">
-      <img src="{$randomimage->getImage("pittsburgh", "PREVIEW")}" border="0" />
-    </a>
-  </li>
-{/if}
-
-
-
-TODO:
-  Have the album links, and <a title> strings generated automatically
-   probably with a parameter or configuration options so it works for
-   everyone
-
-  Probably can get rid of the SQL query in the plugin and use class
-   methods for better compatibility

Copied: plugins/branches/lifetype-1.1/randomimage/readme.txt (from rev 4258, plugins/branches/lifetype-1.1/unported/randomimage/readme.txt)



More information about the pLog-svn mailing list