Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Code Requests
  • Completed Requests
  • [Completed] [ZB] Code Request
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
[Completed] [ZB] Code Request
Tweet Topic Started: Oct 30 2009, 05:04 PM (318 Views)
Chase Oct 30 2009, 05:04 PM Post #1


Posts:
12
Group:
Member
Member
#3,541
Joined:
Oct 24, 2009
Coding language
None
Hey guys just so you know I didn't join this forum to request codes, so I will still be active. In other words I didn't just get the 10 posts to request this code. B)

Anyways... back to my request. This should be fairly easy.

You know how on ZetaBoard News Broadcast how they used to have the "Breaking News" section where they would have to manually update each news story on the index. For example, the current breaking news is as follows:

Quote:
 
Breaking News

James...Or Should I Say Shane?

October 21, 2009 In an investigative report by Zathyus News Broadcast Editor-in-Chief, Scotty, it was revealed that a once presumed dead member of the Zathyus Network is actually alive and faked his death. With this latest development having the community abuzz, read the full story below... Read More


Would it be possible to create a code that would automatically update this section on the index with every new topic posted in the specific news forum? All that would be updated is the topic name, date, and the first XX words in the post. Take your time and thanks. If you have any questions just pm me or post in here.

-Chase
Posted Image
Offline Profile Goto Top
 
Gorgor Oct 30 2009, 05:51 PM Post #2
Hello

Posts:
1,187
Group:
Former Staff
Member
#2,728
Joined:
Apr 2, 2009
Coding language
PHP
I'm not sure what it looked like on Zetaboards News Broadcast, but would it be like the Newest Code box we have here on ZBC? Would it only appear on the index page?

Also, this code will use a few ad credits every time it's viewed, is that ok?
Offline Profile Goto Top
 
Chase Oct 30 2009, 08:03 PM Post #3


Posts:
12
Group:
Member
Member
#3,541
Joined:
Oct 24, 2009
Coding language
None
What are ad credits?

The news would be at the top of every page, but im sure if it only showed up on the index it would be acceptable.. What does the newest code box do?
Posted Image
Offline Profile Goto Top
 
Gorgor Oct 30 2009, 08:20 PM Post #4
Hello

Posts:
1,187
Group:
Former Staff
Member
#2,728
Joined:
Apr 2, 2009
Coding language
PHP
Ad credits are if you have ad removal. If you do not have ad removal, then don't worry.

Add this in:
Code:
 
<script type='text/javascript'>
forum = "NEWS_FORUM_ID"
limit = "AMOUNT_OF_CHARACTERS_FOR_POST"

$(function(){
$("#main").prepend("<div class='meta_box' id='breaking_news'>Breaking news<br><br>Loading...</div>")
$.get(main_url+"forum/"+forum+"/1/?cutoff=100&sort_key=unix&sort_by=DESC", function(data){
topic = $("#inlinetopic .posts tbody tr td.c_cat-title:first", data);
topic_link = $(topic).children("a").attr("href");
topic_name = $(topic).children("a").html();
$.get(topic_link+"1/", function(data){
topic_post = $(".c_post:first", data).html();
if(topic_post.length > limit){
topic_post = topic_post.substring(0, limit)+"..."
}
a = "<strong>Latest news</strong><br><br><a href='"+topic_link+"'>"+topic_name+"</a><br><br>"+topic_post;
$("#breaking_news").html(a)
})
})
})
</script>
Offline Profile Goto Top
 
PIWYRCOM Oct 30 2009, 11:12 PM Post #5
Member Avatar
PrideInWhatYouRide

Posts:
368
Group:
Member
Member
#53
Joined:
Jul 17, 2008
Coding language
None
This works great !
Thanks
» TEST FORUM »
FIND IT HERE !
Spoiler: click to toggle

→ Infinite Results (themes)
→ ZBThemeZone (themes)

→ Big Boards (codes/themes)
→ ZBCodes (codes/themes)
→ The Coding Zone (codes/themes)

→ Code Index ('Official')
→ ZetaDoc's ('Official - How To Info')

Posted Image

Offline Profile Goto Top
 
Dorith Oct 31 2009, 01:43 AM Post #6
Member Avatar
Has just entered the Matrix

Posts:
2,069
Group:
Former Staff
Member
#1,854
Joined:
Dec 23, 2008
You're welcome.
See? We can read thoughts too. ;)

Your request has been completed, and we're moving it to the correct forum. We hope it works for you; if it doesn't, feel free to post another request topic in the requests forum. Just remember: read the rules first!

Thanks,
The ZBCode Staff
Posted Image
Posted Image
(Made emoticon using Codes Rock's Smiley Generator)
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Completed Requests · Next Topic »
Locked Topic

Track Topic · E-mail Topic Time: 2:27 PM Jul 11
Hosted for free by ZetaBoards · Privacy Policy