Search the Community
Showing results for tags 'smarty'.
-
Why smarty won't find my template file? Fatal error: Uncaught --> Smarty: Unable to load template file 'test.tpl' <-- thrown in C:\xampp\htdocs\testing\includes\smarty\sysplugins\smarty_internal_templatebase.php on line 129 also did testinstall $smarty->testInstall(); Smarty Installation test... Testing template directory... C:\xampp\htdocs\testing\templates\frontend\default\tpl is OK. Testing compile directory... C:\xampp\htdocs\testing\templates_c\frontend is OK. Testing plugins directory... C:\xampp\htdocs\testing\includes\smarty\plugins is OK. Testing cache directory... C:\xampp\htdocs\testing\cache is OK. Testing configs directory... C:\xampp\htdocs\testing\configs is OK. Testing sysplugin files... ... OK Testing plugin files... ... OK Tests complete. And get template dir var_dump($smarty->getTemplateDir()); array(1) { [0]=> string(55) "C:/xampp/htdocs/testing/templates/frontend/default/tpl\" } File schema htdocs -- testing -- incluses -- smarty plugins sysplugins Smarty.class.php SmartyBC.class.php -- configs configs.php -- db connect.php db.php -- configs -- cache -- templates -- frontend -- default -- css -- mages -- js -- tpl test.tpl -- backend -- templates_c -- frontend index.php index.php <?php ini_set('display_errors', 1); ini_set('log_errors', 1); ini_set('display_startup_errors', TRUE); ini_set('error_log', dirname(__FILE__) . '/error_log.txt'); error_reporting(E_ALL); ob_start(); session_start(); require 'includes/smarty/Smarty.class.php'; require 'includes/db/db.php'; require 'includes/configs/configs.php'; $page = isset($_GET['do']) ? $_GET['do'] : ''; switch($page){ case 'home'; include 'pages/home.php'; break; default: include 'pages/test.php'; break; } ob_flush(); ?> configs.php <?php $smarty = new Smarty(); $smarty->compile_check = true; $smarty->debugging = false; $smarty->cache = 1; $smarty->setTemplateDir('C:/xampp/htdocs/testing/templates/frontend/default/tpl'); $smarty->setCompileDir('C:/xampp/htdocs/testing/templates_c/frontend/default'); $smarty->setCacheDir('C:/xampp/htdocs/testing/cache'); $smarty->setConfigDir('C:/xampp/htdocs/testing/configs'); ?> test.php <?php //$success = 'Success Message'; //$error = 'Error Message'; $errors[] = 'Error one'; $errors[] = 'Error two'; $smarty = new Smarty; //$smarty->assign('success', $success); //$smarty->assign('error', $error); $smarty->assign('errors', $errors); $smarty->display('test.tpl'); ?> test.tpl {if !empty($errors)} <div id="errors"> {section name=i loop=$errors} {$errors[i]}<br /> {/section} </div> {/if}
-
I have been tasked to find the problem with this site's database connection. The site is a PHP, MySQL, Smarty site. Currently, I am getting the following when www.mysite.com is called. The index.php is located at www.mysite.com/index.php The current locations of the following files are: includes/ru_config.com includes/ru_connection.com All the replaced passwords, usernames, and site specific information worked previously so the problem is not there. One problem there might be, is in ru_connection where the paths for ru_4pear and DB.php might be wrong. There locations are: includes/ru_4pear.com libs/pear/DB.php ru_config.php index.php ru_connection.php DB.php ru_4pear.php
-
Hello all, I start learning php for several weeks. I got to know Smarty recently. It looks very complicated. Do you think it's necessary to learn it?
-
Greetings All! This is my first post here, so I'd like to extend a big HELLO to everyone! I look forward to learning more about PHP from all the advanced PHP developers who frequent these forums. I've taken over management of a website that was recently compromised through use of a MULCI shell, as well as SQL injection. I've been working to tidy everything up, and have turned my attention to the image upload directory. Users have the ability to upload images to the website. I believe it could be possible that a user uploaded a PHP script (the MULCI shell) into the image uploads directory, and executed it their to compromise my website. I talked with a Linux security analyst who recommended that I CHMOD that directory to not allow execution of PHP files. Problem is, I'm not sure what permissions should be set to achieve such action, and this is a Rackspace Cloud Site, so I do NOT have terminal access. I tried setting some of my own CHMOD permissions, but it broke loading of images in the site. I'm open to any suggestions. Thanks.
-
I don't know the syntax , couldn't find anything similar on the net please help : Code: <script type="text/javascript"> var u=$('#2').find('tbody > tr').size(); <%section name='i' start=0 loop=u%> alert('in loop'); <%/section%> </script>
- 1 reply
-
- smarty
- javascript
-
(and 1 more)
Tagged with:
-
I have two columns in a table , first column has a select and the second has a list of checkboxes I'm using smarty to get the number of rows of the table from php , then I use a loop in script code to generate onchange event for every select cell in the table , I'm lost with syntax ! what I want that when I change the select options the checkboxes in the second cloumn become readonly or not . depeanding on the select option which has been chosen . when I open the source of the page I find that there's no code generated in the script at all , it's like the smarty code is ignored need your help to fing the error . the script : <script type="text/javascript"> $(document).ready(function() { <%section name='i' start=0 loop=$rows_number%> $('col_order<%$smarty.section.i.index%>').change(function(){ if( $('col_order<%$smarty.section.i.index%>').val=='first') { $("col_list<%$smarty.section.i.index%>_0").attr('selected','y'); $("col_list<%$smarty.section.i.index%>_0").attr('disabled',false); $("col_list<%$smarty.section.i.index%>_1").attr('selected','y'); $("col_list<%$smarty.section.i.index%>_1").attr('disabled',false); } else if( $('col_order<%$smarty.section.i.index%>').val=='second') { $("col_list<%$smarty.section.i.index%>_0").attr('selected','n'); $("col_list<%$smarty.section.i.index%>_0").attr('disabled',true); $("col_list<%$smarty.section.i.index%>_1").attr('selected','n'); $("col_list<%$smarty.section.i.index%>_1").attr('disabled',true); } }); }); <%/section%> </script>