1927 @header('HTTP/1.1 404 Not Found'); |
1927 @header('HTTP/1.1 404 Not Found'); |
1928 |
1928 |
1929 $this->header(); |
1929 $this->header(); |
1930 $this->do_breadcrumbs(); |
1930 $this->do_breadcrumbs(); |
1931 |
1931 |
1932 $msg = $paths->sysmsg('Page_not_found'); |
1932 $msg = ( $pp = $paths->sysmsg('Page_not_found') ) ? $pp : '{STANDARD404}'; |
1933 if ( $msg ) |
1933 |
1934 { |
1934 $standard_404 = ''; |
1935 $msg = RenderMan::render($msg); |
1935 |
1936 eval( '?>' . $msg ); |
1936 if ( $userpage ) |
|
1937 { |
|
1938 $standard_404 .= '<h3>' . $lang->get('page_msg_404_title_userpage') . '</h3> |
|
1939 <p>' . $lang->get('page_msg_404_body_userpage'); |
1937 } |
1940 } |
1938 else |
1941 else |
1939 { |
1942 { |
1940 if ( $userpage ) |
1943 $standard_404 .= '<h3>' . $lang->get('page_msg_404_title') . '</h3> |
1941 { |
1944 <p>' . $lang->get('page_msg_404_body'); |
1942 echo '<h3>' . $lang->get('page_msg_404_title_userpage') . '</h3> |
1945 } |
1943 <p>' . $lang->get('page_msg_404_body_userpage'); |
1946 if ( $session->get_permissions('create_page') ) |
1944 } |
1947 { |
1945 else |
1948 $standard_404 .= ' ' . $lang->get('page_msg_404_create', array( |
1946 { |
1949 'create_flags' => 'href="'.makeUrlNS($this->namespace, $this->page_id, 'do=edit', true).'" onclick="ajaxEditor(); return false;"', |
1947 echo '<h3>' . $lang->get('page_msg_404_title') . '</h3> |
1950 'mainpage_link' => makeUrl(getConfig('main_page'), false, true) |
1948 <p>' . $lang->get('page_msg_404_body'); |
1951 )); |
1949 } |
1952 } |
1950 if ( $session->get_permissions('create_page') ) |
1953 else |
1951 { |
1954 { |
1952 echo ' ' . $lang->get('page_msg_404_create', array( |
1955 $standard_404 .= ' ' . $lang->get('page_msg_404_gohome', array( |
1953 'create_flags' => 'href="'.makeUrlNS($this->namespace, $this->page_id, 'do=edit', true).'" onclick="ajaxEditor(); return false;"', |
1956 'mainpage_link' => makeUrl(getConfig('main_page'), false, true) |
1954 'mainpage_link' => makeUrl(getConfig('main_page'), false, true) |
1957 )); |
1955 )); |
1958 } |
1956 } |
1959 $standard_404 .= '</p>'; |
1957 else |
1960 if ( $session->get_permissions('history_rollback') ) |
1958 { |
1961 { |
1959 echo ' ' . $lang->get('page_msg_404_gohome', array( |
1962 $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;'); |
1960 'mainpage_link' => makeUrl(getConfig('main_page'), false, true) |
1963 if ( !$e ) |
1961 )); |
1964 { |
1962 } |
1965 $db->_die('The deletion log could not be selected.'); |
1963 echo '</p>'; |
1966 } |
1964 if ( $session->get_permissions('history_rollback') ) |
1967 if ( $db->numrows() > 0 ) |
1965 { |
1968 { |
1966 $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;'); |
1969 $r = $db->fetchrow(); |
1967 if ( !$e ) |
1970 $standard_404 .= '<p>' . $lang->get('page_msg_404_was_deleted', array( |
|
1971 'delete_time' => enano_date('d M Y h:i a', $r['time_id']), |
|
1972 'delete_reason' => htmlspecialchars($r['edit_summary']), |
|
1973 'rollback_flags' => 'href="'.makeUrl($paths->page, 'do=rollback&id='.$r['log_id']).'" onclick="ajaxRollback(\''.$r['log_id'].'\'); return false;"' |
|
1974 )) |
|
1975 . '</p>'; |
|
1976 if ( $session->user_level >= USER_LEVEL_ADMIN ) |
1968 { |
1977 { |
1969 $db->_die('The deletion log could not be selected.'); |
1978 $standard_404 .= '<p>' . $lang->get('page_msg_404_admin_opts', array( |
1970 } |
1979 'detag_link' => makeUrl($paths->page, 'do=detag', true) |
1971 if ( $db->numrows() > 0 ) |
|
1972 { |
|
1973 $r = $db->fetchrow(); |
|
1974 echo '<p>' . $lang->get('page_msg_404_was_deleted', array( |
|
1975 'delete_time' => enano_date('d M Y h:i a', $r['time_id']), |
|
1976 'delete_reason' => htmlspecialchars($r['edit_summary']), |
|
1977 'rollback_flags' => 'href="'.makeUrl($paths->page, 'do=rollback&id='.$r['log_id']).'" onclick="ajaxRollback(\''.$r['log_id'].'\'); return false;"' |
|
1978 )) |
1980 )) |
1979 . '</p>'; |
1981 . '</p>'; |
1980 if ( $session->user_level >= USER_LEVEL_ADMIN ) |
|
1981 { |
|
1982 echo '<p>' . $lang->get('page_msg_404_admin_opts', array( |
|
1983 'detag_link' => makeUrl($paths->page, 'do=detag', true) |
|
1984 )) |
|
1985 . '</p>'; |
|
1986 } |
|
1987 } |
1982 } |
1988 $db->free_result(); |
1983 } |
1989 } |
1984 $db->free_result(); |
1990 echo '<p> |
1985 } |
1991 ' . $lang->get('page_msg_404_http_response') . ' |
1986 $standard_404 .= '<p> |
1992 </p>'; |
1987 ' . $lang->get('page_msg_404_http_response') . ' |
1993 } |
1988 </p>'; |
|
1989 |
|
1990 $parser = $template->makeParserText($msg); |
|
1991 $parser->assign_vars(array( |
|
1992 'STANDARD404' => $standard_404 |
|
1993 )); |
|
1994 |
|
1995 $msg = RenderMan::render($parser->run()); |
|
1996 eval( '?>' . $msg ); |
|
1997 |
1994 $this->footer(); |
1998 $this->footer(); |
1995 } |
1999 } |
1996 |
2000 |
1997 /** |
2001 /** |
1998 * Echoes out breadcrumb data, if appropriate. |
2002 * Echoes out breadcrumb data, if appropriate. |