From 1020bf46ae33bb0dc552ad77d0e9a42fce8e337b Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Sun, 06 Jul 2014 21:49:10 +0000
Subject: [PATCH] [mod_data] Poprawienie możliwości wyświetlenia błędnego numeru roku w dacie
---
data/lotto/pobierz.php | 31 ++++++++++++++++++++++---------
1 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/data/lotto/pobierz.php b/data/lotto/pobierz.php
index 3130d07..4c6741a 100644
--- a/data/lotto/pobierz.php
+++ b/data/lotto/pobierz.php
@@ -7,12 +7,12 @@
// Lista gier.
protected $gry = array(
- // nazwa => array(ilość liczb, plus?, lottoplus?)
- 'lotto' => array(6, FALSE, 6),
- 'mini-lotto' => array(5, FALSE, 0),
- 'kaskada' => array(12, FALSE, 0),
- 'multi-multi' => array(20, TRUE, 0),
- 'joker' => array(5, FALSE, 0)
+ // nazwa => array(ilość liczb, plus?, lottoplus?, skrót)
+ 'lotto' => array(6, FALSE, 6, 'dl'),
+ 'mini-lotto' => array(5, FALSE, 0, 'el'),
+ 'kaskada' => array(12, FALSE, 0, 'ka'),
+ 'multi-multi' => array(20, TRUE, 0, 'mm'),
+ 'joker' => array(5, FALSE, 0, 'jk')
);
// Spróbuj pobrać stronę http://lotto.pl/wyniki-gier
@@ -168,7 +168,13 @@
if($gra == 'multi-multi') {
$wyniki = $this->wyniki($gra, 2);
$wynik = $wyniki[0];
- $skrot = $data[2].substr($wynik['godzina'], 0, 2);
+
+ $godzina = substr($wynik['godzina'], 0, 2);
+ if($godzina == '21') {
+ $godzina = '22';
+ }
+ $skrot = $data[3].$godzina;
+
$last_data = @file_get_contents('./last_'.$skrot.'.txt');
if($last_data != $wynik['data']) {
$output = array();
@@ -185,7 +191,13 @@
}
$wynik = $wyniki[1];
- $skrot = $data[2].substr($wynik['godzina'], 0, 2);
+
+ $godzina = substr($wynik['godzina'], 0, 2);
+ if($godzina == '21') {
+ $godzina = '22';
+ }
+ $skrot = $data[3].$godzina;
+
$last_data = @file_get_contents('./last_'.$skrot.'.txt');
if($last_data != $wynik['data']) {
$output = array();
@@ -204,7 +216,8 @@
else
{
$wynik = $this->wynik($gra);
- $skrot = $data[2];
+ $skrot = $data[3];
+
$last_data = @file_get_contents('./last_'.$skrot.'.txt');
if($last_data != $wynik['data']) {
$output = array();
--
Gitblit v1.9.1