PDA

View Full Version : Replacements


Jensie180
07-30-2003, 11:45 AM
Hi everyone

Does anyone know how to execute the replacement thing on a non-vb page so it replaces the {replacething} on that page too?

Help would be very much appreciated :)

NTLDR
07-30-2003, 11:51 AM
$var = dovars($var);

Make sure that you have included global.php if you using vB. If not then something similar to:

$var = str_replace("{replacement}", "value", $var);

Jensie180
07-30-2003, 11:54 AM
Thanks for your help, I saw that on php.net too. But what I'm looking for is that it includes the replacement thing of Vb in the non-vb page. Without doing it with the str_replace.

NTLDR
07-30-2003, 11:56 AM
The first example shown should parse all vB replacements on the variable $var.

Jensie180
07-30-2003, 04:32 PM
I tried this but my page went blanc when adding $var = dovars($var); and yes I included the global.php. How do you use the $var anyway? I just want it to be global on the page so everything that can be replaced by the vb replacements system IS replaced. Anyone? Please, it's very urgent :(

Jensie180
07-31-2003, 12:27 AM
Can someone please tell me how I should do this, it's very urgent as I want my site up tomorrow and it won't be without this. Thanks!

Highlander
07-31-2003, 04:24 AM
hmm i just wannt to know it also.. but here in vbulletin.org the help is soo poorly managed.. all the coders are looking for their own problems and issues they aant to know..

but if someone asks..something that would mean to spend some minutes for figuring it out.. you wont get helped!

i hate that here..the helpouts are really POOR..

sorry.. ut i feel so, cause i just asked a few question some weeks ago.. and any of my questions has been answered !

NTLDR
07-31-2003, 11:51 AM
Nobody is paid to help here Highlander, we all do it out of our own free will. If you paying for to help then you would have reason to complain, but your not. People just expect everyone to do everything for them for free, well sorry thats not how it works. Give to the community and perhaps it will give back to you...

@Jensie180 are you using vB's templates to create the page? I'll have a look and see if I can find a vB2 functions.php and see why its not working :)

NTLDR
07-31-2003, 12:17 PM
Looking at the dovars() funtion in vB 2.3.0 I can't see why this wouldn't work.

IMO, if you not using the vB template system then you should be, remember this will use the default replacement set:


$replacementsetid = X; // the replacement set to use
$var = dovars($var); // $var contains the HTML for the replacements to be issued on
echo $var; // outputs the HTML to the browser

Jensie180
07-31-2003, 09:32 PM
Ok thanks again but while I was waiting I already solved it with variables. Like $tableheadbgcolor = '#color'; and in the table I put $tableheadbgcolor ;)