Seite 1 von 1

Chatbox 3.0.1: IFrames & Archivierung

Verfasst: 15.02.2004 12:49
von Wuppi
Hi

Edit: Such-Request gelöscht: ne nette hab ich jetzt gefunden - hoffe ich ;)

-> siehe 2. Posting - da hab ich nämlich noch so paar probleme mit :(

Danke
Wuppi

Verfasst: 15.02.2004 18:48
von Wuppi
Hi

hab mir gerade mal chatbox_v3_0_1 angeschaut ... leider nur per Popup ... würde es aber gerne eingebettet haben (werde es dann dem User zur Wahl stellen: eingebettet oder Popup).

Hab daher ne chat.php erstellt:

Code: Alles auswählen

<?php 
define('IN_PHPBB', true); 

$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 

$userdata = session_pagestart($user_ip, PAGE_INDEX); 
init_userprefs($userdata); 
include($phpbb_root_path . 'includes/page_header.'.$phpEx); 

?>
<iframe src="chatbox_mod/chatbox.php" width="800" height="375" align="center">Alternativlink</iframe>
<?
include($phpbb_root_path . 'includes/page_tail.'.$phpEx); 
?>
Nur jetzt umgehe ich ja die chatbox_front.php, oder?? Folgendes steht da drin:

Code: Alles auswählen

if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
}

error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);

include_once($phpbb_root_path . 'config.'.$phpEx);

$table_chatbox_session_name = $table_prefix . 'chatbox_session';

// Kill Ghosts
$sql = "DELETE FROM " . $table_chatbox_session_name . " WHERE lastactive < '" . (time() - 300) . "'";
if (!$result = $db->sql_query($sql))
{
	message_die(GENERAL_ERROR, "Could not check session for Ghosts", "", __LINE__, __FILE__, $sql);
}

// Get all remain sessions
$sql = 'SELECT * FROM ' . $table_chatbox_session_name;
if (!$sol = $db->sql_query($sql))
{
	message_die(GENERAL_ERROR, "Could not query ChatBox Session information", "", __LINE__, __FILE__, $sql);
}

$howmanychat = $db->sql_numrows($sol); // Return this

$isimler[0] = $db->sql_numrows($sol);

$i = 1;

while ($record = $db->sql_fetchrow($sol)) 
{ 
         $isimler[$i++] = $record['username']; 
} 

$chatters = $isimler[1];

for($s = 2; $s <= $isimler[0]; $s++)
{
	$chatters .= ", $isimler[$s]"; // Return this
}
Wie kann ich das in meinem Code einbinden? (Muß überhaupt?) Wenn ich die Datei direkt aufrufe kommt Hacking Attempt ... muß mir also das wichtige in meine chat.php kopieren - nur wie mach ich das und wo kommt das hin?

Mhhh gibt es ne möglichkeit alles geschriebene in der DB gespeichert zu lassen (angezeigt werden dann z.b. nur die letzten 100 Zeilen!) ... oder das alles was vom System gelöscht wird (Zeit abgelaufen), vorher in eine weitere Tabelle gesichert wird) ... würde da nämlich gerne noch ne Archiv-Funktion einbauen ;)

Wie kann man das Teil jetzt noch Gästetauglich machen?

Bis denne
Wuppi