SMF Shoutbox

Started by Deep, March 15, 2006, 08:09:52 AM

Previous topic - Next topic

Kettu

delete all shouts? You can use the X in front of the posts. And if you have lots of lines allowed, you should go to the administration before and reduce the lines to 5 i.e., than it is easier  ;)

To carola. This is no typical problem. I think it is a database problem. Sounds like it doesn't write correctly into the database. Also you could check the database field what field type there is in. Shouldn't be "INT" or similar for numbers.
Main Forum: SMF 2.0.6
Co-Forum: SMF 2.0.6

carola0102

Quote from: Kettu on July 02, 2006, 04:47:31 AM
delete all shouts? You can use the X in front of the posts. And if you have lots of lines allowed, you should go to the administration before and reduce the lines to 5 i.e., than it is easier  ;)

To carola. This is no typical problem. I think it is a database problem. Sounds like it doesn't write correctly into the database. Also you could check the database field what field type there is in. Shouldn't be "INT" or similar for numbers.

Hi Kettu,

first of all thanks a lot for ur reply, a database problem? yes u may be right. do u have any idea how I can fix this? Should I edit the smf_sbox_content and if so what should I edit? really all members loved the shoutbox at my site, its really a great mod! So I would be really happy if this problem could be fixed.

Regards,
Carola

Kettu

Quote from: carola0102 on July 02, 2006, 10:19:18 AM
Hi Kettu,

first of all thanks a lot for ur reply, a database problem? yes u may be right. do u have any idea how I can fix this? Should I edit the smf_sbox_content and if so what should I edit? really all members loved the shoutbox at my site, its really a great mod! So I would be really happy if this problem could be fixed.

Regards,
Carola
Hi Carola,
I am sorry, but I don't know. Database is my biggest problem. It is still a mystery for me. So maybe one of the other users can help with this.  It should be one who knows the specifications of SMF.
Regards,
Foxy
Main Forum: SMF 2.0.6
Co-Forum: SMF 2.0.6

carola0102

Quote from: Kettu on July 02, 2006, 12:59:25 PM
Quote from: carola0102 on July 02, 2006, 10:19:18 AM
Hi Kettu,

first of all thanks a lot for ur reply, a database problem? yes u may be right. do u have any idea how I can fix this? Should I edit the smf_sbox_content and if so what should I edit? really all members loved the shoutbox at my site, its really a great mod! So I would be really happy if this problem could be fixed.

Regards,
Carola
Hi Carola,
I am sorry, but I don't know. Database is my biggest problem. It is still a mystery for me. So maybe one of the other users can help with this.  It should be one who knows the specifications of SMF.
Regards,
Foxy

No problem, thanks anyway ;)

Piwaille

#204
hello...

still not installed this mod (I will do so in a few minutes) but I've alredy notice an (small) thing : when I do browse mod form the admin panel, I click on install... it only D/L the german language :o

(I don't know if i'm understandable)
It's not bloquing.... but it could be improved and easyer ;)


[EDIT] i've got a pb installing :
Appliquer la modification     ./Themes/default/BoardIndex.template.php     Échec du test (failed test)

[2nd Edit] got a lot of erros while installing :
Quotehttp://www.parapentiste.info/forum/index.php?action=packages;sa=install2;package=sbox_v1.04.zip
Appliquer le filtre: Montrer les erreurs qui ont un même message
8: Undefined variable: db_server
Fichier: .../forum/Packages/temp/sbox_setup.php
Ligne: 51
+
Quotehttp://www.parapentiste.info/forum/index.php?action=packages;sa=install2;package=sbox_v1.04.zip
Appliquer le filtre: Montrer les erreurs qui ont un même message
8: Undefined variable: db_user
Fichier: .../forum/Packages/temp/sbox_setup.php
Ligne: 51
++++
then
Quote8: Undefined index: sbox_ModTitle
Fichier: ..../forum/Sources/ModSettings.php
Ligne: 144
&
Quotehttp://www.parapentiste.info/forum/index.php?action=featuresettings;sa=layout;sesc
Appliquer le filtre: Montrer les erreurs qui ont un même message
8: Undefined index: sbox_ModTitle
Fichier: ..../forum/Sources/ModSettings.php
Ligne: 144
Piwaille
le chant du vario est motorisé par SMF 1.1.15

tL0z

Hello,

Yesterday my forum changed servers. However, the domain is still the same. After the change, the time was six hours late. I've already put 6 in Overall time offset in Features and Options and it fixed the time in the forum. However, it is still wrong in the shoubox

How can I fix it?

Thanks

Kettu

#206
@Piwaille
Please download the mod from Simple Machines Forum and upload it through the package manager.

@tL0z
The shoutbox gets the time from the server. So if the server time is still another one, it still shows it. It doesn't matter what kind of + or - hours a user has or forums standard is.
Main Forum: SMF 2.0.6
Co-Forum: SMF 2.0.6

tL0z

How can I change the time of the server?

Kettu

Quote from: tL0z on July 07, 2006, 11:22:29 AM
How can I change the time of the server?
Normally you can't. Because you don't own the server ;)
Main Forum: SMF 2.0.6
Co-Forum: SMF 2.0.6

Piwaille

#209
Quote from: Kettu on July 07, 2006, 09:24:48 AM
@Piwaille
Please download the mod from Simple Machines Forum and upload it through the package manager.

already done... that's why I manage to install and I had the others problems (I did solve them also ... I just signal them for improving the script)

Now that the script is running on my site I've got some suggestions :

* some <![CDATA[ and // ]]> code prevent the good run of CSS. I had to remove all in sboxDB.php and it function well. I also removed every <!-- and //-->

* instead of having an iframe you could put a div with a javascript clock feeding it (ajax way). It would cut down the load on the server and be nicer on client (no flicking)

* you should replace every path hard coded (E.G. "Sources/sboxDB.php") with a nicer one so that the script could be called from everywhere (not only ..../forum/sources/XXX.php) using $boardurl or $sourcedir...

* it would be much nicer (for our users) to have every smiley that is uploaded in SMF. For doing so, it could be much usefull to use the functions of SMF... why not using function such like "parse_bbc" ? (could be nice to use BBCode also)

* it could be nice to en-light when s/o talk to you : when X write Y's name in it's message, when Y display the message if it have Y then (blink ? invert colors ? ...)

When I have some time, I will try to improve some parts
If you did not manage to understand some parts (my English is quite poor), just contact me ;D
Piwaille
le chant du vario est motorisé par SMF 1.1.15

littleone

Quote from: Kettu on July 07, 2006, 12:00:46 PM
Quote from: tL0z on July 07, 2006, 11:22:29 AM
How can I change the time of the server?
Normally you can't. Because you don't own the server ;)

R U on a VPS?  If not you will need to submit a support ticket and ask if they can do it.  Chances are they wont thought.

snakize

This mod ruined my forum. I have no idea what it did to it. As soon as I installed it, I refreshed my page and this error is coming up.

Fatal error: Cannot redeclare sbox() (previously declared in /home/parallel/public_html/forum/Sources/Subs.php:3330) in /home/parallel/public_html/forum/Sources/Subs.php on line 3337

This is my subs.php file.

Kettu

How did you install shoutbox? With package manager or manual?
Check your subs.php for the added code if there is an error:
<search for>
log_error('Copyright removed!!');
}
}
</search for>

<add after>

function sbox()
{
global $sourcedir;

include_once("$sourcedir/sbox.php");
sbox_display();
}

</add after>
Main Forum: SMF 2.0.6
Co-Forum: SMF 2.0.6

blackoutpt

great mod

but there's one thing i can't solve. my language is set to portuguese. so, when i type characters like "ç or á, etc.." i get this "缯div>". i think it's a enconding issue but i have no idea wich file to save with the right encoding for me that is "ISO-8859-1"
can someone give me a clue?


[nofollow]

blackoutpt

this solved my charset issueAttention please

--------------------------------------------------------------------------------
After you have installed the shoutbox please modify the file sboxDB.php.

Please search for

Código:
// handle spacial characters $content=addslashes($content);
and replace this with


Código:
// handle special characters $content=addslashes($content); // enquote html and script code to avoid html/javascript injection $content = htmlentities($content, ENT_QUOTES);


[nofollow]

blackoutpt

not 100% solved  :'(
the characters in the day of the week field aren't right
please help me


[nofollow]

otochan

Got it to work but how do I make it parse BBcode?

otochan

Quote from: yellow1912 on April 12, 2006, 07:25:46 PM
Quote from: Jabberwocky on April 03, 2006, 09:26:19 PM
One feature I would like to see added is the ability to add bbcode-url's to the window. It parses html-url's to images / smilies etc...

But BB-Code [url's] etc would be a lot better and "Safer" ?? :)
Definetely need

Edit:
I modified sboxDB.php to display parse BBC: hxxp:www.megaupload.com/?d=G55CMQXD [nonactive]


Could you please post it again pretty please? Or upload it to another host? my school has banned megaupload and rapidshare so I can't download that file :(

Col

Otochan,

I make no guarantees about the code, but this is what was at the link to megaupload.


<?

require("../SSI.php");



if (!defined('SMF'))

die('Hacking attempt...');



// global variables

global $db_connection, $context, $settings, $txt, $user_info, $modSettings, $db_prefix;



// used in test scenario

//@mysql_select_db($db_name, $db_connection);



//display html header

echo '<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />

<meta name="description" content="Shoutbox" />

<meta name="keywords" content="Shoutbox" />

<title>Shoutbox</title>

<meta http-equiv="refresh" content="'.$modSettings['sbox_RefreshTime'].';URL=sboxDB.php">

<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc2" />

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[

function killYesNo()

{

return confirm("'.$txt['sbox_KillShout'].'");



}

// ]]></script>



<style type="text/css"><!-- // --><![CDATA[

<!--

.Kill

{

color: #ff0000;

}

.OddLine

{

font-family: '.$modSettings['sbox_FontFamily1'].';

font-style: normal;

font-size: '.$modSettings['sbox_TextSize1'].';

font-weight: normal;

color: '.$modSettings['sbox_TextColor1'].';

}

.EvenLine

{

font-family: '.$modSettings['sbox_FontFamily2'].';

font-style: normal;

font-size: '.$modSettings['sbox_TextSize2'].';

font-weight: normal;

color: '.$modSettings['sbox_TextColor2'].';

}

body

{

padding: 0px 0px 0px 0px;

background-color: '.$modSettings['sbox_BackgroundColor'].';

}

a:link

{

color: #ff0000;

text-decoration: none;

}

//-->

// ]]></style>';





switch ($_REQUEST['action'])

{



case "write":

if  ((!$context['user']['is_guest']) || ($modSettings['sbox_GuestAllowed'] == "1"))

{

// empty messages are not allowed

$content=$_REQUEST['sboxText'];

if(chop($content."") != "")

{

// get actual weekday

$days = array($txt['sbox_Sunday'],$txt['sbox_Monday'],$txt['sbox_Tuesday'],$txt['sbox_Wednesday'],$txt['sbox_Thurday'],$txt['sbox_Friday'],$txt['sbox_Saturday']);

$day=$days[date("w")]; // weekday

$date=$day." | ". date("G:i"); // time



// handle spacial characters

include_once("Subs-Post.php");
    preparsecode(&$content);
fixTags(&$content);




// insert shout message into database

$sql = "insert into ".$db_prefix."sbox_content (name,content,time) values ('".$user_info['username']."','".$content."','$date')";

db_query($sql,__FILE__,__LINE__);



// delete old shout messages (get id of last shouting and delete all shoutings as defined in settings

$result = db_query("select id from ".$db_prefix."sbox_content where name='".$user_info['username']."' and content='".$content."' and time='$date'",__FILE__,__LINE__);

$rows = mysql_fetch_assoc($result) ;

$sql = "delete from ".$db_prefix."sbox_content where id < '".($rows["id"]-$modSettings['sbox_MaxLines'])."'";

db_query($sql,__FILE__,__LINE__);

}

}

break;

case "kill":

if  ($context['user']['is_admin'])

{

$id = "".$_REQUEST['kill'];

if ($id != "")

{

$sql = "delete from ".$db_prefix."sbox_content where id=".$id."";

db_query($sql,__FILE__,__LINE__);

}

}

break;

}



// close header and open body

echo '

</head>

<body>';



// get smilie path

$themedir = $settings['default_theme_url']; // smf theme path

$imgdir = $themedir."/images/"; // smilie path



// get shout messages out of database

$result = db_query("select * from ".$db_prefix."sbox_content order by id desc, time asc limit ".$modSettings['sbox_MaxLines'],__FILE__,__LINE__);

if(mysql_num_rows($result))

{

$count=0; // counter to distinguish font color

while($row = mysql_fetch_assoc($result))

{

$count = $count + 1; // increase counter

$name = $row["name"]; // user name

$date = $row["time"]; // shouting date and time

$content = $row['content']; // shouting content

include_once("Subs-Post.php");
$content = un_preparsecode($content);
$content = doUBBC ($content);
// replace smilie code with path to smilie image

$content = str_replace ($txt['sbox_smilie01_code'], '<img src="'.$imgdir.$txt['sbox_smilie01_file'].'" alt="'.$txt['sbox_smilie01_text'].'" title="'.$txt['sbox_smilie01_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie02_code'], '<img src="'.$imgdir.$txt['sbox_smilie02_file'].'" alt="'.$txt['sbox_smilie02_text'].'" title="'.$txt['sbox_smilie02_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie03_code'], '<img src="'.$imgdir.$txt['sbox_smilie03_file'].'" alt="'.$txt['sbox_smilie03_text'].'" title="'.$txt['sbox_smilie03_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie04_code'], '<img src="'.$imgdir.$txt['sbox_smilie04_file'].'" alt="'.$txt['sbox_smilie04_text'].'" title="'.$txt['sbox_smilie04_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie05_code'], '<img src="'.$imgdir.$txt['sbox_smilie05_file'].'" alt="'.$txt['sbox_smilie05_text'].'" title="'.$txt['sbox_smilie05_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie06_code'], '<img src="'.$imgdir.$txt['sbox_smilie06_file'].'" alt="'.$txt['sbox_smilie06_text'].'" title="'.$txt['sbox_smilie06_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie07_code'], '<img src="'.$imgdir.$txt['sbox_smilie07_file'].'" alt="'.$txt['sbox_smilie07_text'].'" title="'.$txt['sbox_smilie07_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie08_code'], '<img src="'.$imgdir.$txt['sbox_smilie08_file'].'" alt="'.$txt['sbox_smilie08_text'].'" title="'.$txt['sbox_smilie08_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie09_code'], '<img src="'.$imgdir.$txt['sbox_smilie09_file'].'" alt="'.$txt['sbox_smilie09_text'].'" title="'.$txt['sbox_smilie09_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie10_code'], '<img src="'.$imgdir.$txt['sbox_smilie10_file'].'" alt="'.$txt['sbox_smilie10_text'].'" title="'.$txt['sbox_smilie10_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie11_code'], '<img src="'.$imgdir.$txt['sbox_smilie11_file'].'" alt="'.$txt['sbox_smilie11_text'].'" title="'.$txt['sbox_smilie11_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie12_code'], '<img src="'.$imgdir.$txt['sbox_smilie12_file'].'" alt="'.$txt['sbox_smilie12_text'].'" title="'.$txt['sbox_smilie12_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie13_code'], '<img src="'.$imgdir.$txt['sbox_smilie13_file'].'" alt="'.$txt['sbox_smilie13_text'].'" title="'.$txt['sbox_smilie13_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie14_code'], '<img src="'.$imgdir.$txt['sbox_smilie14_file'].'" alt="'.$txt['sbox_smilie14_text'].'" title="'.$txt['sbox_smilie14_text'].'" border="0" />', $content);

$content = str_replace ($txt['sbox_smilie15_code'], '<img src="'.$imgdir.$txt['sbox_smilie15_file'].'" alt="'.$txt['sbox_smilie15_text'].'" title="'.$txt['sbox_smilie15_text'].'" border="0" />', $content);



// display shouting message and use a different color each second row

if ($count % 2)

echo '

<div class="OddLine">';

else

echo '

<div class="EvenLine">';

if ($context['user']['is_admin'])

echo '<a title="'.$txt['sbox_KillShout'].'" class="Kill" onclick="return killYesNo();" href="sboxDB.php?action=kill&kill='.$row['id'].'">[X]</a>';



echo '[&nbsp;'.$date.'&nbsp;]&nbsp;<b>&lt;'.$name.'&gt;</b>&nbsp;'.$content.'</div>';

}



    echo '

</body>

</html>';

}

?>

Dextrophobia

I installed. Said it was installed. And just plain doesn't work. Why why why why why do mods not work when I install them?

Advertisement: