[mythtv-users] myxer theme configurator

Michael Anthon michael at anthon.net
Wed Jun 22 13:42:53 UTC 2005

Stef Coene wrote:

>You can choose the background, watermarks and buttons.  It will generate a 
>preview how mythtv will probably look.  This is not perfect.  I don't know 
>the exact place of the menu and the images, but at least it will give you an 
>idea how it will look like.
Works pretty well but there is a much better way to do the selection.

If you modify the index.php code so that instead of generating a form
with a button with the image on it you just generate and image like this...

<img src="image.php?img=<?=$image?>&width=150" alt="oops"
onclick="document.getElementById('preview_img').src =

Each time you click an image it then just updates the source url for the
image and inlcudes the new selection in that URL as a query, this is
then passed to the server which updates the session setting and
generates a new preview. 

You also need to modify the preview image container to give it an id...

 <a href="preview.php?width=FULL"><img id='preview_img'
src='preview.php?width=<?=$_SESSION["preview_size"]?>' alt='Preview'></a>

And then modify common.php to remove the test for a form post (as it now
uses a get or post depending on if you are updating the preview or
reloading the page with a different section) then you will have a
preview that will update without doing a full page reload.

This should work in pretty much all browsers that people would be using
these days.


More information about the mythtv-users mailing list