* 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 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';
I'm attempting to add the this updated code to a new guild site, and am having a problem. Well, actually a few. First... for some reason adding a Free Form HTML Box using Firefox is a bit hosed. Or maybe it's just me. Who knows. Either way... I copy/paste the code you currently have listed into the widget edit box (in HTML mode), then save it. When I load the forum page, all I see is the working icon but the script never runs. I go back to the widget editor, and all the scripting is gone and only the HTML output remains. It's as if the editor box rendered the HTML mode then saved that rendered code, not the full HTML code. IE does not seem to have this problem. Second... I'm getting a javascript error from both Firefox and IE in the included jquery js file. IE Error Report Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322) Timestamp: Sat, 24 Oct 2009 05:06:47 UTC Message: 'type' is null or not an object Line: 2 Char: 6697 Code: 0 URI: http://www.guildportal.com/Cms/jquery.tablesorter.min.js Firefox Error Report Error: parsers is undefined Source File: http://www.guildportal.com/Cms/jquery.tablesorter.min.js Line: 2 URL of the Forum page I'm attempting to add this code to... http://drivenbydistraction.guildportal.com/Guild.aspx?PageName=Forums&GuildID=268085&TabID=2251152
Error: parsers is undefinedSource File: http://www.guildportal.com/Cms/jquery.tablesorter.min.jsLine: 2
<style type="text/css"> .tooltip, .preview, .screenshot { cursor:pointer; } #tooltip, #tooltip2, #preview, #screenshot { color:#dddddd; background:#222222; border: 1px solid #333333; padding:5px; display:none; opacity: 0.9; filter: alpha(opacity=90); text-align:left; border-radius: 1em; -moz-border-radius: 1em; -webkit-border-radius: 1em; } </style> <script src="http://www.axiomfiles.com/Files/258012/tooltip.js" type="text/javascript"></script>