Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Search found 82 matches
Smarty Forum Index
Author Message
  Topic: problem with mysql query
jpiercemaine

Replies: 1
Views: 4547

PostForum: General   Posted: Thu Sep 02, 2010 12:23 pm   Subject: mysql query
see your previous post
  Topic: Operand should contain 1 column(s)
jpiercemaine

Replies: 1
Views: 5999

PostForum: General   Posted: Thu Sep 02, 2010 12:21 pm   Subject: mysql query
The query would be quicker if you did a join rather than a subselect:


function GetData($table1,$table2,$table3,$id) {
$sql = "SELECT h.id, h.title, h.head_type, h.head_code, ...
  Topic: Adding up values in a multidimensional array
jpiercemaine

Replies: 5
Views: 8546

PostForum: General   Posted: Tue Aug 24, 2010 7:57 pm   Subject: reply
The following appears to give the correct total:


{foreach from=$obj->mItems item="item"}
{math assign="total" equation="x + y" x=$total|default&# ...
  Topic: Samrty and text area value
jpiercemaine

Replies: 2
Views: 5050

PostForum: General   Posted: Thu Aug 19, 2010 12:28 pm   Subject: hey
If you are printing this out in html you can use the nl2br modifyer to convert all linebreaks to <br />, hope this helps:

example:

{$MyText|nl2br}
  Topic: test if file exists
jpiercemaine

Replies: 8
Views: 12832

PostForum: General   Posted: Thu Aug 19, 2010 12:19 pm   Subject: a
The if statements appear to be nested funny... then again i cant see entire code so.
Your code:

{if $dept eq "Maps"}{else}><a HREF="person_details.php?Id={$ID}&Dept={$dep ...
  Topic: test if file exists
jpiercemaine

Replies: 8
Views: 12832

PostForum: General   Posted: Wed Aug 18, 2010 5:16 pm   Subject: reply
You could use the file_exists modifier to check to see if the file exists, just make sure you use the absolute path ie: _images/test.jpg no leading forward slash:


{if $id|cat:'.jpg'|file ...
  Topic: problem in loop in loop in smarty
jpiercemaine

Replies: 2
Views: 5301

PostForum: General   Posted: Tue Aug 17, 2010 5:37 pm   Subject: reply
Based on your queries you do not have a unique identifier tying the news to the user in your array. I would recommend doing a LEFT JOIN on your sql query to return all news items and the user info wh ...
  Topic: comparing a number with an array item in smarty
jpiercemaine

Replies: 1
Views: 4505

PostForum: General   Posted: Mon Aug 09, 2010 7:50 pm   Subject: loops
You need to assign a name to your section loop and use that when comparing the index or iteration in this case 'allseats':


{section start=1 loop=$seats+1 step=1 name=allseats}
 ...
  Topic: How to separate diffrent data in table?
jpiercemaine

Replies: 1
Views: 4607

PostForum: General   Posted: Tue Jun 29, 2010 4:48 pm   Subject: code
Please provide some code so that you can be assisted. It depends on how your array and loops are setup.
  Topic: Adding a different class name with foreach
jpiercemaine

Replies: 1
Views: 4437

PostForum: General   Posted: Fri Jun 18, 2010 8:52 pm   Subject: a
if you are just going to name them based on the iteration : 1,2,3,4,5,etc...


{* Extra Fields *}
{foreach from=$extrafields item=extras name=myextras}
<tr class="ex ...
  Topic: Subcategory problem
jpiercemaine

Replies: 1
Views: 5159

PostForum: General   Posted: Thu Jun 17, 2010 12:35 pm   Subject: hmmm
Not sure exactly how your code works, but rather than try to include a WHERE clause could you use it in the IF statement?


{if $page_name == 'category' && $id_cat_bg->id_parent|int ...
  Topic: Problem with backround image and css
jpiercemaine

Replies: 1
Views: 5038

PostForum: General   Posted: Mon Jun 14, 2010 12:14 pm   Subject: couple of options
Why not use the style inside the tag just for the background?

TPL:

<div id="contenu" style="background:url({$link->getCatImageLink($category->link_rewri ...
  Topic: how display value from array on tpl
jpiercemaine

Replies: 2
Views: 11517

PostForum: General   Posted: Mon Jun 07, 2010 5:51 pm   Subject: how display value from array on tpl
have you passed (assigned) these values to the template? if so in the template use the foreach loop.

smarty:

{foreach from=$array key=k item=i}
<div id="{$i.user_id ...
  Topic: Align display next to each other?
jpiercemaine

Replies: 2
Views: 5276

PostForum: General   Posted: Mon Jun 07, 2010 5:47 pm   Subject: correct
scuzzy is correct. you want to layout your templates accordingly. If you want a header template, you should also have a footer template. layout your 3 "body" templates in floating div's. ...
  Topic: template questin
jpiercemaine

Replies: 6
Views: 8267

PostForum: General   Posted: Mon Jun 07, 2010 5:39 pm   Subject: hmmm
Okay, so obviously you will need to clean up the fields, where you did not provide them all. This is not tested, and am not sure if this is what you are looking for but...

PHP:

$sql = "SEL ...
 
Page 1 of 6 Goto page 1, 2, 3, 4, 5, 6  Next
All times are GMT
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP