PHPOpenChat
[email protected] (AndreasW) Sat, 24 Apr 2004 22:26:41 +0000 (UTC)
| Newsgroups | gmane.comp.cms.xaraya.user.german |
|---|---|
| Organization | Xaraya News Server |
| Message-ID | <[email protected]> |
Hallo zusammen,
ich versuche zur Zeit PHPOpenChat Beta 8 in Xaraya zu intigrieren.
Leider geht das mehr schlecht als recht.
Auf der Webseite von PHPOpenChat findet man leider nur eine passende
Datei um den Chat mit PHPNuke zu verbinden. Leider hat das umschreiben
auf Xaraya nicht funktioniert.
Hier erst einmal der Originalcode für PHPNuke 6-7.X:
<?php //-*-php-*-
/*
********************************************************************
**
** Copyright notice
**
**
**
** (c) 1995-2004 PHPOpenChat Development Team
**
** http://phpopenchat.sourceforge.net/
**
**
**
** All rights reserved
**
**
**
** This script is part of the PHPOpenChat project. The PHPOpenChat
**
** project 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.
**
**
**
** The GNU General Public License can be found at
**
** http://www.gnu.org/copyleft/gpl.html.
**
** A copy is found in the textfile GPL and important notices to the
**
** license from the team is found in the textfile LICENSE distributed
**
** with these scripts.
**
**
**
** This script is distributed in the hope that it will be useful,
**
** but WITHOUT ANY WARRANTY; without even the implied warranty of
**
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
**
** GNU General Public License for more details.
**
**
**
** This copyright notice MUST APPEAR in all copies of the script!
**
**
********************************************************************
*/
/*
$Author: letreo $
$Date: 2004/02/24 17:05:18 $
$Source: /cvsroot/phpopenchat/chat3/contrib/yabbse/Attic/poc.php,v $
$Revision: 1.1.2.3 $
*/
include("header.php");
OpenTable(); $index=0;
//PHPOpenChat properties
/*
supposition is, you have installed phpnuke and PHPOpenChat within the
document root
of your webserver side by side.
<http://your.host.tld>
|
+</nuke>
|
+</phpopenchat>
*/
$poc_doc_root = '/phpopenchat';
$poc_root_path = './../phpopenchat';
// Scripteinstellungen // Scriptsettings
$dbhost = "localhost"; // 'localhost' or 'www.yoursiteurl.com'
if on a remote site
$dbuser = "root"; // username
$dbpwd = ""; // password
$dbname = ""; // the name of your database
$mysqlconnect = @mysql_connect($dbhost,$dbuser,$dbpwd);
$channelname = ''; //Welcher Channel soll betreten werden
$deftheme = 'openchat'; // POC default Theme -- POC Standard Theme
$siteurl = 'http://www.yourdomain.tld'; // Deine Domain URL -- Your
Domain URL -- without ending "/"
$nuke_prefix = 'nuke_'; // Prefix of phpnuke tables // Prefix der
PHPnuke Tabellen.. Meist "nuke_"
// User oder Gast? -- User or Guest?
if ($cookie[1] == "") {
// Wenn Gastbenutzer, dann gebe folgenden Inhalt aus (anpassen bitte)
// If Guest, output the following and exit (please, edit ;) )
echo"<table class='fonts' width='100%' border='0' cellspacing='0'
cellpadding='0'>
<tr>
<td><p><font size='2' face='Georgia, Times New Roman, Times,
serif'><strong><font face='Verdana, Arial, Helvetica, sans-serif'>Hallo
Gast!
</font></strong> </font></p>
<p><font size='2' face='Verdana, Arial, Helvetica, sans-serif'>
Solltest Du als Gast Chatten wollen, klicke unten auf den \"Zum
Gast-Chat\" Button,<br>
gebe einen Nicknamen ein und betrete den Chat als Gast.<br>
<br>
Um den Chat ohne Umwege direkt zu betreten, wäre es gut,
wenn Du Dich bereits vorher anmeldest.<br>
Der Chat list dann Deine Benutzerdaten aus und Du kannst direkt
als Benutzer chatte- <br>
melde Dich am Besten JETZT an und nutze alle tollen
Features!</font></p>
<br>Du kannst Dein Profil jederzeit löschen... Also, auf
gehts! <br><br>
<center>
<form action='$siteurl/phpopenchat/index.php' method='get'>
<div align=\'center\'>
<input type='submit' name='Submit' value='Zum Gast-Chat'>
</div>
</form>
<form action='$siteurl/hp3/modules.php' method='get'>
<div align=\'center\'>
<input type='submit' name='Submit' value='Zur Registrierung'>
<input type='hidden' value='profile' name='file'>
<input type='hidden' value='register' name='mode'>
<input type='hidden' value='Forums' name='name'>
</div>
</form>
</center>
<br>
</td>
</tr>
</table>";
exit;
}
if ($cookie[1] != "") {
$sql2 = "SELECT * FROM ".$nuke_prefix."users WHERE
user_id='$cookie[0]'";
$con2 = mysql_db_query($dbname,$sql2,$mysqlconnect);
$list2 = mysql_fetch_assoc($con2);
$userid = $cookie[0];
$username = $list2["username"];
if( $username != 'Anonymous' ){
require_once($poc_root_path.'/config.inc.php');
require_once(POC_INCLUDE_PATH.'/class.Chatter.inc');
require_once(POC_INCLUDE_PATH.'/adodb/adodb.inc.php');
$chatter = &new POC_Chatter();
$chatter->set_nick($list2[username]);
$current_chatter = $chatter;//save current
$chatter->set_user($list2[username]);
$chatter->set_email($list2[user_email]); //is hidden by default
$chatter->set_name($list2['name']);
$chatter->set_homePageURL($list2[user_website]);
$chatter->set_icqNumber($list2[user_icq]);
// $chatter->set_motto($list2[12]);
$chatter->set_aimNickname($list2[user_aim]);
$chatter->set_yimNickname($list2[user_yim]);
$chatter->set_interests($list2[user_interests]);
if( !empty($list2[user_gender]) ) $gender =
($list2[user_gender]=='1')? 'm':'f';
$chatter->set_gender($gender);
unset($gender);
$chatter->set_birthday($list2[user_age]);
$chatter->set_theme( '$deftheme' );//use default theme of PHPOpenChat
if( $list2[user_rank] == '1' ){
$chatter->add_to_group('operator');
}
if( !empty($list2[user_lang]) ){
$chatter->set_preferred_language($list2[user_lang]);
}
//do not send registration mails
$chatter->set_skip_email();
if( $current_chatter != $chatter ){
if( !$chatter->is_registered()) {
$chatter->register();
} else {
$chatter->update();
}
}
unset($current_chatter);
$chatter->mkinstance_persist();
unset($chatter);
header('Status: 301');
header('Location:
'.$siteurl.''.$poc_doc_root.'/index.php?use_db_instance='. $username
'&channel='.$channelname.'');
exit;
}else{
die('No guest login possible to the chat!');
}
}
CloseTable();
include("footer.php");
?>
-----------------------------
Die Datenbank auf "roles" umzulenken ist ja kein Problem aber danach
fängt es schon an das ein User_ID ( Cookie ) abgefragt wird. Wo
versteckt sich das den in Xaraya_DB?
Weiterhin wird die Header.php Datei eingebunden gibt es etwas gleiches
unter Xaraya?
Nun vielleicht hat ja schon jemand mit PHPNuke gearbeitet und natürlich
mit Xaraya und kann mir sagen wie man die gepostete Datei umschreiben
muss um PHPOpenChat zum fliegen zu bekommen.
Danke.
GrüÃe
Andreas