"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/class/feed.php" between
wacko.6.1.18.zip and wacko.6.1.19.zip

About: WackoWiki is a multilingual Wiki-engine that supports WYTIWYG-editing, page rights (ACLs), design themes (skins), file upload, email notification and much more.

feed.php  (wacko.6.1.18):feed.php  (wacko.6.1.19)
skipping to change at line 22 skipping to change at line 22
######################################################## ########################################################
*/ */
class Feed class Feed
{ {
// VARIABLES // VARIABLES
public $engine; public $engine;
public $lang; public $lang;
public $charset; public $charset;
public $prefix;
// CONSTRUCTOR // CONSTRUCTOR
function __construct(&$engine) function __construct(&$engine)
{ {
$this->engine = & $engine; $this->engine = & $engine;
$this->lang = $this->engine->db->language; $this->lang = $this->engine->db->language;
$this->engine->set_language($this->lang, true, true); $this->engine->set_language($this->lang, true, true);
$this->charset = $this->engine->get_charset(); $this->charset = $this->engine->get_charset();
$this->prefix = $this->engine->db->table_prefix;
} }
function write_file($name, $body): void function write_file($name, $body): void
{ {
$file_name = Ut::join_path(XML_DIR, $name); $file_name = Ut::join_path(XML_DIR, $name);
@file_put_contents($file_name, $body); @file_put_contents($file_name, $body);
@chmod($file_name, CHMOD_FILE); @chmod($file_name, CHMOD_FILE);
} }
function xml_name($name) function xml_name($name)
skipping to change at line 132 skipping to change at line 134
$this->write_file($name, $xml); $this->write_file($name, $xml);
$this->engine->canonical = false; $this->engine->canonical = false;
} }
function feed($feed_cluster = ''): void function feed($feed_cluster = ''): void
{ {
$limit = 10; $limit = 10;
$name = $this->xml_name('news'); $name = $this->xml_name('news');
$news_cluster = empty($feed_cluster) ? $this->engine->db->news_ cluster : $feed_cluster; $news_cluster = empty($feed_cluster) ? $this->engine->db->news_ cluster : $feed_cluster;
$news_levels = $this->engine->db->news_levels; $news_levels = $this->engine->db->news_levels;
$prefix = $this->engine->db->table_prefix;
$this->engine->canonical = true; $this->engine->canonical = true;
$this->engine->static_feed = true; $this->engine->static_feed = true;
// collect data // collect data
$pages = $this->engine->db->load_all( $pages = $this->engine->db->load_all(
"SELECT p.page_id, p.tag, p.title, p.created, p.body, p.b ody_r, p.comments, p.page_lang " . "SELECT p.page_id, p.tag, p.title, p.created, p.body, p.b ody_r, p.comments, p.page_lang " .
"FROM {$prefix}page p, " . "FROM {$this->prefix}page p, " .
"{$prefix}acl AS a " . "{$this->prefix}acl AS a " .
"WHERE p.page_id = a.page_id " . "WHERE p.page_id = a.page_id " .
"AND a.privilege = 'read' AND a.list = '*' " . "AND a.privilege = 'read' AND a.list = '*' " .
"AND p.comment_on_id = 0 " . "AND p.comment_on_id = 0 " .
"AND p.noindex <> 1 " . "AND p.noindex <> 1 " .
"AND p.deleted <> 1 " . "AND p.deleted <> 1 " .
"AND p.tag REGEXP '^{$news_cluster}{$news_levels} $' " . "AND p.tag REGEXP '^{$news_cluster}{$news_levels} $' " .
"ORDER BY p.created DESC " . "ORDER BY p.created DESC " .
"LIMIT " . (int) $limit); "LIMIT " . (int) $limit);
if ($pages) if ($pages)
skipping to change at line 294 skipping to change at line 295
$xml .= '</rss>'; $xml .= '</rss>';
$this->write_file($name, $xml); $this->write_file($name, $xml);
$this->engine->canonical = false; $this->engine->canonical = false;
$this->engine->static_feed = false; $this->engine->static_feed = false;
} }
// Sitemaps XML file: http://www.sitemaps.org // Sitemaps XML file: http://www.sitemaps.org
function site_map(): void function site_map(): void
{ {
$prefix = $this->engine->db->table_prefix;
// collect data // collect data
$pages = $this->engine->db->load_all( $pages = $this->engine->db->load_all(
"SELECT p.page_id, p.owner_id, p.user_id, p.tag, p.modifi ed, p.page_lang " . "SELECT p.page_id, p.owner_id, p.user_id, p.tag, p.modifi ed, p.page_lang " .
"FROM {$prefix}page p, " . "FROM {$this->prefix}page p, " .
"{$prefix}acl AS a " . "{$this->prefix}acl AS a " .
"WHERE p.page_id = a.page_id " . "WHERE p.page_id = a.page_id " .
"AND a.privilege = 'read' AND a.list = '*' " . "AND a.privilege = 'read' AND a.list = '*' " .
"AND p.comment_on_id = 0 " . "AND p.comment_on_id = 0 " .
"AND p.noindex <> 1 " . "AND p.noindex <> 1 " .
"AND p.deleted <> 1 " . "AND p.deleted <> 1 " .
"ORDER BY p.modified DESC, BINARY p.tag"); "ORDER BY p.modified DESC, BINARY p.tag");
$xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n"; $xml = '<?xml version="1.0" encoding="utf-8"?>' . "\n";
$xml .= $this->engine->db->xml_sitemap_gz $xml .= $this->engine->db->xml_sitemap_gz
? '' ? ''
 End of changes. 6 change blocks. 
7 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)