includes/pageprocess.php
changeset 301 13f5f7d0cd64
parent 294 444c34a3886b
child 318 eec2dfd2f0a3
equal deleted inserted replaced
300:614f6ff1a855 301:13f5f7d0cd64
  1301     header('HTTP/1.1 404 Not Found');
  1301     header('HTTP/1.1 404 Not Found');
  1302     
  1302     
  1303     $this->header();
  1303     $this->header();
  1304     $this->do_breadcrumbs();
  1304     $this->do_breadcrumbs();
  1305     
  1305     
       
  1306     $standard_404 = '';
       
  1307     
  1306     if ( $userpage )
  1308     if ( $userpage )
  1307     {
  1309     {
  1308       echo '<h3>There is no page with this title yet.</h3>
  1310       $standard_404 .= '<h3>There is no page with this title yet.</h3>
  1309              <p>This user has not created his or her user page yet.';
  1311              <p>This user has not created his or her user page yet.';
  1310     }
  1312     }
  1311     else
  1313     else
  1312     {
  1314     {
  1313       echo '<h3>There is no page with this title yet.</h3>
  1315       $standard_404 .= '<h3>There is no page with this title yet.</h3>
  1314              <p>You have requested a page that doesn\'t exist yet.';
  1316              <p>You have requested a page that doesn\'t exist yet.';
  1315     }
  1317     }
  1316     if ( $session->get_permissions('create_page') )
  1318     if ( $session->get_permissions('create_page') )
  1317     {
  1319     {
  1318       echo ' You can <a href="'.makeUrlNS($this->namespace, $this->page_id, 'do=edit', true).'" onclick="ajaxEditor(); return false;">create this page</a>, or return to the <a href="'.makeUrl(getConfig('main_page')).'">homepage</a>.';
  1320       $standard_404 .= ' You can <a href="'.makeUrlNS($this->namespace, $this->page_id, 'do=edit', true).'" onclick="ajaxEditor(); return false;">create this page</a>, or return to the <a href="'.makeUrl(getConfig('main_page')).'">homepage</a>.';
  1319     }
  1321     }
  1320     else
  1322     else
  1321     {
  1323     {
  1322       echo ' Return to the <a href="'.makeUrl(getConfig('main_page')).'">homepage</a>.</p>';
  1324       $standard_404 .= ' Return to the <a href="'.makeUrl(getConfig('main_page')).'">homepage</a>.</p>';
  1323     }
  1325     }
  1324     if ( $session->get_permissions('history_rollback') )
  1326     if ( $session->get_permissions('history_rollback') )
  1325     {
  1327     {
  1326       $e = $db->sql_query('SELECT * FROM ' . table_prefix . 'logs WHERE action=\'delete\' AND page_id=\'' . $this->page_id . '\' AND namespace=\'' . $this->namespace . '\' ORDER BY time_id DESC;');
  1328       $e = $db->sql_query('SELECT * FROM ' . table_prefix . 'logs WHERE action=\'delete\' AND page_id=\'' . $this->page_id . '\' AND namespace=\'' . $this->namespace . '\' ORDER BY time_id DESC;');
  1327       if ( !$e )
  1329       if ( !$e )
  1329         $db->_die('The deletion log could not be selected.');
  1331         $db->_die('The deletion log could not be selected.');
  1330       }
  1332       }
  1331       if ( $db->numrows() > 0 )
  1333       if ( $db->numrows() > 0 )
  1332       {
  1334       {
  1333         $r = $db->fetchrow();
  1335         $r = $db->fetchrow();
  1334         echo '<p><b>This page was deleted on ' . $r['date_string'] . '.</b> The stated reason was:</p><blockquote>' . $r['edit_summary'] . '</blockquote><p>You can probably <a href="'.makeUrl($paths->page, 'do=rollback&amp;id='.$r['time_id']).'" onclick="ajaxRollback(\''.$r['time_id'].'\'); return false;">roll back</a> the deletion.</p>';
  1336         $standard_404 .= '<p><b>This page was deleted on ' . $r['date_string'] . '.</b> The stated reason was:</p><blockquote>' . $r['edit_summary'] . '</blockquote><p>You can probably <a href="'.makeUrl($paths->page, 'do=rollback&amp;id='.$r['time_id']).'" onclick="ajaxRollback(\''.$r['time_id'].'\'); return false;">roll back</a> the deletion.</p>';
  1335         if ( $session->user_level >= USER_LEVEL_ADMIN )
  1337         if ( $session->user_level >= USER_LEVEL_ADMIN )
  1336         {
  1338         {
  1337           echo '<p>Additional admin options: <a href="' . makeUrl($paths->page, 'do=detag', true) . '" title="Remove any tags on this page">detag page</a></p>';
  1339           $standard_404 .= '<p>Additional admin options: <a href="' . makeUrl($paths->page, 'do=detag', true) . '" title="Remove any tags on this page">detag page</a></p>';
  1338         }
  1340         }
  1339       }
  1341       }
  1340       $db->free_result();
  1342       $db->free_result();
  1341     }
  1343     }
  1342     echo '<p>
  1344     $standard_404 .= '<p>
  1343             HTTP Error: 404 Not Found
  1345             HTTP Error: 404 Not Found
  1344           </p>';
  1346           </p>';
       
  1347           
       
  1348     $msg = ( $pp = $paths->sysmsg('Page_not_found') ) ? RenderMan::render($pp) : '{STANDARD404}';
       
  1349     $parser = $template->makeParserText($msg);
       
  1350     $parser->assign_vars(array(
       
  1351         'STANDARD404' => $standard_404
       
  1352       ));
       
  1353     
       
  1354     $msg = $parser->run();
       
  1355     eval( '?>' . $msg );
       
  1356     
  1345     $this->footer();
  1357     $this->footer();
  1346   }
  1358   }
  1347   
  1359   
  1348   /**
  1360   /**
  1349    * Echoes out breadcrumb data, if appropriate.
  1361    * Echoes out breadcrumb data, if appropriate.