have you tried using something like: date(“D M j Y G:i:s”, strtotime(bp_get_the_topic_time())) ?
Converting the string to a timestamp and then reformatting it.
Hi thanks for your reply, I did it like this:
and ended up with:
Parse error: syntax error, unexpected T_STRING in /home/*removed*/public_html/wp-content/plugins/buddypress/bp-themes/bp-default/forums/forums-loop.php on line 66
Then you have an unexpected T_STRING on that line somewhere
It basically means that your syntax is incorrect and you have terminated the line prematurely somewhere with a ‘ or , or ; or not closed the previous line.
Changing this: “ to this “ did not work. Any suggestions
Make sure you’re not using quotations in the date() function.
Try this:
`date(‘D M j Y G:i:s’, strtotime(bp_get_the_topic_time()));`
I replied to a similar thread a while ago; I’ll try to dig it up.
I don’t think there should be any trouble with quotes in this case. See examples on this page, partic. #4 http://php.net/manual/en/function.date.php
Are you still getting the ‘unexpected T_STRING’ message? Are you certain line 66 is your date(…) line?
If Ray’s suggestion / similar thread doesn’t help, it would be a good idea to post a few more lines of your code, so we can see the snippet in context.
There’s a problem with curling quotations (`“`) not (“) because it will give that T_STRING error.
I just tried ` ` again with the proper quotes and now the date disappeared all together. I’m perplexed
You will need to echo the string returned from the function!
thats over my head, can you explain a little more
date() returns a string, it doesn’t display it. You’ll need to use the ‘echo’ statement to display it.
That’s a basic PHP question, not anything BuddyPress specific – Google “php echo”
To work with the templates and significantly modify BuddyPress look and feel, a basic grounding in PHP is a pre-requisite.