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 15 matches
Smarty Forum Index
Author Message
  Topic: Using CACHE and logged in/logged out states on webpage
lastexile

Replies: 6
Views: 8317

PostForum: General   Posted: Sat Sep 12, 2009 9:15 pm   Subject: Using CACHE and logged in/logged out states on webpage
Ah ha... Yes.. that works for me.

Thanks!

Scott

One way, move the display code:

$smarty->display('header.tpl');
$smarty->caching = 2;
$smarty->cache_lifetime = 7200;
$t ...
  Topic: Using CACHE and logged in/logged out states on webpage
lastexile

Replies: 6
Views: 8317

PostForum: General   Posted: Sat Sep 12, 2009 7:20 pm   Subject: Using CACHE and logged in/logged out states on webpage
Thanks for the reply!

Hmm... still confused. My settings are like this:

$smarty->caching = 2;
$smarty->cache_lifetime = 7200;
$template_cache_id =
if (!$smarty->is_cached('i ...
  Topic: Using CACHE and logged in/logged out states on webpage
lastexile

Replies: 6
Views: 8317

PostForum: General   Posted: Sat Sep 12, 2009 6:25 am   Subject: Using CACHE and logged in/logged out states on webpage
Hi, I have a basic question that you guys should be able to answer pretty well. It's a real world scenario.

Lets say I am using cache and $smarty->force_compile = false;

What happens if the p ...
  Topic: Performance of variables in template files using SECTION
lastexile

Replies: 2
Views: 5463

PostForum: General   Posted: Sat Sep 12, 2009 6:22 am   Subject: Performance of variables in template files using SECTION
Thanks!
  Topic: Performance of variables in template files using SECTION
lastexile

Replies: 2
Views: 5463

PostForum: General   Posted: Fri Sep 11, 2009 6:23 am   Subject: Performance of variables in template files using SECTION
Hi, I was wondering about performance inside templates if I am doing a {section} loop.

In my PHP, I assigned an array to smarty template.

My question is this.

Is it better for me to use {SECT ...
  Topic: Is there something to get total records of mysql query?
lastexile

Replies: 8
Views: 14984

PostForum: General   Posted: Fri Oct 10, 2008 4:47 am   Subject: Is there something to get total records of mysql query?
Awesome!

thanks!

you could cut it down to one line by
$smarty->assign('rating_info_total', mysql_num_rows($handle));
Unless of course you need the variable in your PHP code
  Topic: Dynamic Table Columns
lastexile

Replies: 17
Views: 319987

PostForum: Tips and Tricks   Posted: Sat Sep 27, 2008 5:50 pm   Subject: columns using smarty
Yep that worked for me!

{assign var='cols' value=0}
{section name="outer" loop=$gallerylist}
** LOOP THROUGH MY STUFF ***
{assign var="cols" value=$cols+1}{if $cols eq 2} &l ...
  Topic: Does SMARTY cache mySQL queries? It doesnt seem to on site
lastexile

Replies: 2
Views: 7384

PostForum: General   Posted: Fri Sep 19, 2008 9:32 am   Subject: Does SMARTY cache mySQL queries? It doesnt seem to on site
AHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I think that might be why. Let me do research and check!!

Thanks so much!

You should also have, in your PHP file, something like :


if (!$sma ...
  Topic: Does SMARTY cache mySQL queries? It doesnt seem to on site
lastexile

Replies: 2
Views: 7384

PostForum: General   Posted: Fri Sep 19, 2008 8:26 am   Subject: Does SMARTY cache mySQL queries? It doesnt seem to on site
I am running SMARTY on my site and was using Xdebug to check the speed and performance. I notice it is still doing MySQL queries. Why is that? I have:

$smarty->force_compile = false;
$smarty-&g ...
  Topic: How to loop within a loop (php + SMARTY)
lastexile

Replies: 5
Views: 8903

PostForum: General   Posted: Fri Jun 20, 2008 5:21 pm   Subject: Hey awesome!
Thanks for the example. I'm going to try it tonight!!
  Topic: How to loop within a loop (php + SMARTY)
lastexile

Replies: 5
Views: 8903

PostForum: General   Posted: Fri Jun 20, 2008 10:03 am   Subject: How to loop within a loop (php + SMARTY)
I am a beginner and have a question about loops.

Lets say I have something like this in the database. Imagine one table is Categories and another table is Lists. The result I want to see is this:
...
  Topic: Is there something to get total records of mysql query?
lastexile

Replies: 8
Views: 14984

PostForum: General   Posted: Thu Jan 03, 2008 11:50 pm   Subject: Is there something to get total records of mysql query?
Smarty is only a template language. Cold fusion is a programming language, such as PHP itself. In PHP, there are "simple" ways to get your record count, it is up to you to assign that to Sma ...
  Topic: Is there something to get total records of mysql query?
lastexile

Replies: 8
Views: 14984

PostForum: General   Posted: Thu Jan 03, 2008 7:02 pm   Subject: Is there something to get total records of mysql query?
http://www.devscripts.net/smarty/

http://www.smarty.net/manual/en/language.modifiers.php (shows how to count array elements)

Okay, I'll go and check it out. Thanks..

it's too bad smarty doesn ...
  Topic: Is there something to get total records of mysql query?
lastexile

Replies: 8
Views: 14984

PostForum: General   Posted: Thu Jan 03, 2008 6:16 pm   Subject: Is there something to get total records of mysql query?
You can assign the record count from MYSQL, or count the array items in the template.

Hi, could you provide examples of both?

Thanks!
  Topic: Is there something to get total records of mysql query?
lastexile

Replies: 8
Views: 14984

PostForum: General   Posted: Thu Jan 03, 2008 6:01 pm   Subject: Is there something to get total records of mysql query?
I was wondering if SMARTY provides something for a total record count of a mysql query.

My query in the PHP is

$sql = "SELECT * FROM user_rating WHERE item_id = '".$_GET['item_id'].&q ...
 
Page 1 of 1
All times are GMT
Jump to:  


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