view the scheduled post

Post Reply
viriisxp
Sr. Bludit
Posts: 32
Joined: Sat Jul 02, 2016 6:01 pm

Wed Sep 19, 2018 6:37 pm

Hi, i know it's a singular request but .

i have this :

Code: Select all


$categoryKey = 'actualites';
$category = getCategory($categoryKey);

foreach ($category->pages() as $pageKey) {

	$page = buildPage($pageKey);

	// On récupère la date de l'évènement puis on découpe jour/mois et année
	$chaine = $page->date();
	echo '<li>';

		echo	'<div class="datebox">';
			echo '<div class="date">';
				echo '<div id="daymonth">'.substr($chaine, 0, 2).' '.substr($chaine, 3, 4).'.</div>';
				echo '<div id="year">'.substr($chaine,-4,4).'</div>';
			echo '</div>';
		echo '</div>';
		echo $page->status();
		echo '<a href="'.$page->permalink().'" class="title-link" title='.$page->title().'>'.$page->title().'</a>';

echo '</li>';

But I would like to have the list of the published article AND the scheduled article.
How i can do this , please ?

Thx for all
User avatar
diego
Site Admin
Posts: 633
Joined: Sat May 16, 2015 2:53 pm
Contact:

Wed Sep 19, 2018 7:05 pm

Hi,
the code you show us is for print all published pages in a particular category.
I don't understand what you want to do.
Regards
viriisxp
Sr. Bludit
Posts: 32
Joined: Sat Jul 02, 2016 6:01 pm

Wed Sep 19, 2018 7:08 pm

I would like to use the system like a calendar :

if page date is old than the day of today, it's a past event, and it will appear in past event, and if the date is not yet it's possible to see in "futur event".

and only the page in "actualites" (news in french) category only


something like this :

Code: Select all

page : "past event" :
list of all the page with an old date

page : "futur event" :
list of all the page scheduled.
like this , when the event is done, the page are automatically going in old page ;)
viriisxp
Sr. Bludit
Posts: 32
Joined: Sat Jul 02, 2016 6:01 pm

Wed Sep 19, 2018 7:34 pm

ok i have it :

Code: Select all

	    // Page number of the paginator, the first page is 1
    $pageNumber = 1;
    // The value -1 tell to Bludit to returns all the pages on the system
    $amountOfItems = -1;
    // Only get the pages with the satus published
    $onlyPublished = false;
    // Get the list of keys of pages
    $pages = $dbPages->getList($pageNumber, $amountOfItems, $onlyPublished);

    foreach ($pages as $pageKey) {
        // buildPage function returns a Page-Object
        $page = buildPage($pageKey);
							if ($page->categorykey() == 'actualites'){
								echo $page->title();
								echo"</br>";
									}
        
    }
thx
Post Reply