array( "contents" => $PGI["home"][0], "index" => $PGI["up"][0], "prev" => $PGI["prev"][0], "next" => $PGI["next"][0], "schema.dc" => "http://purl.org/dc/elements/1.1/", "schema.rdfs" => "http://www.w3.org/2000/01/rdf-schema#", array( "rev" => "canonical", "rel" => "self alternate shorter shorturl shortlink", "href" => "http://php.net/" . $shorturl, ), array( "rel" => "license", "href" => "http://creativecommons.org/licenses/by/3.0/", "about" => "#content", ), ), "profile" => "http://purl.org/NET/erdf/profile", "extra_headers" => array( "Link" => "; rel=shorturl", ), "headtags" => array( ' ', ), )); manual_navbar(); } // Print out manual page footer function manual_footer() { global $PGI; // Get vars for easy handling list($filename, $title) = $PGI['this']; echo "

"; manual_notes(); echo "
"; manual_navbar("bottom"); site_footer(); } // ============================================================================= // Manual page navigation parts // ============================================================================= // Append all the table of contents data to $SIDEBAR_DATA function manual_sidebar() { global $PGI, $SIDEBAR_DATA; // Start sidebar with its
$BAR = "\n\n"; } function manual_navbar($location = "top") { global $PGI, $LANG, $LANGUAGES, $INACTIVE_ONLINE_LANGUAGES, $ACTIVE_ONLINE_LANGUAGES; // Start navbar with echo "\n
\n \n"; if (isset($PGI['next']) && isset($PGI['next'][1])) { echo " " . $PGI['next'][1] . make_image('caret-r.gif', '>') . "\n"; } echo " \n \n"; if (isset($PGI['prev']) && isset($PGI['prev'][1])) { echo " " . make_image('caret-l.gif', '<') . $PGI['prev'][1] . "\n"; } else { echo "  \n"; } echo " \n
\n"; // Provide last updated information on this page echo " Last updated: {$PGI['lastmod']}\n"; // Print out language switch on top of manual pages echo "
\n"; if ($location != 'bottom') { $links = array(); // Quick access to filename $filename = $PGI['this'][0]; // Disable all languages without online content // Add a dropdown item for all languages left foreach ($ACTIVE_ONLINE_LANGUAGES as $code => $name) { if (!preg_match("!/$code/!", $_SERVER['BASE_PAGE']) // && file_exists($_SERVER['DOCUMENT_ROOT'] . "/$code/$filename") ) { $links[] = array("$code/$filename", $name); } } $links[] = array('help-translate.php', 'Other'); // Print out the form with all the options echo '
' . "\n" . '

view this page in

\n" . ' ' . "\n
\n"; } else { echo "  \n"; } echo "
\n"; echo "
\n\n\n"; } // ============================================================================= // User note display functions // ============================================================================= // Print out all user notes for this manual page function manual_notes() { // Get needed values list($filename, $title) = $GLOBALS['PGI']['this']; // Drop file extension from the name if (substr($filename, -4) == '.php') { $filename = substr($filename, 0, -4); } // Load user note for this page $notes = manual_notes_load($filename); // If there are few comments, provide the quick 'prevous'/'next' navigation // above the comments if(count($notes) > 2) { manual_navbar("bottom"); } // Link target to add a note to the current manual page, // and it's extended form with a [+] image $addnotelink = '/manual/add-note.php?sect=' . $filename . '&redirect=' . $_SERVER['BASE_HREF']; $addnotesnippet = make_link($addnotelink, make_image('notes-add.gif', 'add a note', FALSE, 'class="middle"')) . ' ' . make_link($addnotelink, 'add a note') . ''; echo <<
{$addnotesnippet} User Contributed Notes
{$title}
END_USERNOTE_HEADER; // If we have no notes, then inform the user if (sizeof($notes) == 0) { echo "\n
There are no user contributed notes for this page.
"; } // If we have notes, print them out else { echo '
'; foreach($notes as $note) { manual_note_display( $note['xwhen'], $note['user'], $note['note'], $note['id'] ); } echo "
\n"; echo "\n
$addnotesnippet
\n"; } // End of #usernotes echo "
"; } // Get user notes from the appropriate text dump function manual_notes_load($id) { // Initialize values $notes = array(); $hash = substr(md5($id), 0, 16); $notes_file = $_SERVER['DOCUMENT_ROOT'] . "/backend/notes/" . substr($hash, 0, 2) . "/$hash"; // Open the note file for reading and get the data (12KB) if ($fp = @fopen($notes_file, "r")) { while (!feof($fp)) { $line = chop(fgets($fp, 12288)); if ($line == "") { continue; } list($id, $sect, $rate, $ts, $user, $note) = explode("|", $line); $notes[$id] = array( "id" => $id, "sect" => $sect, "rate" => $rate, "xwhen" => $ts, "user" => $user, "note" => base64_decode($note) ); } fclose($fp); } return $notes; } // Print out one user note entry function manual_note_display($date, $name, $text, $id) { if ($name) { $name = "\n " . htmlspecialchars($name) . "
"; } $datestr = date("d-M-Y h:i", $date); $datestr = ($id ? "\n $datestr" : "\n $datestr"); $anchor = ($id ? "\n " : ""); $text = clean_note($text); // If the viewer is logged in, show admin options if (isset($_COOKIE['MAGIC_COOKIE']) && $id) { $admin = "\n \n " . make_popup_link( 'https://master.php.net/manage/user-notes.php?action=edit+' . $id, make_image('notes-edit.gif', 'edit note'), 'admin', 'scrollbars=yes,width=650,height=400' ) . "\n " . make_popup_link( 'https://master.php.net/manage/user-notes.php?action=reject+' . $id, make_image('notes-reject.gif', 'reject note'), 'admin', 'scrollbars=no,width=300,height=200' ) . "\n " . make_popup_link( 'https://master.php.net/manage/user-notes.php?action=delete+' . $id, make_image('notes-delete.gif', 'delete note'), 'admin', 'scrollbars=no,width=300,height=200' ) . "\n "; } else { $admin = ''; } echo <<{$admin}{$name}{$datestr}
{$text}
USER_NOTE_TEXT; } /* vim: set et ts=4 sw=4: */