'; /* ALTER FOR LOCAL "../../php-gtk-web/manual1-lookup.php" */ $SIDEBAR_DATA.= ''; if(sizeof($TOC) > 1) { $SIDEBAR_DATA.= ''; $SIDEBAR_DATA.= ''; $SIDEBAR_DATA.= ''; $SIDEBAR_DATA.= ''; if (($HOME[1] != $UP[1]) && $UP[1]) { $SIDEBAR_DATA.= ''; } $SIDEBAR_DATA.= ''; } $SIDEBAR_DATA.= '
' . 'lookup: ' . make_submit('small_submit.gif', 'lookup', 'bottom') . '
' . make_link('./', make_image('caret-t.gif', $HOME[1]) . $HOME[1] ) . '
' . make_link($UP[0], make_image('caret-u.gif', $UP[1]) . $UP[1] ) . '
'; for ($i = 0; $i < count($TOC); $i++) { list($url, $title, $type) = $TOC[$i]; if (!$url || !$title) { continue; } $end = '0.gif'; if ($title == $this) { $end = '1.gif'; } switch($type) { case NAV_CLASSENTRY: $img = "icon-o".$end; break; case NAV_CONSTRUCTOR: $img = "icon-c".$end; break; case NAV_METHOD: $img = "icon-m".$end; break; case NAV_SIGNAL: $img = "icon-s".$end; break; case NAV_ENUM: $img = "icon-e".$end; break; default: $img = "box-".$end; } if ($UP[0] == 'funcref.php') { $title = eregi_replace(" functions\$", "", $title); } $SIDEBAR_DATA .= ' ' . make_link($url, make_image($img, $title) . $title ) . '
'; } $SIDEBAR_DATA.= '
'; } function navigationBar($title, $id, $loc) { global $NEXT, $PREV, $tstamp; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } echo "
'; if ($PREV[1]) { echo make_link( $PREV[0] , make_image('caret-l.gif', 'previous') . $PREV[1] ) ; } echo '
'; if ($NEXT[1]) { echo make_link( $NEXT[0] , $NEXT[1] . make_image('caret-r.gif', 'next') ) ; } echo '
'; spacer(1,1); echo '
Last updated: '.$tstamp.'
'; # if ($loc == 'bottom') { # $back_url = 'http://' . $_SERVER['SERVER_NAME'] . # (($_SERVER['SERVER_PORT']==80) ? '' : ':'.$_SERVER['SERVER_PORT'] ) . # $_SERVER['PHP_SELF']; # } else { global $LANGUAGES; $links = array(); if($LANGUAGES){ foreach($LANGUAGES as $code=>$name) { if (file_exists("../$code/$id")) { $links[] = make_link("../$code/$id", $name); } } } $file = substr($id,0,-4); if (file_exists("html/$file.html")) { $links[] = make_link("html/$file.html", 'Plain HTML'); } if (count($links)) { echo 'view this page in ' . join (delim(), $links); echo '
\n"; } function makeTitle($title) { echo ''; echo '' . $title . '
'; echo "\n"; } function makeEntry($row, $show_admin = true, $show_rating = true ) { global $MAGIC_COOKIE; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; $name = htmlspecialchars($row['user']); if ($name && $name != "php-gtk@lists.php.net" && $name != "user@example.com") { if (ereg("(.+)@(.+)\.(.+)",$name)) { echo ''.$name.'
'; } else { echo ''.$name.'
'; } } echo '' . date("d-M-Y h:i", $row['xwhen']) . ''; echo '
'; if (isset($MAGIC_COOKIE) && $show_admin) { print_link('/manual1/admin-notes.php?action=edit+' . $row['id'] . '&brief=1', make_image('notes-edit.gif', 'edit note') ); echo ' '; print_link('/manual1/admin-notes.php?action=reject+' . $row['id'] . '&brief=1&popup=1', make_image('notes-reject.gif', 'reject note'), 'admin' ); echo ' '; print_link('/manual1/admin-notes.php?action=delete+' . $row['id'] . '&brief=1&popup=1', make_image('notes-delete.gif', 'delete note'), 'admin' ); } echo '
'; if ($show_rating) { echo 'rating: '; if ( $row['votes'] > 2 ) { printf('%.01f', $row['rate'] ); } else { echo 'new'; } echo ' | rate: '; for ($i=1; $i<=5; $i++) { if ($i>1) { echo ' | '; } print_link(htmlspecialchars($_SERVER['PHP_SELF']).'?rate_id='.$row['id'].'&rate_note='.$i, $i); } echo '
'; } echo '
'; echo clean_note($row['note']). '
'; echo '
'; echo ''; } function updateNotesVoting() { # probably a better way/place to do this, but ... if ($_GET['rate_id'] && $_GET['rate_note']) { $p = parse_url($_SERVER['HTTP_REFERER']); echo "\n\n\n\n"; /* prevent outside scripts from voting */ if ($_SERVER['SCRIPT_NAME']==$p['path']) { $query = 'UPDATE note SET votes=votes+1, rating=rating+' . min(5, $_GET['rate_note']) . ' WHERE id=' . $_GET['rate_id']; $result_id = @mysql_query($query); } } } function manualGetUserNotes($title, $id) { // if we're gtk.php.net, get it from the local DB // otherwise look in "/manual1/usernotes/$title.txt" (if present) $notes = array(); # if(is_primary_site() || strstr($MYSITE,"localhost")) { if ( true ) { updateNotesVoting(); $query = "SELECT *, UNIX_TIMESTAMP(ts) AS xwhen, IF(votes=0, 10, rating/votes) AS rate FROM note " . "WHERE sect='$title' OR sect='$id' ORDER BY xwhen DESC, id"; echo "\n\n\n\n"; $result_id = @mysql_query($query); if ($result_id && mysql_num_rows($result_id) > 0) { echo "\n\n\n\n"; while ($row = mysql_fetch_array($result_id)) { $notes[] = $row; } } else { echo "\n\n\n\n"; } } else { $notes_file = "../usernotes/" . urlencode( $title ) . ".txt"; if ( @file_exists( $notes_file ) ) { $fp = @fopen($notes_file,"r"); if ($fp) { $body = fread($fp,filesize($notes_file)); if (strlen($body)) { $notes = @unserialize($body); } fclose($fp); } } } return $notes; } function manualUserNotes($title, $id) { global $LANG, $MYSITE; $cur = substr(dirname($_SERVER['PHP_SELF']), -2); if($cur=='al') { $cur='en'; } echo "
\n\n"; echo ''; $notes = manualGetUserNotes($title, $id); $back_url = 'http://' . $_SERVER['SERVER_NAME'] . (($SERVER_PORT==80) ? '' : ':'.$_SERVER['SERVER_PORT'] ) . htmlspecialchars($_SERVER['PHP_SELF']); echo ''; echo ''; echo '\n"; echo "\n"; if ( sizeof($notes) == 0 ) { if ( false ) { echo ''; echo ''; } else { echo ''; echo ''; } } else { foreach($notes as $note) { makeEntry($note); } echo "\n"; echo "\n"; echo "\n"; } echo "
User Contributed Notes
' . $title . '
'; print_link('/manual1/add-note.php?sect='.$id.'&redirect='.$back_url, make_image('notes-add.gif','add a note') ); echo " "; print_link('/manual1/about-notes.php', make_image('notes-about.gif', 'about notes') ); echo "
'; echo 'User contributed notes are not available on this mirror site; try '; print_link('http://gtk.php.net/manual1/'.$LANG.'/'.$id, 'here'); echo '.
'; echo 'There are no user contributed notes for this page.'; echo '
\n"; print_link('/manual1/add-note.php?sect='.$id.'&redirect='.$back_url, make_image('notes-add.gif','add a note') ); echo " "; print_link('/manual1/about-notes.php', make_image('notes-about.gif', 'about notes') ); echo "


\n"; } function sendManualHeaders($charset, $LANG) { global $LANG; Header("Content-type: text/html;charset=UTF-8"); Header("Content-language: $LANG"); } function manualHeader($title, $id="") { global $HTDIG; makeBorderTOC($title); commonHeader('PHP-GTK 1 Manual : '.$title); # create links to plain html and other languages if (!$HTDIG) { navigationBar($title, $id, "top"); } } function manualFooter($title, $id="") { global $HTDIG; if (!$HTDIG) { manualUserNotes($title,$id); navigationBar($title, $id, "bottom"); } commonFooter(); } function dehtmlspecialchars($str) { $str = str_replace(">",">",$str); $str = str_replace("<","<",$str); $str = str_replace(""","\"",$str); $str = str_replace("&","&",$str); return $str; } ?>