cloudy cloudy

Author Topic: NEW AtomFeed.php Program  (Read 62110 times)

0 Members and 1 Guest are viewing this topic.

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NEW AtomFeed.php Program
« Reply #30 on: December 18, 2009, 03:14:22 PM »
YUP

Thanks for the help Michael.
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,146
  • North Bend, WA
    • North Bend Weather
Re: NEW AtomFeed.php Program
« Reply #31 on: December 18, 2009, 04:29:28 PM »
Just for info Curly, i got mine all working the way i wanted too... Thanks again for the script.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NEW AtomFeed.php Program
« Reply #32 on: December 18, 2009, 04:32:55 PM »
How'd you get your "Weather Alert" box up there? I had it and lost it again.
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,146
  • North Bend, WA
    • North Bend Weather
Re: NEW AtomFeed.php Program
« Reply #33 on: December 18, 2009, 04:35:48 PM »
This is what Im using on my index page...

Code: [Select]

<?php
echo "<!-- AtomFeed Alert Box-->";
include(
"./atomalerts/AtomArray.php");
if(
$alert_box !== '') {
print 
'
<div>
<table border="0" cellspacing="0" cellpadding="0" style="width: 650px; margin: 0px auto 0px auto;">
<tr>
<td style="color: #FFFF99; background-color: #3AB; text-align: center">WEATHER ALERTS</td>
</tr>
<tr>
<td>'
.$alert_box.'</td>
</tr>
</table>
</div>'
;
}
echo 
"\n<!-- end AtomFeed Alert Box-->\n";
?>




"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NEW AtomFeed.php Program
« Reply #34 on: December 18, 2009, 04:41:59 PM »
Well that woulda fixed the width problem I had before. Didnt realize there
was  a width size within the code I have on my index page to print the warnings.

Except now I cant get the warning box and No Watches... to apear
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,146
  • North Bend, WA
    • North Bend Weather
Re: NEW AtomFeed.php Program
« Reply #35 on: December 18, 2009, 04:46:57 PM »
I noticed in your view source the code isnt there...all i see is the start and end tags of the script..

<!-- AtomFeed Alert Box-->
<!-- end AtomFeed Alert Box-->
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NEW AtomFeed.php Program
« Reply #36 on: December 18, 2009, 04:50:24 PM »
Hmmm.


If you go to http://www.cnyweather.com/atomalerts/AtomFeed.php, viewing the source,
that shows it's downloading the files. I'll see what I did wrong when Curly gets on


My AtomArray.php shows nothing in view source now.

I see Mark has his AtomArray in his atomalerts folder. Mine is just in my root
« Last Edit: December 18, 2009, 05:25:45 PM by cnyweather »
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Posts: 5,146
  • North Bend, WA
    • North Bend Weather
Re: NEW AtomFeed.php Program
« Reply #37 on: December 18, 2009, 05:55:16 PM »
Hmmm.


If you go to http://www.cnyweather.com/atomalerts/AtomFeed.php, viewing the source,
that shows it's downloading the files. I'll see what I did wrong when Curly gets on


My AtomArray.php shows nothing in view source now.

I see Mark has his AtomArray in his atomalerts folder. Mine is just in my root


Thats where the script put it by itself. Not really sure if that matters though. as long as you have your config file pointing to where ever it is.
"Nature can do without man, but man cannot do without nature."

Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NEW AtomFeed.php Program
« Reply #38 on: December 18, 2009, 06:18:09 PM »
Does the ../AtomArray.php mean that it isnt in the root folder, correct Mark?

Mine is in the root so I just changed it to just $file_output = "AtomArray.php

On the next cron job, i believe I will get an error on the site again.
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com

curly

  • Guest
Re: NEW AtomFeed.php Program
« Reply #39 on: December 18, 2009, 07:07:38 PM »
Does the ../AtomArray.php mean that it isnt in the root folder, correct Mark?

Mine is in the root so I just changed it to just $file_output = "AtomArray.php


The AtomArray.php is the data file that the web pages pull the information from and should be set to go into the root.
All of the web pages that are in the root use include("AtomArray.php"). Since the main AtomFeed files are in another folder, you need to use this setting:
$file_output = "../AtomArray.php";.   
If you omit off the ' ../ ', it will keep the AtomArray.php file in the sub folder and the include function for the web pages will not get the file and create an error.


Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NEW AtomFeed.php Program
« Reply #40 on: December 18, 2009, 07:09:59 PM »
I really screwed something up Curly

http://www.cnyweather.com/AtomZone.php returns Invalid zone or no zone entered in URL

If you wanna hack into my site, lemme know. I have an error on the main page now.
« Last Edit: December 18, 2009, 07:16:22 PM by cnyweather »
Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com

curly

  • Guest
Re: NEW AtomFeed.php Program
« Reply #41 on: December 18, 2009, 07:44:52 PM »
Fixed the issue with the Alert Box not displaying when $local_alerts is set to true and there were no local alerts but other alerts.
Both of these files need to be updated  AtomFeed.php and AtomFeed-config.php.
The AtomFeed.php file can be downloaded and then uploaded to the server in the sub folder. There are no user settings in this file. AtomFeed.php version 4

You can download the AtomFeed-config.php, or copy and paste it, or make this modification to your existing file.
Open AtomFeed-config.php and find this
Code: [Select]
$line_break = false;      // true=one alert per line if aBox_Width is used   false=fit multiple alerts on each line
                         // *if line_break=false AND aBox_Width has a value, icons are removed

Replace it with this
Code: [Select]
$line_break = false;      // true=one alert per line if aBox_Width is used   false=fit multiple alerts on each line
                         // *if line_break=false AND aBox_Width has a value, icons are removed

$colorCode_bckgrnd = false;  // true=color code background to first alert severity rating + change text to black
                            // false=no color code for the background, always use aBox_Color





An option was added to change the alert box background color to a severity rated color code. If the highest ranked alert is a warning, the background will be red or if it is a watch, the background will change to orange. All text will be black if this option is set to true and there is an alert.

Curly

curly

  • Guest
Re: NEW AtomFeed.php Program
« Reply #42 on: December 18, 2009, 07:51:39 PM »
Tony,

This is your warning message
Code: [Select]
Warning: include(../AtomArray.php) [function.include]: failed to open stream: No such file or directory in /home/content/c/n/y/cnyweather/html/index.php on line 60

That means it is looking in /cnyweather/ for the AtomArray.php file.  The AtomArray.php file is in the root along with your index page.
You will need to edit your index page and change this  include("../AtomArray.php");  to this   include("AtomArray.php");

curly

  • Guest
Re: NEW AtomFeed.php Program
« Reply #43 on: December 18, 2009, 07:56:10 PM »
To place the AtomArray.php file in the root, this needs to be set in the AtomFeed-config.php file
Code: [Select]
$file_output = "../AtomArray.php";
Web pages will need the default setting  include("AtomArray.php");

Offline CNYWeather

  • Professional Trophymaker!
  • Posts: 1,521
  • Rome, New York
    • CNYWeather.com
Re: NEW AtomFeed.php Program
« Reply #44 on: December 18, 2009, 07:57:07 PM »
Got that done now.

Here's what I have on my index page:

Code: [Select]
<div id="main-copy">
    
<?php
echo "<!-- AtomFeed Alert Box-->";
include(
"AtomArray.php");
if(
$alert_box !== '') {
print 
'
<div>
<table border="0" cellspacing="0" cellpadding="0" style="width: 625px; margin: 0px auto 0px auto;">
<tr>
<td style="color: #FFFF99; background-color: #3AB; text-align: center">WEATHER ALERTS</td>
</tr>
<tr>
<td>'
.$alert_box.'</td>
</tr>
</table>
</div>'
;
}
echo 
"\n<!-- end AtomFeed Alert Box-->\n";
?>

AtomArray.php is in my root. I'm gonna find a warning somewhere and add it to mine to see if the top box is working.

Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com