Author Topic: Creating sub directories in Carter Lake template  (Read 5830 times)

0 Members and 1 Guest are viewing this topic.

Offline MesquiteWx

  • Forecaster
  • *****
  • Posts: 610
    • Mesquite Weather
Creating sub directories in Carter Lake template
« on: July 27, 2008, 02:30:08 AM »
Hello, I am trying to create sub directories with the carter lake templates and for some reason it is not like it. For example I have the template installed in a dir called weather. Well I am making new templates for certain sections with different maps and I don't want to put them all under the weather folder so it will be easier to find these files and keep everything organized. So I created a I.E. a travel folder so it was not like this weather/travel. But when I try to make new pages in that folder it doesn't like it. All the include statements that are in the newpage template I have to use absolute paths because relative paths won't work. When I do set those and get no errors I get no nav menu, or header image etc. So is their a global setting I might be missing so I can make sub directories within the carter lake root?

Here is an example, I am using absolute paths for the includes but I can not get the navigation to show now both in the carter lake root and in the sub dirs. Here is an example of a page in a sub dir where the nav doesn't show. IN the sub dir the gizmo doesn't show ether.

http://www.mesquitechristmas.com/weather/travel/wxdelaysc.php

And on the home page in the root...

http://www.mesquitechristmas.com/weather/wxindex.php

-Thanks

« Last Edit: July 27, 2008, 03:26:59 AM by MesquiteXmas »

Offline MesquiteWx

  • Forecaster
  • *****
  • Posts: 610
    • Mesquite Weather
Re: Creating sub directories in Carter Lake template
« Reply #1 on: July 27, 2008, 04:44:43 AM »
OK well I made a temporary fix and copied the necessary files from the root into the new dir. Their has got to be an easier way though as this defeats the purpose  of having a sub dir to keep things clean. I used absolute paths from the new dir to the root and it worked to an extent. Normally in this manner just using relative path would work but it doesn't. So is their an easy way to do this so you can have files in a sub dir and not have to copy files to the new dir?

-Thanks

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Creating sub directories in Carter Lake template
« Reply #2 on: July 27, 2008, 05:29:52 PM »
The template set was designed to be simple for folks to install and configure as the primary site for their domain.  As such, it (as distributed) expects everything to be in the same directory as the wx....php pages with three exceptions:
1) the ajax-images/ directory contains the images needed for the wind-rose, conditions icons, moon/earth images and direction arrows.
2) the forecast/images/ directory contains all the NOAA-style forecast icons (used by advforecast2.php, WXSIM plaintext-parser.php and WU-forecast.php) and
3) (optional) the /GR3 directory for GRLevel3 radar images.

It's possible to relocate the template set to a subdirectory, but (as it says on the install page), you'll have to do multiple adjustments to make it work.

On my own site, I have several 'clones' of the template that use my real data (from my document root directory) by using symlinks to define the files needed .. that way, I don't have to copy the files into my subdirectory (or get WD to upload extra copies).

For example -- the following subdirectories use the stock code and data/graphic files from my main weather site

http://saratoga-weather.org/template/WD-Canada/wxindex.php
http://saratoga-weather.org/template/WD-USA/wxindex.php
http://saratoga-weather.org/template/WD-World/wxindex.php
http://saratoga-weather.org/template/WD-World-ML/wxindex.php

Here's the shell commands I execute in teach of the subdirectories to establish the links to my 'real' files:

Code: [Select]
ln -s ../../forecast forecast
ln -s ../../testtags.php testtags.php
ln -s ../../trends-inc.html trends-inc.html
ln -s ../../curr24hourgraph.gif curr24hourgraph.gif
ln -s ../../curr72hourgraph.gif curr72hourgraph.gif
ln -s ../../dirplot.gif dirplot.gif
ln -s ../../monthtodate.gif monthtodate.gif
ln -s ../../plaintext.txt plaintext.txt
ln -s ../../moonicon.gif moonicon.gif
ln -s ../../moondetail1.gif moondetail1.gif
ln -s ../../moondetail2.gif moondetail2.gif
ln -s ../../clientraw.txt clientraw.txt

I use the ajax-images/ directory in each directory, but the forecast/images directory really refers to my main /forecast/images directory instead (so there's not a lot of files to copy around).  Make sure you do a symlink instead of a hard-link (omitting the -s) .. that way the webserver goes automatically to the 'real' address of the file to fetch the current content.

For the wxhistory.php, I have to change the $website = '../../'; so it picks up the files in the document root.

This little trick only works on a *nix webserver, and you need shell access to the server to run the ln commands.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline MesquiteWx

  • Forecaster
  • *****
  • Posts: 610
    • Mesquite Weather
Re: Creating sub directories in Carter Lake template
« Reply #3 on: July 27, 2008, 08:49:37 PM »
Well the problem is not so much the images or the ajax images but connecting to the major files needed to display the template from a sub-dir and the menu. I have taken the wxnewpage.php and made new pages for my additional weather maps and information, etc. In normal php logic you could connect to a page that is in a dir in the root installation with a relative path. In this case it won't allow it. For example these files MUST be included in each file...

    require_once("Settings.php");
    require_once("common.php");
    include("top.php");
    include("header.php");
    include("menubar.php");
    include("footer.php");

Things are still simple even when creating a dir to place certain maps or areas of your site. This template doesn't come with a .ini file so their are no global settings so you can have sub dir. Normally if you had a files in a sub dir in the root you could connect to the other files like this.

     include("./top.php");

        Or

      include("/weather/top.php");

And that would allow you to connect to those files in the root from files in the sub dirs. For some reason I can not do this and not sure as to why. Is their another setting somewhere that would allow me to do this function?

For example here is a custom page I made with the wxnewpage.php for my Airport delays. Their are 8 separate files which is a lot so I included in the root so I put them in a sub dir to keep them all together.

http://www.mesquitechristmas.com/weather/travel/wxdelaysc.php

Problem is I have to include like 13 files from the root instead of doing just a relative connect in the include to the root dir. for those files. That is not so much a big deal I guess I can live with that if I have to even though it sucks. The big problem is if you look at the menu the that new dir. it inherits the dir name. It would be a real pain to have to edit 7-10 different flyout-xml files which can get tedious. So now we are back to how important it is to connect to files in the root with the include statement for situations like this. That way you only have to edit one file instead of like 7-10. Is their away around this?

-Thanks





Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Creating sub directories in Carter Lake template
« Reply #4 on: July 27, 2008, 09:41:39 PM »
I guess the underlying issue is that the template design was set to have all files in the same directory as the wx....php pages (with the subdirectories from there for the images) .. they weren't really designed to be directly relocatable to spread into subdirectories .. it was done that way to make it simple for novices to PHP and websites to easily set it up as their primary weather website.

What you're wanting to do is beyond the novice level, so in your case, you'll need to adapt the template set to allow it to transparently be used in subdirectories as you desire.

Even using relative addressing such as '../../top.php' to grab from document root for a page in /weather/travel may not work correctly unless you go through EACH page in the set and make the adjustments.  Like any other template set, if you want it to work differently, the code changes needed are on your initiative.

My advice is to use a flat navigation scheme (main pages in the document root) and avoid a lot of custom editing, but YMMV :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline MesquiteWx

  • Forecaster
  • *****
  • Posts: 610
    • Mesquite Weather
Re: Creating sub directories in Carter Lake template
« Reply #5 on: July 28, 2008, 02:18:49 AM »
I guess the underlying issue is that the template design was set to have all files in the same directory as the wx....php pages (with the subdirectories from there for the images) .. they weren't really designed to be directly relocatable to spread into subdirectories .. it was done that way to make it simple for novices to PHP and websites to easily set it up as their primary weather website.

That's the thing though, is I tired to leave the primary function files in the root and just make sub dir. I.E. weather/travel and putting all the new files I create for travel maps etc in that folder. Then weather/precip those precip maps etc in there and so on. It keeps from having 100+ files in the root so things are better organized. Now I tried to call the primary files needed listed in my last post with relative paths from the files in the sub dir to the root but it didn't work. In normal php logic that is suppose to work. Why it is not working I am not sure has to why. The overall layout yes is easy for novice people but being able to create sub dir is a novice function as well. The logic for the template was poorly layed out because those who would like to create sub dir can not. It could still be done and still keep it easy for beginners.

What you're wanting to do is beyond the novice level, so in your case, you'll need to adapt the template set to allow it to transparently be used in subdirectories as you desire.

I think you might not understand what I am trying to do

Even using relative addressing such as '../../top.php' to grab from document root for a page in /weather/travel may not work correctly unless you go through EACH page in the set and make the adjustments.  Like any other template set, if you want it to work differently, the code changes needed are on your initiative.

My advice is to use a flat navigation scheme (main pages in the document root) and avoid a lot of custom editing, but YMMV :)

That is what I am trying to say is I have tried something like this in files from a sub dir, '../../top.php' to call the required files from the root and it was not working. UGH, so I am trying to use a flat navigation system and have just one set of files in the root and have those files in the subs call those required files but it won't work unless a certain required files are in the subs also which then screws up the navigation because the navigation inherits that folder so you can not go back to another page. I.E. from a page in the root, if you go to lets say a file in travel. You mouse over home you will notice that the URL has not inherited the dir travel even though it is not set up that way. If you could call those files from the root and then just edit the one menu file in the root for the relative path to those files in subs then they wouldn't inherit the sub dir.

I can work around the relative issues with calling files in the root if I have to. But the navigation issue is something I can not work around with it doing the above mentioned. So that makes this template not very flexible. Don't get me wrong it is a great template but it has some bug and some cross browser compatibility issues as well. So is their anything I can do to work around this navigation issue if I can not call included files in the root from sub dir files?

-Thanks

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Creating sub directories in Carter Lake template
« Reply #6 on: July 28, 2008, 10:28:43 AM »
For the menu issue, you can change flyout-menu.xml to use full path addressing to the pages like this
Code: [Select]
<item caption="Display Home" link="/weather/index.html" title="Display Home Page"/>
<item caption="Live Weather" link="/weather/wxindex.php" title="Home Page"/>

<item caption="Radar">
<item caption="Local NEXRAD" link="/weather/wxgr3radar.php" title="NEXRAD Radar using GRLevel3"/>
<item caption="WU Radar/Maps" link="/weather/wxradar.php" title="Radar"/>
</item>
<item caption="Lightning" link="/weather/wxlightning.php" title="Realtime lightning tracking and data"/>

<item caption="Current Maps" title="Maps of Current Conditions">
<item caption="North Texas" link="/weather/currents/wxntweather.php" title="North Texas Weather Conditions"/>
<item caption="Texas" link="/weather/currents/wxtxweather.php" title="Texas Weather Conditions"/>
<item caption="National" link="/weather/currents/wxusweather.php" title="National Weather Conditions"/>

...
and that would fix the navigation issue you're seeing.  Don't forget to change footer.php to have any internal site links do the same thing.

"Cross browser compatibility issues"?  Would you please elaborate on what you're seeing? 
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline MesquiteWx

  • Forecaster
  • *****
  • Posts: 610
    • Mesquite Weather
Re: Creating sub directories in Carter Lake template
« Reply #7 on: July 28, 2008, 02:28:20 PM »
I know I can do that, but that is what I am trying to avoid because the way things are now I could have up to 5-6 or more flyout-menu.xml. Because in order to have sub dir I have to copy the necessary root files in the sub dir which is what I am trying to avoid and just one have single file in the root. I have found a way around the include issue and have that sorted. BUT It will not connect to the menu, I get errors finding the file when the file is there. So I would have to edit every single xml file in those sub dirs. every time I just add one link or more and that can get to be a pain. The xml menu is nice and all but why xml over a css menu?

Cross browser compatibility issues their are many. Just because the code might validate doesn't mean it is going to render the same in both browsers. Their are many but can be fixed easily which I will do once I get this set up I will re work the code and send it to you. Simple rewrites and IE exceptions will fix most of it. For starters though. Go look at the navigation in FF and then go look at it in IE, what's different.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Creating sub directories in Carter Lake template
« Reply #8 on: July 28, 2008, 04:33:19 PM »
The code used to find the flyout-menu.xml (in flyout-menu.php) is very simple
Code: [Select]
// ---------- settings ------------------------------
$MENUdef = './flyout-menu.xml'; // (relative) file location of XML menu definition file
$MENUdefTest = './flyout-menu-test.xml'; // (relative) file location of test XML menu definition file
$imagesDir = './ajax-images/';  // (relative) URL location of images dir (with trailing '/')
//
//
// ---------- end settings --------------------------
//  error_reporting(E_ALL); // for testing
//------------------------------------------------
// overrides from Settings.php if available
global $SITE;
if (isset($SITE['imagesDir'])) {$imagesDir = $SITE['imagesDir'];}
if (isset($SITE['menudef'])) {$MENUdef = $SITE['menudef'];}
if (isset($SITE['menudeftest'])) {$MENUdefTest = $SITE['menudeftest'];}
// end of overrides from Settings.php if available
and then
Code: [Select]
$usingAltXML = false;
if(isset($_REQUEST['menu']) and
   strtolower($_REQUEST['menu']) == 'test' and
   $MENUdefTest <> '' ) {
   
   $MENUdef = $MENUdefTest;
   $usingAltXML = true;
 }

$depth = array();
$MENU = array();
$MENUcnt = 0;
$lastDepth = 0;
$Status = "<!-- $Version -->\n";

// ------------- main routine --------------------
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElementFlyout", "endElementFlyout");
if (!($fp = fopen($MENUdef, "r"))) {
    die("could not open XML input from $MENUdef ");
}
to open the actual menu (allowing for the ?menu=test override

As you can see, it uses relative FILE addressing to find the menu.  If you want only ONE menu file for everything, then you can set the absolute FILE address for both the flyout-menu.xml and flyout-menu-test.xml in your Settings.php file with
Code: [Select]
$SITE['menudef'] = '/some/path/to/website/public_html/flyout-menu.xml'; // FULL path to menu definition file
$SITE['menudeftest'] = '/some/path/to/website/public_html/flyout-menu-test.xml'; // FULL path to test menu definition file

Having one XML file for the menu definition for the site also allows the wxsitemap.php page to show the current site structure (generated from the XML file). 

Perhaps you misunderstand about the flyout-menu .. it uses XML as the definition, but it creates a HTML/CSS menu on the fly, so the menu works irrespective of JavaScript being enabled in the browser.  The XML is only used by the flyout-menu.php to dynamically generate the needed CSS and HTML and uses the current Theme settings with the generated CSS.

I'm a bit surprised you've encountered browser incompatibilities with the rendering, as Mike Challis and I did many tests on as many browser types we could get our hands on.  I know the Flyout menu doesn't work with Netscape 7.1 (my oldest browser), but since that product is deprecated by AOL, shouldn't be a problem.

On my viewing with FF2, FF3, IE6, IE7, Opera 9 and Safari (windows), they behave as expected with IE6/IE7 not showing the border around the flyout menu, and all the other standards-compliant browsers showing it (FF, Opera, Safari).  Is that your concern?

IE6IE7

FF2FF3Opera 9.5Safari (Win)

When you do changes to your sites CSS to address inconsistencies, please do send along the changes to me.



Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline MesquiteWx

  • Forecaster
  • *****
  • Posts: 610
    • Mesquite Weather
Re: Creating sub directories in Carter Lake template
« Reply #9 on: July 28, 2008, 08:24:50 PM »
I don't have these lines in my Settings.php

Code: [Select]
$SITE['menudef'] = '/some/path/to/website/public_html/flyout-menu.xml'; // FULL path to menu definition file
$SITE['menudeftest'] = '/some/path/to/website/public_html/flyout-menu-test.xml'; // FULL path to test menu definition file

Maybe that could be causing the problems? What I meant by couldn't find the flyout-menu.xml I mean the file couldn't locate it from the sub dir after I have addressed and fixed the other issues with connecting to files in the root. If the file in the sub is able to connect to the root shouldn't it be able to find that file through the settings since that are both in the same folder?

http://www.mesquitechristmas.com/weather/test/wxtest.php

The files are definitely there though.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Creating sub directories in Carter Lake template
« Reply #10 on: July 28, 2008, 08:55:16 PM »
The $SITE vars I'd cited weren't in the setup instructions or the default Settings.php for any of the distributions.  I put the support in the flyout-menu.php code to help folks who wanted to do an override of some form.  As I say in the how the templates work page in "Caution #6"
Quote
As distributed, the template files are expected to be located in the document root of your website and the required subdirectories located below the document root. It is possible to use the templates from a subdirectory if the identical directory substructure is maintained and you continue to have URL and FILE relative addressing consistent (as it is now). You may be required to make additional changes that are not documented in the instructions if you wish to use the templates in a subdirectory.

Unless you change your Settings.php to have the full path information to the flyout-menu.xml and flyout-menu-test.xml, the flyout-menu.php will not work in any subdirectory below the one the main script is in (because the default setting is to use ./flyout-menu.xml .. meaning in the same directory the overall page is running in).  Try that change and see if it works for you.

I remembered why I'd abandoned the construction of the template set to allow arbitrary directory (and subdirectory) placement:  It was the issue of FILE path v.s. URL path construction for the parts.  Some of the scripts (like the advforecast2.php, plaintext-parser.php, ec-forecast.php and WU-forecast.php) rely on the mapping of relative FILE addressing is equal to relative URL addressing when finding PoP stamped images in the filesystem and generating the correct HTML for the <img> links.  In HTML/JavaScript '/' means the 'document root directory', but you can't use that for PHP file_exists(), since in PHP it's a FILE system address, not an URL address.  PHP on IIS systems (ugh!) use the Windows backslash file spec, while on *nix systems the forward slash is used as a directory designator.

My work on the GR3-radar-inc.php animator (PHP script to generate HTML+JavaScript) let me know that I really wanted nothing more to do with trying to make the templates 'generally flexible' for placement, so I'd included the caveat in the instructions to let folks know they would have their own work to do to bend the templates to a configuration outside what was outlined.  Hey, it's a free template, so it's a do it yourself project :)
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline MesquiteWx

  • Forecaster
  • *****
  • Posts: 610
    • Mesquite Weather
Re: Creating sub directories in Carter Lake template
« Reply #11 on: July 28, 2008, 09:48:02 PM »
Yea I know what you are saying. Don't take my frustrations personally as it is not intended that way. I really appreciate your help with this. I am on a serious time crunch and limited to how much I can work on this because come Friday I have to turn my attention to getting the Halloween and Christmas displays staged and ready for the season. So I won't have much time to get this set up and I want to have this ready for the 2008 season since it will be a new feature to the web site for 2008.

Here is my default Settings.php. Nothing has been removed or changed except for the necessary changes to make the template work. I don't see those lines you were referring to.

Code: [Select]
<?php
############################################################################
# A Project of TNET Services, Inc. and Saratoga-Weather.org (WD-USA template set)
############################################################################
#
# Project: Sample Included Website Design
# Module: Settings.php
# Purpose: Provides the Site Settings Used Throughout the Site
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
############################################################################
$SITE  = array();

# Automatic Info we might need
############################################################################
$SITE['REMOTE_ADDR'] $_SERVER['REMOTE_ADDR'];
$SITE['REMOTE_HOST'] $_SERVER['REMOTE_HOST'];
$SITE['WEBROOT'] $_SERVER['DOCUMENT_ROOT'];
$SITE['REQURI'] $_SERVER['REQUEST_URI'];
$SITE['SERVERNAME'] $_SERVER['SERVER_NAME'];

# Sitewide configuration
#
############################################################################
$SITE['charset'] 'ISO-8859-1'// character set for webpages (iso-8859-1=latin)
$SITE['CSSscreen'] './weather-screen-red-narrow.css'// 800px design
$SITE['CSSprint'] './weather-screen-red-narrow.css';
#
#$SITE['CSSscreen'] = 'weather-screen.css'; // Classic design
#$SITE['CSSprint'] = 'weather-print.css';

#############################################
# Mike Challis' Theme Switch configuration
$SITE['allowThemeSwitch']   = false;  // set to false to disable the the use of Theme Switcher 
$SITE['CSSscreenDefault'] = 'weather-screen-red-narrow.css';
$SITE['CSSwideOrNarrowDefault'] = 'narrow'// 'narrow' or 'wide'
#############################################
$SITE['flyoutmenu'] = true// set to false to use classic menubar.php instead

$SITE['clientrawfile'] './clientraw.txt';  // relative FILE location of clientraw.txt

# Configurable Carterlake/WD/PHP template Site Settings
############################################################################
$SITE['WXtags'] 'testtags.php';  // for testtags.php weather variables
$SITE['organ'] 'Mesquite Christmas Weather';
$SITE['copyr'] '&copy 2007-' date("Y",time()) . ' Mesquite Christmas, Your Live Mesquite, Texas Weather';
$SITE['remote'] "onclick=\"window.open(this.href,'_blank');return false;\"";
$SITE['tz' 'CST6CDT';  //NOTE: this *MUST* be set correctly to
// translate UTC times to your LOCAL time for the displays.
//  http://saratoga-weather.org/timezone.txt  has the list of timezone names
//  pick the one that is closest to your location and put in $ourTZ like:
//    $ourTZ = 'America/Los_Angeles';  // or
//    $ourTZ = 'Europe/Brussels';
$SITE['location']               = 'Mesquite, Texas';
$SITE['email'] 'mailto:webmaster@mesquitechristmas.com';
# Weather Station sensors
$SITE['UV'] false;  // set to false if no UV sensor
$SITE['SOLAR'] false;  // set to false if no Solar sensor
# Station location: latitude, longitude, cityname
$SITE['latitude'] '32.829927';    //North=positive, South=negative decimal degrees
$SITE['longitude'] '-96.648573';  //East=positive, West=negative decimal degrees
$SITE['cityname'] 'Mesquite';

# USA Specific settings
$SITE['noaazone' 'TXZ119'// used for NOAA advisories and advforecast2.php forecasts
$SITE['hurlURL'] "wxadvisory.php"// page to launch for details on NOAA advisories
#
#Forecast script settings area
#
$SITE['UVscript'] 'get-UV-forecast-inc.php'// worldwide forecast script for UV Index
// comment out above line to exclude UV forecast
//
# if you have WXSIM and plaintext-parser.php, set $SITE['WXSIM'] = true;
# to have the WXSIM forecast text appear in the dashboard along with your primary forecast org's
# forecast.  
$SITE['WXSIM'] false;  // Set to false if no WXSIM/plaintext-parser.php
$SITE['WXSIMscript'         = 'plaintext-parser.php'// script for decoding plaintext.txt into icons

# fcsturlNWS is the point-printable forecast URL from http://www.weather.gov/ (used by advforecast2.php)
$SITE['fcsturlNWS'] 'http://forecast.weather.gov/MapClick.php?CityName=Mesquite&state=TX&site=FWD&textField1=32.769&textField2=-96.5998&TextType=2';

$SITE['fcsticonsdir']           = './forecast/images/'// NOAA-style icons for NWS, WU, WXSIM forecast scripts
#
#---- in the following section, enable settings for ONE primary forecast organization
# pick which script AND org are to be used for your forecast here: (last uncommented pair will
#  be the ones used on the wxforecast.php page and in your dashboard and sidebar
$SITE['fcstscript'] 'advforecast2.php';  // USA-only NWS Forecast script
$SITE['fcstorg'] 'NWS';    // set to 'NWS' for NOAA NWS

#$SITE['fcstscript']         = 'plaintext-parser.php';    // WXSIM forecast (if only forecast script)
#$SITE['fcstorg'] = 'WXSIM';    // set to 'WXSIM' for WXSIM forecast

###########################################################################

# ajax-dashboard, ajax-sidebar settings (will override defaults in
#  the scripts themselves when included in this site
###########################################################################
$SITE['WDdateMDY'] = true// for WD date format of month/day/year.  =false for day/month/year
$SITE['uomTemp'] = '&deg;F';
$SITE['uomBaro'] = ' inHg';
$SITE['uomWind'] = ' mph';
$SITE['uomRain'] = ' in';
$SITE['uomDistance'] = ' miles';  // or ' km' -- used for Wind Run display
$SITE['uomPerHour'] = '/hr';
$SITE['imagesDir'] = './ajax-images/';  // directory for ajax-images with trailing slash
# note: date format used for PHP parts only.  Weather-Display dates are not processed
#   except on the astronomy page
$SITE['timeFormat'] = 'D, d-M-Y g:ia T';  // Day, 31-Mar-2006 6:35pm Tz  (USA Style)
//$SITE['timeFormat'] = 'm/d/Y g:ia';      // USA  format 03/31/2006 14:03
//$SITE['timeFormat'] = 'd/m/Y H:i';       // Euro format 31/03/2006 14:03
//$SITE['timeFormat'] = 'Y-m-d H:i';       // ISO  format 2006-03-31 14:03

$SITE['timeOnlyFormat'] = 'g:ia';          // USA format h:mm[am|pm\
#$SITE['timeOnlyFormat'] = 'H:i';          // Euro format hh:mm  (hh=00..23);
$SITE['dateOnlyFormat'] = 'd-M-Y';        // for 31-Mar-2008 or 'j/n/Y' for Euro format

# carterlake-radar settings (will override defaults in
#  the scripts themselves when included in this site
###########################################################################
$SITE['noaaradar'] 'FWS';    // LAST 3 characters of NOAA Radar Site ID
// e.g. Radar KMUX has $SITE['noaaradar'] = 'MUX';
$SITE['WUregion'] 'sp'; // Wunderground regional maps
// 'sw'=SouthWest, 'nw'=NorthWest, 'mw'=Midwest
// 'sp'=South Central, 'ne'=North East, 'se'=South East
$SITE['WUname1'] 'City Level'; // tooltip label for mode=1
$SITE['WUname2'] 'Dallas/Fort Worth'; // tooltip label for mode=2
$SITE['WUname3'] 'North Texas'; // tooltip label for mode=3
$SITE['WUname4'] 'South Central'; // tooltip label for mode=4
$SITE['WUname5'] 'Entire US'; // tooltip label for mode=5

###########################################################################
# GRLevel3 Radar image settings
$SITE['GR3radar'] 'kfws'; // set to lower-case full name of NEXRAD radar site
$SITE['GR3DIR'] '/weather/GR3' // set to directory for GRLevel3 images (or '.' for root directory
$SITE['GR3type'] 'br'; // radar image type 'cr','br','cr248','br1' etc.
$SITE['GR3img'] 'jpg'; // GR3 image type 'jpg' or 'png'
$SITE['GR3cnt'] 10; // number of images in series 10=(_0 ... _9 in name of file)
$SITE['GR3width'] 512; // width of GR3 images
$SITE['GR3height']  = 512; // height of GR3 images
$SITE['showradarstatus'] = true// set to false to suppress 'active' message

##########################################################################
# end of configurable settings
#
# set the Timezone abbreviation automatically based on $SITE['tzname'];
putenv("TZ=".$SITE['tz']);
$SITE['tzname'] date("T",time());
if(
$SITE['allowThemeSwitch']) {
  
# begin Color Theme Switcher Plugin by Mike Challis
  # http://www.carmosaic.com/weather/scripts.php
  
include_once('include-style-switcher.php');
  
$SITE['CSSscreen'] = validate_style_choice();
  
# end Color Theme Switcher Plugin
}
?>

Now the only code I could find relating to file paths for the flyout menu was in the flyout-menu.php was this....

Code: [Select]
// ---------- settings ------------------------------
$MENUdef = './flyout-menu.php'; // (relative) file location of XML menu definition file
$MENUdefTest = 'f./lyout-menu-test.xml'; // (relative) file location of test XML menu definition file
$imagesDir = './ajax-images/';  // (relative) URL location of images dir (with trailing '/')
//
//
// ---------- end settings --------------------------

Are those the ones your are referring to?

-Thanks

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Creating sub directories in Carter Lake template
« Reply #12 on: July 28, 2008, 10:00:51 PM »
I wouldn't change the flyout-menu.php script .. just add
Code: [Select]
$SITE['menudef'] = '/home/mesquit1/public_html/weather/flyout-menu.xml'; // FULL path to menu definition file
$SITE['menudeftest'] = '/home/mesquit1/public_html/weather/flyout-menu-test.xml'; // FULL path to test menu definition file
to the Settings.php file after the
Code: [Select]
$SITE['flyoutmenu'] = true; // set to false to use classic menubar.php instead
entry.  The entries weren't in the distributed Settings.php nor the online documentation .. I'd just put support for them in the flyout-menu.php (as distributed), so you need to add the entries as shown above to let the flyout-menu.xml be found (in the /weather/flyout-menu.xml ) irrespective of where the flyout-menu.php script is loaded (main or subdirectory).

Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline MesquiteWx

  • Forecaster
  • *****
  • Posts: 610
    • Mesquite Weather
Re: Creating sub directories in Carter Lake template
« Reply #13 on: July 29, 2008, 01:50:40 AM »
The entries weren't in the distributed Settings.php nor the online documentation ..

Gotcha, that locates the file now and works. For some reason it doesn't load the stylesheet though and it still inherits the sub dir. I will tackle this later when I have some more time. Right now I am just going to get all this online and probably just put everything in the root until after the Holidays when I have some more time to work on this and then clean everything up. It is almost there though. Thanks for your help!

Are you using the image resize script from Carter Lake by any chance? If you are I am running it and have it outputting the image and creating a new one. Problem is, it does not update the image when a new radar image becomes available. I have set all three images to 666 and even set up a cron to the run that file. If I call that file directly in the URL it will create a new image. Otherwise it does not so that is why I set up the cron but that doesn't do it ether. You know what might be causing this?

-Thanks

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9297
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Creating sub directories in Carter Lake template
« Reply #14 on: July 29, 2008, 02:01:03 AM »
The stylesheets are also expected to be in the same directory as the calling page .. another of those "there'll be issues trying to run in a subdirectory from the main site directory" things.  You'll have to change your Settings.php to have
an absolute URL address to the CSS file you've selected, like
Code: [Select]
$SITE['CSSscreen'] = '/weather/weather-screen-red-narrow.css';
$SITE['CSSprint'] = '/weather/weather-screen-red-narrow.css';
to have one copy of the CSS be used for all pages in subdirectories too.


I've not been using the CarterLake image resize.  I'm assuming your have the call for the PHP script inside an <img src="something.php" ... /> in order for the script to be invoked when the page if viewed .. I use that technique on similar scripts I have for the NOAA Image Of The Day.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP