From: <vb...@us...> - 2002-09-09 14:25:46
|
Update of /cvsroot/webnotes/web In directory usw-pr-cvs1:/tmp/cvs-serv3582 Modified Files: cvs_api.php database.php header.php localization.php Added Files: common.php Log Message: Made changes to get the website to work without the cvs_api actually connected to sf cvs. For some reason it works when running on my webserver, but not when running from sf webserver. --- NEW FILE: common.php --- <?php # phpWebNotes - a php based note addition system # Copyright (C) 2000-2002 Webnotes Team - web...@so... # This program is distributed under the terms and conditions of the GPL # See the files README and LICENSE for details # -------------------------------------------------------- # $Id: common.php,v 1.1 2002/09/09 14:25:41 vboctor Exp $ # -------------------------------------------------------- $g_webnotes_path = "webnotes/"; $g_webnotes_url = "webnotes/"; if ( file_exists( dirname(__FILE__) . "/webnotesweb_config_inc.php" ) ) { require_once ( dirname(__FILE__) . "/webnotesweb_config_inc.php"); } ?> Index: cvs_api.php =================================================================== RCS file: /cvsroot/webnotes/web/cvs_api.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cvs_api.php 9 Sep 2002 09:35:11 -0000 1.2 +++ cvs_api.php 9 Sep 2002 14:25:41 -0000 1.3 @@ -10,21 +10,34 @@ # -------------------------------------------------------- function cvs_get_link( $p_project, $p_module, $p_file, $p_rev='HEAD' ) { - $t_url = "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/$p_project/$p_module$p_file?rev=$p_rev&content-type=text/vnd.viewcvs-markup"; + # $t_url = "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/$p_project/$p_module$p_file?rev=$p_rev&content-type=text/vnd.viewcvs-markup"; + + # @@@@ Till CVS works + global $g_webnotes_path; + $t_url = $g_webnotes_path . substr( $p_file, 1 ); + $t_url = str_replace( '/', DIRECTORY_SEPARATOR, $t_url ); + return $t_url; } function cvs_get_file( $p_project, $p_module, $p_file , $p_rev='HEAD' ) { $t_url = cvs_get_link( $p_project, $p_module, $p_file, $p_rev ); - $fp = @fopen( $t_url, 'r'); - if (!$fp) { + # $fp = fsockopen( $t_url, 80, $errno, $errstr, 30 ); + $fp = fopen( $t_url, 'r'); + if ( $fp === false ) { + # echo "$errno: $errstr<br />"; return false; } - $t_contents = fread( $fp, 1000000 ); + $t_contents = ''; + while (!feof($fp)) { + $t_contents .= fgets ($fp, 10240); + } fclose($fp); + + return $t_contents; # @@@@ Till CVS works # Use <pre> and </pre> as separators, so replace </pre> with <pre> # to have one separator to send to explode() Index: database.php =================================================================== RCS file: /cvsroot/webnotes/web/database.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- database.php 8 Sep 2002 22:06:43 -0000 1.4 +++ database.php 9 Sep 2002 14:25:41 -0000 1.5 @@ -1,8 +1,6 @@ -<?php include('header.php') ?> - <?php - include('header.php'); - require_once('cvs_api.php'); + include( 'header.php' ); + require_once( 'cvs_api.php' ); ?> <span class="page_title">Database Schema</span> @@ -10,7 +8,6 @@ <?php cvs_echo_file( 'webnotes', 'webnotes', '/sql/db_generate.sql' ); - include('footer.php'); ?> <!-- Index: header.php =================================================================== RCS file: /cvsroot/webnotes/web/header.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- header.php 9 Sep 2002 09:35:11 -0000 1.4 +++ header.php 9 Sep 2002 14:25:41 -0000 1.5 @@ -1,13 +1,4 @@ -<?php - #countpage( $REQUEST_URI, $REQUEST_URI ); - - $g_webnotes_path = "webnotes/"; - $g_webnotes_url = "webnotes/"; - - if ( file_exists( dirname(__FILE__) . "/webnotesweb_config_inc.php" ) ) { - require_once ( dirname(__FILE__) . "/webnotesweb_config_inc.php"); - } -?> +<?php require_once('common.php'); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> Index: localization.php =================================================================== RCS file: /cvsroot/webnotes/web/localization.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- localization.php 9 Sep 2002 09:35:11 -0000 1.4 +++ localization.php 9 Sep 2002 14:25:41 -0000 1.5 @@ -5,10 +5,11 @@ <?php function print_lang( $p_language, $p_version, $p_state ) { - + global $g_webnotes_url; $t_filename = 'strings_' . strtolower( $p_language ) . '.php'; - $t_path = '/lang/' . $t_filename; - $t_link = cvs_get_link( 'webnotes', 'webnotes', $t_path ); + $t_path = $g_webnotes_url . 'lang/' . $t_filename; + # $t_link = cvs_get_link( 'webnotes', 'webnotes', $t_path ); + $t_link = $t_path; echo "<li>$p_language (<a href=\"$t_link\" target=\"_new\">$t_filename</a>)</li>"; |