php,smarty,smarty3Related issues-Collection of common programming errors


  • Danvin Lee Qicheng
    php html dynamic graph
    Currently I have a page where once you click that page it will fetch yahoo weather reading and supposedly it will be added to the graph (real time).Currently i have input a timer to consistly read from the page and now I can’t put it into the y value of the graph so may I request some time to take a look at my codes?P.S. line 309 is the input of y value, and line 280 is the timer that calls the file.index.php<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js”><

  • ThihaKyaw
    php android mysql
    What is this error, and why does it happen? Please explain and solve. This is sample from “androidhive”. I need help for my thesis because of my thesis android app is to store data at web server.12-10 10:08:09.556: W/System.err(401): org.apache.http.conn.HttpHostConnectException: Connection to http://localhost refused 12-10 10:08:09.556: W/System.err(401): org.apache.http.conn.HttpHostConnectException: Connection to http://localhost refused 12-10 10:08:09.686: W/System.err(401): at org.apache.h

  • Muhammed Aslam C
    php google-app-engine curl google-api-php-client
    This works in WAMP server, i get output. but not in GAE. because GAE doesn’t support cURL. and i couldn’t find any solution to use GAPI php in GAE. Is there any way to use php GAPI in GAE? Here is the example filter code the provide<?php define(‘ga_email’,’[email protected]’); define(‘ga_password’,’your password’); define(‘ga_profile_id’,’your profile id’);require ‘gapi.class.php’;$ga = new gapi(ga_email,ga_password);$filter = ‘country == United States && browser == Firefox || bro

  • Xalu
    java php android mysql json
    I am currently working on an app and I am trying to implement a user system with login/registatration. I’ve been going over several tutorials to get an idea what to do. Now I am beginng to wonder if something is wrong with my eclipse enviroment because after trying 2 or 3 tutorials (and downloading the source code to test), I keep getting the same errors.Rather than posting all the code (there is a lot)…Here is a link to the projects tutorial http://www.learn2crack.com/2013/08/develop-android-

  • SPeed_FANat1c
    php random poker
    I have made a research on poker equities. What I did is use pokerstove program with some selected. And with that program calculated the equities using enumerate all method. So pokerstove results:I also made a table where I store the random results:CREATE TABLE poker_results ( id int NOT NULL AUTO_INCREMENT, matches_id int NOT NULL, — just for filtering in case I will want another starting hands. result varchar(255) NOT NULL, winner_hands varchar(255) NOT NULL, PRIMARY KEY (id) ) The result col

  • Darius
    php xml
    I call commission junction API and receive this as a response.$xml_response = simplexml_load_file($xml_response); exit($xml_response);If I do $xml = new SimpleXMLElement($xml_response);I get an application error. (Not sure how to find what error this is, where could I set error codes to show for this part?)Warning: simplexml_load_file(): I/O warning : failed to load external entity ” 106032782478435B & H Photo VideoComputers & Solutions > Laptops > MacBookshttp://www.jdoqocy.com/cl

  • Martijn Riemers
    php git maven vert.x
    I’m trying to install the PHP language in my vert.x mods directory. I have tried both branches and both process a different answer.All these results and errors were either produced when trying to build from the git repo or using running vertx run app.php in the command line using this simple PHP script:<?phpuse Vertx\Pump;$server = Vertx::createNetServer();$server->connectHandler(function($socket) {$pump = new Pump($socket, $socket);$pump->start(); })->listen(1234, ‘localhost’);When

  • jbihan
    java php android mysql json
    Immersed in the development of my program, I encounter an error that seems to me not really speaking.So here’s my logcat in the order and the java code:When I click on the item in my listview it should return me the contact information for the update.public class MajContactActivity extends Activity {EditText txtNom; EditText txtPrenom; EditText txtNummobile; EditText txtNumfixe; EditText txtEmail; EditText txtAdresse; EditText txtProfession;Button btnSav; Button btnSup;String idCONTACT;// Progr

  • mrkirby153
    java php sockets encryption
    Recently I was experimenting with communication between a webserver and java and ended up experimenting with sockets. Putting this into production, it is a must to encrypt the data being sent to and from the java socket server and to the php webserver. As an encryption method, I am using AES. I can get the PHP web server to successfully encrypt the data and send it via a socket but I cannot get the java application to successfully decrypt the message. I keep gettingException in thread “main” jav

  • Inator
    php javascript apache nosql couchdb
    I’ve recently successfully installed CouchDB version 1.2.1 and as a test I can access it using the following Apache rewrite in CentOS 6:RewriteRule couchdb/(.*)$ http://127.0.0.1:5984/$1 [QSA,P]I have a PHP authentication class that I use across a home grown API to support my mobile apps. My API accepts and authenticates each request using an HMAC signature that is included in the URL like so:https://api.domain.com/endpoint/?timestamp=[timestamp]&signature=[signature]&id=[id]…etcEach

  • CrazyPHP
    php smarty
    I wrote small plugin for smarty 3 to allocate my files in case of theme options. It work fine all the time, but i choose new template for new project. And discover something mad!{block name=”css_load”}<link href=”{asset file=’plugins/bootstrap/css/bootstrap.min.css’}” rel=”stylesheet” type=”text/css”><link href=”{asset file=’plugins/bootstrap/css/bootstrap-responsive.min.css’}” rel=”stylesheet” type=”text/css”> {/block}Normal code isn’t it? But it throw exception:Syntax error in tem

  • Daryl Gill
    php smarty
    I’m in the process of creating a controller to display pages. I currently have this; $request = str_replace(“/Smarty/”, “”, $_SERVER[‘REQUEST_URI’]); $params = explode(“/”, $request); function FormatArr ($Arr){$Array_Keys = array (“PageName”,”Username”);if (count($Arr) > 2){trigger_error(“Unexpected Params”,E_USER_ERROR);}return array_combine($Array_Keys,$Arr);}$New_Params = FormatArr($params);On the setup.php page, then on my libs: class testing {protected $Smarty;protected $fixpath;public

  • irimie andrei
    javascript regex validation smarty prestashop
    I have a form, and when I submit it, I want to make an email validation before. I created a js file, put in theme’s js directory, included it on the page and my page is WHITE. I activated the errors and I saw that this is the error: SmartyCompilerException: Syntax Error in template”D:\Projects\mpm_shop\themes\pmart\js\processContactFormEmail.js”on line 44 “var re =/^([a-zA-Z0-9_.-+])+\@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;”- Unexpected “,”, expected one of: &quo

  • lorenzo-s
    smarty
    I am getting the following error when I call an ajax function SmartyCompilerException: Syntax Error in template “themes/themename/ajax-product-sort.tpl” on line 16 “<option value=”{$link->addSortDetails($request, ‘price’, ‘asc’)|escape:’htmlall’:’UTF-8′}” {if $orderby eq ‘price’ AND $orderway eq ‘ASC’ }selected=”selected”{/if>l} {s=’price: lowest first’}</option>” – Unexpected ” }” in D:\wamp\www\sitename\tools\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 431

  • Paul DelRe
    php wordpress smarty
    I am using smarty templates for pinnaclecart to pull post data from wordpress database so the website can show the blog posts. I fixed IF unexpected error but now it is back to $this. I m stuck :(public_blog.phpEDIT backfunction getPosts() {$query= $this->db->query(“SELECT * from wp_posts where post_status=’publish’ AND post_type = ‘post'”);$posts = array();if ($this->db->moveNext($query, MYSQL_ASSOC)){$posts[] = $this->db->col;} return $posts;} $posts = getPosts(); view()->

  • joe
    smarty
    I’m using smarty template engine to implement my templates for a website.I have to extract the first word of a varible, e.g. the variable “$a” with the content “hello world foo …” must be seperated into two variables: “$b” = “hello” and “$c” with the rest (which can be of different size) of “$a”, so “world foo …”.

  • sathia
    php smarty
    If I try to assign a multidimensional array to a class i get this error {Widgets->Widgetmedia=’videos’filters=Array(‘a’ => ‘b’, ‘c’ => ‘d’)}”{assign var=’X’ value = Array(‘a’ =&gt; ‘b’, ‘c’ =&gt; ‘d’)}” – Unexpected ” => “, expected one of: “”,”” , “)”‘this doesn’t work as wellfilters[‘a’]=’b’filters[‘c’] = ‘d’is there a way to circumvent this limit? the version of smarty I’m using is the latest.the documentation isn’t very clear about it: http://www.smarty.net/docs/en/advan

  • Paul Rusu
    php smarty whmcs
    I have added the function.bnr_exchange.php to the includes/smarty/plugins directory. It contains smarty_function_bnr_exchange which returns a string.I also modified invoicepdf.tpl $pdf->Cell(0,6,{bnr_exchange} . ”,0,1,’L’,’1′);which gives error: unexpected { I tried with “{bnr_exchange}” but then it writes the text {bnr_exchange}If i simply write {bnr_exchange} in the template it says unexpected } in that line. So it doesn’t recognize the plugin “bnr_exchange”. My question is how do I tell w

  • Claude Grecea
    php pdo smarty
    I am having a problem with Smarty passing a PDO Object to Smarty it just doesn’t like =>. Is there a trick to get around this problem?Here is he error:{assign var=’brgdatas’ value=”{$brgObj->fetchOneBrg(array(‘id’=>{$ststres[ststval].to_id}’))}”}” – Unexpected “=>”, expected one of: “”,”” , “)Here is the code I am working with:{section name=ststval loop=$ststres}{if $ststres[ststval].type == 2}{assign var=’brgdatas’ value=”{$brgObj->fetchOneBrg(array(‘id’=>{$ststres[ststval].to

  • Jerielle
    javascript jquery smarty
    Hello guys I have a problem in getting textboxes inputs in my jquery using ID. Ok here’s my code.<script type=”text/javascript”>var globalBase_Url = “{$base_url}”; //OK NO ERROR var name = “”;var desc = “”;{literal}$(document).ready(function(){$(‘#add_cat’).on(‘click’,function(){$(‘#add_category’).show(‘slide’);});$(‘#submit’).on(‘click’,function(){jquery.ajax({ var name = $(‘#category_name’).val(); //this is the errorvar desc = $(‘#description’).val(); // this is the error});});});{/li

  • Syntax Error
    upgrade smarty3 cmsmadesimple
    I’m new to CMSMS and taking an older installation through a painful upgrade path to get it to the current version. One of the major changes involves using Smarty 3 for it’s templating engine. This change has broken a couple of the existing templates.The related CMSMS module is called “Product and Inventory Manager” which looks like it’s part of “Calguys Module Extensions”Here’s the error message I’m getting:Syntax Error in template “module_db_tpl:ProductsWithLocation;summary_default” on line 26

  • Dainis Abols
    php exception-handling smarty smarty3
    I have block try – catch and i want assign error to the template to $error. I tried:catch (Exception $e) {$smarty->assign(“error”, ‘Error! Details: ‘.$e->getMessage()); }Also tried:catch (Exception $e) {$error = $e->getMessage()); } $smarty->assign(“error”, $error);But when there is no error, smarty requires this variable and all crashes. Is there any way to deal with it without using if? Or may be i am doing wrong from the begining?

  • Athanatos
    php smarty smarty3
    My ajax php located in maindirexample/actions is calling a tpl file one folder up in maindirexample/templatesfetch(‘../templates/popupMyItems.tpl’); However this throws an error <br /> <b>Fatal error</b>: Uncaught exception ‘SmartyException’ with message ‘Unable to load template file ‘list-myItems.tpl’ in ‘../templates/popupMyItems.tpl’popupMyitems.tpl seems to be called ok, however list-myItems.tpl fails (this is included in popupMyitems.tpl) ..{foreachfrom=$uniquecategories i

  • Vipan Kumar
    php smarty3 server-configuration
    I have created project in smarty and now i am trying to host it on pagodabox.com. I have created application on pagodabox.com and uploaded all code on to this application but problem is this now i am unable to configure cache and compiler directory in pagodabox.com that’s why it output fetal error because cache and compiler directory is read only mode. I have try Boxfile to resolve this issue but failing to solve. I am not aware how i can make these directory writable. please help me. this is ur

  • fl3x7
    php codeigniter smarty codeigniter-2 smarty3
    Im currently using codeigniter 2 with ci-Smarty. Just been trying to add a smarty output filter but not having much luck. Its as if the function cannot be found or something?I am using a plugin as the output filter function and have the following code:LOCATION: /libraries/Smarty.php// Set email output filter $this->loadFilter(‘output’, ‘protect_email’);LOCATION: /third_party/Smarty/plugins/function.protect_email.phpfunction smarty_function_protect_email($tpl_output, Smarty_Internal_Template $

  • Hailwood
    php javascript escaping smarty3
    I am using the below code with smarty V3<script>$(function() {jwplayer(“video-player-{$v->id}”).setup( {file: “/webfiles/competitions/movies/{$v->file}”,skin: “/assets/jwplayer/skins/simplicity/simplicity.zip”,width: 446,height: 353,stretching: “fill”,flashplayer: “/assets/jwplayer/player.swf”} );} ); </script>The manual states:Note{literal}{/literal} tags are normally not necessary, as Smartyignores delimiters that are surrounded by whitespace. Be sure yourjavascript and CSS c

  • JochenJung
    include smarty block smarty3
    I have some templates written with Smarty 3:A layout page An index page An include pagelayout.tpl:{block “css”}{/block} {block “js”}{/block} {block “content”}{/block}index.tpl:{extends “layout.tpl”} {block “content”} content text {include “include.tpl”} {/block}include.tpl{block “js” append} include some extra js files for this included content {/block} include textBut I got a compiler exception:Fatal error: Uncaught exception ‘SmartyCompilerException’ with message ‘Syntax Error in template inc

  • lukaswilkeer
    smarty3
    What’s this? Does any error in the configuration file? Following is the full error.Fatal error: Uncaught exception ‘SmartyException’ with message ‘Unableto load template file ‘index.tpl” in/var/www/stoke/libs/sysplugins/smarty_internal_templatebase.php:127Stack trace: #0/var/www/stoke/libs/sysplugins/smarty_internal_templatebase.php(374):Smarty_Internal_TemplateBase->fetch(‘index.tpl’, NULL, NULL, NULL,true) #1 /var/www/stoke/index.php(41):Smarty_Internal_TemplateBase->display(‘index.tpl’) #2 {

  • Rajat
    php smarty smarty3
    My file structure:–header.php –smarty–templates– x.tpl–cache–configs–templates_c –articles– testPage.phpCode in header.php$smarty = new Smarty();$smarty->setTemplateDir(‘smarty/templates’); $smarty->setCompileDir(‘smarty/templates_c’); $smarty->setCacheDir(‘smarty/cache’); $smarty->setConfigDir(‘smarty/configs’);Code in testPage.php<?phpinclude(‘../header.php’);$smarty->display(‘x.tpl’); ?>I am hitting this error:PHP Fatal error: Uncaught exception ‘SmartyException

  • user861587
    php smarty echo combine smarty3
    Why doesn’t this work in Smarty?{my_function($test.’a1′)}It’s showing following error: Fatal error: Uncaught exception ‘SmartyCompilerException’ with message ‘Syntax Error in template “test.tpl” on line 1 “{my_function($test.’a1’)}” Unexpected “‘a1′”, expected one of: “{” , “$” , “identifier” , INTEGER’ in…

Web site is in building

I discovery a place to host code、demo、 blog and websites.
Site access is fast but not money