Previous Thread
Next Thread
Print Thread
Rate Thread
#208186 02/08/2001 3:48 PM
Joined: Jan 2001
Posts: 32
User
User
Offline
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


Sponsored Links
Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
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
Offline
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



Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)