Ejemplo n.º 1
0
$quote = new quotes($texts['quotes'], $config['irc']);
$do = $_REQUEST['do'];
$texts = $texts['quotes'];
switch ($do) {
    case 'add':
        $crumbs = "<a href=\"index.php\">home</a> &raquo; <a href=\"index.php?mod=quotes\">quotes</a> &raquo; {$texts['gen']['add']}";
        if (!$quote->quote()) {
            $content = $quote->form_quote();
        }
        break;
    default:
        $quotes = $quote->getQuotes();
        $count = 0;
        $extraButtons = "<a href=\"index.php?mod=quotes&do=add\" title=\"{$texts['gen']['add']}\"><img src=\"images/add.png\" width=\"30\" height=\"30\" alt=\"links\" /></a>";
        if (!empty($quotes)) {
            $quote->rate();
            foreach ($quotes as $key => $val) {
                $count++;
                $postedBy = $quote->getPoster($val['userid']);
                $quoteDate = strftime("%A %d %B %Y", $val['date']);
                if ($quote->checkRating($val['id'])) {
                    $rateForm = $quote->form_rating($val['id'], $count);
                } else {
                    $rateForm = false;
                }
                $content .= "\n\t\t\t\t<div class=\"quote\">\n\t\t\t\t\t<p class=\"postedBy\">\n\t\t\t\t\t{$texts['postedby']} {$postedBy}, {$val['votes']} {$texts['votes']}\n\t\t\t\t\t</p>\n\t\t\t\t\t{$rateForm}\n\t\t\t\t\t<p><b>{$quoteDate}</b></p>\n\t\t\t\t\t<p class=\"quote\">{$val['quote']}</p>\n\t\t\t\t\t<div><div style=\"width: {$val['rating']}%\"></div></div>\n\t\t\t\t</div>\n\t\t\t";
            }
        } else {
            $content = "<p class=\"text\">{$texts['noquotes']}</p>";
        }
}