pecesama 15 лет назад
Родитель
Сommit
3bfc42a5eb
3 измененных файлов с 15 добавлено и 25 удалено
  1. 0 15
      plugins/hola.php
  2. 14 9
      plugins/kodrs.php
  3. 1 1
      update.php

+ 0 - 15
plugins/hola.php Просмотреть файл

1
-<?php
2
-
3
-class hola extends plugins {
4
-	
5
-	function hola() {
6
-		//$this->addAction('gelato_init', 'saluda');		
7
-	}
8
-	
9
-	function saluda() {
10
-		echo "Hola mundo desde plugin en gelato<br />";
11
-	}
12
-	
13
-}
14
-
15
-?>

+ 14 - 9
plugins/kodrs.php Просмотреть файл

1
 <?php
1
 <?php
2
-/*
3
-Plugin Name: kodrs
4
-Plugin URI: http://plugins.gelatocms.com/kodrs/
5
-Description: Geshify your source codes
6
-Author: Pedro Santana
7
-Author URI: http://www.pecesama.net/
8
-Version: 0.1
9
-*/ 
2
+
10
 class kodrs extends plugins {	
3
 class kodrs extends plugins {	
11
 	
4
 	
12
 	function kodrs() {
5
 	function kodrs() {
15
 		}
8
 		}
16
 		$this->addAction('post_content', 'source_code_beautifier');
9
 		$this->addAction('post_content', 'source_code_beautifier');
17
 	}
10
 	}
11
+	
12
+	function info()
13
+	{
14
+		return array(
15
+			'name' => 'kodrs',
16
+			'version' => '0.1',
17
+			'url' => 'http://plugins.gelatocms.com/kodrs/',
18
+			'author' => 'Pedro Santana',
19
+			'authorurl' => 'http://www.pecesama.net/',
20
+			'license' => 'MIT License',
21
+			'description' => 'Geshify your source codes',
22
+		);
23
+	}
18
 
24
 
19
 	function source_code_beautifier() {
25
 	function source_code_beautifier() {
20
 		global $rows;
26
 		global $rows;
21
 		if(count($rows)>0){
27
 		if(count($rows)>0){
22
 			foreach($rows as $key=>$post){
28
 			foreach($rows as $key=>$post){
23
-				// Si no es tipo 'post' entonces no tiene 'Body' :)
24
 				if($post["postType"]=="post"){
29
 				if($post["postType"]=="post"){
25
 					$text = $rows[$key]['Body'];		
30
 					$text = $rows[$key]['Body'];		
26
 					$result = preg_replace_callback("/<code\s+.*lang\s*=\"(.*)\">(.*)<\/code>/siU", 
31
 					$result = preg_replace_callback("/<code\s+.*lang\s*=\"(.*)\">(.*)<\/code>/siU", 

+ 1 - 1
update.php Просмотреть файл

16
 require('entry.php');
16
 require('entry.php');
17
 global $configFile, $db;
17
 global $configFile, $db;
18
 
18
 
19
-if (!file_exists($configFile) || true) {
19
+if (!file_exists($configFile) == true) {
20
 	$mensaje = '
20
 	$mensaje = '
21
 			<h3 class="importan">'.__("Error reading configuration file").'</h3>
21
 			<h3 class="importan">'.__("Error reading configuration file").'</h3>
22
 			<p>'.__("There does not seem to be a <code>config.php</code> file. I need this before we can get started.").'</p>
22
 			<p>'.__("There does not seem to be a <code>config.php</code> file. I need this before we can get started.").'</p>