Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Renamed in error wxindex.php??? HELP!!!!! ?

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
User avatar
Intheswamp
Posts: 126
Joined: Sun 12 May 2013 5:35 am
Weather Station: Davis VP2+
Operating System: Windows XP SP3
Location: South Alabama, USA

Renamed in error wxindex.php??? HELP!!!!! ?

Post by Intheswamp »

I started from a local folder where all the Saratoga templates, files, and folders were stored. I uploaded from there to my web server. Since then I have used Filezilla to transfer files back and forth for editing. I've looked at, what is to me, a large number of files and they've begun to run together. Well, I was looking at another stations' index page and thought I'd compare it with mine. When I opened up the local copy of wxindex.php the code I found is shown below...it looks like an alerts file and not the index file. I downloaded the file off the web server and it was the same file. I then when back to the webpage and viewed the source code online...it looked more like a full index page. I copied that code down and saved it to a file. The website is still working using the odd wxindex.php file, but is this simply running from a cache and will quit working once the cache(?) is flushed? Should I replace the "small" wxindex.php file with the file I saved while viewing the source code? It all sounds crazy to me...or, it might be working right...reality is beginning to slip here. :o Thanks for your help, I really don't won't to lose what I've got put together so far!!! Ed

Code: Select all

<?php
############################################################################
# A Project of TNET Services, Inc. and Saratoga-Weather.org (Base-USA template set)
############################################################################
#
#   Project:    Sample Included Website Design
#   Module:     sample.php
#   Purpose:    Sample Page
#   Authors:    Kevin W. Reed <kreed@tnet.com>
#               TNET Services, Inc.
#
# 	Copyright:	(c) 1992-2007 Copyright TNET Services, Inc.
############################################################################
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
############################################################################
#	This document uses Tab 4 Settings
############################################################################
//Version 1.01 - 28-Jul-2012 - integrated support for nws-alerts scripts
require_once("Settings.php");
require_once("common.php");
############################################################################
$TITLE= $SITE['organ'] . " - Home";
$showGizmo = true;  // set to false to exclude the gizmo
include("top.php");
<<<<snipped by Ed for brevity>>>>>###
?>
ETA: The last sentence that I wrote was pertaining to the website and not my mental state...though my wife may argue the point... :roll:
Image
Davis VP2, v3.12
Cumulus v1.9.4 Build 1079
WU - KALRUTLE2 // PWS - BEEWEATHER // CWOP - EW2927 // Weather-Cam
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Renamed in error wxindex.php??? HELP!!!!! ?

Post by saratogaWX »

The main home page on the template set was named 'wxindex.php' for a simple reason -- if someone had an existing HTML or PHP website, there was likely a index.html or index.php existing, and calling it 'wxindex.php' just allowed them to configure the new template site while not disturbing the old site. It was expected that when they are ready for cutover, the instructions from the install page (near the bottom) would be used to fully implement the new template website
When you've decided that the new site is to be made 'live', then use these steps to have it become the primary display.

1. Rename (on your local disk) wxindex.php to index.php
2. Edit flyout-menu.xml for flyout-menu to replace wxindex.php with index.php in the link.
3. Upload flyout-menu.xml and index.php to your website.
There is not usually much customization of the [wx]index.php page so you can extract the default one from the Base-USA.zip and use it if you like. It does have code in it to activate the nws-alerts (or atom-advisory/atom-top-warning scripts) for the USA template set

Code: Select all

<?php
############################################################################
# A Project of TNET Services, Inc. and Saratoga-Weather.org (Base-USA template set)
############################################################################
#
#   Project:    Sample Included Website Design
#   Module:     sample.php
#   Purpose:    Sample Page
#   Authors:    Kevin W. Reed <kreed@tnet.com>
#               TNET Services, Inc.
#
# 	Copyright:	(c) 1992-2007 Copyright TNET Services, Inc.
############################################################################
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
############################################################################
#	This document uses Tab 4 Settings
############################################################################
//Version 1.01 - 28-Jul-2012 - integrated support for nws-alerts scripts
require_once("Settings.php");
require_once("common.php");
############################################################################
$TITLE= $SITE['organ'] . " - Home";
$showGizmo = true;  // set to false to exclude the gizmo
include("top.php");
############################################################################
?>
</head>
<body>
<?php
############################################################################
include("header.php");
############################################################################
include("menubar.php");
############################################################################
//
$useTopWarning = true;  // set to true to use only the rss-top-warning script
//                         set to false to use the rss-advisory script instead
?>

<div id="main-copy">
    
<?php // insert desired warning box at top of page

  if(isset($SITE['NWSalertsCodes']) and count($SITE['NWSalertsCodes']) > 0) {
	// Add nws-alerts alert box cache file
	include_once("nws-alerts-config.php");
	include($cacheFileDir.$aboxFileName);
	// Insert nws-alerts alert box
	echo $alertBox;
	?>
<script type="text/javascript" src="nws-alertmap.js"></script>
<?php
	  
  } else { // use atom scripts of choice
	if ($useTopWarning) {
	  include_once("atom-top-warning.php");
	} else {
	 print "      <div class=\"advisoryBox\">\n";
	 $_REQUEST['inc'] = 'y';
	 $_REQUEST['summary'] = 'Y';
	 include_once("atom-advisory.php");
	 print "      </div>\n";
	}
  }
?>
<div class="column-dark">
<div align="center">
  <br/>
  <table width="99%" style="border: none">
  <tr><td align="center">
    <img src="http://icons.wunderground.com/data/640x480/<?php echo $SITE['WUregion']; ?>_rd_anim.gif" alt="Regional Radar" width="320" height="240" style="margin: 0px; padding: 0px; border: none" />
  </td>
  <td align="center">
    <img src="http://icons.wunderground.com/data/640x480/<?php echo $SITE['WUregion']; ?>_ir_anim.gif" alt="Regional Infrared Satellite"  
      width="320" height="240" style="margin: 0px; padding: 0px; border: none" />
  </td>
  </tr>
  <tr><td colspan="2" align="center"><small>Radar/Satellite images courtesy of <a href="http://www.weatherunderground.com">Weather Underground</a>.</small></td></tr>
  </table>
	<img src="<?php echo $SITE['imagesDir']; ?>spacer.gif" alt="spacer"
	height="2" width="620" style="padding:0; margin:0; border: none" />
	<div align="center">
	<?php if(isset($SITE['ajaxDashboard']) and file_exists($SITE['ajaxDashboard']))
	 { include_once($SITE['ajaxDashboard']);
	   } else {
		print "<p>&nbsp;</p>\n";
		print "<p>&nbsp;</p>\n";
		print "<p>Note: ajax-dashboard not included since weather station not yet specified.</p>\n";
        for ($i=0;$i<5;$i++) { print "<p>&nbsp;</p>\n"; }
	}?>
    </div>
</div><!-- end center -->

</div><!-- end column-dark -->

</div><!-- end main-copy -->

<?php
############################################################################
include("footer.php");
############################################################################
# End of Page
############################################################################
?>
is the current USA wxindex.php page.

Best regards,
Ken
User avatar
Intheswamp
Posts: 126
Joined: Sun 12 May 2013 5:35 am
Weather Station: Davis VP2+
Operating System: Windows XP SP3
Location: South Alabama, USA

Re: Renamed in error wxindex.php??? HELP!!!!! ?

Post by Intheswamp »

Thanks Ken. I have the wxindex.php renamed to index.php and have edited the flyout-menu.xml to reflect that change.

The code that you've listed above is the code I receive when I download index.php via FTP from my web server. But when I view online the page source of http://www.beeweather.com/index.php it is a much larger file (when I copy the page source and paste it into Notepad++ it's 844 lines long!). Is this the dynamic aspect of PHP and the different xx.php files come together to "build" the index.php file that I see when I view the page source online? Which files would I use to alter the meta tags in the header in this file...such as keywords and even something as simple as replacing the <title>? I guess I'm having trouble understanding why the index.php I download via FTP is different from the one I see when I view the page source online...and how to edit parts of the page source version. :? I appreciate your patience with me as I must seem like a block of wood to you and my descriptions of things tend to be very inadequate. :oops:

Thanks,
Ed
Image
Davis VP2, v3.12
Cumulus v1.9.4 Build 1079
WU - KALRUTLE2 // PWS - BEEWEATHER // CWOP - EW2927 // Weather-Cam
User avatar
saratogaWX
Posts: 1238
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Renamed in error wxindex.php??? HELP!!!!! ?

Post by saratogaWX »

Intheswamp wrote:Thanks Ken. I have the wxindex.php renamed to index.php and have edited the flyout-menu.xml to reflect that change.

The code that you've listed above is the code I receive when I download index.php via FTP from my web server. But when I view online the page source of http://www.beeweather.com/index.php it is a much larger file (when I copy the page source and paste it into Notepad++ it's 844 lines long!). Is this the dynamic aspect of PHP and the different xx.php files come together to "build" the index.php file that I see when I view the page source online?
Yes, it is the dynamic aspect of PHP pages that what you see in FTP is never what you see when the page is loaded in the browser.
When PHP processes the .php page, by default, everything between a <?php and the next ?> is replaced by a 'null'(no characters), and so the only things that appear are those outside a <?php ... ?> pair OR whatever the PHP script itself uses 'print' or 'echo' to write to the HTML page. All that work is done on the webserver so the page seen by the browser is always fully processed with all the <?php...?> code executed and the raw code removed.
Intheswamp wrote: Which files would I use to alter the meta tags in the header in this file...such as keywords and even something as simple as replacing the <title>? I guess I'm having trouble understanding why the index.php I download via FTP is different from the one I see when I view the page source online...and how to edit parts of the page source version. :? I appreciate your patience with me as I must seem like a block of wood to you and my descriptions of things tend to be very inadequate. :oops:

Thanks,
Ed
Each template page is constructed by running a series of PHP scripts .. the order is shown at http://saratoga-weather.org/wxtemplates ... uction.php with the graphic view below.

All good questions, and I understand the confusion about FTP-view and HTTP-view. The former is 'raw' and the latter is 'processed' so they are very likely to be very different.

Meta tag changes generally go in top.php where they will appear on all pages in your website.

Best regards,
Ken
You do not have the required permissions to view the files attached to this post.
User avatar
Intheswamp
Posts: 126
Joined: Sun 12 May 2013 5:35 am
Weather Station: Davis VP2+
Operating System: Windows XP SP3
Location: South Alabama, USA

Re: Renamed in error wxindex.php??? HELP!!!!! ?

Post by Intheswamp »

Thanks for the clarification, Ken, I appreciate it. This response has been like pulling back a curtain for me...very insightful! I went and looked at the page source via the browser and <?php...?> is not to be seen! So I'm just seeing the "parsed" or "rendered" product of the multiple php files. Now that gives pause for thought! :)

I was just reading in the wiki you linked to about the top.php file not having a </head> but rather that each individual page has the </head> so that each page can be customized. That is cool!!!(ok, I admit it...I'm a product of the 70's<grin>).

It seems things are plugging along here nicely right now (until I go in an mess something up! :) ). I've got a question or two about inserting background images but I want to dig around a bit and see if I can figure it out. :D

Thanks for your patience, and your templates and scripts pages are great!!! (I've just gotta dig into'em more! ;) )

Ed
Image
Davis VP2, v3.12
Cumulus v1.9.4 Build 1079
WU - KALRUTLE2 // PWS - BEEWEATHER // CWOP - EW2927 // Weather-Cam
Post Reply