* Just one quick note about working on this script... I tried to include the forum group where the post was added, but this proved to increase the page loading time too much and at least for my help site it messed up the CSS, so I removed it. I might look into this again at a later time.
<style type="text/css"> #recentPosts .ForumTitleHeaderCell { color: #0080ff; } #recentPosts .ForumTopicCountHeaderCell { width: 90px; } #recentPosts .ForumLastPostInfoHeaderCell { width: 150px; } #recentPosts th { text-align: left; } .page-number, .view-all { padding: 0 2px; cursor: pointer; color: #aaaaaa; } </style> <div id="rpContainer"> <div id="rpLoading" style="text-align:center"> <img src="http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/loading4.gif"><br> Loading </div> <table width="100%" style="display:none;" id="recentPosts"> <thead> <tr class="ForumCategoryHeader"> <th colspan="3" class="ForumCategoryHeader">Most Recent Posts</th> </tr> <tr> <th class="ForumTitleHeaderCell">Post Title</th> <th class="ForumTopicCountHeaderCell">Poster</th> <th class="ForumLastPostInfoHeaderCell sort-date sorted-asc">Posted</th> </tr> </thead> <tbody> </tbody> </table> </div> <div style="display:none;" id="preloadPosts"></div> <input type="hidden" style="display:none;" value="0" id="fgindex" /> <script type="text/javascript" src="http://www.axiomfiles.com/Files/258012/jquerysortpage.js"></script> <script type="text/javascript"> var showPostHeader = false; var recentPostsToDisplay = 20; // set to zero to display all found posts ( max = #forum groups x 25 ) var paginatePosts = true; var paginateLocationTop = true; // Set to true to place at top, false to add below var postsPerPage = 10; // number of posts to display when using paginate function ( paginatePosts must be true for this to work ) var forumURL = 'http://guildportal.com/Guild.aspx?GuildID=258012&TabID=2168224'; /******************************* Don't change anything below *******************************/ var recentPosts = new Array(); var forumGroups = new Array(); var tmp,ttile,tx,tdate,tlink,tposter; forumURL = forumURL.substring(forumURL.lastIndexOf('/Guild.aspx'),forumURL.length); $(document).ready(function(){ if ( $("div[id*='pnlMostRecent']").length || ( gup('TabID',forumURL) != gup('TabID',location.href) ) ) { $('#preloadPosts').hide('fast',loadForum); /* Load main forum page only if recent post box exists or it's not on forum page */ } }) function loadForum(){ $('#preloadPosts').load(forumURL + ' div[id*="ForumView"]',findGroups); } function findGroups(){ /* get URL for each forum group */ $('#preloadPosts .ForumTitleCell').each(function(){ tmp = $(this).find('a').attr('href'); tx = (tmp.match('#')) ? tmp.lastIndexOf('#') : tmp.length; forumGroups.push([tmp.substring(0,tx)]); }) /* search each forum group's first page for posts */ for (j=0; j < forumGroups.length; j++) { $('#preloadPosts').hide('fast',loadTopics(j)); } /* wait until all data is loaded into the table */ $("#preloadPosts").bind("ajaxComplete", function(){ var k = $('#fgindex').val(); k++; if (k>forumGroups.length){ sortme(); if (recentPostsToDisplay != 0) { $('#recentPosts tbody tr:gt(' + (recentPostsToDisplay-1) + ')').remove(); /* remove left over posts */ } if (paginatePosts) pageinate(); $('#recentPosts tbody tr:odd').addClass('AltGridRow'); $('#recentPosts tbody tr:even').addClass('NormGridRow'); if (!showPostHeader) $('#recentPosts tr.ForumCategoryHeader').remove(); /* hide header */ if ( $("div[id*='pnlMostRecent']").length ) { $("div[id*='pnlMostRecent']").html( $('#rpContainer').html() ); /* replace Most Recent Posts on Forums page */ $('#rpContainer').hide(); }; $('#rpLoading').hide(); $('#recentPosts').show(); /* show posts */ }; $('#fgindex').val(k); }); }; function loadTopics(j){ $('#preloadPosts').load(forumGroups[j] + ' div[id*="ThreadView"]',findTopics) } function findTopics(){ $('#preloadPosts').find('.NormGridRow,.AltGridRow').each(function(){ ttitle = $(this).find('.TopicTitleCell a').html(); tx = $(this).find('.TopicLastPosterCell'); tdate = tx.find('a:last-child').html(); tlink = tx.find('a:last-child').attr('href'); tx.find('a').remove(); /* strips out date so only the poster is left */ tposter = tx.text().replace(/ /,''); tmp = '<tr onclick="location.href=\'' + tlink + '\'"><td class="SmallDisplay"><a href="' + tlink + '">' + ttitle + '</a></td><td class="SmallDisplay">' + tposter + '</td><td>' + tdate +'</td></tr>'; $('#recentPosts').find('tbody').append(tmp); }) } function gup(name, myString) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( myString ); if( results == null ) return ""; else return results[1]; } </script>
#recentPosts .ForumTitleHeaderCell { color: #0080ff; } #recentPosts .ForumTopicCountHeaderCell { width: 90px; } #recentPosts .ForumLastPostInfoHeaderCell { width: 150px; } #recentPosts th { text-align: left; } .page-number, .view-all { padding: 0 2px; cursor: pointer; color: #aaaaaa; }
var showPostHeader = false;
var recentPostsToDisplay = 20;
var paginatePosts = true; var paginateLocationTop = true;
var postsPerPage = 10;
var forumURL = 'http://guildportal.com/Guild.aspx?GuildID=258012&TabID=2168224';