Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Homeland Security Advisory System v1.0 Details »»
Homeland Security Advisory System v1.0
Version: 1.00, by yoyoyoyo yoyoyoyo is offline
Developer Last Online: Sep 2008 Show Printable Version Email this Page

Version: 3.0.8 Rating:
Released: 07-29-2005 Last Update: 07-29-2005 Installs: 3
Template Edits
Additional Files  
No support by the author.

HOMELAND SECURITY ADVISORY SYSTEM
for vBulletin
version 1.0
by yoyoyoyo



OVERVIEW

This displays the current 'threat warning'' according to the United States Homeland Security Advisory System. The script visits the Homeland Security page to fetch the current threat level and then displays the approriate image to your visitors. The threat level is cached and is checked once every hour, or (or whenever a new visitor visits your page beyond that time). In other words: if nobody visits your page, then the image is not updated. You can have the threat alert appear on it's own page, below the "What's Going On' box on your forumhome, and also in your vBadvanced CMPS as a module. When someone clicks on the threat level image displayed below the "What's Going On" box or in the CMPS module then it will take them to a page that goes in to more detail about the Homeland Security Advisory System, including links and advice on what precautions to take. This page can also be accessed by a link in the navbar "quick links."

This mod uses a cgi script to retreive and cache the images in real time. This script visits whitehouse.gov, a US federal web site in order to retrieve the current threat level according to the Homeland Security Advisory System (HSAS). You can substitute whatever images you want for each of the alerts, just be sure to name them: elevated, guarded, high, low and severe and place them in the same folder as the cgi script.

There are 3 different image/cgi folders: 'advisory_main,' 'cmps,' and 'wol.' The 'advisory_main,' folder is where the script and images for advisory.php reside, the 'cmps' folder is where the vBadvanced CMPS module scripts and images reside, and 'wol' folder is where the forumhome "Who's Online' images and scripts reside.

BEFORE YOU INSTALL

make sure that your server supports perl scripts and that you have access to the cgi-bin directory via FTP. The CGI scripts require the Perl modules HTTP::Request and LWP; both are commonly installed on most hosts. If you do not have PERL then you can try running a free program called PerlSP found at:
Code:
http://2n-com.de/perlsp/
PerlSP provides an ASP/PHP/JSP like environment for Perl on all servers, dedicated or virtual, with everything that you expect from a web programming environment and before only knew from PHP or ASP.

EDIT THE SCRIPTS

At the very top of each cgi file you will see
Code:
#!/usr/bin/perl -wT
This must point to the Perl on your server. If you don't know it, ask your host or run info.cgi that comes included in the zip on your server to get it. In most cases #!/usr/bin/perl or #!/usr/bin/perl5 works OK.

That is the only thing you need to edit in the cgi files, unless you want the files to be cached more or less frequently than once every hour. If that is the case then open the advisory-caching.cgi script and look for this:
Code:
my $cache = new Cache::FileCache( { namespace => 'HomeLandCache',
									 expires_in => 3600, # 1 hour
									 max_size => 1048576,
									 filemode => 0666} );
change the value in
Code:
expires_in => 3600, # 1 hour
to however long you want it to be and 3600 refers to the number of seconds between caching the file.

UPLOAD THE FILES

Upload all of the file to their respective directories. Keep the structure of the files intact. If your server allows you to run cgi files from anywhere on your server, and you decide to change the directory that the 'advisory' folder will be uploaded to, then please remember to change the filepath in the 'advisory' template as well. 'advisory.php' is uploaded to your forum root directory, and the images are uploaded to the images directory of your forum. 'alert.gif' is uploaded to your images/misc directory. Obviously you do not need to upload the folder 'wol' if you do not intend to use the forumhome display, and you do not need to upload the 'cmps' folder if you do not intend to use the CMPS module. YOU DO NOT NEED TO UPLOAD THE FOLDER NAMED TEMPLATES.

Attached to this post are also a few "alternate" image sets. You can decide which set you want to use, or use the images that come with the install file. You do not need to download the "alternative images" if you want to use the default images.

CHMOD THE FILES

Using your FTP client CHMOD all of the folders, files and subdirectories in the 'advisory' folder to 755. 'chmod' or "change mode" is the UNIX way of changing file permissions. Basically CHMOD refers to setting the access privileges for a file, and you use an FTP client. Highlight the file that you want to change permissions for, and right click and select "Properties" or "Permissions" or "CHMOD" or "File Attributes" (depending on which FTP client you are using).


CREATE THE PHRASES

Go to your Admin Control Panel -> Languages & Phrases -> Phrase Manager -> Add New Phrase and add the phrases listed in the 'phrases.txt' file

CREATE THE TEMPLATES

Go to your Admin Control Panel -> Styles & Templates -> Style Manager and select 'Add New Template' from the drop-down selection menu. Create 2 new templates: 'advisory' and 'adv_portal_homeland' using the contents of each respective text file in the 'templates' folder, making sure that you name them exactly as mentioned, with no capitalization, etc.. NOTE: You do not need to add the 'adv_portal_homeland' template if you are not using vBAdvanced CMPS, or if you don't want the Homeland Security Advisory System module to appear.

EDIT THE FORUMHOME TEMPLATE

Go to your Admin Control Panel -> Styles & Templates -> Style Manager and select 'Edit Templates' from the drop-down selection menu. Then on the next screen click on the "<< >>" button to expand all of the templates, and scroll down to the "Forum Home Templates" and select 'forumhome' and click on the 'Customize' (or 'Edit') button. Make the changes noted in the 'forumhome' template by using the 'forumhome.txt' text file in the 'templates' folder (YOU ONLY NEED TO EDIT THE FORUMHOME TEMPLATE IF YOU WANT TO HAVE THE ADVISORY APPEAR ON THE FORUMHOME, JUST BELOW THE "WHAT'S GOING ON' BOX).

EDIT THE NAVBAR TEMPLATE

Go to your Admin Control Panel -> Styles & Templates -> Style Manager and select 'Edit Templates' from the drop-down selection menu. Then on the next screen click on the "<< >>" button to expand all of the templates, and scroll down to the "Navigation/Breadcrumb Templates" and select 'navbar' and click on the 'Customize' (or 'Edit') button. Make the changes noted in the 'navbar' template by using the 'navbar.txt' text file in the 'templates' folder included in this file. (YOU ONLY NEED TO EDIT THE NAVBAR TEMPLATE IF YOU WANT TO HAVE THE ADVISORY TO APPEAR AS A LINK ON THE NAVBAR, IN THE 'QUICK LINKS' DROPDOWN).

ACTIVATE THE CMPS MODULE

Go to your Admin Control Panel -> vBa CMPS -> Add Module -> TEMPLATE and add the following:
Code:
Module Title: Homeland Security
column: your choice (right or left)
Display Order: your choice
Active: Yes
Template to Include: adv_portal_homeland (the 'adv_portal_' part is already implied- only enter 'homeland')
Use Module Shell Template: No
leave the rest at default and setup your usergroup permissions and click 'Save'

That's it!

PLEASE CLICK INSTALL IF YOU FIND THIS USEFUL

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 07-30-2005, 12:06 AM
yoyoyoyo's Avatar
yoyoyoyo yoyoyoyo is offline
 
Join Date: Dec 2004
Location: USA
Posts: 1,612
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack could alternately be used by a forum that is somewhat liberal in it's political orientation to display your feelings about the Homeland Security Alert System. Attached to this post are examples of "liberal" type images (you can create your own- these are just to give you an idea).
Reply With Quote
  #3  
Old 07-30-2005, 03:26 AM
webslugger webslugger is offline
 
Join Date: Dec 2004
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well done.
Reply With Quote
  #4  
Old 07-30-2005, 04:34 PM
snyx's Avatar
snyx snyx is offline
 
Join Date: Oct 2001
Location: Vancouver (whistler.2010)
Posts: 556
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by webslugger
well done.
up here in Canada im just gunna leave my sting and bell to alert me to trouble. nice hack tho!
Reply With Quote
  #5  
Old 07-31-2005, 12:10 AM
bigcurt's Avatar
bigcurt bigcurt is offline
 
Join Date: Nov 2004
Location: KierDarby.php
Posts: 1,009
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ya know yoyo, I love your mods man..they crack me up everytime xD.

~Curt
Reply With Quote
  #6  
Old 07-31-2005, 12:21 AM
yoyoyoyo's Avatar
yoyoyoyo yoyoyoyo is offline
 
Join Date: Dec 2004
Location: USA
Posts: 1,612
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bigcurt
Ya know yoyo, I love your mods man..they crack me up everytime xD.

~Curt
Oh yeah- this hack is a barrel of laughs...
Reply With Quote
  #7  
Old 07-31-2005, 12:57 AM
EFairy's Avatar
EFairy EFairy is offline
 
Join Date: Nov 2002
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice idea!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:34 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04365 seconds
  • Memory Usage 2,273KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete