[BETA] Simple Weather Mod

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Anti-Spam Guide
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

[BETA] Simple Weather Mod

Post by keith10456 »

Modification Name: Simple Weather Mod
Author: keith10456

Modification Description: Adds a weather page to your phpBB website. The mod utilizes phpBB custom pages and the weather script from weatherforyou.com. Since the mod uses a phpBB custom page, the weather page will automatically posses the style that your Forum is using (including the overall_header).

Modification Version: 0.1.2

Requirements: Weather script from http://www.weatherforyou.com/snapshots/ ... e7day5.php

Features:
  • 7-Day Weather Forecast for your City
  • Utilizes phpBB Custom Pages (retains the phpBB style that is in use)
  • Displays "Who's Online" info
  • Subsilver support
  • Ability to edit colors of weather display (background and text) to match your website
  • Optional edit to make weather page for members only.

Demo URL: Click here for the demo.

Modification Download: Click here to download the mod.


Notice: As with any mod, before you install this mod be sure to make a back-up of your phpBB files and database (this mod does not make database changes).
Last edited by keith10456 on Mon Sep 07, 2015 6:15 pm, edited 8 times in total.
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [BETA] Simple Weather Mod

Post by keith10456 »

FREQUENTLY ASKED QUESTIONS

1 - I made all of the edits in the install instructions, uploaded the files and refreshed the templates, imagesets, and theme. Why don't I see the weather?
Ensure that you followed the "DIY Instructions" in the install file.


2 - Does this mod support subsilver2?
Yes.


3 - How do I restrict access to the weather page to logged in members only?
Open: root/weather.php

Find:

Code: Select all

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
After Add:

Code: Select all

if ($user->data['user_id'] == ANONYMOUS)
{
    login_box('', $user->lang['LOGIN']);
} 

4 - How do I increase the size of the weather image?
Open: root/styles/prosilver/template/weather.html

Find:

Code: Select all

width="500" height="200"
Change the width and height to your liking.


5 - Can I remove the link that's applied to the weather image?
No. Removing the link will violate the scripts terms of use.


6 - How do I make it so if someone click the weather forecast a new window is opened instead of them leaving my website?
Open: root/styles/prosilver/template/weather.html

Find:

Code: Select all

>
<img src=
Inline Find:

Code: Select all

>
Add Before:

Code: Select all

 target="_blank"
Open: root/styles/subsilver2/template/weather.html

Find:

Code: Select all

>
<img src=
Inline Find:

Code: Select all

>
Add Before:

Code: Select all

 target="_blank"

7 - Can I change the colors of the weather forecast?
Yes. Click here to enter your City and State. After you submit your info, you'll be given the option(s) to change the Background and Text color of the Weather Forecast.

Copy the updated weather forecast code.

Open: root/styles/prosilver/template/weather.html

Replace the old weather script code with the new one. The code begins with:

Code: Select all

<a href="http://www.weatherforyou.com
... And ends with:

Code: Select all

</a>

8 - Is this mod XHTML 1.0 Strict?
No. The phpBB custom page is but the weather script portion of the page isn't. Sorry I can't control that. Only the author of the script.


9 - How do I add this mod to a style other than prosilver?
For "prosilver" based styles, copy the "prosilver" folder in the download and rename it to the exact name of the style you're using.
  • Upload the copied folder to the following directory: yoursite.com/yourphpbb/styles/
  • In the install instructions, apply the edits for "overall_header.html", "stylesheet.css", "bidi.css", "buttons.css", and "colours.css" to the respective files of the style you're using.
  • Upload the edited file. Go to the ACP, select the "Styles" tab. Refresh your "Templates", "Themes" and "Imagesets".
For "subsilver" based styles, copy the "subsilver2" folder in the download and rename it to the exact name of the style you're using.
  • Upload the copied folder to the following directory: yoursite.com/yourphpbb/styles/
  • In the install instructions, apply the edit for "overall_header.html" to the "overall_header.html" file of the style you're using.

10 - How do I uninstall this mod?
Reverse the edits given in the install file. The edited files include:
  • yoursite.com/yourphpbb/includes/functions.php
  • yoursite.com/yourphpbb/language/en/common.php
  • yoursite.com/yourphpbb/styles/prosilver/template/overall_header.html
  • yoursite.com/yourphpbb/styles/prosilver/theme/stylesheet.css
  • yoursite.com/yourphpbb/styles/prosilver/theme/bidi.css
  • yoursite.com/yourphpbb/styles/prosilver/theme/buttons.css
  • yoursite.com/yourphpbb/styles/prosilver/theme/colours.css
  • yoursite.com/yourphpbb/styles/subsilver2/template/overall_header.html
Delete from your server:
  • yoursite.com/yourphpbb/weather.php
  • yoursite.com/yourphpbb/styles/prosilver/template/weather.html
  • yoursite.com/yourphpbb/styles/prosilver/theme/weather.css
  • yoursite.com/yourphpbb/styles/prosilver/theme/images/simple_weather_mod.png
  • yoursite.com/yourphpbb/styles/subsilver2/template/weather.html
  • yoursite.com/yourphpbb/styles/subsilver2/theme/images/simple_weather_mod.png

11 - How do I make the "Weather" link in the overall_header viewable to logged in members only?
Open: root/styles/prosilver/template/overall_header.html

Find:

Code: Select all

				<!-- SIMPLE WEATHER MOD BEGIN -->
				<li class="icon-swm"><a href="{U_SIMPLE_WEATHER_MOD_LINK}" title="{L_SIMPLE_WEATHER_MOD_LINK_EXPLAIN}">{L_SIMPLE_WEATHER_MOD_LINK}</a></li>
				<!-- SIMPLE WEATHER MOD END -->
Replace With:

Code: Select all

				<!-- SIMPLE WEATHER MOD BEGIN -->
            <!-- IF S_USER_LOGGED_IN -->
				<li class="icon-swm"><a href="{U_SIMPLE_WEATHER_MOD_LINK}" title="{L_SIMPLE_WEATHER_MOD_LINK_EXPLAIN}">{L_SIMPLE_WEATHER_MOD_LINK}</a></li>
            <!-- ENDIF -->
				<!-- SIMPLE WEATHER MOD END --> 
Open: root/styles/subsilver2/template/overall_header.html

Find:

Code: Select all

				<!-- SIMPLE WEATHER MOD BEGIN -->
				<a href="{U_SIMPLE_WEATHER_MOD_LINK}"><img src="{T_THEME_PATH}/images/simple_weather_mod.png" width="16" height="16" alt="*" /> {L_SIMPLE_WEATHER_MOD_LINK}</a>&nbsp; &nbsp;
				<!-- SIMPLE WEATHER MOD END -->
Replace With:

Code: Select all

				<!-- SIMPLE WEATHER MOD BEGIN -->
            <!-- IF S_USER_LOGGED_IN -->
				<a href="{U_SIMPLE_WEATHER_MOD_LINK}"><img src="{T_THEME_PATH}/images/simple_weather_mod.png" width="16" height="16" alt="*" /> {L_SIMPLE_WEATHER_MOD_LINK}</a>&nbsp; &nbsp;
            <!-- ENDIF -->
				<!-- SIMPLE WEATHER MOD END --> 

12 - What versions of phpBB is this mod compatible with?
The mod was tested on versions 3.0.8, 3.0.9 and 3.10.



13 - How do use this mod for International weather and/or Weather.com?
For international weather you can use the code from the Weather.com.

Install the mod the same way listed in the install instructions, except instead of using the code from the link in the mod instructions, use the code from weather.com
Last edited by keith10456 on Mon Jul 16, 2012 3:37 pm, edited 13 times in total.
User avatar
Meis2M
Translator
Posts: 1012
Joined: Wed Mar 03, 2010 11:32 am
Location: IR.Damghan
Name: میثم نوبری

Re: [BETA] Simple Weather Mod

Post by Meis2M »

very good keith10456 this mod is very nice and usefull for me. thank u
phpBB persian international support
Follow us in Instagram
Free upgrade and install extensions on your forum - drop me PM
Ultimate phpBB SEO Friendly URL extension
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [BETA] Simple Weather Mod

Post by keith10456 »

Meis2M wrote:very good keith10456 this mod is very nice and usefull for me. thank u
No problem ;)
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [BETA] Simple Weather Mod

Post by keith10456 »

I updated the Frequently Asked Questions list :idea:
User avatar
darkonia
Registered User
Posts: 1901
Joined: Tue May 13, 2008 1:10 pm
Location: Munich, Germany

Re: [BETA] Simple Weather Mod

Post by darkonia »

can you make a ucp option where members can define there city or zip for the weather display?
MMOG-Heaven - Das Gaming Portal
Community bedeutet Gleichgesinnte finden - MMOG-Heaven ist Deine Community! Von Spielern für Spieler bietet Dir dieses Portal genau das, was ein Spieler braucht. Bleibe ständig informiert, finde die neuesten MMORPGs, oder suche die frischesten News aus der Welt des Online Gamings - dieses und vieles mehr erwartet Dich auf MMOG-Heaven.
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [BETA] Simple Weather Mod

Post by keith10456 »

darkonia wrote:can you make a ucp option where members can define there city or zip for the weather display?
Unfortunately, no.

The weather image is generated by weatherforyou.com. I tried replacing the City and State in the script - as is what would happen if you had UCP variables - and it didn't work.
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [BETA] Simple Weather Mod

Post by keith10456 »

I updated the mod... Just a small language variable edit. If you already downloaded the mod, simply:

Open: yoursite.com/yourphpbb/styles/prosilver/template/weather.html

Find:

Code: Select all

{U_WEATHER_MOD_COPYRIGHT}

Replace With:

Code: Select all

{U_WEATHER_MOD_INFO}
Upload the edited file... Go to ACP, select the "Styles" tab. Refresh your "Templates".
User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: [BETA] Simple Weather Mod

Post by 4_seven »

First, awesome nice mod. Congrats to keith10456 :D
darkonia wrote:can you make a ucp option where members can define there city or zip for the weather display?
should be possibly. i take a look these days..
Current Mods | Mod Base | php(BB) programming | No help via PM
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [BETA] Simple Weather Mod

Post by keith10456 »

Thanks...

If you can do it I'll definitely add it to the mod :)
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [BETA] Simple Weather Mod

Post by keith10456 »

Subsilver2 support is in the works... ;)
Last edited by keith10456 on Mon Jun 20, 2011 3:44 pm, edited 1 time in total.
User avatar
boy_ofpersia
Registered User
Posts: 88
Joined: Sat Sep 13, 2008 5:58 pm
Location: Tehran, Iran
Name: Arman Pasayandeh

Re: [BETA] Simple Weather Mod

Post by boy_ofpersia »

Thank's bro! I tested it, just keep on a way. It's great.
"We tie knots & bind up words in double meanings, and then try to untie them"
--Seneca
User avatar
Terr0r
Registered User
Posts: 553
Joined: Thu May 05, 2011 3:39 pm
Location: The Netherlands

Re: [BETA] Simple Weather Mod

Post by Terr0r »

can I use this on my portal on my forum ?
if you can't fix it with ducktape you ain't using enough
if you want to search a MOD maybe you can find it here
For my MODS and BBCodes or other things that I have made take a look here
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [BETA] Simple Weather Mod

Post by keith10456 »

Terr0r wrote:can I use this on my portal on my forum ?
Can you add the weather page? Yes.

On another note, subsilver support should be available by the end of this weekend (God willing).
User avatar
keith10456
Registered User
Posts: 2315
Joined: Thu Feb 24, 2005 6:55 pm

Re: [BETA] Simple Weather Mod

Post by keith10456 »

Mod Updated To Beta Version 0.1.2

Update instructions are in the "contrib" folder of the download. The download link is in the 1st post of this topic. I also updated the FAQ post (2nd post in this topic).

  • Fixed/changed a number of language variables
  • Added subsilver2 support
  • Added link and icon to overall_header file
Enjoy :D [/b]

Return to “[3.0.x] MODs in Development”