Good evening.
Being new to N-13 News and limited in my PHP includes, I'm having difficulty integrating N-13 News code/PHP includes into one of my templates. Below is a graphical example of what I wish to accomplish:
The issue I'm having is the line break between the month and the day. I don't know how to put it into the template. But I just can't figure out how to do this. BTW, I'm not having a problem with the general HTML/CSS. I can do that.
Any help would be appreciated.
Duane
Admin > Options > Settings > News > Date & time format for news
:, change it to something like this %h<br />%d
Alternatively you can specify the time format when including your news like so
<?php
$newstimeformat = '%h<br />%d';
include 'news/index.php';
?>
Thanks, Chris. I think I will need to be more complete in my explanation of my confusion. Here's what I want the full headline area to look like:
Here's the news area of my "Headline" template:
<div class="headlines">
<div class="hldates">
</div>
<div class="hlcontent">
<a href="fullstory.php?id{id}" title="{title}">{title}</a><br />
{summary}<br />
</div>
</div>
The "hldates" div will float left.
Here's my include for the webpage:
<?php
$template = 'Headlines';
include 'news/index.php';
?>
It seems to me that I can't just simply format the newstimeformat. I'm sorry that I'm so confused by this. It will click in soon I'm sure.
Thanks for your help.
Duane
Have you tried this?
<?php
$template = 'Headlines';
$newstimeformat = '%h<br />%d';
include 'news/index.php';
?>
Thanks, Chris, for working me through the process. I needed to add {date} to the template. I now see how it works. My apologies for my slowness,
Hi, Chris.
Would you clarify the $newstimeformat? You wrote the following:
$newstimeformat = '%h<br />%d';
When I check the PHP.net site, I understand the "h" to be "hour." Is there a better explanation somewhere? I would like to play with the different formats but have gotten various results based on the php.net site.
Have a look here - http://uk3.php.net/strftime
The way the news system formats your date/time is as follows.
By default the date is formatted depending on your system setting: Options
> System
> News
> Date & time format for news:
, which by default looks something like this %d/%m/%y %I:%M%p
. If you look to the right of that input box you'll see a link called Date() which points to the above URL - http://uk3.php.net/strftime
If you don't specify the $newstimeformat
when you include your news into your site, then the system setting is used.
Using the $newstimeformat
variable when including your news, allows you to override the system default setting. This allows you to use different date/time formats with different templates.