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 44 matches
Smarty Forum Index
Author Message
  Topic: Sorting Array
clj83

Replies: 4
Views: 8757

PostForum: General   Posted: Wed Apr 02, 2014 9:27 pm   Subject: Sorting Array
Actually, think I have it. Does this look right?

$data = $params['data'];
sort($data);
foreach ($data as $key => $val) {
}
$smarty->assign('sorted', ...
  Topic: Sorting Array
clj83

Replies: 4
Views: 8757

PostForum: General   Posted: Wed Apr 02, 2014 9:25 pm   Subject: Sorting Array
Thanks for your help. I would use sort if I could figure it out, I am a php newbie. I don't suppose you could help me create the sort function?

Thanks
  Topic: Sorting Array
clj83

Replies: 4
Views: 8757

PostForum: General   Posted: Wed Apr 02, 2014 8:47 pm   Subject: Sorting Array
I am creating an array within a template using:

{foreach from=$items item=node}
{if $node->fielddefs.location01.value != ''}{$locations[] = $node->fielddefs. ...
  Topic: Unexpected "@", How to avoid?
clj83

Replies: 4
Views: 5949

PostForum: General   Posted: Thu May 16, 2013 6:26 pm   Subject: Unexpected "@", How to avoid?
Thanks for your suggestions. I have tried all sorts of combinations and nothing seems to work, any other ideas of an approach I could try?
  Topic: Unexpected "@", How to avoid?
clj83

Replies: 4
Views: 5949

PostForum: General   Posted: Sun May 12, 2013 8:42 am   Subject: Unexpected "@", How to avoid?
I am using an XML feed which unfortunately uses the @ symbol within some of the definitions. Here is an example,


SimpleXMLElement Object
(
[@attributes] => Array
 ...
  Topic: Call of unknown method '_compile_source'.
clj83

Replies: 1
Views: 4409

PostForum: General   Posted: Fri Nov 09, 2012 11:09 am   Subject: Call of unknown method '_compile_source'.
Hopefully someone can help me with this. I am using smarty within CMSMS and have something called a User Defined Tag running within my page. This contains the following code:

$db = cmsms()- ...
  Topic: foreachgroup
clj83

Replies: 0
Views: 6525

PostForum: Plugins   Posted: Fri May 04, 2012 10:19 pm   Subject: foreachgroup
Hi,

I found this plugin, http://smarty.incutio.com/?page=foreachgroup, called foreachgroup which I thought could be useful. However, I cannot get it to work.

Has anyone successfully managed to ...
  Topic: Smarty Math Foreach
clj83

Replies: 2
Views: 5925

PostForum: General   Posted: Fri May 04, 2012 2:07 pm   Subject: Thanks
Hi,

Thanks for the reply. Unfortunately I am using CMSMS which currently only uses Smarty2.

I found this plugin, http://smarty.incutio.com/?page=foreachgroup, called foreachgroup which I though ...
  Topic: Smarty Math Foreach
clj83

Replies: 2
Views: 5925

PostForum: General   Posted: Fri May 04, 2012 12:08 pm   Subject: Smarty Math Foreach
Hi,

Not sure if this is possible but what I am trying to do is add some amounts within a foreach loop and create some subtotals. The problem is that I need to create a number of subtotals from with ...
  Topic: Sort By
clj83

Replies: 3
Views: 13980

PostForum: Plugins   Posted: Wed Aug 10, 2011 8:57 pm   Subject: Sort By
Hi,

Thanks for the reply. I don't suppose you would be able to help me figure out how to create a sort using the field 'course_name' from my object using the methods listed in the link you sent?
...
  Topic: Sort By
clj83

Replies: 3
Views: 13980

PostForum: Plugins   Posted: Wed Aug 10, 2011 7:56 pm   Subject: Sort By
Hi,

I am trying to get the following smarty Sort function working.


#
# sorts an array of named arrays by the supplied fields
# code by dholmes at jccc d0t net

function array_sort_by ...
  Topic: Truncate Start Of String
clj83

Replies: 2
Views: 7450

PostForum: General   Posted: Thu Aug 04, 2011 1:38 pm   Subject: Great
Excellent, that works perfectly. Thanks so much for your help.
  Topic: Truncate Start Of String
clj83

Replies: 2
Views: 7450

PostForum: General   Posted: Thu Aug 04, 2011 8:19 am   Subject: Truncate Start Of String
Hi,

Im not sure if this is possible but does anyone know a method to truncate a fixed number of characters off the start of a string. So for example

{$entry->foo|truncate:6:"":true} ...
  Topic: Subtract Two Dates And Show New Date?
clj83

Replies: 6
Views: 18124

PostForum: General   Posted: Fri Nov 19, 2010 11:25 am   Subject: Thanks
Hi,

Thanks for your helps. I got it working now. I just wanted to create a payment date 6 weeks before another variable date. See below.


<!-- payment date check starts here -->
{capture ...
  Topic: Subtract Two Dates And Show New Date?
clj83

Replies: 6
Views: 18124

PostForum: General   Posted: Thu Nov 18, 2010 11:24 pm   Subject: Subtract Two Dates And Show New Date?
Hi,

Thanks for that, I cant quite get it working though. Is this correct,

{$date|"-7 days"|date_format:"%Y-%m-d%"}

Im guessing not as it doesnt work, or any of the other v ...
 
Page 1 of 3 Goto page 1, 2, 3  Next
All times are GMT
Jump to:  


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