Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Please sign in or apply for membership to remove the ads
    • CommentAuthorbigstan
    • CommentTimeFeb 7th 2008
     
    Hi there, let me tell you first your script is neat! Thank you very much !

    I have a question i can't solve by myself : I'm including an album in some php pages and it's working great.
    Can you tell me if there's a way, to include an album with only, let say, the last 3 photos added in this album ?

    My php include is calling the url photos/?level=album&id=2, is there by example a variable i could add in this url to specify i want only the X last photos of this album to appear in my include ??

    Thank you for helping me !
    • CommentAuthorbigstan
    • CommentTimeFeb 7th 2008
     
    After looking at the php pages, the best solution for my problem is probably to use an include like photos/?level=album&id=2&limit=4, so the modification is to add the variable "limit=4"in order to "get" as a $variable this limit number and make it the LIMIT statement of the sql request in charge to display the pics in the album.
    (if the limit variable is passed trough the url and exists then use this limit variable, if it doesn't exists, don't use it and launch the usual sql request to display the regular album)

    After looking at all the pages of plogger, i'm pretty sure i need to find the request in plog_functions (correctme if i'm wrong). I've made many tests but i can't figured where exactely where is the sql request in wich i could add the limit variable ???

    any idea guys ?

    Sorry for my english !
    •  
      CommentAuthorkimparsell
    • CommentTimeFeb 7th 2008
     
    There is a script that I use to display the latest 3 images added to my Plogger gallery on an external page. Perhaps you could modify that to do what you are wanting?
    • CommentAuthorbigstan
    • CommentTimeFeb 8th 2008
     
    Hello, thanks for your help, it could help me indeed if it displays the thumbs linked to the larger pics !
    If not, i guess i could use the path field in the plogger_pictures table, "explode it" to retreive only the filename of the original image and then rebuilt the thumb filename of the pic, not very elegant but i'm running out of ideas...!
    •  
      CommentAuthorkimparsell
    • CommentTimeFeb 8th 2008
     
    This is the script that I use. It displays the latest 3 images added to the entire gallery, not one specific album, and it does indeed link you directly to the large image of each of the thumbs.

    You need to change the result for the variables $siteurl and $amount to match your plogger install and the number of images you want displayed. You also need to change the url in the tag at the end to match your plogger install.

    Save this code as latest-images.php, upload it to your plogger directory (same level as the files included in the beginning of the code), then add a php include ( <?php include('ploggerdirectory/latest-images.php'); ?> ) to the page you want to display the thumbnails on.

    <?php
    include_once("plog-globals.php");
    include_once("plog-load_config.php");
    include_once("plog-functions.php");

    global $config;

    $amount="3"; //How many images do you want shown?

    //The URL of your Plogger directory E.G. http://yoursite.com/ploggerdirectory ***IMPORTANT*** DO NOT INCLUDE A TRAILING SLASH
    $siteurl="http://www.yourdomain.tld/ploggerdirectory";

    $q = "SELECT * from plogger_pictures order by `id` DESC LIMIT $amount";
    $result= mysql_query($q) or die
    ("Could not execute query : $q." . mysql_error());

    while ($row=mysql_fetch_array($result))
    {
    $id=$row["id"];
    $path=$row["path"];

    $number=strrpos($path, '/');
    $number=$number+1;
    $url=substr($path, $number);
    ?>

    <a href="<?php echo "$siteurl"; ?>/index.php?level=picture&id=<?php echo "$id"; ?>"><img class="imgborder" src="http://www.yourdomain.tld/ploggerdirectory/thumbs/<? echo "$id"; ?>-<?php echo "$url"; ?>" border="0" /></a><br /><br />
    <?php } ?>


    I have a css class assigned to the thumbnails (class="imgborder") that I use to style the thumbs on the page where they are displayed. Here's what I use - you can alter it or remove it, depending on what your needs are.

    .imgborder {
    background-color: #eee;
    border: 2px solid #999;
    padding: 5px;
    }
    • CommentAuthorbigstan
    • CommentTimeFeb 8th 2008
     
    Hello ! Thank you very much, this is perfect !!!
    • CommentAuthorosmonsat
    • CommentTimeApr 29th 2008 edited
     
    Quick question, the latest-images.php script works great but how would you invoke it from within a html page?
    •  
      CommentAuthorkimparsell
    • CommentTimeApr 30th 2008
     
    Normally php includes are not parsed within a page with a .html extension. You will need to add the following lines of code to your .htaccess file in order to tell your server to have it parse .html pages as php:

    AddType application/x-httpd-php .html
    AddType application/x-httpd-php .htm
    •  
      CommentAuthorDeeJayOdie
    • CommentTimeMay 17th 2008
     
    If anyone wants to only show the latest x-images from a specific collection instead of the whole gallery just change this:
    $q = "SELECT * from plogger_pictures order by `id` DESC LIMIT $amount";
    with:
    $q = "SELECT * from plogger_pictures WHERE `parent_collection` = 2 order by `id` DESC LIMIT $amount";
    and change the `parent_collection` = X to match the number of the collection you want the pictures to be displayed from.
    • CommentAuthorpandianbe
    • CommentTimeJun 20th 2008
     
    Hi All,

    Thanks for this Post.

    Here i need to get the Cut free URL as output is it Possible?

    and also Please help me to get the Random and Mostly Viewed Pictures with Code.

    Thanks in Advance :-)