cvs: phpweb /include shared-manual.inc

From: Date: Sat, 22 Sep 2001 20:56:16 +0000
Subject: cvs: phpweb /include shared-manual.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-6606@lists.php.net to get a copy of this message
jimw Sat Sep 22 16:56:16 2001 EDT Modified files: /phpweb/include shared-manual.inc Log: manual notes are now always read from rsync-distributed files Index: phpweb/include/shared-manual.inc diff -u phpweb/include/shared-manual.inc:1.119 phpweb/include/shared-manual.inc:1.120 --- phpweb/include/shared-manual.inc:1.119 Sat Sep 22 05:29:32 2001 +++ phpweb/include/shared-manual.inc Sat Sep 22 16:56:16 2001 @@ -173,37 +173,25 @@ function manualGetUserNotes($title, $id) { // if we're www.php.net, get it from the local DB // otherwise look in "/manual/usernotes/$title.txt" (if present) - global $MYSITE; + global $MYSITE, $DOCUMENT_ROOT; $notes = array(); - if (0 && is_primary_site() && @mysql_connect("localhost","nobody","")) { - mysql_select_db("php3"); - $query = "SELECT *,UNIX_TIMESTAMP(ts) AS xwhen FROM note WHERE sect='$id' AND NOT removed ORDER BY id"; - $result_id = mysql_query($query); - if ($result_id && mysql_num_rows($result_id) > 0) { - while ($row = mysql_fetch_array($result_id)) { - $notes[] = $row; - } - } - } else { - global $DOCUMENT_ROOT; - $hash = substr(md5($id),0,16); - $notes_file = "$DOCUMENT_ROOT/backend/notes/".substr($hash,0,2)."/$hash"; - if ($fp = @fopen($notes_file,"r")) { - while (!feof($fp)) { - $line = chop(fgets($fp,8096)); - if ($line == "") continue; - list($id,$sect,$rate,$ts,$user,$note) = explode("|",$line); - $notes[] = array( - "id" => $id, - "sect" => $sect, - "rate" => $rate, - "xwhen" => $ts, - "user" => $user, - "note" => base64_decode($note) - ); - } - fclose($fp); + $hash = substr(md5($id),0,16); + $notes_file = "$DOCUMENT_ROOT/backend/notes/".substr($hash,0,2)."/$hash"; + if ($fp = @fopen($notes_file,"r")) { + while (!feof($fp)) { + $line = chop(fgets($fp,8096)); + if ($line == "") continue; + list($id,$sect,$rate,$ts,$user,$note) = explode("|",$line); + $notes[] = array( + "id" => $id, + "sect" => $sect, + "rate" => $rate, + "xwhen" => $ts, + "user" => $user, + "note" => base64_decode($note) + ); } + fclose($fp); } return $notes; }

« previous php.mirrors (#6606) next »