diff -r b0995e600bde -r 62c594682bf6 plugins/Newsboy.php --- a/plugins/Newsboy.php Mon Mar 30 00:31:33 2009 -0400 +++ b/plugins/Newsboy.php Mon Mar 30 00:32:57 2009 -0400 @@ -1,16 +1,16 @@ perms = $session->fetch_page_acl($this->page_id, $this->namespace); - } - - function send() - { - NewsBoy_namespace_handler($this); + function __construct($a, $b, $c = 0) + { + global $db, $session, $paths, $template, $plugins; // Common objects + + parent::__construct($a, $b, $c); + $this->perms = $session->fetch_page_acl($this->page_id, $this->namespace); + } + + function send() + { + ob_start(); + NewsBoy_namespace_handler($this); + if ( ob_get_contents() == '' ) + { + parent::send(); + } + } } } @@ -913,25 +923,19 @@ { $publ = ( isset($_POST['published']) ) ? 1 : 0; - $result = PageUtils::createpage( (string)$time, 'NewsBoy', $name, $publ ); + $page = new PageProcessor((string)$time, 'NewsBoy'); + $page->create_page($name, $publ); - if ( $result == 'good' ) + if ( $page->update_page($_POST['content'], 'Initial revision', false) ) { - // Set content - $content = RenderMan::preprocess_text($_POST['content'], true); // this also SQL-escapes it - - $q = $db->sql_query('UPDATE '.table_prefix.'page_text SET page_text=\'' . $content . '\' WHERE page_id=\'' . $time . '\' AND namespace=\'NewsBoy\';'); - if ( !$q ) - $db->_die(); - - if ( $result ) - echo '