Post by Peter on Dec 3, 2004 13:05:23 GMT
Rene or Ron,
If this isn't allowed just delete it
Ok, this code will replace the smiley popup link with a new function so the smileys can work. At the moment there is a bug which prevents the smileys from working from the popup. So until it's fixed and you really need it, use this.
Only 3 things you need to know.
1. var sbUser = "USERNAME";
Change the bit in red to your SayBox username. That is needed to grab the stylesheet for your saybox.
2. If you look in the top part of the script you have a variable...
var iBase = "www.saybox.co.uk/smileys/";
at the moment it's setup to use the default SayBox smileys, so if you have your own, enter the url to the folder, remember to include the ending slash (/).
3. The array in the script at the top which looks like this..
var smileys = [
["SMILIE CODE","IMAGE NAME.gif"],
["SMILIE CODE","IMAGE NAME.gif"]
];
that is where you enter the code and image name. You can add more if you wish.
Add this under your saybox code
If this isn't allowed just delete it
Ok, this code will replace the smiley popup link with a new function so the smileys can work. At the moment there is a bug which prevents the smileys from working from the popup. So until it's fixed and you really need it, use this.
<script type="text/javascript">
<!--
//Smiley popup
//This is your saybox username
var sbUser = "USERNAME";
//This is the url base to the smileys with ending /
var iBase = "http://www.saybox.co.uk/smileys/";
var smileys = [
[":)","smiley.gif"],
[";)","wink.gif"],
[":D","cheesy.gif"],
[";D","grin.gif"],
[">:(","angry.gif"],
[":(","sad.gif"],
[":o","shocked.gif"],
["8-)","cool.gif"],
["???","huh.gif"],
["::\\","rolleyes.gif"],
[":P","tongue.gif"],
[":-[","embarassed.gif"],
[":-x","lipsrsealed.gif"],
[":-\\","undecided.gif"],
[":-*","kiss.gif"],
[":\'(","cry.gif"]
];
function SBSmileys(){
var top = ((screen.height - 375) / 2); var left = ((screen.width - 200) / 2);
var doWin = window.open('','S','width=200,height=375,scrollbars=yes,resizable=yes,left=' + left +',top=' + top);
var genPage = '<!-- Copyright © SayBox 2003 - 2004, All Rights Reserved -->\n\n<html>\n<head>\n';
genPage += '<title>Viewing Smilies</title>\n';
genPage += '<link rel="stylesheet" href="http://saybox.co.uk/style.php?user=' + sbUser + '" />\n</head>\n';
genPage += '\n<body style="margin:0;">\n<script type="text/javascript">\nfunction emote(code){\n';
genPage += '\tvar message = window.opener.document.sayboxform.saybox_mesg;\n';
genPage += '\tmessage.value += (message.value.charAt(message.value.length-1) == \' \') ? code : \' \'+code;\n';
genPage += '}\n<\/script>\n\n<table border="0" cellspacing="1" cellpadding="3" width="100%"';
genPage +=' align="center" class="tdborder">';
genPage += '\n<tr class="tdtitle">\n<th width="50%">Code(s)</th>\n<th width="50%">Image</th>\n</tr>';
for(s=0;s<smileys.length;s++){
genPage += '<tr class="tdwindow">\n<td width="50%" align="center">' + smileys[s][0] + '</td>\n';
genPage += '<td width="50%" align="center"><img src="' + iBase + smileys[s][1] + '" ';
genPage += 'title="' + smileys[s][0] + '" onmouseover="this.style.cursor=\'pointer\'"';
genPage += ' onclick="emote(this.title)" border="0" /></td>\n</tr>\n';
}
genPage += '<tr>\n<td align="center" colspan="2" class="tdtitle">';
genPage += '<a href="javascript:window.close();">Close Window</a></td>\n</tr>\n</table>';
genPage += '\n</body>\n</html>\n';
doWin.document.write(genPage);
doWin.document.close();
if(doWin){
doWin.focus();
}
}
var sdSLink = document.getElementsByTagName("a");
for(a=0;a<sdSLink.length;a++){
with(sdSLink[a]){
if(target=="_self" && firstChild.nodeValue.match(/Smilies/)){
href = 'javascript: SBSmileys()';
}
}
}
//-->
</script>
Only 3 things you need to know.
1. var sbUser = "USERNAME";
Change the bit in red to your SayBox username. That is needed to grab the stylesheet for your saybox.
2. If you look in the top part of the script you have a variable...
var iBase = "www.saybox.co.uk/smileys/";
at the moment it's setup to use the default SayBox smileys, so if you have your own, enter the url to the folder, remember to include the ending slash (/).
3. The array in the script at the top which looks like this..
var smileys = [
["SMILIE CODE","IMAGE NAME.gif"],
["SMILIE CODE","IMAGE NAME.gif"]
];
that is where you enter the code and image name. You can add more if you wish.
Add this under your saybox code