Post by Peter on Apr 11, 2007 9:35:48 GMT -8
A new version that will work with the new ad position under the first post. Due to the restrictions on modifying the source, it has had to be completely recoded.
Head and base images are supported just read the comments in the top of the script.
Add to your global footer.
<script type="text/javascript">
<!--
// Created by PopThosePringles
// Gap size between posts
var pv_sp_gap_size = 25;
// Head image URL
var pv_sp_head_img = "URL";
// Base image URL
var pv_sp_base_img = "URL";
var split_posts = {
head: '<div id="_head_" style="text-align: center"><img src="' + pv_sp_head_img + '" /></div>',
base: '<div id="_base_" style="text-align: center"><img src="' + pv_sp_base_img + '" /></div>',
gap: '<div style="height: ' + pv_sp_gap_size + 'px;"></div>',
html: "",
skip: false,
init: function(){
if(location.href.match(/=(display|userr|search2|recent)/i)){
this.html = '</table></td></tr></table>' + this.base + this.gap + this.head + '<table class="bordercolor" cellSpacing="0" cellPadding="0" width="100%"><tr><td><table cellSpacing="1" cellPadding="4" width="100%">',
this.split_them(RegExp.$1);
if(!document.attachEvent && !this.skip){
this.fix_poll();
}
}
},
to_node: function(str){
var span = document.createElement("span");
span.innerHTML = str;
return span;
},
split_them: function(l){
var rows = document.getElementsByTagName("tr");
var e = false, m, s = 0;
for(r = 0; r < rows.length; r ++){
var row = rows.item(r);
var cell = row.cells.item(0);
if(row.parentNode.parentNode.width == "92%" && row.innerHTML.match(/javascript:popWindow/i)){
row.parentNode.parentNode.id = "_main_table";
}
if(l.match(/(userr|recent|search2)/i)){
this.skip = true;
if(row.parentNode.parentNode.className == "bordercolor" && row.parentNode.parentNode.cellSpacing == 0){
if(s > 0){
var p = row.parentNode.parentNode;
var gap = (s == 1)? this.gap : "";
var head = this.to_node(gap + this.head);
var base = this.to_node(this.base);
p.parentNode.insertBefore(head, p);
p.parentNode.insertBefore(base, p.nextSibling);
}
s ++;
}
} else {
if(cell.width == "20%" && cell.className.match(/windowbg/i) && cell.innerHTML.match(/(member is|Guest)/)){
var p = cell.parentNode;
var c = document.createComment("_SPLITTER_");
if(!e){
var end;
if(p.parentNode.rows.item(p.parentNode.rows.length - 1).cells.item(0).className != "titlebg"){
end = p.parentNode.rows.item(p.parentNode.rows.length - 2);
} else {
end = p.parentNode.rows.item(p.parentNode.rows.length - 1);
}
end.parentNode.insertBefore(c.cloneNode(true), end);
e = true;
}
p.parentNode.insertBefore(c, p);
}
}
}
if(document.getElementById("_main_table") && !this.skip){
m = document.getElementById("_main_table");
m.parentNode.innerHTML = m.parentNode.innerHTML.replace(/<!--_SPLITTER_-->/g, this.html);
var cc = 0, ee = 0;
var divs = document.getElementsByTagName("div");
for(d = 0; d < divs.length; d ++){
if(divs.item(d).id.match(/_(base|head)_/i)){
if(cc == 0){
divs.item(d).style.display = "none";
}
cc ++;
e = d;
}
}
if(divs.item(e) && divs.item(e).id == "_head_"){
divs.item(e).style.display = "none";
}
}
},
fix_poll: function(){
var form = document.getElementsByTagName("form");
for(f = 0; f < form.length; f ++){
if(!form.item(f).elements.length){
var par = form.item(f).parentNode.parentNode;
var nform = form.item(f).cloneNode(false);
form.item(f).parentNode.removeChild(form.item(f));
while(par.hasChildNodes()){
nform.appendChild(par.firstChild);
}
par.appendChild(nform);
break;
}
}
}
}
split_posts.init();
//-->
</script>
Head and base images are supported just read the comments in the top of the script.
Add to your global footer.
<script type="text/javascript">
<!--
// Created by PopThosePringles
// Gap size between posts
var pv_sp_gap_size = 25;
// Head image URL
var pv_sp_head_img = "URL";
// Base image URL
var pv_sp_base_img = "URL";
var split_posts = {
head: '<div id="_head_" style="text-align: center"><img src="' + pv_sp_head_img + '" /></div>',
base: '<div id="_base_" style="text-align: center"><img src="' + pv_sp_base_img + '" /></div>',
gap: '<div style="height: ' + pv_sp_gap_size + 'px;"></div>',
html: "",
skip: false,
init: function(){
if(location.href.match(/=(display|userr|search2|recent)/i)){
this.html = '</table></td></tr></table>' + this.base + this.gap + this.head + '<table class="bordercolor" cellSpacing="0" cellPadding="0" width="100%"><tr><td><table cellSpacing="1" cellPadding="4" width="100%">',
this.split_them(RegExp.$1);
if(!document.attachEvent && !this.skip){
this.fix_poll();
}
}
},
to_node: function(str){
var span = document.createElement("span");
span.innerHTML = str;
return span;
},
split_them: function(l){
var rows = document.getElementsByTagName("tr");
var e = false, m, s = 0;
for(r = 0; r < rows.length; r ++){
var row = rows.item(r);
var cell = row.cells.item(0);
if(row.parentNode.parentNode.width == "92%" && row.innerHTML.match(/javascript:popWindow/i)){
row.parentNode.parentNode.id = "_main_table";
}
if(l.match(/(userr|recent|search2)/i)){
this.skip = true;
if(row.parentNode.parentNode.className == "bordercolor" && row.parentNode.parentNode.cellSpacing == 0){
if(s > 0){
var p = row.parentNode.parentNode;
var gap = (s == 1)? this.gap : "";
var head = this.to_node(gap + this.head);
var base = this.to_node(this.base);
p.parentNode.insertBefore(head, p);
p.parentNode.insertBefore(base, p.nextSibling);
}
s ++;
}
} else {
if(cell.width == "20%" && cell.className.match(/windowbg/i) && cell.innerHTML.match(/(member is|Guest)/)){
var p = cell.parentNode;
var c = document.createComment("_SPLITTER_");
if(!e){
var end;
if(p.parentNode.rows.item(p.parentNode.rows.length - 1).cells.item(0).className != "titlebg"){
end = p.parentNode.rows.item(p.parentNode.rows.length - 2);
} else {
end = p.parentNode.rows.item(p.parentNode.rows.length - 1);
}
end.parentNode.insertBefore(c.cloneNode(true), end);
e = true;
}
p.parentNode.insertBefore(c, p);
}
}
}
if(document.getElementById("_main_table") && !this.skip){
m = document.getElementById("_main_table");
m.parentNode.innerHTML = m.parentNode.innerHTML.replace(/<!--_SPLITTER_-->/g, this.html);
var cc = 0, ee = 0;
var divs = document.getElementsByTagName("div");
for(d = 0; d < divs.length; d ++){
if(divs.item(d).id.match(/_(base|head)_/i)){
if(cc == 0){
divs.item(d).style.display = "none";
}
cc ++;
e = d;
}
}
if(divs.item(e) && divs.item(e).id == "_head_"){
divs.item(e).style.display = "none";
}
}
},
fix_poll: function(){
var form = document.getElementsByTagName("form");
for(f = 0; f < form.length; f ++){
if(!form.item(f).elements.length){
var par = form.item(f).parentNode.parentNode;
var nform = form.item(f).cloneNode(false);
form.item(f).parentNode.removeChild(form.item(f));
while(par.hasChildNodes()){
nform.appendChild(par.firstChild);
}
par.appendChild(nform);
break;
}
}
}
}
split_posts.init();
//-->
</script>