SMF For Free Support Forum
Signup For Free Forum
March 22, 2010, 07:29:11 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1]
  Print  
Author Topic: [Code] Global Announcements  (Read 1126 times)
0 Members and 1 Guest are viewing this topic.
Celebrus
SMF For Free Hero
*
Offline Offline

Posts: 941



View Profile WWW
« on: May 02, 2009, 08:34:18 am »

Preview is here: http://9861.smfforfree.com/index.php

I have two boards on that forum, the announcements show up in both.

First off, ensure you have this in your headers:
Code:
<script src="/jquery.js" type="text/javascript"></script>

This goes in your footers:
Code:
<script type="text/javascript">
// Edit after this line
var announcements = [
 ['Aetus Designs', 'http://aetus.net/'],
 ['RevolutionX', 'http://revolutionx.smfforfree3.com']
];
// Stop editing if you don't know what you are doing
/**
 * Global Announcements
 * http://aetus.net/
 * http://revolutionx.smfforfree3.com/
 *
 *  While there is NO warranty on this script unless you pay me a very large fee,  I will *TRY*
 *  to the best of my ability to help you out.
 *
 *  License: WTFPL (http://sam.zoy.org/wtfpl/)
 * 
 *  Feel free to remove this copyright notice, just visit those two sites listed above.
 *  Thanks for using this script.
 *
 */
(function($,topics){
  if(window.location.href.match(/board=/) || window.location.href.match(/board,/)){
    var html = '<tr><td class="titlebg2" colspan="7">Global Announcements</td></tr><tr><td class="windowbg2" colspan="7">';
    for(var i = 0;i<topics.length;i++){
      html += '<a href="' + topics[i][1] + '">' + topics[i][0] + '</a><br />';
    }
    html += '</td></tr><tr><td class="titlebg2" colspan="7">Regular Topics</td></tr>';
    $("div#bodyarea div.tborder table.bordercolor tbody tr td.catbg3:contains('Subject')").parent().after(html);
  }
})(jQuery, announcements);
</script>

You have to edit the first part of the script, the part before the copyright message. The part which looks like this:
Code:
var announcements = [
 ['Aetus Designs', 'http://aetus.net/'],
 ['RevolutionX', 'http://revolutionx.smfforfree3.com']
];

More specifically, the two lines in the center. Delete those two lines and add in your own lines like this:
Quote
['NAME OF THE TOPIC', '*FULL* URL TO THE TOPIC'],

Keep adding lines like that, and when you are done, remove the comma at the end of the last line.

As usual this has been tested on Firefox and Opera. (I realized that Epiphany uses Firefox's rendering engine so no point mentioning that.) If it doesn't on another browser let me know and I'll try to iron out the bugs.

That's it. If you have any problems with this let me know. Also, if you liked this code I'd appreciate it very very very much if you linked to my site(Aetus Designs) somewhere.
« Last Edit: May 03, 2009, 11:40:30 pm by Celebrus » Logged

Alex P.
SMF For Free Sponsors
*
Offline Offline

Posts: 781


x= -b +- √b^2-4(a)(c)/2a Know it? Pm me for a :)


View Profile
« Reply #1 on: May 04, 2009, 03:41:38 pm »

This is great! I might end up using this code on my forum!
Logged

Support FAQ|Style Index|Guides|Codes


Don't PM me for Support.
riley
SMF For Free Member
*
Offline Offline

Posts: 34



View Profile WWW
« Reply #2 on: May 04, 2009, 07:25:04 pm »

same as alex i might use it or i might not probably not though
Logged







please click eggs!!!!
valhalla95
SMF For Free Member
*
Offline Offline

Posts: 30


View Profile WWW
« Reply #3 on: May 05, 2009, 07:39:44 am »

hey, great code, it says you tested on FF and Opera? im going to test it real quick with Safari and IE

Safari:Success
IE: Success
Logged
Alex P.
SMF For Free Sponsors
*
Offline Offline

Posts: 781


x= -b +- √b^2-4(a)(c)/2a Know it? Pm me for a :)


View Profile
« Reply #4 on: May 05, 2009, 07:50:31 am »

FF is great  Wink

FireFox- Success
Logged

Support FAQ|Style Index|Guides|Codes


Don't PM me for Support.
B E N E L
SMF For Free Member
*
Offline Offline

Posts: 76



View Profile
« Reply #5 on: June 19, 2009, 10:55:45 am »

Meh cant u make it just go to all the boards? Cause i got over 20 topics\boards -.-... And once i saw tihs smf forum when u post in "announcemnt" topic it went out like announcents so when u want to homepage it was out there showing, so is there a code for that?
« Last Edit: June 19, 2009, 10:57:35 am by B E N E L » Logged

BEST RSPS CLICK SIG DL THE CLIENT Here Runelocus CLICK HERE JOIN!!
Seldom Fail
SMF For Free Sponsors
*
Online Online

Posts: 1483


Please feel free to email me ;)


View Profile WWW
« Reply #6 on: June 19, 2009, 03:56:50 pm »

Meh cant u make it just go to all the boards? Cause i got over 20 topics\boards -.-... And once i saw tihs smf forum when u post in "announcemnt" topic it went out like announcents so when u want to homepage it was out there showing, so is there a code for that?

I'm not sure what you're asking? Does this refer to this code at all?

I think what you are looking for is the EzPortal feature that announces when posts are made in a board.

Such as the announcement board. If you post something in that board it will appear in that block. (on the homepage)


To learn how to do this, see this guide: EZPortal Guide
       
Logged

If at first you fail... call it Vista, sell it, and hope that no one notices



My Blog Wink
B E N E L
SMF For Free Member
*
Offline Offline

Posts: 76



View Profile
« Reply #7 on: June 19, 2009, 03:59:28 pm »

Yes liked that, but it was on the main forums  Huh
Logged

BEST RSPS CLICK SIG DL THE CLIENT Here Runelocus CLICK HERE JOIN!!
Seldom Fail
SMF For Free Sponsors
*
Online Online

Posts: 1483


Please feel free to email me ;)


View Profile WWW
« Reply #8 on: June 19, 2009, 04:00:45 pm »

Read the guide I provided. It will tell you how to do that Wink
Logged

If at first you fail... call it Vista, sell it, and hope that no one notices



My Blog Wink
B E N E L
SMF For Free Member
*
Offline Offline

Posts: 76



View Profile
« Reply #9 on: June 25, 2009, 02:39:17 pm »

Thanks i got it how i wanted it works fine now Wink
Logged

BEST RSPS CLICK SIG DL THE CLIENT Here Runelocus CLICK HERE JOIN!!
Andrew
SMF For Free Sponsors
*
Offline Offline

Posts: 1574


Andrew At Your Service!


View Profile WWW
« Reply #10 on: June 25, 2009, 02:52:38 pm »

For above:
Opera: Success

Been using this code for a while, its really great! Nice job Cele!
Logged

Support Page


Click the banner to join me on Club Cooee!


Pages: [1]
  Print  
 
Jump to:  



Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
ServerBeach Coupon
Page created in 0.291 seconds with 15 queries. (Pretty URLs adds 0.041s, 2q)