Пример #1
0
     $query = $db->query("SELECT fid FROM pw_forums WHERE allowvisit='' AND f_type!='hidden'");
     while ($rt = $db->fetch_array($query)) {
         $fids .= $extra . "'" . $rt['fid'] . "'";
         $extra = ',';
     }
     $description = "Latest {$Rss_newnum} article of all forums";
     if ($fids) {
         $sql = "WHERE fid IN({$fids}) AND ifcheck=1 AND topped='0' AND postdate>" . pwEscape($timestamp - 604800) . " ORDER BY postdate DESC LIMIT {$Rss_newnum}";
         $forceindex = 'FORCE INDEX (postdate)';
     }
 }
 $channel = array('title' => $db_bbsname, 'link' => $db_bbsurl, 'description' => $description, 'copyright' => "Copyright(C) {$db_bbsname}", 'generator' => "PHPWind Forums by PHPWind Studio", 'lastBuildDate' => date('r'));
 $image = array('url' => "{$imgpath}/{$stylepath}/rss.gif", 'title' => 'PHPWind Board', 'link' => $db_bbsurl, 'description' => $db_bbsname);
 $Rss = new Rss(array('xml' => "1.0", 'rss' => "2.0", 'encoding' => $db_charset));
 $Rss->channel($channel);
 $Rss->image($image);
 if ($sql) {
     $query = $db->query("SELECT t.tid,t.fid,t.subject,t.author,t.postdate,t.anonymous,tm.content FROM pw_threads t {$forceindex} RIGHT JOIN {$pw_tmsgs} tm ON tm.tid=t.tid {$sql}");
     while ($rt = $db->fetch_array($query)) {
         $rt['content'] = substrs(stripWindCode($rt['content']), 300);
         $rt['anonymous'] && ($rt['author'] = $db_anonymousname);
         if ($db_htmifopen) {
             $link = "{$db_bbsurl}/read{$db_dir}tid-{$rt['tid']}{$db_ext}";
         } else {
             $link = "{$db_bbsurl}/read.php?tid={$rt['tid']}";
         }
         $item = array('title' => $rt['subject'], 'description' => $rt['content'], 'link' => $link, 'author' => $rt['author'], 'category' => $forum[$rt['fid']]['name'], 'pubdate' => date('r', $rt['postdate']));
         $Rss->item($item);
     }
 }
 $Rss->generate($cache_path);