示例#1
0
function printNews($num)
{
    $db = new DB();
    $db->query("SELECT `author`, `title`, `body` FROM `news` ORDER BY `time` DESC LIMIT {$num};");
    while ($row = $db->fetchRow()) {
        print '<p class="news"><span class="bold">' . $row[1] . '</span></p>' . "\r\n";
        print '<p class="small indent">By ' . uidToUsername($row[0]) . '</p>' . "\r\n";
        print '<p>' . $row[2] . '</p>';
        print "\r\n";
    }
    $db->close();
}
示例#2
0
 function populateXML()
 {
     if ($this->loaded == 1) {
         $toapply = $this->getDiffs();
         for ($i = 0; $i < count($toapply); $i++) {
             print '<diff id="' . $toapply[$i]->did . '">' . "\r\n";
             print "\t" . '<comment>' . $toapply[$i]->comment . '</comment>' . "\r\n";
             print "\t" . '<user>' . uidToUsername($toapply[$i]->uid) . '</user>' . "\r\n";
             print "\t" . '<toreplace><![CDATA[' . $toapply[$i]->toreplace . ']]></toreplace>' . "\r\n";
             print "\t" . '<replacewith><![CDATA[' . $toapply[$i]->replacewith . ']]></replacewith>' . "\r\n";
             print '</diff>' . "\r\n";
         }
     }
 }