NEW AtomFeed.php Program

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.

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

$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

$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

Tony,

This is your warning message

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");

To place the AtomArray.php file in the root, this needs to be set in the AtomFeed-config.php file

 $file_output = "../AtomArray.php";

Web pages will need the default setting include("AtomArray.php");

Got that done now.

Here’s what I have on my index page:

<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.

:lol: :lol: :lol: :lol:

I musta messed up one path or another Curly.

The Weather alert box was there for a sec now it’s gone.

The Weather alert box was there for a sec now it's gone.

Oh boy… the latest update should have fixed that.

SRY, That’s all set now.

I always have path issues. Always going down the wrong path. 8)

Next thing. Do I have to change all the paths in AtomFeed-config.php to put the files created
into the atomalerts folder I created? My atom feed hasnt updated since I ran atomalerts/AtomFeed.php manually.

$AdvisURL = "AtomZone.php"; // filename of your full detailed advisory page (CHMOD=664)

$AlertSummary = "AtomSummary.php"; // filename of your summary advisory page (CHMOD=664)

$file_output = "../AtomArray.php";  // filename of the main alert arrays (CHMOD=664)
                                    // (filename to be included in other pages)

$a_arrays = "../AtomWork.txt";     //  temp working file (CHMOD=664)
							 
$xmlFilename = "../LiveFeed.xml";   // filename for xml file (CHMOD=664)

$cache_folder = "../atomalerts/work/";  // folder to keep cache and data files - chmod to 775
Do I have to change all the paths in AtomFeed-config.php to put the files created into the atomalerts folder I created? My atom feed hasn't updated since I ran atomalerts/AtomFeed.php manually.

There are no settings in the AtomFeed-config.php file for updating. The settings place the files when updated.
If it hasn’t updated since you’ve manually ran the file, that means the cron job or the program to call the AtomFeed.php file, like the Windows Task Scheduler, doesn’t have the new path atomalerts/AtomFeed.php.
Check the file for the sub folder.

On my index page inside the alert box, Its not showing no advisories anymore. Any ideas or should I just let it go and see if it fixes itself? it was working this morning and i havent touched any of the files today.

There was an issue with this under certain conditions and I’ve updated the AtomFeed.php file and the AtomFeed-config.php file.
Update both files as described here http://discourse.weather-watch.com/p/339508

I’ve got 2 atomalerts folders now Rick. I think it was cause i had this path

$cache_folder = “…/atomalerts/work/”; // folder to keep cache and data files - chmod to 775

Which I changed now to just …/work

$AdvisURL = "AtomZone.php"; // filename of your full detailed advisory page (CHMOD=664)

$AlertSummary = "AtomSummary.php"; // filename of your summary advisory page (CHMOD=664)

$file_output = "../atomalerts/AtomArray.php";  // filename of the main alert arrays (CHMOD=664)
                                    // (filename to be included in other pages)

$a_arrays = "../atomalerts/AtomWork.txt";     //  temp working file (CHMOD=664)
							 
$xmlFilename = "../LiveFeed.xml";   // filename for xml file (CHMOD=664)

$cache_folder = "../work/";  // folder to keep cache and data files - chmod to 775

$icon_folder = '../images';	// folder for all icons. *Do not added trailing forward slash			   


Thanks Curly, that fixed it. Overlooked that update you posted.

Which I changed now to just ../work

I strongly discourage doing that. That put another sub folder in your root, cnyweather?/work, and is no longer connected with the cnyweather?/atomalerts folder.
You should not change the path to this folder by adding the dot dot. The option is there to change the name of the folder.

I changed back to $cache_folder = “/work/”; //

Havent had an update since 6:45 Rick

Glad you changed it back!

What type of program do you use to call the AtomFeed.php ?

I’m using a cron job every 10 minutes.

I just deleted everything and am starting from scratch now.

Here is a sample that runs every 10 minutes.
*/10 * * * * php -q /home/usern5/public_html/atomalerts/AtomFeed.php

I have something similar using GoDaddy.

I started from scratch and have lost the top warning box again.

I have the top warning box and no alert shows, just a small box

///////////////////////////////////////////////////////////////////////////////////////////////////////////
// DISPLAY OPTIONS

$use_headline = false;  // for XML link title   true= use long NWS headline  false=use short alert type

$titleA = "Area Weather Top Alerts";  // title for xml page

$timeFormat = 'D, M j, Y h:ia T';   //  'D, M j, Y h:ia T' = Tue, Jun 2, 2009 06:14pm TimeZone

$no_alert = "No warnings, watches, or advisories"; // Display this if there are no alerts
							
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ALERT BOX SET UP

$create_box = true;   //  true=create a box <div><table>  false= no box created, just alert messages

$aBox_Width = '645';     // width of box  examples - aBox_Width = '80%';  aBox_Width = '850px';  or smallest box  aBox_Width = '';

$link2details = true;  //  true=link to full detail page   false=link to summary page

$local_alerts = true;  // true=show primary location  false=show all locations 
// also when set to true, all alerts are displayed for the local location
// regardless if limit_topAlerts is set to true

$limit_topAlerts = false;  // true=display highest ranked alert for each code
                          // false=display all alerts for each code
						  
$always_show = false;  // true=display message if no alerts   false=display message only when alert is active
						  
$limit_NoAlerts = true;  // true=show 1 'no alert' message if always_show=true   
                        // false=show 'no alert' message for each code if always_show=true
						// *only if local_alerts=false

$line_break = true;      // 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 = true;  // true=color code background to first alert severity rating + change text to black
                            // false=no color code for the background, always use aBox_Color
						 
$aBox_Color = '#FFEEBB';  // background color of the alert box if create_box=true  examples  '#FFF'  '#FFEEBB'  'white'

$aBox_Border = '1';      // border size of alert box  0=no outline if create_box=true

$aBox_Icon = true;       // true=show icons in alert box   false=no icons in the alert box if create_box=true

I think I got it starting fresh. Have a warning showing now (poor Baltimore)
I’ll keep an eye on it now.

Whatever you did got it going. :smiley:

I ran the file to check the AtomWork file and it looks good.