- Moderated by:
- Support
-
- rank:
-
Professional
- registered:
- August 2002
- Status:
- offline
- last visit:
- 25.11.05
- Posts:
- 994
Not all the colours in the $colors array are available in the theme, it seems, notably the background colour ($bgcolor1)
The theme.php define these ones, and others are defined in xaninit.php:
Code
$bgcolor1 = $colors['background'];
$bgcolor2 = $colors['color1'];
$bgcolor3 = $colors['color2'];
$bgcolor4 = $colors['color3'];
$bgcolor5 = $colors['color4'];
$bgcolor6 = $colors['color5'];
$sepcolor = $colors['sepcolor'];
$textcolor1 = $colors['text1'];
$textcolor2 = $colors['text2'];
They should translate to tags like this, but some of them aren't valid:
Quote
not valid
not valid
not valid
not valid
not valid
not valid
So, Is this a bug, or are there other tag names for these? It wouldn't make sense for them not to match the $colors array, though. Mark's conversion kit has a slightly different listing of colours, but only the ones above are valid. In the meantime, I'll have to hard-code the background colours. -
- rank:
-
Moderator
- registered:
- March 2002
- Status:
- offline
- last visit:
- 26.08.08
- Posts:
- 7720
Martin,
I believe that the colors defined in theme.php are the legacy names used by older modules e.g. $GLOBALS['color1'] etc... The Xanthia class assigns the full range of colors available in a a palette in the followig snippet. The keys for the array are the template tags.
Code
$this->DTS_attrib = array('bgcolor' => $colors['background'],
'color1' => $colors['color1'],
'color2' => $colors['color2'],
'color3' => $colors['color3'],
'color4' => $colors['color4'],
'color5' => $colors['color5'],
'color6' => $colors['color6'],
'color7' => $colors['color7'],
'color8' => $colors['color8'],
'sepcolor' => $colors['sepcolor'],
'text1color' => $colors['text1'],
'text2color' => $colors['text2'],
'linkcolor' => $colors['link'],
'vlinkcolor' => $colors['vlink'],
'hovercolor' => $colors['hover']);
-Mark -
- rank:
-
Professional
- registered:
- August 2002
- Status:
- offline
- last visit:
- 25.11.05
- Posts:
- 994
Thanks Mark, these work:
Code
<!--[$bgcolor]-->
<!--[$color1]-->
<!--[$color2]-->
<!--[$color3]-->
<!--[$color4]-->
<!--[$color5]-->
<!--[$color6]-->
<!--[$color7]-->
<!--[$color8]-->
<!--[$sepcolor]-->
<!--[$text1color]-->
<!--[$text2color]-->
<!--[$linkcolor]-->
<!--[$vlinkcolor]-->
<!--[$hovercolor]-->
I had a look through the documentation first, and found no mention of these codes. It talks of how to use the Xanthia colours configuration panel, that's all. The closest I found was the table of commands in your AT->Xanthia Conversion kit, which shows $color1-10 for colours, nothing more (of which the last two don't exist). I assume this was how it was in an earlier build.
Is there a reason other than semantics why the others don't match the $colors array, notably bgcolor, textXcolor, linkcolor, vlinkcolor and hovercolor? They can't be defined global vars, since nothing is returned by the Template for $link, $vlink, $hover, and $background. It's not important as long as the tags are documented somewhere.
I figured the first were for legacy, the confusing part there is that there isn't a direct correlation between the $color vars and the old vars, eg $color1 = $bgcolo2 etc, so it's tempting to put $color4 when you want $bgcolor4, which is wrong. I found this in postnukeblue for instance.
Martin
