Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length


News:

Register your account to receive email notifications when new services and mods are added.


Pages: 1 [2]

AuthorTopic: Shoutbox  (Read 2190 times)

Cronus

  • Administrator
  • Excellent Member
  • *****
  • Reputation Power: 1870
  • Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!Cronus is awe-inspiring!
  • Offline Offline
  • Posts: 479
    • View Profile
    • WWW
Re: Shoutbox
« Reply #15 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 =)
Logged

Danny696

  • Excellent Member
  • ***
  • Reputation Power: 276
  • Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.
  • Offline Offline
  • Posts: 457
    • View Profile
Re: Shoutbox
« Reply #16 on: November 24, 2009, 11:38:22 AM »
Fixed, Tested, PM'ed
Logged
My Game: GraveYard; Madness || Projects; N/A -  Available for work. Please IM/PM me.

gator

  • Basic Member
  • *
  • Reputation Power: 12
  • gator has no influence.
  • Offline Offline
  • Posts: 4
    • View Profile
Re: Shoutbox
« Reply #17 on: November 30, 2009, 05:48:53 PM »
with a lil minor editing, V1 shoutbox works like a charm.



here is what the user sees when banned

« Last Edit: November 30, 2009, 05:59:49 PM by gator »
Logged

Danny696

  • Excellent Member
  • ***
  • Reputation Power: 276
  • Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.
  • Offline Offline
  • Posts: 457
    • View Profile
Re: Shoutbox
« Reply #18 on: December 01, 2009, 11:04:15 AM »
So does my V2 -.-
Logged
My Game: GraveYard; Madness || Projects; N/A -  Available for work. Please IM/PM me.

Danny696

  • Excellent Member
  • ***
  • Reputation Power: 276
  • Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.
  • Offline Offline
  • Posts: 457
    • View Profile
Re: Shoutbox
« Reply #19 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 />';;
}
Logged
My Game: GraveYard; Madness || Projects; N/A -  Available for work. Please IM/PM me.

mentaljason

  • Basic Member
  • *
  • Reputation Power: 7
  • mentaljason has no influence.
  • Offline Offline
  • Posts: 17
    • View Profile
Re: Shoutbox
« Reply #20 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... ?
Logged

Danny696

  • Excellent Member
  • ***
  • Reputation Power: 276
  • Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.
  • Offline Offline
  • Posts: 457
    • View Profile
Re: Shoutbox
« Reply #21 on: January 14, 2010, 12:22:30 PM »
Not an iframe, where ever you want it to show, add include_once"shoutbox.php";
Logged
My Game: GraveYard; Madness || Projects; N/A -  Available for work. Please IM/PM me.

Jordan

  • Active Member
  • **
  • Reputation Power: 55
  • Jordan has no influence.
  • Offline Offline
  • Posts: 103
  • Website Developer for hire;
    • MSN Messenger - Pudda2008@hotmail.co.uk
    • View Profile
    • WWW
    • Email
Re: Shoutbox
« Reply #22 on: February 24, 2010, 03:03:20 AM »
Looking good. I like David (Iamwickeds) && Jeff's better though
Logged

Pudda2008@hotmail.co.uk - Feel free to add me on MSN

kieranrobo

  • Basic Member
  • *
  • Reputation Power: 18
  • kieranrobo has no influence.
  • Offline Offline
  • Posts: 17
    • View Profile
Re: Shoutbox
« Reply #23 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?
Logged

Danny696

  • Excellent Member
  • ***
  • Reputation Power: 276
  • Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.
  • Offline Offline
  • Posts: 457
    • View Profile
Re: Shoutbox
« Reply #24 on: July 11, 2010, 06:39:31 AM »
AJAX/JS ermm, im sure IAM made an AJAX shoutbox on MWG :)
Logged
My Game: GraveYard; Madness || Projects; N/A -  Available for work. Please IM/PM me.

kieranrobo

  • Basic Member
  • *
  • Reputation Power: 18
  • kieranrobo has no influence.
  • Offline Offline
  • Posts: 17
    • View Profile
Re: Shoutbox
« Reply #25 on: July 11, 2010, 11:10:04 AM »
MWG? Link please ;)
Logged

Danny696

  • Excellent Member
  • ***
  • Reputation Power: 276
  • Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.Danny696 has a powerful will.
  • Offline Offline
  • Posts: 457
    • View Profile
Re: Shoutbox
« Reply #26 on: July 11, 2010, 12:18:25 PM »
Logged
My Game: GraveYard; Madness || Projects; N/A -  Available for work. Please IM/PM me.
Pages: 1 [2]
« previous next »