Foren / Cotonti / General / How do I make pages "created" in future visible for the guests?

staleo
#1 30. Januar 2015, 21:01

Hi folks,

For one of my projects, i create lots of pages on a regular basis. Here's i asked a community on how do I extend BEGIN dates further than 2000, and i appreciate a good help with it. However, I'm now stuck with another issue.

As you can see in the post mentioned above, i dont use PAGEEDIT_FORM_BEGIN. Instead, i input a date in {PHP.pag.page_begin|cot_selectbox_date($this, 'long', 'rpagebegin', '2030', '1900')} and it's all set. Nonetheless, while creating a page, if i set any future date, the page will appear in a list only for the administrators, not for regular users.

Why so? And how do I make those pages "from the future" visible for everyone?

Thank you all in advance.

Добавлено 19 часов спустя:

All right, here's what worked for me. Find a /modules/page/inc/page.list.php, and than turn a string

$where['date'] = "page_begin <= {$sys['now']} AND (page_expire = 0 OR page_expire > {$sys['now']})";

into

$where['date'] = "(page_expire = 0 OR page_expire > {$sys['now']})";

Dieser Beitrag wurde von staleo (am 31. Januar 2015, 16:26, vor 9 Jahre) bearbeitet
Dayver
#2 31. Januar 2015, 21:45

Yes your correct solution. But when updating your cotonti you need again repeat it. better if you do creat mini plugin which is only two file yourminiplug.setup.php and yourminiplug.page.list.query.php and that work on this file and contain Hook page.list.query only one line

$where['date'] = "(page_expire = 0 OR page_expire > {$sys['now']})";

Pavlo Tkachenko aka Dayver