×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
publish_down field
Rob
Navegador Iniciado
Posts: 3
10 años 6 meses antes #44
por Rob
publish_down field Publicado por Rob
Perhaps I have missed it, is there currently a Field Type similar to the "Finish Publishing" on basic Joomla articles?
Por favor, Identificarse o Crear cuenta para unirse a la conversación.
Gordon
Navegador Junior
Posts: 23
10 años 6 meses antes - 10 años 6 meses antes #47
por Gordon
Never doubt that a small group of committed people can change the world. Indeed, it is the only thing that ever has... Margaret Mead
Gordon Wright
Old fart developer
Respuesta de Gordon sobre el tema publish_down field
Just a normal calendar field but you have to code it into your component. Best way is to modify the SQL that delivers the content with a WHERE/AND statement so the result is less than the finishing date.
Joomla Articles (in the front end do it via the content model...
if ((!$user->authorise('core.edit.state', 'com_content')) && (!$user->authorise('core.edit', 'com_content'))) {
// Filter by start and end dates.
$nullDate = $db->quote($db->getNullDate());
$date = JFactory::getDate();
$nowDate = $db->quote($date->toSql());
$query->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')')
->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')');
}
Never doubt that a small group of committed people can change the world. Indeed, it is the only thing that ever has... Margaret Mead
Gordon Wright
Old fart developer
Última Edición: 10 años 6 meses antes por Gordon.
El siguiente usuario dijo gracias: Søren Beck Jensen, Andres Maeso, RIP Graphics
Por favor, Identificarse o Crear cuenta para unirse a la conversación.
Rob
Navegador Iniciado
Posts: 3
10 años 6 meses antes #48
por Rob
Respuesta de Rob sobre el tema publish_down field
Thanks. I'll give it a whirl.
Por favor, Identificarse o Crear cuenta para unirse a la conversación.
Tiempo de carga de la página: 0.047 segundos