Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ET-Chat and MyBB
#11
Absolutely brilliant thank you it's working well so far!

I struggled loads to get a chat room to work with my site and now it's really looking good!

Now I just need to work out how to switch the language to english... lol

Thanks again and keep it up man! Smile
Reply
#12
You can switch the language when logging into it as admin like I stated before Smile

You are welcome, have fun with your chat!
Forum Admin
Reply
#13
i get an error. i uploaded everything and did everything you said and i get this


Fehler beim Verbinden...Fehler beim Auswählen der DB...Dieser Fehler deutet darauf, dass der ET-Chat an keine Datenbank angebunden ist. Lesen Sie bitte dazu die readme.txt und nutzen Sie die Installationsroutine.

Fehler beim Senden der Abfrage...

Dieser Fehler deutet darauf, dass der ET-Chat nicht ordentlich installiert ist. Lesen Sie bitte dazu die readme.txt und nutzen Sie die Installationsroutine.

1146: Table 'nlcom_esips3clan.db1_etchat_config' doesn't exist
Reply
#14
ET Chat can't access your database, make sure that you install it correctly into the MySQL database. It has no connection at the moment.
Forum Admin
Reply
#15
HELP!

Is there an English install page?
Reply
Need professional support? PRinguin, the Digital-Agency. For web design and online marketing.
Register (for free) to hide the ads.
#16
I don't know, sorry. Try GoogleTranslate and if you have any specific questions please ask.

Best regards
Lennart Sauter
Forum Admin
Reply
#17
I'm almost there...Got this error message

Parse error: syntax error, unexpected T_VARIABLE in /home/content/f/t/d/ftdj2009/html/infocenter/chat/index.php on line 63

Here is my code for the page...



<?php
/* ##########################################################################
# ET-Chat v3.x.x
# Lizenz: CCPL - http://creativecommons.org/licenses/by-nc/2.0/de/
# Autor: Evgeni Tcherkasski <SEDesign />
# E-mail: info@s-e-d.de
# WWW: http://www.sedesign.de
############################################################################*/

error_reporting(E_ALL ^ E_NOTICE);
session_start();
define("IN_MYBB", 1);
require("../global.php");
global $db, $mybb, $lang;
$sender = $mybb->user['uid'];
//Redirect guests to index.php
if($mybb->user['uid'] == 0) {
redirect("../index.php", "Guests aren't allowed to chat. Please login");
}
// Connect to MySQL database, MyBB integration:
$verbindung = mysql_pconnect( "myhostname", "myusername", "mypassword");

if (!$verbindung) // If there is something wrong display error message
{
echo "<br><center><b>- Database is not connectiong properly - contact admin -</b></center>";
exit;
}
mysql_select_db("myhostname");

//Get username

$abfrage = "SELECT username FROM mybb_users WHERE uid LIKE ".$sender."";
$ergebnis = mysql_query($abfrage);
mysql_query("SET NAMES 'utf8'");
while($row = mysql_fetch_object($ergebnis))
{
$chatusername = $row->username;
}
$username = $chatusername


//*****************************************************************************
// Für die Realisierung der Anbindung des Chats an Ihr Userverwaltungssystem aus einem
// Forum, CMS, usw. müssen Sie lediglich die unten stehenden Sessionvariablen
// in Ihrem System mit dem Usernamen belegen und den User mit einem
// Link auf diese Datei führen. Beachten Sie dass dabei der Username ohne Passwort übertragen wird.
// Sie dürfen also in Chat keine Passwörter für Admins und Mods anlegen. Für einen Chatbenutzer ist die
// Übergabe des Usernamen über die Sessionvar. $_SESSION['etchat_username'] aus Ihrem
// System ausreichend.


// $user_pw = $_SESSION['etchat_user_pw']; // am besten jedoch, man erstellt Admins und Mods ohne PW
// und löscht die index.php demit niemand unbefügt als Afmin rein kann.

//---------------------------------------------------------------------------
// oder als GET oder POST Übergabe, jedoch unsicher und sollte kodiert werden
// $username = $_REQUEST['etchat_username'];
// $gender = $_REQUEST['etchat_gender'];
//---------------------------------------------------------------------------

// Weiterleitung nach dem Logout(die Session bleibt bestehen,
// da sonst der User aus Ihrem System rausfliegt.)
$_SESSION['etchat_v3_logout_url']="http://www.ftdj3.com/infocenter";







//*****************************************************************************

//Bugfix 26.06.09 ------------------------
if (empty($username)){
echo "Error!<br>No username received.";
exit();
}
// ---------------------------------------------

header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0');

include('dbcon/config.inc.php');
include('dbcon/'.$database_class);
include('dbcon/init_chat_db.class.php');
include('lang/xml_parser.class.php');

$confObj = new InitChatDB($prefix, $sqlhost,$sqluser,$sqlpass,$database,true);
$db = $confObj->dbObj;

$db->sql("delete FROM {$prefix}etchat_messages where etchat_timestamp < ".(date('U')-($confObj->loeschen_nach*3600*24)), false);
$db->sql("delete FROM {$prefix}etchat_blacklist where etchat_blacklist_time < ".date('U'), false);
$db->sql("delete FROM {$prefix}etchat_kick_user where etchat_kicked_user_time < ".date('U'), false);

// language XML auswerten ---------------------------
$xml = file_get_contents('lang/'.$confObj->lang_xml_file);
$parser = new XMLParser($xml);
$parser->Parse();

$lang=$parser->document->checkusername_php[0];
//---------------------------------------------------

// Textfarbe ermitteln. ----------------------------------
$style_lines = file("styles/".$confObj->style."/style.css");
foreach($style_lines as $line){
if (substr($line, 0, 10)=="Textfarbe:") {
$ft = explode(":", $line);
$_SESSION['etchat_v3_textcolor'] = trim($ft[1]);
}
if (substr($line, 0, 12)=="Systemfarbe:") {
$fs = explode(":", $line);
$_SESSION['etchat_v3_syscolor'] = trim($fs[1]);
}
}
// Textfarbe ermitteln ENDE ----------------------------------


// Blacklist IP Prüfung
$user_param_all = $_SERVER['REMOTE_ADDR']."@".@gethostbyaddr($_SERVER['REMOTE_ADDR'])."@".@getenv('HTTP_X_FORWARDED_FOR');
//zuerst nach Cookie:
if(isset($_COOKIE['cookie_etchat_blacklist_ip']) && isset($_COOKIE['cookie_etchat_blacklist_until']))
$blacklist_c=$db->sql("SELECT etchat_blacklist_ip FROM {$prefix}etchat_blacklist WHERE etchat_blacklist_ip = '".$_COOKIE['cookie_etchat_blacklist_ip']."' and etchat_blacklist_time = ".$_COOKIE['cookie_etchat_blacklist_until']." and etchat_blacklist_time > ".date('U'), false);
// jetzt ohne Cookie
$blacklist=$db->sql("SELECT etchat_blacklist_ip FROM {$prefix}etchat_blacklist WHERE etchat_blacklist_ip = '".$user_param_all."' and etchat_blacklist_time > ".date('U'), false);
if (is_array($blacklist) || is_array($blacklist_c)){
$db->close();
header('Location: admin/blacklist.php');
@session_unset();
@session_destroy();
exit();
}
//----------------------------------------------



// Löscht alle Datensätze, die alt sind um festzustellen ob User online
$db->sql("DELETE FROM {$prefix}etchat_useronline WHERE etchat_onlinetimestamp < ".(date('U')-(($confObj->reloadsequenz/1000)*4)), false);

$username = htmlentities($username, ENT_QUOTES, "UTF-8");

$user_vorhanden=$db->sql("SELECT etchat_user_id, etchat_username, etchat_userpw, etchat_userprivilegien FROM {$prefix}etchat_user WHERE etchat_username = '".$username."' order by etchat_userpw DESC", false);

if (is_array($user_vorhanden)){

if ($gender=='f' || $gender=='m')
$db->sql("UPDATE {$prefix}etchat_user SET etchat_usersex = '".$gender."' WHERE etchat_user_id = ".$user_vorhanden[0][0], false);

if (!empty($user_pw) && md5($user_pw)==$user_vorhanden[0][2]) {
$_SESSION['etchat_v3_user_id'] = $user_vorhanden[0][0];
$_SESSION['etchat_v3_username'] = $user_vorhanden[0][1];
$_SESSION['etchat_v3_user_priv'] = $user_vorhanden[0][3];
}
else {
if (!empty($user_vorhanden[0][2]) && md5($user_pw)!=$user_vorhanden[0][2]) {
echo "PW falsch.";
exit();
}
else {
$_SESSION['etchat_v3_user_id'] = $user_vorhanden[0][0];
$_SESSION['etchat_v3_username'] = $user_vorhanden[0][1];
$_SESSION['etchat_v3_user_priv'] = $user_vorhanden[0][3];
}
}
}
else{
if ($gender=='f' || $gender=='m')
$db->sql("INSERT INTO {$prefix}etchat_user ( etchat_username, etchat_usersex) VALUES ( '".$username."', '".$gender."')", false);
else
$db->sql("INSERT INTO {$prefix}etchat_user ( etchat_username ) VALUES ( '".$username."' )", false);

$user_neu=$db->sql("SELECT etchat_user_id, etchat_username, etchat_userprivilegien FROM {$prefix}etchat_user WHERE etchat_username = '".$username."' LIMIT 1", false);
$_SESSION['etchat_v3_user_id'] = $user_neu[0][0];
$_SESSION['etchat_v3_username'] = $user_neu[0][1];
$_SESSION['etchat_v3_user_priv'] = $user_neu[0][2];
}

// Nachricht nach Raumbetritt.
$raum_array=$db->sql("SELECT etchat_room_message FROM {$prefix}etchat_rooms where etchat_id_room = 1", false);
if (!empty($raum_array[0][0])){
// Zeilenumbruch bei WIN
$room_message_insert = str_replace("\r\n","<br />",$raum_array[0][0]);
// Zeilenumbruch bei LIN, Uniux, MacOS
$room_message_insert = str_replace("\n","<br />",$room_message_insert);

$db->sql("INSERT INTO {$prefix}etchat_messages ( etchat_user_fid , etchat_text, etchat_text_css, etchat_timestamp, etchat_fid_room, etchat_privat)
VALUES ( 1, '<div style=\"margin: 4px;\">".$room_message_insert."</div>', 'color:#".$_SESSION['etchat_v3_syscolor'].";font-weight:bold;font-style:normal;', ".date('U').", 1, ".$_SESSION['etchat_v3_user_id'].")", false);

$my_first_mess_id = $db->sql("SELECT max(etchat_id) from {$prefix}etchat_messages", false);

$db->sql("INSERT INTO {$prefix}etchat_messages ( etchat_user_fid, etchat_text, etchat_text_css, etchat_timestamp, etchat_fid_room)
VALUES ( 1, '<b>".$_SESSION['etchat_v3_username']."</b> ".$lang->eintritt[0]->tagData."', 'color:#".$_SESSION['etchat_v3_syscolor'].";font-weight:normal;font-style:normal;', '".date('U')."', 0)", false);

}
else{
$db->sql("INSERT INTO {$prefix}etchat_messages ( etchat_user_fid, etchat_text, etchat_text_css, etchat_timestamp, etchat_fid_room)
VALUES ( 1, '<b>".$_SESSION['etchat_v3_username']."</b> ".$lang->eintritt[0]->tagData."', 'color:#".$_SESSION['etchat_v3_syscolor'].";font-weight:normal;font-style:normal;', '".date('U')."', 0)", false);

$my_first_mess_id = $db->sql("SELECT max(etchat_id) from {$prefix}etchat_messages", false);
}

$_SESSION['etchat_v3_last_id'] = 0;
$_SESSION['etchat_v3_my_first_mess_id'] = $my_first_mess_id[0][0];
@$db->close();
header('Location: chat.php');
?>
Reply
#18
Please use Php-tags next time, it's easier to see the errors then.

Your error message shows that something is wrong in line 63, I corrected this line. Try to replace line 63 with this code:
You are not allowed to see php code.I added white spaces between the stuff, maybe that caused your error any maybe it'll solve it. If not please post here again Smile

Thank you and best regards
Lennart Sauter
Forum Admin
Reply
#19
Sorry about that. Didn't see that before.

Here was my error (I tried the new code)

Parse error: syntax error, unexpected T_VARIABLE in /home/content/f/t/d/ftdj2009/html/infocenter/chat/index.php on line 63

You are not allowed to see php code.
Reply
#20
Found your error

In line 39 find:
You are not allowed to see php code.replace with:
You are not allowed to see php code.
Should work Smile

Kind regards
Lennart Sauter
Forum Admin
Reply
Need professional support? PRinguin, the Digital-Agency. For web design and online marketing.
Register (for free) to hide the ads.


Forum Jump:


Users browsing this thread: 1 Guest(s)