Chris Browne cbbrowne at lists.slony.info
Fri Jun 27 13:31:08 PDT 2008
Update of /home/cvsd/slony1/slony1-www
In directory main.slony.info:/home/community/slony/htdocs

Modified Files:
	index.php layout.php 
Log Message:
Update PHP code to accomodate v2.0 of Slony-I



Index: index.php
===================================================================
RCS file: /home/cvsd/slony1/slony1-www/index.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** index.php	3 Apr 2007 15:10:45 -0000	1.11
--- index.php	27 Jun 2008 20:31:06 -0000	1.12
***************
*** 30,33 ****
--- 30,34 ----
         if ($_GET["version"] == "1.1") $version = "1.1";
         if ($_GET["version"] == "1.2") $version = "1.2";
+        if ($_GET["version"] == "2.0") $version = "2.0";
         $platform = "";
         if ($_GET["platform"]=="source") $platform = "source";
***************
*** 135,142 ****
          if ($fp){
                  $text="";
                  while (!feof($fp)){
  			 $buf=fgets($fp,256);
  			 if (strpos($buf,'---')!==false){
! 				if ($text != "") echo layout_defaultblock($title,$link,$text);
  				$text = "";
  				$title = trim(@fgets($fp,256));
--- 136,149 ----
          if ($fp){
                  $text="";
+ 		$article_count = 0;
                  while (!feof($fp)){
  			 $buf=fgets($fp,256);
  			 if (strpos($buf,'---')!==false){
! 				if ($article_count < 5){
! 					if ($text != "") echo layout_defaultblock($title,$link,$text);
! 				} else {
! 					break;
! 				}
! 				$article_count++;
  				$text = "";
  				$title = trim(@fgets($fp,256));
***************
*** 155,162 ****
          if ($fp){
                  $text="";
                  while (!feof($fp)){
  			 $buf=fgets($fp,256);
  			 if (strpos($buf,'---')!==false){
! 				if ($text != "") echo layout_defaultblock($title,$link,$text,$stamp,$poster);
  				$text = "";
  				$title = trim(@fgets($fp,256));
--- 162,175 ----
          if ($fp){
                  $text="";
+ 		$article_count = 0;
                  while (!feof($fp)){
  			 $buf=fgets($fp,256);
  			 if (strpos($buf,'---')!==false){
! 				if ($article_count < 12){
! 					if ($text != "") echo layout_defaultblock($title,$link,$text,$stamp,$poster);
! 				} else {
!                                         break;
!                                 }
!                                 $article_count++;
  				$text = "";
  				$title = trim(@fgets($fp,256));

Index: layout.php
===================================================================
RCS file: /home/cvsd/slony1/slony1-www/layout.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** layout.php	13 Nov 2007 21:00:29 -0000	1.10
--- layout.php	27 Jun 2008 20:31:06 -0000	1.11
***************
*** 136,138 ****
--- 136,152 ----
  }
  
+ function between ($pre, $post, &$data, $n = 1) {
+         $offset = 0;
+         for (; $n > 0; $n--) {
+                 $prepos = strpos($data, $pre, $offset);
+                 if ($prepos == 0) return false;
+                 $prepos += strlen($pre);
+                 $postpos = strpos($data, $post, $prepos);
+                 if ($postpos == 0) return false;
+                 $offset = $postpos + strlen($post);
+         }
+         $taglen = $postpos - $prepos;
+         return trim(substr($data, $prepos, $taglen));
+ }
+ 
  ?>



More information about the Slony1-commit mailing list