Author |
Message |
Donovan
Client

Joined: Oct 07, 2003
Posts: 735
Location: Ohio
|
Posted:
Wed Jun 07, 2006 11:50 am |
|
'$bgcolor1' and '$bgcolor2', etc... is set in the theme.php
If, in my custom module pages I set my bgcolor to '$bgcolor1' I get this bright green color that is nowhere near the '$bgcolor1' variable.
Example:
Code:<table width="100%" border="2" cellpadding="2" align="center" cellspacing="0" style="border-collapse: collapse;" bgcolor='$bgcolor2' bordercolor="#111111">
<tr>
<td height="25" colspan="2" align="left" bgcolor='$bgcolor1'><b><font class="content">Vital Statistics</font></b></td>
</tr>
<tr>
<td align="center" bgcolor='$bgcolor2'>
|
What I want to do is make the colors of my module integrated with whichever theme is shown. |
|
|
 |
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Wed Jun 07, 2006 11:59 am |
|
It should work exactly as you've described it. |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Wed Jun 07, 2006 12:08 pm |
|
That of course is the whole idea of having a theme.
I am the last person who should answer questions on themes BUT I will try.
I presume you have preciously declared the values of your $bgcolor like this
Code:$bgcolor1 = "#FFFFFF";
$bgcolor2 = "#101070";
$bgcolor3 = "#e6e6e6";
$bgcolor4 = "#e6e6e6";
$textcolor1 = "#FFFFFF";
$textcolor2 = "#000000";
| so that when you decalr bgcolor as having one the $ values it knows what it should be? |
|
|
|
 |
Donovan

|
Posted:
Wed Jun 07, 2006 12:09 pm |
|
This is what I get. It doesn't matter what theme I use.
 |
|
|
|
 |
Donovan

|
Posted:
Wed Jun 07, 2006 12:14 pm |
|
The current theme used.
Code:/************************************************************/
/* Theme Colors Definition */
/************************************************************/
$bgcolor1 = "#474646";
$bgcolor2 = "#474646";
$bgcolor3 = "#474646";
$bgcolor4 = "#474646";
$textcolor1 = "#FFFFFF";
$textcolor2 = "#FFFFFF";
|
In my modules pages.
Code:global $module_name, $db, $prefix, $admin_file, $bgcolor1, $bgcolor2;
|
|
|
|
|
 |
kguske

|
Posted:
Wed Jun 07, 2006 12:59 pm |
|
I was going to suggest making sure it was a global variable, but you've already done that. Can you display the value on the page? I'd guess it's being overwritten somewhere. |
|
|
|
 |
Guardian2003

|
Posted:
Wed Jun 07, 2006 2:58 pm |
|
kguske - god catch!
I'm wondering whether there is a css or style sheet being included somewhere. |
|
|
|
 |
kguske

|
Posted:
Wed Jun 07, 2006 3:09 pm |
|
Another good point, Guardian2003. You can use a color picker to identify the HTML color, then a good source scanner like Crimson Editor to find where that exists in your source (php, css, js, etc.). |
|
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Wed Jun 07, 2006 8:14 pm |
|
Donovan, is the original lines that you posted "wrapped" in a HEREDOC or is this code outside the <?php .... ?> tags?
By the way, when you look at the generated source wihtin the browser, what do you see after the bgcolor= text? I want to follow up on a "hunch"... |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Donovan

|
Posted:
Wed Jun 07, 2006 9:16 pm |
|
It was outside of php. I will have to check and view source. |
|
|
|
 |
jaded
Theme Guru

Joined: Nov 01, 2003
Posts: 1006
|
Posted:
Thu Jun 08, 2006 5:15 am |
|
|
|
 |
montego

|
Posted:
Thu Jun 08, 2006 5:44 am |
|
It would be good to find out first whether the $bgcolor1 is being "parsed" or being taken "literally". That is why I asked Donovan the question. He should be able to quickly tell by looking at the source of the HTML in his browser. |
|
|
|
 |
jaded

|
Posted:
Thu Jun 08, 2006 8:10 am |
|
true but in the case he doesnt know. seeing the site and or my going into it would be the fastest way to fix it for him. |
|
|
|
 |
Donovan

|
Posted:
Thu Jun 08, 2006 8:14 am |
|
This seems to work.
Code:<td align="center" bgcolor= <?php echo $bgcolor2 ?>><b><font class="title">Personnel File of <?php echo $soldierName ?></font></b></td>
|
Thanks everyone. |
|
|
|
 |
montego

|
Posted:
Fri Jun 09, 2006 7:13 am |
|
You're welcome.
By the way, if you are concerned about XHTML compliance, you may want to have it look like this :
bgcolor="<?php echo $bgcolor2 ?>">
For XHTML, every attribute must be quoted and that can be either single or double quotes.
Best regards,
montego |
|
|
|
 |
|