Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Search found 69 matches
Smarty Forum Index
Author Message
  Topic: Specific place in loop
Pap

Replies: 1
Views: 2279

PostForum: General   Posted: Sun Jan 21, 2007 5:37 pm   Subject: Specific place in loop
You could read the manual on section loops, to start with:
http://smarty.php.net/manual/en/language.function.section.php
  Topic: [resolved] Check if variable is numeric
Pap

Replies: 4
Views: 19854

PostForum: General   Posted: Thu Jan 18, 2007 7:44 pm   Subject: [resolved] Check if variable is numeric
{if is_numeric($smartyVar)}

Any PHP function would work.
  Topic: Foreach inside a foreach..
Pap

Replies: 3
Views: 3848

PostForum: General   Posted: Thu Jan 18, 2007 4:48 pm   Subject: Foreach inside a foreach..
Do these not help?
http://www.phpinsider.com/smarty-forum/viewtopic.php?p=38428#38428
http://www.phpinsider.com/smarty-forum/viewtopic.php?p=38485#38485
  Topic: Accessing assigned array in PHP tags
Pap

Replies: 4
Views: 4386

PostForum: General   Posted: Wed Jan 17, 2007 2:15 am   Subject: Accessing assigned array in PHP tags
The tags put you into PHP. You do whatever you want with it that you want to, using normal PHP code.
  Topic: [resolved] Section inside a section
Pap

Replies: 3
Views: 4729

PostForum: General   Posted: Tue Jan 16, 2007 5:58 pm   Subject: [resolved] Section inside a section
So you only want to list the days that have events in them? All of this code is untested.


$first_day = date('Y-n-d', mktime() + (3600 * $tz));
$last_day = date('Y-n- ...
  Topic: Two associated queries
Pap

Replies: 3
Views: 4639

PostForum: General   Posted: Sun Jan 14, 2007 11:01 pm   Subject: Two associated queries
I bet the problem you were having was with the query itself...

$sql = 'SELECT categories.id AS cat_id, sub_categories.id AS sub_id, category_name, sub_name FROM categories INNER JOIN sub_categories ...
  Topic: unset session array element
Pap

Replies: 1
Views: 3687

PostForum: General   Posted: Sun Jan 14, 2007 9:33 pm   Subject: unset session array element
You shouldn't, and you can't, unless you escape into {php}{/php} tags.
  Topic: Two associated queries
Pap

Replies: 3
Views: 4639

PostForum: General   Posted: Sun Jan 14, 2007 3:23 am   Subject: Two associated queries
All code untested, so please mind any typos.

$sql = 'SELECT * FROM categories INNER JOIN sub_categories ON (categories.id = sub_categories.cat_id)';

$result = mysql_query($sql); ...
  Topic: Graceful Error Handling (i.e. when missing plugins)
Pap

Replies: 2
Views: 3242

PostForum: General   Posted: Thu Jan 11, 2007 6:48 am   Subject: Graceful Error Handling (i.e. when missing plugins)
About your first post:

http://smarty.php.net/manual/en/variable.error.reporting.php

You can also pre-register anything you want:
http://smarty.php.net/manual/en/api.register.function.php


...
  Topic: Smarty caching
Pap

Replies: 6
Views: 5941

PostForum: General   Posted: Fri Jan 05, 2007 4:27 pm   Subject: Smarty caching
could you verify that the pages are being written to your /cache/ directory for us?
  Topic: Smarty equivalent for PHP code
Pap

Replies: 4
Views: 4932

PostForum: General   Posted: Thu Jan 04, 2007 8:44 pm   Subject: Smarty equivalent for PHP code
Is $totalPagini an array, like the "from=" value is expecting?

If it's just an integer value, then I think you need to stick with the section loop.
  Topic: Smarty equivalent for PHP code
Pap

Replies: 4
Views: 4932

PostForum: General   Posted: Tue Jan 02, 2007 11:26 pm   Subject: Smarty equivalent for PHP code
Probably this (untested):

{section loop=$totalPagini name='page'}
{if $page == $smarty.section.page.iteration}
<strong> {$smarty.section.page.iteration} &l ...
  Topic: Can this make smarty faster?
Pap

Replies: 9
Views: 8016

PostForum: General   Posted: Sun Dec 31, 2006 8:20 pm   Subject: Can this make smarty faster?
I suggest you use this:
http://php.net/manual/en/ref.apc.php

It will keep your most commonly requested PHP files cached in memory in bytecode format. Compiling to bytecode automatically removes c ...
  Topic: {HTML_TABLE} Array Trouble
Pap

Replies: 2
Views: 3434

PostForum: General   Posted: Fri Dec 22, 2006 5:59 am   Subject: {HTML_TABLE} Array Trouble
I don't think {html_table} supports multi-dimensional arrays.
  Topic: Quick question!
Pap

Replies: 1
Views: 2587

PostForum: General   Posted: Thu Dec 21, 2006 6:54 pm   Subject: Quick question!
This is indeed the wrong forum to ask.

but...

echo date('c', strtotime('-1 day', strtotime('2006-12-21 17:54:09')));

You'll need to lookup the date function in php and change 'c' to the exact ...
 
Page 1 of 5 Goto page 1, 2, 3, 4, 5  Next
All times are GMT
Jump to:  


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