Seite 1 von 1

x7chat - Hilfe bei Script anpassen

Verfasst: 19.12.2007 14:07
von derkubi
Hallo

Eigentlich soll mit diesem Script die User , die gerade im Chat sind , im Forum angezeigt werden :

Code: Alles auswählen

<html><body><table width='25%'bgcolor="C0C0C0" align=center border=3 valign=top cellpadding=2 cellspacing='0'>
<tr><br><td width='50%' align=center>Im Chat</td><td width='50%' align=center>Raumname</td></tr>
<?
//connect to mysql
//change localhost, username and password to your mySQL username and password
mysql_connect("localhost","username of database","Password for username");


//select which database, change DBname
mysql_select_db("your database name");

//select the table, should be right if you didn't change the prefix in the data base
$result = mysql_query("select * from x7chat2_online");



//grab all the content
while($r=mysql_fetch_array($result))


//modify these to match your mysql table columns that you want to display

$usersonline=$r["name"];
$room=$r["room"];

//display the row
echo "<tr><td width='25%' align=center>$usersonline<br></td><td width='25%' align=center>$room<br>";



?>

</td></tr></table><br></body>

</html>
Die Zeilen :
mysql_connect("localhost","username of database","Password for username");
mysql_select_db("your database name");

habe ich geändert in :
mysql_connect("http://MeinForum.de.funpic.de/","MeineD ... QLPasswort");
mysql_select_db("MeineDatenbank");

Eingefügt in die index_body.tpl bekomme ich auf der Forum-Startseite das hier : ( ich befinde mich im Chat )

[ externes Bild ]

Da stimmt also was nicht , aber was ?

Verfasst: 19.12.2007 14:40
von derkubi
Das soll angeblich das Gleiche bewirken : ( Originaltext dazu )

Just a block for php-nuke that shows what members are in your php x7Chat. It lists the names of all people in the chat system. I didn't see one on here, thought since I worked one out I'd provide for others. Enjoy

Code: Alles auswählen

<?php

if (eregi("block-Chat.php", $_SERVER['PHP_SELF'])) {
    Header("Location: index.php");
    die();
}
global $prefix, $db, $sitename;
$exptime = time()-5;
$result = $db->sql_query("SELECT name FROM x7chat2_online WHERE invisible<>'1' AND time>'$exptime' ORDER BY time DESC LIMIT 10");
$content = "<center><b>User(s) Online</b></center><br>";
while ($row = $db->sql_fetchrow($result)) {

    $name = $row['name'];
{
        $content .= "<center>$name<br></center>";
    }
}
$content .= "<center><a href=\"Enter the link you want here\"><br><b><u>Join Chat</u></b></a></center>";
?>

Frage :
Eh...which directory should we upload this file in?

Antwort : you don't upload the file, just copy and paste the code to any place on any page you wish the thing to appear.

Muß ich hier noch Daten durch eigene anpassen ? Ich habs mal in die index_body.tpl getan . Dort erschien ein WirrWarr von diesem Text , zwar an der richtigen Stelle , aber ....

Re: x7chat - Hilfe bei Script anpassen

Verfasst: 23.12.2007 12:52
von powersilie
Hi!

Ich krieg den gleichen Müll bei der ersten Möglichkeit, hab das auch ausprobiert. Langsam reichts mir mit dem Chat, da findet man zig Anleitungen, die nicht stimmen, Codes die nicht stimmen.

saure Grüße
Powersilie

Re: x7chat - Hilfe bei Script anpassen

Verfasst: 23.12.2007 13:00
von Max
powersilie hat geschrieben:da findet man zig Anleitungen, die nicht stimmen, Codes die nicht stimmen.
Deshalb habe ich mir auch etwas Eigenes geschrieben, das läuft seit Monaten, aber auch gerne hier den Link: http://www.phpbb.de/viewtopic.php?p=936398#936398