Quote:
Originally posted by TECK
not to be picky erwin... but isnt alot easier to add a file like that:
Code:
<?php
error_reporting(7);
$templatesused = 'error_nopermission, your_template';
require('./global.php');
$permissions = getpermissions();
if (!$permissions['canview']) {
show_nopermission();
}
eval("dooutput(\"".gettemplate('your_template')."\");");
?>
??
|
Also, a friendly tip.
There's no point including 2 templates into $templateused if each template is mutually exclusive. The templateused uses 1 query. Without it, when you either call error_nopermission OR the other template, it's 1 query each - it's never 2 queries. So you don't save any queries using $templateused if the templates are mutually exclusive and never run together.
And looking at your code, you completely misunderstand this hack. This hack doesn't require anyone to save their HTML file into the template database, and have multiple PHP files.
All you need is the html.php file. Then, just change the filename in front of it like this : html.php?file=index.html or html.php?file=anything.html, and the HTML will automatically be integrated as though it is in the template, but it's not.
It actually is harder to do than it looks. It's not a simple include() function. It's not even a simple eval() function. I had to look up PHP manuals and do a tricky array type code to make the HTML file parsed into the forum.
Try it and have a look at my code. Your code will never work for what I intend this hack to do.