Board Logo

 Username:    Password:    Stay logged in: Welcome Guest. Please Login or Register.  Jun 26th, 2017, 03:48am


Board Hacks
Important News
Please read the notes posted with any codes carefully, as they will usually tell you where they need to go.
Welcome to the Conforums Hacks Board!

All codes here have been tested but we accept no responsibility if these codes do not work on your board, or have an adverse effect when used in combination with other codes.

This board is read only. Any queries or requests for codes should be made on the Coding Forum

Helpful sites
Google
Dynamic Drive

The Staff
Roger
Dave
GIzzy



« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Add extra smilies with originals.  (Read 2680 times)
Dave
I've always wanted one of these wink
Conforums Administrator


member is offline

Avatar

Mr Fixit...


Homepage PM

Gender: Male
Posts: 17636
xx Add extra smilies with originals.
« Thread started on: Aug 30th, 2005, 03:41am »

Code:
<script language="javascript" type="text/javascript">
<!--
// Add Extra Smilies to originals in Post Box
// Coded by Dave - Conforums.com

var smilie = new Array();
var censor = new Array();
var tds = document.getElementsByTagName('td');
//Contains URLs of extra Smilies and censored words

smilie[0] = "http://mysite.freeserve.com/dbdave/images/thumb.gif";
censor[0] = ":thumb:";

var ftloc = (location.href.match(/imshow/)) ? 2 : 3;
function addsmile(smile,image){
var sm = new RegExp(smile,"g");
for(ji=0;ji<tds.length; ji++){
if(tds[ji].width=="80%" && tds[ji].height=="100%"){
if(!tds[ji].getElementsByTagName('SCRIPT')[0])
tds[ji].getElementsByTagName('FONT')[ftloc].innerHTML = tds[ji].getElementsByTagName('FONT')[ftloc].innerHTML.replace(sm,'<img src="'+image+'" border="0">');
}}}

if (location.href.match(/=post|reply|modify|quote|imsend/) && !location.href.match(/modify2/)) {
for(k=0; k<smilie.length; k++){
document.getElementById('extrasmilie').innerHTML+= (smilie[k] == "<br>") ? "<br />" : "<a href=javascript:add('%20"+censor[k]+"')><img src= "+smilie[k]+" align=bottom alt= "+censor[k]+" border='0'></a> ";
}} else {
for(kl=0; kl<smilie.length; kl++){
if(!smilie[kl].match(/<br>/ig))
addsmile(censor[kl],smilie[kl])
}}
-->
</script> 
 


This code goes in the Global Footers.

This code should now be 100% cross browser compatible, although it will not convert the censored words on the post preview page.

If you want the smilies to appear in a new line, then insert a <br> tag into the smilie array and make the censor array empty for that value.


Eg:

smilies[9]="<br>";
censor[9]="";


This code goes in all footers..

To see a preview of this code's effects Click Here
User IP Logged

Have you read the FAQ or checked the Hacks board before posting?
No?
Then please do so...
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Back To Top
Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls