Autoclose window after use the bookmarklet, and minor changes in order to release the 0.95

master
pecesama 2007-10-26 05:40:39 +00:00
parent 6876d2650b
commit 574e4b1d4d
6 changed files with 147 additions and 7 deletions

View File

@ -61,7 +61,13 @@ if ($user->isAdmin()) {
$_POST["description"] = strip_tags($_POST["description"]);
if ($tumble->addPost($_POST)) {
header("Location: ".$conf->urlGelato."/admin/index.php?added=true");
//header("Location: ".$conf->urlGelato."/admin/index.php?added=true");
//die();
$input = array("{type}");
$output = array("1");
$template->cargarPlantilla($input, $output, "template_bm");
$template->mostrarPlantilla();
die();
} else {
header("Location: ".$conf->urlGelato."/admin/index.php?error=2&des=".$this->merror);
@ -146,7 +152,7 @@ if ($user->isAdmin()) {
?>
</ul>
<p>&nbsp;</p>
<form action="index.php" method="post" <?php echo (isset($_GET["new"]) && $_GET["new"]=="photo") ? "enctype=\"multipart/form-data\"" : ""?> name="frmAdd" class="newpost">
<form action="bm.php" method="post" <?php echo (isset($_GET["new"]) && $_GET["new"]=="photo") ? "enctype=\"multipart/form-data\"" : ""?> name="frmAdd" class="newpost">
<fieldset>
<?php
$date = gmmktime();
@ -166,7 +172,7 @@ if ($user->isAdmin()) {
$input = array("{type}", "{date}", "{id_user}", "{editUrl}", "{editBody}");
$output = array("2", $date, $_SESSION['user_id'], $url, $body);
$template->cargarPlantilla($input, $output, "template_add_photo");
$template->cargarPlantilla($input, $output, "template_add_photo_bm");
$template->mostrarPlantilla();
break;
case "url":

View File

@ -0,0 +1,66 @@
<div id="photo_upload">
</div>
<div id="photo_url">
<label for="description">Photo URL</label>
<input class="input-text" type="text" name="url" id="url" size="80" value="{editUrl}" />
</div>
<div>
<label for="description" style="display:block;">Caption <span class="option">(optional)</span></label>
<textarea rows="12" cols="84" name="description" id="description">{editBody}</textarea>
</div>
<input type="hidden" name="title" id="title" value="" />
<input type="hidden" name="MAX_FILE_SIZE" value="10485760" />
<input type="hidden" name="type" id="type" value="{type}" />
<input type="hidden" name="date" id="date" value="{date}" />
<input type="hidden" name="id_user" id="id_user" value="{id_user}" />
<script>
$('#photo_upload').css('display','none');
$("#autosave").validate({
rules: {
photo: {
required: function() {
return ($('#photo_upload').css('display')!= 'none') ? true : false;
},
accept: "(jpe?g|gif|png)"
},
url: {
required: function() {
return ($('#photo_url').css('display')!= 'none') ? true : false;
},
url: true
}
},
errorElement: "span",
errorClass: "validate_span",
errorPlacement: function(label, element) {
label.prependTo(element.prev())
}
});
$("#photo_upload a.linkFrm").click( function() {
$('#photo_upload').css('display','none');
$('#photo_url').css('display','block');
$('#photo').val('');
return false;
}
);
$("#photo_url a.linkFrm").click( function() {
$('#photo_url').css('display','none');
$('#photo_upload').css('display','block');
$('#url').val('');
return false;
}
);
</script>

View File

@ -0,0 +1,57 @@
<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>gelato bookmarklet</title>
<style type="text/css">
body {
background-color: #e1e1e1;
margin: 0px;
font: Normal 15px 'Trebuchet MS',Verdana,Helvetica,sans-serif;
text-align: center;
}
div#content {
margin: 137px 30px 0px 30px;
padding: 15px;
}
</style>
<script type="text/javascript">
function countdown_func() {
var prefix = 'or wait ';
countdown--;
el = document.getElementById('countdown');
if (countdown == 1) {
el.firstChild.nodeValue =
prefix + countdown + ' second.';
} else if (countdown > 0) {
el.firstChild.nodeValue =
prefix + countdown + ' seconds.';
} else {
self.close();
}
if (countdown > 0) setTimeout('countdown_func()', 1000);
}
var countdown = 3;
</script>
</head>
<body>
<div id="content">
<div style="margin-bottom:10px; font-size:40px; color:#777;">Done!</div>
<a href="#" onclick="javascript:self.close(); return false;"
style="color:#777;">Close this window</a>
<span id="countdown" style="color:#777;">
or wait 3 seconds.
</span>
</div>
<script type="text/javascript">
setTimeout('countdown_func()', 1000);
</script>
</body>
</html>

View File

@ -123,7 +123,7 @@ class Install {
$sqlStr[] = "INSERT INTO `".Table_prefix."config` VALUES (". $this->data['posts_limit'] .", '".$this->data['title']."', '".$this->data['description']."', '".$this->data['lang']."', '".$this->data['template']."', '".$this->data['url_installation']."');";
$sqlStr[] = "INSERT INTO `".Table_prefix."users` VALUES ('', '', '".$this->data['login']."', '".md5($this->data['password'])."', '".$this->data['email']."', '".$this->data['website']."', '".$this->data['about']."');";
$sqlStr[] = "INSERT INTO `".Table_prefix."options` VALUES ('url_friendly', '1');";
$sqlStr[] = "INSERT INTO `".Table_prefix."options` VALUES ('url_friendly', '0');";
$sqlStr[] = "INSERT INTO `".Table_prefix."options` VALUES ('rich_text', '0');";
$sqlStr[] = "INSERT INTO `".Table_prefix."options` VALUES ('allow_comments', '0');";
$sqlStr[] = "INSERT INTO `".Table_prefix."options` VALUES ('offset_city', '".$this->data['offset_city']."');";

View File

@ -6,18 +6,28 @@
* If you installed gelato in the root directory, you should visit: http://example.com/install.php
* If you installed gelato in its own subdirectory called tumblelog, for example, you should visit: http://example.com/tumblelog/install.php
4) Set CHMOD / permission ( Chmod 777 ) to the folder 'uploads' and the folder 'uploads/CACHE'
5) REMOVE the install.php and update.php files.
That's it! gelato should now be installed.
==== How to update to v0.95 RC1 from v0.90 version =====
==== How to update to v0.95 from v0.90 version =====
1) Download and unzip the gelato package, if you haven't already.
2) Create a backup of your config.php file.
3) Replace all the old files with those from the new 0.95 RC1.
3) Replace all the old files with those from the new 0.95.
4) Rename the config-sample.php file to config.php.
5) Open config.php in your favorite text editor and fill in your database details (using the information on your old config.php).
4) Execute the update.php file.
7) Set CHMOD / permission ( Chmod 777 ) to the folder 'uploads' and the folder 'uploads/CACHE'.
8) REMOVE the install.php and update.php files.
That's it! gelato should now be updated.
==== How to update to v0.95 from v0.95 RC1 version =====
1) Download and unzip the gelato package, if you haven't already.
2) Replace all the old files with those from the new 0.95.
3) REMOVE the install.php and update.php files.
That's it! gelato should now be updated.
@ -34,6 +44,7 @@ That's it! gelato should now be updated.
6) Place the gelato files in the desired location on your web server.
Note: The test data on the script /db/gelato_db.sql point the installation to http://localhost/gelato
7) Set CHMOD / permission ( Chmod 777 ) to the folder 'uploads' and the folder 'uploads/CACHE'
8) REMOVE the install.php and update.php files.
That's it! gelato should now be installed.
Demo user: admin

View File

@ -58,6 +58,6 @@ if(!is_dir('upload/CACHE')){
}
echo "<p><em>Finished!</em></p>";
echo "<p>Now you are running on the new <strong>gelato cioccolato RC1</strong> version!!!</p>";
echo "<p>Now you are running on the new <strong>gelato cioccolato</strong> version!!!</p>";
?>