|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
kenshiro_kid Smarty n00b
Joined: 09 May 2008 Posts: 4
|
Posted: Fri May 09, 2008 12:42 am Post subject: Infamous $compile_dir error on line 1095 (URGENT!) |
|
|
Okay, first of all- I'm trying to install kusaba imageboard software, and I guess one way or another it uses smarty in it's configuration. But anyway, it just plain isn't working. This is my second day trying to fix it and I'm still have no luck, yes, I've checked EVERYTHING:
-The sticky topic
-File permissions
-Safe_mode (which is off)
-The paths are in the right place, etc.
Everything should work, and it's really annoying me that it's not. Here are some pics of what I'm dealing with:
File permissions:
http://i28.tinypic.com/dcvfhx.png
Line 1095 (highlighted):
http://i30.tinypic.com/oaslkk.png
Error I get during installation:
http://i31.tinypic.com/2rh5ici.png
the only line containing $compile_dir:
http://i28.tinypic.com/2qn2iah.png
This is the kusaba installation file:
Code: |
<?php
/**
* @ignore
*/
function mysql_table_exists($database, $tableName) {
global $tc_db;
$tables = array();
$tablesResults = $tc_db->GetAll("SHOW TABLES FROM `$database`;");
foreach ($tablesResults AS $row) $tables[] = $row[0];
return(in_array($tableName, $tables));
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>kusaba Installation</title>
<style type="text/css">
body { font-family: sans-serif; font-size: 75%; background: #ffe }
a { text-decoration: none; color: #550 }
h1,h2 { margin: 0px; background: #fca }
h1 { font-size: 150% }
h2 { font-size: 100%; margin-top: 1em }
.hl { font-style: italic }
.plus { float: right; font-size: 8px; font-weight: normal; padding: 1px 4px 2px 4px; margin: 0px 0px; background: #eb9; color: #000; border: 1px solid #da8; cursor: hand; cursor: pointer }
.plus:hover { background: #da8; border: 1px solid #c97 }
ul { list-style: none; padding-left: 0px; margin: 0px }
li { margin: 0px }
li:hover { background: #fec; }
li a { display: block; width: 100%; }
</style>
<link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
<div style="text-align:center;"><h1>kusaba Installation</h1></div>
<?php
echo '<h2>Checking configuration file...</h2>';
if (file_exists('config.php')) {
require 'config.php';
require KU_ROOTDIR . 'inc/functions.php';
if (KU_RANDOMSEED!="ENTER RANDOM LETTERS/NUMBERS HERE"&&KU_RANDOMSEED!="") {
echo 'Configuration appears correct.';
echo '<h2>Checking database...</h2>';
$reqiredtables = array("banlist","bannedhashes","blotter","boards","board_filetypes","events","filetypes","loginattempts","modlog","module_settings","news","reports","sections","staff","watchedthreads","wordfilter");
foreach ($reqiredtables as $tablename) {
if (!mysql_table_exists(KU_DBDATABASE,KU_DBPREFIX.$tablename)) {
die("Couldn't find the table <b>".KU_DBPREFIX.$tablename."</b> in the database. Please <a href=\"install-mysql.php\"><b><u>insert the mySQL dump</u></b></a>.");
}
}
echo 'Database appears correct.';
echo '<h2>Inserting default administrator account...</h2>';
$result_exists = $tc_db->GetOne("SELECT COUNT(*) FROM `".KU_DBPREFIX."staff` WHERE `username` = 'admin'");
if ($result_exists==0) {
$result = $tc_db->Execute("INSERT INTO `".KU_DBPREFIX."staff` ( `username` , `password` , `type` , `addedon` ) VALUES ( 'admin' , '".md5("admin")."' , '1' , '".time()."' )");
echo 'Account inserted.';
} else {
echo 'There is already an administrator account inserted.';
$result = true;
}
if ($result) {
require_once KU_ROOTDIR . 'inc/classes/menu.class.php';
$menu_class = new Menu();
$menu_class->Generate();
echo '<h2>Done!</h2>Installation has finished! The default administrator account is <b>admin</b> with the password of <b>admin</b>.<br /><br />Delete this and the install-mysql.php file from the server, then <a href="manage.php">add some boards</a>!';
echo '<br /><br /><br /><h1><font color="red">DELETE THIS AND install-mysql.php RIGHT NOW!</font></h1>';
} else {
echo 'Error inserting SQL. Please add <b>$tc_db->debug = true;</b> just before ?> in config.php to turn on debugging, and check the error message.';
}
} else {
echo 'Please enter a random string into the <b>KU_RANDOMSEED</b> value.';
}
} else {
echo 'Unable to locate config.php';
}
?>
</body>
</html>
|
This is the smarty.php file:
Code: | <?php
/*
* This file is part of Trevorchan.
*
* Trevorchan is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* Trevorchan is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* Trevorchan; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* +------------------------------------------------------------------------------+
* Smarty engine initialization and configuration
* +------------------------------------------------------------------------------+
*/
require_once KU_ROOTDIR . 'lib/smarty/Smarty.class.php';
$smarty = new Smarty();
$smarty->template_dir = KU_TEMPLATEDIR;
if (KU_CACHEDTEMPLATEDIR != '') {
$smarty->compile_dir = KU_CACHEDTEMPLATEDIR;
$smarty->cache_dir = KU_CACHEDTEMPLATEDIR;
}
$smarty->config_dir = KU_ROOTDIR . 'smarty/configs';
$smarty->assign('ku_name', KU_NAME);
$smarty->assign('ku_webpath', KU_WEBPATH);
$smarty->assign('ku_boardspath', KU_BOARDSPATH);
$smarty->assign('ku_cgipath', KU_CGIPATH);
?>
|
Anything else you guys need to know? Seriously- this is so irritating, I've never encountered one problem that's annoyed me for so long.
PS: I know it's a security issue to chmod 777 * blah blah blah I just want it to work D= |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri May 09, 2008 2:17 am Post subject: |
|
|
You should use an absolute filepath to the template_dir, compile_dir, cache_dir, and config_dir so you are not relying on your include_path. What is happening is that "templates_c" is not in your include_path relative from the executing PHP script. |
|
Back to top |
|
kenshiro_kid Smarty n00b
Joined: 09 May 2008 Posts: 4
|
Posted: Fri May 09, 2008 8:00 pm Post subject: |
|
|
How do I do this? D= I'm sorry but I wasn't expecting to set up smarty with this imageboard software. I'm just learning PHP too- I have basic education in computer science so I do know what I'm doing, I just need a small shove in the right direction. |
|
Back to top |
|
kenshiro_kid Smarty n00b
Joined: 09 May 2008 Posts: 4
|
Posted: Fri May 09, 2008 8:05 pm Post subject: |
|
|
Nevermind. It worked. Holy crap I am so relieved >< thank you so much! I can not express how happy I am that I finally have this fixed =D
EDIT: Um...now I'm getting a different error =/ Warning: Smarty error: unable to read resource: "Library/WebServer/Documents/kusabav104/smarty/templates/manage_menu.tpl" in /Library/WebServer/Documents/kusabav104/lib/smarty/Smarty.class.php on line 1095
The file permissions are correct D= I don't know what else it could be. |
|
Back to top |
|
kenshiro_kid Smarty n00b
Joined: 09 May 2008 Posts: 4
|
Posted: Sat May 10, 2008 8:06 pm Post subject: |
|
|
Okay, so I fixed that problem...and now...I'm getting one blank page >< not all of them are blank, just one- the thing is it wasn't blank before and I don't know what I did to now make it blank =/ |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|