Page 1 of 2
Displaying the date of the article end
Posted: Sat 14. Oct 2006, 19:39
by Bunny
Is there a possibility to display the date of the article end (e.g. with the help of a special replacement tag or anything else)?
Thanks for your answers!
Posted: Sat 14. Oct 2006, 19:43
by cyrano
Hi Bunny,
search for {WAK_ARTICLE_CREATED} ;-)
Posted: Sat 14. Oct 2006, 19:51
by Bunny
Hi cyrano,
thanks, but I don't want to display the date of creation of an article, I want the date of ending of an article.
Posted: Sun 15. Oct 2006, 12:43
by lupo
Hello Bunny
I had a similar problem, because I have to sort and display articles by the start date. Because all my articles are about incidents in the past (fire fighter), I misuse the start date as the official article date.
Example:
http://www.fwbrugg.ch/wcms/berichte2006.phtml
May be you want to adapt my solution for your needs:
http://www.phpwcms.de/forum/viewtopic.p ... highlight=
(This source fragments are from 1.2.6)
Regards,
Lupo
BTW: Oliver, it would be great to have official replacement tags for start date and end date of an article or a tag that represents the official article date (which is not the same as the creation date of the article).
Posted: Sun 15. Oct 2006, 16:38
by Bunny
Hi Lupo,
thank you very very much! It works great (for my needs, of course, by replacing "begin" with "end").
I've searched for so many weeks to solve this problem and now I have the solution! Thank you!
Posted: Sun 15. Oct 2006, 18:58
by Bunny
Lupo, your solution works great for the article listing. What do I have to do for using it for the complete article, therefore in order to display the article end in the article listing and in the whole article?
Posted: Mon 16. Oct 2006, 08:29
by lupo
I never tested to insert the date into the article itself (because I don't need that).
Give me some time... It's a long time ago when I modified the code, so I have to go trough the code again.
Lupo
Posted: Mon 16. Oct 2006, 16:03
by Bunny
@ Lupo:
Thanks, that would be very nice!
Posted: Wed 18. Oct 2006, 20:59
by lupo
Hello Bunny
Maybe I have found a solution. It worked in my tests, but I had no a lot of time to test
Add the line with xxxx in content.func.inc.php, about line 468
Code: Select all
// date replacement
if( ! ( strpos($content["all"],'{DATE_')===false ) ) {
$content["all"] = str_replace('{DATE_LONG}', international_date_format($template_default["date"]["language"], $template_default["date"]["long"]), $content["all"]);
$content["all"] = str_replace('{DATE_MEDIUM}', international_date_format($template_default["date"]["language"], $template_default["date"]["medium"]), $content["all"]);
$content["all"] = str_replace('{DATE_SHORT}', international_date_format($template_default["date"]["language"], $template_default["date"]["short"]), $content["all"]);
$content["all"] = str_replace('{DATE_ARTICLE}', international_date_format($template_default["date"]["language"], $template_default["date"]["article"], $content["article_date"]), $content["all"]);
$content["all"] = str_replace('{DATE_EVT}', international_date_format($template_default["date"]["language"], $template_default["date"]["article"], strtotime($content["article_begin"])), $content["all"]); // xxxxx
}
Add the line with xxxx in content.article.inc.php, about line 141
Code: Select all
$content["summary"] = '';
$content["article_date"] = $row["article_date"]; // article date
$content["article_begin"] = $row["article_begin"]; // article begin xxxxx
$content["article_created"] = $row["article_created"]; // article created
My sources are version 1.2.6, and I used "article_begin". --> you have to replace it with "article_end"
I hope that works for you and much thanks to Oliver Georgi for that wonderful system!
Greetings from Switzerland, Lupo
Posted: Thu 19. Oct 2006, 20:44
by Bunny
Thanks for your efforts, Lupo, but unfortunately it doesn't work. The complete article displays only the replacement tag.
Posted: Thu 19. Oct 2006, 21:03
by Bunny
If I leave out the date format and the language from the replacement tag (in my case instead of {DATE_END:D, d. F Y: DE} only {DATE_END}) the date is displayed in the complete article. But it is displayed in the short date format. For my needs it has to be the long format. What can I do to get that?
Posted: Fri 20. Oct 2006, 03:08
by DeXXus
I'm guessing you could "work around it" by changing $template_default["date"]["short"] to -match- $template_default["date"]["long"] in:
"/config/phpwcms/conf.template_default.inc.php"
Code: Select all
// date and time formatting
$template_default["date"]["language"] = "DE"; // DE=German, IT=Italian, FR=French
$template_default["date"]["long"] = "l, j. F Y"; // (Monday, 1. October 2003)
$template_default["date"]["medium"] = "D, j. M y"; // (Mon, 1. Oct 03)
$template_default["date"]["short"] = "Y/m/d"; // (2003/12/25)
$template_default["date"]["article"] = "Y/m/d"; // (2003/12/25)
$template_default["time"]["long"] = "H:i:s"; // 15:25:45
$template_default["time"]["short"] = "H:i"; // 15:25
Posted: Fri 20. Oct 2006, 09:03
by lupo
Hello Bunny
does the name of the replacement tag ("DATE_EVT" in my example) exactly correspond to the name you used in content.func.inc.php? I checked this modification in the article list, the article header and in a content part (text with image) and it worked well.
Regards, Lupo
Posted: Fri 20. Oct 2006, 11:33
by Bunny
Yes, the names correspond exactly.
By the way I had a similar problem with the {WAK_ARTICLE_CREATED} RT for my news section. The creation date of the article is displayed in the article list by using the specification of the article ID {WAK_ARTICLE_CREATED:{ARTICLEID}}, but in the complete article only without the ID. For my news section I need only the short date format, so I didn't have a problem with that.
Well, maybe I have to go the way that DeXXus posted. Thank you all very much for your help!
Posted: Fri 20. Oct 2006, 11:57
by DeXXus
Bunny wrote:Well, maybe I have to go the way that DeXXus posted. Thank you all very much for your help!
It ~may~ be
$template_default["date"]["article"] that you want to experiment with, to tell you the truth, dunno!
