Changeset 426 for trunk/admin/modules/Elezioni
- Timestamp:
- Oct 4, 2024, 12:14:01 PM (6 weeks ago)
- Location:
- trunk/admin/modules/Elezioni
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/modules/Elezioni/aggiornamento.php
r424 r426 150 150 echo "<form name=\"conferma\" action=\"admin.php\"><input type=\"hidden\" name=\"errmex\" value=\"1\"><input type=\"hidden\" name=\"op\" value=\"aggiorna\">"; 151 151 echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"procedi\" value=\"1\">"; 152 echo "<br><table align=\"center\"><tr><td><h3>Procedo con verifica e aggiornamento del solo db (all'ultima versione scaricata)?< /h3></td><td><input type=\"submit\" name=\"vai\" value=\""._OK."\"></td></tr></table></form>";152 echo "<br><table align=\"center\"><tr><td><h3>Procedo con verifica e aggiornamento del solo db (all'ultima versione scaricata)?<br><i>E' consigliato procedere solo dopo aver prodotto una copia di backup</i></h3></td><td><input type=\"submit\" name=\"vai\" value=\""._OK."\"></td></tr></table></form>"; 153 153 }else{ 154 154 aggiornadb(); … … 160 160 if(phpversion()<5.6) $host="http://80.211.143.127"; 161 161 else $host="https://trac.eleonline.it"; 162 163 $headers=get_headers("$host/ele3/changeset/"); 164 165 $testurl=strlen($headers[0])>0?true:false; 166 if($testurl){ 167 $file = file("$host/ele3/changeset/"); 168 $cntFile = count($file); 169 $fine=0; 170 $currentLine=0; 171 foreach ($file as $line_num => $line) { 172 if(strpos($line,'<title>') ) {$fine=1; continue;} 173 if ($fine){ 174 $newrev=(int) filter_var($line, FILTER_SANITIZE_NUMBER_INT); 175 $_SESSION['remoterev']=$newrev; 176 break; 177 } 178 } 179 unset($file); 162 ###################### 163 $rev=0; 164 if ($stream = fopen('http://mail.eleonline.it/version/risposta.php', 'r')) { 165 $rev= stream_get_contents($stream, 4); 166 fclose($stream); 167 168 $newrev=(int) filter_var($rev, FILTER_SANITIZE_NUMBER_INT); 169 $_SESSION['remoterev']=$newrev; 180 170 }else{ 181 171 $errmex=2; … … 183 173 } 184 174 #$newrev=$_SESSION['remoterev']; 185 $myrev=$_SESSION['localrev']; 175 #$myrev=$_SESSION['localrev']; 176 include('versione.php'); 177 $myrev=intval(substr($versione,-4,4)); 178 $_SESSION['localrev']=$myrev; 179 186 180 if (isset($_SESSION['forzadb'])) $myrev=378; 187 181 if($newrev<=$myrev) { … … 213 207 { 214 208 echo '<p class="title"><a href="'. $item->link .'">' . $item->title . "</a></p>"; 215 #$str=preg_replace("--", "<br>--", $item->description );216 209 $str=preg_replace('/\s\--/','<br>--',$item->description); 217 #$str=preg_replace("[^A-Za-z0-9\-]", "<br>", $item->description ); 218 # $str=preg_replace('/\s\`echo "\040"`/','<br>--',$item->description); 219 # $str=htmlentities($item->description); 220 echo "<p class='desc'>" . $str . "</p>"; 210 echo "<p class='desc'>" . $str . "</p>"; 221 211 } 222 212 echo "</div>"; … … 228 218 echo "<input type=\"hidden\" name=\"id_cons_gen\" value=\"$id_cons_gen\"><input type=\"hidden\" name=\"procedi\" value=\"1\">"; 229 219 echo "<br><table align=\"center\"><tr><td><h3>Procedo con l'aggiornamento?</h3></td><td><input type=\"submit\" name=\"vai\" value=\""._OK."\"></td></tr></table></form>"; 230 /* echo "<br><textarea name=\"log\" rows=\"15\" cols=\"150\">";231 foreach ($file as $line_num => $line) echo "$line";232 233 echo "</textarea>";234 ############Ã */235 220 $filename = "$host/ele3/changeset?format=zip&new=$newrev&new_path=%2F&old=$myrev&old_path=%2F"; 236 221 -
trunk/admin/modules/Elezioni/ele.php
r424 r426 66 66 function ele() { 67 67 68 global $espandi, $aid, $bgcolor1, $bgcolor2,$bgcolor5, $prefix, $dbi, $offset, $min,$descr_cons, $id_cons_gen,$tipo_cons,$genere,$op,$id_comune,$perms,$id_cons,$votog,$votol,$votoc,$votocirc,$tema,$fascia,$limite,$BACKUP ;68 global $espandi, $aid, $bgcolor1, $bgcolor2,$bgcolor5, $prefix, $dbi, $offset, $min,$descr_cons, $id_cons_gen,$tipo_cons,$genere,$op,$id_comune,$perms,$id_cons,$votog,$votol,$votoc,$votocirc,$tema,$fascia,$limite,$BACKUP,$versione; 69 69 70 70 include ("header.php"); … … 177 177 echo "<hr>"; 178 178 } 179 $newrev=$_SESSION['remoterev']; 179 if(isset($_SESSION['remoterev'])) { 180 $newrev=$_SESSION['remoterev']; 181 } else { 182 $rev=0; 183 if ($stream = fopen('http://mail.eleonline.it/version/risposta.php', 'r')) { 184 $rev= stream_get_contents($stream, 4); 185 fclose($stream); 186 } 187 $newrev=(int) filter_var($rev, FILTER_SANITIZE_NUMBER_INT); 188 $_SESSION['remoterev']=$newrev; 189 $myrev=intval(substr($versione,-4,4)); 190 $_SESSION['localrev']=$myrev; 191 192 193 } 180 194 $myrev=$_SESSION['localrev']; 181 195 if($newrev==$myrev or $newrev==0) echo "<a href=\"admin.php?op=aggiorna&id_cons_gen=$id_cons_gen\">$bullet"._AGGIORNA."</a><br>"; … … 314 328 } 315 329 316 317 330 ?>
Note:
See TracChangeset
for help on using the changeset viewer.