function print_news_feed_page($page_number)
{
    print_news_feed($page_number, 10);
    $n_rows = get_number_news();
    if ($page_number * 10 + 10 < $n_rows) {
        ?>
    <a href="?action=news&subaction=news&page=<?php 
        echo $page_number + 1;
        ?>
">
     <div class="next_page">page <?php 
        echo $page_number + 2;
        ?>
 -&gt;</div>
    </a>
   <?php 
    }
    if ($page_number > 0) {
        ?>
    <a href="?action=news&subaction=news&page=<?php 
        echo $page_number - 1;
        ?>
">
     <div class="prev_page">&lt;- page <?php 
        echo $page_number;
        ?>
</div>
    </a>
   <?php 
    }
}
Esempio n. 2
0
require_once "news/get-news.php";
# trick to execute 1st time, but not 2nd so you don't have an inf loop
if (!isset($TPL)) {
    $TPL = new PageTemplate();
    $TPL->PageTitle = "News & Events";
    $TPL->PageTitleInPage = "NEWS & EVENTS";
    $TPL->ContentBody = __FILE__;
    $TPL->HeaderClass = "dark-blue-subtitle";
    include $_SERVER['DOCUMENT_ROOT'] . '/scouts/page-layout.php';
    exit;
}
if (!isset($_GET['subaction'])) {
    ?>
  <h1>Latest News</h1>
  <?php 
    print_news_feed(0, 4);
    ?>
  <p class="body_paragraph"><a href="?action=news&subaction=news&page=0">View all news</a></p>

  <br>
  <h1>Upcoming Events</h1>
  <div class="latest-news">
    <h3 class="latest-news-title">Item Title</h3> <h5 class="date-time-title">HH:MM dd/mm/yyyy - HH:MM dd/mm/yyyy</h5>
    <p class="body-paragraph">
      Lorem ipsum dolor sit amet, consectetur adipiscing elit.
      Aliquam fringilla fringilla ex, id vestibulum leo convallis ut.
      Aliquam volutpat est in leo fringilla placerat.
    </p>
  </div>
  <div class="latest-news">
    <h3 class="latest-news-title">Item Title</h3> <h5 class="date-time-title">HH:MM-HH:MM dd/mm/yyyy</h5>