Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 03:04:12 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Date on Anynews Headlines  (Read 1017 times)
aimeeish

Offline Offline

Posts: 28


« on: April 27, 2008, 09:36:03 PM »

I use the Anynews module to display headlines. Currently, I have it set up as this:

News Item

News Item

I would like the anynews headlines to display as this:

$Date: News Item

I modified the include.php file, but my php skills are crap and next to absolutely nothing, so this is what I did:

Added this into the file:
Code:
               $post_date = gmdate(DATE_FORMAT, $post['posted_when']+TIMEZONE);
                $post_time = gmdate(TIME_FORMAT, $post['posted_when']+TIMEZONE);
                $publ_date = date(DATE_FORMAT,$post['published_when']);

Then, I did this:
Code:
$output .= "<p>"$publ_date"<a href=\"" .WB_URL.PAGES_DIRECTORY .$data['link'] .PAGE_EXTENSION ."\">" .$data['title'] ."</a></p>\n";

Not working, blank page. I assume it's my fault, but can someone help me how to do this?
Logged
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6977


WWW
« Reply #1 on: April 28, 2008, 04:52:33 PM »

You forgot to put some dots around you variable $publ_date and the one in front of the = is to much.

Code:
$output = "<p>".$publ_date."<a href=\"" .WB_URL.PAGES_DIRECTORY .$data['link'] .PAGE_EXTENSION ."\">" .$data['title'] ."</a></p>\n";

I think that should work.

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

aimeeish

Offline Offline

Posts: 28


« Reply #2 on: April 28, 2008, 09:33:12 PM »

It works...somewhat. But now the date is showing December 31 1969 no matter what date I set it to. And, it only shows the one news item...checked the script, supposed to show 10 news items.
Logged
allhaas

Offline Offline

Posts: 24


« Reply #3 on: July 17, 2008, 03:41:23 PM »

The solution you can find here:
http://www.websitebaker2.org/forum/index.php/topic,10447.0.html

Greets
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!