Hi,
how can I retrieve (via PHP) the current background color of a page? I figured out that '$gallery->album->fields["bgcolor"]' carries the background color for the album but the problem is that the variable is empty ("") when the album uses the style sheet color (that's the default for the gallery).
Is there a way that I can retrieve the current background color of a page no matter if the color comes from the style sheet or from the '$gallery->album->fields["bgcolor"]' variable?
Bye,
Jürgen
Posts: 22
Can you be be a ittle more specific as to what your trying to acomplish? unless a variable is set somehere by something you cannot pull it afaik.
Posts: 24
Thanks for the answer.
That's the problem. I thought that could retrieve (somehow, that's the point I don't know :smile the current background color of the page so that I can use this color (e.g. #EEEEEE) as a paramter for an external program (e.g. ppmmake). My hope was that PHP has a "predefined" variable like the "$_SERVER" variables - or something like that - which holds the background color of the current page.
I modified the Gallery so that I can create thumbnail images with drop shadows (first on the fly, now direct when the gallery creates the thumbnails) and because of that I need the background color. Of course I could use a variable for the color but my hope was that I could find a more general solution (e.g. the current background color of the page :smile.
You can see the first steps of my modifications here <!-- BBCode Start --><A HREF="http://www.natural-light.org/gallery/BayArea" TARGET="_blank">Natural Light Photography</A><!-- BBCode End -->.
Bye,
Jürgen
Posts: 22
First things first, you have some Beautiful Images in your gallery.
I would guess your only options are to:
a] have your external program use a shared style.css file
||
b] create a new variable to pass along
..but it's only a guess :grin:
muggles
Posts: 24
Hi,
oh, that's not my gallery, my girl friend took the pictures :smile:.
a. doesn't work because the external program is part of the NetPBM tools and NetPBM doesn't use style sheets.
b. is exactly what I did to create the drop shadows :smile:.
Bye,
Jürgen
Posts: 1301
Hi!
Beautiful photos, and your layout is very nice - I was wondering if you'd be willing to share how you got the drop shadows on the thumbnails, I love the effect.
Regards,
Posts: 24
Hi,
yes, the modifications are simple, a few lines of PHP-Code and some additional NetPBM-Tools. I'll create a patch against the 1.3.1 version of the gallery maybe on the weekend.
Bye,
Jürgen
Posts: 1301
Thank-you! :smile:
On my list for this Fall...learn MORE about PHP!!
Posts: 487
Hmm... well, if you can determine the patch to the stylesheet being
used, you can try to run a regular expression on it's contents.
Otherwise there is no php function or html code to return the currently
used background color that I am aware of.
About the only thing I do see of any possible use would be the javascript property
'document.bgColor'. Maybe you could pass on that value somehow. Don't ask
me how though :wink:
Posts: 24
Yep... that's what I figured out too. But my hope was that I'm just to stupid to find the PHP function :smile:.
I know, but JavaScript is no option. I was a little bit surprised that I can retrieve the background color with the JavaScript DOM but that PHP lacks this functionality.
Bye,
Jürgen