Author Topic: Tide On Alt 6.95c Home Page  (Read 635 times)

0 Members and 1 Guest are viewing this topic.

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 325
Tide On Alt 6.95c Home Page
« on: July 16, 2020, 03:28:55 PM »
I am trying to get my Tides section to work. But it is not updating like it should. Not sure if I am missing something. The tideprediction.html is in the root directory.

This is the sections in altajaxdashboardconfig6 script.

Code: [Select]
$useLIGT   = false;           // set to true to show lightning counts when there is no snow on the ground.
                              // (if true, Lightning will over-ride TIDE display if more then $minLcnt (set below) is reached in 5 mins)
$useSNOW   = false;            // Normally always TRUE unless you want TIDE to Display. SNOW & TIDE CANNOT BE BOTH TRUE!!!
                              // Snow will over-ride the lightning section if you have snow on the ground.
$useTIDE   = true;           // Set to True to display TIDE information.
                              // Lightning will over-ride Tide.  SNOW & TIDE CANNOT BE BOTH TRUE!!!
$S3C2      = '2';             // Over-ride status:  If Lightning is TRUE, this allows Lightning to over-ride either Tide or Snow
                              // Set as follows:
                              // 0 = None Shows (All three previous setting are FALSE)
                              // 1 = Just Snow No Lightning over-ride (Snow must be set to TRUE)
                              // 2 = Just Tide No Lightning over-ride (Tide must be set to TRUE)
                              // 3 = Just Lightning (Lightning must be set to TRUE)
                              // 4 = Snow with Lightning Over-ride (SNOW and LIGHTNING must be set to TRUE)
                              // 5 = Tide with Lightning Over-ride (TIDE and LIGHTNING must be set to TRUE)

Code: [Select]
$tidefile = "tideprediction.html";//   Set the server path to your tideprediction.html file
$yearDate = "yes";//   If your tide dates include years (Monday 2008-09-10) change this to "yes"
//   You can convert "Rising & Falling" format to standard "High & Low"         //
//   by changing the following to "yes".                                        //
$convertRF = "no";
// timezone offset hours server time vs. tides time
$time_offset_next_tide = 0; // You may need different values here depending if your server is in a different timezone
if (isset($_REQUEST['sce']) && ( strtolower($_REQUEST['sce']) == 'view' or
        strtolower($_REQUEST['sce']) == 'show')) {
    //--self downloader --
    $filenameReal = __FILE__;
    $download_size = filesize($filenameReal);
    header('Pragma: public');
    header('Cache-Control: private');
    header('Cache-Control: no-cache, must-revalidate');
    header("Content-type: text/plain");
    header("Accept-Ranges: bytes");
    header("Content-Length: $download_size");
    header('Connection: close');

    readfile($filenameReal);
    exit;


This is the section in the ajax-dashboard6.php below

Code: [Select]
// The following function are for the TIDE module

function next_tide_info($tideinfo, $day) {
    global $time_offset_next_tide;
//$tideinfo = '  High Tide:  2049   6.0';
//make an array out of the string, split on the space char after removing multiple spaces
    $t_arr = explode(" ", preg_replace('/\s\s+/', ' ', trim($tideinfo)));

//print_r ($t_arr);
//Array ( [0] => High [1] => Tide: [2] => 2049 [3] => 6.0 )
// now time in seconds
    $time_now = (time() - ($time_offset_next_tide * (60 * 60)));

// get tide time in seconds.
    $t_hr = substr($t_arr[2], 0, 2);
    $t_min = substr($t_arr[2], -2);
    $t_time = strtotime(date("Y-m-d", $time_now + (86400 * $day)) . " $t_hr:$t_min:" . date('s'));

// next tide in minutes
    $t_diff = round(($t_time - $time_now) / 60);
    $next_t1 = array(
        "$t_diff" => strtolower($t_arr[0]),
    );
    return $next_t1;
}

// end function mins_to_next_tide

function round_tide_time($mins_to_next_tide) {

    if ($mins_to_next_tide <= 0)
        return 0;
    if ($mins_to_next_tide >= 360)
        return 360;

    //echo "mins_to_next_tide: $mins_to_next_tide<br>";

    $mins_to_next_tide = (round($mins_to_next_tide / 15) * 15);

    return $mins_to_next_tide;
}

// end function round_tide_time

global $nexttidequarter;

function select_tide_image($mins_to_next_tide, $high_or_low) {
    global $nexttidequarter;

    if ($high_or_low == 'high')
        $nexttidequarter = "High$mins_to_next_tide";
    if ($high_or_low == 'low')
        $nexttidequarter = "Low$mins_to_next_tide";

    if ($mins_to_next_tide <= 0)
        return $high_or_low . '_0.jpg';
    if ($mins_to_next_tide >= 360)
        return $high_or_low . '_360.jpg';
    return $high_or_low . '_' . $mins_to_next_tide . '.jpg';
}

// end function select_tide_image

function time_till_tide($time) {
    // takes a time diff like 6740 secs and formats to '1 hour, 52 minutes'
    $hrs = (int) intval($time / 3600);
    $time = (int) intval($time - (3600 * $hrs));
    $mns = (int) intval($time / 60);
    $time = (int) intval($time - (60 * $mns));
    $secs = (int) intval($time / 1);
    $hrs == 1 and $string .= "$hrs hour, ";
    $hrs > 1 and $string .= "$hrs hours, ";
    $string .= sprintf("%01d minutes", $mns);
    return $string;
}

function tide_data($numb) {
    global $tidefile, $yearDate, $convertRF;

    $tideD = implode('', file($tidefile));

    $time = time();

    // Get tide records by date, cut to length and split
    // If year is included in date
    if ($yearDate == "yes") {
        $tidedate = strstr($tideD, date("l Y-m-d", $time + (86400 * $numb)));
        $tideEnd = strpos($tideD, date("l Y-m-d", $time + (86400 * ($numb + 1))));
    } else {
        $tidedate = strstr($tideD, date("l m-d", $time + (86400 * $numb)));
        $tideEnd = strpos($tideD, date("l m-d", $time + (86400 * ($numb + 1))));
        //$tidedate = strstr($tideD, date("D m-d", $time + (86400 * $numb)));
        //$tideEnd = strpos($tideD, date("D m-d", $time + (86400 * ($numb + 1))));
    }
// The last tide will not show because it is not followed by a date. So we will
    // set the end possition to a fixed leangth
    if (!$tideEnd == false) {
        $tide = substr($tidedate, 0, $tideEnd);
    } else {
        $tide = substr($tidedate, 0, 280);
    }
    // Check if tides are in rising/falling format
    if (strstr($tide, "Rising")) {
        $risingFormat = "yes";
        //$tide = substr($tidedate, 0, $tideEnd);
    }
    $tide = explode("\n", $tide);
    // Check if sunrise info is included
    if (strstr($tide[1], "Sunrise")) {
        $tide = $tide[0] . "|" . $tide[3] . "|" . $tide[4] . "|" . $tide[5] . "|" . $tide[6] . "|" . $tide[7] . "|" . $tide[8] . "|" . $tide[9] . "|" . $tide[10];
        $tide = explode("|", $tide);
    } else {
        $tide = $tide[0] . "|" . $tide[1] . "|" . $tide[2] . "|" . $tide[3] . "|" . $tide[4] . "|" . $tide[5] . "|" . $tide[6] . "|" . $tide[7] . "|" . $tide[8];
        $tide = explode("|", $tide);
    }
    return $tide;
}

// eof minutes to next tide
// END OF ALL TIDE FUNCTIONS

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 910
    • North Bend Weather
Re: Tide On Alt 6.95c Home Page
« Reply #1 on: July 18, 2020, 05:38:20 PM »
Chuck, can you post a link to your site?
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam + Soil temp + Soil Moisture

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 910
    • North Bend Weather
Re: Tide On Alt 6.95c Home Page
« Reply #2 on: July 18, 2020, 05:43:34 PM »
Also,  did you set up wd in the tides section?
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam + Soil temp + Soil Moisture

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 325
Re: Tide On Alt 6.95c Home Page
« Reply #3 on: July 18, 2020, 06:58:17 PM »

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 910
    • North Bend Weather
Re: Tide On Alt 6.95c Home Page
« Reply #4 on: July 18, 2020, 07:28:00 PM »
Did you download the tide setup from WD? https://www.weather-display.com/files.php
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam + Soil temp + Soil Moisture

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 325
Re: Tide On Alt 6.95c Home Page
« Reply #5 on: July 18, 2020, 07:45:53 PM »
Yes I did. I extracted it to the display folder and created a shortcut to the desktop.

Chuck


Sent from my iPhone using Tapatalk

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 325
Re: Tide On Alt 6.95c Home Page
« Reply #6 on: July 18, 2020, 07:46:21 PM »
I meant wdisplay folder.


Sent from my iPhone using Tapatalk

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 910
    • North Bend Weather
Re: Tide On Alt 6.95c Home Page
« Reply #7 on: July 18, 2020, 07:48:43 PM »
Ok.... I'll take a closer look at my setup and get back to you.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam + Soil temp + Soil Moisture

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 325
Re: Tide On Alt 6.95c Home Page
« Reply #8 on: July 18, 2020, 07:53:19 PM »
Thanks I appreciate it.

Chuck

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 910
    • North Bend Weather
Re: Tide On Alt 6.95c Home Page
« Reply #9 on: July 19, 2020, 11:44:02 AM »
In your "Tide" setup in WD, I dont have "Create graph file" checked.

Also, In your Control panel in WD under Internet and file creation setup, do you have #34 set to create and upload?
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam + Soil temp + Soil Moisture

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 325
Re: Tide On Alt 6.95c Home Page
« Reply #10 on: July 19, 2020, 12:05:29 PM »
I have tried both the create graph checked and unchecked. Yes I have box 34 crates and upload files.

Chuck


Sent from my iPhone using Tapatalk

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 910
    • North Bend Weather
Re: Tide On Alt 6.95c Home Page
« Reply #11 on: July 21, 2020, 09:12:44 PM »
In your altdashboard6 settings, this is the only thing I noticed different compared to mine...

Code: [Select]
$yearDate = "no";//   If your tide dates include years (Monday 2008-09-10) change this to "yes"

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


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam + Soil temp + Soil Moisture

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 910
    • North Bend Weather
Re: Tide On Alt 6.95c Home Page
« Reply #12 on: July 21, 2020, 09:18:32 PM »
Your wxtide32.exe isn't running right? You just made your settings and then saved and closed it correct? Also, in your Wd folder, do you have these files?

WXTide32.cfg
WXtide32.cnt
WXTIDE32.HLP
WXTIDE47.INF
WXTSrc47.7z

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


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam + Soil temp + Soil Moisture

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 325
Re: Tide On Alt 6.95c Home Page
« Reply #13 on: July 21, 2020, 11:26:16 PM »
I will check those settings and files either tonight or in the morning.

Chuck


Sent from my iPhone using Tapatalk

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 325
Re: Tide On Alt 6.95c Home Page
« Reply #14 on: July 22, 2020, 12:25:56 PM »
I checked for those files in the wdisplay folder and I have all of them there. Plus my $yearDate is set to yes. I have my wxtide.php page working. It is just on the home page that it is not working.

Chuck

Offline staccermaccer

  • Senior Member
  • **
  • Posts: 67
    • Weather in Ekeren and Port of Antwerp
Re: Tide On Alt 6.95c Home Page
« Reply #15 on: September 13, 2020, 03:08:07 AM »
Hi,

Is your tideprediction.html-page uploading? You also should look if this option in your altajaxdashboardconfig is set:

Quote
//  NOTE:  The following are the TIDE specified in the code. 
//   

$tidefile = "tideprediction.html";//   Set the server path to your tideprediction.html file
$yearDate = "yes";//   If your tide dates include years (Monday 2008-09-10) change this to "yes"
//   You can convert "Rising & Falling" format to standard "High & Low"         //
//   by changing the following to "yes".                                        //
$convertRF = "no";

Hope this helps you out a bit!

Marc,