Quellcode durchsuchen

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

pecesama vor 17 Jahren
Ursprung
Commit
574e4b1d4d

+ 9 - 3
admin/bm.php Datei anzeigen

@@ -61,7 +61,13 @@ if ($user->isAdmin()) {
61 61
 		$_POST["description"] = strip_tags($_POST["description"]);
62 62
 		
63 63
 		if ($tumble->addPost($_POST)) {
64
-			header("Location: ".$conf->urlGelato."/admin/index.php?added=true");
64
+			//header("Location: ".$conf->urlGelato."/admin/index.php?added=true");
65
+			//die();
66
+			$input = array("{type}");
67
+			$output = array("1");
68
+			
69
+			$template->cargarPlantilla($input, $output, "template_bm");
70
+			$template->mostrarPlantilla();
65 71
 			die();
66 72
 		} else {
67 73
 			header("Location: ".$conf->urlGelato."/admin/index.php?error=2&des=".$this->merror);
@@ -146,7 +152,7 @@ if ($user->isAdmin()) {
146 152
 ?>					
147 153
 					</ul>
148 154
 					<p>&nbsp;</p>
149
-					<form action="index.php" method="post" <?php echo (isset($_GET["new"]) && $_GET["new"]=="photo") ? "enctype=\"multipart/form-data\"" : ""?> name="frmAdd" class="newpost">
155
+					<form action="bm.php" method="post" <?php echo (isset($_GET["new"]) && $_GET["new"]=="photo") ? "enctype=\"multipart/form-data\"" : ""?> name="frmAdd" class="newpost">
150 156
 						<fieldset>
151 157
 <?php					
152 158
 							$date = gmmktime();
@@ -166,7 +172,7 @@ if ($user->isAdmin()) {
166 172
 									$input = array("{type}", "{date}", "{id_user}", "{editUrl}", "{editBody}");
167 173
 									$output = array("2", $date, $_SESSION['user_id'], $url, $body);
168 174
 									
169
-									$template->cargarPlantilla($input, $output, "template_add_photo");
175
+									$template->cargarPlantilla($input, $output, "template_add_photo_bm");
170 176
 									$template->mostrarPlantilla();							   
171 177
 									break;
172 178
 								case "url":

+ 66 - 0
admin/themes/admin/template_add_photo_bm.htm Datei anzeigen

@@ -0,0 +1,66 @@
1
+
2
+
3
+	<div id="photo_upload">
4
+		
5
+	</div>
6
+
7
+	<div id="photo_url">
8
+		<label for="description">Photo URL</label>
9
+		<input class="input-text" type="text" name="url" id="url" size="80" value="{editUrl}" />
10
+	</div>
11
+
12
+	<div>
13
+		<label for="description" style="display:block;">Caption <span class="option">(optional)</span></label>
14
+		<textarea rows="12" cols="84" name="description" id="description">{editBody}</textarea>											
15
+	</div>
16
+
17
+	<input type="hidden" name="title" id="title" value="" />
18
+	<input type="hidden" name="MAX_FILE_SIZE" value="10485760" />
19
+	<input type="hidden" name="type" id="type" value="{type}" />
20
+	<input type="hidden" name="date" id="date" value="{date}" />
21
+	<input type="hidden" name="id_user" id="id_user" value="{id_user}" />
22
+
23
+
24
+
25
+
26
+	<script>
27
+		$('#photo_upload').css('display','none');	
28
+		$("#autosave").validate({
29
+			rules: {				
30
+				photo: { 
31
+					required:  function() {
32
+ 						return ($('#photo_upload').css('display')!= 'none') ? true : false;
33
+  					},
34
+					accept: "(jpe?g|gif|png)" 
35
+				},
36
+ 				url: { 
37
+					required:  function() {
38
+ 						return ($('#photo_url').css('display')!= 'none') ? true : false;
39
+  					},
40
+					url: true
41
+				}
42
+			},
43
+			errorElement: "span",
44
+			errorClass: "validate_span", 
45
+			errorPlacement: function(label, element) { 
46
+				label.prependTo(element.prev())
47
+			}			 
48
+		});
49
+
50
+		$("#photo_upload a.linkFrm").click( function() {
51
+				$('#photo_upload').css('display','none');				
52
+				$('#photo_url').css('display','block'); 
53
+				$('#photo').val(''); 
54
+				return false;
55
+			} 
56
+		);
57
+		
58
+		$("#photo_url a.linkFrm").click( function() {
59
+				$('#photo_url').css('display','none');				
60
+				$('#photo_upload').css('display','block'); 
61
+				$('#url').val(''); 
62
+				return false;
63
+			} 
64
+		);
65
+
66
+	</script>

+ 57 - 0
admin/themes/admin/template_bm.htm Datei anzeigen

@@ -0,0 +1,57 @@
1
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+    <head>
5
+    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+    	<title>gelato bookmarklet</title>
7
+    	<style type="text/css">
8
+    	    body {
9
+    	        background-color: #e1e1e1;
10
+    	        margin:           0px;
11
+    	        font:             Normal 15px 'Trebuchet MS',Verdana,Helvetica,sans-serif;
12
+    	        text-align:       center;
13
+    	    }
14
+    	    
15
+    	    div#content {
16
+    	        margin:           137px 30px 0px 30px;
17
+    	        padding:          15px;
18
+    	    }
19
+    	</style>
20
+    	<script type="text/javascript">
21
+			function countdown_func() {
22
+			    var prefix = 'or wait ';
23
+			    countdown--;
24
+			    el = document.getElementById('countdown');
25
+			    if (countdown == 1) {
26
+			        el.firstChild.nodeValue = 
27
+			            prefix + countdown + ' second.';
28
+			    } else if (countdown > 0) {
29
+			        el.firstChild.nodeValue = 
30
+			            prefix + countdown + ' seconds.';
31
+			    } else {
32
+                    self.close();
33
+			    }
34
+			    if (countdown > 0) setTimeout('countdown_func()', 1000);
35
+			}
36
+	
37
+          	var countdown = 3;
38
+        </script>
39
+    </head>
40
+
41
+    <body>
42
+        <div id="content">
43
+            <div style="margin-bottom:10px; font-size:40px; color:#777;">Done!</div>
44
+
45
+            <a href="#" onclick="javascript:self.close(); return false;"
46
+            style="color:#777;">Close this window</a>
47
+            
48
+            <span id="countdown" style="color:#777;">
49
+                or wait 3 seconds.
50
+            </span>
51
+        </div>
52
+
53
+        <script type="text/javascript">
54
+            setTimeout('countdown_func()', 1000);
55
+        </script>
56
+    </body>
57
+</html>

+ 1 - 1
classes/install.class.php Datei anzeigen

@@ -123,7 +123,7 @@ class Install {
123 123
 					
124 124
 		$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']."');";		
125 125
 		$sqlStr[] = "INSERT INTO `".Table_prefix."users` VALUES ('', '', '".$this->data['login']."', '".md5($this->data['password'])."', '".$this->data['email']."', '".$this->data['website']."', '".$this->data['about']."');";
126
-		$sqlStr[] = "INSERT INTO `".Table_prefix."options` VALUES ('url_friendly', '1');";
126
+		$sqlStr[] = "INSERT INTO `".Table_prefix."options` VALUES ('url_friendly', '0');";
127 127
 		$sqlStr[] = "INSERT INTO `".Table_prefix."options` VALUES ('rich_text', '0');";		
128 128
 		$sqlStr[] = "INSERT INTO `".Table_prefix."options` VALUES ('allow_comments', '0');";
129 129
 		$sqlStr[] = "INSERT INTO `".Table_prefix."options` VALUES ('offset_city', '".$this->data['offset_city']."');";		

+ 13 - 2
readme.txt Datei anzeigen

@@ -6,18 +6,28 @@
6 6
 	* If you installed gelato in the root directory, you should visit: http://example.com/install.php
7 7
     * If you installed gelato in its own subdirectory called tumblelog, for example, you should visit: http://example.com/tumblelog/install.php 
8 8
 4) Set CHMOD / permission ( Chmod 777 ) to the folder 'uploads' and the folder 'uploads/CACHE'
9
+5) REMOVE the install.php and update.php files.
9 10
 
10 11
 That's it! gelato should now be installed.
11 12
 
12
-==== How to update to v0.95 RC1 from v0.90 version =====
13
+==== How to update to v0.95 from v0.90 version =====
13 14
 
14 15
 1) Download and unzip the gelato package, if you haven't already.
15 16
 2) Create a backup of your config.php file.
16
-3) Replace all the old files with those from the new 0.95 RC1.
17
+3) Replace all the old files with those from the new 0.95.
17 18
 4) Rename the config-sample.php file to config.php.
18 19
 5) Open config.php in your favorite text editor and fill in your database details (using the information on your old config.php).
19 20
 4) Execute the update.php file.
20 21
 7) Set CHMOD / permission ( Chmod 777 ) to the folder 'uploads'  and the folder 'uploads/CACHE'.
22
+8) REMOVE the install.php and update.php files.
23
+
24
+That's it! gelato should now be updated.
25
+
26
+==== How to update to v0.95 from v0.95 RC1 version =====
27
+
28
+1) Download and unzip the gelato package, if you haven't already.
29
+2) Replace all the old files with those from the new 0.95.
30
+3) REMOVE the install.php and update.php files.
21 31
 
22 32
 That's it! gelato should now be updated.
23 33
 
@@ -34,6 +44,7 @@ That's it! gelato should now be updated.
34 44
 6) Place the gelato files in the desired location on your web server.
35 45
 	Note: The test data on the script /db/gelato_db.sql point the installation to http://localhost/gelato
36 46
 7) Set CHMOD / permission ( Chmod 777 ) to the folder 'uploads' and the folder 'uploads/CACHE'
47
+8) REMOVE the install.php and update.php files.
37 48
 
38 49
 That's it! gelato should now be installed.
39 50
 	Demo user: admin

+ 1 - 1
update.php Datei anzeigen

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