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

times are a-changing (or not...) please help

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
psy
Smarty Rookie


Joined: 02 Jan 2005
Posts: 8

PostPosted: Mon Jan 03, 2005 1:34 am    Post subject: times are a-changing (or not...) please help Reply with quote

Hello

I am having trouble with 2 plugins, ie:

1. time_since: No matter what the data in my dbase is (unless zero), the time since function returns "35" years. I have more info on this problem in the "General" forum (sorry, am new here and posted it in the wrong place).
Code:

        <td>

         {if $dob != "0000-00-00 00:00:00"}
         {time_since from=$dob format="%Y Y|year|years|"}
         {else}
          Unknown
         {/if}


2. html_date_select-adv and smartyvalidate problem: I can retrieve a date field from my mysql dbase (that I've entered via phpmyadmin) and have html_date_select display it correctly. What I cannot do is have the new/updated date written back to the dbase.

tpl code is:

Code:
         <td>
             {* Date of Birth Validation *}
             {* generate the DOB value from dobYear, dobMonth, dobDay *}
             {validate form="horseform" field="dob" criteria="dummyValid" transform="makeDate"}


             {* Drop Down Date of Birth Fields *}
             {html_select_date_adv name="dob" prefix="dob" time=$dob start_year="-30" display_days=true reverse_years=true}

             <input type="hidden" name="dob" value="{$dob}">
        </td>


The field in the dbase is DATETIME format. I tried the mktime feature but either put it in the wrong spot in my php file or it had no effect????

Also, if the date is 0, the date_format function prints it as "November, 1999".

I have researched, rtfm, tried all sorts of things to get this working and am at my wits end.

Please help!
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Jan 03, 2005 8:47 am    Post subject: Reply with quote

time_since and html_select_date_adv are not part of the smarty-distribution.
ask the supplier of these plugins for support.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
psy
Smarty Rookie


Joined: 02 Jan 2005
Posts: 8

PostPosted: Mon Jan 03, 2005 10:33 am    Post subject: Reply with quote

OK I will, thanks

I did have the same problem with html_date_select (ie not adv) if that makes a difference.
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Jan 03, 2005 10:44 am    Post subject: Reply with quote

regarding time_since: the docs in the wiki say it expects the from-attribute as a timestamp (like the results of mktime() or time() ) and not as a DATETIME.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
psy
Smarty Rookie


Joined: 02 Jan 2005
Posts: 8

PostPosted: Mon Jan 03, 2005 12:24 pm    Post subject: Reply with quote

Cheers

Tried that. Now I get -34 years old for any item with a DOB as a TIMESTAMP. hehe

Gotta laugh or I'll pull all my hair out! Looks like I'll have to follow it up with the plugin author. Confused

Psy
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


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