Shoutbox: Gäste mit IP für Admin anzeigen?

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
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.
Antworten
starshine
Mitglied
Beiträge: 26
Registriert: 12.01.2005 15:37

Shoutbox: Gäste mit IP für Admin anzeigen?

Beitrag von starshine »

Hallo,

eine Bekannte von mir hat ebenfalls ein phpBB-Forum installiert (bekommen - aber nicht von mir :) ), der Mod "Shoutbox" wurde ebenfalls eingebaut.

Nun ist leider ein "Schmierfink" als Gast dort und stänkert.

Das Schreibrecht sollte Gästen nicht entzogen werden, es geht einfach nur darum, dass man sieht, von welcher IP-Adresse der Text aus geschrieben wurde.

Gibt es da eine Möglichkeit, diese IP für Admins sichbar zu machen?

Liebe Grüße
Manu
Benutzeravatar
kidrob
Mitglied
Beiträge: 755
Registriert: 29.01.2005 00:06
Wohnort: Brüssel
Kontaktdaten:

hmm

Beitrag von kidrob »

kommt ganz drauf an, welche shoutbox verwendet wird!

habe die shoutbox von "niels" - wenn man da auf shoutbox klickt sieht man die shoutbox wie einen "normalen Forumthread"!->dh. man kann bannen!

aber schau mal, ob der sonst irgentwo seine ip hat, -> dann ban ihn einfach "normal" auf dem forum (im acp)

-> siehe auch den "IPTracking - mod"

hoffe konnte dir damit helfen!
Gruß Robin!
starshine
Mitglied
Beiträge: 26
Registriert: 12.01.2005 15:37

Beitrag von starshine »

Hallo Kidrob,

danke erst mal für Deine schnelle Antwort!

Den Link "Shoutbox" kann ich anklicken, aber daraufhin erscheint es nicht wie ein Foren-Thread, sondern einfach nur in kompletter Fenstergröße.

In der shoutbox steht folgendes Copyright drin: copyright : (C) 2003 Przemo ( http://www.przemo.org ) -> small shoutbox


Ich habe einen anderen Mod gefunden, der eigentlich genau das macht (halt nur in einer anderen Datei, in diesem Fall viewtopic.php), was in der Shoutbox interessant wäre.

Dabei handelt es sich um den "Guest_less_anonymous-Mod", bei dem folgende Zeilen nur in die Viwtopic.php eingebaut werden müssen:

Code: Alles auswählen

//-- delete
	//
	// Handle anon users posting with usernames
	//
//	if ( $poster_id == ANONYMOUS && $postrow[$i]['post_username'] != '' )
//	{
//		$poster = $postrow[$i]['post_username'];
//		$poster_rank = $lang['Guest'];
//	}
//-- add
	//
	// Handle anon users posting with usernames
	//
	if ( $poster_id == ANONYMOUS )
		if ($postrow[$i]['post_username'] != '') 
		{
			$poster_rank = $lang['Guest'] . '<br> IP: ' . decode_ip($postrow[$i]['poster_ip']);
			$poster = $postrow[$i]['post_username'];
		}
		else
		{
			$poster = decode_ip($postrow[$i]['poster_ip']);
			$poster_rank = gethostbyaddr($poster) . ' @ ' ;
			$poster_rank .= $lang['Guest'];
			$poster = 'IP: ' . $poster;
		}

//-- fin mod : Guests less anonymous 

In der Shoutbox_view.php steht folgender Code:

Code: Alles auswählen

if ( $shoutbox_config['links_names'] ) $name = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=$name_id") . '" target="_blank" class="gensmall" title="' . $lang['Read_profile'] . '">' . $username . '</a>';
			else $name = $username;

			if ( $username == Anonymous ) $name = '' . $lang['Guest'] . '';
Gäbe es da eine Möglichkeit, den oben genannten Code einzubauen - müsste natürlich umgeschrieben werden irgendwie (mh, für mich als Laie ziemlich heftig)...

Liebe Grüße
Manu
Benutzeravatar
kidrob
Mitglied
Beiträge: 755
Registriert: 29.01.2005 00:06
Wohnort: Brüssel
Kontaktdaten:

hmm

Beitrag von kidrob »

habe leider ne andere shoutbox als du!

-> also aber wenn du schon so einen entsprechenden mod hast, dann musst den ja nur noch einbauen!

mach einfach das, was in der modanleitung steht!

->du weißt ja, dass du den oberen code einfügen musst, dann stand da doch sicher auchne zeile, oder wo nach du das einfügen sollst!? mach doch das einfach so!?

wenn du das nicht kannst, weil du das noch nie gemacht hast, schau einfach hier auf dieser seite (phpbb) -da stehen jede menge anleitungen!
Gruß Robin!
starshine
Mitglied
Beiträge: 26
Registriert: 12.01.2005 15:37

Beitrag von starshine »

Hallo Kidrob,

naja, der Mod ist halt für eine andere Datei gedacht, leider wirkt der sich nicht auf die Shoutbox aus, da die Shoutbox auf eine ganz andere Datei zugreift (auf die shoutbox_view.php).

Den Text dort einfach mal einzufügen habe ich schon probiert, auch nur die Daten, die ich davon brauche, aber irgendwie brüllt mir dann die Shoutbox nette Fehler... Kein Wunder, denn ich müsste auf eine andere Datenbankspalte ( SESSIONS_TABLE ) zugreifen, damit ich die IP hätte, oder?

Wenn das in der Viewtopic.php so geht, ist es wahrscheinlich, dass es auch in der Shoutbox_view.php gehen wird, halt nur mit nem etwas abgewandelten Code.

Wäre halt eine Idee, nur an der Umsetzung hapert es bei mir...

Ich poste mal den kompletten Code der shoutbox_view.php hier:

Code: Alles auswählen

<?php
/***************************************************************************
 *				shoutbox_view.php
 *				-------------------
 *   begin		: Friday, Jul 12, 2003
 *   copyright	: (C) 2003 Przemo
 *   website	: http://www.przemo.org
 *   email		: przemo@przemo.org
 *   version	: 1.4
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx);

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);


if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) 
{ 
   $mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; 
} 
if ( isset($HTTP_GET_VARS['name']) || isset($HTTP_POST_VARS['name']) ) 
{ 
   $name = ( isset($HTTP_GET_VARS['name']) ) ? $HTTP_GET_VARS['name'] : $HTTP_POST_VARS['name']; 
} 
if ( isset($HTTP_GET_VARS['message']) || isset($HTTP_POST_VARS['message']) ) 
{ 
   $message = ( isset($HTTP_GET_VARS['message']) ) ? $HTTP_GET_VARS['message'] : $HTTP_POST_VARS['message']; 
} 
if ( isset($HTTP_GET_VARS['msg']) || isset($HTTP_POST_VARS['msg']) ) 
{ 
   $msg = ( isset($HTTP_GET_VARS['msg']) ) ? $HTTP_GET_VARS['msg'] : $HTTP_POST_VARS['msg']; 
} 
if ( isset($HTTP_GET_VARS['id']) || isset($HTTP_POST_VARS['id']) ) 
{ 
   $id = ( isset($HTTP_GET_VARS['id']) ) ? $HTTP_GET_VARS['id'] : $HTTP_POST_VARS['id']; 
} 
if ( isset($HTTP_GET_VARS['del_sb_id']) || isset($HTTP_POST_VARS['del_sb_id']) ) 
{ 
   $del_sb_id = ( isset($HTTP_GET_VARS['del_sb_id']) ) ? $HTTP_GET_VARS['del_sb_id'] : $HTTP_POST_VARS['del_sb_id']; 
} 
if ( isset($HTTP_GET_VARS['name_id']) || isset($HTTP_POST_VARS['name_id']) ) 
{ 
   $name_id = ( isset($HTTP_GET_VARS['name_id']) ) ? $HTTP_GET_VARS['name_id'] : $HTTP_POST_VARS['name_id']; 
} 
if ( isset($HTTP_GET_VARS['date_edit']) || isset($HTTP_POST_VARS['date_edit']) ) 
{ 
   $date_edit = ( isset($HTTP_GET_VARS['date_edit']) ) ? $HTTP_GET_VARS['date_edit'] : $HTTP_POST_VARS['date_edit']; 
} 
if ( isset($HTTP_GET_VARS['name_edit']) || isset($HTTP_POST_VARS['name_edit']) ) 
{ 
   $name_edit = ( isset($HTTP_GET_VARS['name_edit']) ) ? $HTTP_GET_VARS['name_edit'] : $HTTP_POST_VARS['name_edit']; 
} 
if ( isset($HTTP_GET_VARS['clean_msg']) || isset($HTTP_POST_VARS['clean_msg']) ) 
{ 
   $clean_msg = ( isset($HTTP_GET_VARS['clean_msg']) ) ? $HTTP_GET_VARS['clean_msg'] : $HTTP_POST_VARS['clean_msg']; 
} 
if ( isset($HTTP_GET_VARS['submit_button']) || isset($HTTP_POST_VARS['submit_button']) ) 
{ 
   $submit_button = ( isset($HTTP_GET_VARS['submit_button']) ) ? $HTTP_GET_VARS['submit_button'] : $HTTP_POST_VARS['submit_button']; 
}


$sb_user_id = $userdata['user_id'];

if ( $mode == "show" )
{
	@setcookie('shoutbox',on , (time()+3600*9000), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
	header("Location: " . append_sid("index.$phpEx?redirect=shoutbox_view.$phpEx", true));
}

if ( $mode == "submit" && $msg )
{
	if ( !$shoutbox_config['allow_guest'] && !$userdata['session_logged_in'] )
	{
		echo '<body onload="window.scrollTo(0,0);" />
			<table align="center"><tr><td align="left"><span class="gensmall">
			<b>' . $lang['login_to_shoutcast'] . '</b></span></td></tr></table>';
	}

	$check_lenght=explode(" ",$msg);
	$total=sizeof($check_lenght);
	for($i=0; $total > $i; $i++)
	if (strlen($check_lenght[$i])>$shoutbox_config['word_lenght'])
	{
		$too_long = true;
		echo '<body onload="window.scrollTo(0,0);" />
			<table align="center"><tr><form name="post" action="shoutbox_view.php" method="POST"><td align="left"><span class="gensmall">
			<b>' . $lang['too_long_word'] . '</b></span></td></tr></table>';
	}

	$current_time = time();
	$sql = "SELECT MAX(timestamp) AS last_msg_time
		FROM " . SHOUTBOX_TABLE . "
		WHERE sb_user_id = $sb_user_id";
	if ( $result = $db->sql_query($sql) )
	{
		if ( $row = $db->sql_fetchrow($result) )
		{
			if ( $row['last_msg_time'] > 0 && ( $current_time - $row['last_msg_time'] ) < $board_config['flood_interval'] )
			{
				$flood_msg = true;
				echo '<body onload="window.scrollTo(0,0);" />
					<table align="center"><tr><td align="left"><span class="gensmall">
					' . $lang['Flood_Error'] . '</span></td></tr></table>';
			}
		}
	}

	$shoutbox_config['banned_user_id'] = $GLOBALS['shoutbox_config']['banned_user_id'];
	if( strstr($shoutbox_config['banned_user_id'], ',') )
	{
		$fids = explode(',', $shoutbox_config['banned_user_id']);
	
		while( list($foo, $id) = each($fids) )
		{
			$fid[] = intval( trim($id) );
		}
	}
	else
	{
		$fid[] = intval( trim($shoutbox_config['banned_user_id']) );
	}
	reset($fid);
	if ( in_array($sb_user_id, $fid) != false )
	{
		echo '<body onload="window.scrollTo(0,0);" />
			<table align="center"><tr><td align="left"><span class="gensmall">
			' . $lang['sb_banned_send'] . '</span></td></tr></table>';
		$shoutbox_banned = true;
	}

	if ( !$too_long && !$flood_msg && !$shoutbox_banned ) if ( $shoutbox_config['allow_guest'] || $userdata['session_logged_in'] )
	{
		$sql = "INSERT INTO " . SHOUTBOX_TABLE . "
		       VALUES('', '$sb_user_id', '$msg', '".time()."', '$name')";
		if( !($result = $db->sql_query($sql)) )
		{ message_die(GENERAL_ERROR, 'Could not insert shoutbox message', '', __LINE__, __FILE__, $sql); }

		$start = time() - $shoutbox_config['delete_days'] * 86400;
		$sql = "DELETE FROM " . SHOUTBOX_TABLE . "
			WHERE timestamp < $start";
		if( !($result = $db->sql_query($sql)) )
		{ message_die(GENERAL_ERROR, 'Could not delete shoutbox messages', '', __LINE__, __FILE__, $sql); }
	}
}

if ( $shoutbox_config['allow_edit_all'] && $username != Anonymous ) $aedit = 1; else $aedit = 0;
if ( $shoutbox_config['allow_delete_all'] && $username != Anonymous ) $adel = 1; else $adel = 0;
if ( $shoutbox_config['allow_edit'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $aedit = 1;
if ( $shoutbox_config['allow_delete'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $adel = 1;
else $del_mod = "AND sb_user_id = $sb_user_id";

if ( $mode == "delete" && $adel )
{
	$sql = "DELETE FROM " . SHOUTBOX_TABLE . "
	      WHERE id = $id $del_mod";
	if( !($result = $db->sql_query($sql)) )
	{ message_die(GENERAL_ERROR, 'Could not delete shoutbox message', '', __LINE__, __FILE__, $sql); }
}

if ( $mode == "edit" && $aedit )
{
	echo '<body onload="window.scrollTo(0,0);" />
		<table><tr><form name="post" action="shoutbox_view.php" method="POST"><td align="left"><span class="gensmall">
		' . $lang['Edit_pm'] . ': <input type="text" name="message" style="height:15px" size="60" maxlength="150" " value="' . $clean_msg . '" class="editbox"><input type="hidden" name="mode" value="edited_msg"><input type="hidden" name="id" value="' . $id . '"><input type="hidden" name="name_edit" value="' . $name_edit . '">
		<input type="hidden" name="date_edit" value="' . $date_edit . '">
		<input type="hidden" name="name_id" value="' . $name_id . '">
		<input type="submit" name="submit_button" value="' . $lang['Submit'] . '" style="font-size:9px; height:16px;" class="button"></span></td>
		</form></tr></table>';
}

if ( $mode == "edited_msg" && $aedit )
{
	$sql = "REPLACE INTO " . SHOUTBOX_TABLE . "
	       VALUES('$id', '$name_id', '$message', '$date_edit', '$name_edit')";
	if( !($result = $db->sql_query($sql)) )
	{ message_die(GENERAL_ERROR, 'Could not replace shoutbox message', '', __LINE__, __FILE__, $sql); }
}

$template->set_filenames(array(
	'body' => 'shoutbox_view_body.tpl')
);

$shoutbox_config['banned_user_id_view'] = $GLOBALS['shoutbox_config']['banned_user_id_view'];
if( strstr($shoutbox_config['banned_user_id_view'], ',') )
{
	$fids = explode(',', $shoutbox_config['banned_user_id_view']);

	while( list($foo, $id) = each($fids) )
	{
		$fid[] = intval( trim($id) );
	}
}
else
{
	$fid[] = intval( trim($shoutbox_config['banned_user_id_view']) );
}
reset($fid);
if ( in_array($sb_user_id, $fid) != false )
{
	$shoutbox_banned_view = true;
}

if ( $shoutbox_config['shoutbox_on'] && $shoutbox != "off" && !$shoutbox_banned_view ) if ( $shoutbox_config['allow_guest'] || $shoutbox_config['allow_guest_view'] || $userdata['session_logged_in'] )
{
	function get_shout_msg()
	{
		global $db;
		$sql = "SELECT COUNT(id) AS total
			FROM " . SHOUTBOX_TABLE . "";
		if ( !($result = $db->sql_query($sql)) )
		{ message_die(GENERAL_ERROR, 'Could not query shoutbox count messages', '', __LINE__, __FILE__, $sql); }
		$row = $db->sql_fetchrow($result);
		return $row['total'];
	}

	$msg_count = get_shout_msg();
	$number = $shoutbox_config['count_msg'];
	$start = $msg_count - $number;
	if ( $msg_count < $number ) $start = 0;
	$sql = "SELECT id, sb_user_id, msg, timestamp, sb_username
		FROM " . SHOUTBOX_TABLE . "
		ORDER by timestamp LIMIT $start, $number";
	if( !($result = $db->sql_query($sql)) )
	{ message_die(GENERAL_ERROR, 'Could not query shoutbox messages', '', __LINE__, __FILE__, $sql); }

	if ( $row = $db->sql_fetchrow($result) )
	{
		$i = 0;
		do
		{
			$name_id = $row['sb_user_id'];
			$username = $row['sb_username'];
			$username = stripslashes(htmlspecialchars(trim($username)));

			if ( $shoutbox_config['links_names'] ) $name = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=$name_id") . '" target="_blank" class="gensmall" title="' . $lang['Read_profile'] . '">' . $username . '</a>';
			else $name = $username;

			if ( $username == Anonymous ) $name = '' . $lang['Guest'] . '';

			$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
			$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
			if ( $shoutbox_config['date_on'] ) 
			{
				$make_date = create_date($shoutbox_config['date_format'], $row['timestamp'], $board_config['board_timezone']);
				$date = '[' . $make_date . ']';
			}
			$msg = $row['msg'];
			$msg = htmlspecialchars(trim($msg));

			if ( $shoutbox_config['allow_smilies'] )
			{
				$msg = smilies_pass($msg);
				$msg = preg_replace('/images\/smiles/', 'images/smiles', $msg);
			}

			if ( $shoutbox_config['make_links'] ) $msg = make_clickable($msg);
			if ( $shoutbox_config['allow_bbcode'] )
			{
				$msg = str_replace("[/i]","</i>",$msg); $msg = str_replace("[i]","<i>",$msg);
				$msg = str_replace("[/b]","</b>",$msg); $msg = str_replace("[b]","<b>",$msg);
				$msg = str_replace("[/u]","</u>",$msg); $msg = str_replace("[u]","<u>",$msg);
			}
			else
			{
				$msg = str_replace("[/i]","",$msg); $msg = str_replace("[i]","",$msg);
				$msg = str_replace("[/b]","",$msg); $msg = str_replace("[b]","",$msg);
				$msg = str_replace("[/u]","",$msg); $msg = str_replace("[u]","",$msg);
			}

			$id = $row['id'];
			if ( $shoutbox_config['allow_edit_all'] && $username != Anonymous && $sb_user_id == $name_id ) $aedit = 1; else $aedit = 0;
			if ( $shoutbox_config['allow_delete_all'] && $username != Anonymous && $sb_user_id == $name_id ) $adel = 1; else $adel = 0;
			if ( $shoutbox_config['allow_edit'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $aedit = 1;
			if ( $shoutbox_config['allow_delete'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $adel = 1;
			if ( $adel )
			{
				$temp_url = append_sid("shoutbox_view.$phpEx?mode=delete&id=$id&del_sb_id=$sb_user_id");
				$delmsg = '<a href="' . $temp_url . '" class="mainmenu" title="' . $lang['Delete_message'] . '"><b>X</b></a>';
			}
			else
			{
				$delmsg = '';
			}
			if ( $aedit )
			{
				$date_edit = $row['timestamp'];
				$name_edit = $row['sb_username'];
				$clean_msg = $row['msg'];
				$temp_url_e = append_sid("shoutbox_view.$phpEx?mode=edit&id=$id&name_id=$name_id&date_edit=$date_edit&name_edit=$name_edit&clean_msg=$clean_msg");
				$editmsg = '<a href="' . $temp_url_e . '" class="mainmenu" title=" ' .$lang['Edit_pm'] . '"><b>E</b></a>';
			}
			else
			{
				$editmsg = '';
			}

			$template->assign_block_vars('shoutrow', array(
				'DELMSG' => $delmsg,
				'EDITMSG' => $editmsg,
				'ROW_CLASS' => $row_class,
				'NAME' => $name,
				'DATE' => $date,
				'MSG' => $msg
				)
			);

			$i++;
		}
		while ( $row = $db->sql_fetchrow($result) );
	}

}

$template->assign_vars(array( 
'S_CONTENT_ENCODING' => $lang['ENCODING']) 
);

$template->pparse('body');

?>
Trotzdem vielen Dank, dass Du Dich meinem Problem gewidmet hast :)

Liebe Grüße
Manu
Antworten

Zurück zu „phpBB 2.0: Mod Support“