Added click able Smilies and also showing my changes to authors original script.
Note: changed original post in this tread slightly to add credit link to author.
Code added here borrowed from scripts in this Coppermine software.
Files to edit in Shout: shoutbox.php
Open shoutbox.php
Find and remove, (added in anycontent.php, see first post)
$version = "v0.5";
$powered = "Powered: SHOUT!";
Find
print "</HEAD>
Replace with
print "
<SCRIPT LANGUAGE='JAVASCRIPT' TYPE='TEXT/JAVASCRIPT'>
<!--
/****************************************************
AUTHOR: WWW.CGISCRIPT.NET, LLC
URL: http://www.cgiscript.net
Use the code for FREE but leave this message intact.
Download your FREE CGI/Perl Scripts today!
( http://www.cgiscript.net/scripts.htm )
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(pos=='random'){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=='center'){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!='random') || pos==null){myleft=0;mytop=20}
settings='width=' + w + ',height=' + h + ',top=' + mytop + ',left=' + myleft + ',scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';win=window.open(mypage,myname,settings);
win.focus();}
// -->
</script>
<script language='JavaScript' type='text/javascript'>
<!--
function emoticon_post(text) {
text = ' ' + text + ' ';
if (document.post.message.createTextRange && document.post.message.caretPos) {
var caretPos = document.post.message.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
document.post.message.focus();
} else {
document.post.message.value += text;
document.post.message.focus();
}
}
function storeCaret_post(textEl) {
if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}
//-->
</script>
</HEAD>
Find
if (isset($_COOKIE['name'])){
$name = $_COOKIE['name'];
$email = $_COOKIE['email'];
$site = $_COOKIE['site'];
echo "<form action='$php_self' method='post' name='form'>
<INPUT TYPE='TEXT' value='$name' NAME='name' SIZE=18 maxlength='100'><br />
<INPUT TYPE='TEXT' value='$site' NAME='site' SIZE=18 maxlength='100'><br />
<INPUT TYPE='TEXT' value='$email' NAME='email' SIZE=18 maxlength='100'><br />
<INPUT TYPE='TEXT' value='message' NAME='message' SIZE=18 maxlength='100'><br />
<input type='submit' name='submit' value='shout'><input type='reset' name='reset' value='Reset'>
</form>";
} else {
echo "<form action='$php_self' method='post' name='form'>
Replace with
echo "<div id='comments'><form action='$php_self' method='post' name='post'>
<td><input type='hidden' name='msg_author' value='Webmaster' /></td>
<!-- BEGIN input_box_smilies -->
Enter your name and your message here.<br>
Find
<INPUT TYPE='TEXT' value='message' NAME='message' SIZE=54 maxlength='100'><br />
<input type='submit' name='submit' value='shout'><input type='reset' name='reset' value='Reset'>
</form>";
Replace with
Note: change smilie codes to your liking
<INPUT TYPE='TEXT' value='message' NAME='message' SIZE=54 maxlength='140' class='textinput' id='message' name='msg_body' onselect='storeCaret_post(this);' onclick='storeCaret_post(this);' onkeyup='storeCaret_post(this);' />
<input type='reset' name='reset' value='Reset'>
<input type='submit' class='comment_button' name='submit' value='shout'>
<!-- END input_box_smilies -->
<td class='tableb_compact'>
<input type='hidden' name='event' value='comment' />
<input type='hidden' name='pid' value='91' />
</td>
</br>
Click on smilies below to add to your message.
<table width=50% border=0 cellspacing=0 cellpadding=0>
<tr align=center height=30 valign=middle>
<td width=5%><img src=smilies/".$theme."/".$theme."biggrin.gif alt= :-D width=15 height=15 border=0 style=cursor:pointer; title= :-D onclick=javascript:emoticon_post(':-D') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."smilewinkgrin.gif alt= :swg width=15 height=15 border=0 style=cursor:pointer; title= :swg onclick=javascript:emoticon_post(':swg') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."smile.gif alt= :) width=15 height=15 border=0 style=cursor:pointer; title= :) onclick=javascript:emoticon_post(':)') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."laugh.gif alt= :lol width=15 height=15 border=0 style=cursor:pointer; title= :lol onclick=javascript:emoticon_post(':lol') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."cool.gif alt= :cool width=15 height=15 border=0 style=cursor:pointer; title= :cool onclick=javascript:emoticon_post(':cool') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."sad.gif alt= :( width=15 height=15 border=0 style=cursor:pointer; title= :( onclick=javascript:emoticon_post(':(') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."cry.gif alt= :cry width=15 height=15 border=0 style=cursor:pointer; title= :cry onclick=javascript:emoticon_post(':cry') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."dead.gif alt= :dead width=15 height=15 border=0 style=cursor:pointer; title= :dead onclick=javascript:emoticon_post(':dead') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."eek.gif alt= :o width=15 height=15 border=0 style=cursor:pointer; title= :o onclick=javascript:emoticon_post(':o') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."bigeek.gif alt= :bO width=15 height=15 border=0 style=cursor:pointer; title= :bO onclick=javascript:emoticon_post(':bO') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."embarrassed.gif alt= :emb width=15 height=15 border=0 style=cursor:pointer; title= :emb onclick=javascript:emoticon_post(':emb') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."mad.gif alt= :x width=15 height=15 border=0 style=cursor:pointer; title= :x onclick=javascript:emoticon_post(':x') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."no.gif alt= :no width=15 height=15 border=0 style=cursor:pointer; title= :no onclick=javascript:emoticon_post(':no') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."none.gif alt= :| width=15 height=15 border=0 style=cursor:pointer; title= :| onclick=javascript:emoticon_post(':|') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."razz.gif alt= :razz width=15 height=15 border=0 style=cursor:pointer; title= :razz onclick=javascript:emoticon_post(':razz') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."bigrazz.gif alt= :brazz width=15 height=15 border=0 style=cursor:pointer; title= :brazz onclick=javascript:emoticon_post(':brazz') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."roll.gif alt= :roll width=15 height=15 border=0 style=cursor:pointer; title= :roll onclick=javascript:emoticon_post(':roll') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."rolleyes.gif alt= :rol2 width=15 height=15 border=0 style=cursor:pointer; title= :rol2 onclick=javascript:emoticon_post(':rol2') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."shy.gif alt= :shy width=15 height=15 border=0 style=cursor:pointer; title= :shy onclick=javascript:emoticon_post(':shy') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."uhoh.gif alt= :O width=15 height=15 border=0 style=cursor:pointer; title= :O onclick=javascript:emoticon_post(':O') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."wink.gif alt= ;) width=15 height=15 border=0 style=cursor:pointer; title= ;) onclick=javascript:emoticon_post(';)') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."yes.gif alt= :yep width=15 height=15 border=0 style=cursor:pointer; title= :yep onclick=javascript:emoticon_post(':yep') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."sleep.gif alt= :sleep width=15 height=25 border=0 style=cursor:pointer; title= :sleep onclick=javascript:emoticon_post(':sleep') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."sleepw.gif alt= :slw width=15 height=25 border=0 style=cursor:pointer; title= :slw onclick=javascript:emoticon_post(':slw') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."confused.gif alt= :-? width=15 height=25 border=0 style=cursor:pointer; title= :-? onclick=javascript:emoticon_post(':-?') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."confusedw.gif alt= :-w width=15 height=25 border=0 style=cursor:pointer; title= :-w onclick=javascript:emoticon_post(':-w') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."sigh.gif alt= :sigh width=15 height=25 border=0 style=cursor:pointer; title= :sigh onclick=javascript:emoticon_post(':sigh') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."sighw.gif alt= :siw width=15 height=25 border=0 style=cursor:pointer; title= :siw onclick=javascript:emoticon_post(':siw') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."upset.gif alt= :grim width=15 height=25 border=0 style=cursor:pointer; title= :grim onclick=javascript:emoticon_post(':grim') /></td>
<td width=5%><img src=smilies/".$theme."/".$theme."upsetw.gif alt= :griw width=15 height=25 border=0 style=cursor:pointer; title= :griw onclick=javascript:emoticon_post(':griw') /></td>
</tr>
</table>
</form></div>";
Find and remove, not needed
echo '<br />';
echo '<center>';
echo $powered.'<br />';
//page loading time
$round = 3;// The number of decimal places to round the micro time to.
$m_time = explode(" ",microtime());
$m_time = $m_time[0] + $m_time[1];
$endtime = $m_time;
$totaltime = ($endtime - $starttime);
echo "Load: ". round($totaltime,$round) ." seconds";
echo "</center>";
Save and close file, enjoy
Working on "name field" to match person logged in.
Please let me know if you are using this script by providing your link, thank you.