Plugin control panel
New option in options table Some changes in the css some minor adjustments about spaces and tabsmaster
parent
9533dd1cf9
commit
cc6ffa91d1
|
|
@ -60,6 +60,7 @@ if ($user->isAdmin()) {
|
|||
<div class="box">
|
||||
<ul class="menu manage">
|
||||
<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/index.php"><?php echo __("Posts")?></a></li>
|
||||
<li><a href="<?php echo $conf->urlGelato;?>/admin/user.php"><?php echo __("Add user")?></a></li>
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@ fieldset{ border:none; margin:0; padding:0;}
|
|||
|
||||
/*********** 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;}
|
||||
|
||||
#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;}
|
||||
|
||||
|
|
@ -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;}
|
||||
h3{font-size:1.12em; margin:4px; color:#333333; text-indent:20px;}
|
||||
|
||||
.box{ background:#efefef url(images/bg-box.png) left top repeat-y;}
|
||||
.footer-box{background:#fff url(images/bg-foot-box.png) top center no-repeat;}
|
||||
.box{ background:#fff url(images/bg-box.png) center top repeat-y; width:600px;}
|
||||
.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;}
|
||||
.menu{ background:#c1c7cd url(images/bg-top-box.png) top center no-repeat; height:40px; width:559px; list-style-type:none; padding-right:10px;}
|
||||
.box h3{float:left; color:#444444; font-weight:bold; padding:5px 10px 0 0;}
|
||||
.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.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: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;}
|
||||
|
||||
.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;}
|
||||
|
||||
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 li{ margin:4px 0; padding:0; position:relative;}
|
||||
form.newpost li.select{ margin:6px 0;}
|
||||
form.newpost label{}
|
||||
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.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;}
|
||||
|
|
@ -81,7 +95,7 @@ fieldset.install{border:1px solid #dfdfdf; padding:10px;}
|
|||
fieldset.install input.txt{width:468px;}
|
||||
|
||||
.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 p{font-size:0.8em; color:#297aab; display:inline;}
|
||||
|
||||
|
|
@ -101,9 +115,8 @@ fieldset.install input.txt{width:468px;}
|
|||
.post .video{}
|
||||
.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; }
|
||||
|
||||
|
|
@ -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; }
|
||||
|
||||
/* 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 .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;}
|
||||
|
|
|
|||
|
|
@ -98,9 +98,10 @@ if ($user->isAdmin()) {
|
|||
<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="<?php echo $conf->urlGelato;?>/admin/index.php"><?php echo __("Post")?></a></li>
|
||||
<li><a href="<?php echo $conf->urlGelato;?>/admin/admin.php"><?php echo __("Users")?></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>
|
||||
</ul>
|
||||
<?php
|
||||
|
|
@ -210,21 +211,20 @@ if ($user->isAdmin()) {
|
|||
<option value="0" <?php if(!$conf->shorten_links) echo "selected=\"selected\""; ?>><?php echo __("Deactive")?></option>
|
||||
</select>
|
||||
</li>
|
||||
<li class="select"><label for="rss_import_frec"><?php echo __("Import feeds every:")?></label>
|
||||
<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="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="30 minutes" <?php if($conf->rssImportFrec == '30 minutes') echo "selected=\"selected\""; ?>>30 <?php echo __("minutes");?></option>
|
||||
<option value="45 minutes" <?php if($conf->rssImportFrec == '45 minutes') echo "selected=\"selected\""; ?>>45 <?php echo __("minutes");?></option>
|
||||
<option value="1 hour" <?php if($conf->rssImportFrec == '1 hour') echo "selected=\"selected\""; ?>>1 <?php echo __("hour");?></option>
|
||||
<option value="2 hours" <?php if($conf->rssImportFrec == '2 hours') echo "selected=\"selected\""; ?>>2 <?php echo __("hours");?></option>
|
||||
<option value="3 hours" <?php if($conf->rssImportFrec == '3 hours') echo "selected=\"selected\""; ?>>3 <?php echo __("hours");?></option>
|
||||
<option value="4 hours" <?php if($conf->rssImportFrec == '4 hours') echo "selected=\"selected\""; ?>>4 <?php echo __("hours");?></option>
|
||||
<option value="6 hours" <?php if($conf->rssImportFrec == '6 hours') echo "selected=\"selected\""; ?>>6 <?php echo __("hours");?></option>
|
||||
<option value="12 hours" <?php if($conf->rssImportFrec == '12 hours') echo "selected=\"selected\""; ?>>12 <?php echo __("hours");?></option>
|
||||
<option value="1 day" <?php if($conf->rssImportFrec == '1 day') echo "selected=\"selected\""; ?>>24 <?php echo __("hours");?></option>
|
||||
<li class="select"><label for="rss_import_frec"><?php echo __("Import feeds every:")?></label>
|
||||
<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="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="30 minutes" <?php if($conf->rssImportFrec == '30 minutes') echo "selected=\"selected\""; ?>>30 <?php echo __("minutes");?></option>
|
||||
<option value="45 minutes" <?php if($conf->rssImportFrec == '45 minutes') echo "selected=\"selected\""; ?>>45 <?php echo __("minutes");?></option>
|
||||
<option value="1 hour" <?php if($conf->rssImportFrec == '1 hour') echo "selected=\"selected\""; ?>>1 <?php echo __("hour");?></option>
|
||||
<option value="2 hours" <?php if($conf->rssImportFrec == '2 hours') echo "selected=\"selected\""; ?>>2 <?php echo __("hours");?></option>
|
||||
<option value="3 hours" <?php if($conf->rssImportFrec == '3 hours') echo "selected=\"selected\""; ?>>3 <?php echo __("hours");?></option>
|
||||
<option value="4 hours" <?php if($conf->rssImportFrec == '4 hours') echo "selected=\"selected\""; ?>>4 <?php echo __("hours");?></option>
|
||||
<option value="6 hours" <?php if($conf->rssImportFrec == '6 hours') echo "selected=\"selected\""; ?>>6 <?php echo __("hours");?></option>
|
||||
<option value="12 hours" <?php if($conf->rssImportFrec == '12 hours') echo "selected=\"selected\""; ?>>12 <?php echo __("hours");?></option>
|
||||
<option value="1 day" <?php if($conf->rssImportFrec == '1 day') echo "selected=\"selected\""; ?>>24 <?php echo __("hours");?></option>
|
||||
</select>
|
||||
</li>
|
||||
<li class="select"><label for="check_version"><?php echo __("Check for updates:")?></label>
|
||||
|
|
|
|||
|
|
@ -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…")?></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"> </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");
|
||||
}
|
||||
?>
|
||||
|
|
@ -56,9 +56,10 @@ if ($user->isAdmin()) {
|
|||
<div class="box">
|
||||
<ul class="menu manage">
|
||||
<h3><?php echo __("Tumblelog configuration")?></h3>
|
||||
<li><a href="index.php"><?php echo __("Post")?></a></li>
|
||||
<li><a href="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/index.php"><?php echo __("Post")?></a></li>
|
||||
<li><a href="<?php echo $conf->urlGelato;?>/admin/admin.php"><?php echo __("Users")?></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>
|
||||
</ul>
|
||||
<?php
|
||||
|
|
|
|||
|
|
@ -102,7 +102,8 @@
|
|||
<h3>{__('Manage')}</h3>
|
||||
<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/feeds.php">{__("Feeds")}</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/admin.php">{__("Users")}</a></li>
|
||||
<li><a href="{conf.urlGelato}/admin/comments.php">{__("Comments")}</a></li>
|
||||
<li class="selected"><a>{__("Posts")}</a></li>
|
||||
|
|
|
|||
|
|
@ -55,17 +55,20 @@ class configuration {
|
|||
$this->shorten_links = $this->get_option("shorten_links");
|
||||
$this->rssImportFrec = $this->get_option("rss_import_frec");
|
||||
$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
|
||||
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))) {
|
||||
if (substr($file, strlen($file)-4, 4) == ".php") {
|
||||
require_once(Absolute_Path."plugins/{$file}");
|
||||
$this->plugins[] = substr($file, 0, strlen($file)-4);
|
||||
$this->plugins[] = substr($file, 0, strlen($file)-4);
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}*/
|
||||
} else {
|
||||
if($isFeed) {
|
||||
header("HTTP/1.0 503 Service Unavailable");
|
||||
|
|
|
|||
|
|
@ -650,24 +650,28 @@ if(!defined('entry') || !entry) die('Not a valid page');
|
|||
function init_plugins() {
|
||||
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 />";
|
||||
if (!file_exists(Absolute_Path."plugins/".$plugin.".php")) {
|
||||
if (!file_exists(Absolute_Path."plugins/".$plugin)) {
|
||||
//echo "\tNo existe el archivo<br />";
|
||||
unset($conf->plugins[$index]);
|
||||
unset($actives[$index]);
|
||||
continue;
|
||||
}
|
||||
}else{
|
||||
require_once(Absolute_Path.'plugins/'.$plugin);
|
||||
}
|
||||
//echo "\tSi existe el archivo<br />";
|
||||
|
||||
if (!class_exists($plugin)) {
|
||||
if (!class_exists($index)) {
|
||||
//echo "\tNo existe la clase<br />";
|
||||
continue;
|
||||
}
|
||||
//echo "\tSi existe la clase<br />";
|
||||
|
||||
plugins::$instances[$plugin] = new $plugin;
|
||||
/*print_r(plugins::$instances[$plugin]);
|
||||
echo "<br />";*/
|
||||
plugins::$instances[$index] = new $index;
|
||||
//print_r(plugins::$instances[$index]);
|
||||
//echo "<br />";
|
||||
}
|
||||
/*echo "<br /><br />";
|
||||
print_r(plugins::$instances);
|
||||
|
|
|
|||
|
|
@ -19,16 +19,16 @@ if(!defined('entry') || !entry) die('Not a valid page');
|
|||
|
||||
function call($name) {
|
||||
|
||||
if (!$this->exists($name)) {
|
||||
return false;
|
||||
if (!$this->exists($name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*echo "<br />==========<br />";
|
||||
|
||||
/*echo "<br />==========<br />";
|
||||
echo $name;
|
||||
echo "<br />";*/
|
||||
|
||||
$index = 0;
|
||||
foreach (plugins::$instances as $plugin) {
|
||||
foreach (plugins::$instances as $plugin) {
|
||||
if(array_key_exists($index,$this->actions[$name])){
|
||||
$action = $this->actions[$name][$index][1];
|
||||
if (is_callable(array($plugin, $action))) {
|
||||
|
|
@ -64,15 +64,12 @@ if(!defined('entry') || !entry) die('Not a valid page');
|
|||
return $this->exists[$name] = false;
|
||||
}
|
||||
|
||||
function & instance()
|
||||
{
|
||||
static $instance;
|
||||
|
||||
if( !isset($instance) ) {
|
||||
$instance = new self();
|
||||
}
|
||||
|
||||
return $instance;
|
||||
function & instance(){
|
||||
static $instance;
|
||||
if( !isset($instance) ) {
|
||||
$instance = new self();
|
||||
}
|
||||
return $instance;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 ('shorten_links', '0');
|
||||
INSERT INTO `gel_options` VALUES ('rss_import_frec', '5 minutes');
|
||||
INSERT INTO `gel_options` VALUES ('active_plugins', '[{"total":0},[]]');
|
||||
|
|
|
|||
205
index.php
205
index.php
|
|
@ -20,38 +20,38 @@ global $user, $tumble, $conf;
|
|||
$theme = new themes;
|
||||
// Our first approach to MVC... our second? visit http://www.flavorphp.com
|
||||
|
||||
if(isset($_SERVER['PATH_INFO'])) $param_url = explode("/",$_SERVER['PATH_INFO']);
|
||||
if(isset($_SERVER['PATH_INFO'])) $param_url = explode("/",$_SERVER['PATH_INFO']);
|
||||
|
||||
if (isset($_GET["post"])) {
|
||||
$id_post = $_GET["post"];
|
||||
if (!is_numeric($id_post) || $id_post < 1 ){
|
||||
if (isset($_GET["post"])) {
|
||||
$id_post = $_GET["post"];
|
||||
if (!is_numeric($id_post) || $id_post < 1 ){
|
||||
header("Location: index.php");
|
||||
}
|
||||
} else {
|
||||
if (isset($param_url[1]) && $param_url[1]=="post") {
|
||||
$id_post = (isset($param_url[2])) ? ((is_numeric($param_url[2])) ? $param_url[2] : NULL) : NULL;
|
||||
} else {
|
||||
$id_post = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (isset($param_url[1]) && $param_url[1]=="post") {
|
||||
$id_post = (isset($param_url[2])) ? ((is_numeric($param_url[2])) ? $param_url[2] : NULL) : NULL;
|
||||
} else {
|
||||
$id_post = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
$theme->set('id_post',$id_post);
|
||||
$theme->set('id_post',$id_post);
|
||||
$theme->set('error','');
|
||||
|
||||
if (isset($_GET["page"])) {
|
||||
$page_num = $_GET["page"];
|
||||
} else {
|
||||
if (isset($param_url[1]) && $param_url[1]=="page") {
|
||||
$page_num = (isset($param_url[2])) ? ((is_numeric($param_url[2])) ? $param_url[2] : NULL) : NULL;
|
||||
} else {
|
||||
$page_num = NULL;
|
||||
}
|
||||
}
|
||||
if (isset($_GET["page"])) {
|
||||
$page_num = $_GET["page"];
|
||||
} else {
|
||||
if (isset($param_url[1]) && $param_url[1]=="page") {
|
||||
$page_num = (isset($param_url[2])) ? ((is_numeric($param_url[2])) ? $param_url[2] : NULL) : NULL;
|
||||
} else {
|
||||
$page_num = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
$feed_url = $conf->urlGelato.($conf->urlFriendly?"/rss/":"/rss.php");
|
||||
|
||||
$gelato_includes = "<meta name=\"generator\" content=\"gelato ".codeName()." (".version().")\" />\n";
|
||||
$gelato_includes .= "\t<link rel=\"shortcut icon\" href=\"".$conf->urlGelato."/images/favicon.ico\" />";
|
||||
$gelato_includes = "<meta name=\"generator\" content=\"gelato ".codeName()." (".version().")\" />\n";
|
||||
$gelato_includes .= "\t<link rel=\"shortcut icon\" href=\"".$conf->urlGelato."/images/favicon.ico\" />";
|
||||
|
||||
$page_title = $conf->title;
|
||||
$page_title_divisor = " » "; // it should be set in configuration
|
||||
|
|
@ -83,54 +83,53 @@ $theme = new themes;
|
|||
$theme->set('allowComments',$conf->allowComments);
|
||||
|
||||
$theme->set('isAuthenticated',$user->isAuthenticated());
|
||||
if($user->isAuthenticated()){
|
||||
if($user->isAuthenticated()){
|
||||
$theme->set('User',$_SESSION["user_login"]);
|
||||
$theme->set('URL_Tumble',$conf->urlGelato);
|
||||
}
|
||||
}
|
||||
|
||||
$rows = array();
|
||||
if(!$id_post){
|
||||
$limit=$conf->postLimit;
|
||||
if(!$id_post){
|
||||
$limit=$conf->postLimit;
|
||||
|
||||
if(isset($page_num) && is_numeric($page_num) && $page_num>0) { // Is defined the page and is numeric?
|
||||
$from = (($page_num-1) * $limit);
|
||||
} else {
|
||||
$from = 0;
|
||||
}
|
||||
if(isset($page_num) && is_numeric($page_num) && $page_num>0) { // Is defined the page and is numeric?
|
||||
$from = (($page_num-1) * $limit);
|
||||
} else {
|
||||
$from = 0;
|
||||
}
|
||||
|
||||
$rs = $tumble->getPosts($limit, $from);
|
||||
$rs = $tumble->getPosts($limit, $from);
|
||||
|
||||
if ($tumble->contarRegistros()>0) {
|
||||
$dateTmp = null;
|
||||
while($register = mysql_fetch_assoc($rs)) {
|
||||
if ($tumble->contarRegistros()>0) {
|
||||
$dateTmp = null;
|
||||
while($register = mysql_fetch_assoc($rs)) {
|
||||
$formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
|
||||
if ( $dateTmp != null && $formatedDate == $dateTmp ) { $formatedDate = ""; } else { $dateTmp = $formatedDate; }
|
||||
if ( $dateTmp != null && $formatedDate == $dateTmp ) { $formatedDate = ""; } else { $dateTmp = $formatedDate; }
|
||||
|
||||
$permalink = $tumble->getPermalink($register["id_post"]);
|
||||
|
||||
$conversation = $register["description"];
|
||||
|
||||
$register["title"] = stripslashes($register["title"]);
|
||||
$register["description"] = stripslashes($register["description"]);
|
||||
$register["title"] = stripslashes($register["title"]);
|
||||
$register["description"] = stripslashes($register["description"]);
|
||||
|
||||
$row['Date_Added'] = $formatedDate;
|
||||
$row['Permalink'] = $permalink;
|
||||
$row['postType'] = type2Text($register["type"]);
|
||||
|
||||
switch ($register['type']){
|
||||
case "1":
|
||||
$row['Title'] = $register["title"];
|
||||
$row['Body'] = $register["description"];
|
||||
break;
|
||||
case "2":
|
||||
$fileName = "uploads/".getFileName($register["url"]);
|
||||
|
||||
$x = @getimagesize($fileName);
|
||||
if ($x[0] > 500) {
|
||||
switch ($register['type']){
|
||||
case "1":
|
||||
$row['Title'] = $register["title"];
|
||||
$row['Body'] = $register["description"];
|
||||
break;
|
||||
case "2":
|
||||
$fileName = "uploads/".getFileName($register["url"]);
|
||||
$x = @getimagesize($fileName);
|
||||
if ($x[0] > 500) {
|
||||
$photoPath = $conf->urlGelato."/classes/imgsize.php?w=500&img=".$register["url"];
|
||||
} else {
|
||||
} else {
|
||||
$photoPath = str_replace("../", $conf->urlGelato."/", $register["url"]);
|
||||
}
|
||||
}
|
||||
|
||||
$effect = " href=\"".str_replace("../", $conf->urlGelato."/", $register["url"])."\" rel=\"lightbox\"";
|
||||
|
||||
|
|
@ -138,13 +137,13 @@ $theme = new themes;
|
|||
$row['PhotoAlt'] = strip_tags($register["description"]);
|
||||
$row['Caption'] = $register["description"];
|
||||
$row['Effect'] = $effect;
|
||||
break;
|
||||
case "3":
|
||||
$row['Quote'] = $register["description"];
|
||||
$row['Source'] = $register["title"];
|
||||
break;
|
||||
break;
|
||||
case "3":
|
||||
$row['Quote'] = $register["description"];
|
||||
$row['Source'] = $register["title"];
|
||||
break;
|
||||
case "4":
|
||||
if($conf->shorten_links){
|
||||
if($conf->shorten_links){
|
||||
$register["url"] = _file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
|
||||
}
|
||||
$register["title"] = ($register["title"]=="")? $register["url"] : $register["title"];
|
||||
|
|
@ -152,20 +151,20 @@ $theme = new themes;
|
|||
$row['URL'] = $register["url"];
|
||||
$row['Name'] = $register["title"];
|
||||
$row['Description'] = $register["description"];
|
||||
break;
|
||||
case "5":
|
||||
$row['Title'] = $register["title"];
|
||||
$row['Conversation'] = $tumble->formatConversation($conversation);
|
||||
break;
|
||||
case "6":
|
||||
$row['Video'] = $tumble->getVideoPlayer($register["url"]);
|
||||
$row['Caption'] = $register["description"];
|
||||
break;
|
||||
case "7":
|
||||
$row['Mp3'] = $tumble->getMp3Player($register["url"]);
|
||||
$row['Caption'] = $register["description"];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case "5":
|
||||
$row['Title'] = $register["title"];
|
||||
$row['Conversation'] = $tumble->formatConversation($conversation);
|
||||
break;
|
||||
case "6":
|
||||
$row['Video'] = $tumble->getVideoPlayer($register["url"]);
|
||||
$row['Caption'] = $register["description"];
|
||||
break;
|
||||
case "7":
|
||||
$row['Mp3'] = $tumble->getMp3Player($register["url"]);
|
||||
$row['Caption'] = $register["description"];
|
||||
break;
|
||||
}
|
||||
|
||||
$comment = new comments();
|
||||
$noComments = $comment->countComments($register["id_post"]);
|
||||
|
|
@ -182,23 +181,23 @@ $theme = new themes;
|
|||
$trigger->call('post_content');
|
||||
$theme->set('rows',$rows);
|
||||
|
||||
$p = new pagination;
|
||||
$p->Items($tumble->getPostsNumber());
|
||||
$p->limit($limit);
|
||||
$p = new pagination;
|
||||
$p->Items($tumble->getPostsNumber());
|
||||
$p->limit($limit);
|
||||
if($conf->urlFriendly){
|
||||
$p->urlFriendly('[...]');
|
||||
$p->target($conf->urlGelato."/page/[...]");
|
||||
}else
|
||||
}else{
|
||||
$p->target($conf->urlGelato);
|
||||
}
|
||||
|
||||
$p->currentPage(isset($page_num) ? $page_num : 1);
|
||||
|
||||
$theme->set('pagination',$p->getPagination());
|
||||
} else {
|
||||
$theme->set('error','No posts in this tumblelog.');
|
||||
}
|
||||
} else {
|
||||
$register = $tumble->getPost($id_post);
|
||||
$p->currentPage(isset($page_num) ? $page_num : 1);
|
||||
$theme->set('pagination',$p->getPagination());
|
||||
} else {
|
||||
$theme->set('error','No posts in this tumblelog.');
|
||||
}
|
||||
} else {
|
||||
$register = $tumble->getPost($id_post);
|
||||
|
||||
$formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
|
||||
$permalink = $tumble->getPermalink($register["id_post"]);
|
||||
|
|
@ -208,26 +207,26 @@ $theme = new themes;
|
|||
$register["description"] = $register["description"];
|
||||
|
||||
$register["title"] = stripslashes($register["title"]);
|
||||
$register["description"] = stripslashes($register["description"]);
|
||||
$register["description"] = stripslashes($register["description"]);
|
||||
|
||||
$row['Date_Added'] = $formatedDate;
|
||||
$row['Permalink'] = $permalink;
|
||||
$row['postType'] = type2Text($register["type"]);
|
||||
|
||||
switch ($register['type']) {
|
||||
case "1":
|
||||
switch ($register['type']) {
|
||||
case "1":
|
||||
$row['Title'] = $register["title"];
|
||||
$row['Body'] = $register["description"];
|
||||
break;
|
||||
case "2":
|
||||
$fileName = "uploads/".getFileName($register["url"]);
|
||||
break;
|
||||
case "2":
|
||||
$fileName = "uploads/".getFileName($register["url"]);
|
||||
|
||||
$x = @getimagesize($fileName);
|
||||
if ($x[0] > 500) {
|
||||
$x = @getimagesize($fileName);
|
||||
if ($x[0] > 500) {
|
||||
$photoPath = $conf->urlGelato."/classes/imgsize.php?w=500&img=".$register["url"];
|
||||
} else {
|
||||
} else {
|
||||
$photoPath = str_replace("../", $conf->urlGelato."/", $register["url"]);
|
||||
}
|
||||
}
|
||||
|
||||
$effect = " href=\"".str_replace("../", $conf->urlGelato."/", $register["url"])."\" rel=\"lightbox\"";
|
||||
|
||||
|
|
@ -235,20 +234,20 @@ $theme = new themes;
|
|||
$row['PhotoAlt'] = strip_tags($register["description"]);
|
||||
$row['Caption'] = $register["description"];
|
||||
$row['Effect'] = $effect;
|
||||
break;
|
||||
case "3":
|
||||
break;
|
||||
case "3":
|
||||
$row['Quote'] = $register["description"];
|
||||
$row['Source'] = $register["title"];
|
||||
break;
|
||||
case "4":
|
||||
if($conf->shorten_links){
|
||||
$row['Source'] = $register["title"];
|
||||
break;
|
||||
case "4":
|
||||
if($conf->shorten_links){
|
||||
$register["url"] = _file_get_contents("http://api.abbrr.com/api.php?out=link&url=".$register["url"]);
|
||||
}
|
||||
$row['URL'] = $register["url"];
|
||||
$row['Name'] = $register["title"];
|
||||
$row['Description'] = $register["description"];
|
||||
break;
|
||||
case "5":
|
||||
break;
|
||||
case "5":
|
||||
$row['Title'] = $register["title"];
|
||||
$row['Conversation'] = $tumble->formatConversation($conversation);
|
||||
break;
|
||||
|
|
@ -313,6 +312,6 @@ $theme = new themes;
|
|||
$theme->set('rows',$rows);
|
||||
}
|
||||
|
||||
$theme->set('URL_Tumble',$conf->urlGelato);
|
||||
$theme->set('URL_Tumble',$conf->urlGelato);
|
||||
$theme->display(Absolute_Path.'themes/'.$conf->template.'/index.htm');
|
||||
?>
|
||||
18
update.php
18
update.php
|
|
@ -16,22 +16,22 @@ if(!defined('entry')) define('entry',true);
|
|||
require('entry.php');
|
||||
global $configFile, $db;
|
||||
|
||||
if (!file_exists($configFile)) {
|
||||
$mensaje = "
|
||||
<h3 class=\"important\">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>This either means that you did not rename the <code>config-sample.php</code> file to <code>config.php</code>.</p>";
|
||||
if (!file_exists($configFile) || true) {
|
||||
$mensaje = '
|
||||
<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>'.__("This either means that you did not rename the <code>config-sample.php</code> file to <code>config.php</code>.").'</p>';
|
||||
die($mensaje);
|
||||
} else {
|
||||
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);
|
||||
|
||||
echo "<p><em>Finished!</em></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><em>'.__("Finished!").'</em></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>';
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue