Subversion Repositories svnkaklik

Compare Revisions

No changes between revisions

Ignore whitespace Rev 5 → Rev 6

/web/test/chat/shoutbox2/README!.txt
0,0 → 1,28
--------------------------------------------------------------
- Shout It! By r2xDesign
- Website: www.r2xDesign.net
- Support: www.r2xdesign.net/forums
- Description: A simple shoutbox that you can use for your website.
--------------------------------------------------------------
 
INSTRUCTION:
1. Open up config.php and edit all variables in it.
2. - Open up create_table.txt and copy the SQL query.
- You need to run this SQL query to the right database using phpMyAdmin or other SQL GUI you're using.
3. Upload the folder "shoutbox" in your MAIN site directory.
4. - Go to your www.yoursite.com/shoutbox/shoutbox.php to see the shoutbox
- To include the shoutbox to your main site use this PHP code:
 
<?php include("shoutbox/shoutbox.php"); ?>
Use the code above wherever you want to put your shoutbox.
5. You can edit the shoutbox looks by modifying the CSS internal style.
6. Please do not remove the link to r2xDesign.net, this is all I ask for! Thank You.
 
LATEST UPDATE:
- Added "posted date" on mouseover
- You can now customize the shoutbox message limit
- Much cleaner code
 
Subcribe to this script! http://www.r2xdesign.net/index.php?page=subscribe&id=5
View other scripts: http://www.r2xdesign.net/page-phpscripts.php
/web/test/chat/shoutbox2/_vti_cnf/README!.txt
0,0 → 1,6
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|27 Jun 2005 06:41:42 -0000
vti_extenderversion:SR|6.0.2.5516
vti_cacheddtm:TX|27 Jun 2005 06:41:42 -0000
vti_filesize:IR|1287
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/_vti_cnf/config.php
0,0 → 1,15
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|31 Jul 2005 12:14:44 -0000
vti_extenderversion:SR|6.0.2.5516
vti_author:SR|KAKLIK\\Jakub
vti_modifiedby:SR|KAKLIK\\Jakub
vti_timecreated:TR|27 Jun 2005 06:32:40 -0000
vti_backlinkinfo:VX|
vti_nexttolasttimemodified:TW|27 Jun 2005 06:32:40 -0000
vti_cacheddtm:TX|31 Jul 2005 12:14:44 -0000
vti_filesize:IR|479
vti_cachedneedsrewrite:BR|false
vti_cachedhasbots:BR|false
vti_cachedhastheme:BR|false
vti_cachedhasborder:BR|false
vti_charset:SR|windows-1250
/web/test/chat/shoutbox2/_vti_cnf/create_table.txt
0,0 → 1,6
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|05 Jun 2005 14:26:04 -0000
vti_extenderversion:SR|6.0.2.5516
vti_cacheddtm:TX|05 Jun 2005 14:26:04 -0000
vti_filesize:IR|298
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/_vti_cnf/shoutbox.php
0,0 → 1,16
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|27 Jun 2005 06:27:16 -0000
vti_extenderversion:SR|6.0.2.5516
vti_backlinkinfo:VX|content2.htm
vti_author:SR|KAKLIK\\Jakub
vti_modifiedby:SR|KAKLIK\\Jakub
vti_timecreated:TR|27 Jun 2005 06:27:16 -0000
vti_cacheddtm:TX|27 Jun 2005 06:27:16 -0000
vti_filesize:IR|6546
vti_cachedlinkinfo:VX|A|< S|./shoutbox/smileys/smile.gif S|./shoutbox/smileys/laugh.gif S|./shoutbox/smileys/wink.gif S|./shoutbox/smileys/sad.gif S|./shoutbox/smileys/shocked.gif S|./shoutbox/smileys/tongue.gif S|./shoutbox/smileys/sick.gif S|./shoutbox/smileys/roll.gif S|./shoutbox/smileys/cry.gif S|./shoutbox/smileys/mad.gif H|http://www.r2xDesign.net
vti_cachedsvcrellinks:VX|DAUS|chat/shoutbox2/< NSUS|chat/shoutbox2/shoutbox/smileys/smile.gif NSUS|chat/shoutbox2/shoutbox/smileys/laugh.gif NSUS|chat/shoutbox2/shoutbox/smileys/wink.gif NSUS|chat/shoutbox2/shoutbox/smileys/sad.gif NSUS|chat/shoutbox2/shoutbox/smileys/shocked.gif NSUS|chat/shoutbox2/shoutbox/smileys/tongue.gif NSUS|chat/shoutbox2/shoutbox/smileys/sick.gif NSUS|chat/shoutbox2/shoutbox/smileys/roll.gif NSUS|chat/shoutbox2/shoutbox/smileys/cry.gif NSUS|chat/shoutbox2/shoutbox/smileys/mad.gif NHHS|http://www.r2xDesign.net
vti_cachedneedsrewrite:BR|false
vti_cachedhasbots:BR|false
vti_cachedhastheme:BR|false
vti_cachedhasborder:BR|false
vti_charset:SR|windows-1250
/web/test/chat/shoutbox2/config.php
0,0 → 1,26
<?php
 
//Edit everything below to match your mySQL database configuration.
 
//database host
$db_host = "localhost";
 
//database name
$db_name = "shoutbox2";
 
//database user
$db_user = "chaosdell";
 
//database user password
$db_pass = "sesvul";
 
 
//Shoutbox Configuration
 
//Message length limit (in characters)
$max_length = 1000;
 
//Shoutbox message limit (Dont set this too high!)
$dmessage = 100;
 
?>
/web/test/chat/shoutbox2/create_table.txt
0,0 → 1,11
RUN THE SQL QUERY BELOW USING phpMyAdmin OR OTHER SQL GUI YOU'RE USING!!!
 
CREATE TABLE shoutbox
(
id INT(10) not null AUTO_INCREMENT,
name VARCHAR(20),
ip VARCHAR(15),
message TEXT,
date CHAR(20),
PRIMARY KEY(id)
);
/web/test/chat/shoutbox2/shoutbox.php
0,0 → 1,140
<script type="text/javascript">
<!--
function addsmiley(code) {
var pretext = document.forms['shoutbox_form'].shoutbox_message.value;
this.code = code;
document.forms['shoutbox_form'].shoutbox_message.value = pretext + code;
}
//-->
</script>
 
<style type="text/css">
/* Belows is the CSS file with some comments, edit it to your likings. */
 
/* This is to "trap" all shoutbox message into one content box */
div.shoutbox {
background: #E5E5E5;
padding: 5px;
width: 190px;
height: 200px;
border: 1px solid #000000;
overflow: auto;
color: #000000;
font: normal 10px verdana,tahoma,arial }
 
/* Smiley with no border and a cursor pointer */
img.smileys {
border: 0;
cursor: pointer; }
 
/* Just some styling... */
#shoutbox-message { width: 200px }
strong {
color: #000000;
font: bold 10px verdana,tahoma,arial }
 
/* Dont remove this style property or the messages wont display properly! */
ul {
margin: 0;
padding: 0;
list-style-type: none;
color: #000000;
font: normal 10px verdana,tahoma,arial; }
 
/* This is just to make the form looks nice */
input {
padding: 0px;
border: 1px solid #000000;
background-color: #E5E5E5;
color: #000000;
font: normal 10px verdana,tahoma,arial; }
textarea {
width: 195px;
padding: 0px;
border: 1px solid #000000;
background-color: #E5E5E5;
color: #000000;
font: normal 10px verdana,tahoma,arial; }
</style>
 
<?php
include("config.php");
if ($_POST['shoutbox_submit']) {
$name = $_POST['shoutbox_name'];
$ip = $_POST['shoutbox_ip'];
$message = $_POST['shoutbox_message'];
$mlen = strlen($message);
$date = date("F jS Y");
if ($name == "") {
echo "<strong>Error: Please enter your nickname.</strong>";
}
else if ($message == "") {
echo "<strong>Error: No message to be sent.</strong>";
}
else if ($mlen > $max_length) {
echo "<strong>Error: Message too long.</strong>";
}
else {
$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db($db_name) or die("Cannot connect to database");
mysql_query("INSERT INTO shoutbox(name,ip,message,date) VALUES('$name','$ip','$message','$date')");
mysql_close($db);
}
}
$db = mysql_connect($db_host,$db_user,$db_pass);
mysql_select_db($db_name) or die("Cannot connect to database");
$query = "SELECT * FROM shoutbox ORDER BY id DESC LIMIT $dmessage";
$result = mysql_query($query);
echo "<div class=\"shoutbox\">\n";
echo "<ul>\n";
while($r=mysql_fetch_array($result)) {
//Strips unwanted HTML from nickname
$name = $r['name'];
$name = strip_tags($name);
//Strips unwanted HTML from message
$message = $r['message'];
$message = strip_tags($message);
// Transform text to smileys =)
$message = str_replace("=(","<img src=\"/shoutbox/smileys/sad.gif\" alt=\"=(\"/>", $message);
$message = str_replace(":(","<img src=\"/shoutbox/smileys/sad.gif\" alt=\":(\"/>", $message);
$message = str_replace(";(","<img src=\"/shoutbox/smileys/cry.gif\" alt=\";(\"/>", $message);
$message = str_replace(":@","<img src=\"/shoutbox/smileys/mad.gif\" alt=\":@\"/>", $message);
$message = ereg_replace(":)","<img src=\"/shoutbox/smileys/smile.gif\" alt=\":)\"/>", $message);
$message = ereg_replace("=)","<img src=\"/shoutbox/smileys/smile.gif\" alt=\"=)\"/>", $message);
$message = ereg_replace(":D","<img src=\"/shoutbox/smileys/laugh.gif\" alt=\":D\"/>", $message);
$message = ereg_replace(":d","<img src=\"/shoutbox/smileys/laugh.gif\" alt=\":d\"/>", $message);
$message = ereg_replace(":p","<img src=\"/shoutbox/smileys/tongue.gif\" alt=\":p\"/>", $message);
$message = ereg_replace(":P","<img src=\"/shoutbox/smileys/tongue.gif\" alt=\":P\"/>", $message);
$message = ereg_replace(":O","<img src=\"/shoutbox/smileys/shocked.gif\" alt=\":O\"/>", $message);
$message = ereg_replace(":o","<img src=\"/shoutbox/smileys/shocked.gif\" alt=\":o\"/>", $message);
$message = ereg_replace(";)","<img src=\"/shoutbox/smileys/wink.gif\" alt=\";)\"/>", $message);
$message = ereg_replace(":S","<img src=\"/shoutbox/smileys/sick.gif\" alt=\":S\"/>", $message);
$message = ereg_replace(":s","<img src=\"/shoutbox/smileys/sick.gif\" alt=\":s\"/>", $message);
$message = ereg_replace(":roll:","<img src=\"/shoutbox/smileys/roll.gif\" alt=\":roll:\"/>", $message);
echo "<li title=\"Shouted on $r[date]\" style=\"cursor: pointer\"><strong>$name</strong>: $message</li>\n";
}
echo "</ul>\n";
echo "</div>\n";
mysql_close($db);
?>
 
<div>
<form id="shoutbox_form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<strong>Nickname:</strong><br/>
<input type="text" name="shoutbox_name" size="37" maxlength="20"><br/>
<strong>Message:</strong><br/>
<img class="smileys" src="./shoutbox/smileys/smile.gif" alt=":)" onclick="addsmiley(':)')"/>
<img class="smileys" src="./shoutbox/smileys/laugh.gif" alt=":D" onclick="addsmiley(':D')"/>
<img class="smileys" src="./shoutbox/smileys/wink.gif" alt=";)" onclick="addsmiley(';)')"/>
<img class="smileys" src="./shoutbox/smileys/sad.gif" alt=":(" onclick="addsmiley(':(')"/>
<img class="smileys" src="./shoutbox/smileys/shocked.gif" alt=":O" onclick="addsmiley(':O')"/>
<img class="smileys" src="./shoutbox/smileys/tongue.gif" alt=":P" onclick="addsmiley(':P')"/>
<img class="smileys" src="./shoutbox/smileys/sick.gif" alt=":S" onclick="addsmiley(':S')"/>
<img class="smileys" src="./shoutbox/smileys/roll.gif" alt=":roll:" onclick="addsmiley(':roll:')"/>
<img class="smileys" src="./shoutbox/smileys/cry.gif" alt=";(" onclick="addsmiley(';(')"/>
<img class="smileys" src="./shoutbox/smileys/mad.gif" alt=":@" onclick="addsmiley(':@')"/><br/>
<textarea id="shoutbox-message" cols="20" rows="3" name="shoutbox_message"></textarea><br/>
<input type="submit" name="shoutbox_submit" value="Shout It!">&nbsp;<a href="http://www.r2xDesign.net" title="Web Scripting Resources - PHP Scripts, PHP Snippets, PHP Tutorials and Free Templates">www.r2xDesign.net</a>
<input type="hidden" name="shoutbox_ip" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>">
</form>
</div>
/web/test/chat/shoutbox2/smileys/Thumbs.db
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/test/chat/shoutbox2/smileys/_vti_cnf/Thumbs.db
0,0 → 1,6
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|19 May 2005 13:13:40 -0000
vti_extenderversion:SR|6.0.2.5516
vti_cacheddtm:TX|19 May 2005 13:13:40 -0000
vti_filesize:IR|13312
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/smileys/_vti_cnf/cry.gif
0,0 → 1,9
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|20 Feb 2005 15:57:42 -0000
vti_extenderversion:SR|6.0.2.5516
vti_author:SR|KAKLIK\\Jakub
vti_modifiedby:SR|KAKLIK\\Jakub
vti_timecreated:TR|20 Feb 2005 15:57:42 -0000
vti_cacheddtm:TX|20 Feb 2005 15:57:42 -0000
vti_filesize:IR|184
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/smileys/_vti_cnf/laugh.gif
0,0 → 1,9
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|20 Feb 2005 15:56:56 -0000
vti_extenderversion:SR|6.0.2.5516
vti_author:SR|KAKLIK\\Jakub
vti_modifiedby:SR|KAKLIK\\Jakub
vti_timecreated:TR|20 Feb 2005 15:56:56 -0000
vti_cacheddtm:TX|20 Feb 2005 15:56:56 -0000
vti_filesize:IR|174
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/smileys/_vti_cnf/mad.gif
0,0 → 1,9
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|20 Feb 2005 15:57:26 -0000
vti_extenderversion:SR|6.0.2.5516
vti_author:SR|KAKLIK\\Jakub
vti_modifiedby:SR|KAKLIK\\Jakub
vti_timecreated:TR|20 Feb 2005 15:57:26 -0000
vti_cacheddtm:TX|20 Feb 2005 15:57:26 -0000
vti_filesize:IR|181
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/smileys/_vti_cnf/roll.gif
0,0 → 1,9
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|20 Feb 2005 15:57:22 -0000
vti_extenderversion:SR|6.0.2.5516
vti_author:SR|KAKLIK\\Jakub
vti_modifiedby:SR|KAKLIK\\Jakub
vti_timecreated:TR|20 Feb 2005 15:57:22 -0000
vti_cacheddtm:TX|20 Feb 2005 15:57:22 -0000
vti_filesize:IR|1520
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/smileys/_vti_cnf/sad.gif
0,0 → 1,9
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|20 Feb 2005 15:56:52 -0000
vti_extenderversion:SR|6.0.2.5516
vti_author:SR|KAKLIK\\Jakub
vti_modifiedby:SR|KAKLIK\\Jakub
vti_timecreated:TR|20 Feb 2005 15:56:52 -0000
vti_cacheddtm:TX|20 Feb 2005 15:56:52 -0000
vti_filesize:IR|173
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/smileys/_vti_cnf/shocked.gif
0,0 → 1,9
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|20 Feb 2005 15:56:54 -0000
vti_extenderversion:SR|6.0.2.5516
vti_author:SR|KAKLIK\\Jakub
vti_modifiedby:SR|KAKLIK\\Jakub
vti_timecreated:TR|20 Feb 2005 15:56:54 -0000
vti_cacheddtm:TX|20 Feb 2005 15:56:54 -0000
vti_filesize:IR|181
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/smileys/_vti_cnf/sick.gif
0,0 → 1,9
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|20 Feb 2005 15:57:32 -0000
vti_extenderversion:SR|6.0.2.5516
vti_author:SR|KAKLIK\\Jakub
vti_modifiedby:SR|KAKLIK\\Jakub
vti_timecreated:TR|20 Feb 2005 15:57:32 -0000
vti_cacheddtm:TX|20 Feb 2005 15:57:32 -0000
vti_filesize:IR|187
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/smileys/_vti_cnf/smile.gif
0,0 → 1,9
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|20 Feb 2005 15:56:48 -0000
vti_extenderversion:SR|6.0.2.5516
vti_author:SR|KAKLIK\\Jakub
vti_modifiedby:SR|KAKLIK\\Jakub
vti_timecreated:TR|20 Feb 2005 15:56:48 -0000
vti_cacheddtm:TX|20 Feb 2005 15:56:48 -0000
vti_filesize:IR|185
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/smileys/_vti_cnf/tongue.gif
0,0 → 1,9
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|20 Feb 2005 15:57:14 -0000
vti_extenderversion:SR|6.0.2.5516
vti_author:SR|KAKLIK\\Jakub
vti_modifiedby:SR|KAKLIK\\Jakub
vti_timecreated:TR|20 Feb 2005 15:57:14 -0000
vti_cacheddtm:TX|20 Feb 2005 15:57:14 -0000
vti_filesize:IR|182
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/smileys/_vti_cnf/wink.gif
0,0 → 1,9
vti_encoding:SR|utf8-nl
vti_timelastmodified:TR|20 Feb 2005 15:57:10 -0000
vti_extenderversion:SR|6.0.2.5516
vti_author:SR|KAKLIK\\Jakub
vti_modifiedby:SR|KAKLIK\\Jakub
vti_timecreated:TR|20 Feb 2005 15:57:10 -0000
vti_cacheddtm:TX|20 Feb 2005 15:57:10 -0000
vti_filesize:IR|186
vti_backlinkinfo:VX|
/web/test/chat/shoutbox2/smileys/cry.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/test/chat/shoutbox2/smileys/laugh.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/test/chat/shoutbox2/smileys/mad.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/test/chat/shoutbox2/smileys/roll.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/test/chat/shoutbox2/smileys/sad.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/test/chat/shoutbox2/smileys/shocked.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/test/chat/shoutbox2/smileys/sick.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/test/chat/shoutbox2/smileys/smile.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/test/chat/shoutbox2/smileys/tongue.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/web/test/chat/shoutbox2/smileys/wink.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property