 |
|
|
|

| Autor |
Nachricht |
Schlecky
phpBB2.de User


Anmeldungsdatum: 05.08.2002
Beiträge: 358
|
Verfasst am:
Di 06 Aug, 2002 22:14 |
  |
Kann sich vielleicht wer *zufabroschau* meinen birthday hack anschauen?
Es funktioniert zwar aber ich habe das mx_portal und auf der index seite zeigt er mit die user doppelt an!
Es liegt soweit ich rausgefunden habe an den zeilen(habe ich in der mx_online.php eingefügt!):
| Code: |
'L_WHOSBIRTHDAY_WEEK' => sprintf((($birthday_week_list)? $lang ['Birthday_week'].$birthday_week_list:$lang ['Nobirthday_week']),$board_config['birthday_check_day']),
'L_WHOSBIRTHDAY_TODAY' =>($birthday_today_list&&$board_config['birthday_check_day'])? $lang ['Birthday_today'].$birthday_today_list:$lang ['Nobirthday_today'], |
Bitte um hilfe!
Danke+mfG
Schlecky |
_________________ Administrator @ www.mypolitix.com
[img]http://www.mypolitix.com/version3.php[/img] |
|
      |
 |
Google
|
Verfasst am:
|
 |
|
|
 |
Fabro
phpBB2.de User


Anmeldungsdatum: 02.08.2002
Beiträge: 1172
Wohnort: Bayern
|
Verfasst am:
Di 06 Aug, 2002 22:51 |
  |
Der Fehler liegt eher dort, wo die Variablen $birthday_week_list und $birthday_today_list definiert und zugewiesen werden.
Such mal diese Stelle.
Vielleicht finden wir dann den Fehler.
Fabro |
_________________ [img]http://cgi.gbgr.de/spruch.png?d=2[/img] |
|
   |
 |
Schlecky
phpBB2.de User


Anmeldungsdatum: 05.08.2002
Beiträge: 358
|
Verfasst am:
Di 06 Aug, 2002 23:10 |
  |
Na wenigstens hab ich die datei richtig erraten!
ich habs in die mx_online.php und in die mx_forum.php reingeben!
Hier:
| Code: |
// Birthday Mod, Show users with birthday
$sql = "SELECT user_id, username, user_birthday,user_level FROM " . USERS_TABLE. " WHERE user_birthday!=999999 ORDER BY username";
if($result = $db->sql_query($sql))
{
$birthdayrow = $db->sql_fetchrowset($result);
if (!empty($birthdayrow))
{
$year=create_date('Y', time(), $board_config['board_timezone']);
$date_today = create_date('Ymd', time(), $board_config['board_timezone']);
$date_forward = create_date('Ymd', time()+($board_config['birthday_check_day']*86400), $board_config['board_timezone']);
for($i = 0; $i < count($birthdayrow); $i++)
{
$user_birthday=realdate("md",$birthdayrow[$i]['user_birthday']);
$user_birthday2=(($year.$user_birthday<$date_today)? $year+1:$year).$user_birthday;
if ($user_birthday2==$date_today)
{
//user have birthday today
$user_age=$year- realdate ('Y',$birthdayrow[$i]['user_birthday']);
$style_color = ($birthdayrow[$i]['user_level'] == ADMIN )?'style="color:#' . $theme['fontcolor3'] . '"':(( $birthdayrow[$i]['user_level'] == MOD )?'style="color:#' . $theme['fontcolor2'] . '"':'');
$birthday_today_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $birthdayrow[$i]['user_id']) . '"' . $style_color .'><b>' . $birthdayrow[$i]['username'] . ' ('.$user_age.')</b></a>';
}
else if ($user_birthday2>$date_today && $user_birthday2<=$date_forward)
{
// user are having birthday within the next days
$user_age=($year.$user_birthday<$date_today)?$year- realdate ('Y',$birthdayrow[$i]['user_birthday'])+1:$year- realdate ('Y',$birthdayrow[$i]['user_birthday']);
$style_color = ($birthdayrow[$i]['user_level'] == ADMIN )?'style="color:#' . $theme['fontcolor3'] . '"':(( $birthdayrow[$i]['user_level'] == MOD )?'style="color:#' . $theme['fontcolor2'] . '"':'');
$birthday_week_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $birthdayrow[$i]['user_id']) . '"' . $style_color .'><b>' . $birthdayrow[$i]['username'] . ' ('.$user_age.')</b></a>';
}
}
}
}
$db->sql_freeresult($result); |
|
_________________ Administrator @ www.mypolitix.com
[img]http://www.mypolitix.com/version3.php[/img] |
|
      |
 |
Fabro
phpBB2.de User


Anmeldungsdatum: 02.08.2002
Beiträge: 1172
Wohnort: Bayern
|
Verfasst am:
Mi 07 Aug, 2002 09:24 |
  |
Hi,
versuch mal folgendes:
Setz mal direkt nach // Birthday Mod, Show users with birthday folgendes ein:
| Code: |
$birthday_today_list = '';
$birthday_week_list =''; |
Fabro |
_________________ [img]http://cgi.gbgr.de/spruch.png?d=2[/img] |
|
   |
 |
Schlecky
phpBB2.de User


Anmeldungsdatum: 05.08.2002
Beiträge: 358
|
Verfasst am:
Mi 07 Aug, 2002 09:39 |
  |
Das wars danke vielmals - aber ich hab da noch ein Problem!
ich hatte den last visit auch doppelt und hab mich da ein bissal gspielt!
Jedoch zeigt er mir jetzt nicht mehr die reg. Benutzer an!
Schaus da mal bitte:
www.superforum.at.tf
MfG
Schlecky |
_________________ Administrator @ www.mypolitix.com
[img]http://www.mypolitix.com/version3.php[/img] |
|
      |
 |
Fabro
phpBB2.de User


Anmeldungsdatum: 02.08.2002
Beiträge: 1172
Wohnort: Bayern
|
Verfasst am:
Mi 07 Aug, 2002 09:48 |
  |
Dann poste mal des, was du geändert hast.
Oder versetze es in den Ur-Zustand und ich schau wie viel ich dir heute noch helfen kann.
Fabro |
_________________ [img]http://cgi.gbgr.de/spruch.png?d=2[/img] |
|
   |
 |
Schlecky
phpBB2.de User


Anmeldungsdatum: 05.08.2002
Beiträge: 358
|
Verfasst am:
Mi 07 Aug, 2002 09:54 |
  |
So ich habe jetzt die Datein wieder in den originalzustand versetzt.
Nur der birthday hack habe ich noch installiert
mx_online.tpl:
| Code: |
<table width="{BLOCK_SIZE}" cellpadding="3" cellspacing="0" border="0" class="forumline">
<tr>
<td class="catHead" colspan="2" height="28"><span class="cattitle"><a href="{U_VIEWONLINE}" class="cattitle">{L_WHO_IS_ONLINE}</a></span></td>
</tr>
<tr>
<td class="row1" align="center" valign="middle" rowspan="3"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
<td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}<br />{TOTAL_USERS}<br />{NEWEST_USER}</span>
</td>
</tr>
<tr>
<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE}
<br />[ {L_WHOSONLINE_ADMIN} ] [ <font color="#FF0000"> Super Moderator </font> ] [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
</tr>
<tr>
<td class="row1" align="left"><span class="gensmall">{L_WHOSBIRTHDAY_TODAY}<br />{L_WHOSBIRTHDAY_WEEK}</span></td>
</tr>
</table>
<br clear="all" /> |
mx_online.php:
| Code: |
<?php
/***************************************************************************
* mx_online.php
* -------------------
* begin : April, 2002
* copyright : (C) 2002 MX-System
* email : support@mx-system.com
*
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
// Birthday Mod, Show users with birthday
$birthday_today_list = '';
$birthday_week_list ='';
$sql = "SELECT user_id, username, user_birthday,user_level FROM " . USERS_TABLE. " WHERE user_birthday!=999999 ORDER BY username";
if($result = $db->sql_query($sql))
{
$birthdayrow = $db->sql_fetchrowset($result);
if (!empty($birthdayrow))
{
$year=create_date('Y', time(), $board_config['board_timezone']);
$date_today = create_date('Ymd', time(), $board_config['board_timezone']);
$date_forward = create_date('Ymd', time()+($board_config['birthday_check_day']*86400), $board_config['board_timezone']);
for($i = 0; $i < count($birthdayrow); $i++)
{
$user_birthday=realdate("md",$birthdayrow[$i]['user_birthday']);
$user_birthday2=(($year.$user_birthday<$date_today)? $year+1:$year).$user_birthday;
if ($user_birthday2==$date_today)
{
//user have birthday today
$user_age=$year- realdate ('Y',$birthdayrow[$i]['user_birthday']);
$style_color = ($birthdayrow[$i]['user_level'] == ADMIN )?'style="color:#' . $theme['fontcolor3'] . '"':(( $birthdayrow[$i]['user_level'] == MOD )?'style="color:#' . $theme['fontcolor2'] . '"':'');
$birthday_today_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $birthdayrow[$i]['user_id']) . '"' . $style_color .'><b>' . $birthdayrow[$i]['username'] . ' ('.$user_age.')</b></a>';
}
else if ($user_birthday2>$date_today && $user_birthday2<=$date_forward)
{
// user are having birthday within the next days
$user_age=($year.$user_birthday<$date_today)?$year- realdate ('Y',$birthdayrow[$i]['user_birthday'])+1:$year- realdate ('Y',$birthdayrow[$i]['user_birthday']);
$style_color = ($birthdayrow[$i]['user_level'] == ADMIN )?'style="color:#' . $theme['fontcolor3'] . '"':(( $birthdayrow[$i]['user_level'] == MOD )?'style="color:#' . $theme['fontcolor2'] . '"':'');
$birthday_week_list .= ' <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $birthdayrow[$i]['user_id']) . '"' . $style_color .'><b>' . $birthdayrow[$i]['username'] . ' ('.$user_age.')</b></a>';
}
}
}
}
$db->sql_freeresult($result);
//
// Start output of page
//
//
// Generate logged in/logged out status
//
if($userdata['session_logged_in'])
{
$u_login_logout = "login.$phpEx?logout=true";
$l_login_logout = $lang['Logout'] . ' [ ' . $userdata["username"] . ' ]';
}
else
{
$u_login_logout = "login.$phpEx";
$l_login_logout = $lang['Login'];
}
$s_last_visit = ( $userdata['session_logged_in'] ) ? create_date($board_config['default_dateformat'], $userdata['user_lastvisit'], $board_config['board_timezone']) : '';
//
// Get basic (usernames + totals) online
// situation
//
$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
AND ( s.session_time >= ".( time() - 300 ) . "
OR u.user_session_time >= " . ( time() - 300 ) . " )
ORDER BY u.username ASC, s.session_ip ASC";
$result = $db->sql_query($sql);
if(!$result)
{
message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
}
$userlist_ary = array();
$userlist_visible = array();
$logged_visible_online = 0;
$logged_hidden_online = 0;
$guests_online = 0;
$online_userlist = '';
$prev_user_id = 0;
$prev_user_ip = '';
$prev_session_ip = 0;
while( $row = $db->sql_fetchrow($result) )
{
// User is logged in and therefor not a guest
if( $row['session_logged_in'] )
{
// Skip multiple sessions for one user
if( $row['user_id'] != $prev_user_id )
{
$style_color = '';
if( $row['user_level'] == ADMIN )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
}
else if( $row['user_level'] == MOD )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
}
if( $row['user_allow_viewonline'] )
{
$user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
$logged_visible_online++;
}
else
{
$user_online_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
$logged_hidden_online++;
}
if( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
$online_userlist .= ( $online_userlist != "" ) ? ", " . $user_online_link : $user_online_link;
}
}
}
else
{
// Skip multiple sessions for one user
if( $row['session_ip'] != $prev_session_ip )
{
$guests_online++;
}
}
$prev_session_ip = $row['session_ip'];
$prev_user_id = $row['user_id'];
}
if( empty($online_userlist) )
{
$online_userlist = $lang['None'];
}
$online_userlist = $lang['Registered_users'] . ' ' . $online_userlist;
$total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online;
if ( $total_online_users > $board_config['record_online_users'])
{
$sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '$total_online_users'
WHERE config_name = 'record_online_users'";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update online user record (nr of users)', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '" . time() . "'
WHERE config_name = 'record_online_date'";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update online user record (date)', '', __LINE__, __FILE__, $sql);
}
$board_config['record_online_users'] = $total_online_users;
$board_config['record_online_date'] = time();
}
if( $total_online_users == 0 )
{
$l_t_user_s = $lang['Online_users_zero_total'];
}
else if( $total_online_users == 1 )
{
$l_t_user_s = $lang['Online_user_total'];
}
else
{
$l_t_user_s = $lang['Online_users_total'];
}
if( $logged_visible_online == 0 )
{
$l_r_user_s = $lang['Reg_users_zero_total'];
}
else if( $logged_visible_online == 1 )
{
$l_r_user_s = $lang['Reg_user_total'];
}
else
{
$l_r_user_s = $lang['Reg_users_total'];
}
if( $logged_hidden_online == 0 )
{
$l_h_user_s = $lang['Hidden_users_zero_total'];
}
else if( $logged_hidden_online == 1 )
{
$l_h_user_s = $lang['Hidden_user_total'];
}
else
{
$l_h_user_s = $lang['Hidden_users_total'];
}
if( $guests_online == 0 )
{
$l_g_user_s = $lang['Guest_users_zero_total'];
}
else if( $guests_online == 1 )
{
$l_g_user_s = $lang['Guest_user_total'];
}
else
{
$l_g_user_s = $lang['Guest_users_total'];
}
$l_online_users = sprintf($l_t_user_s, $total_online_users);
$l_online_users .= sprintf($l_r_user_s, $logged_visible_online);
$l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);
$l_online_users .= sprintf($l_g_user_s, $guests_online);
//
// Obtain number of new private messages
// if user is logged in
//
if( $userdata['session_logged_in'] )
{
if( $userdata['user_new_privmsg'] )
{
$l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms'];
$l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']);
if( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_last_privmsg = " . $userdata['user_lastvisit'] . "
WHERE user_id = " . $userdata['user_id'];
if( !$status = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql);
}
$s_privmsg_new = 1;
$icon_pm = $images['pm_new_msg'];
}
else
{
$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'];
}
}
else
{
$l_privmsgs_text = $lang['No_new_pm'];
$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'];
}
if( $userdata['user_unread_privmsg'] )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']);
}
else
{
$l_privmsgs_text_unread = $lang['No_unread_pm'];
}
}
else
{
$icon_pm = $images['pm_no_new_msg'];
$l_privmsgs_text = $lang['Login_check_pm'];
$l_privmsgs_text_unread = "";
$s_privmsg_new = 0;
}
$template->set_filenames(array(
"body_online" => "mx_online.tpl")
);
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];
if( $total_posts == 0 )
{
$l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
$l_total_post_s = $lang['Posted_article_total'];
}
else
{
$l_total_post_s = $lang['Posted_articles_total'];
}
if( $total_users == 0 )
{
$l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
$l_total_user_s = $lang['Registered_user_total'];
}
else
{
$l_total_user_s = $lang['Registered_users_total'];
}
$template->assign_vars(array(
'BLOCK_SIZE' => $block_size,
'U_VIEWONLINE' => append_sid('viewonline.'.$phpEx),
'L_WHO_IS_ONLINE' => $lang['Who_is_Online'],
'L_WHOSONLINE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
'L_WHOSONLINE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),
'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], create_date($board_config['default_dateformat'], $board_config['record_online_date'], $board_config['board_timezone'])),
'L_WHOSBIRTHDAY_WEEK' => sprintf((($birthday_week_list)? $lang ['Birthday_week'].$birthday_week_list:$lang ['Nobirthday_week']),$board_config['birthday_check_day']),
'L_WHOSBIRTHDAY_TODAY' =>($birthday_today_list&&$board_config['birthday_check_day'])? $lang ['Birthday_today'].$birthday_today_list:$lang ['Nobirthday_today'],
'LOGGED_IN_USER_LIST' => $online_userlist,
'TOTAL_USERS_ONLINE' => $l_online_users,
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>')
));
$template->pparse("body_online");
$template->destroy();
?> |
MfG
Schlecky |
_________________ Administrator @ www.mypolitix.com
[img]http://www.mypolitix.com/version3.php[/img] |
|
      |
 |
Fabro
phpBB2.de User


Anmeldungsdatum: 02.08.2002
Beiträge: 1172
Wohnort: Bayern
|
Verfasst am:
Mi 07 Aug, 2002 10:40 |
  |
Da ist das leeren der Fariable ja shcon gesetzt.
Komisch, da kann ich jetzt auf die schnelle nix finden.
sry
Fabro |
_________________ [img]http://cgi.gbgr.de/spruch.png?d=2[/img] |
|
   |
 |
|
|
|
|
|
Nächstes Thema anzeigen
Vorheriges Thema anzeigen
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
|
|
| |