Effervescence Theme

Just put the finishing touches on the theme for the gallery associated to my blog (http://sblog.angoulvant.net/). It will probably not be for release unless I get a lot of demand, in which case I would probably adapt the color scheme.

Check it out and tell me what you think:
http://s.angoulvant.net/

The main header takes a random image from the gallery that is cropped using the ZP function, so sometimes it looks great and other times it seems a bit more abstract...

-Stephane

Comments

  • Skwid Member
    Wow ...
    Very nice !
    Lovely pictures too ...

    As for your validating problem, i think it might be possible to fix by using html entities rather than just the character.
    (Example: "&" instead of "&")
  • I think you're right but that's at a deeper level in the ZP code.

    Thanks!
  • Skwid Member
    Hum, you just need to edit the template-functions.php (i think) and change the call to i.php
  • Nice theme. I love the colors.
  • very clean.. I like the random image on the top..
  • Very nice theme. Great colors. What font did you use for the site title ?
  • Thanks for the comments! The font is Trebuchet MS.
  • Hey, I'd love to try this out on my site. Some very nice photographs too.
  • Daxeno Member
    Hi Steph... Are you going to share this theme?

    Just asking.. coz i like to try this on my zen. :D
  • Nice! I like it very much as well!

    please.... ;)
  • marc Member
    Very sweet theme. I think you should release it so we have more themes out there to share. How did you do the random image at the top. I was in fact just looking for a way to do this.
  • Please share the theme or at least the random image stuff. I would love to get the theme though.
  • if you search the forums, there is a random image feature that Skwid and I integrated into the Thinkdreams theme. In fact, you can probably grab the whole theme and pick out the custom function from there. It's up on the Wiki.
  • As thinkdreams pointed out, the code for random images is on the forums somewhere, that's what I used. However, you have convinced me to work on a releaseable version. It might take some time to clean up, so don't hold your breath.
  • In the meantime, here is the function I use in my themes:

    // Get Random Images

    function getRandomImages() {
    $result = query_single_row('SELECT '.prefix("images").'.filename,'.prefix("images").'.title, '.prefix("albums").'.folder FROM '.prefix("images").' INNER JOIN '.prefix("albums").' ON '.prefix("images").'.albumid = '.prefix("albums").'.id ORDER BY RAND() LIMIT 1');
    $image = new Image(new Album(new Gallery(), $result['folder']), $result['filename']);
    return $image;
    }

    You can use this block of code to display it:

    <?php
    $randomImage = getRandomImages();
    $randomImageURL = getURL($randomImage);
    print "<center>getTitle()."'><img src='".$randomImage->getSizedImage('120')."' alt='".$randomImage->getTitle()."'></center>";
    ?>
  • I've released the theme and created a new topic about it here.

    Check it out!

    -Stephane
  • marc Member
    thinkdreams, I did grab your function, right after I posted above, from your theme and it works great, thanks.

    However if one wanted to have a bigger image as a random image like in Stephane's theme, all that random image creation will take up some extra server space. Furthermore since its random and cropped depending on the picture it sometime looks weird, depending on the focal point of the picture.

    How could the SQL statement in the thinkdreams getRandomImage function be modified to only get album thumbnails randomly instead of any picture in the entire database? That way you could ensure there aren't a ton of extra images being created and that they would look good cropped.
  • If you look at the zenphoto code, the SQL is not determining the image size the random function displays. The SQL, in any of the zenphoto functions, just retrieves the images from the albums, and then runs them through i.php to create an image, a sized image, or a thumb depending on the function.

    Rather, the getsizedimage('120') is what does it. It actually uses the i.php to generate the images, which is what zenphoto is using anyway. So I'm not sure how much more overhead there is for the random function generation, as ALL of the images have to be processed through the i.php at some point anyway. If you're worried about caching space, you may want to consider just sizing your images to a smaller size before uploading to zenphoto, that way you're working with a "display" version of the image. Most of my images don't get uploaded over 1024x768, since anything more than that is quite a bit big for regular web users. You also, for copyright reasons, don't want too high of a resolution....

    You can adjust the ('120') to any size you want to change the size of the image you can display. Stephane is probably just adjusting the image size higher for her front page random image. The 120 is what I used to display my random image in the thinkdreams theme.
  • marc Member
    Sorry I think I didn't explain my self correctly.

    I know how to resize the photo. What I'm wondering how to do is restrict the radom image function to only be a subset of all the images in the database. Specifically I only want to display random album thumbnails. So in all the album thumbnails I know they will looked good when cropped to center.

    So I believe that it is the SQL statment in the random image function that selects which photos out of the database should be considered. How do I make that SQL statement just find the images that are being used as album thumbnails?
  • Marc-

    The thumbnails are no more than processed i.php images. So the procedure is as follows:

    1. SQL Query is made based on album and image
    2. Thumbnail or regular sized image?
    3. If Thumb, run through i.php and convert to thumb.
    4. If Image, run through i.php and convert (if necessary)
    5. Display.

    Thus, resizing the photo happens after the SQL query. The database doesn't actually contain any thumbnails. The i.php takes the image from the DB and converts it to whatever size was asked for after the SQL query.

    So, if you want to display only random thumbnails, then you need to size and crop the image as a thumb. There are a couple custom thumb functions in the template-functions.php you should be able to use to do a custom thumb and crop size.

    Now, if you want to only randomize based on certain albums, then you will need to change the SQL query to include only those albums you want to gather to randomize. However, the SQL query will then need to be run through i.php.

    This is hopefully what you were looking for, but if anyone else has any more suggestions, that would be cool too.
  • After looking at the database table, the field you are looking for is "thumb". That's what zenphoto is using to designate the album thumb to display. You could pull this field in a SQL query, and then randomize against that to accomplish what you want.
  • marc Member
    Yeah that is what I'm looking for. I just don't know how to write the SQL to pull out just images in the thumb column of the ablums table.
  • You may be able to add:

    .prefix("album").'.thumb

    to the select statement. Bear in mind my syntax may be off. Anyone else want to comment?
  • marc Member
    I think I got it. The only thing is that the thumb column is empty when you upload via FTP untill you pick and actual album thumb highlight. I guess it just defaults to to first picture if one isn't listed in the thumb column of the album table.

    `function getRandomImage() {

    $result = query_single_row('SELECT folder,thumb FROM '.prefix("albums").' ORDER BY RAND() LIMIT 1');

    $image = new Image(new Album(new Gallery(), $result['folder']), $result['thumb']);

    return $image;

    }`
Sign In or Register to comment.