Seite 1 von 2

[Erledigt] x7chat User werden im Forum nicht angezeigt

Verfasst: 09.05.2007 18:48
von Punky2104
Hallo Leute

Ich habe in mein Forum den x7chat Mod eingebaut. Jetzt wollte ich, das im Forum angezeigt wird, ob jemand im Chat ist. Ich habe es nach der Anleitung gemacht, die beigelegt war, doch es funktioniert nicht.

Seht selbst
Forum

Es wird nur ein Bild, bzw. nicht Bild angezeigt, zumindest im IE. Im Firefox wird nix angezeigt

Mein Provider: Strato

hier mal mein Quellcode in der index_body.tpl
<table cellspacing="1" class="index_body">
<tr>
<td colspan="2"><h2><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h2></td>
</tr>
<tr>
<td class="row1 one" rowspan="2"><img src="templates/AdInfinitum/images/whosonline.gif" alt="" /></td>
<td class="row1 two">{TOTAL_POSTS}<br />
{TOTAL_USERS}<br />
{NEWEST_USER}</td>
</tr>
<tr>
<td class="row1 two">{TOTAL_USERS_ONLINE} &nbsp; [ {L_WHOSONLINE_ADMIN} ] &nbsp; [ {L_WHOSONLINE_MOD} ]<br />
<br>
derzeit im Chat &nbsp;&nbsp; <img src="../x7chat2/online.php?font_size=10&size_y=10&red=00&green=66&blue=99" border="0" align="absmiddle">User <br>
<br>
{RECORD_USERS}<br />
{LOGGED_IN_USER_LIST}</td>
</tr>
</table>
Ich habe hier schon alles durchsucht, aber nix gefunden.

Bitte helft mir.

Ach ja wenn es möglich ist, würde ich gerne angezeigt bekommen, WER im Chat ist, also die Usernamen.

Danke schonmal im vorraus

Verfasst: 11.05.2007 12:41
von Punky2104
weiß keiner nen Rat??? :(

Verfasst: 11.05.2007 13:39
von Andi1111
keine ahnung ob dir das was nutzt, ich habe im portal eine box in der wird richtig angezeigt wer im chat ist. der code davon sieht so aus.

Code: Alles auswählen

<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<th>Chat</th>
</tr>
<tr>
<td class="row2"><span class="genmed"><a href="{U_X7CHAT}">{L_X7COUNT}:</a><br />{L_X7_LIST}</span></td>
</tr>
<tr>
<td class="row1">
<a href="{U_X7CHAT}" title="CHAT">Chat betreten&nbsp;</a>
</td>
</tr>
</table>

Verfasst: 11.05.2007 15:57
von Punky2104
ich hab nur leider ein Problem, ich habe überhaupt keine Ahnung wo ich das jetzt einbauen soll :(

Verfasst: 11.05.2007 16:55
von Andi1111
also wenn du direkt im browser die datei aufrufst kommt das:

Warning: putenv() [function.putenv]: Safe Mode warning: Cannot set environment variable 'GDFONTPATH' - it's not in the allowed list in /mnt/kw2/06/511/00000014/htdocs/bootboys/x7chat2/online.php on line 85

Warning: Cannot modify header information - headers already sent by (output started at /mnt/kw2/06/511/00000014/htdocs/bootboys/x7chat2/online.php:85) in /mnt/kw2/06/511/00000014/htdocs/bootboys/x7chat2/online.php on line 93
‰PNG IHDR é“àßPLTEÿÿÿßßß___ŸŸŸ???¿¿¿©<öÇ:IDAT™c`€eA#åª$Y ˜Ø8 X˜

Verfasst: 11.05.2007 17:05
von Punky2104
leider is mein englisch mehr als miserabel. Ich habe nicht mal die Hälfte verstanden, aber trotzdem Danke für die Hilfe.

Ich hoffe es hat noch jemand eine Idee!!! :-?

Verfasst: 11.05.2007 17:19
von Punky2104
es gibt doch auf der Login Seite ein Feld mit Statistik
siehe hier:
http://www.bootboys.eu/x7chat2/index.php

kann man das nicht einfach irgendwie auf einer anderen Seite, zum Beispiel der Startseite des Forums, anzeigen lassen???

Und wenn ja wie geht das, habe grad schon alles versucht, doch irgendwie will es nicht gehen, habt Ihr eine Idee???

Verfasst: 12.05.2007 12:07
von Punky2104
hat keiner ne Idee???

viele von euch habe doch so eine Anzeige, wie habt Ihr das gemacht???

Verfasst: 12.05.2007 16:08
von Punky2104
So ich habe jetzt mit meiner, zugegebener Maßen, wenigen Erfahrung in PHP, es geschafft, das der Counter angezeigt wird. Jetzt habe ich nur das Problem, das der Counter nur dann angezeigt wird, wenn man NICHT eingeloggt ist. Sobald man eingeloggt ist, kommt ein leeres Feld. Vielleicht kann mir jemand sagen, was ich ändern muss.

Hier der Code:
<?PHP
// Import the configuration file
include("./config.php");

// Test to see if it is installed
if(!isset($X7CHAT_CONFIG['INSTALLED'])){
header("location: ./install.php");
echo "<a href=\"./install.php\">Click Here to Install X7 Chat 2.0.0A3</a>";
exit;
}

// Test to make sure the user didn't miss the last install step
if(@$_GET['act'] != "frame"){
if(file_exists("./install.php") || file_exists("./upgradev1.php")){
print("<div align='center'><font color='red'>You must delete the files install.php and upgradev1.php before using the chatroom.</font></div>");
exit;
}
}

// Import the database library
include("./lib/db/".strtolower($X7CHAT_CONFIG['DB_TYPE']).".php");

// Create a new database connection
$db = new x7chat_db();
// Include the classes needed for loading

// Include the security
include("./lib/security.php");

// Clean all incoming data
parse_incoming();
include("./lib/load.php");

// Load the server variables
$x7c = new settings();

// Clean up the database a tad
include("./lib/cleanup.php");
cleanup_banned();

// Include the authentication functions
include("./lib/auth.php");

// Include the AuthMod file
include("./lib/auth/".strtolower($X7CHAT_CONFIG['AUTH_MODE']).".php");

// Force Settings from AuthMod
if($auth_disable_guest)
$x7c->settings['allow_guests'] = 0;

// Create a new session
$x7s = new session();

// Is the user trying to login? If so give them a cookie
if(isset($_POST['dologin']) && @$_POST['username'] != "")
$x7s->dologin();

// The alternate way to login is using GETs, check for that
if(isset($_GET['dologin']) && @$_GET['username'] != ""){
$_POST['username'] = $_GET['username'];
$_POST['password'] = $_GET['password'];
$x7s->dologin();
}

// If the user is logged in then load their settings and profile
if($x7s->loggedin == 1){
$x7p = new profile_info($x7s->username);
$x7c->usersettings();
}

// Include the language file
include("./lang/".$x7c->settings['default_lang'].".php");

// Include the output library
include("./lib/output.php");

// Load the skin data
$print = new load_skin($x7c->settings['default_skin']);

// Run these cleanups only if you are not part of a frame
if(@$_GET['act'] != "frame"){
cleanup_messages();
cleanup_guests();
}

// Now before all else we have to get them logged in if they are not already
// We also have to check and make sure they are not trying to register or remember their password which they stupidly forgot or get help or anything like that

// THis array contins the functions that you don't hvae to be logged in to do
$no_login_req[] = "register";
$no_login_req[] = "forgotmoipass";
$no_login_req[] = "sm_window";
$no_login_req[] = "help";

if($x7s->loggedin == 0 && !in_array(@$_GET['act'],$no_login_req)){
// They are not logged in
// Include controls for login and logout
include("./counter-lib.php");
page_login();
$print->dump_buffer();
exit;
}elseif($x7s->loggedin == 2 && !in_array(@$_GET['act'],$no_login_req)){
// They tried to login but with an incorrect pass or username
include("./counter-lib.php");
page_login("failed");
$print->dump_buffer();
exit;
}elseif($x7s->loggedin == 3 && !in_array(@$_GET['act'],$no_login_req)){
// They tried to login but their username was invalid
include("./counter-lib.php");
page_login("invalid");
$print->dump_buffer();
exit;
}elseif($x7s->loggedin == 4 && !in_array(@$_GET['act'],$no_login_req)){
// They tried to login but their username was invalid
include("./counter-lib.php");
page_login("activated");
$print->dump_buffer();
exit;
}

// Prevent their username and room from being deleted
prevent_cleanup();

// If the user has just entered as a guest then we need to remove old logs
// This variable is set in lib/auth.php IF it is set at all
if(isset($remove_old_guest_logs))
cleanup_guest_logs($x7s->username);

// Prevent errors
if(!isset($_GET['act']))
$_GET['act'] = "";

// We cannot allow a user to start the frameset without choosing a room
if($_GET['act'] == "frame" && $x7c->room_name == "")
$_GET['act'] = "";

// Test to see if server is running in single room mode
if($x7c->settings['single_room_mode'] != ""){
// Set the room name
$_GET['room'] = $x7c->settings['single_room_mode'];
// Fix problems with room passwords
$x7c->room_info($_GET['room']);
// Set action to frameset
if($_GET['act'] == "")
$_GET['act'] = "frame";
}

// See if the room is password protected
if(isset($_GET['room'])){
include("./sources/room_password.php");

$cookie_name = "rpw_".$x7c->room_data['id'];

// See if a cookie password is set
if(!isset($_COOKIE[$cookie_name]))
$_COOKIE[$cookie_name] = "";

// See if the password form was filled out
if(isset($_POST['room_pw']))
$_COOKIE[$cookie_name] = $_POST['room_pw'];

// Check the password returns 1 if correct, 2 if incorrect and 0 if there is no password
$result = check_password($_GET['room'],$_COOKIE[$cookie_name]);
if($result == 1){
setcookie($cookie_name,$_COOKIE[$cookie_name],time()+$x7c->settings['cookie_time'],$X7CHAT_CONFIG['COOKIE_PATH']);
}elseif($result == 2 && $x7c->permissions['access_pw_rooms'] != 1){
roomlogin_screen($_GET['room']);
$print->dump_buffer();
exit;
}

}

// See if a bandwidth error is occuring
if($x7c->settings['log_bandwidth'] == 1){
include("./lib/bandwidth.php");
$BW_CHECK = check_bandwidth($x7s->username);
if($BW_CHECK && ((@$_GET['frame'] != 'update' || $_GET['act'] != 'frame') && (@$_GET['pmf'] != "update" || $_GET['act'] != "pm")))
$_GET['act'] = "bw_error";
}


// See if the admin has disabled the chat server
if($x7c->settings['disable_chat'] == 1 && @$_GET['act'] != "logout" && $x7c->permissions['access_disabled'] != 1)
$_GET['act'] = "disabledchat";

// Time to see what's happening! The $act variable stored what the
// user wants to see. We need to determine that and bring up the
// correct page

// See if they are banned from this server
include("./lib/ban.php");
$x7p->bans_on_you = get_bans_onyou();
$bans = $x7p->bans_on_you;

foreach($bans as $key=>$row){
if($row[1] == "*" && ((@$_GET['frame'] != 'update' || $_GET['act'] != 'frame') && (@$_GET['pmf'] != "update" || $_GET['act'] != "pm"))){ // The reason we see if they are getting the update frame is cuz if they are we need to let them so it'll remove them from the room they are in now
$_GET['act'] = "sbanned";
$ban_reason = $row[5];

// Remove them from all online lists
$db->DoQuery("DELETE FROM {$prefix}online WHERE name='$x7s->username'");
}
}

// Ok let's see what's inside
switch($_GET['act']){
case "logout":
// The user is leaving us :(
setcookie($auth_ucookie,"",time()-$x7c->settings['cookie_time']-63000000,$X7CHAT_CONFIG['COOKIE_PATH']);
setcookie($auth_pcookie,"",time()-$x7c->settings['cookie_time']-63000000,$X7CHAT_CONFIG['COOKIE_PATH']);

// If the admin has choosen where to send the user to then send them there
$to_send = $x7c->settings['logout_page'];
if($to_send != ""){
header("Location: $to_send");
}else{
$print->normal_window($txt[16],"$txt[17]<br><Br>&nbsp; <a href=\"index.php\">[$txt[0]]</a>");
$print->dump_buffer();
exit;
}
break;

case "panic":
// Core error (probably database)
$print->normal_window($txt[14],"$txt[597]<Br><br><hr><b>Error Dump</b><br>$_GET[dump]<Br>$_GET[source]<Br>");
$print->dump_buffer();
exit;
break;

// Chat is disabled and user is not an admin
case "disabledchat":
$print->normal_window($txt[14],$txt[39]);
$print->dump_buffer();
exit;
break;


}

?>
Ich denke mal, das meine Methode nicht ganz die beste war, da ich einfach die Index-Seite kopiert habe und dann solange gelöscht habe, bis nur noch das Counterfeld übrig war. Leider war das das einzige, womit ich mir helfen konnte. Ich hoffe Ihr könnt mir sagen, wie ich es fertigstelle, denn irgendwie muss man ja das Feld auch anzeigen lassen können ohne das man sich erst ausloggen muss. :-?

Verfasst: 12.05.2007 16:14
von Andi1111
wie hast du das denn in die tpl eingebaut?