Seite 1 von 2

Wer war da anpassung

Verfasst: 07.07.2005 19:54
von lord of reign
hi
kann mir mal jemand erklären wie ich den Group Color und dne Wer war da Mod verknüpfen kann!!

also es soll die Farben vom Group Color Mod auch in der Wer war da list übernommen werden!!

glaub hier muss ich was ändern aber was???

Code: Alles auswählen

$result = $db->sql_query('Select `user_id`, `username`, `user_session_time`, `user_level` FROM '.USERS_TABLE." WHERE `user_session_time` > $mitternacht ORDER BY `user_session_time` DESC");
while( $row = $db->sql_fetchrow($result))
	{
	$user_today .= ($count_user_today > 0) ? ', ' : ''; 
	$user_today .= '<a href="'.append_sid('profile.php?mode=viewprofile&u='.$row['user_id']).'"';
	$user_today .= ($row['user_level'] == 1) ? ' style="color: #'.$theme['fontcolor3'].'"><b>'.$row['username'].'</b></a>' : '';
	$user_today .= ($row['user_level'] == 2) ? ' style="color: #'.$theme['fontcolor2'].'"><b>'.$row['username'].'</b></a>' : '';
	$user_today .= ($row['user_level'] != 1 && $row['user_level'] != 2) ? '">'.$row['username'].'</a>' : '';
	$count_user_today++;
	}
$user_today_text['count_user'] = ($count_user_today > 0) ? str_replace('{COUNT_USER_TODAY}', $count_user_today, $user_today_text['count_user']) : $user_today_text['no_user'];
$db->sql_freeresult($result);
danke!!!!

Verfasst: 09.07.2005 22:06
von lord of reign
kann mir da keiner sagen was ich ändern muss?

Verfasst: 10.07.2005 09:53
von AmigaLink

Code: Alles auswählen

(!function_exists(color_group_colorize_name)) ? include($phpbb_root_path . 'includes/functions_color_groups.'.$phpEx) : '';
$result = $db->sql_query('Select `user_id`, `username`, `user_session_time`, `user_level` FROM '.USERS_TABLE." WHERE `user_session_time` > $mitternacht ORDER BY `user_session_time` DESC"); 
while( $row = $db->sql_fetchrow($result)) 
   { 
   $user_today .= ($count_user_today > 0) ? ', ' : ''; 
   $user_today .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . color_group_colorize_name($row['user_id'], true) . '</a>';
   $count_user_today++; 
   } 
$user_today_text['count_user'] = ($count_user_today > 0) ? str_replace('{COUNT_USER_TODAY}', $count_user_today, $user_today_text['count_user']) : $user_today_text['no_user']; 
$db->sql_freeresult($result);

Verfasst: 10.07.2005 19:30
von lord of reign
danke

Verfasst: 10.07.2005 23:43
von AmigaLink
Gern geschehen. :)

Verfasst: 11.07.2005 10:45
von Der Krefelder
sorry das ich mich hier einklinke,aber wollte nicht extra einen trade aufmachen!
wen bei einem mode einbau da steht AFTER, ADD soll es dan in die selbe ziele gleich am anschluss oder in die zeile darunter eingefuegt werden??

Verfasst: 11.07.2005 13:52
von AmigaLink
In die Zeile darunter!!!

In der Zeile wäre #----------[ INLINE AFTER, ADD ]------------------------ :)

Verfasst: 11.07.2005 14:28
von Der Krefelder
danke sher! :lol:

Verfasst: 14.10.2005 11:45
von MaverickZ
hi, ich hab das jetz mehrmals gelesen, aber kann keine richtigen parallelen zu mir ziehen.

Das is mein Wer war da MOD:

Code: Alles auswählen

/*----------WER WAR HEUTE DA HACK----------*/
###############################  SETTINGS ###############################
$enable_wwd_counter = True; #Enables or disables counting of hidden users and guests
							#Values: True or False
############################### /SETTINGS ###############################
$time = time();
$heute = date('Ymd', $time);
$ip = $_SERVER['REMOTE_ADDR'];
$mitternacht = mktime(0,0,0,date('m', $time),date('d', $time),date('Y', $time));
$user_gmd = ( $userdata['session_logged_in'] ) ? $userdata['user_timezone'] : $board_config['board_timezone'];
###############################  INSTALLATION ###############################
if ( !isset( $board_config['wwd_record_users']) )
{
	$sql = 'INSERT INTO ' . CONFIG_TABLE . " (config_name, config_value) VALUES ('wwd_record_users', '0')";
	if ( !$db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, 'Could not create row `wwd_record_users` in phpBB CONFIG_TABLE', '', __LINE__, __FILE__, $sql);
   	}
	$board_config['wwd_record_users'] = 0;
}

if ( $enable_wwd_counter ) {
	if ( !isset($board_config['wwd_record_time']) ){
		$sql = 'INSERT INTO ' . CONFIG_TABLE . " (config_name, config_value) VALUES ('wwd_record_time', '0')";
  		if ( !$db->sql_query($sql) )
  		{
			message_die(GENERAL_ERROR, 'Could not create row `wwd_record_time` in phpBB CONFIG_TABLE', '', __LINE__, __FILE__, $sql);
   		}
	}
	if ( !isset($board_config['wwd_counter_date']) ){
		$sql = 'INSERT INTO ' . CONFIG_TABLE . " (config_name, config_value) VALUES ('wwd_counter_date', '$heute')";
  		if ( !$db->sql_query($sql) )
  		{
			message_die(GENERAL_ERROR, 'Could not create row `wwd_counter_date` in phpBB CONFIG_TABLE', '', __LINE__, __FILE__, $sql);
   		}
		$sql = 'CREATE TABLE `' . $table_prefix . 'wwd_counter_ips` (`ip` VARCHAR( 15 ) NOT NULL , PRIMARY KEY ( `ip` ))';
  		if ( !$db->sql_query($sql) )
  		{
			message_die(GENERAL_ERROR, 'Could not create table `'. $table_prefix . 'wwd_counter_ips`', '', __LINE__, __FILE__, $sql);
   		}
	}
}
############################### /INSTALLATION ###############################

if ( $enable_wwd_counter ) {
	if ( $board_config['wwd_counter_date'] != $heute ){
		$sql = "UPDATE " . CONFIG_TABLE . "
				SET config_value = '$heute'
				WHERE config_name = 'wwd_counter_date'";
  		if ( !$db->sql_query($sql) )
  		{
			message_die(GENERAL_ERROR, 'Could not update CONFIG_TABLE wwd_counter_date', '', __LINE__, __FILE__, $sql);
	   	}
		$sql = "DELETE FROM `" . $table_prefix . "wwd_counter_ips`";
  		if ( !$db->sql_query($sql) )
  		{
			message_die(GENERAL_ERROR, 'Could not delete ips from PREFIX_wwd_counter_ips table', '', __LINE__, __FILE__, $sql);
   		}
	}
	
	$sql = "DELETE FROM `" . $table_prefix . "wwd_counter_ips`
			WHERE `ip` = '$ip'";
  	if ( !$db->sql_query($sql) )
  	{
		message_die(GENERAL_ERROR, 'Could not delete your ip from PREFIX_wwd_counter_ips table', '', __LINE__, __FILE__, $sql);
   	}
	
	if ( $userdata['session_logged_in'] ) {
	} else {
		$sql = "INSERT INTO `" . $table_prefix . "wwd_counter_ips`
				(ip) VALUES ('$ip')";
  		if ( !$db->sql_query($sql) )
  		{
			message_die(GENERAL_ERROR, 'Could not delete your ip from PREFIX_wwd_counter_ips table', '', __LINE__, __FILE__, $sql);
   		}
	}

}

$sql = 'Select user_id, username, user_session_time, user_level FROM '.USERS_TABLE." 
        WHERE user_allow_viewonline = '1' AND user_session_time > $mitternacht 
		ORDER BY user_session_time DESC";

$result = $db->sql_query($sql);

while( $row = $db->sql_fetchrow($result) )
	{
	$user_today .= ($count_user_today > 0) ? ', ' : ''; 
	$user_today .= '<a href="' . append_sid('profile.php?mode=viewprofile&u=' . $row['user_id']) . '"';
	$user_today .= ($row['user_level'] == 1) ? ' style="color: #' . $theme['fontcolor3'].'"><b>' . $row['username'].'</b></a>' : '';
	$user_today .= ($row['user_level'] == 2) ? ' style="color: #' . $theme['fontcolor2'].'"><b>' . $row['username'].'</b></a>' : '';
	$user_today .= ($row['user_level'] != 1 && $row['user_level'] != 2) ? '">' . $row['username'] . '</a>' : '';
	//$user_today .= ' (' . $lang['wwd_last'] . ' ' . create_date('H:i', $row['user_session_time'], $user_gmd) . ')';
	$count_user_today++;
	}



if ( $count_user_today > $board_config['wwd_record_users'] )
	{
	$sql = 'UPDATE ' . CONFIG_TABLE . "	SET config_value = '$count_user_today' WHERE config_name = 'wwd_record_users'";
	if ( !$db->sql_query($sql) )
	{
      message_die(GENERAL_ERROR, 'Could not update row wwd_record_users in phpBB CONFIG_TABLE', '', __LINE__, __FILE__, $sql);
	}
	
	$sql = "UPDATE " . CONFIG_TABLE . " SET config_value = '$time' WHERE config_name = 'wwd_record_time'";
	if ( !$db->sql_query($sql) )
	{
      message_die(GENERAL_ERROR, 'Could not update row wwd_record_time in phpBB CONFIG_TABLE', '', __LINE__, __FILE__, $sql);
	}
	$record_users = $count_user_today;
	$record_time = $time;
} else {
	$record_users = $board_config['wwd_record_users'];
	$record_time = $board_config['wwd_record_time'];
}

$record_text = str_replace('%u', $record_users, $lang['wwd_record']);
$record_text = str_replace('%t', create_date($lang['DATE_FORMAT'], $record_time, $user_gmd), $record_text);

$total_users = $count_user_today;

if ( $enable_wwd_counter ) {
	$sql = 'SELECT `user_active` FROM '.USERS_TABLE." 
        WHERE user_session_time > $mitternacht";
	$result = $db->sql_query($sql);
	if ( !$result )
	{
      message_die(GENERAL_ERROR, 'Could not read number of users from USER_TABLE', '', __LINE__, __FILE__, $sql);
	}
	$hidden = $db->sql_numrows($result) - $count_user_today;
	$total_users += $hidden;
	
	$sql = 'SELECT `ip` FROM `' . $table_prefix . 'wwd_counter_ips`';
	$result = $db->sql_query($sql);
	if ( !$result )
	{
      message_die(GENERAL_ERROR, 'Could not read number of guests from PREFIX_wwd_counter_ips', '', __LINE__, __FILE__, $sql);
	}
	$gaeste = $db->sql_numrows($result);
	$total_users += $gaeste;
}

if ( $enable_wwd_counter ) {

	$user_today_text .= ( $total_users > 1 ) ? str_replace('%d', $total_users, $lang['wwd_c_user_today']) : $lang['wwd_c_one_user'];

	$user_today_text .= ( $count_user_today == 0 || $count_user_today == '' ) ? $lang['Reg_users_zero_total'] : '';
	$user_today_text .= ( $count_user_today == 1 ) ? str_replace('%d', $count_user_today, $lang['Reg_user_total']) : '';
	$user_today_text .= ( $count_user_today > 1 ) ? str_replace('%d', $count_user_today, $lang['Reg_users_total']) : '';

	$user_today_text .= ( $hidden == 0 || $hidden == '' ) ? $lang['Hidden_users_zero_total'] : '';
	$user_today_text .= ( $hidden == 1 ) ? str_replace('%d', $hidden, $lang['Hidden_user_total']) : '';
	$user_today_text .= ( $hidden > 1 ) ? str_replace('%d', $hidden, $lang['Hidden_users_total']) : '';

	$user_today_text .= ( $gaeste == 0 || $gaeste == '' ) ? $lang['Guest_users_zero_total'] : '';
	$user_today_text .= ( $gaeste == 1 ) ? str_replace('%d', $gaeste, $lang['Guest_user_total']) : '';
	$user_today_text .= ( $gaeste > 1 ) ? str_replace('%d', $gaeste, $lang['Guest_users_total']) : '';

} else {
	if ( $count_user_today > 1 ) {
		$user_today_text = str_replace('%u', $count_user_today, $lang['wwd_user_today']);
	} elseif ( $count_user_today == 1 ) {
		$user_today_text = $lang['wwd_one_user'];
	} else {
		$user_today_text = $lang['wwd_no_user'];
	}
}


$db->sql_freeresult($result);
/*----------WER WAR HEUTE DA HACK----------*/
ich denk mal das einzig interessante is das hier:

Code: Alles auswählen

$sql = 'Select user_id, username, user_session_time, user_level FROM '.USERS_TABLE." 
        WHERE user_allow_viewonline = '1' AND user_session_time > $mitternacht 
		ORDER BY user_session_time DESC";

$result = $db->sql_query($sql);

while( $row = $db->sql_fetchrow($result) )
	{
	$user_today .= ($count_user_today > 0) ? ', ' : ''; 
	$user_today .= '<a href="' . append_sid('profile.php?mode=viewprofile&u=' . $row['user_id']) . '"';
	$user_today .= ($row['user_level'] == 1) ? ' style="color: #' . $theme['fontcolor3'].'"><b>' . $row['username'].'</b></a>' : '';
	$user_today .= ($row['user_level'] == 2) ? ' style="color: #' . $theme['fontcolor2'].'"><b>' . $row['username'].'</b></a>' : '';
	$user_today .= ($row['user_level'] != 1 && $row['user_level'] != 2) ? '">' . $row['username'] . '</a>' : '';
	//$user_today .= ' (' . $lang['wwd_last'] . ' ' . create_date('H:i', $row['user_session_time'], $user_gmd) . ')';
	$count_user_today++;
	}

Kann mir das jemand umbauen dass es funzt?

Verfasst: 14.10.2005 11:57
von MaverickZ
ok, ich glaub ich habs hinbekommen. hab einfach den code von weiter oben auch mal bei mir eingesetzt... ich hoffe das klappt dauerhaft. wäre aber nett wenn trotzdem einfach mal einer guckt ob das so ok war...