How can I combine the replies & view columns?
Posted February 1st 2012, 12:52pm
Hello, I was wondering if it was possible to combine the replies & view columns. Something akin to Dion's brilliant example. I figured it would be along the same lines with different class names substituted.Is my hunch correct?

These are the columns I'm referring to by the way.
http://imageshack.us/photo/my-images/703/columns.png/
φ
Posts: 13
Joined: July 20th 2011, 11:00pm
Re: How can I combine the replies & view columns?
Posted February 1st 2012, 2:01pm
The technique is similar to what is done here: viewtopic.php?t=95

But I'm in a good mood today, because I just finished the most difficult part of a large project that has consumed most of my time for the past three months. So here is what you would need for an IPB2/Invision board:

var CopyrightNotice = 'Modified replies/views display for forumotion IPB2/Invision boards. Copyright © 2012 by Dion Designs. All Rights Reserved. Use and/or modification of this script is allowed, provided this entire copyright notice remains in the original or modified script. Distribution is not allowed without written consent from Dion Designs.';

$(function() {
    if (document.getElementById('info_open')) {
        x=$('.dropped').next().find('tbody tr').get();
        for (i = 0; i < x.length; i++) {
            var replies=x[i].childNodes[3].innerHTML;
            var views=x[i].childNodes[5].innerHTML;
            $(x[i].childNodes[2]).append('<div class="topicsposts" style="margin-top:3px;"><b>'+replies+'</b> Replies, <b>'+views+'</b> Views</div>');
            x[i].childNodes[3].className='blank';
            x[i].childNodes[5].className='blank';
            x[i].childNodes[3].innerHTML='';
            x[i].childNodes[5].innerHTML='';
        }

        x=$('.dropped').next().find('thead tr').get();
        for (i = 0; i < x.length; i++) {
            x[i].childNodes[2].className='ddforum';
            x[i].childNodes[3].className='blank';
            x[i].childNodes[4].className='ddauthor';
            x[i].childNodes[5].className='blank';
            x[i].childNodes[6].className='ddlastpost';
            x[i].childNodes[3].innerHTML='';
            x[i].childNodes[5].innerHTML='';
        }
    }
});

And here is the CSS you'll need:

table.ipbtable th.blank, table.ipbtable td.blank {width: 0px; padding: 0px; border: none;}
table.ipbtable th.ddforum {width: 56%;}
table.ipbtable th.ddauthor {width: 15%;}
table.ipbtable th.ddlastpost {width: 27%;}
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357

Who is online

Users browsing this forum: No registered users and 0 guests