Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Sprawdzanie aktualizacji
mateŁusz
post
Post #1





Grupa: Zarejestrowani
Postów: 102
Pomógł: 0
Dołączył: 21.08.2012

Ostrzeżenie: (0%)
-----


  1. <?php
  2. $version = file_get_contents('http://matias-test.ugu.pl/changelog_panel/version.ver');
  3. $version_local = file_get_contents('../version.ver');


Powiedzmy, mam dwa takie pliki. Jeden na ftp, drugi na localu.
W tych plikach mam wpisane, np. 'MC43' - Dobrze. Pokaże się w indexie napis:

Najnowsza wersja: 0.7
Lokalna wersja: 0.7
Stan skryptu: Aktualna


MC41/9
W takich zakresach się da, lecz nie wiem jak zrobić, aby było '0.1'.

Przykład:

MC44 - 0.8
MC41 - 0.5

A więc, jak to zapisać, aby pokazywało 0.1? (IMG:style_emoticons/default/biggrin.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
mateŁusz
post
Post #2





Grupa: Zarejestrowani
Postów: 102
Pomógł: 0
Dołączył: 21.08.2012

Ostrzeżenie: (0%)
-----


MC37 - 0-�

Algorytmu. O co chodzi Ci dokładnie? (IMG:style_emoticons/default/smile.gif)

  1. <?php
  2. $version = file_get_contents('http://matias-test.ugu.pl/changelog_panel/version.txt');
  3. $version_local = file_get_contents('../version.txt');
  4.  
  5. if(!$version) {
  6. echo $lang['WER'].": <font style='color: #FF0000; font-weight: bold;'>".$lang['NO_PL']."</font><br>";
  7. } else {
  8. echo $lang['WER'].": <b>".base64_decode($version)."</b><br>";
  9. }
  10.  
  11. if(!$version_local) {
  12. echo $lang['WER_LOC'].": <font style='color: #FF0000; font-weight: bold;'>".$lang['NO_PL']."</font><br>";
  13. } else {
  14. echo $lang['WER_LOC'].": <b>".base64_decode($version_local)."</b><br>";
  15. }
  16.  
  17. echo $lang['SK_ST'].": ";
  18. if ($version_local==$version) {
  19. echo "<font style='color: #008000; font-weight: bold;'>".$lang['SK_AK']."</font><br>";
  20. } else {
  21. echo "<font style='color: #FF0000; font-weight: bold;'>".$lang['SK_NAK']."</font><br>";
  22. }
  23. ?>


? (IMG:style_emoticons/default/smile.gif)

Ten post edytował mateŁusz 11.10.2012, 07:13:33
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 13:11