Not signed in (Sign In)

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

    • CommentAuthorLeGaS
    • CommentTimeJun 19th 2008
     
    Hello!

    I would like to display 3 or 4 pictures next to or more likely under the name of an album, but I couldn't found any function for this.
    Could you help me please?

    Thanks!
    • CommentAuthorLeGaS
    • CommentTimeJun 22nd 2008
     
    Anybody?
    •  
      CommentAuthorsidtheduck
    • CommentTimeJun 22nd 2008
     
    LeGas,

    How would you choose the 3 or 4 images? Is it the most recent ones? Random images? The top alphabetical, bottom alphabetical? If you let us know that, I can try to help you create a MySQL query that will pull them in for you.
    • CommentAuthorpandianbe
    • CommentTimeJun 22nd 2008
     
    Hi sidtheduck,

    It would be latest 4 images or any random 4 images from the each album.what is the function ?where can we change the SQL Query?

    Thanks :-)
    • CommentAuthorLeGaS
    • CommentTimeJun 23rd 2008
     
    Hello sidtheduck,

    It doesn't matter, it's ok for me if those pictures are selected randomly.
    Thanks for your help! :)
    •  
      CommentAuthorsidtheduck
    • CommentTimeJul 3rd 2008 edited
     
    I finally got around to this, sorry for the long wait. My example is using the 'default / classic' theme and it grabs the 4 newest image from the collection.

    Open 'collections.php' and find the following code:// generate XHTML with thumbnail and link to picture view.
    print '<img class="photos" src="'.plogger_get_collection_thumb().'" title="'.$desc.'" alt="'.$desc.'" />';
    and change it to read:// generate XHTML with thumbnail and link to picture view.
    $thumb_query = "SELECT * FROM `".TABLE_PREFIX."pictures` WHERE `parent_collection`='".plogger_get_collection_id()."' ORDER BY `id` DESC LIMIT 4";
    $thumb_result = run_query($thumb_query);
    while($thumb_data = mysql_fetch_assoc($thumb_result)){
    print '<img class="photos" src="'.generate_thumb($thumb_data['path'], $thumb_data['id'], THUMB_SMALL).'" title="'.$desc.'" alt="'.$desc.'"/>';;
    }


    If you want random images, just change your $thumb_query to:$thumb_query = "SELECT * FROM `".TABLE_PREFIX."pictures` WHERE `parent_collection`='".plogger_get_collection_id()."' ORDER BY RAND() LIMIT 4";
    • CommentAuthorpandianbe
    • CommentTimeFeb 24th 2010
     
    Hi Sidtheduck,

    How can i do this for Latest version.Plogger RC1


    Regards,
    Pandianbe
    • CommentAuthorpandianbe
    • CommentTimeMar 3rd 2010
     
    Sidtheduck,

    Please reply this.

    Regards,
    Pandian
    • CommentAuthorpandianbe
    • CommentTimeMar 10th 2010
     
    sidtheduck or kim,

    Please have look on this.

    Regards,
    Pandian
    •  
      CommentAuthorsidtheduck
    • CommentTimeMar 10th 2010
     
    pandianbe,

    I think it should be like this:
    $thumb_query = "SELECT * FROM `".PLOGGER_TABLE_PREFIX."pictures` WHERE `parent_collection`='".plogger_get_collection_id()."' ORDER BY `id` DESC LIMIT 4";

    and for random:
    $thumb_query = "SELECT * FROM `".PLOGGER_TABLE_PREFIX."pictures` WHERE `parent_collection`='".plogger_get_collection_id()."' ORDER BY RAND() LIMIT 4";
    • CommentAuthorpandianbe
    • CommentTimeMar 10th 2010
     
    it can be work on older version of Plogger.

    But new versions of plogger was reconstructed as you know.it is not working.it should come into while loop to take more than one picture for collections view.

    Plase help me to edit collections.php ---- plogger_get_collection_thumb() funtion.


    Thanks....