Forum Moderators: coopster

Message Too Old, No Replies

Reading a DB value and acting upon

matching value and action

         

henry0

2:53 pm on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here is my quandary:
OOP/templates/CMS
I have a script that sets up web pages for biz members
I am trying to allow for a change of BG
So the chosen BG is passed to the DB (works fine)

But my page design includes a curve in the nav bar and I need to match the image curve with the chosen BG
So far I query the DB and get the BG value
Now I need to match that value with the corresponding piece of image
Those images are refered in the DB by ref to IMG path and are named as for the example below curv_y, curv_g and curve_g
The bg values are entered as HEX CODE color here the chosen value is “#fffcc”
The problem is to read the BG and then match it with the corresponding curv img

Obviously $bg=”#ffffcc” cannot work but you get the idea
What can I do?

$new_content[bg]=$bg;
if ($bg="#ffffcc") {
$content_103.= $new_content[curv_y];
}

Thanks

mincklerstraat

4:09 pm on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why not just rename your bgimages to match information you already have, like that bgcolor?

$content_103 .= 'curve-'.substr($bg, 1).'.png';

then make your image called, e.g., 'curve-ffffcc.png';

save yourself hassle, save your processor lines of code.

henry0

5:17 pm on Oct 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks
I will give it a try

regards

Henry