Only gather year-month-day with {join_date}

larsheldens

New Member
Hello, I want to gather the date, and not de datetime.

I searched on the web and found this, but it doesn't work:
<?php echo date('d-M-Y', strtotime($join_date)); ?>

I will be very happy if someone could help me with this!
 

Mark

Administrator
Staff member
that should work just fine, just make sure you are using a plugin for this and not just pasting it into HTML template.
 

larsheldens

New Member
I want to place {join_date2} at mij 'rankings' page, so what name should I give the plugin file?
The content is

$TMPL['join_date2'] = date('d-M-Y', strtotime($join_date));

Is that right?
 

Mark

Administrator
Staff member
close.

{join_date2} should be {$join_date2}

and you need to ensure $join_date has a value.
 

Mark

Administrator
Staff member
I don't have enough information about what you have done to help you further.
 

Basti

Administrator
Staff member
Here is an existing plugin which does what you want, either use it out of the box or use it to learn and set up your own :)

Few things, you dont need $TMPL['join_date2'] , you can use the existing $TMPL['join_date'] to overwrite it display value
strtotime($join_date) should be strtotime($TMPL['join_date'])

As seen in the plugin files ( one for stats, one for rankings )
 

Attachments

Top