Not signed in (Sign In)

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

    • CommentAuthorniceday
    • CommentTimeOct 10th 2005 edited
     
    I have written a simple code to display randomly selected thumbnail from your Plogger gallery anywhere in your website.

    See/download the code at http://www.sourcematic.com .
    •  
      CommentAuthorBen
    • CommentTimeOct 10th 2005
     
    oh nice
    • CommentAuthorniceday
    • CommentTimeOct 10th 2005
     
    Thanks Ben. Hope it is useful.

    I like Plogger for its simplicity and customizability. Have been looking at quite a few gallery scripts and nothing suits me better than Plogger.
    • CommentAuthorjack
    • CommentTimeOct 11th 2005
     
    Very nice! The first (kind of) plugin. And very usefull indeed. And even a nice name for it: "a plugger for plogger" :)
    Does it also contain a link to the gallery or even the page that image is on? The latter sounds difficult to me.

    Thanks! I'm sure I'm gonna use this.
  1.  
    Aaargh! you beat me to it! That was my project for the weekend.
    • CommentAuthorniceday
    • CommentTimeOct 11th 2005 edited
     
    Thanks Jack. It is good to hear that you like it. I might consistently use the name Plugger for all script that I wrote and will write for plogger.

    Yes, the thumbnail is hyperlinked to the actual picture in the gallery. I am not sure though what did you mean with "The latter sounds difficult to me."

    Sorry OtherMichael, but sure you still can post your code so that users have choices.
    • CommentAuthorjack
    • CommentTimeOct 13th 2005
     
    Just a thought, not really so important, but this script could be modified to only show a random thumb from one specified album? I was thinking of perhaps adding one album with 'favourite images'.
    • CommentAuthorniceday
    • CommentTimeOct 16th 2005 edited
     
    Jack and anyone who is interested in this script, I have modified the script and yes you now can display a randomly selected thumbnail from one specific album. You need to download the plog-plugger.php file again and add the following line on your own page where you want to display the thumbnail:

    $plugger->album = "album name";
    //You can put your favorite album name there
    //Leave this blank if you want to select the thumbnail from the whole albums.

    That line should be added after you instantiate plugger object. Read use.txt file for details.
    • CommentAuthorniceday
    • CommentTimeNov 29th 2005
     
    For all of you who happened trying to access http://sourcematic.com and found it unavailable, I would like to let you know that http://sourcematic.com is now back online. Sorry for being down for about a week due to problem with the hosting provider.

    For webbie, yes of course you can select thumbs of one album. Did you mean that you want to display thumbnails of an album on specific page of your website?
  2.  
    Niceday

    I think your script is great, but I would like to know the following:

    a) How can I make the image that appears on my page bigger? At present its only approx 1 inch square.

    b) Is there anything in the script that can be modified that will allow the image to switch to another image every few seconds without the page having to reload?

    Thanks.
    • CommentAuthorniceday
    • CommentTimeDec 7th 2005
     
    hi cpthompson82. Answering your question:

    a) The thumbnail is in the same size as the thumbnail in your plogger gallery which I am sure bigger that 1 inch square. Can you give me the url to your gallery?

    b) Yes you can modify it to show different images every few seconds. You will need to use Javascript (Ajax).
  3.  
    Niceday,

    Thank you for your reply.

    I'm new to all this - is there any way you could point me in the right direction for the javascript where the image will change every few seconds? .... I struggled getting it how it is.

    You are correct. The thumbs are the same size (ie random thumbnail and gallery thumb nail).

    However, how can I make the thumbnail bigger on http://www.studentknights.co.uk/php/student_knights_monday_top.php but leave it the same size as it already is on the gallery page?

    Is there anyway of making it a shrunk down picture from a random or the latest gallery reather than a thumbnail?

    I look forward to you help.
    • CommentAuthorniceday
    • CommentTimeDec 8th 2005
     
    cpthompson82, you can't make the thumbnail bigger without creating another thumbnail in the desired size. If you use a shrunk down picture then you will waste the download time needed to show that picture... the ideal is that you should create another set of thumbnails in the desired size.

    I might implement this in the future... together with a feature to make the thumbnail keeps on changing without reloading the page. At the moment I am a bit busy with christmas is just around the corner.

    I will keep you posted when I have made some update.
    • CommentAuthorromainbj
    • CommentTimeDec 17th 2005
     
    hi
    i'd just like to know if there is any way to display several random thumbs, i tried to copy and paste the display code in 4 colums but as you can guess it didn't work...
    I look forward to you help.
    • CommentAuthorsolemnchaos
    • CommentTimeDec 19th 2005 edited
     
    one way is the add additional variables to your plog-plugger.php file (there are probably more efficient ways). as an example here's a quick guess at the code that should display 2 random thumbs

    change lines 26-33 in your plog-plugger file to this (backup the original first):

    $selected_id = mt_rand(0,mysql_num_rows($query) - 1);
    $selected_id2 = mt_rand(0,mysql_num_rows($query) - 1);

    //sc...if both random images are the same, continue randomizing until they are different...
    while ($selected_id2 == $selected_id) {
    $selected_id2 = mt_rand(0,mysql_num_rows($query) - 1);
    }

    $thumb = mysql_result($query,$selected_id,'path');
    $thumb2 = mysql_result($query,$selected_id2,'path');

    $selected_id = strtolower(mysql_result($query,$selected_id,'id'));
    $selected_id2 = strtolower(mysql_result($query,$selected_id2,'id'));

    $post = strrpos($thumb, '/');
    $thumb = substr($thumb,$post+1,strlen($thumb));
    $post2 = strrpos($thumb2, '/');
    $thumb2 = substr($thumb2,$post2+1,strlen($thumb2));

    $display = "<img src="".$this->host."/thumbs/".$selected_id."-".$thumb."">";
    $display2 = "<img src="".$this->host."/thumbs/".$selected_id2."-".$thumb2."">";
    $display = "<a href="".$this->host."/index.php?level=picture&id=".$selected_id."">".$display."</a>
    <a href="".$this->host."/index.php?level=picture&id=".$selected_id2."">".$display2."</a>";
    return $display;
    •  
      CommentAuthorctlsmite
    • CommentTimeDec 22nd 2005
     
    I am trying to include the plugger in my home page, but it doesn't appear to work. I am using Movable Type 3.2, so I can't modify the home page (index.html) to be a PHP file (index.php). Is it required for the file that holds:

    <?php
    include("path_to_plogger_directory/plog-plugger.php");
    $plugger = new plugger();
    $plugger->host = "http://yourdomain.com/yourgallery";
    $plugger->album = "";
    echo $plugger->getRandomThumb();
    ?>


    to be a PHP file?
    •  
      CommentAuthormike
    • CommentTimeDec 22nd 2005
     
    The PHP won't be processed unless the file has a .php extension. If you cannot edit the home page extension, try putting the PHP code in a seperate file (with a php extension) and calling it through an IFRAME in the HTML page. Ugly, but probably your only solution.
    •  
      CommentAuthorctlsmite
    • CommentTimeDec 22nd 2005
     
    That's what I was thinking too, Mike. Instead, I just did it the old-fashioned way in Flash here.

    Thanks for your help!
    • CommentAuthorddejong
    • CommentTimeDec 22nd 2005
     
    I see you're running Apache! There is absolutely no reason you can't set .html as application/php in httpd.conf on Windows or Linux. It doesn't cause an appreciable loss of cpu cycles (the parser just flies through them), but means you can do what you want above, namely add php in html documents. Can't think of this hurting anything, but if everything else breaks, you can always set it back.

    Damn it, ctlsmite, you'd better make a Plogger theme -- I think it'd be rad.

    Cheers,
    Derek
    •  
      CommentAuthorctlsmite
    • CommentTimeJan 13th 2006
     
    A Plogger theme... don't know much about that. I'm assuming it's a custom CSS with attached image assets? Where do I submit it if I have it?

    Do you guys (I'm assuming Derek and Mike are behind Plogger) do this stuff full-time? Are you making any money?
    •  
      CommentAuthormike
    • CommentTimeJan 13th 2006 edited
     
    Plogger theme creation is a very flexible way to create new looks for the Plogger interface. You can simply change the colors through CSS and submit that as your theme, or you can completely change the HTML output of every gallery element. This system, along with a complete theme making guide will be available with the next version. We will also have a theme browser on the main website where you can submit your themes and download other peoples themes as well.

    We definitely don't work on this project full-time... Anti is a web developer for Skype and I work full-time at a startup called iCentera. As for Derek, I'm not sure what his employment status is, but any web dev company would be stupid not to pick him up =)

    As for money, this is a free open-source project. I think you can draw your own conclusions on how much money we make from it =) Donations are few and far between, and Google ads brings in enough to cover hosting. So, if you're feeling generous, you can support us here: http://www.plogger.org/donate/. I make a good living doing professional web development, and this project wasn't started with any expectations of revenue generation, so the financial potential of this software really isn't that important to me.

    We really just want to give you guys something that makes your life on the web easier and more enjoyable, and to see positive feedback and happy users is reward enough for us.
    • CommentAuthornam
    • CommentTimeJan 13th 2006
     
    This is a great script. (im not a scripter) but can someone make a script that displays 4 random thumbs. I tried to copy this code 4 times but thats not working:
    <?php
    include("admingallery/plugger.php");
    $plugger= new graphic();
    $plugger->host = "*********";
    $plugger->album = "";
    echo $plugger->getRandomThumb();
    ?>
    I will include this script in 4 different tables. So the visitor can see 4 different thumbs on the page.
    • CommentAuthornidave
    • CommentTimeJan 25th 2006
     
    hi can anyone send me the script as the site does not seem to be working
  4.  
    I have a similar question to the one that's been asked before... for my purposes, I altered the plog-plugger.php to create a div and set the random thumbnail as its background. It works perfectly and I am madly in love with it. But I would like to use it in three places on my front page, drawing random thumbnails from three different albums. I know precious little about php and I'm not the least bit comfortable messing around with the file myself (not to mention there's no point because I just don't know enough to do anything good), so if anybody knows of a trick, I'd be incredibly grateful to hear it.

    Thanks!
    •  
      CommentAuthormike
    • CommentTimeMar 30th 2006
     
    Why not just change the value of $plugger->album and make three seperate calls to $plugger->getRandomThumb()? Seems like this should be really easy. I don't know what you did to modify the original code so I can't really comment on that.
    • CommentAuthornotkristina
    • CommentTimeMar 30th 2006 edited
     
    Mike,

    I agree that it seems easy, but it isn't working. When the page gets to the point where the second call is, it stops loading. I've tried leaving in and leaving out things in any combination I can think of, but I'm still doing something wrong. Should it look like this?

    --the getRandomThumb displays <div class="sidebar" style="background-image:url( THUMBNAIL URL );"> --

    Since I only ever want to use it in sidebar divs, it felt easier to me to just let it render the div and remind myself to close it after I call the plugger. Anyway, so I've got something like:

    <?php
    include("../../imagelove/plog-plugger.php");
    $plugger = new plugger();
    $plugger->host = "http://likeahouseonfire.com/imagelove";
    $plugger->album = "Recent Work";
    echo $plugger->getRandomThumb();
    ?>
    </div>
    [another div in between][/div]
    <?php
    $plugger = new plugger();
    $plugger->host = "http://likeahouseonfire.com/imagelove";
    $plugger->album = "Shop";
    echo $plugger->getRandomThumb();
    ?>
    </div>


    So... hopefully what I'm doing wrong will be obvious to someone. I tried leaving out the first line, then the first and second, then all but the last two, and even just the echo line... but it isn't working.

    I have a feeling that the answer to this tiny puzzle will be enormously educational to me in general.
    • CommentAuthorddejong
    • CommentTimeMar 31st 2006
     
    Leave out the $plugger = new plugger(); and $plugger->host lines on repeat.

    You just want to assign a new album and pick a thumbnail; no need to create new objects each time -- unless there's something in Plugger that prevents it.

    Might help, if not, post back.

    Cheers,
    Derek
  5.  
    I can't belive no one has modded this for use with the actual gallery. I've tried to edit the gallery.php myself, but I'm no programmer and couldn't get it working. I wanted to make it so my gallery thumbnails were being randomly shown. So what I did was modify the plog-plugger.php file so it doesn't make a link out of the image (remove line 33), cuz I want the link to still be made by plogger to link to the next gallery level. Then in gallery.php I tried editing line 593 from:

    $imgtag = '<img class="photos" src="'.$thumbpath.'" title="'.htmlspecialchars($row["description"]).'" alt="'.htmlspecialchars($row["description"]).'" />';

    to:

    $imgtag = '<img class="photos" src=" '

    $plugger = new plugger();
    $plugger->host = "http://localhost/~jesse/plogger";
    $plugger->album = "";
    echo $plugger->getRandomThumb();

    ' " title="'.htmlspecialchars($row["description"]).'" alt="'.htmlspecialchars($row["description"]).'" />';

    and putting include("plog-plugger.php"); at the top of the page. This is not working though. I'm not sure why. Does anyone have a way to do this, or can see what I'm doing wrong? It work when referenced by a seperate php file. It loads a random image without a link. It's just in between the code in gallery.php that it's not working. I know I'm replacing the right code (when i remove it the image isn't generated), so it must be my php.
    • CommentAuthorddejong
    • CommentTimeApr 3rd 2006
     
    Jesse,

    Feel free to email me off-list. I don't mind FTP'ing in to get it working, if you don't mind creating a temporary account.

    Cheers,
    Derek
  6.  
    Derek, I don't see an e-mail for you?
    • CommentAuthorddejong
    • CommentTimeApr 10th 2006
     
    Click on my name and go from there. Although, now derekREMOVETHIS@plogger.org works too, for the added legitimacy that brings. ;)

    Cheeers,
    Derek
  7.  
    Clicking your name it says "Email n/a". I'll send you one now.
  8.  
    Ah...I wasn't logged in when I was clikcing your name. Got it now.
    • CommentAuthorUbbe
    • CommentTimeApr 14th 2006
     
    could anybody tell me how to customize this so insted of a random photo it is the newest photo that is shown.

    and have any of you tried altering the scipt to make it valid to the wc3 validators? because it says something about i need a <alt> definition on the random thumb.

    Best Regards
    Ubbe - www.ubbedall.dk
  9.  
    hey there,

    does anyone know where to get the plog-plugger.php file, since http://sourcematic.com doesn't seem to work? i'd really appreciate that.
    cheers, bo
  10.  
    hmm? anyone at all? someone there?