April 19, 2024, 08:27:04 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

Global Announcements

Pages: [1]   Go Down
  Print  
Author Topic: Global Announcements  (Read 535 times)
0 Members and 1 Guest are viewing this topic.
Celebrus
Artificially Conscious
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 626



View Profile WWW
Badges: (View All)
Apple User
« on: May 02, 2009, 08:36:05 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:41:21 pm by Celebrus » Report Spam   Logged

Share on Facebook Share on Twitter

Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Search
« Reply #1 on: May 02, 2009, 10:36:08 am »

Now that's pretty simple and yet cool Smiley

Good job.
Report Spam   Logged


★вιησソ★
╚╡Processor╞╝
Starter
Starter
Offline Offline

Gender: Male
Posts: 19


I value two things. Truth and reason.


View Profile
Badges: (View All)
« Reply #2 on: July 03, 2009, 03:19:56 am »

Excellent. I was in need of this! Thank you very much, Celebrus.  Smiley
Report Spam   Logged
Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #3 on: July 03, 2009, 04:40:32 am »

Ahh never noticed this code!
Thx Cele
Report Spam   Logged






Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy