Chat maked for PhpRetro and PhoenixPHP
Hello Ragezone, i have make a chatbox with the old Habbomotion chat.
Screen:
http://i47.tinypic.com/xbi9sp.gif
Live demo;
http://pastehtml.com/view/c3x3ghu4f.html
(There you can not chat)
Download:
PhpRetro chat - Retroplace.nl.zip
If you have PhoenixPHP change Chat.php with this:
Code:
<?php
define('USERNAME_REQUIRED', TRUE);
define('ACCOUNT_REQUIRED', TRUE);
include('global.php');
define("THIS_SCRIPT", 'me');
$username = $core->EscapeString($_SESSION['username']);
?>
<html>
<head>
<title>Drabbo: Chat</title>
<style type="text/css">
body {
font-family: Verdana;
font-size: 11px;
color: black;
margin: 0 auto;
}
input {
font-family: Verdana;
font-size: 11px;
color: black;
}
div#container {
width: 548px;
margin: 0 auto;
}
div#top {
background-image: url('/web-gallery/chat/achtergrond.png');
height: 228px;
width: 523px;
margin: 10px 0 0 0;
padding: 13px 5px 5px 20px;
}
div#speech {
background-image: url('/web-gallery/chat/chatbubbel.png');
height: 62px;
width: 548px;
}
input#chat-msg {
margin: 22px 0 0 65px;
background-color: transparent;
width: 465px;
border: 0;
}
</style>
</head>
<body>
<div id="container">
<?php
if($_POST['chat-msg']){
$msg = strip_tags(mysql_real_escape_string($_POST['chat-msg']));
if(!$msg){
echo 'Je moet wat invullen!<br><br><a href="/chat.php">Ā« Terug</a>';
}else{
$habbo2 = $_COOKIE['habbo'];
$hotel2 = $_COOKIE['hotel'];
$margin = $_COOKIE['margin'];
mysql_query("INSERT INTO `chat` (`habbo`, `hotel`, `margin`, `message`) VALUES ('$username', '$hotel2', '$margin', '$msg');");
header("Location: /chat.php");
}
}else{
?>
<div id="top">
<?php
$last10 = mysql_query("SELECT * FROM chat ORDER BY `id` DESC LIMIT 7");
if(mysql_num_rows($last10) == 0){
echo '<img src="http://retroplace.nl/scripts/ballonmaker/ballon.php?ballon= Er zijn nog geen shouts, ben jij de eerste?" style="margin-left: '.$margin.'px;">';
}else{
while($r = mysql_fetch_array($last10)){
$habbo = $r["habbo"];
$hotel = $r["hotel"];
$margin = $r["margin"];
$msg = $r["message"];
echo '<img src="http://retroplace.nl/scripts/ballonmaker/ballon.php?ballon='.$habbo.': '.$msg.'&format=say" style="margin-left: '.$margin.'px;"><br>';
}
}
?>
</div>
<div id="speech">
<form method="post">
<input type="text" name="chat-msg" value="Type een bericht..." id="chat-msg" onfocus="if (this.value=='Type a message...') this.value = '';" onblur="if (this.value=='') this.value = 'Type a message...';">
</form>
</div>
<?php
}
?>
</div>
<?php if($users->UserPermission('hk_login', $core->EscapeString($_SESSION['username']))) {?>
<center>Delete al shouts: <a href="/chat.php?page=leegchat">Click here!</a> (Only staff can see this).</center>
<?php } ?>
<?php
if($_GET['page'] == 'leegchat')
{
?>
<?php
mysql_query("TRUNCATE TABLE chat");
?>
<center><a href="/chat.php"><b>Chat is clean!</b></a><br></center>
<?php
}
?>
Run this Query;
Code:
--
-- Tabelstructuur voor tabel `chat`
--
CREATE TABLE IF NOT EXISTS `chat` (
`id` int(90) NOT NULL auto_increment,
`habbo` varchar(45) NOT NULL,
`hotel` varchar(10) NOT NULL,
`margin` int(2) NOT NULL default '0',
`message` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Gegevens worden uitgevoerd voor tabel `chat`
--
INSERT INTO `chat` (`id`, `habbo`, `hotel`, `margin`, `message`) VALUES
(1, 'Arjan', '', 0, 'Chat working look for more stuff at: Retroplace.nl');
And edit;
Go to chat.php search for this;
if($_GET['page'] == 'leegchat')
And change 'leegchat' to something else (because that is not secure).
Enjoy
If you want only a HTML chat;
Code:
<html>
<head>
<title>Drabbo: Chat</title>
<style type="text/css">
body {
font-family: Verdana;
font-size: 11px;
color: black;
margin: 0 auto;
}
input {
font-family: Verdana;
font-size: 11px;
color: black;
}
div#container {
width: 548px;
margin: 0 auto;
}
div#top {
background-image: url('/web-gallery/chat/achtergrond.png');
height: 228px;
width: 523px;
margin: 10px 0 0 0;
padding: 13px 5px 5px 20px;
}
div#speech {
background-image: url('/web-gallery/chat/chatbubbel.png');
height: 62px;
width: 548px;
}
input#chat-msg {
margin: 22px 0 0 65px;
background-color: transparent;
width: 465px;
border: 0;
}
</style>
</head>
<body>
<div id="container">
<div id="top">
<img src="http://retroplace.nl/scripts/ballonmaker/ballon.php?ballon=Arjan: Test voor Retroplace.nl"><br>';
</div>
<div id="speech">
<form method="post">
<input type="text" name="chat-msg" value="Type een bericht..." id="chat-msg" onfocus="if (this.value=='Type een bericht...') this.value = '';" onblur="if (this.value=='') this.value = 'Type een bericht...';">
</form>
</div>
</div>
If you are dutch; RetroPlace - Inloggen
Like if you like :)
Other thread(s) from me: http://forum.ragezone.com/f353/dubbe...back-p-852888/
http://forum.ragezone.com/f353/new-i...om-ads-840500/
http://forum.ragezone.com/f353/rooft...om_ads-835157/
Re: Chat maked for PhpRetro and PhoenixPHP
Cool, i like really much!! :-D
Re: Chat maked for PhpRetro and PhoenixPHP
Quote:
Originally Posted by
Lasse
Cool, i like really much!! :-D
Thanks :)
Re: Chat maked for PhpRetro and PhoenixPHP
Re: Chat maked for PhpRetro and PhoenixPHP
I have one question, does this chat use the user name of the account that's registered?
Re: Chat maked for PhpRetro and PhoenixPHP
Quote:
Originally Posted by
Facebook
I have one question, does this chat use the user name of the account that's registered?
Yes and guests can not visit that page. (Chat.php).
Re: Chat maked for PhpRetro and PhoenixPHP
Quote:
Originally Posted by
iArjan
Yes and guests can not visit that page. (Chat.php).
Great I will definitely use this, also how do the query's get handled?
Re: Chat maked for PhpRetro and PhoenixPHP
Quote:
Originally Posted by
Facebook
Great I will definitely use this, also how do the query's get handled?
You post a message and it wil be placed in the Database.
Re: Chat maked for PhpRetro and PhoenixPHP
This is really good, I will use this. (Y)
EDIT:
Lol, I was just thinking, and this would be really good as new comments.
Re: Chat maked for PhpRetro and PhoenixPHP
Quote:
Originally Posted by
landline
This is really good, I will use this. (Y)
EDIT:
Lol, I was just thinking, and this would be really good as new comments.
Can you make image how you think about that?
I can make it then..
Re: Chat maked for PhpRetro and PhoenixPHP
Lol, tried getting this working for rev, but failed. xP
Re: Chat maked for PhpRetro and PhoenixPHP
Arjan, can you make this one for Rev?
Re: Chat maked for PhpRetro and PhoenixPHP
Re: Chat maked for PhpRetro and PhoenixPHP
I really like this, but im thinking about optimisation and security.
And im trying to think if theres any other way to store the chat log as a db query every second is no good.
And has anyone got a demo up?
Apart from that, this is sexy and i will use. ty
-------------- EDIT--------------
Can you also make Mods/Staff/VIP have different colours :P
And implement some commands for banning for X hours, pruning, muting, spam prevention
And also a user list on the side which shows the users rank etc when their names clicked
Its easy, im just lazy
Re: Chat maked for PhpRetro and PhoenixPHP
Nice release, iArjan... its nicely coded but unncessesary, i mean what's the client for??? oh well, im still using it.....
Re: Chat maked for PhpRetro and PhoenixPHP
Re: Chat maked for PhpRetro and PhoenixPHP
If a user was banned (PhoenixPHP).
He cant talk.
And i'm make now a spam control and a live update chat.
And i dont know how make it for RevCMS? i have never use it.
Re: Chat maked for PhpRetro and PhoenixPHP
so wait, it wasnt live update then? So when did it update, on refresh? -,- and is there a demo?
Re: Chat maked for PhpRetro and PhoenixPHP
Quote:
Originally Posted by
leenster
When a person posts just set a session with the time stamp. Also on submit check that session first to see if 15 seconds or so have passed... That way u don't overload the mysql server when someone tries to spam... I am thinking that that's a easy and effective way of doing it...
Sent from some remote location using Tapatalk...
i'm not a PHP god, i make only a spam control and a live update system..
Other people can make more updates. (Make it for revcms phoenixcf etc).
Demo;
http://pastehtml.com/view/c3x3ghu4f.html
Re: Chat maked for PhpRetro and PhoenixPHP
Quote:
Originally Posted by
iArjan
U can do it.... I have faith in you...
Re: Chat maked for PhpRetro and PhoenixPHP
Re: Chat maked for PhpRetro and PhoenixPHP
Quote:
Originally Posted by
leenster
U can do it.... I have faith in you...
Thank you, I will try it.. :$