Explorar el Código

New option for checking version

vbracco hace 16 años
padre
commit
d1aaffd10e
Se han modificado 4 ficheros con 23 adiciones y 5 borrados
  1. 6 5
      admin/index.php
  2. 11 0
      admin/options.php
  3. 2 0
      classes/configuration.class.php
  4. 4 0
      update.php

+ 6 - 5
admin/index.php Ver fichero

@@ -165,12 +165,13 @@ if ($user->isAuthenticated()) {
165 165
 					</ul>
166 166
 					<p>&nbsp;</p>					
167 167
 <?php			
168
-					$present = version();
169
-					$lastest = _file_get_contents("http://www.gelatocms.com/vgel.txt");
170
-					if ($present < $lastest) {
171
-						echo "<div class=\"information\" id=\"update\">".__("A new gelato version has been released and is ready <a href=\"http://www.gelatocms.com/\">for download</a>.")."</div><br />";
168
+					if($conf->check_version){
169
+						$present = version();
170
+						$lastest = _file_get_contents("http://www.gelatocms.com/vgel.txt");
171
+						if ($present < $lastest) {
172
+							echo "<div class=\"information\" id=\"update\">".__("A new gelato version has been released and is ready <a href=\"http://www.gelatocms.com/\">for download</a>.")."</div><br />";
173
+						}
172 174
 					}
173
-					
174 175
 					if (isset($_GET["deleted"])) {
175 176
 						if ($_GET["deleted"]=="true") {
176 177
 							echo "<div class=\"exito\" id=\"divMessages\">".__("The post has been eliminated successfully.")."</div>";

+ 11 - 0
admin/options.php Ver fichero

@@ -54,6 +54,11 @@ if ($user->isAdmin()) {
54 54
 			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
55 55
 			die();
56 56
 		}
57
+		
58
+		if (!$tumble->saveOption($_POST["check_version"], "check_version")) {
59
+			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
60
+			die();
61
+		}
57 62
 
58 63
 		header("Location: ".$conf->urlGelato."/admin/options.php?modified=true");
59 64
 		die();
@@ -222,6 +227,12 @@ if ($user->isAdmin()) {
222 227
                                             <option value="1 day" <?php if($conf->rssImportFrec == '1 day') echo "selected=\"selected\""; ?>>24 <?php echo __("hours");?></option>
223 228
 										</select>
224 229
 									</li>
230
+									<li class="select"><label for="check_version"><?php echo __("Check for updates:")?></label>
231
+										<select name="check_version" id="check_version">
232
+											<option value="1" <?php if($conf->check_version) echo "selected=\"selected\""; ?>><?php echo __("Active")?></option>
233
+											<option value="0" <?php if(!$conf->check_version) echo "selected=\"selected\""; ?>><?php echo __("Deactive")?></option>
234
+										</select>
235
+									</li>
225 236
 								</ul>
226 237
 							</fieldset>
227 238
 							<p>

+ 2 - 0
classes/configuration.class.php Ver fichero

@@ -30,6 +30,7 @@ class configuration extends Conexion_Mysql {
30 30
 	var $offset_time;
31 31
 	var $shorten_links;
32 32
 	var $rssImportFrec;
33
+	var $check_version;
33 34
 		
34 35
 	function configuration() {
35 36
 		parent::Conexion_Mysql(DB_name, DB_Server, DB_User, DB_Password);
@@ -55,6 +56,7 @@ class configuration extends Conexion_Mysql {
55 56
 			$this->allowComments = $this->get_option("allow_comments");
56 57
 			$this->shorten_links = $this->get_option("shorten_links");
57 58
 			$this->rssImportFrec = $this->get_option("rss_import_frec");
59
+			$this->check_version = $this->get_option("check_version");
58 60
 			
59 61
 		} else {
60 62
 			if($isFeed) {

+ 4 - 0
update.php Ver fichero

@@ -34,6 +34,10 @@ $sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('rss_import_frec', '5 m
34 34
 		
35 35
 $db->ejecutarConsulta($sqlStr);
36 36
 
37
+$sqlStr = "INSERT INTO `".Table_prefix."options` VALUES ('check_version', '1');";
38
+		
39
+$db->ejecutarConsulta($sqlStr);
40
+
37 41
 $sqlStr = "CREATE TABLE `".Table_prefix."feeds` (
38 42
   `id_feed` int(11) NOT NULL auto_increment,
39 43
   `url` varchar(255) NOT NULL,