1<?php
2/**
3 * XOOPS PDA for news
4 *
5 * You may not change or alter any portion of this comment or credits
6 * of supporting developers from this source code or any supporting source code
7 * which is considered copyrighted (c) material of the original comment or credit authors.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
13 * @license             GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
14 * @package             core
15 * @since               2.0.0
16 */
17
18include __DIR__ . '/mainfile.php';
19
20header('Content-Type: text/html');
21echo '<html><head><title>' . htmlspecialchars($xoopsConfig['sitename']) . "</title>
22      <meta name='HandheldFriendly' content='True' />
23      <meta name='PalmComputingPlatform' content='True' />
24      </head>
25      <body>";
26
27$sql    = 'SELECT storyid, title FROM ' . $xoopsDB->prefix('stories') . ' WHERE published>0 AND published<' . time() . ' ORDER BY published DESC';
28$result = $xoopsDB->query($sql, 10, 0);
29//TODO Remove this hardcoded string
30if (!$result) {
31    echo 'An error occured';
32} else {
33    echo "<img src='images/logo.gif' alt='" . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES) . "' border='0' /><br>";
34    echo '<h2>' . htmlspecialchars($xoopsConfig['slogan']) . '</h2>';
35    echo '<div>';
36    while (false !== (list($storyid, $title) = $xoopsDB->fetchRow($result))) {
37        echo "<a href='" . XOOPS_URL . "/modules/news/print.php?storyid=$storyid'>" . htmlspecialchars($title) . '</a><br>';
38    }
39    echo '</div>';
40}
41echo '</body></html>';
42