Minor fixes

master
pecesama 2008-11-03 23:15:10 +00:00
parent 0126387ac8
commit 3bfc42a5eb
3 changed files with 15 additions and 25 deletions

View File

@ -1,15 +0,0 @@
<?php
class hola extends plugins {
function hola() {
//$this->addAction('gelato_init', 'saluda');
}
function saluda() {
echo "Hola mundo desde plugin en gelato<br />";
}
}
?>

View File

@ -1,12 +1,5 @@
<?php <?php
/*
Plugin Name: kodrs
Plugin URI: http://plugins.gelatocms.com/kodrs/
Description: Geshify your source codes
Author: Pedro Santana
Author URI: http://www.pecesama.net/
Version: 0.1
*/
class kodrs extends plugins { class kodrs extends plugins {
function kodrs() { function kodrs() {
@ -16,11 +9,23 @@ class kodrs extends plugins {
$this->addAction('post_content', 'source_code_beautifier'); $this->addAction('post_content', 'source_code_beautifier');
} }
function info()
{
return array(
'name' => 'kodrs',
'version' => '0.1',
'url' => 'http://plugins.gelatocms.com/kodrs/',
'author' => 'Pedro Santana',
'authorurl' => 'http://www.pecesama.net/',
'license' => 'MIT License',
'description' => 'Geshify your source codes',
);
}
function source_code_beautifier() { function source_code_beautifier() {
global $rows; global $rows;
if(count($rows)>0){ if(count($rows)>0){
foreach($rows as $key=>$post){ foreach($rows as $key=>$post){
// Si no es tipo 'post' entonces no tiene 'Body' :)
if($post["postType"]=="post"){ if($post["postType"]=="post"){
$text = $rows[$key]['Body']; $text = $rows[$key]['Body'];
$result = preg_replace_callback("/<code\s+.*lang\s*=\"(.*)\">(.*)<\/code>/siU", $result = preg_replace_callback("/<code\s+.*lang\s*=\"(.*)\">(.*)<\/code>/siU",

View File

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