View Full Version : Recursive replacement variables hack!

10 Jan 2002, 00:14
What the hell is a "recursive replacement variables hack"? you ask? Well, allow the bigmattyh-meister to explain.

Simply put, the RRV hack allows you to use replacement variables within other replacement variables. "But isn't that already a feature included in vB?" you ask. Well, yes, and no. I've found that vB's ability to do this works in some cases, and doesn't work at all in other cases. Some variables get replaced, others don't. Especially when it comes to the <body> tag! Whew. It's messed up.

Here's one way you can use this hack:
Create a custom variable called {color1}. Give it the value of #440044. Or whatever color you choose.
With the RRV hack you can use it in any other replacement variable of your choosing. You can set <body> to be replaced by <body ... alink="{color1}" vlink="{color1}">, or make {categorybackgroundcolor} be replaced by {color1}.

The benefit? Now when you want to change your board's colors, all you do is change the value of {color1}, and the rest falls into place.

If you want, you can also use it like this:
Create {color1} and set its value to a color of your choosing.
Make { linkcolor } be replaced with "{color1}".
Change <body> to be replaced by <body ... alink="{ linkcolor }" vlink="{ linkcolor }">

It works! But it doesn't in your standard version of vB.

Anyway, you might not think this is huge, but it works for me, so now I pass on the joy to you. Feedback is much appreciated. I plan on releasing this as a full hack in a few days, pending feedback. Also with it, I'll include the hack to directly edit vB's default replacement variables. (and that is super-useful with this hack!)

10 Jan 2002, 04:14
Very nice Matt :)

Thanks for the hack!

10 Jan 2002, 15:11
Well done, thanks.

10 Jan 2002, 15:21
Wouldn't this slow the page loading?

10 Jan 2002, 23:41
It may be a little extra time loading pages, but for all I can tell, it's not that much difference.

That said, I'm working on an improved version of this hack that will get the job done in a much more efficient way. So look for it!