PDA

View Full Version : Custom Non-vB Page


Breaker
06-02-2003, 03:30 PM
Created this hack for a friend and everything works well exept for one problem.

The problem is that the Replacement variables in the templates arent replaced by the replacement code, so the colors or images dont show up, if there is any file i have to "require" other than global.php could someone tell me?

Breaker
06-03-2003, 02:53 PM
BUMP! Ne1 have ne ideas?

filburt1
06-03-2003, 03:20 PM
Make sure you're using the appropriate code to eval the template:

eval("gettemplate(\"" . gettemplate("templatename") . "\");");

Breaker
06-03-2003, 03:29 PM
I put that in, but the template didn't show, not sure if i missed something out or something. I'm currently using two lines to display the template which seems to work: eval("\$ranking = \"".gettemplate('ranking')."\";");
print $ranking; but the replacements aren't working

filburt1
06-03-2003, 03:51 PM
Never echo directly from a vB page. Instead, always use dooutput (search in the source).

noppid
06-03-2003, 04:38 PM
Today at 12:29 PM Breaker said this in Post #4 (https://vborg.vbsupport.ru/showthread.php?postid=403916#post403916)
I put that in, but the template didn't show, not sure if i missed something out or something. I'm currently using two lines to display the template which seems to work: eval("\$ranking = \"".gettemplate('ranking')."\";");
print $ranking; but the replacements aren't working

You are using single quotes where you need double quotes for one thing.

Try this...

eval("\$ranking = \"".gettemplate("ranking")."\";");
print $ranking;

filburt1
06-03-2003, 04:41 PM
That's not the problem; PHP doesn't care which quote format you use (although I use double for everything except array keys). The only difference between the two is that single-quotes won't parse variables in the string.

Breaker
06-03-2003, 04:44 PM
ye, i just noticed that the type of quotes doesn't really matter, i prefer to use single quotes, thats the way i do it, others may use double.

Never echo directly from a vB page. Instead, always use dooutput (search in the source).

dont really understand exactly what you mean here, i'm still learning php :)

noppid
06-03-2003, 04:45 PM
Today at 01:41 PM filburt1 said this in Post #7 (https://vborg.vbsupport.ru/showthread.php?postid=403945#post403945)
That's not the problem; PHP doesn't care which quote format you use (although I use double for everything except array keys). The only difference between the two is that single-quotes won't parse variables in the string.

In my experience with PHP and vB I've find that statement and it's assumed compatibility to be unreliable. Just my 2 cents.

http://us3.php.net/eval

filburt1
06-03-2003, 04:51 PM
What do you mean? :)

Breaker: look in vB's files for examples on how to use dooutput(). :)