Post by Ross on Oct 17, 2005 14:56:43 GMT
Before I post the code, I must warn you that allowing HTML is posts can be very dangerous. There are some malicious people out there who would use it to do harm. For that reason I have done this so only member groups which you specify may use HTML in their posts.
So some of you may be wondering what the point of this code is? Well it lets users use features that you can't usually do in UBBC code. For example, you could link to iFrames or use advanced tables.
Global or Board Footer:
<script type="text/javascript">
<!--
/* Allow HTML in Staff Posts
WARNING: Use with great caution!
The code creator will NOT be held responsible for any damage done by this code*/
var allowedGroups = /(1|2)$/;
var disabledBoards = '(board ID|board ID|board ID)';
if(!location.href.match(new RegExp('board='+disabledBoards))) {
var td = document.getElementsByTagName('td');
for(i=0; i<td.length; i++) {
if(td.colSpan == '3' && td.innerHTML.match(/google_ad/i)
&& td.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('a')[1].className.match(allowedGroups) && td.innerHTML.match(/(\[html\](.+?)\[\/html\])/i)) {
var code = RegExp.$2.replace(new RegExp('&l'+'t;','g'),'<').replace(new RegExp('&g'+'t;','g'),'>').replace(/<(img src|(a|embed) href).+?<a.+?>(.+?)("|'|")?<\/a>(.+?>)/gi, '<$1=$3$5');
td.innerHTML = td.innerHTML.replace(/(\[html\](.+?)\[\/html\])/i, code);
i--;
}
}
}
//-->
</script>
Red: Here you should edit the group IDs of who can use HTML in their posts. By default, Admins are group 1, G-Mods are group 2, Mods group 3 etc. Seperate each group ID with a divider line | (Shift + \)
Blue: This is an optional feature to disable HTML in certain boards. For example, if you have a code database and don't want any codes there being called. List the Board IDs, each seperated by a divider | symbol.
To use the HTML, put [html]Code to be executed[/html] in your post
So some of you may be wondering what the point of this code is? Well it lets users use features that you can't usually do in UBBC code. For example, you could link to iFrames or use advanced tables.
Global or Board Footer:
<script type="text/javascript">
<!--
/* Allow HTML in Staff Posts
WARNING: Use with great caution!
The code creator will NOT be held responsible for any damage done by this code*/
var allowedGroups = /(1|2)$/;
var disabledBoards = '(board ID|board ID|board ID)';
if(!location.href.match(new RegExp('board='+disabledBoards))) {
var td = document.getElementsByTagName('td');
for(i=0; i<td.length; i++) {
if(td.colSpan == '3' && td.innerHTML.match(/google_ad/i)
&& td.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('a')[1].className.match(allowedGroups) && td.innerHTML.match(/(\[html\](.+?)\[\/html\])/i)) {
var code = RegExp.$2.replace(new RegExp('&l'+'t;','g'),'<').replace(new RegExp('&g'+'t;','g'),'>').replace(/<(img src|(a|embed) href).+?<a.+?>(.+?)("|'|")?<\/a>(.+?>)/gi, '<$1=$3$5');
td.innerHTML = td.innerHTML.replace(/(\[html\](.+?)\[\/html\])/i, code);
i--;
}
}
}
//-->
</script>
Red: Here you should edit the group IDs of who can use HTML in their posts. By default, Admins are group 1, G-Mods are group 2, Mods group 3 etc. Seperate each group ID with a divider line | (Shift + \)
Blue: This is an optional feature to disable HTML in certain boards. For example, if you have a code database and don't want any codes there being called. List the Board IDs, each seperated by a divider | symbol.
To use the HTML, put [html]Code to be executed[/html] in your post