diff -r 9bcc185dc151 -r 85f91037cd4f includes/pageutils.php --- a/includes/pageutils.php Tue Jan 29 17:29:08 2008 -0500 +++ b/includes/pageutils.php Tue Jan 29 23:15:44 2008 -0500 @@ -89,7 +89,7 @@ } /** - * Basically a frontend to RenderMan::getPage(), with the ability to send valid data for nonexistent pages + * DEPRECATED. Previously returned the full rendered contents of a page. * @param $page the full page id (Namespace:Pagename) * @param $send_headers true if the theme headers should be sent (still dependent on current page settings), false otherwise * @return string @@ -98,226 +98,6 @@ public static function getpage($page, $send_headers = false, $hist_id = false) { die('PageUtils->getpage is deprecated.'); - global $db, $session, $paths, $template, $plugins; // Common objects - ob_start(); - $pid = RenderMan::strToPageID($page); - //die('
'.print_r($pid, true).''); - if(isset($paths->pages[$page]['password']) && strlen($paths->pages[$page]['password']) == 40) - { - password_prompt($page); - } - if(isset($paths->pages[$page])) - { - doStats($pid[0], $pid[1]); - } - if($paths->custom_page || $pid[1] == 'Special') - { - // If we don't have access to the page, get out and quick! - if(!$session->get_permissions('read') && $pid[0] != 'Login' && $pid[0] != 'Register') - { - $template->tpl_strings['PAGE_NAME'] = 'Access denied'; - - if ( $send_headers ) - { - $template->header(); - } - - echo '
$message
"); - } - else - { - echo "$message
"; - } - } - @call_user_func($fname); - } - else if ( !isset( $paths->pages[$page] ) ) - { - ob_start(); - $code = $plugins->setHook('page_not_found'); - foreach ( $code as $cmd ) - { - eval($cmd); - } - $text = ob_get_contents(); - if ( $text != '' ) - { - ob_end_clean(); - return $text; - } - $template->header(); - if($m = $paths->sysmsg('Page_not_found')) - { - eval('?>'.RenderMan::render($m)); - } - else - { - header('HTTP/1.1 404 Not Found'); - echo 'You have requested a page that doesn\'t exist yet.'; - if($session->get_permissions('create_page')) echo ' You can create this page, or return to the homepage.'; - else echo ' Return to the homepage.
'; - if ( $session->get_permissions('history_rollback') ) - { - $e = $db->sql_query('SELECT * FROM ' . table_prefix.'logs WHERE action=\'delete\' AND page_id=\'' . $paths->page_id . '\' AND namespace=\'' . $pid[1] . '\' ORDER BY time_id DESC;'); - if ( !$e ) - { - $db->_die('The deletion log could not be selected.'); - } - if ($db->numrows() > 0 ) - { - $r = $db->fetchrow(); - echo 'This page also appears to have some log entries in the database - it seems that it was deleted on ' . enano_date('d M Y h:i a', intval($r['time_id'])) . '. You can probably roll back the deletion.
'; - } - $db->free_result(); - } - echo '- HTTP Error: 404 Not Found -
'; - } - $template->footer(); - } - else - { - - // If we don't have access to the page, get out and quick! - if(!$session->get_permissions('read')) - { - $template->tpl_strings['PAGE_NAME'] = 'Access denied'; - if($send_headers) $template->header(); - echo ''.htmlspecialchars($message).''); - - if( !$paths->pages[$page]['special'] ) - { - if($send_headers) - { - $template->header(); - } - display_page_headers(); - } - - // This is it, this is what all of Enano has been working up to... - - eval('?>' . $message); - - if( !$paths->pages[$page]['special'] ) - { - display_page_footers(); - if($send_headers) - { - $template->footer(); - } - } - } - } - $ret = ob_get_contents(); - ob_end_clean(); - return $ret; } /**