Trying to add click able smilies to my shoutbox add on. Trying to add click able smilies to my shoutbox add on.
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Trying to add click able smilies to my shoutbox add on.

Started by Ross(SE-MI), March 13, 2006, 05:42:14 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ross(SE-MI)

Need help on scripts borrowed from this Coppermine smilie scripts.

First, here is link to my site showing added shout box and smilies (not clickable).
http://www.metaldetectingpics.com/

When I add borrowed code listed below, my text boxes and smilies disappear but no errors.
Can someone help me out with what is causing the disappearance?

<? ob_start(); ?>
<?
/*
BarCode Scripts (SHOUT!) [config]
http://shout.sourceforge.net
Original Author: James Fleeting
*/

$m_time = explode(" ",microtime());
$m_time = $m_time[0] + $m_time[1];
$starttime = $m_time;

//Set cookies
setcookie("name", $name, time()+999999999);
setcookie("email", $email, time()+999999999);
setcookie("site", $site, time()+999999999);

require('./shoutconfig.php');

print "<HTML>
<HEAD>
<TITLE>$title</TITLE>
    <link rel='stylesheet' type='text/css' href='style.css'>";

    header("Refresh: $refresh; URL=shoutbox.php");

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>
<BODY>
<center>";

if (isset($_COOKIE['name'])){

$name = $_COOKIE['name'];
$email = $_COOKIE['email'];
$site = $_COOKIE['site'];
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>
<INPUT TYPE='TEXT' value='name' NAME='name' SIZE=18 maxlength='100'>
<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>";
}


/*
NoName Scripting (Users Online)
*/

//get the time from server
$timestamp = time();
$timeout = $timestamp-$timeoutseconds;

//connect to database
mysql_connect($server, $db_user, $db_pass);

//values
$insert = mysql_db_query($database, "INSERT INTO $dbt_useronline VALUES
('$timestamp','$REMOTE_ADDR','$PHP_SELF')");
if(!($insert)) {
print "Useronline Insert Failed > ";
}

//delete user when they leave
$delete = mysql_db_query($database, "DELETE FROM $dbt_useronline WHERE timestamp<$timeout");
if(!($delete)) {
print "Useronline Delete Failed > ";
}

//get the results
$result = mysql_db_query($database, "SELECT DISTINCT ip FROM $dbt_useronline WHERE file='$PHP_SELF'");
if(!($result)) {
print "Useronline Select Error > ";
}

//rows = people online
$user = mysql_num_rows($result);


//displays the users online
mysql_close();
if($user == 1) {
print("$user user online\n");
} else {
print("$user users online\n");
}

echo '<br />';

/*NoName Scripting SHOUT!*/

//mySQL database info
mysql_connect("$server","$db_user","$db_pass");
mysql_select_db("$database");

if($submit)
{
   //PHP date function
   $time=date("l, F d Y H:i");
   
   //inserting info to the database
   $result=MYSQL_QUERY("INSERT INTO $dbt_shoutbox (id,name,message,time,site,email)".
      "VALUES ('NULL','$name', '$message','$time','$site','$email')");
}

//getting the last ? messages. Edit $showamount in config file
$result = mysql_query("select * from $dbt_shoutbox order by id desc limit $showamount");


//while loop
while($r=mysql_fetch_array($result))
{
   //getting details from the database
   $gmt = "-5";
   $time=$r["time"];
   $id=$r["id"];
   $message=$r["message"];
   $name=$r["name"];
   $site=$r["site"];
   $email=$r["email"];

//gets smilies strings
require('./shoutsmilies.php');

echo '</center>';
echo '<b>'.$name.'&nbsp;'.'&nbsp;'.'&nbsp;'.$time.'</b>'.'<br />';
echo $message.'<br />';
echo '<hr align="center" width="100%" color='.$linecolor.'>';

}

?>
</center>
</body>
</html>

Ross(SE-MI)

I believe the problem was with the following code which I removed.

if (isset($_COOKIE['name'])){

$name = $_COOKIE['name'];
$email = $_COOKIE['email'];
$site = $_COOKIE['site'];