Welcome Guest [Log In] [Register]
Support Staff Recommendation
All communities remaining on zIFBoards/InvisionFree should check their conversion opt-in selection in their Admin CP (menu item Tapatalk Conversion)
(Read More)
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Multiquote (on) Multiquote (off)
Add Reply
Recent Updates Remade
Topic Started: Jun 20 2013, 11:54 AM (16,957 Views)
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code Name: Recent Updates Remade

What the code does: Preview

Xero originally created this code and it can be found here. The reason I remade it is because three of the tabs on his code are broken due to AJAX being restricted on those pages, ?force_ads isn't used, and the code performs 7 AJAX requests on every page load. This code performs no AJAX requests on page load and only performs the AJAX request when the tab is clicked. The AJAX clicks are only activated once so users won't keep jumping back and fourth through tabs for repetitious AJAX requests, after the data was successfully grabbed it's a simple show and hide process.

The Online Users tab is a new feature that wasn't introduced in Xero's code.

How to use the code: Install as instructed, no editing is required.

Put this below the code if you want to hide the Recent Updates table from guests:
Code:
 
<script type="text/javascript">
//<![CDATA[
if ($.zb.logged_in === false) {
$('#recent_updates').hide();
}
//]]>
</script>
How to install the code:

Admin CP Posted Image Themes Posted Image Board Template Posted Image Below the Board
Code:
 
<script type="text/javascript" src="http://z3.ifrm.com/63/1/0/p479384/Recent_Updates.js"></script>
Offline Profile Quote Post Goto Top
 
Replies:
Chelonian
Member
[ *  * ]
Yes. Hidden from those, thanks. And hidden from 'Replies to Your Topics' too.
Edited by Chelonian, Aug 24 2017, 05:18 PM.
Offline Profile Quote Post Goto Top
 
Chelonian
Member
[ *  * ]
Cory
Aug 14 2017, 03:01 PM
You need it to hide topics from those forums in the 'Board Feed' and 'Active Topics' tab?

Yes, I can add a blog tab for you.
Any updates on this?
Offline Profile Quote Post Goto Top
 
Chelonian
Member
[ *  * ]
Does cory not come here anymore?
Offline Profile Quote Post Goto Top
 
Chelonian
Member
[ *  * ]
Anyone alive out there?
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Try this instead:
Code:
 
<script type="text/javascript">
// By Cory
// http://s1.zetaboards.com/Cory/index/

var disabledFromForum = ['5015162', '5015163', '5016167', '5002983', '5023362'];

$('#main').prepend('<table id="recent_updates" style="margin: 10px 0"><thead><tr><th colspan="6" class="l">Recent Updates - <em id="reload" class="cu">Reload</em></th><tr></thead><tbody><tr><th id="feed" class="c cu">Board Feed</th><th id="status" class="c cu">Status Updates</th><th id="recent" class="c cu">Active Topics</th><th id="replies" class="c cu">Replies to Your Topics</th><th id="online" class="c cu">Online Users</th><th id="blogs" class="c cu">Blogs</th></tr><tr><td colspan="6" style="padding: 1px"><div id="recent_content" style="overflow: auto; height: 150px"><div id="message" class="c" style="font-style: italic; line-height: 150px">Please select an option</div></div></td></tr></tbody></table>');

$('em.cu, th.cu').css('cursor', 'pointer');

$('th.cu').css('width', '16.6%').click(function() {
$('th.cu').css('font-weight', '400');
$(this).css('font-weight', '700');
});

$('#feed').one('click', function() {
$.get(main_url + 'stats/feed/?force_ads', function(data) {
$('#recent_content').append('<table id="feed-table" class="topic"></table>');
$('#board_feed tr', data).each(function() {
if ($.inArray($(this).find('td.c_desc + td strong:eq(0) a:last').attr('href').split('/forum/')[1].split('/')[0], disabledFromForum) === -1) {
$('#feed-table').append(this);
$('#feed-table img').css('max-width', '500px');
}
});
});
});

$('#status').one('click', function() {
$.get(main_url + 'stats/status_updates/?force_ads', function(data) {
var html = $('#status_updates', data).html();
$('#recent_content').append('<table id="status-table" class="topic">' + html + '</table>');
});
});

$('#recent').one('click', function() {
$.get(main_url + 'search/?c=5&force_ads', function(data) {
$('#recent_content').append('<table id="recent-table" class="forums"></table>');
$('#search_results_topics + table.forums tr[class*="row"]', data).each(function() {
if ($.inArray($(this).find('td.c_cat-title:eq(1) a').attr('href').split('/forum/')[1].split('/')[0], disabledFromForum) === -1) {
$('#recent-table').append(this);
}
});
});
});

$('#replies').one('click', function() {
$.get(main_url + 'search/?c=6&force_ads', function(data) {
var html = $('#search_results_topics + table.forums', data).html();
$('#recent_content').append('<table id="replies-table" class="posts">' + html + '</table>');
});
});

$('#online').one('click', function() {
$.get(main_url + 'online/?force_ads', function(data) {
var html = $('#active_list tbody', data).html();
$('#recent_content').append('<table id="online-table"><tbody>' + html + '</tbody></table>');
$('#online-table td.c_foot').hide();
});
});

$('#blogs').one('click', function() {
$.get(main_url + 'stats/blogroll/?force_ads', function(data) {
var html = $('#blogroll tbody', data).html();
$('#recent_content').append('<table id="blogs-table" class="topic">' + html + '</table>');
});
});

$('th.cu').click(function() {
$('#recent_content table, #message').hide();
});

$('#feed').click(function() {
$('#feed-table').show();
});

$('#status').click(function() {
$('#status-table').show();
});

$('#recent').click(function() {
$('#recent-table').show();
});

$('#replies').click(function() {
$('#replies-table').show();
});

$('#online').click(function() {
$('#online-table').show();
});

$('#blogs').click(function() {
$('#blogs-table').show();
});

$('#reload').click(function() {
location.reload();
});

if ($.zb.logged_in === false) {
$('#replies').hide();
$('th.cu').css('width', '25%');
}
</script>
To hide the links from the 'Replies to Your Topics' tab, I'll need to know the names of the forum's instead of the forum ID.
Offline Profile Quote Post Goto Top
 
Chelonian
Member
[ *  * ]
Profile Comments
Mentions
Online
Quote Notifications
Like Notifications

Are the forum names.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Try this:
Code:
 
<script type="text/javascript">
// By Cory
// http://s1.zetaboards.com/Cory/index/

var disabledFromForum = ['5015162', '5015163', '5016167', '5002983', '5023362'];
var disabledFromForumN = ['Profile Comments', 'Mentions', 'Online', 'Quote Notifications', 'Like Notifications'];

$('#main').prepend('<table id="recent_updates" style="margin: 10px 0"><thead><tr><th colspan="6" class="l">Recent Updates - <em id="reload" class="cu">Reload</em></th><tr></thead><tbody><tr><th id="feed" class="c cu">Board Feed</th><th id="status" class="c cu">Status Updates</th><th id="recent" class="c cu">Active Topics</th><th id="replies" class="c cu">Replies to Your Topics</th><th id="online" class="c cu">Online Users</th><th id="blogs" class="c cu">Blogs</th></tr><tr><td colspan="6" style="padding: 1px"><div id="recent_content" style="overflow: auto; height: 150px"><div id="message" class="c" style="font-style: italic; line-height: 150px">Please select an option</div></div></td></tr></tbody></table>');

$('em.cu, th.cu').css('cursor', 'pointer');

$('th.cu').css('width', '16.6%').click(function() {
$('th.cu').css('font-weight', '400');
$(this).css('font-weight', '700');
});

$('#feed').one('click', function() {
$.get(main_url + 'stats/feed/?force_ads', function(data) {
$('#recent_content').append('<table id="feed-table" class="topic"></table>');
$('#board_feed tr', data).each(function() {
if ($.inArray($(this).find('td.c_desc + td strong:eq(0) a:last').attr('href').split('/forum/')[1].split('/')[0], disabledFromForum) === -1) {
$('#feed-table').append(this);
$('#feed-table img').css('max-width', '500px');
}
});
});
});

$('#status').one('click', function() {
$.get(main_url + 'stats/status_updates/?force_ads', function(data) {
var html = $('#status_updates', data).html();
$('#recent_content').append('<table id="status-table" class="topic">' + html + '</table>');
});
});

$('#recent').one('click', function() {
$.get(main_url + 'search/?c=5&force_ads', function(data) {
$('#recent_content').append('<table id="recent-table" class="forums"></table>');
$('#search_results_topics + table.forums tr[class*="row"]', data).each(function() {
if ($.inArray($(this).find('td.c_cat-title:eq(1) a').attr('href').split('/forum/')[1].split('/')[0], disabledFromForum) === -1) {
$('#recent-table').append(this);
}
});
});
});

$('#replies').one('click', function() {
$.get(main_url + 'search/?c=6&force_ads', function(data) {
$('#recent_content').append('<table id="replies-table" class="posts"></table>');
$('#search_results_topics + table.forums tr[class*="row"]', data).each(function() {
if ($.inArray($(this).find('td.c_cat-title:eq(1)').text(), disabledFromForumN) === -1) {
$('#replies-table').append(this);
}
});
});
});

$('#online').one('click', function() {
$.get(main_url + 'online/?force_ads', function(data) {
var html = $('#active_list tbody', data).html();
$('#recent_content').append('<table id="online-table"><tbody>' + html + '</tbody></table>');
$('#online-table td.c_foot').hide();
});
});

$('#blogs').one('click', function() {
$.get(main_url + 'stats/blogroll/?force_ads', function(data) {
var html = $('#blogroll tbody', data).html();
$('#recent_content').append('<table id="blogs-table" class="topic">' + html + '</table>');
});
});

$('th.cu').click(function() {
$('#recent_content table, #message').hide();
});

$('#feed').click(function() {
$('#feed-table').show();
});

$('#status').click(function() {
$('#status-table').show();
});

$('#recent').click(function() {
$('#recent-table').show();
});

$('#replies').click(function() {
$('#replies-table').show();
});

$('#online').click(function() {
$('#online-table').show();
});

$('#blogs').click(function() {
$('#blogs-table').show();
});

$('#reload').click(function() {
location.reload();
});

if ($.zb.logged_in === false) {
$('#replies').hide();
$('th.cu').css('width', '25%');
}
</script>
Offline Profile Quote Post Goto Top
 
Chelonian
Member
[ *  * ]
Getting this error message when I try to save it.

"This page isnít working

Chrome detected unusual code on this page and blocked it to protect your personal information (for example, passwords, phone numbers and credit cards).
Try visiting the site's homepage.
ERR_BLOCKED_BY_XSS_AUDITOR"
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Try this instead:
Code:
 
<script type="text/javascript">
// By Cory
// http://s1.zetaboards.com/Cory/index/

//<![CDATA[
var disabledFromForum = ['5015162', '5015163', '5016167', '5002983', '5023362'];
var disabledFromForumN = ['Profile Comments', 'Mentions', 'Online', 'Quote Notifications', 'Like Notifications'];

$('#main').prepend('<table id="recent_updates" style="margin: 10px 0"><thead><tr><th colspan="6" class="l">Recent Updates - <em id="reload" class="cu">Reload</em></th><tr></thead><tbody><tr><th id="feed" class="c cu">Board Feed</th><th id="status" class="c cu">Status Updates</th><th id="recent" class="c cu">Active Topics</th><th id="replies" class="c cu">Replies to Your Topics</th><th id="online" class="c cu">Online Users</th><th id="blogs" class="c cu">Blogs</th></tr><tr><td colspan="6" style="padding: 1px"><div id="recent_content" style="overflow: auto; height: 150px"><div id="message" class="c" style="font-style: italic; line-height: 150px">Please select an option</div></div></td></tr></tbody></table>');

$('em.cu, th.cu').css('cursor', 'pointer');

$('th.cu').css('width', '16.6%').click(function() {
$('th.cu').css('font-weight', '400');
$(this).css('font-weight', '700');
});

$('#feed').one('click', function() {
$.get(main_url + 'stats/feed/?force_ads', function(data) {
$('#recent_content').append('<table id="feed-table" class="topic"></table>');
$('#board_feed tr', data).each(function() {
if ($.inArray($(this).find('td.c_desc + td strong:eq(0) a:last').attr('href').split('/forum/')[1].split('/')[0], disabledFromForum) === -1) {
$('#feed-table').append(this);
$('#feed-table img').css('max-width', '500px');
}
});
});
});

$('#status').one('click', function() {
$.get(main_url + 'stats/status_updates/?force_ads', function(data) {
var html = $('#status_updates', data).html();
$('#recent_content').append('<table id="status-table" class="topic">' + html + '</table>');
});
});

$('#recent').one('click', function() {
$.get(main_url + 'search/?c=5&force_ads', function(data) {
$('#recent_content').append('<table id="recent-table" class="forums"></table>');
$('#search_results_topics + table.forums tr[class*="row"]', data).each(function() {
if ($.inArray($(this).find('td.c_cat-title:eq(1) a').attr('href').split('/forum/')[1].split('/')[0], disabledFromForum) === -1) {
$('#recent-table').append(this);
}
});
});
});

$('#replies').one('click', function() {
$.get(main_url + 'search/?c=6&force_ads', function(data) {
$('#recent_content').append('<table id="replies-table" class="posts"></table>');
$('#search_results_topics + table.forums tr[class*="row"]', data).each(function() {
if ($.inArray($(this).find('td.c_cat-title:eq(1)').text(), disabledFromForumN) === -1) {
$('#replies-table').append(this);
}
});
});
});

$('#online').one('click', function() {
$.get(main_url + 'online/?force_ads', function(data) {
var html = $('#active_list tbody', data).html();
$('#recent_content').append('<table id="online-table"><tbody>' + html + '</tbody></table>');
$('#online-table td.c_foot').hide();
});
});

$('#blogs').one('click', function() {
$.get(main_url + 'stats/blogroll/?force_ads', function(data) {
var html = $('#blogroll tbody', data).html();
$('#recent_content').append('<table id="blogs-table" class="topic">' + html + '</table>');
});
});

$('th.cu').click(function() {
$('#recent_content table, #message').hide();
});

$('#feed').click(function() {
$('#feed-table').show();
});

$('#status').click(function() {
$('#status-table').show();
});

$('#recent').click(function() {
$('#recent-table').show();
});

$('#replies').click(function() {
$('#replies-table').show();
});

$('#online').click(function() {
$('#online-table').show();
});

$('#blogs').click(function() {
$('#blogs-table').show();
});

$('#reload').click(function() {
location.reload();
});

if ($.zb.logged_in === false) {
$('#replies').hide();
$('th.cu').css('width', '25%');
}
//]]>
</script>
Offline Profile Quote Post Goto Top
 
Chelonian
Member
[ *  * ]
This page isnít working

Chrome detected unusual code on this page and blocked it to protect your personal information (for example, passwords, phone numbers and credit cards).
Try visiting the site's homepage.
ERR_BLOCKED_BY_XSS_AUDITOR

Again. :/
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Copying and pasting the exact same code to my board, I don't receive that error.

Try hosting the script externaly.
Offline Profile Quote Post Goto Top
 
Chelonian
Member
[ *  * ]
I tried Firefox instead but now the forum is telling me:

Error: You may only have 20,000 characters total in your template.
You have used: 21342 characters.
Error Code: 68014:8000037
I tried hosting it via the forum like I had done for a different code but it hasn't changed anything.

<script type="text/javascript" src="http://b3.ifrm.com/40000/37/0/f7033011/recentupdates.js"></script> is what I put in below the board.
Edited by Chelonian, Dec 6 2017, 03:44 AM.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Remove the two script tags from the external file.
Offline Profile Quote Post Goto Top
 
Chelonian
Member
[ *  * ]
Did that. Doesn't show at all now.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Link me to your new file.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply