BullsEyePhotos Blog of Indecision

It’s not just “point & shoot” anymore!

About

not much of anything but maybe something of interest if you look hard enough.

Here’s a nice “grunge” theme for your Coppermine galleries. DFire was ported from a WordPress theme by Tracy Ou (aka Viitoria L.). I’ve added quite a few little “extras” to this theme so read CPG forum post to get all the details.

There were several issues with porting this theme but I believe I worked out most of them. The original theme 765 pixels wide including the sidebar which leaves little space for the main content (in this case images) so I widened it to 965px. This keeps it viewable on a 1024 monitor and still leaves plenty of room for the gallery. There are some issues with IE7 (OK… I’m too tired right now to bash IE but I’ll make up for it next time) which needed to be dealt with where the right side header expands out of the box. I ended up putting a margin-right property in which seemed to fix the problem.

Other features that I added are:

  • truncated album descriptions
  • truncated image captions
  • simple search bar
  • opacity driven image links
  • frames around the intermediate images

Check it out on the Coppermine demo site.

dfire-2

So what do you do when the holiday vacation is in full swing and we’re tired of going places? Well, you port a new theme to Coppermine! I’ve been working on ChaoticSoul by Bryan Veloso at Avalonstar for quite a while and finally had the time to sit and finish it. However, I didn’t want to add just another new theme so I included a couple of cool features to this one.

One of the things that can trash a beautiful theme real fast is having long album descriptions. While they are necessary, they can be an eyesore and cause misalignment of your album list. I found a php script by Chirp Internet for truncating text and then add padding characters at the end to alert visitors that there’s more text.

The second enhancement is the addition of a frame around the photo when viewing intermediate images. This was adopted from a post by dereksurfs on the Coppermine Forum and is really a nice addition to any theme.

Check it out on the Coppermine demo site. You can download it from the Theme Contribution board here

ChaoticSoul-1 ChaoticSoul-2

Firebug - web development evolved

December 20th, 2006

Here’s a Firefox extension with moxie. “Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.” Plus there’s even a lite version for integration with IE, Opera and Safari. If you’ve used the Web Developer extension for Firefox, create themes and websites or just likes to see what makes something special work in a web page, you’ll want to take a look at this awesome tool.

Check out this screencast by Jesse Newland.

One of the questions that comes up often in the Coppermine forum is “how to add php code to a theme”. The usual method is to use the {CUSTOM_HEADER} and {CUSTOM_FOOTER} options that are standard in the theme code. One problem with this is that you only have these 2 avenues and if you want to submit your theme to the forum these are used by the Coppermine demo site to display it’s header and footer possibly leaving you with a “broken” theme. No one wants to have that so, I found the code that allows you to add additional php code and use a different {TAG} for displaying the output. I’m creating a new theme that uses Stramm’s Modpack and Vuud’s cpmFetch to display random square thumbnails at the top of the theme. Now when I submit the theme to Coppermine, it won’t be broken! :)

The function looks like this

  1. function cpg_get_custom_include_2()
  2. {
  3. global $CONFIG;
  4. $path2 = ‘random.php’; //  add your file name here with path to file from root
  5. $return = ;// check if the include file exists
  6. if (!file_exists($path2))
  7. {
  8. return $return;
  9. }
  10. include($path2);
  11. $return = ob_get_contents();
  12. // crude sub-routine to remove the most basic "no-no" stuff from possible includes
  13. // could need improvement
  14. $return = str_replace(, , $return);
  15. $return = str_replace(, , $return);
  16. $return = str_replace(, , $return);
  17. $return = str_replace(, , $return);
  18. $return = str_replace(, , $return);
  19. $return = str_replace(, , $return);
  20. return $return;
  21. }

and you create the {TAG} by placing this line either in the function pageheader($section, $meta = ”) or function pagefooter() functions in the theme.php file.

  1. ‘{RANDOM_IMAGES}’ => cpg_get_custom_include_2(),

If you don’t have either of these functions in your theme.php, copy them from the sample theme.php and paste it into yours.

To use the {RANDOM_IMAGES} tag, just place it in your template.html where you want the code output to be. Oh, and don’t forget to place the referenced php file inside your Coppermine directory. This method is also good for displaying additional html code that you may not want to be in the template.html file.

This is the second theme from Beccary that I’ve ported to Coppermine.

A stylish theme in green. Two columns, fixed width.

which means it took some doing to get it to fit for a photo gallery but I think it turned out nicely. You can see Thirteen in action here and read about all in the Coppermine forum. Thanks again Becca!

Thirteen-1 Thirteen-2