1
DaGoN
Problem with XoopsFormDateTime
  • 2007/4/26 8:23

  • DaGoN

  • Just popping in

  • Posts: 3

  • Since: 2007/4/25


Hi to all,
i've make a little form with custom template but element XoopsFormDateTime it doesn't display, while anothers components yes.

My XOOPS version is 2.0.16.

My code (include/form_edit.inc.php):
include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";

$edit_form = new XoopsThemeForm("Edit""edit_form""edit.php");
    
$descrizione = new XoopsFormTextArea("Descrizione""descrizione",$eo_descr,10,100,"desc");
     
$edit_form->addElement($descrizione,true);
     echo 
xoops_getUserTimestamp($eo_ins_date);
    
$data = new XoopsFormDateTime("Data","data"15,/*$eo_ins_date*/);
    
$edit_form->addElement($data,false);
    
$note = new XoopsFormTextArea("Note""note",$eo_note,10,100,"note");
    
$edit_form->addElement($note,true);
    
$edit_form->addElement(new XoopsFormHidden('id'$id));
    
$button_tray = new XoopsFormElementTray(' ' ,' ''button');
    
$button_tray->addElement(new XoopsFormButton('','post',"Modifica",'submit'));
    
$edit_form->addElement($button_tray);


Template:
<div align="center"><font color="#FF0000"><strong>teststrongfont>div>

<
form name="<{$edit_form.name}>" action="<{$edit_form.action}>" method="<{$edit_form.method}>">

<
table cellpadding="0" cellspacing="1" width="98%" border="1" class="outer">
  <
tr>
    <
th align="center" colspan="2"><{$edit_form.title}>td>
  tr>
  <
tr>
    <
td class="head" width="8%"><{$edit_form.elements.descrizione.caption}>:td>
    <
td class="even"><{$edit_form.elements.descrizione.body}>td>
  tr>
  <
tr>
    <
td class="head" width="8%"><{$edit_form.elements.data.caption}>:td>
    <
td class="even"><{$edit_form.elements.data.body}>td>
  tr>
  <
tr>
    <
td class="head" width="8%"><{$edit_form.elements.note.caption}>:td>
    <
td class="even"><{$edit_form.elements.note.body}>td>
  tr>
  <
tr>
    <
td class="head" ><{$edit_form.elements.button.caption}>td>
    <
td class="<{cycle values="even,odd"}>"><{$edit_form.elements.button.body}>td>
  tr>
table>
<
br />
<{
$edit_form.elements.id.body}>
form>
<
div style="margin-right:auto;margin-left:50%;"><input type="submit" value="indietro" onclick="history.go(-1);" />div>


Anyone have some problem?

Thanks in adv,
DaGoN

2
DaGoN
Re: Problem with XoopsFormDateTime
  • 2007/4/28 16:47

  • DaGoN

  • Just popping in

  • Posts: 3

  • Since: 2007/4/25


Now i know because XOOPS is only a CMS toy and it's not a real good CMS.
This is a good reason to looking for another CMS.
No future without support...

Goodbye,
DaGoN

3
DobePhat
Re: Problem with XoopsFormDateTime
  • 2007/4/28 17:39

  • DobePhat

  • Friend of XOOPS

  • Posts: 656

  • Since: 2003/4/15


Its a great CMS.

I just dont understand your question and I think others may not either.

Sorry couldnt be of help.

4
earplane
Re: Problem with XoopsFormDateTime
  • 2007/4/28 17:57

  • earplane

  • Just popping in

  • Posts: 35

  • Since: 2002/10/1


What language are you using?

I used to have problems with the popup calendar not showing, and I traced it down to a faulty language file. But if you're using English that's probably not it.

If you're using a non-English language you may want to try if it works with XOOPS set to English.

5
lesage
Re: Problem with XoopsFormDateTime
  • 2007/10/15 3:05

  • lesage

  • Just popping in

  • Posts: 2

  • Since: 2007/10/10


i have the same problem with XoopsFormDateTime
i can'T get the enter or selected date.
Please when you find some answer let me know.

6
Catzwolf
Re: Problem with XoopsFormDateTime
  • 2007/10/15 10:02

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Quote:

lesage wrote:
i have the same problem with XoopsFormDateTime
i can'T get the enter or selected date.
Please when you find some answer let me know.


Try using 'XoopsFormTextDateSelect' rather than 'XoopsFormDateTime' at the moment, there seems to be an issue somewhere when rendering the form via smarty, it seems ok if you do it the other way.

Working method but not with smarty:

include_once XOOPS_ROOT_PATH '/class/xoopsformloader.php';
        
$edit_form = new XoopsThemeForm"Edit""edit_form""edit.php" );
        
$descrizione = new XoopsFormTextArea"Descrizione""descrizione"$eo_descr10100"desc" );
        
$edit_form->addElement$descrizionetrue );

        
$data = new XoopsFormDateTime"Data""data"150/*$eo_ins_date*/ );
        
$edit_form->addElement$datafalse );

        
$note = new XoopsFormTextArea"Note""note"$eo_note10100"note" );
        
$edit_form->addElement$notetrue );
        
$edit_form->addElement( new XoopsFormHidden'id'$id ) );

        
$button_tray = new XoopsFormElementTray' ' ' ''button' );
        
$button_tray->addElement( new XoopsFormButton'''post'"Modifica"'submit' ) );
        
$edit_form->addElement$button_tray );
        
$edit_form->display();


You could buffer the output and at it to a smarty tag

example:

ob_start();
include_once 
XOOPS_ROOT_PATH '/class/xoopsformloader.php';
$edit_form = new XoopsThemeForm"Edit""edit_form""edit.php" );
$descrizione = new XoopsFormTextArea"Descrizione""descrizione"$eo_descr10100"desc" );
$edit_form->addElement$descrizionetrue );

$data = new XoopsFormDateTime"Data""data"150/*$eo_ins_date*/ );
$edit_form->addElement$datafalse );

$note = new XoopsFormTextArea"Note""note"$eo_note10100"note" );
$edit_form->addElement$notetrue );
$edit_form->addElement( new XoopsFormHidden'id'$id ) );

$button_tray = new XoopsFormElementTray' ' ' ''button' );
$button_tray->addElement( new XoopsFormButton'''post'"Modifica"'submit' ) );
$edit_form->addElement$button_tray );
$edit_form->display();
$output ob_get_contents();
ob_end_clean();
$xoopsTpl->assign'form'$output );


Or you could do it this way:

include_once XOOPS_ROOT_PATH '/class/xoopsformloader.php';
                
$edit_form = new XoopsThemeForm"Edit""edit_form""edit.php" );
                
$descrizione = new XoopsFormTextArea"Descrizione""descrizione"$eo_descr10100"desc" );
                
$edit_form->addElement$descrizionetrue );

                
$data = new XoopsFormDateTime"Data""data"15);
                
$edit_form->addElement$datafalse );

                
$note = new XoopsFormTextArea"Note""note"$eo_note10100"note" );
                
$edit_form->addElement$notetrue );
                
$edit_form->addElement( new XoopsFormHidden'id'$id ) );

                
$button_tray = new XoopsFormElementTray' ' ' ''button' );
                
$button_tray->addElement( new XoopsFormButton'''post'"Modifica"'submit' ) );
                
$edit_form->addElement$button_tray );
                
$edit_form->assign$xoopsTpl );


Remember When working with XoopsFormDateTime it returns an Array with two elements. The first element requires some work to be usable.

$array['date'] and $array['time]

$array['time'] will have to be converted to unixtime format and time added to it

i.e:

$date = strtotime($array['date']) + $array['time];

I will try and find out the reason why the first method does not work as it should.

Catz

Hope this helps.

7
earplane
Re: Problem with XoopsFormDateTime
  • 2007/10/15 12:17

  • earplane

  • Just popping in

  • Posts: 35

  • Since: 2002/10/1


What language are you using? I had a problem with the popup calendar not showing in Norwegian, but it worked OK in English. It turned out that the JSCalendar had a faulty language file.

Try changing your site language, it may not be a XOOPS bug at all

8
Catzwolf
Re: Problem with XoopsFormDateTime
  • 2007/10/15 15:05

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Quote:

earplane wrote:
What language are you using? I had a problem with the popup calendar not showing in Norwegian, but it worked OK in English. It turned out that the JSCalendar had a faulty language file.

Try changing your site language, it may not be a XOOPS bug at all


This was using the default english language and I would have to state it does seem like a bug but I have not fould the reason behind yet.

Login

Who's Online

265 user(s) are online (200 user(s) are browsing Support Forums)


Members: 0


Guests: 265


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits