Hello Rick
I had the same problem to write articles of incidents that happened on a certain date, so I created a new RT called DATE_EVT (date of event) which uses the start date of the article (this is always in the past when I write the article, so I can use it).
The result you can see at
http://www.fwbrugg.ch/wcms/index.php?berichte2005
My articlesummary list template looks like this:
Code: Select all
//-->
[SPACE]<hr>[/SPACE]
<div>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td width="150" valign="bottom">
[IMAGE]<div><a href="{ARTICLELINK}">{IMAGE}</a></div>[/IMAGE]
[CAPTION]<div align="center">{CAPTION}</div>[/CAPTION]
</td>
<td width="10">
<img src="img/leer.gif" border="0" width="20" height="1" alt="">
</td>
<td width="98%" valign="top">
[TITLE]<h5>{DATE_EVT:d. F Y:DE}</h5><h4 style="margin:0 0 5px 0;"><a href="{ARTICLELINK}">{TITLE}</a></h4>[/TITLE]
[SUB]<h3 style="margin:0 0 5px 0;">{SUB}</h3>[/SUB]
[SUMMARY]<p style="margin:0">{SUMMARY}</p>[/SUMMARY]
[MORE]<a href="{ARTICLELINK}">{MORE}</a>[/MORE]
</td>
</tr>
</table>
</div>
I only had to patch the file ...\include\inc_front\front.func.inc.php (see lines with comment xxxxx rle):
function get_actcat_articles_data:
Code: Select all
$data[$row["article_id"]] = array(
"article_id" => $row["article_id"],
"article_cid" => $row["article_cid"],
"article_title" => $row["article_title"],
"article_subtitle" => $row["article_subtitle"],
"article_keyword" => $row["article_keyword"],
"article_summary" => $row["article_summary"],
"article_redirect" => $row["article_redirect"],
"article_date" => $row["article_date"],
"article_begin" => $row["article_begin"], // xxxxx rle patch (added)
"article_username" => $row["article_username"],
"article_sort" => $row["article_sort"],
"article_notitle" => $row["article_notitle"],
"article_created" => $row["article_created"],
"article_image" => unserialize($row["article_image"]),
"article_timeout" => $row["article_cache"],
"article_nosearch" => $row["article_nosearch"],
"article_nositemap" => $row["article_nositemap"],
"article_aliasid" => $row["article_aliasid"],
"article_headerdata"=> $row["article_headerdata"],
"article_morelink" => $row["article_morelink"]
function list_articles_summary:
Code: Select all
... //rendering
$tmpl = $tmpllist[ $article_list[$key]["article_image"]['tmpllist'] ];
$tmpl = render_cnt_template($tmpl, 'TITLE', html_specialchars($article_list[$key]["article_title"]));
$tmpl = render_cnt_template($tmpl, 'SUB', html_specialchars($article_list[$key]["article_subtitle"]));
$tmpl = render_cnt_template($tmpl, 'SUMMARY', $article_list[$key]["article_summary"]);
$tmpl = render_cnt_template($tmpl, 'IMAGE', $thumb_img);
$tmpl = render_cnt_template($tmpl, 'ZOOMIMAGE', $article_list[$key]["article_image"]["poplink"]);
$tmpl = render_cnt_template($tmpl, 'CAPTION', nl2br(html_specialchars($article_list[$key]["article_image"]["caption"])));
$tmpl = render_cnt_template($tmpl, 'ARTICLELINK', $article_link);
$tmpl = render_cnt_template($tmpl, 'EDITOR', $article_list[$key]["article_username"]);
$tmpl = render_cnt_template($tmpl, 'ARTICLEID', $article_list[$key]["article_id"]);
$tmpl = render_cnt_template($tmpl, 'MORE', $template_default["top_readmore_link"]);
$tmpl = render_cnt_template($tmpl, 'BEFORE', '<!--before//-->');
$tmpl = render_cnt_template($tmpl, 'AFTER', '<!--after//-->');
$tmpl = render_cnt_date($tmpl, $article_list[$key]["article_date"]);
$tmpl = render_cnt_date_evt($tmpl, strtotime($article_list[$key]["article_begin"])); // xxxxx rle patch (added)
if($temp_counter) {
and add the following function anywhere:
Code: Select all
function render_cnt_date_evt($text='', $date) { // xxxxx rle patched (function added)
// render date by replacing placeholder tags by value
//$language="EN", $format="Y/m/d", $date_now=0
$text = preg_replace('/\{DATE_EVT:(.*?):(.*)\}/ie', 'international_date_format("$2","$1","'.$date.'")', $text);
$text = preg_replace('/\{DATE_EVT:(.*?)\}/ie', 'date("$1",'.$date.')', $text);
return $text;
}
I hope this is useful for you
Regards, Lupo