[mythtv] [PATCH][mythweb] Simple mythgallery support

Chris Petersen lists at forevermore.net
Tue Jan 25 00:44:44 EST 2005


> this is a patch for mythweb to add a simple form of mythgallery support. 
> You have to rename the file "For_themes_Defaulr_dir_mythgallery.php" 
> into mythgallery.php and copy it into /themes/Default/

You're probably going to hate being the first person I do this to, but 
I'm starting to get stricter about the code that goes into my projects 
(meaning that I have a HUGE task of cleaning up the stuff that's already 
there), and this is as good of a time as any to start (seriously, it's 
nothing against you or your patch).

This means no "execution" code in the theme file unless absolutely 
necessary; no objects unless absolutely necessary (your main mythgallery 
script has an object, but all it does is call linear functions -- 
objects have a LOT of unnecessary overhead, and shouldn't be used unless 
there's a good reason for them); check for existince of files before 
trying to interact with them; don't just rely on php error messages to 
tell you what's going on.

Anyway, your code doesn't pass my new rules, and since I'm busy working 
on updating mythweb for the pending .17 release, I don't have time at 
the moment to fix it.

also, just call the files "gallery.php" -- I should really rename the 
music one.  we already know that it's "myth"...

> Make a link to your mythgallery dir or edit configs/conf.php:
> e.g.
> cd /var/www/localhost/htdocs
> ln -s /data/images gallery

Can this be done via a setting in the database?  I'm unfamiliar with 
mythgallery, but it shouldn't be hard to pull the host info from the db, 
and create the symlink if necessary (or better yet, look at my code 
reference for a way to merely pass the image data straight to the 
browser so you don't need a symlink)

> - no thumbs creation (currently using .thumbcache of MythGallery), is a 
> future dependency to GD applicable?

This is easy.  See my code reference for examples,  I don't mind 
requiring ImageMagick -- seems that it's a pretty standard thing to have 
installed.

> - you have to use the back button of the browser to navigate back

shouldn't be hard to fix.

> - hard coded 5 thumbs in a row

No need to use tables unless absolutely necessary, either -- they're 
slow, and not nearly as much fun to play with (granted, they're often 
easier, but not always better).  A line of images with or without <br/> 
tags -- use CSS and let them wrap if you want.

Anyway, my sample code is here:

http://forevermore.net/photos/index.php
http://forevermore.net/photos/index.php.txt

This is a quick gallery script that I wrote so I could create a visual 
directory index for a directory full of images.  However, it has pretty 
much all you'd need to

So this is nothing against you or your patch -- I think it's a great 
idea to add mythgallery support -- it's just that I'm tired of the 
half-finished music and video sections, and want to make sure that 
anything new going in is really clean (and if anyone out there wants to 
fix the music and video stuff, I don't have time to do it, and would 
really love the help).

Did I miss anything?

-Chris


More information about the mythtv-dev mailing list