Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Hi again!

As my users were a bit reluctant to share some of their personal data within my site I came up with a way to "obscure" the birthdays they enter within a datetime region. I had the incredible inventive idea ( ;) ) to "hide" the data for the month and day inside the time part while I feed some random values then to the dates. I "decode" then the information on the frontend.

Code: Select all
<cms:set obsc_y="<cms:sub "<cms:date frm_user_birthdate format='Y'/>" '4' />" />
<cms:set obsc_m="<cms:date frm_user_birthdate format='m'/>" />
<cms:set obsc_d="<cms:date frm_user_birthdate format='d'/>" />
<cms:set obsc_g="<cms:php> echo rand(1,9);</cms:php>"/>
<cms:set obsc_i="<cms:php> echo rand(10,30);</cms:php>"/>
<cms:set obsc_s="<cms:php> echo rand(10,60);</cms:php>"/>
<cms:set obsc_birthdate="<cms:show obsc_y/>-0<cms:show obsc_g/>-<cms:show obsc_i/> <cms:show obsc_m/>:<cms:show obsc_d/>:<cms:show obsc_s/>" />


All that works rather fine, unless I change something on the users page within the admin panel (or if I hit simply save there without making changes of course). If I <cms:dump/> the data afterwards, the time part of the variable is empty, or better "00:00:00". Is that a known problem? Can it be fixed? :D
Hi Klaus,

The fudged dates have valid values so I don't see why they should be rejected while saving afresh.

If you wish you may get me access to the site and I'll take a look at the problem first-hand.

Thanks.
2 posts Page 1 of 1