|
|
Joined: Jan 2001
Posts: 32
User
|
User
Joined: Jan 2001
Posts: 32 |
Can someone help me with this, probably very simple, newbie hack:
I just want to be able to control the date format of the posted date on the list of news items, and I want it to be 'Monday 5 January 2020' or whatever...so I find these lines:
// --------------------------------- // Set up the variables for echoing $date = $html -> convert_time($Posted);
and I reckong that $posted has come straight from the database and is therefore a 'seoncd since epoch' string. So I just change 'convert_time($Posted)' to 'date('l d F Y', $Posted)', right?
If so, how come I get an error saying undefined function date() in line 1 - it's not line one for a start!
My new copy of w3tnews.php is in the root of my site:
.../html/libdems/oxfordshirelibdems/testhome.php
and my w3t installation is in:
.../html/libdems/oxfordshirelibdems/forums/
and the testhome.php file knows that. If I don't make this change it works, so it's seeing all the paths correctly. I can't understand where I am going wrong.
Jock
|
|
|
|
Joined: May 1999
Posts: 3,039
Guru
|
Guru
Joined: May 1999
Posts: 3,039 |
Your updated line should look like this:
$date = date('l d F Y', $Posted);
It sounds like it looks like this (which will not work):
$date = $html -> date('l d F Y', $Posted);
UBB.threads Developer
|
|
|
|
Joined: Jan 2001
Posts: 32
User
|
User
Joined: Jan 2001
Posts: 32 |
Doh! An experienced eye always helps! Thanls Scream. I even understand why it won't work now that you point it out - because it's currently looking for a date() method of the html class, not just a native PHP function!
Anyhow - it works great, and it was quicker to achieve than my Lotus Notes html filled view...:-)
Cheers,
Jock
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 69
Joined: January 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|