Results 1 to 5 of 5

Thread: Problem with memberlist with showing birthday

  1. #1
    New user
    Join Date
    09-28-10.
    Posts
    8

    Default Problem with memberlist with showing birthday

    Hi,

    I'm using memberlist - but having a problem with showing the birthday. In the template my code is:

    Code:
    <?php echo $col['raw']['dateOfBirth']; ?>
    Right now it's showing 10 numbers, which don't make sense to me at all! Like my birthday is the 21th april 1992. My input is DD.MM.YYYY (the same as I wan't my output to be) and it's gives me 703814400. I tried to change it with strtotime - but with no luck!

    Please help me guys!

  2. #2
    Community-Moderator xchs's Avatar
    Join Date
    06-20-09.
    Posts
    1,284

    Default Re: Problem with memberlist with showing birthday

    Add <?php $this->showTemplateVars(); ?> at the begin of the respective template to output all available template variables. Perhaps there you find another variable with an already parsed time string.
    Contao Community Moderator
    → Support options

  3. #3
    New user
    Join Date
    09-28-10.
    Posts
    8

    Default Re: Problem with memberlist with showing birthday

    Not quite. The information I receive is:

    Code:
        [id] => 63
        [pid] => 3
        [tstamp] => 1307607071
        [name] => Member - list
        [headline] => 
        [type] => memberlist
        [levelOffset] => 0
        [showLevel] => 0
        [hardLimit] => 
        [showProtected] => 
        [defineRoot] => 
        [rootPage] => 0
        [navigationTpl] => 
        [pages] => 
        [includeRoot] => 
        [showHidden] => 
        [customLabel] => 
        [autologin] => 
        [jumpTo] => 0
        [redirectBack] => 
        [cols] => 2cl
        [editable] => 
        [memberTpl] => 
        [tableless] => 
        [form] => 0
        [searchType] => simple
        [fuzzy] => 
        [contextLength] => 48
        [totalLength] => 1000
        [perPage] => 0
        [queryType] => and
        [searchTpl] => 
        [inColumn] => main
        [skipFirst] => 0
        [loadFirst] => 
        [size] => 
        [transparent] => 
        [flashvars] => 
        [altContent] => 
        [source] => internal
        [singleSRC] => 
        [url] => medarbejdere.html
        [interactive] => 
        [flashID] => 
        [flashJS] => 
        [imgSize] => 
        [useCaption] => 
        [fullsize] => 
        [multiSRC] => 
        [html] => 
        [protected] => 
        [groups] => 
        [guests] => 
        [cssID] => 
        [space] => Array
            (
                [0] => 
                [1] => 
            )
    
        [cal_calendar] => 
        [cal_noSpan] => 
        [cal_format] => cal_month
        [cal_order] => ascending
        [cal_limit] => 0
        [cal_template] => event_full
        [cal_ctemplate] => cal_default
        [cal_startDay] => 0
        [cal_showQuantity] => 
        [com_order] => ascending
        [com_moderate] => 
        [com_bbcode] => 
        [com_requireLogin] => 
        [com_disableCaptcha] => 
        [com_template] => com_default
        [faq_categories] => 
        [list_table] => 
        [list_fields] => 
        [list_where] => 
        [list_sort] => 
        [list_search] => 
        [list_info] => 
        [list_info_where] => 
        [list_layout] => list_default
        [list_info_layout] => info_default
        [news_archives] => 
        [news_featured] => all_items
        [news_numberOfItems] => 3
        [news_jumpToCurrent] => 
        [news_metaFields] => a:2:{i:0;s:4:"date";i:1;s:6:"author";}
        [news_template] => news_latest
        [news_format] => news_month
        [news_startDay] => 0
        [news_order] => descending
        [news_showQuantity] => 
        [newsletters] => 
        [nl_channels] => 
        [nl_hideChannels] => 
        [nl_subscribe] => 
        [nl_unsubscribe] => 
        [nl_template] => nl_simple
        [nl_includeCss] => 
        [disableCaptcha] => 
        [reg_groups] => 
        [reg_allowLogin] => 
        [reg_skipName] => 
        [reg_assignDir] => 
        [reg_close] => 
        [reg_homeDir] => 
        [reg_activate] => 
        [reg_jumpTo] => 0
        [reg_text] => 
        [reg_password] => 
        [rss_cache] => 3600
        [rss_feed] => 
        [rss_numberOfItems] => 3
        [rss_template] => rss_default
        [list_formdata] => 
        [efg_list_access] => 
        [efg_fe_edit_access] => 
        [efg_fe_delete_access] => 
        [efg_fe_export_access] => 
        [efg_fe_keep_id] => 
        [efg_iconfolder] => 
        [efg_DetailsKey] => 
        [efg_list_searchtype] => 
        [efg_com_allow_comments] => 
        [efg_com_notify] => notify_admin
        [efg_com_per_page] => 0
        [custommenu_defineRoots] => 
        [custommenu_roots] => 
        [custommenu_useChildren] => 
        [ml_groups] => a:1:{i:0;s:1:"4";}
        [ml_fields] => a:10:{i:0;s:9:"firstname";i:1;s:8:"lastname";i:2;s:11:"dateOfBirth";i:3;s:6:"street";i:4;s:6:"postal";i:5;s:4:"city";i:6;s:5:"phone";i:7;s:6:"mobile";i:8;s:5:"email";i:9;s:8:"username";}
        [lb_displaymode] => 
        [lb_memberlist] => 0
        [lb_showprofilelink] => 
        [lb_template] => 
        [sc_type] => 
        [sc_modules] => 
        [sc_gap] => 
        [sc_gapdefault] => 1
        [sc_equalize] => 
        [typePrefix] => ce_
        [hl] => h1
        [search_fields] =>
    As you can see, it looks like the third line?

  4. #4
    Community-Moderator xchs's Avatar
    Join Date
    06-20-09.
    Posts
    1,284

    Default Re: Problem with memberlist with showing birthday

    Not sure, but I think you have added

    Code:
    <?php $this->showTemplateVars(); ?>
    into the wrong template. I guess "member_default.*" or "member_grouped.*" are the right templates for this.

    Anyway, how looks your current setting for the date and time format (see the "System settings" or the settings in the page "Website root")? There must be a valid date and time format:
    Contao supports all date and time formats that can be parsed with the PHP date() function. However, to ensure that any input can be transformed into a UNIX timestamp, you can only use numeric date and time formats (j, d, m, n, y, Y, g, G, h, H, i, s) in the back end.
    Either way, to parse a certain Unix timestamp you can always add something like this in your template (or what fits best):

    Code:
    <?php echo $this->parseDate($GLOBALS['TL_CONFIG']['dateFormat'], $col['raw']['dateOfBirth']); ?>
    Contao Community Moderator
    → Support options

  5. #5
    New user
    Join Date
    09-28-10.
    Posts
    8

    Default Re: Problem with memberlist with showing birthday

    Thank you xchs! You fixed my problem :D

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •