Browse Source

New option for checking version

vbracco 16 years ago
parent
commit
d1aaffd10e
4 changed files with 23 additions and 5 deletions
  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 View File

165
 					</ul>
165
 					</ul>
166
 					<p>&nbsp;</p>					
166
 					<p>&nbsp;</p>					
167
 <?php			
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
 					if (isset($_GET["deleted"])) {
175
 					if (isset($_GET["deleted"])) {
175
 						if ($_GET["deleted"]=="true") {
176
 						if ($_GET["deleted"]=="true") {
176
 							echo "<div class=\"exito\" id=\"divMessages\">".__("The post has been eliminated successfully.")."</div>";
177
 							echo "<div class=\"exito\" id=\"divMessages\">".__("The post has been eliminated successfully.")."</div>";

+ 11 - 0
admin/options.php View File

54
 			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
54
 			header("Location: ".$conf->urlGelato."/admin/options.php?error=1&des=".$conf->merror);
55
 			die();
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
 		header("Location: ".$conf->urlGelato."/admin/options.php?modified=true");
63
 		header("Location: ".$conf->urlGelato."/admin/options.php?modified=true");
59
 		die();
64
 		die();
222
                                             <option value="1 day" <?php if($conf->rssImportFrec == '1 day') echo "selected=\"selected\""; ?>>24 <?php echo __("hours");?></option>
227
                                             <option value="1 day" <?php if($conf->rssImportFrec == '1 day') echo "selected=\"selected\""; ?>>24 <?php echo __("hours");?></option>
223
 										</select>
228
 										</select>
224
 									</li>
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
 								</ul>
236
 								</ul>
226
 							</fieldset>
237
 							</fieldset>
227
 							<p>
238
 							<p>

+ 2 - 0
classes/configuration.class.php View File

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

+ 4 - 0
update.php View File

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