Пример #1
0
function create_special_feed($db, $type)
{
    require 'CPoem.php';
    $cPoem = new CPoem($db, $_SESSION);
    if ($type == 'newest') {
        $poems = $cPoem->getNewestPoems(10);
        create_rss($poems, 'Uusimmat runot', 'http://www.runosydan.net/rss.php?special=newest');
    }
}
Пример #2
0
}
// Maximum is 100 poems per page. We do not want
// to make whole server lag because of this.
if ($_GET['num_poems'] > 100) {
    $_GET['num_poems'] = 100;
}
echo '<div class="poems">';
echo '<table width="100%">';
echo '<tr><td><h3>' . $_GET['num_poems'] . ' uusinta runoa</h3></td>';
echo '<td>';
echo '<a href="rss.php?special=newest"><img src="graphics/rss.gif" class="rss">';
echo '</a></td></tr></table>';
// Get 50 newest poems
$cPoem = new CPoem($db, $_SESSION);
$cUsers = new CUsers($db, $_SESSION);
$poems = $cPoem->getNewestPoems($_GET['num_poems']);
echo '<table>';
echo '<tr>';
echo '<td><b>Runoilija</b></td>';
echo '<td><b>Runon nimi</b></td>';
echo '<td><b>Lisätty</b></td>';
echo '</tr>';
$poems_per_page = $cPoem->getPoemsPerPage();
foreach ($poems as $poem) {
    echo '<tr>';
    echo '<td>';
    echo '<a href="poet.php?id=' . $poem['user_id'] . '">';
    echo $cUsers->getUsername($poem['user_id']);
    echo '</a>';
    echo '</td>';
    echo '<td><a href="poet.php?id=' . $poem['user_id'];
Пример #3
0
session_start();
require 'general_functions.php';
require 'CPoem.php';
create_site_top();
create_top_menu();
echo '<div class="poems">';
echo '<h3>Runot</h3>';
echo '<table class="title_table">';
echo '<tr><td><h3><a href="newest_poems.php">10 uusinta runoa</a></h3></td>';
echo '<td>';
echo '<a href="rss.php?special=newest"><img src="graphics/rss.gif" class="rss" alt="rss">';
echo '</a></td></tr></table>';
// Get 10 newest poems
$cPoem = new CPoem($db, $_SESSION);
$cUsers = new CUsers($db, $_SESSION);
$poems = $cPoem->getNewestPoems(10);
echo '<table>';
echo '<tr>';
echo '<td><b>Runoilija</b></td>';
echo '<td><b>Runon nimi</b></td>';
echo '<td><b>Lisätty</b></td>';
echo '</tr>';
$poems_per_page = $cPoem->getPoemsPerPage();
foreach ($poems as $poem) {
    echo '<tr>';
    echo '<td>';
    echo '<a href="poet.php?id=' . $poem['user_id'] . '">';
    echo $cUsers->getUsername($poem['user_id']);
    echo '</a>';
    echo '</td>';
    echo '<td><a href="poet.php?id=' . $poem['user_id'];