Not signed in (Sign In)

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

    • CommentAuthorVoowoo
    • CommentTimeJul 24th 2009 edited
     
    I just got the script from Link and was wondering how i would make it so it shows small thumbs of each new image? Thanks
    •  
      CommentAuthorkimparsell
    • CommentTimeJul 26th 2009
     
    Voowoo: If you downloaded the script that I listed in that post, the instructions are in my post on how to include it in your webpage:

    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.

    The script includes the small thumbnails of the new images wherever you add the include statement.
    • CommentAuthorVoowoo
    • CommentTimeJul 26th 2009
     
    Hey Thanks I never saw that before, but I still can't get it to organise them in a table like 4 columns
    • CommentAuthorVoowoo
    • CommentTimeJul 28th 2009
     
    Anyone help please?
    •  
      CommentAuthorkimparsell
    • CommentTimeJul 29th 2009
     
    If you can provide a link to the page you're displaying them on, I can try and work something up in the morning for you.
    • CommentAuthorVoowoo
    • CommentTimeJul 29th 2009 edited
     
    Thanks kim, my page is www.walls4u.com/index.php The Updates part is on the right. Thank you for helping :D
    •  
      CommentAuthorkimparsell
    • CommentTimeJul 30th 2009
     
    Sorry for the delay in getting back with you.

    I've looked at the template that you are using for your gallery. The Updates section in the sidebar is including the images inside an unordered list tag (< ul >). I've modified the script so that each image will be included inside that list with the correct < li > opening/closing tags around them (see code block below). You'll need to change line 11 to reflect the URL of your Plogger directory again, but the rest of the code should work correctly.

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

    global $config;

    $amount = '6'; //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);
    ?>
    <li><a href="<?php echo $siteurl; ?>/index.php?level=picture&amp;id=<?php echo $id; ?>"><img class="imgborder" src="<?php echo $siteurl; ?>/thumbs/<?php echo $id; ?>-<?php echo $url; ?>" border="0" /></a></li>

    <?php } ?>

    I also noticed that you are echoing the style for those thumbnails in the sidebar. You need to add

    .imgborder {
    background-color: #ccc;
    border: 2px solid #0fc;
    padding: 2px;
    }

    to your Plogger gallery theme stylesheet (gallery.css) rather than echoing it before the code for each thumbnail so it's cached along with the rest of the stylesheet.

    Let me know if you have any other questions or issues.
    • CommentAuthorVoowoo
    • CommentTimeJul 31st 2009
     
    Thanks kim, but how do I get them to line up next to each other like 2 rows?
    •  
      CommentAuthorkimparsell
    • CommentTimeAug 2nd 2009
     
    In your template, change:

    <div id="updates" class="boxed">
    <h2 class="title">Recent Updates</h2>

    <div class="content">

    to

    <div id="updates" class="boxed">
    <h2 class="title">Recent Updates</h2>

    <div style="text-align: left; margin-left: 5px;">

    Then make the following change to the code I posted above, replacing the last 10 lines with this:

    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&amp;id=<?php echo $id; ?>"><img class="imgborder" src="<?php echo $siteurl; ?>/thumbs/<?php echo $id; ?>-<?php echo $url; ?>" width="80" height="60" border="0" /></a>

    <?php } ?>

    That should line them up next to each other, 2 images per row.

    I added the width and height to the code so they'll be scaled properly regardless of the original size of the thumb and will line up correctly.
    • CommentAuthorVoowoo
    • CommentTimeAug 2nd 2009
     
    Yay thank you thank you thank you, that's exactly what I wanted :D Thanks Kim
    •  
      CommentAuthorkimparsell
    • CommentTimeAug 2nd 2009
     
    You're welcome. :)
  1.  
    I too needed the same application above but Iam using the Plogger 1.0-RC1version in this version plog-functions.php is inside the folder plog-includes so I made the above code line 3 as
    include_once('plog-includes/plog-functions.php');
    and made lines 23 /*define('PLOGGER_TABLE_PREFIX', 'plogger_');,28 /*define('PLOGGER_CHMOD_DIR', 0755);and 32 /*define('PLOGGER_CHMOD_FILE', 0644);commented in plog-config.php.but I don't know how to change the line above
    <a href="<?php echo $siteurl; ?>/index.php?level=picture&amp;id=<?php echo $id; ?>"><img class="imgborder" src="<?php echo $siteurl; ?>/thumbs/<?php echo $id; ?>-<?php echo $url; ?>" width="80" height="60" border="0" /></a>
    as in new version the thumbnails are in plog-content/thumbs/'collection' /'album'/small/ the name.jpg' I don't know how to use it here .Can anybody help me plz
    •  
      CommentAuthorkimparsell
    • CommentTimeNov 4th 2009
     
    sarigamanakodam: This script should not be used with the 1.0-RC1 version. That version has a plugin included that does the same thing called Latest Images.

    Log into your admin section and go to the Plugins tab. You will see the Latest Images plugin in the list. Click on "Use this plugin" and a white box will open up with the instructions on how to use it along with the correct code for the php include.

    Try using the plugin instead of this script please. I'd also recommend removing this outdated version of the script from the server as it may cause a conflict with the built-in Latest Images plugin.
    Thankful People: sarigamanakodam
  2.  
    Could any one let me how to use lightbox to show the latest images.Iam using 1.0-RC1 version and I am using the code to get Latest Images.now when I click on the thumbnail the link goes to index page ,not even to the picture.php. plz help me
  3.  
    i found it my self
  4.  
    My link for thumbnails at latest images are taken from folder plog-content\thumbs\collection\album\large .But now the problem is that when a new image is uploaded its large thumbnail is not created in the folder plog-content\thumbs\collection\album\large unless it's small thumbnail is clicked in the album level .is there any way to create the large thumbnail when image is uploaded ,also the large thumbnail is not formed .if the dimension of uploaded image is small
  5.  
    plz help.
    At index page of my site the thumbnails showing the latest images when clicked goes to folder plog-content\thumbs\collection\album\large\imagename.jpg.but the problem is when i upload a new image its large thumbnail image is not created yet in the plog-content\thumbs\collection\album\large\ folder.as soon as i goes to the plogger and click the small thumbnail in the album level the corresponding newly uploaded image's large thumbnail is created in folder plog-content\thumbs\collection\album\large\ and the thumbnail for latest images in index page also work properly there after.could any one tell me the modification i had to make so that when an image is newly uploaded its corresponding large thumbnail is also created in folder plog-content\thumbs\collection\album\large\
    •  
      CommentAuthorsidtheduck
    • CommentTimeDec 17th 2009
     
    sariga,

    You can either do it via the plugin script (to make sure it always calls it) or via the backend script (happens during upload). If you want it via the plugin script, please post the code you are using.
  6.  
    i was using my own code to generate thumbnail of latest image in index page but now iam using the plugin of plogger itself .At earlier i don't know the reason why the image of latest thumbnail was not working properly when i used the latest -image plugin.It was because of the same problem that the large thumbnail was not being created in plog-content/thumbs/collection/album/large so i shifted to the code that i made .By chance it became correct as i had earlier clicked on the small thumbnail at the album level so the large thumbnail was present in its folder and worked properly ,so i was in the belief that everything had became ok with the latest image thumbnail .but recently only i found that its all because of the large thumbnail not being created in folder plog-content/thumbs/collection/album/large .so could you plz tell the code to create an corresponding image in the folder plog-content/thumbs/collection/album/large when ever an image is uploaded at the admin side.
  7.  
    In the upload.php i had not made any changes iam using the latest version of plogger
  8.  
    this is the plugin code i use


    <?php
    $host="localhost";
    $username="186326 "; //Database username here
    $password="123456"; //Database password here
    $database="186326 "; //Database name here
    $amount="3"; //How many images do you want shown?
    $siteurl="http://sariga.freetzi.com/gallery/video/"; //The URL of your Plogger directory E.G. http://yoursite.com/ploggerdirectory ***IMPORTANT*** DO NOT INCLUDE A TRAILING SLASH LIKE THIS http://yoursite.com/ploggerdirectory/

    //Database Connection
    $connection = mysql_connect($host, $username, $password);
    $db = mysql_select_db($database);

    $q = "SELECT * from plogger_pictures ORDER BY `date_submitted` 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'];
    $caption=$row['caption'];
    $number = strrpos($path, '/');
    $number = $number+1;
    $turl = substr($path, $number);
    $no=strlen($turl);
    $url = substr($path, 0,-$no);
    ?>
    <div style="float:left" style="margin:0 30px 30px 0;">
    <div style=" margin: 12px 12px 12px 12px; adding: 12px 0px 12px 12px; list-style: none ">
    <a href="http://sariga.freetzi.com/gallery/plog-content/thumbs/<?php echo $url; ?>large/<?php echo $id ; ?>-<?php echo $turl ;?>" rel="lightbox" title="$caption"><img src="http://sariga.freetzi.com/gallery/plog-content/thumbs/<?php echo $url; ?>small/<?php echo $id ; ?>-<?php echo $turl; ?>" border="1" style="border-color:black"></a>
    <div><?php echo $caption ?>&nbsp;&nbsp;</div>
    </div>
    </div>
    <?php } ?>
    •  
      CommentAuthorsidtheduck
    • CommentTimeDec 28th 2009
     
    Probably the easiest way would be to do it on the admin backend during photo upload since it would take a bit of work to overhaul your working plugin code. You would just need to open up 'plog-admin-functions.php' and find the following line of code (should be around line 352 at the very end of the add_picture function):
    //$thumbpath = generate_thumb($picture_path, $result['picture_id'],THUMB_LARGE);
    and remove the comment backslashes so it looks like this:
    $thumbpath = generate_thumb($picture_path, $result['picture_id'],THUMB_LARGE);

    Alternately, you can modify the Latest Images plugin included in the current release for your latest images which uses the generate_thumb() function to create the images. It would automatically force the large image to be generated if not already done so.
    You would just need to change the following part of the code on line 65 from this:
    src="<?php echo generate_thumb($path, $id); ?>"
    to this:
    src="<?php echo generate_thumb($path, $id, THUMB_LARGE); ?>"
    Thankful People: sarigamanakodam