Torjäger Tipp ??Patch hat geschrieben:Resultat:
[BETA] EURO 2008 Webtipp
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
- buegelfalte
- Mitglied
- Beiträge: 759
- Registriert: 16.02.2005 14:32
- Wohnort: Köln
- Kontaktdaten:
http://www.beehave.de - home of humbug - und zocken !
[kein Support per PN]
[kein Support per PN]
ich muss mich korriegiern. Das stimmt so leider immer noch nicht. in der Funktion get_em_user_points_up_to_yesterday wird mit einer sql abfrage die Ranglsite des vorherigen Spieles ermittelt. Bloß dabei wird statt den Anstoßzeiten der Spiele die Tippzeit des users herangezogen?! Völliger Unsinn...
Gab es mit den Tendenzen während des wm Tippspiels eigentlich auch solche Probleme? ich kann mich gar nicht mehr erinnern
@buegelfalte
ja,hab ich bei mir zusätzlich eingebaut. jedoch muss ich gleich anmerken, das ich mich bei der Programmierung an keine phpbb Grundsätze gehalten habe. sprich ich verwende keine $lang variablen und hab auch keine Konstanten für die Tabellennamen verwendet. Außerdem verwende ich in den mySQL Abgragen Unterabfragen. Das können nicht alle mySQL Versionen. Deshalb spar ich mir den Release als Addon
Gab es mit den Tendenzen während des wm Tippspiels eigentlich auch solche Probleme? ich kann mich gar nicht mehr erinnern
@buegelfalte
ja,hab ich bei mir zusätzlich eingebaut. jedoch muss ich gleich anmerken, das ich mich bei der Programmierung an keine phpbb Grundsätze gehalten habe. sprich ich verwende keine $lang variablen und hab auch keine Konstanten für die Tabellennamen verwendet. Außerdem verwende ich in den mySQL Abgragen Unterabfragen. Das können nicht alle mySQL Versionen. Deshalb spar ich mir den Release als Addon

- buegelfalte
- Mitglied
- Beiträge: 759
- Registriert: 16.02.2005 14:32
- Wohnort: Köln
- Kontaktdaten:
Kenn ich - (nur) bei mir gibts den "Regenbogentipper", bei dem hohe korrekte Tipps extra belohnt werden ...Patch hat geschrieben:Deshalb spar ich mir den Release als Addon

http://www.beehave.de - home of humbug - und zocken !
[kein Support per PN]
[kein Support per PN]
um jetzt alle zu wirklich alle zu verwirren
nochmal ein Lösungsansatz für die Tendenzpfeile. Bir mir stimmt es damit. Aber vorsicht, es wird mySQL 4.1 oder höher vorausgesetzt
öffne functions_em.php
finde:
ersetze mit:
finde:
ersetzte mit
Achtung: Setzt mds. MySQL 4.1 oder höher voraus
finde:
füge dahinter an
öffne em_stats.php (muss wieder auf Urprung zurückgestzt werden)
finde:
ersetzte mit
Ich habe die ersten beiden Spiele Testweise eingetragen:
23.05.2008, 00:00 Schweiz - Tschechien 1 : 2
23.05.2008, 08:00 Portugal - Türkei 3 : 1
damit jetzt folgendes Resultat: (Vergleich zu meinem Posting 994088 )
[ externes Bild ]


öffne functions_em.php
finde:
Code: Alles auswählen
function get_timestamp_for_ranking_history(){
global $db;
$timestamp_now=time();
$month = strftime("%m",$timestamp_now);
$day = strftime("%d",$timestamp_now);
$year = strftime("%Y",$timestamp_now);
$timestamp_today_begin = mktime(0,0,0,$month,$day,$year);
$timestamp_today_end = mktime(23,59,0,$month,$day,$year);
$timestamp_first_game_of_today;
$timestamp_first_game_of_last_day_with_a_game;
$timestamp_last_game_of_last_day_with_a_game;
// get playing times of today
$sql = "SELECT game_time
FROM " . EM_FINALS_TABLE . "
WHERE game_time > ". $timestamp_today_begin ."
AND game_time < ". $timestamp_today_end ."
ORDER BY game_time ASC";
if( !($result_times = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get playing times of today', '', __LINE__, __FILE__, $sql);
}
$row_times = $db->sql_fetchrow($result_times);
$timestamp_first_game_of_today = $row_times['game_time'];
if($timestamp_first_game_of_today < $timestamp_now){
// first game of today has started -> use all results before this game
return $timestamp_first_game_of_today;
}else{
// first game of today is not started
// saerch the first game of last playing day
$sql = "SELECT game_time
FROM " . EM_FINALS_TABLE . "
WHERE game_time < ". $timestamp_today_begin ."
ORDER BY game_time DESC";
if( !($result_times = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get playing times of today', '', __LINE__, __FILE__, $sql);
}
$row_times = $db->sql_fetchrow($result_times);
$timestamp_last_game_of_last_day_with_a_game = $row_times['game_time'];
$month_last_day_with_a_game = strftime("%m",$timestamp_last_game_of_last_day_with_a_game);
$day_last_day_with_a_game = strftime("%d",$timestamp_last_game_of_last_day_with_a_game);
$year_last_day_with_a_game = strftime("%Y",$timestamp_last_game_of_last_day_with_a_game);
$timestamp_last_day_with_a_game_begin =
mktime(0,0,0,$month_last_day_with_a_game,$day_last_day_with_a_game,$year_last_day_with_a_game);
$timestamp_last_day_with_a_game_end =
mktime(23,59,0,$month_last_day_with_a_game,$day_last_day_with_a_game,$year_last_day_with_a_game);
$sql = "SELECT game_time
FROM " . EM_FINALS_TABLE . "
WHERE game_time > ". $timestamp_last_day_with_a_game_begin ."
AND game_time < ". $timestamp_last_day_with_a_game_end ."
ORDER BY game_time ASC";
if( !($result_times = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get playing times of today', '', __LINE__, __FILE__, $sql);
}
$row_times = $db->sql_fetchrow($result_times);
$timestamp_first_game_of_last_day_with_a_game = $row_times['game_time'];
return $timestamp_first_game_of_last_day_with_a_game+1; // +1 becaouse of the < comparison
}
}
ersetze mit:
Code: Alles auswählen
function get_timestamp_for_ranking_history(){
global $db;
$timestamp_now=time();
$month = strftime("%m",$timestamp_now);
$day = strftime("%d",$timestamp_now);
$year = strftime("%Y",$timestamp_now);
$timestamp_today_begin = mktime(0,0,0,$month,$day,$year);
$timestamp_today_end = mktime(23,59,0,$month,$day,$year);
$timestamp_first_game_of_today;
$timestamp_first_game_of_last_day_with_a_game;
$timestamp_last_game_of_last_day_with_a_game;
// get playing times of today
$sql = "SELECT game_time
FROM " . EM_FINALS_TABLE . "
WHERE game_time > ". $timestamp_today_begin ."
AND game_time < ". $timestamp_today_end ."
union
SELECT game_time
FROM " . EM_GAMES_TABLE . "
WHERE game_time > ". $timestamp_today_begin ."
AND game_time < ". $timestamp_today_end ."
ORDER BY game_time ASC";
if( !($result_times = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get playing times of today', '', __LINE__, __FILE__, $sql);
}
$row_times = $db->sql_fetchrow($result_times);
$timestamp_first_game_of_today = $row_times['game_time'];
if($timestamp_first_game_of_today < $timestamp_now){
// first game of today has started -> use all results before this game
return $timestamp_first_game_of_today;
}else{
// first game of today is not started
// saerch the first game of last playing day
$sql = "SELECT game_time
FROM " . EM_FINALS_TABLE . "
WHERE game_time < ". $timestamp_today_begin ."
union
SELECT game_time
FROM " . EM_GAMES_TABLE . "
WHERE game_time < ". $timestamp_today_begin ."
ORDER BY game_time DESC";
if( !($result_times = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get playing times of today', '', __LINE__, __FILE__, $sql);
}
$row_times = $db->sql_fetchrow($result_times);
$timestamp_last_game_of_last_day_with_a_game = $row_times['game_time'];
$month_last_day_with_a_game = strftime("%m",$timestamp_last_game_of_last_day_with_a_game);
$day_last_day_with_a_game = strftime("%d",$timestamp_last_game_of_last_day_with_a_game);
$year_last_day_with_a_game = strftime("%Y",$timestamp_last_game_of_last_day_with_a_game);
$timestamp_last_day_with_a_game_begin =
mktime(0,0,0,$month_last_day_with_a_game,$day_last_day_with_a_game,$year_last_day_with_a_game);
$timestamp_last_day_with_a_game_end =
mktime(23,59,0,$month_last_day_with_a_game,$day_last_day_with_a_game,$year_last_day_with_a_game);
$sql = "SELECT game_time
FROM " . EM_FINALS_TABLE . "
WHERE game_time > ". $timestamp_last_day_with_a_game_begin ."
AND game_time < ". $timestamp_last_day_with_a_game_end ."
union
SELECT game_time
FROM " . EM_GAMES_TABLE . "
WHERE game_time > ". $timestamp_last_day_with_a_game_begin ."
AND game_time < ". $timestamp_last_day_with_a_game_end ."
ORDER BY game_time ASC";
if( !($result_times = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get playing times of today', '', __LINE__, __FILE__, $sql);
}
$row_times = $db->sql_fetchrow($result_times);
$timestamp_first_game_of_last_day_with_a_game = $row_times['game_time'];
return $timestamp_first_game_of_last_day_with_a_game+1; // +1 becaouse of the < comparison
}
}
finde:
Code: Alles auswählen
$sql = "SELECT A.tipp_user , sum( A.tipp_points ) AS user_points, count( A.tipp_points ) AS user_total_tipps, count(
B.tipp_points ) AS user_points_tendency, count( C.tipp_points ) AS user_points_difference, count( D.tipp_points ) AS user_points_result
FROM " . EM_TIPPS_TABLE . " A
LEFT JOIN " . EM_TIPPS_TABLE . " B ON A.tipp_id = B.tipp_id
AND A.tipp_points = " . $em_config['points_tendency'] . "
LEFT JOIN " . EM_TIPPS_TABLE . " C ON A.tipp_id = C.tipp_id
AND A.tipp_points = " . $em_config['points_tordiff'] . "
LEFT JOIN " . EM_TIPPS_TABLE . " D ON A.tipp_id = D.tipp_id
AND A.tipp_points = " . $em_config['points_match'] . "
WHERE A.tipp_time < ". intval($timestamp_last_game_before_this_day) ."
GROUP BY A.tipp_user
ORDER BY user_points DESC, user_points_result DESC, user_points_difference DESC, user_points_tendency DESC";
Code: Alles auswählen
$sql = "SELECT A.tipp_user , sum( A.tipp_points ) AS user_points, count( A.tipp_points ) AS user_total_tipps, count(
B.tipp_points ) AS user_points_tendency, count( C.tipp_points ) AS user_points_difference, count( D.tipp_points ) AS user_points_result
FROM " . EM_TIPPS_TABLE . " A
LEFT JOIN " . EM_TIPPS_TABLE . " B ON A.tipp_id = B.tipp_id
AND A.tipp_points = " . $em_config['points_tendency'] . "
LEFT JOIN " . EM_TIPPS_TABLE . " C ON A.tipp_id = C.tipp_id
AND A.tipp_points = " . $em_config['points_tordiff'] . "
LEFT JOIN " . EM_TIPPS_TABLE . " D ON A.tipp_id = D.tipp_id
AND A.tipp_points = " . $em_config['points_match'] . "
inner join (Select game_id, Game_time FROM " . EM_GAMES_TABLE . " Union Select game_id, Game_time FROM " . EM_FINALS_TABLE . ") as E on E.game_id = A.tipp_game and E.game_time < ". intval($timestamp_last_game_before_this_day) ."
GROUP BY A.tipp_user
ORDER BY user_points DESC, user_points_result DESC, user_points_difference DESC, user_points_tendency DESC, tipp_user ASC";
finde:
Code: Alles auswählen
, user_points_tendency DESC
Code: Alles auswählen
, tipp_user ASC
öffne em_stats.php (muss wieder auf Urprung zurückgestzt werden)
finde:
Code: Alles auswählen
for ( $i = 0; $i < count($em_users_data); $i++ )
{
// user position yesterday
$int_userpos_yesterday = get_rank_of_yesterday($em_users_data[$i]['tipp_user']);
$int_userposalt = $int_userpos;
$int_userpos = ($int_userpkt != $em_users_data[$i]['user_points']) ? $int_userpos + 1 : $int_userpos;
// compare the absolute positions
if($int_userpos_yesterday < $int_userpos )
{
$userpos_change = '<img src="./images/em/down.gif" alt="Down" border="0" />';
}
else if ($int_userpos_yesterday == $int_userpos )
{
$userpos_change = '<img src="./images/em/stay.gif" alt="Stay" border="0" />';
}
else if ($int_userpos_yesterday > $int_userpos )
{
$userpos_change = '<img src="./images/em/up.gif" alt="Up" border="0" />';
}
Code: Alles auswählen
for ( $i = 0; $i < count($em_users_data); $i++ )
{
// absolute position now
$int_userpos_absolute = $i+1;
// user position yesterday
$int_userpos_yesterday = get_rank_of_yesterday($em_users_data[$i]['tipp_user']);
// compare the absolute positions
if($int_userpos_yesterday < $int_userpos_absolute )
{
$userpos_change = '<img src="./images/em/down.gif" alt="Down" border="0" />';
}
else if ($int_userpos_yesterday == $int_userpos_absolute )
{
$userpos_change = '<img src="./images/em/stay.gif" alt="Stay" border="0" />';
}
else if ($int_userpos_yesterday > $int_userpos_absolute )
{
$userpos_change = '<img src="./images/em/up.gif" alt="Up" border="0" />';
}
$int_userposalt = $int_userpos;
$int_userpos = ($int_userpkt != $em_users_data[$i]['user_points']) ? $int_userpos + 1 : $int_userpos;
Ich habe die ersten beiden Spiele Testweise eingetragen:
23.05.2008, 00:00 Schweiz - Tschechien 1 : 2
23.05.2008, 08:00 Portugal - Türkei 3 : 1
damit jetzt folgendes Resultat: (Vergleich zu meinem Posting 994088 )
[ externes Bild ]

ich wollts auch gerade sagen.. irgendwie scheint das net zu funktionieren..Patch hat geschrieben:ich muss mich korriegiern. Das stimmt so leider immer noch nicht.

leider bin ich erst seit diesem jahr dazugestoßen.. hab vorher nicht mal gewußt das es phpbb gibt..
von daher bin ich immer wieder erstaunt was alles möglich ist.. torjäger tipps .. regenbogentipper.. ich beneide euch..
da wird wohl irgendwas nicht ganz glatt gelaufen sein. Mach mal eine sicherung deiner em_stats.phpsmithi hat geschrieben:so,
also die Änderungen zwecks Tendenz funktionieren bei mir leider nicht.![]()
Hab immernoch nur rote Pfeile zu allem übel rechnet er in der Rangliste nur noch mit geraden Platzierungen. Also Rang 2, 4, 6 etc. ich glaub nun hab ich alles verwurschtelt..
und versuch mal meine (probeweise)