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:
Locked Topic
[ C ] Post feed code update
Topic Started: Aug 6 2012, 02:48 PM (266 Views)
Deleted User
Deleted User

Board Address: http://thebeeandbarb.com/index/
Board Software: ZetaBoards
Description: I'm currently using the code below to display the newest post at the bottom of my board.

Code:
 
<script type="text/javascript">
// Adds a feed to the bottom of the forum with recent posts and topics
if (location.href.indexOf('/index') !== -1) {
$.get(main_url + 'stats/feed', function (data) {
$('#board_feed tr:lt(1)', data).insertAfter('#stats').wrapAll('<table id="board_feed" class="topic" style="margin: 10px 0" />');

$('#board_feed').prepend('<thead><tr><th colspan="2">Latest Forum Post & Topic</th></tr></thead>');
});
}
</script>


I was wondering if there's anyway to prevent posts that have been made in certain forums (e.g. staff only) from appearing in the feed?

Also, is there any way to prevent posts with images showing too?

Thanks!
Goto Top
 
Pk Magic Hat
Member Avatar
Irritating requester
[ *  * ]
I am using this for latest posts:

http://www.tierrahosting.com/latest-post.php?

You can put it anywhere you want. It will only show posts that are viewable by guests.
Instructions are on that page.

preview:
Posted Image
Edited by Pk Magic Hat, Aug 6 2012, 02:53 PM.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type="text/javascript">
function disableForum(forumID) {
if (location.href.indexOf('/index') !== -1) {
$.get(main_url + 'stats/feed', function (data) {
$('#board_feed', data).find('tr:not(:has(img), :has(a[href*="/forum/' + forumID + '"])):eq(0)').insertAfter('#stats').wrapAll('<table id="board_feed" class="topic" style="margin: 10px 0" />');
$('#board_feed').prepend('<thead><tr><th colspan="2">Latest Forum Post & Topic</th></tr></thead>');
});
}
}

disableForum('FORUM_ID');
</script>
Try that. Change FORUM_ID to the ID of a forum you wish to disable it for, and you may repeat that line to disable more forums.
Offline Profile Goto Top
 
Deleted User
Deleted User

Hey Cory

This doesn't seem to work for me :(
Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
It appears to work correctly on my test board, and on your board when running the code in Firebug: http://img585.imageshack.us/img585/73/235accc8ee4245418ade6a0.png
Offline Profile Goto Top
 
Deleted User
Deleted User

Ah of course it works! I was logged into an admin account which is why I could see it. I just made a test account and it shows the one posted before my test post in the staff forum.

Thanks for your help Cory!
Goto Top
 
Steve
Member Avatar
patriot
[ *  *  *  *  *  *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic