Some changes and bug fixes.

master
Victor De la Rocha 2008-10-24 06:51:48 +00:00
parent 77cb58b951
commit 11022c204d
3 changed files with 50 additions and 50 deletions

View File

@ -21,9 +21,9 @@ if ($user->isAdmin()) {
if(isset($_POST["btnAdd"])) {
unset($_POST["btnAdd"]);
if ($_POST["type"]=="2") { // is Photo type
if (isset($_POST["url"]) && $_POST["url"]!="") {
if ($_POST["type"]=="2") { // is Photo type
if (isset($_POST["url"]) && $_POST["url"]!="") {
$photoName = getFileName($_POST["url"]);
if (!$tumble->savePhoto($_POST["url"])) {
header("Location: ".$conf->urlGelato."/admin/index.php?photo=false");
@ -31,15 +31,15 @@ if ($user->isAdmin()) {
}
$_POST["url"] = "../uploads/".sanitizeName($photoName);
}
if ( move_uploaded_file( $_FILES['photo']['tmp_name'], "../uploads/".sanitizeName($_FILES['photo']['name']) ) ) {
$_POST["url"] = "../uploads/".sanitizeName($_FILES['photo']['name']);
}
unset($_POST["photo"]);
unset($_POST["MAX_FILE_SIZE"]);
}
if ($_POST["type"]=="7") { // is MP3 type
set_time_limit(300);
$mp3Name = getFileName($_POST["url"]);
@ -50,22 +50,22 @@ if ($user->isAdmin()) {
if (isMP3($remoteFileName)) {
$_POST["url"] = $conf->urlGelato."/uploads/".$mp3Name;
}
}
if (!get_magic_quotes_gpc()) {
}
if (!get_magic_quotes_gpc()) {
$_POST["title"] = addslashes($_POST["title"]);
$_POST["description"] = addslashes($_POST["description"]);
}
$textile = new Textile();
$_POST["title"] = $textile->TextileThis(removeBadTags($_POST["title"]));
$_POST["description"] = $textile->TextileThis(removeBadTags($_POST["description"]));
if ($tumble->addPost($_POST)) {
$input = array("{type}");
$output = array("1");
$template->cargarPlantilla($input, $output, "template_bm");
$template->mostrarPlantilla();
die();
@ -74,14 +74,14 @@ if ($user->isAdmin()) {
die();
}
} else {
if (isset($_GET["url"])) {
$url = $_GET["url"];
} else {
$url = null;
}
if (isset($url)) {
if (isset($url)) {
if (isMP3($url)) {
$postType = "mp3";
} elseif (isGoEar($url)) {
@ -97,11 +97,11 @@ if ($user->isAdmin()) {
$postType = "url";
}
}
} else {
die(__("Must be a valid URL"));
} else {
die(__("Must be a valid URL"));
}
?>
?>
<!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>
@ -110,11 +110,11 @@ if ($user->isAdmin()) {
<title>gelato :: <?php echo __("bookmarklet")?></title>
<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/tools.js"></script>
<style type="text/css" media="screen">
<style type="text/css" media="screen">
@import "<?php echo $conf->urlGelato;?>/admin/css/style.css";
</style>
</head>
<body>
<div id="cont">
<div id="main">
@ -131,69 +131,69 @@ if ($user->isAdmin()) {
case "photo":
?>
<li class="selected"><a href="#"><img src="css/images/image.png" alt="New picture" /> <?php echo __("Picture")?></a></li>
<?php
<?php
break;
case "url":
?>
<li class="selected"><a href="#"><img src="css/images/world.png" alt="New link" /> <?php echo __("Link")?></a></li>
<?php
break;
<?php
break;
case "video":
?>
<li class="selected"><a href="#"><img src="css/images/film.png" alt="New video" /> <?php echo __("Video")?></a></li>
<?php
<?php
break;
case "mp3":
?>
<li class="selected"><a href="#"><img src="css/images/music.png" alt="New audio" /> <?php echo __("Audio")?></a></li>
<?php
<?php
break;
}
?>
?>
</ul>
<p>&nbsp;</p>
<form action="bm.php" method="post" <?php echo (isset($_GET["new"]) && $_GET["new"]=="photo") ? "enctype=\"multipart/form-data\"" : ""?> name="frmAdd" class="newpost">
<fieldset>
<?php
<?php
$date = gmmktime();
$title = "";
$body = (isset($_GET["sel"])) ? $_GET["sel"] : "";
$url = (isset($url)) ? $url : "";
switch ($postType) {
case "post":
$input = array("{type}", "{date}", "{id_user}", "{editTitle}", "{editBody}");
$output = array("1", $date, $_SESSION['user_id'], $title, $body);
$template->cargarPlantilla($input, $output, "template_add_post");
$template->mostrarPlantilla();
break;
case "photo":
$input = array("{type}", "{date}", "{id_user}", "{editUrl}", "{editBody}");
$output = array("2", $date, $_SESSION['user_id'], $url, $body);
$template->cargarPlantilla($input, $output, "template_add_photo_bm");
$template->mostrarPlantilla();
$template->mostrarPlantilla();
break;
case "url":
$input = array("{type}", "{date}", "{id_user}", "{editTitle}", "{editUrl}", "{editBody}");
$output = array("4", $date, $_SESSION['user_id'], $title, $url, $body);
$template->cargarPlantilla($input, $output, "template_add_link");
$template->mostrarPlantilla();
break;
break;
case "video":
$input = array("{type}", "{date}", "{id_user}", "{editUrl}", "{editBody}");
$output = array("6", $date, $_SESSION['user_id'], $url, $body);
$template->cargarPlantilla($input, $output, "template_add_video");
$template->mostrarPlantilla();
break;
case "mp3":
$input = array("{type}", "{date}", "{id_user}", "{editUrl}", "{editBody}");
$output = array("7", $date, $_SESSION['user_id'], $url, $body);
$template->cargarPlantilla($input, $output, "template_add_mp3");
$template->mostrarPlantilla();
break;
@ -203,10 +203,10 @@ if ($user->isAdmin()) {
<span style="color: rgb(136, 136, 136); margin-bottom: 10px; font-size: 10px;"><a href="http://hobix.com/textile/">Textile</a> <?php echo __("syntax is supported.")?></span>
</p>
<p>
<input class="btn" type="submit" name="btnAdd" value="<?php echo ($isEdition) ? "Modify" : "Create"; ?> post" />
<input class="btn" type="submit" name="btnAdd" value="Create post" />
</p>
</fieldset>
</form>
</form>
<div class="footer-box">&nbsp;</div>
</div>
@ -220,7 +220,7 @@ if ($user->isAdmin()) {
</div>
</body>
</html>
<?php
<?php
} else {
header("Location: ".$conf->urlGelato."/login.php");
}

View File

@ -16,7 +16,7 @@ require_once('entry.php');
$configFile = Absolute_Path."config.php";
if(file_exists($configFile)){
require($configFile);
require_once($configFile);
}else{
exit("You need to rename config-sample.php to config.php and fill out the required details.");
}

View File

@ -1,5 +1,5 @@
<?php
if(!defined('entry')) define('entry',true);
if(!defined('entry')) define('entry',true);
/* ===========================
gelato CMS - A PHP based tumblelog CMS
@ -15,27 +15,27 @@ 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>
<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>";
die($mensaje);
} else {
require($configFile);
require_once($configFile);
}
$sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('shorten_links', '0');";
$db->ejecutarConsulta($sqlStr);
$sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('rss_import_frec', '5 minutes');";
$db->ejecutarConsulta($sqlStr);
$sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('check_version', '1');";
$db->ejecutarConsulta($sqlStr);
$sqlStr = "CREATE TABLE `".Table_prefix."feeds` (