Plugin control panel

New option in options table
Some changes in the css
some minor adjustments about spaces and tabs
master
ravenlp 2008-11-03 04:08:48 +00:00
parent 9533dd1cf9
commit cc6ffa91d1
12 changed files with 365 additions and 175 deletions

View File

@ -60,6 +60,7 @@ if ($user->isAdmin()) {
<div class="box"> <div class="box">
<ul class="menu manage"> <ul class="menu manage">
<h3>Manage</h3> <h3>Manage</h3>
<li><a href="<?php echo $conf->urlGelato;?>/admin/plugins.php"><?php echo __("Plugins")?></a></li>
<li><a href="<?php echo $conf->urlGelato;?>/admin/settings.php"><?php echo __("Settings")?></a></li> <li><a href="<?php echo $conf->urlGelato;?>/admin/settings.php"><?php echo __("Settings")?></a></li>
<li><a href="<?php echo $conf->urlGelato;?>/admin/index.php"><?php echo __("Posts")?></a></li> <li><a href="<?php echo $conf->urlGelato;?>/admin/index.php"><?php echo __("Posts")?></a></li>
<li><a href="<?php echo $conf->urlGelato;?>/admin/user.php"><?php echo __("Add user")?></a></li> <li><a href="<?php echo $conf->urlGelato;?>/admin/user.php"><?php echo __("Add user")?></a></li>

View File

@ -29,14 +29,14 @@ fieldset{ border:none; margin:0; padding:0;}
/*********** LAYOUT *************/ /*********** LAYOUT *************/
body{ background: #fff; text-align:center; font-family:"Trebuchet Ms", Verdana, Tahoma; font-size:1em;} body{ background: #e0e0e0; text-align:center; font-family:"Trebuchet Ms", Verdana, Tahoma; font-size:1em;}
#cont{ width:569px; margin:30px auto 10px auto; text-align:left;} #cont{ width:600px; margin:30px auto 20px auto; text-align:left; border: 1px solid #999;}
#head{ background: transparent url(images/head_bg.png) bottom center no-repeat; position: relative; padding-bottom:20px; height:73px;} #head{ background: #fff url(images/head_bg.png) bottom center no-repeat; position: relative; padding:10px 0 20px 20px; height:73px;}
h1 a{ display:block; height:77px; width:161px; background:#fff url(images/gelato-logo.png) top left no-repeat; text-indent:-9999px; overflow:hidden;} h1 a{ display:block; height:77px; width:161px; background:#fff url(images/gelato-logo.png) top left no-repeat; text-indent:-9999px; overflow:hidden;}
#nav{ position:absolute; right:1px; font-size:0.75em; line-height:normal; margin:0; padding:0 10px 0 0; list-style:none;bottom:34px;} #nav{ position:absolute; right:1px; font-size:0.75em; line-height:normal; margin:0; padding:0 20px 0 0; list-style:none;bottom:34px;}
#nav li{ margin:0; padding:0; text-align:right;} #nav li{ margin:0; padding:0; text-align:right;}
@ -48,28 +48,42 @@ body{ background: #fff; text-align:center; font-family:"Trebuchet Ms", Verdana,
h2{ font-size:1.56em; margin:4px; text-indent:20px;} h2{ font-size:1.56em; margin:4px; text-indent:20px;}
h3{font-size:1.12em; margin:4px; color:#333333; text-indent:20px;} h3{font-size:1.12em; margin:4px; color:#333333; text-indent:20px;}
.box{ background:#efefef url(images/bg-box.png) left top repeat-y;} .box{ background:#fff url(images/bg-box.png) center top repeat-y; width:600px;}
.footer-box{background:#fff url(images/bg-foot-box.png) top center no-repeat;} .footer-box{background:#fff url(images/bg-foot-box.png) center top no-repeat;}
.box h3{float:left; color:#FFFFFF; font-weight:bold; padding:5px 10px 0 0;} .box h3{float:left; color:#444444; font-weight:bold; padding:5px 10px 0 0;}
.menu{ background:#c1c7cd url(images/bg-top-box.png) top center no-repeat; height:40px; width:559px; list-style-type:none; padding-right:10px;} .menu{ background:transparent url(images/bg-top-box.png) top center no-repeat; height:40px; width:570px; list-style-type:none; padding-right:30px;}
.menu li{ display:inline;} .menu li{ display:inline;}
.menu li.selected a{background: transparent url(images/bg-top-box-hover.png) left top repeat-x; text-decoration:none;} .menu li.selected a{background: transparent url(images/bg-top-box-hover.png) left top repeat-x; text-decoration:underline;}
.menu li a{ font-family:Verdana, Arial, Helvetica, sans-serif; font-size:0.7em; display:block; float:right; height:28px; padding:12px 3px 0 3px;} .menu li a{ font-family:Verdana, Arial, Helvetica, sans-serif; font-size:0.7em; display:block; float:right; height:28px; padding:12px 3px 0 3px;}
.menu li a:hover{ background: transparent url(images/bg-top-box-hover.png) left top repeat-x; text-decoration:none;} .menu li a:hover{ background: transparent url(images/bg-top-box-hover.png) left top repeat-x; text-decoration:underline;}
.menu li a img{border:none; vertical-align:bottom;} .menu li a img{border:none; vertical-align:bottom;}
.manage li a{ padding:14px 6px 0 6px;} .manage li a{ padding:14px 6px 0 6px;}
/* New post menu and form*/
div.newpost{background:none;}
div.newpost h3{color:#444; margin:10px 0 0 10px;}
#post_types{ background: transparent url(images/new_post_nav.png) top center no-repeat; height:51px; position: relative; margin-bottom:20px;}
#head_nav{ background: transparent url(images/head_nav.png) top center no-repeat; height:66px; width:80px; position:absolute; top:-7px; display:none;}
#head_nav_sel{ display:none; background: transparent url(images/head_nav.png) bottom center no-repeat;height:66px; width:80px;}
#post_types ul{ background:none; position: absolute; padding:5px 0 0 0;}
#post_types ul li{}
#post_types ul li.selected a{ background:none;}
#post_types ul li a{ text-align: center; padding:0px 9px; height:auto;}
#post_types ul li a:hover{ background:none;}
#post_types ul li a img{ display: block;}
#context_help{ display:block; margin:0; padding:5px; position: absolute; border: 1px solid #222; background-color: #444; color:#fff; font-size: 12px;} #context_help{ display:block; margin:0; padding:5px; position: absolute; border: 1px solid #222; background-color: #444; color:#fff; font-size: 12px;}
form.newpost{ width:500px; margin:0 auto; padding:0;} form.newpost{ width:500px; margin:20px auto 0 auto; padding:0;}
form.newpost ul{ list-style-type:none; margin:20px 0 10px 0; padding:0;} form.newpost ul{ list-style-type:none; margin:20px 0 10px 0; padding:0;}
form.newpost li{ margin:4px 0; padding:0; position:relative;} form.newpost li{ margin:4px 0; padding:0; position:relative;}
form.newpost li.select{ margin:6px 0;} form.newpost li.select{ margin:6px 0;}
form.newpost label{} form.newpost label{}
form.newpost input{ margin-bottom:10px;} form.newpost input{ margin-bottom:10px;}
form.newpost input.txt{ background: #fff url(images/grad-small.png) top left repeat-x; height:15px; border:1px solid #999; width:490px; padding:5px;} form.newpost input.txt{ background: #fff url(images/grad-small.png) top left repeat-x; border:1px solid #999; width:490px; padding:5px;}
form.newpost input.btn{ } form.newpost input.btn{ }
form.newpost input.check{ vertical-align:middle;} form.newpost input.check{ vertical-align:middle;}
form.newpost textarea{background: #fff url(images/grad-big.png) top left repeat-x; height:190px; border:1px solid #999; width:490px; padding:5px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:0.8em;} form.newpost textarea{background: #fff url(images/grad-big.png) top left repeat-x; height:190px; border:1px solid #999; width:490px; padding:5px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:0.8em;}
@ -81,7 +95,7 @@ fieldset.install{border:1px solid #dfdfdf; padding:10px;}
fieldset.install input.txt{width:468px;} fieldset.install input.txt{width:468px;}
.tabla{ margin:15px 15px; } .tabla{ margin:15px 15px; }
.entry{ background-color:#efefef; border:1px solid #ccc; margin:20px 15px;} .entry{ background-color:#efefef; border:1px solid #ccc; margin:20px auto; width:550px;}
.info{ border-bottom:1px solid #aaa; position:relative; display:block; padding:4px 10px; height:20px; } .info{ border-bottom:1px solid #aaa; position:relative; display:block; padding:4px 10px; height:20px; }
.info p{font-size:0.8em; color:#297aab; display:inline;} .info p{font-size:0.8em; color:#297aab; display:inline;}
@ -101,9 +115,8 @@ fieldset.install input.txt{width:468px;}
.post .video{} .post .video{}
.post .audio{} .post .audio{}
#foot{ background: transparent url(images/foot_bg.png) top center no-repeat; clear: both;}
#foot { text-align:center; font-size: 10px; color: #000; } #foot { border-top:1px solid #999999; color:#000000; font-size:10px; padding:5px 10px; text-align:center;}
#footer a { color: #000; } #footer a { color: #000; }
@ -163,7 +176,7 @@ div.conversation ul { list-style-type: none; margin: 0px; padding: 0px 0px 0px 1
div.conversation ul li.even { background-color: #e8e8e8; } div.conversation ul li.even { background-color: #e8e8e8; }
/* Tables design */ /* Tables design */
#admin-table {background-color:#F3F5F7; margin:0; width:100%; text-align:left; font-size:12px; border:1px solid #EAECEE;} #admin-table {background-color:#F3F5F7; margin:0 auto; width:95%; text-align:left; font-size:12px; border:1px solid #EAECEE;}
#admin-table thead tr th, #admin-table tfoot tr th {background-color:#BDD3E7; padding:6px;} #admin-table thead tr th, #admin-table tfoot tr th {background-color:#BDD3E7; padding:6px;}
#admin-table thead tr .header {background-image: url(images/bg.gif); background-repeat: no-repeat; background-position: center right; cursor: pointer;} #admin-table thead tr .header {background-image: url(images/bg.gif); background-repeat: no-repeat; background-position: center right; cursor: pointer;}
#admin-table tbody td {color:#3D3D3D; padding:6px; background-color:#FFF; background: url(images/td_back.gif) repeat-x; vertical-align:top;} #admin-table tbody td {color:#3D3D3D; padding:6px; background-color:#FFF; background: url(images/td_back.gif) repeat-x; vertical-align:top;}

View File

@ -98,9 +98,10 @@ if ($user->isAdmin()) {
<div class="box"> <div class="box">
<ul class="menu manage"> <ul class="menu manage">
<h3><?php echo __("Tumblelog options")?></h3> <h3><?php echo __("Tumblelog options")?></h3>
<li><a href="index.php"><?php echo __("Post")?></a></li> <li><a href="<?php echo $conf->urlGelato;?>/admin/index.php"><?php echo __("Post")?></a></li>
<li><a href="admin.php"><?php echo __("Users")?></a></li> <li><a href="<?php echo $conf->urlGelato;?>/admin/admin.php"><?php echo __("Users")?></a></li>
<li><a href="settings.php"><?php echo __("Settings")?></a></li> <li><a href="<?php echo $conf->urlGelato;?>/admin/plugins.php"><?php echo __("Plugins")?></a></li>
<li><a href="<?php echo $conf->urlGelato;?>/admin/settings.php"><?php echo __("Settings")?></a></li>
<li class="selected"><a><?php echo __("Options")?></a></li> <li class="selected"><a><?php echo __("Options")?></a></li>
</ul> </ul>
<?php <?php
@ -212,7 +213,6 @@ if ($user->isAdmin()) {
</li> </li>
<li class="select"><label for="rss_import_frec"><?php echo __("Import feeds every:")?></label> <li class="select"><label for="rss_import_frec"><?php echo __("Import feeds every:")?></label>
<select name="rss_import_frec" id="rss_import_frec"> <select name="rss_import_frec" id="rss_import_frec">
<option value="5 minutes" <?php if($conf->rssImportFrec == '5 minutes') echo "selected=\"selected\""; ?>>5 <?php echo __("minutes");?></option> <option value="5 minutes" <?php if($conf->rssImportFrec == '5 minutes') echo "selected=\"selected\""; ?>>5 <?php echo __("minutes");?></option>
<option value="10 minutes" <?php if($conf->rssImportFrec == '10 minutes') echo "selected=\"selected\""; ?>>10 <?php echo __("minutes");?></option> <option value="10 minutes" <?php if($conf->rssImportFrec == '10 minutes') echo "selected=\"selected\""; ?>>10 <?php echo __("minutes");?></option>
<option value="15 minutes" <?php if($conf->rssImportFrec == '15 minutes') echo "selected=\"selected\""; ?>>15 <?php echo __("minutes");?></option> <option value="15 minutes" <?php if($conf->rssImportFrec == '15 minutes') echo "selected=\"selected\""; ?>>15 <?php echo __("minutes");?></option>

170
admin/plugins.php Normal file
View File

@ -0,0 +1,170 @@
<?php
if(!defined('entry')) define('entry',true);
/* ===========================
gelato CMS - A PHP based tumblelog CMS
development version
http://www.gelatocms.com/
gelato CMS is a free software licensed under the GPL 2.0
Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
=========================== */
?>
<?php
require_once('../entry.php');
global $user, $conf, $tumble;
if ($user->isAdmin()) {
$plugins = array();
if ($handle = opendir(Absolute_Path."plugins")) {
while (false !== ($file = readdir($handle))) {
if (substr($file, strlen($file)-4, 4) == ".php") {
$plugins[] = substr($file, 0, strlen($file)-4);
}
}
closedir($handle);
}
$actives = json_decode($conf->active_plugins,1);
$actives = $actives[1];
if(isset($_POST["btnsubmit"])) {
$actives = array();
foreach($_POST['plugins'] as $plugin => $val){
if($val != 'off'){
$file = $plugin.'.php';
$actives[$plugin] = $file;
}
}
if(!$tumble->saveOption(json_encode(array(array('total'=>count($actives)),$actives)), "active_plugins")){
header("Location: ".$conf->urlGelato."/admin/plugins.php?error=1&desc=".$conf->merror);
die();
}
header("Location: ".$conf->urlGelato."/admin/plugins.php?modified=true");
die();
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>gelato :: <?php echo __("Plugins")?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="gelato cms <?php echo version();?>" />
<link rel="shortcut icon" href="<?php echo $conf->urlGelato;?>/images/favicon.ico" />
<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/jquery.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo $conf->urlGelato;?>/admin/scripts/tools.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#divMessages").fadeOut(5000,function(){
$("#divMessages").css({display:"none"});
});
});
</script>
<style type="text/css" media="screen">
@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
</style>
</head>
<body>
<div id="div-process" style="display:none;"><?php echo __("Processing request&hellip;")?></div>
<div id="cont">
<div id="head">
<h1><a href="<?php echo $conf->urlGelato;?>/admin/index.php" title="gelato :: <?php echo __("home")?>">gelato cms</a></h1>
<ul id="nav">
<li><a href="<?php echo $conf->urlGelato;?>/" title="<?php echo __("Take me to the tumblelog")?>"><?php echo __("Back to the Tumblelog")?></a></li>
</ul>
</div>
<div id="main">
<div class="box">
<ul class="menu manage">
<h3><?php echo __("Tumblelog options")?></h3>
<li><a href="index.php"><?php echo __("Post")?></a></li>
<li><a href="admin.php"><?php echo __("Users")?></a></li>
<li><a href="settings.php"><?php echo __("Settings")?></a></li>
<li><a href="options.php"><?php echo __("Options")?></a></li>
<li class="selected"><a href="plugins.php"><?php echo __("Plugins")?></a></li>
</ul>
<?php
if (isset($_GET["modified"])) {
if ($_GET["modified"]=="true") {
echo "<div class=\"exito\" id=\"divMessages\">".__("The configuration has been modified successfully.")."</div>";
}
}
if (isset($_GET["error"])) {
if ($_GET["error"]==1) {
echo "<div class=\"error\" id=\"divMessages\"><strong>".__("Error on the database server: ")."</strong>".$_GET["des"]."</div>";
}
}
?>
<div class="tabla">
<form action="plugins.php" method="post" id="options_form" autocomplete="off" class="newpost">
<fieldset>
<?php
if(count($plugins) == 0){
echo __('You dont have any plugin installed, get some <a href="http://www.gelatocms.com/">here</a>');
}else{
foreach ($plugins as $key => $plugin) {
//FIXME terminar esto asi se lee la info desde el archivo 'a la' WP
/*
$plugin_data = implode( '', file( Absolute_Path."plugins/".$plugin.'.php' ));
preg_match( '|Plugin Name:(.*)$|mi', $plugin_data, $plugin_name );
preg_match( '|Plugin URI:(.*)$|mi', $plugin_data, $plugin_uri );
preg_match( '|Description:(.*)$|mi', $plugin_data, $description );
preg_match( '|Author:(.*)$|mi', $plugin_data, $author_name );
preg_match( '|Author URI:(.*)$|mi', $plugin_data, $author_uri );
if ( preg_match( "|Version:(.*)|i", $plugin_data, $version ))
$version = trim( $version[1] );
else
$version = '';
$plugin_data = array('Name' => trim($plugin_name[1]), 'URI' => trim($plugin_uri[1]), 'Description' => trim($description[1]), 'Author' => trim($author_name[1]), 'Author_uri' => trim($author_uri[1]), 'Version' => $version);
*/
$desc = __("There is no info for this plugin jet");
$activated = array_key_exists($plugin, $actives);
?>
<ul>
<li class="select">
<label for="<?php echo $key;?>" title="<?php echo $desc; ?>" class="help"><?php echo $plugin; ?></label>
<select name="plugins[<?php echo $plugin; ?>]" id="<?php echo $key;?>">
<option value="on" <?php if($activated) echo 'selected="selected"'; ?>><?php echo __("On")?></option>
<option value="off" <?php if(!$activated) echo 'selected="selected"'; ?>><?php echo __("Off")?></option>
</select>
</li>
<?php
}
?>
</ul>
<?php
}
?>
</fieldset>
<p>
<input type="submit" name="btnsubmit" id="btnsubmit" value="<?php echo __("Modify")?>" class="submit"/>
</p>
</form>
</div>
<div class="footer-box">&nbsp;</div>
</div>
</div>
<div id="foot">
<a href="http://www.gelatocms.com/" title="gelato CMS">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
</div>
</div>
</body>
</html>
<?php
}
} else {
header("Location: ".$conf->urlGelato."/login.php");
}
?>

View File

@ -56,9 +56,10 @@ if ($user->isAdmin()) {
<div class="box"> <div class="box">
<ul class="menu manage"> <ul class="menu manage">
<h3><?php echo __("Tumblelog configuration")?></h3> <h3><?php echo __("Tumblelog configuration")?></h3>
<li><a href="index.php"><?php echo __("Post")?></a></li> <li><a href="<?php echo $conf->urlGelato;?>/admin/index.php"><?php echo __("Post")?></a></li>
<li><a href="admin.php"><?php echo __("Users")?></a></li> <li><a href="<?php echo $conf->urlGelato;?>/admin/admin.php"><?php echo __("Users")?></a></li>
<li><a href="options.php"><?php echo __("Options")?></a></li> <li><a href="<?php echo $conf->urlGelato;?>/admin/plugins.php"><?php echo __("Plugins")?></a></li>
<li><a href="<?php echo $conf->urlGelato;?>/admin/options.php"><?php echo __("Options")?></a></li>
<li class="selected"><a><?php echo __("Settings")?></a></li> <li class="selected"><a><?php echo __("Settings")?></a></li>
</ul> </ul>
<?php <?php

View File

@ -102,6 +102,7 @@
<h3>{__('Manage')}</h3> <h3>{__('Manage')}</h3>
<li><a href="{conf.urlGelato}/admin/settings.php">{__("Settings")}</a></li> <li><a href="{conf.urlGelato}/admin/settings.php">{__("Settings")}</a></li>
<li><a href="{conf.urlGelato}/admin/options.php">{__("Options")}</a></li> <li><a href="{conf.urlGelato}/admin/options.php">{__("Options")}</a></li>
<li><a href="{conf.urlGelato}/admin/plugins.php">{__("Plugins")}</a></li>
<li><a href="{conf.urlGelato}/admin/feeds.php">{__("Feeds")}</a></li> <li><a href="{conf.urlGelato}/admin/feeds.php">{__("Feeds")}</a></li>
<li><a href="{conf.urlGelato}/admin/admin.php">{__("Users")}</a></li> <li><a href="{conf.urlGelato}/admin/admin.php">{__("Users")}</a></li>
<li><a href="{conf.urlGelato}/admin/comments.php">{__("Comments")}</a></li> <li><a href="{conf.urlGelato}/admin/comments.php">{__("Comments")}</a></li>

View File

@ -55,9 +55,12 @@ class configuration {
$this->shorten_links = $this->get_option("shorten_links"); $this->shorten_links = $this->get_option("shorten_links");
$this->rssImportFrec = $this->get_option("rss_import_frec"); $this->rssImportFrec = $this->get_option("rss_import_frec");
$this->check_version = $this->get_option("check_version"); $this->check_version = $this->get_option("check_version");
$this->active_plugins = $this->get_option("active_plugins");
//TODO: Soporte de los plugins desde BD activar/desactivar //TODO: Soporte de los plugins desde BD activar/desactivar
if ($handle = opendir(Absolute_Path."plugins")) { //FIXME cambiar esto por el soporte por carpetas, mas organizado.
// asi se pueden estandarizar documentacion y thumbnails,
/*if ($handle = opendir(Absolute_Path."plugins")) {
while (false !== ($file = readdir($handle))) { while (false !== ($file = readdir($handle))) {
if (substr($file, strlen($file)-4, 4) == ".php") { if (substr($file, strlen($file)-4, 4) == ".php") {
require_once(Absolute_Path."plugins/{$file}"); require_once(Absolute_Path."plugins/{$file}");
@ -65,7 +68,7 @@ class configuration {
} }
} }
closedir($handle); closedir($handle);
} }*/
} else { } else {
if($isFeed) { if($isFeed) {
header("HTTP/1.0 503 Service Unavailable"); header("HTTP/1.0 503 Service Unavailable");

View File

@ -650,24 +650,28 @@ if(!defined('entry') || !entry) die('Not a valid page');
function init_plugins() { function init_plugins() {
global $conf; global $conf;
foreach ($conf->plugins as $index => $plugin) { $actives = json_decode($conf->active_plugins,1);
$actives = $actives[1];
foreach ($actives as $index => $plugin) {
//echo "[".$index."] => ".$plugin."<br />"; //echo "[".$index."] => ".$plugin."<br />";
if (!file_exists(Absolute_Path."plugins/".$plugin.".php")) { if (!file_exists(Absolute_Path."plugins/".$plugin)) {
//echo "\tNo existe el archivo<br />"; //echo "\tNo existe el archivo<br />";
unset($conf->plugins[$index]); unset($actives[$index]);
continue; continue;
}else{
require_once(Absolute_Path.'plugins/'.$plugin);
} }
//echo "\tSi existe el archivo<br />"; //echo "\tSi existe el archivo<br />";
if (!class_exists($plugin)) { if (!class_exists($index)) {
//echo "\tNo existe la clase<br />"; //echo "\tNo existe la clase<br />";
continue; continue;
} }
//echo "\tSi existe la clase<br />"; //echo "\tSi existe la clase<br />";
plugins::$instances[$plugin] = new $plugin; plugins::$instances[$index] = new $index;
/*print_r(plugins::$instances[$plugin]); //print_r(plugins::$instances[$index]);
echo "<br />";*/ //echo "<br />";
} }
/*echo "<br /><br />"; /*echo "<br /><br />";
print_r(plugins::$instances); print_r(plugins::$instances);

View File

@ -64,14 +64,11 @@ if(!defined('entry') || !entry) die('Not a valid page');
return $this->exists[$name] = false; return $this->exists[$name] = false;
} }
function & instance() function & instance(){
{
static $instance; static $instance;
if( !isset($instance) ) { if( !isset($instance) ) {
$instance = new self(); $instance = new self();
} }
return $instance; return $instance;
} }

View File

@ -83,3 +83,4 @@ INSERT INTO `gel_options` VALUES ('offset_city', 'Mexico/General');
INSERT INTO `gel_options` VALUES ('offset_time', '-6'); INSERT INTO `gel_options` VALUES ('offset_time', '-6');
INSERT INTO `gel_options` VALUES ('shorten_links', '0'); INSERT INTO `gel_options` VALUES ('shorten_links', '0');
INSERT INTO `gel_options` VALUES ('rss_import_frec', '5 minutes'); INSERT INTO `gel_options` VALUES ('rss_import_frec', '5 minutes');
INSERT INTO `gel_options` VALUES ('active_plugins', '[{"total":0},[]]');

View File

@ -124,7 +124,6 @@ $theme = new themes;
break; break;
case "2": case "2":
$fileName = "uploads/".getFileName($register["url"]); $fileName = "uploads/".getFileName($register["url"]);
$x = @getimagesize($fileName); $x = @getimagesize($fileName);
if ($x[0] > 500) { if ($x[0] > 500) {
$photoPath = $conf->urlGelato."/classes/imgsize.php?w=500&img=".$register["url"]; $photoPath = $conf->urlGelato."/classes/imgsize.php?w=500&img=".$register["url"];
@ -188,11 +187,11 @@ $theme = new themes;
if($conf->urlFriendly){ if($conf->urlFriendly){
$p->urlFriendly('[...]'); $p->urlFriendly('[...]');
$p->target($conf->urlGelato."/page/[...]"); $p->target($conf->urlGelato."/page/[...]");
}else }else{
$p->target($conf->urlGelato); $p->target($conf->urlGelato);
}
$p->currentPage(isset($page_num) ? $page_num : 1); $p->currentPage(isset($page_num) ? $page_num : 1);
$theme->set('pagination',$p->getPagination()); $theme->set('pagination',$p->getPagination());
} else { } else {
$theme->set('error','No posts in this tumblelog.'); $theme->set('error','No posts in this tumblelog.');

View File

@ -16,22 +16,22 @@ if(!defined('entry')) define('entry',true);
require('entry.php'); require('entry.php');
global $configFile, $db; global $configFile, $db;
if (!file_exists($configFile)) { if (!file_exists($configFile) || true) {
$mensaje = " $mensaje = '
<h3 class=\"important\">Error reading configuration file</h3> <h3 class="importan">'.__("Error reading configuration file").'</h3>
<p>There doesn't 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>
<p>This either means that you did not rename the <code>config-sample.php</code> file to <code>config.php</code>.</p>"; <p>'.__("This either means that you did not rename the <code>config-sample.php</code> file to <code>config.php</code>.").'</p>';
die($mensaje); die($mensaje);
} else { } else {
require_once($configFile); require_once($configFile);
} }
$sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('check_version', '1');"; $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('check_version', '1'), ('active_plugins', '[{\"total\":0},[]]');";
$db->ejecutarConsulta($sqlStr); $db->ejecutarConsulta($sqlStr);
echo "<p><em>Finished!</em></p>"; echo '<p><em>'.__("Finished!").'</em></p>';
echo "<p>Now you are running on the new <strong>gelato vaniglia</strong> version!!!</p>"; echo '<p>'.__("Now you are running on the new <strong>gelato vaniglia</strong> version!!!").'</p>';
echo "<p><a href="index.php">Return to your tumblelog</a></p>"; echo '<p><a href="index.php">'.__("Return to your tumblelog").'</a></p>';
?> ?>