07-29-2000, 05:15 PM
This hack will allow you to view your template before you put it up on the web page. It is partial because it does not include any of the global settings like border colors, etc.
So here it is:
In admin/template.php
Look for:
####### Start modify ########
echo "<li>$template[title] <a href=\"template.php?action=edit&templateid=$template[templateid]\">[edit]</a> <a href=\"template.php?action=remove&templateid=$template[templateid]\">[delete]</a></li>\n";
and replace it with:
echo "<li>$template[title] <a href=\"template.php?action=edit&templateid=$template[templateid]\">[edit]</a> <a href=\"template.php?action=remove&templateid=$template[templateid]\">[delete]</a> <a href=\"/yourforum/template.php?action=view&templateid=$template[templateid]\">[view]</a></li>\n";
Change the yourforum to your main forum directory.
Then create a file will the following:
<?php
require("global.php");
// ####################### View ########################
if ($action=="view") {
$templates=$DB_site->query("SELECT templateid,title,template FROM template WHERE templateid=$templateid");
$template=$DB_site->fetch_array($templates);
echo "<html><body>";
echo "<center>Template File Name: $template[title]";
echo "<p><hr><p>";
echo "<table border=0><td>";
echo "$template[template]";
echo "</td></table></center>";
echo "</body></html>";
}
?>
</body>
</html>
and name it template.php and put it in your main forum directory.
Like I said this will give you the basic layout but without all the colors you have set up, etc..
If anyone knows how to grab the rest of the settings like your firstaltcolor, secondaltcolor, to include here so the page will look pretty much like it will on the web would be great.
Parker
[Edited by Parker Clack on 07-29-2000 at 03:51 PM]
So here it is:
In admin/template.php
Look for:
####### Start modify ########
echo "<li>$template[title] <a href=\"template.php?action=edit&templateid=$template[templateid]\">[edit]</a> <a href=\"template.php?action=remove&templateid=$template[templateid]\">[delete]</a></li>\n";
and replace it with:
echo "<li>$template[title] <a href=\"template.php?action=edit&templateid=$template[templateid]\">[edit]</a> <a href=\"template.php?action=remove&templateid=$template[templateid]\">[delete]</a> <a href=\"/yourforum/template.php?action=view&templateid=$template[templateid]\">[view]</a></li>\n";
Change the yourforum to your main forum directory.
Then create a file will the following:
<?php
require("global.php");
// ####################### View ########################
if ($action=="view") {
$templates=$DB_site->query("SELECT templateid,title,template FROM template WHERE templateid=$templateid");
$template=$DB_site->fetch_array($templates);
echo "<html><body>";
echo "<center>Template File Name: $template[title]";
echo "<p><hr><p>";
echo "<table border=0><td>";
echo "$template[template]";
echo "</td></table></center>";
echo "</body></html>";
}
?>
</body>
</html>
and name it template.php and put it in your main forum directory.
Like I said this will give you the basic layout but without all the colors you have set up, etc..
If anyone knows how to grab the rest of the settings like your firstaltcolor, secondaltcolor, to include here so the page will look pretty much like it will on the web would be great.
Parker
[Edited by Parker Clack on 07-29-2000 at 03:51 PM]