Keyword

default "Finish Publishing" date

More
13 years 8 months ago #93010 by ZS
Hey guys,

 

Do you know where / how to set the default "Finish Publishing" date for K2 items? It is "Never" by default.

 

What I am interested in is how to set the default "Finish Publishing" date to stop publishing 1 month after the item was created / published.

 

I found this piece of code in components/com_k2/views/item/view.html.php I think this might be related somehow :-O

 

if (JHTML::_('date', $item->publish_down, '%Y') <= 1969 || $item->publish_down == $db->getNullDate()) {            $item->publish_down = JText::_('Never');        } else {            $item->publish_down = JHTML::_('date', $item->publish_down, '%Y-%m-%d %H:%M:%S');        }

 

I appreciate any help!

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #93011 by ZS
Replied by ZS on topic default "Finish Publishing" date
Thank you very much for the warning!

Fortunately that's not a problem since this is a simple advertising-sellyourstuff site, most advertisements will be long expired by the end of the 30 days and it is highly unlikely that some of the advertisers will link to their ads.

 

Kevin said:

I am not able to answer your question, but what I am writing to warn you about is that if you set a finish date, it will then go unpublished, meaning any links to it will be 404's. It is a tough choice, and visitors are not always smart enough to just change the address bar to get to the main domain since they had an interest in the site.

 

I have items that basically expire, so I was going to do a finish date, but then all the links of those index'd by Google will be 404's.

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #93012 by Jiliko.net
Replied by Jiliko.net on topic default "Finish Publishing" date
Hi Zoltan,

 

In attachment the item template overriding file to place here :

 

'administrator/templates/YOURJOOMLAADMINTEMPLATE/html/com_k2/item/' (Default admin template is 'khepri'. Create folders if necessary)

 

This will set the publish down date to date + 1 month for each NEW item.

 

Olivier

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #93013 by ZS
Replied by ZS on topic default "Finish Publishing" date
Thank you so much! However before I try this I should say that it's really the items created on the front-end that should have this Finish Publishing date stuff. I'm very sorry I didn't make this clear the first time, I thought that the front-end editing function is the same as the back-end editing function and that it is just called when creating on the front-end.

 

Or was I right? Will the items created on the front-end have a Finish Publishing date of 1 month too?

 

Thank you very much!

 

Olivier Nolbert said:

Hi Zoltan,

 

In attachment the item template overriding file to place here :

 

'administrator/templates/YOURJOOMLAADMINTEMPLATE/html/com_k2/item/' (Default admin template is 'khepri'. Create folders if necessary)

 

This will set the publish down date to date + 1 month for each NEW item.

 

Olivier

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #93014 by Jiliko.net
Replied by Jiliko.net on topic default "Finish Publishing" date
Zoltan,

 

The frontend form comes from another template which is in frontend directory.

 

So, in attachment, the new overriding file you have to place here :

 

'templates/YOURJOOMLATEMPLATE/html/com_k2/item/'

 

Olivier

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #93015 by ZS
Replied by ZS on topic default "Finish Publishing" date
Thank you so very much! It works like a charm.

Olivier Nolbert said:
Zoltan,

 

The frontend form comes from another template which is in frontend directory.

 

So, in attachment, the new overriding file you have to place here :

 

'templates/YOURJOOMLATEMPLATE/html/com_k2/item/'

 

Olivier

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #93016 by Jiliko.net
Replied by Jiliko.net on topic default "Finish Publishing" date
You're welcome,

 

you can edit the file and change the new date process on top of file (line #18) if needed. Just check the mktime() function process here : php.net/manual/en/function.mktime.php

 

Olivier
Zoltan Matok said:

Thank you so very much! It works like a charm.
Olivier Nolbert said:
Zoltan,

 

The frontend form comes from another template which is in frontend directory.

 

So, in attachment, the new overriding file you have to place here :

 

'templates/YOURJOOMLATEMPLATE/html/com_k2/item/'

 

Olivier

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #93017 by ZS
Replied by ZS on topic default "Finish Publishing" date
Thank you!!

Olivier Nolbert said:
You're welcome,

 

you can edit the file and change the new date process on top of file (line #18) if needed. Just check the mktime() function process here : php.net/manual/en/function.mktime.php

 

Olivier Zoltan Matok said:

Thank you so very much! It works like a charm. Olivier Nolbert said:
Zoltan,

 

The frontend form comes from another template which is in frontend directory.

 

So, in attachment, the new overriding file you have to place here :

 

'templates/YOURJOOMLATEMPLATE/html/com_k2/item/'

 

Olivier

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum