Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Gazelle (http://www.bvlist.com/forumdisplay.php?f=40)
-   -   Gazelle Shoutbox (http://www.bvlist.com/showthread.php?t=10279)

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;
}


daffy 27th February 2015 14:53

1 Attachment(s)
just messing around with this on comp, done nothing to it apart from add your topten and this. but shhttp://www.bvlist.com/data:image/png...AASUVORK5CYII=out not work bud.

firefly007 27th February 2015 21:39

Hey Daffy could you try and see if any errors are generated, maybe I missed something while putting it together for Bvlist.

daffy 27th February 2015 22:12

:mad:

firefly007 28th February 2015 00:43

Hmm That is part of the original shoutbox code hey, but I'm not getting that Im using a Ubuntu box

Bump:
Quote:

Originally Posted by daffy (Post 46492)
:mad:

Daffy I forgot to add this

create a file called shoutbox.php and save to doc root

and add this.

Code:

require('classes/script_start.php');


All times are GMT +2. The time now is 20:00.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.