diff --git a/block/delivery.php b/block/delivery.php index 0078c49..f2243a3 100644 --- a/block/delivery.php +++ b/block/delivery.php @@ -45,7 +45,7 @@ $sql = "(SELECT SUM(IF(eb.extra_no > 0, IF(eb.bet = '', 0, 1), 0)) AS extra_bets_count, SUM(IF(e.extra_no > 0, 1, 0)) AS extra_count FROM " . FOOTB_MATCHDAYS . " AS m - JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league) + JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league AND l.bet_in_time = 0) JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = 0) JOIN " . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = ma.match_no AND b.user_id = $user_id) LEFT JOIN " . FOOTB_EXTRA . " AS e ON (e.season = m.season AND e.league = m.league AND e.matchday = m.matchday AND e.extra_status = 0) @@ -83,7 +83,7 @@ $sql = "(SELECT 0 AS extra_bets_count, 0 AS extra_count FROM " . FOOTB_MATCHDAYS . " AS m - JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league) + JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league AND l.bet_in_time = 0) JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = -1) JOIN " . FOOTB_BETS . " AS b ON (b.season = ma.season AND b.league = ma.league AND b.match_no = ma.match_no AND b.user_id = $user_id) WHERE m.delivery_date_2 > FROM_UNIXTIME('$local_board_time') @@ -119,13 +119,49 @@ $sql = "(SELECT 0 AS extra_bets_count, 0 AS extra_count FROM " . FOOTB_MATCHDAYS . " AS m - JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league) + JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league AND l.bet_in_time = 0) JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = -2) JOIN " . FOOTB_BETS . " AS b ON (b.season = ma.season AND b.league = ma.league AND b.match_no = ma.match_no AND b.user_id = $user_id) WHERE m.delivery_date_3 > FROM_UNIXTIME('$local_board_time') AND m.status <= 0 GROUP BY m.delivery_date, m.league, b.user_id ) + UNION + (SELECT + m.season, + m.league, + m.matchday, + l.league_name_short, + CASE m.matchday_name + WHEN '' + THEN CONCAT(m.matchday, '." . sprintf($user->lang['MATCHDAY']) . "') + ELSE m.matchday_name + END AS matchday_name, + CONCAT( + CASE DATE_FORMAT(ma.match_datetime,'%w') + WHEN 0 THEN '" . $lang_dates['Sun'] . "' + WHEN 1 THEN '" . $lang_dates['Mon'] . "' + WHEN 2 THEN '" . $lang_dates['Tue'] . "' + WHEN 3 THEN '" . $lang_dates['Wed'] . "' + WHEN 4 THEN '" . $lang_dates['Thu'] . "' + WHEN 5 THEN '" . $lang_dates['Fri'] . "' + WHEN 6 THEN '" . $lang_dates['Sat'] . "' + ELSE 'Error' END, + DATE_FORMAT(ma.match_datetime,' %d.%m.%y %H:%i') + ) as delivery_time, + ma.match_datetime AS delivery, + SUM(IF(((b.goals_home = '') OR (b.goals_guest = '')), 0, 1)) AS bets_count, + COUNT(*) AS matches_count, + 0 AS extra_bets_count, + 0 AS extra_count + FROM " . FOOTB_MATCHDAYS . " AS m + JOIN " . FOOTB_LEAGUES . " AS l ON(l.season = m.season AND l.league = m.league AND l.bet_in_time = 1) + JOIN " . FOOTB_MATCHES . " AS ma ON (ma.season = m.season AND ma.league = m.league AND ma.matchday = m.matchday AND ma.status = 0) + JOIN " . FOOTB_BETS . " AS b ON (b.season = ma.season AND b.league = ma.league AND b.match_no = ma.match_no AND b.user_id = $user_id) + WHERE ma.match_datetime > FROM_UNIXTIME('$local_board_time') + AND m.status <= 0 + GROUP BY ma.match_datetime, m.league, b.user_id + ) ORDER BY delivery, league"; $result = $db->sql_query($sql); diff --git a/block/last_users.php b/block/last_users.php index 83d85c9..f77bfd5 100644 --- a/block/last_users.php +++ b/block/last_users.php @@ -24,6 +24,7 @@ $sql = 'SELECT s.session_user_id FROM ' . USERS_TABLE . ' AS u LEFT JOIN ' . SESSIONS_TABLE . ' AS s ON (u.user_id = s.session_user_id) WHERE u.user_lastvisit > 0 + AND u.user_type IN (0,3) GROUP BY u.user_id ORDER BY lastvisit DESC'; diff --git a/block/my_table.php b/block/my_table.php index 013bbe3..6019141 100644 --- a/block/my_table.php +++ b/block/my_table.php @@ -137,7 +137,6 @@ $sql = 'SELECT AND b.goals_home <> '' AND b.goals_guest <> '' AND m.matchday <= $matchday - AND m.status IN (2, 3,5,6) GROUP BY t.team_id ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC"; @@ -234,7 +233,6 @@ $sql = 'SELECT AND b.goals_home <> '' AND b.goals_guest <> '' AND m.matchday >= $form_from - AND m.status IN (2, 3,5,6) GROUP BY t.team_id ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC"; @@ -302,7 +300,6 @@ $sql = 'SELECT AND b.goals_home <> '' AND b.goals_guest <> '' AND m.matchday <= $matchday - AND m.status IN (2, 3,5,6) GROUP BY t.team_id ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC"; @@ -368,7 +365,6 @@ $sql = 'SELECT AND b.goals_home <> '' AND b.goals_guest <> '' AND m.matchday <= $matchday - AND m.status IN (2, 3,5,6) GROUP BY t.team_id ORDER BY t.group_id ASC, points DESC, goals_diff DESC, goals DESC"; diff --git a/cron/task/football_remember.php b/cron/task/football_remember.php index 8c8837d..e24cda7 100644 --- a/cron/task/football_remember.php +++ b/cron/task/football_remember.php @@ -87,9 +87,8 @@ class football_remember extends \phpbb\cron\task\base $season = curr_season(); //Matchdays to close in 24 hours and 24 hours later - $local_board_time = time() + (($this->config['board_timezone'] - $this->config['football_host_timezone']) * 3600); // shift days to test - $local_board_time = $local_board_time + ($days * 86400); + $local_board_time = time() + ($days * 86400); if ($mode <> 'test') { @@ -137,12 +136,17 @@ class football_remember extends \phpbb\cron\task\base u.user_id AS userid, u.user_lang FROM ' . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = m.season AND l.league = m.league) LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) LEFT JOIN ' . PROFILE_FIELDS_DATA_TABLE. ' AS p ON p.user_id = b.user_id LEFT JOIN ' . USERS_TABLE. " AS u ON u.user_id = b.user_id WHERE m.season = $season AND m.league = $league AND m.matchday = $matchday AND ((b.goals_home = '') OR (b.goals_guest = '')) AND m.status = 0 AND p.pf_footb_rem_f = 1 + AND (l.bet_in_time = 0 OR + (l.bet_in_time = 1 + AND (DATE_SUB(m.match_datetime, INTERVAL '1 23:59' DAY_MINUTE) < FROM_UNIXTIME('$local_board_time')) + AND (DATE_SUB(m.match_datetime, INTERVAL '1 00:00' DAY_MINUTE) > FROM_UNIXTIME('$local_board_time')))) GROUP BY b.user_id UNION SELECT @@ -151,12 +155,17 @@ class football_remember extends \phpbb\cron\task\base u.user_id AS userid, u.user_lang FROM " . FOOTB_MATCHES . ' AS m + LEFT JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = m.season AND l.league = m.league) LEFT JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no) LEFT JOIN ' . PROFILE_FIELDS_DATA_TABLE. ' AS p ON p.user_id = b.user_id LEFT JOIN ' . USERS_TABLE. " AS u ON u.user_id = b.user_id WHERE m.season = $season AND m.league = $league AND m.matchday = $matchday AND ((b.goals_home = '') OR (b.goals_guest = '')) AND m.status = 0 AND p.pf_footb_rem_s = 1 + AND (l.bet_in_time = 0 OR + (l.bet_in_time = 1 + AND (DATE_SUB(m.match_datetime, INTERVAL '1 23:59' DAY_MINUTE) < FROM_UNIXTIME('$local_board_time')) + AND (DATE_SUB(m.match_datetime, INTERVAL '1 00:00' DAY_MINUTE) > FROM_UNIXTIME('$local_board_time')))) GROUP BY b.user_id "; $result = $this->db->sql_query($sql); diff --git a/includes/functions.php b/includes/functions.php index 2bb4b67..a75e593 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -934,14 +934,20 @@ function set_bet_in_time_delivery($season, $league) function curr_season() { global $db, $lang, $user; - $curr_user = $user->data['user_id']; + $user_spec = ''; + if ($user->data['user_type']==0 OR $user->data['user_type']==3) + { + $curr_user = $user->data['user_id']; + $user_spec = 'AND b.user_id = ' . $curr_user; + } + $sql = 'SELECT DISTINCT s.season FROM ' . FOOTB_SEASONS . ' AS s INNER JOIN ' . FOOTB_LEAGUES . ' AS l ON (l.season = s.season) INNER JOIN ' . FOOTB_MATCHDAYS . ' AS m ON (m.season = s.season AND m.league = l.league) - INNER JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.user_id = $curr_user) + INNER JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league ' . $user_spec . ') WHERE m.status IN (0,1,2) - ORDER BY s.season ASC"; + ORDER BY s.season ASC'; $result = $db->sql_query($sql); if ($row = $db->sql_fetchrow($result)) @@ -1017,10 +1023,15 @@ function first_league($season, $complete = true) function current_league($season) { global $db, $lang, $user; - $curr_user = $user->data['user_id']; + $user_spec = ''; + if ($user->data['user_type']==0 OR $user->data['user_type']==3) + { + $curr_user = $user->data['user_id']; + $user_spec = 'AND b.user_id = ' . $curr_user; + } $sql = 'SELECT m.league FROM ' . FOOTB_MATCHES . ' AS m - INNER JOIN ' . FOOTB_BETS . " AS b ON (b.season = m.season AND b.league = m.league AND b.user_id = $curr_user) + INNER JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league ' . $user_spec . ") WHERE m.season = $season AND m.status in (0,1,2) ORDER BY m.match_datetime ASC"; @@ -1710,7 +1721,7 @@ function get_order_team_compare($team_ary, $season, $league, $group, $ranks, $ma $tmp[] = $team; } } - return $tmp; + return (sizeof($tmp) == 0) ? $team_ary: $tmp; } /** diff --git a/language/de/help_football.php b/language/de/help_football.php index 511d964..a4a17e5 100644 --- a/language/de/help_football.php +++ b/language/de/help_football.php @@ -93,7 +93,8 @@ footb_rem_s = Schalter für Versand der Erinnerungsmail an die 2. E-Mail-Adresse 0 => 'Wie aktiviere ich die Erinnerungs-Mail Funktion?', 1 => 'Im Adminbereich muss unter den Tipprunden-Funktionalitäten der Cronjob für die Tipp-Erinnerungsmail aktiviert und der Termin der nächsten Ausführung gesetzt werden.
Der Cron-Job wird beim ersten Zugriff nach diesem Termin ausgeführt und sendet eine Erinnerungs-Mail für die fehlenden Tippabgaben, die im Zeitraum 24-48 Stunden nach dem Cron-Termin liegen. -Falls nicht ausreichend Zugriffe auf die Seite erfolgen, sollte der Cronjob automatisch z.B. von www.cronjob.de durch das Script "cron.php?cron_type=football_remember" gestartet werden.
+Falls nicht ausreichend Zugriffe auf die Seite erfolgen, sollte der Cronjob automatisch z.B. von www.cronjob.de durch das Script +"DEINE_URL/cron.php?cron_type=football.football.cron.task.football_remember" gestartet werden.
Das versenden der Email erfolgt nur einmalig. Nach Aufruf des Cronjobs wird der nächste automatisch für den Folgetag eingeplant. Mit den angehängten parametern "&mode=test&days=n" kann der Versand für die um n Tage versetzte Tippabgabe getestet werden. Dabei werden nur Mails an Board-Email-Adresse versendet.' ), diff --git a/language/de/info_acp_football.php b/language/de/info_acp_football.php index 73a7b29..3ce2857 100644 --- a/language/de/info_acp_football.php +++ b/language/de/info_acp_football.php @@ -120,7 +120,7 @@ $lang = array_merge($lang, array( 'FOOTBALL_REMEMBER_ENABLE_EXPLAIN' => 'Hier kannst Du angeben, ob 1 Tag vor Tippabgabe eine Erinnerungsmail versendet werden soll.', 'FOOTBALL_REMEMBER_NEXT_RUN' => 'Nächster Cronjoblauf für die Tipp-Erinnerungsmail', - 'FOOTBALL_REMEMBER_NEXT_RUN_EXPLAIN'=> 'Hier kannst Du einstellen, wann der Cronjob für die Tipp-Erinnerungsmail frühestens wieder aufgerufen wird. Nach Ausführung wird der Cronjob für den Folgetag zur geichen Uhrzeit neu eingeplant.', + 'FOOTBALL_REMEMBER_NEXT_RUN_EXPLAIN'=> 'Hier kannst Du einstellen, wann der Cronjob für die Tipp-Erinnerungsmail frühestens wieder aufgerufen wird. Nach Ausführung wird der Cronjob für den Folgetag zur gleichen Uhrzeit neu eingeplant.', 'FOUNDER_DELETE' => 'Nur Gründungsmitglieder dürfen löschen', 'FOUNDER_DELETE_EXPLAIN' => 'Löschung von Spielplandaten wie Saisons, Ligen, Teams, Spieltage und Spielpläne nur auf Gründungsmitglieder beschränken. ', diff --git a/language/en/help_football.php b/language/en/help_football.php index c36c157..f14ec0a 100644 --- a/language/en/help_football.php +++ b/language/en/help_football.php @@ -96,7 +96,7 @@ footb_rem_s = switch for sending the reminder email to the second E-mail address 0 => 'How do I activate the reminder e-mail function? ', 1 => 'In the admin area in the Prediction League functionality the mail reminder cron job and the next run must be activated.
The cron job is run on the first access after this date and sends an e-mail reminder for the missing tip duties that lie in the period 24-48 hours after cron date . -If not sufficient accesses the page, the cron job should automatically run on script "cron.php?cron_type=football_remember".
+If not sufficient accesses the page, the cron job should automatically run on script "YOUR_URL/cron.php?cron_type=football.football.cron.task.football_remember".
The ship of the email takes place only once . After calling up the cron job, the next scheduled is automatically planned for the following day . With the appended parameters " & mode = test & days = n " can be tested the shipment for the offset to n days predictions . Only mails to board email address will be shipped . In ACP a user defined prediction leagues code is to define.
diff --git a/migrations/v097_beta.php b/migrations/v097_beta.php new file mode 100644 index 0000000..f88e331 --- /dev/null +++ b/migrations/v097_beta.php @@ -0,0 +1,30 @@ +config['football_version']) && version_compare($this->config['football_version'], '0.9.7', '>='); + } + + static public function depends_on() + { + return array('\football\football\migrations\v096_beta'); + } + + public function update_data() + { + return array( + array('config.update', array('football_version', '0.9.7', '0')), + ); + } +} diff --git a/styles/prosilver/template/mobile_viewplan_popup.html b/styles/prosilver/template/mobile_viewplan_popup.html deleted file mode 100644 index 8a4cf71..0000000 --- a/styles/prosilver/template/mobile_viewplan_popup.html +++ /dev/null @@ -1,57 +0,0 @@ - - - -
-
- -
- - {L_WON} - {L_DRAW} - {L_LOST} -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{L_DATE}{L_GR}{L_VS}{L_RESULT}
{match.MATCH_TIME}{match.GROUP}{match.HOME_NAME}:{match.GUEST_NAME}{match.GOALS_HOME}:{match.GOALS_GUEST}
-
- -
-
{S_ERROR_MESSAGE}
-
- -
- {L_CLOSE_WINDOW} -
-
- \ No newline at end of file