Cronwerks MCCode/MCCodes Forums

Free MCCode/MCCodes Mods => Cronwerks Free MCCode/MCCodes Mods => Topic started by: Cronus on July 04, 2009, 02:22:16 AM



Title: Shoutbox
Post by: Cronus on July 04, 2009, 02:22:16 AM
Shoutbox
Originally Created By: Cyanide (http://www.cronwerks.com/forum/index.php?action=profile;u=150)

This is a simple shoutbox for your game with banning capabilities.
You can add the shoutbox to ANY location with a simple edit.

This mod is available in version 1 and version 2.
Test this mod at: http://test.infintium.net

The files are attached in .rar form.
You will need to be registered and logged in to access it.


Title: Re: Shoutbox
Post by: Cronus on August 04, 2009, 03:10:33 AM
This mod is now available for free!


Title: Re: Shoutbox
Post by: Rain on August 26, 2009, 08:39:51 PM
I have it but when you go to the shoutbox.php its all distorted maybe you can help me on that?


Title: Re: Shoutbox
Post by: Cronus on August 27, 2009, 08:54:05 AM
Perhaps its messing with your template, screenshot?


Title: Re: Shoutbox
Post by: Hitman 15 on August 28, 2009, 04:06:44 PM
works great for me well done cronus


Title: Re: Shoutbox
Post by: Hitman 15 on August 29, 2009, 02:22:30 AM
ok lol the only thing that dont work it the ban :(


Title: Re: Shoutbox
Post by: ducktape on August 30, 2009, 07:32:56 AM
ban dont work eahter on my end


Title: Re: Shoutbox
Post by: Rain on August 30, 2009, 04:08:16 PM
Quote from: Cronus
Perhaps its messing with your template, screenshot?

Here:
http://i31.tinypic.com/jjbv6d.jpg


Title: Re: Shoutbox
Post by: ducktape on August 30, 2009, 07:06:46 PM
i had that 2 the fix for that is to not put the shoutbox.txt part in and it workd fine for me after that


Title: Re: Shoutbox
Post by: Hitman 15 on September 02, 2009, 12:18:12 AM
i had that 2 the fix for that is to not put the shoutbox.txt part in and it workd fine for me after that
what si you can now ban people


Title: Re: Shoutbox
Post by: ducktape on September 02, 2009, 06:42:52 AM
i had that 2 the fix for that is to not put the shoutbox.txt part in and it workd fine for me after that
what si you can now ban people
no i was talking to rain about messing the screen up when he put shoutbox.php


Title: Re: Shoutbox
Post by: Rain on September 02, 2009, 09:16:19 AM
I added the shoutbox.txt and it still didn't work, I have v2.0


Title: Re: Shoutbox
Post by: Klikoka on September 06, 2009, 07:17:03 AM
I added the shoutbox.txt and it still didn't work, I have v2.0
Are the shoutbox.txt permissions set to 0777 ?


Title: Re: Shoutbox
Post by: Twist3d Fat3 on September 07, 2009, 01:50:57 AM
Happy this Isn't a paid mod no more :-\


Title: Re: Shoutbox
Post by: ThaSkiMaskWay on November 24, 2009, 07:19:02 AM
This mod doers not work


Title: Re: Shoutbox
Post by: Cronus on November 24, 2009, 07:43:17 AM
Hmm, well, since it is a free mod, if anyone fixes it, please post a copy and I will update accordingly. If not, I will take some time in the future and fix it. However, there is no time frame for this, so hopefully we can work as a community to get it working =)


Title: Re: Shoutbox
Post by: Danny696 on November 24, 2009, 11:38:22 AM
Fixed, Tested, PM'ed


Title: Re: Shoutbox
Post by: gator on November 30, 2009, 05:48:53 PM
with a lil minor editing, V1 shoutbox works like a charm.

(http://www.omegacrime.com/images/OC shoutbox screenshot.JPG)

here is what the user sees when banned

(http://www.omegacrime.com/images/OC shoutbox screenshot2.JPG)


Title: Re: Shoutbox
Post by: Danny696 on December 01, 2009, 11:04:15 AM
So does my V2 -.-


Title: Re: Shoutbox
Post by: Danny696 on December 02, 2009, 02:57:17 PM
Heres my V2 code, works fully. Tested etc... i did send this to cronus, he hasnt got round to doing it yet, so here it is if your waiting for it.
Code: [Select]
<?php //  colors
$shouty $db->query("SELECT s.*,u.* FROM shoutbox s  LEFT JOIN users u ON u.userid=s.suserid ORDER BY s.stime DESC LIMIT 10");
echo
'<table width="90%" class="table" cellspacing="1">
<tr>
<th class="h" colspan="2"><i>Shout Box</i></td>'
;
if(
$ir['user_level'] > 1)
{
echo
'<td align="center" class="h"><i><b>Staff Actions</b></i></td>';
}
echo
'</tr>';
while(
$sb=$db->fetch_row($shouty))
{
echo 
sprintf("<tr>");
echo 
sprintf("<td valign='top'><a href='viewuser.php?u=%u' title='View profile of %s'>%s</a>[%u]<br />%s</td>"$sb['userid'], $sb['username'], 

$sb['username'], $sb['userid'], date('M j, Y g:i:s a',$sb['stime']));
echo 
sprintf("<td valign='top'>%s</td>"stripslashes($sb['smessage']));
if(
$ir['user_level'] > 1)
{
echo 
sprintf("<td valign='top'><form action='#' method='post'>");
echo 
sprintf("<input type='hidden' name='del' value='%u' /> <input type='submit' value='Delete Post' /></form>"$sb['sid']);
echo 
sprintf("<form action='#' method='post'>");
echo 
sprintf("<input type='hidden' name='ban' value='%u' /> <input type='submit' value='Ban User' /></form></td>"$sb['userid']);
}
echo 
sprintf("</tr>");
}
echo
'<br /><br />';


if(
$_POST['message'] != "")
{
$_POST['message']=mysql_real_escape_string(trim(strip_tags($_POST['message'])));
$message=($_POST['message']);
//smileys
$key = array(":)"":("";)"":D"":innocent"":hug"":/"":x"":blush"":P"":*"":broken"":o"":mad"":sly""B-)"":-S""=))"":-$"":thumbs"":devil"

":angel"":nerd"":whatever"":sleep"":roll"":loser"":clown"":hmmm"":drool");
$images  = array("<img src=smileys/1.gif>""<img src=smileys/2.gif>""<img src=smileys/3.gif>""<img src=smileys/4.gif>""<img src=smileys/5.gif>"

"<img src=smileys/6.gif>""<img src=smileys/7.gif>""<img src=smileys/8.gif>""<img src=smileys/9.gif>""<img src=smileys/10.gif>""<img 

src=smileys/11.gif>"
"<img src=smileys/12.gif>""<img src=smileys/13.gif>""<img src=smileys/14.gif>""<img src=smileys/15.gif>""<img 

src=smileys/16.gif>"
"<img src=smileys/17.gif>""<img src=smileys/18.gif>""<img src=smileys/19.gif>""<img src=smileys/20.gif>""<img 

src=smileys/21.gif>"
"<img src=smileys/22.gif>""<img src=smileys/23.gif>""<img src=smileys/24.gif>""<img src=smileys/25.gif>""<img 

src=smileys/26.gif>"
"<img src=smileys/27.gif>""<img src=smileys/28.gif>""<img src=smileys/29.gif>""<img src=smileys/30.gif>");
$message str_replace($key$images$message);
$query sprintf("INSERT INTO shoutbox VALUES('', %u, '%s', unix_timestamp())"$ir['userid'], $message);
$db->query($query);
echo
'<form action="#" method="post" name="form" form="form1" onSubmit="return disableFrom(this);">
<b>Message: </b><input type="text" name="message" maxlength="255" size="31">
<br />
<input type="Submit" value="Post Message"><input type="reset" value="Clear"> </form><br /><br />'
;
}
else
{
//Submit button JS Start
?>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function disableForm(theform) {
if (document.all || document.getElementById) {
for (i = 0; i < theform.length; i++) {
var tempobj = theform.elements[i];
if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
tempobj.disabled = true;
}
return true;
}
else {
return false;
   }
}
//  End -->
</script>
<?php
//Submit Button JS End
echo'<form action="#" method="post" name="form" form="form1" onSubmit="return disableFrom(this);">
<b>Message: </b><input type="text" name="message" maxlength="255" size="31">
<br />
<input type="Submit" value="Post Message"><input type="reset" value="Clear"> </form><br /><br />'
;
}
?>

  <script language="JavaScript" type="text/javascript">
  function addImage(textToAdd)
  {
   document.form.message.value += textToAdd;document.form.message.focus();
  }
  </script>
<?php
echo'<table width="90%" class="table" cellspacing=1 bgcolor="000000">
<tr>
<td class="h" colspan="10" align="center">Click smiley to insert</td></tr>
<tr bgcolor="ffffff">'
;
?>

<td align="center"><a onClick="addImage(':)')"><img src='smileys/1.gif' alt=':)' /></a></td>
<td align="center"><a onClick="addImage(':(')"><img src='smileys/2.gif' title=':(' /></a></td>
<td align="center"><a onClick="addImage(';)')"><img src='smileys/3.gif' title=';)' /></a></td>
<td align="center"><a onClick="addImage(':D')"><img src='smileys/4.gif' title=':D' /></a></td>
<td align="center"><a onClick="addImage(':innocent')"><img src='smileys/5.gif' title=':innocent' /></a></td>
<td align="center"><a onClick="addImage(':hug')"><img src='smileys/6.gif' title=':hug' /></a></td>
<td align="center"><a onClick="addImage(':/')"><img src='smileys/7.gif' title=':/' /></a></td>
<td align="center"><a onClick="addImage(':x')"><img src='smileys/8.gif' title=':x' /></a></td>
<td align="center"><a onClick="addImage(':blush')"><img src='smileys/9.gif' title=':blush' /></a></td>
<td align="center"><a onClick="addImage(':P')"><img src='smileys/10.gif' title=':P' /></a></td></tr>
<tr bgcolor="ffffff">
<td align='center'><a onClick="addImage(':*')"><img src='smileys/11.gif' title=':*' /></a></td>
<td align="center"><a onClick="addImage(':broken')"><img src='smileys/12.gif' title=':broken' /></a></td>
<td align="center"><a onClick="addImage(':o')"><img src='smileys/13.gif' title=':o' /></a></td>
<td align="center"><a onClick="addImage(':mad')"><img src='smileys/14.gif' title=':mad' /></a></td>
<td align="center"><a onClick="addImage(':sly')"><img src='smileys/15.gif' title=':sly' /></a></td>
<td align="center"><a onClick="addImage(':B-)')"><img src='smileys/16.gif' title=':B-)' /></a></td>
<td align="center"><a onClick="addImage(':-S')"><img src='smileys/17.gif' title=':-S' /></a></td>
<td align="center"><a onClick="addImage('=))')"><img src='smileys/18.gif' title='=))' /></a></td>
<td align="center"><a onClick="addImage(':-$')"><img src='smileys/19.gif' title=':-$' /></a></td>
<td align="center"><a onClick="addImage(':thumbs')"><img src='smileys/20.gif' title=':thumbs' /></a></td></tr>
<tr><td align="center"><a onClick="addImage(':devil')"><img src='smileys/21.gif' title=':devil' /></a></td>
<td align="center"><a onClick="addImage(':angel')"><img src='smileys/22.gif' title=':angel' /></a></td>
<td align="center"><a onClick="addImage(':nerd')"><img src='smileys/23.gif' title=':nerd' /></a></td>
<td align="center"><a onClick="addImage(':whatever')"><img src='smileys/24.gif' title=':whatever' /></a></td>
<td align="center"><a onClick="addImage(':sleep')"><img src='smileys/25.gif' title=':sleep' /></a></td>
<td align="center"><a onClick="addImage(':roll')"><img src='smileys/26.gif' title=':roll' /></a></td>
<td align="center"><a onClick="addImage(':loser')"><img src='smileys/27.gif' title=':loser' /></a></td>
<td align="center"><a onClick="addImage(':clown')"><img src='smileys/28.gif' title=':clown' /></a></td>
<td align="center"><a onClick="addImage(':hmmm')"><img src='smileys/29.gif' title=':hmmm' /></a></td>
<td align="center"><a onClick="addImage(':drool')"><img src='smileys/30.gif' title=':drool' /></a></td></tr>
</table><br/>
<?php
if($ir['user_level'] > 1)
{
echo 
sprintf("<tr><td colspan='3' align='center'><form action='#' method='post'>");
echo 
sprintf("<input type='hidden' name='flush' value='true' /><input type='submit' value='Clear Chat Box' /></form>");
}
echo 
sprintf("</td></tr></table>");
if(
$_POST['flush']==true && $ir['user_level'] > 1)
{
$db->query("TRUNCATE TABLE shoutbox");
echo
'<hr /><font color="red">Cleared Shout Box</font><hr />';
$message "".$ir['username']." cleared the shoutbox.";
$insertnotice sprintf("INSERT INTO shoutbox VALUES('', %u, '%s', unix_timestamp())"$ir['userid'], $message);
$db->query($insertnotice);
}
if(
$_POST['del'] && $ir['user_level'] > 1)
{
$query  sprintf("DELETE FROM shoutbox WHERE sid=%u"$_POST['del']);
$db->query($query);
echo
'<hr /><font color="red">Post deleted</font><hr />';
}
if(
$_POST['ban'] && $ir['user_level'] > 1)
{
$query sprintf("UPDATE users SET sbban=+5 WHERE userid=%u"$_POST['ban']);
$db->query($query);
echo
'<hr /><font color="red">User banned for 5 days.</font><hr />';;
}


Title: Re: Shoutbox
Post by: mentaljason on January 14, 2010, 08:17:18 AM
Just for that last post, is this meant to be added as an iframe? because i dont see any includes in that file... ?


Title: Re: Shoutbox
Post by: Danny696 on January 14, 2010, 12:22:30 PM
Not an iframe, where ever you want it to show, add include_once"shoutbox.php";


Title: Re: Shoutbox
Post by: Jordan on February 24, 2010, 03:03:20 AM
Looking good. I like David (Iamwickeds) && Jeff's better though


Title: Re: Shoutbox
Post by: kieranrobo on July 10, 2010, 12:31:27 PM
Is there a way you could make it work without having to F5 to see a new message?


Title: Re: Shoutbox
Post by: Danny696 on July 11, 2010, 06:39:31 AM
AJAX/JS ermm, im sure IAM made an AJAX shoutbox on MWG :)


Title: Re: Shoutbox
Post by: kieranrobo on July 11, 2010, 11:10:04 AM
MWG? Link please ;)


Title: Re: Shoutbox
Post by: Danny696 on July 11, 2010, 12:18:25 PM
www.makewebgames.com