PDA

View Full Version : [Release vB2.0] vB colors for non-vb page


wajones
25 Jun 2001, 07:03
I don't know if this has been done, if it has please disreguard or delete...

Just a mini hack for those that want to put things on non-vb pages and don't want to hard code the colors. Without the space after the { and before the } of course. Puts the replacement $vars in an array then you assign them in order so you can use them on other pages.

e.g. bgcolor = "$bgcolor1"


require("global.php");
$vbcolors = dovars("{ secondaltcolor },{ categorybackcolor },{ firstaltcolor },{ secondaltcolor },{ pagetextcolor },{ pagetextcolor }",0);
$vbc = explode(",",$vbcolors);
$bgcolor1 = $vbc[0];
$bgcolor2 = $vbc[1];
$bgcolor3 = $vbc[2];
$bgcolor4 = $vbc[3];
$textcolor1 = $vbc[4];
$textcolor2 = $vbc[5];

cyrus
25 Jun 2001, 14:57
I like the idea, I needed sumthing like this.

But how do I go about doing it ?? Can you please include more detailed steps.

Thank you

wajones
25 Jun 2001, 15:49
Example:

<?
require("global.php");
$vbcolors = dovars("{ firstaltcolor },{ secondaltcolor },{ pagetextcolor }",0);
$vbc = explode(",",$vbcolors);
$bgcolor1 = $vbc[0];
$bgcolor2 = $vbc[1];
$textcolor1 = $vbc[2];

echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"$bgcolor2\"><tr><td>\n";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"8\" bgcolor=\"$bgcolor1\"><tr><td>\n";
echo "<font size=\"2\" color=\"$textcolor1\">Hello</font>\n";
echo "</td></tr></table></td></tr></table>\n";

?>