Displaying the date of the article end

Use GitHub to post feature requests for phpwcms.
Bunny
Posts: 9
Joined: Sat 14. Oct 2006, 19:22

Displaying the date of the article end

Post 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!
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

Hi Bunny,

search for {WAK_ARTICLE_CREATED} ;-)
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
Bunny
Posts: 9
Joined: Sat 14. Oct 2006, 19:22

Post 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.
lupo
Posts: 10
Joined: Mon 5. Dec 2005, 12:26
Location: Brugg, Switzerland

Post 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).
Bunny
Posts: 9
Joined: Sat 14. Oct 2006, 19:22

Post 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!
Bunny
Posts: 9
Joined: Sat 14. Oct 2006, 19:22

Post 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?
lupo
Posts: 10
Joined: Mon 5. Dec 2005, 12:26
Location: Brugg, Switzerland

Post 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
Bunny
Posts: 9
Joined: Sat 14. Oct 2006, 19:22

Post by Bunny »

@ Lupo:

Thanks, that would be very nice!
lupo
Posts: 10
Joined: Mon 5. Dec 2005, 12:26
Location: Brugg, Switzerland

Post 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 :oops:

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
Bunny
Posts: 9
Joined: Sat 14. Oct 2006, 19:22

Post by Bunny »

Thanks for your efforts, Lupo, but unfortunately it doesn't work. The complete article displays only the replacement tag.
Bunny
Posts: 9
Joined: Sat 14. Oct 2006, 19:22

Post 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?
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post 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
lupo
Posts: 10
Joined: Mon 5. Dec 2005, 12:26
Location: Brugg, Switzerland

Post 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
Bunny
Posts: 9
Joined: Sat 14. Oct 2006, 19:22

Post 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!
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post 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! :roll:
Locked