firefly007 |
26th February 2015 09:03 |
Gazelle Shoutbox
1 Attachment(s)
Hi,
This shoutbox was not originally created by me but just improved, I will improve on It as time passes.
First follow the step for creating firefly_function.php in "http://www.bvlist.com/gazelle/10274-top-ten-index.html" and then add the below to firefly_function.php.
Code:
function get_av($av,$w,$h){
if (!empty($av)){
$var = '';
}else{
$var = '';
}
return $var;
}
function format_class_colour($class){
switch ($class) {
case "2":
return '#009900';
break;
case "3":
return '#006600';
break;
case "4":
return '#003333';
break;
case "5":
return '#003300';
break;
case "15":
return '#FF0000';
break;
case "19":
return '#00FF00';
break;
case "20":
return '#333399';
break;
default:
return '#FFF';
}
}
function date_time($timestamp = 0)
{
if ($timestamp)
return gmdate("Y-m-d H:i:s", $timestamp + 14000);
else
return gmdate("Y-m-d H:i:s");
}
function gtime() {
return strtotime(date_time());
}
function format_bbcode($text, $strip_html = true) {
$s = $text;
//$s = strip_tags($s);
if ($strip_html)
$s = htmlspecialchars($s);
$s = stripslashes($s);
// Bold
$s = preg_replace("/\[b\]((\s|.)+?)\[\/b\]/", "\\1", $s);
// Italic
$s = preg_replace("/\[i\]((\s|.)+?)\[\/i\]/", "\\1", $s);
// Underline
$s = preg_replace("/\[u\]((\s|.)+?)\[\/u\]/", "\\1", $s);
// Text
$s = preg_replace(
"/\[color=([a-zA-Z]+)\]((\s|.)+?)\[\/color\]/i",
"\\2", $s);
// Text
$s = preg_replace(
"/\[color=(#[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9])\]((\s|.)+?)\[\/color\]/i",
"\\2", $s);
// Text
$s = preg_replace(
"/\[url=((http|ftp|https|ftps|irc):\/\/[^<>\s]+?)\]((\s|.)+?)\[\/url\]/i",
"\\3", $s);
// http://www.example.com
$s = preg_replace(
"/\[url\]((http|ftp|https|ftps|irc):\/\/[^<>\s]+?)\[\/url\]/i",
"\\1", $s);
// www.example.com
$s = preg_replace(
"/\[url\](www\.[^<>\s]+?)\[\/url\]/i",
"\\1", $s);
// Text
$s = preg_replace(
"/\[url=(www\.[^<>\s]+?)\]((\s|.)+?)\[\/url\]/i",
"\\2", $s);
// Text
$s = preg_replace(
"/\[size=([1-7])\]((\s|.)+?)\[\/size\]/i",
"\\2", $s);
// Text
$s = preg_replace(
"/\[font=([a-zA-Z ,]+)\]((\s|.)+?)\[\/font\]/i",
"\\2", $s);
// Linebreaks
$s = nl2br($s);
// Maintain spacing
$s = str_replace(" ", " ", $s);
return $s;
}
2) Edit /sections/index/private.php
And add this, where you want it!!
Code:
print ('');
print(' Shoutbox ');
include(SERVER_ROOT.'/sections/shoutbox/index.php');
print " ";
3) Then download the attached shoutbox and put the folder in /sections/
4) Then execute SQl in phpmyadmin or what ever you use.
Code:
CREATE TABLE IF NOT EXISTS `chat` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`uid` int(10) NOT NULL,
`time` int(10) NOT NULL DEFAULT '0',
`name` varchar(50) NOT NULL,
`text` text NOT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=482 ;
--
-- Dumping data for table `chat`
--
INSERT INTO `chat` (`id`, `uid`, `time`, `name`, `text`) VALUES
(481, 2, 1424932959, 'freespirit', 'This is a test');
5)
Then edit your stylesheet and if you haven't added this.
Code:
.new_box{
margin: 0 auto;
border-radius: 0px 0px 7px 7px;
-moz-border-radius: 0px 0px 7px 7px;
-webkit-border-radius: 0px 0px 7px 7px;
margin-bottom: 20px;
background-color: #101010;
line-height: 300%;
}
.new_head{
background-color: #1a1a1a!important;
font-weight: bold;
height: 37px;
text-indent: 8px;
}
|