[SOLVED] How do I retrieve the selection from {html_select_date}

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
dazu
New Member
New Member
Posts: 7
Joined: Tue Dec 02, 2008 8:14 am
Location: Switzerland

[SOLVED] How do I retrieve the selection from {html_select_date}

Post by dazu »

I'ts driving me crazy:

I have a template with the date selection :


   {$field_descr_date}:
    {html_select_date time=$startdate start_year="-0" end_year="+2" prefix="startdate_"}


So far so good, the date is displayed nicely in my form. However when I process the entries I receive all fields but NOT the date. I simply do not know how the selected date (Day, Month and Year) are passed back. All other fields I find in the params['xxx'], but not the Date  :(
I tired all sorts of variables ($startdate, $startdate_Year etc.)
Can sombody please point me in the right dierection ?

Thanks
Daniel
Last edited by dazu on Sun Feb 15, 2009 10:12 am, edited 1 time in total.
dazu
New Member
New Member
Posts: 7
Joined: Tue Dec 02, 2008 8:14 am
Location: Switzerland

Re: How do I retrieve the selection from {html_select_date}

Post by dazu »

Surely someone must know?  :(
Duketown

Re: How do I retrieve the selection from {html_select_date}

Post by Duketown »

dazu,

Have you checked in the News module action.editarticle.php it contains:

Code: Select all

$postdate = time();
if (isset($params['postdate_Month']))
  {
	$postdate = mktime($params['postdate_Hour'], $params['postdate_Minute'], $params['postdate_Second'], $params['postdate_Month'], $params['postdate_Day'], $params['postdate_Year']);
  }
Hope this helps,

Duketown
dazu
New Member
New Member
Posts: 7
Joined: Tue Dec 02, 2008 8:14 am
Location: Switzerland

Re: How do I retrieve the selection from {html_select_date}

Post by dazu »

Hi Duketown
Thanks. yes I did look at the news module. And I dumped all the params['xxx'] values to see what I get returned. But there are no values for the date (all other fields are there). In the html source the forrm and its fields are correct. If I know that I need to follow up on the params['date_Month'] etc. I hope I can narrow it down. So far I was not sure how I should get the values returned to my module.

I keep looking as soon as I have time again... lost a bit of momentum :-(

Thanks
Daniel
Duketown

Re: How do I retrieve the selection from {html_select_date}

Post by Duketown »

dazu,

According to me, due to the usage of {html_select_date}, automatically _Month, _Day etc are connected as postfix to the prefix as defined by yourself.
So in my example (sorry the example from News) change postdate_ into startdate_ and things should be working.

Duketown
dazu
New Member
New Member
Posts: 7
Joined: Tue Dec 02, 2008 8:14 am
Location: Switzerland

[SOLVED] How do I retrieve the selection from {html_select_date}

Post by dazu »

Its working now. Thanks for all the help. The problem was the following:
I forgot to add the

Code: Select all

$this->smarty->assign('startdateprefix', $id.'startdate_');
in the action.add_adit.php

Not sure why this is required.. I quess I need to study the smarty documentation  :-[
Post Reply

Return to “Developers Discussion”