Browse Source

Some issues fixed

vbracco 16 years ago
parent
commit
6236f57500
1 changed files with 11 additions and 6 deletions
  1. 11 6
      plugins/kodrs.php

+ 11 - 6
plugins/kodrs.php View File

18
 
18
 
19
 	function source_code_beautifier() {
19
 	function source_code_beautifier() {
20
 		global $rows;
20
 		global $rows;
21
-
22
-		$text = $rows[0]['Body'];		
23
-		$result = preg_replace_callback("/<code\s+.*lang\s*=\"(.*)\">(.*)<\/code>/siU",
24
-					array('kodrs', 'replace_with_geshi'),
25
-					$text);
26
-		$rows[0]['Body'] = $result;
21
+		foreach($rows as $key=>$post){
22
+			// Si no es tipo 'post' entonces no tiene 'Body' :)
23
+			if($post["postType"]=="post"){
24
+				$text = $rows[$key]['Body'];		
25
+				$result = preg_replace_callback("/<code\s+.*lang\s*=\"(.*)\">(.*)<\/code>/siU", 
26
+					array('kodrs', 'replace_with_geshi'), 
27
+					$text
28
+				);
29
+				$rows[$key]['Body'] = $result;
30
+			}
31
+		}
27
 	}
32
 	}
28
 	
33
 	
29
 	static function replace_with_geshi($matches) {		
34
 	static function replace_with_geshi($matches) {