tplt_fill("FTP_MSG",$msg); flush(); } if ( $page->tplt_analyzed ) { $foot = default_footer(); $page->tplt_fill("DEFAULTHEADER",default_header(),"DEFAULTFOOTER",$foot); //if ( $page->isTag("STATUS") ) $page->tplt_fill( "STATUS", $page->tplt_snap_status() ); if ( LOCALSERVER ) { return_formlib_output(); foreach ( $ini as $boat=>&$item ) { if ( $item==1 ) $item = TRUE; } $page->tplt_fill("LOCAL_CONTROL", src_jscript("syslib.js")); $page->tplt_fill("LOCAL_CONTROL", stprint_styles()); $page->tplt_fill("LOCAL_CONTROL", open_form("form",null, 'style="border:2px solid ; margin: 10px 200px 10px 200px;"', 'class=bg_wht') . PHP_EOL); $page->tplt_fill("LOCAL_CONTROL", input_button("refresh","Refresh","form" ) . PHP_EOL); $page->tplt_fill("LOCAL_CONTROL", input_button("upload","FTP Upload","form") . PHP_EOL); $page->tplt_fill("LOCAL_CONTROL", input_button("remote","Remote", "http://" . REMOTESITE . "/" . SELF) . PHP_EOL ); $page->tplt_fill("LOCAL_CONTROL", runEditor( $inifile, BUTTON, "Edit Ini File" ) . PHP_EOL ); $page->tplt_fill("LOCAL_CONTROL", sdisplay_wrapper("Show Ini Array") . stprint_array( $ini, "Ini Array" ) . sdisplay_wrapper() . PHP_EOL ); $page->tplt_fill("LOCAL_CONTROL", close_form() . PHP_EOL); } elseif ( $startup_debug ) { $page->tplt_fill("INIFILE_SHOW", stprint_array_b( $ini, "Show Ini Array", $inifile ) ); } if ( $showini ) { tprint_array( $ini, "Show Ini Array" ); exit; } $default_settings = array_shift($ini); // Make sold boats follow unsold boats $sold = array(); $unsold = array(); foreach ( $ini as $boat=>$info ) { if ( array_key_exists('sold', $info) && $info['sold'] <> "" ) { if ( $show_sold_boats ) { $sold[$boat] = $info; } } else { $unsold[$boat] = $info; } } $ini = $unsold + $sold; foreach ( $ini as $boat=>$info ) { extract($default_settings); // sets all settings to defaults extract($info); // sets all settings for particular boat ($boat) if ( $show == FALSE ) continue; if ( $show == "local" && ! LOCALSERVER ) continue; if ( $boatname == "") $boatname = $boat; // Default boatname is the same as the ini section name $boatname = caseword($boatname, UT_TITLE ); $ok = preg_match("@^(.*)( [iv]+)$@i", $boatname, $matches); // handle case of boatnames with roman numerals, e.g. Titanic III if ( $ok ) $boatname = $matches[1] . strtoupper( $matches[2] ); $boat = strtolower(str_replace(" ","",$boat)); $external_link = NULL; if ( !$external_link && file_exists("$boat/$boat.php")) { $link = "$boat/$boat.php"; $external_link = FALSE; } elseif ( $link <> "" ) { $external_link = TRUE; } $status = boolvalue($sold,"SOLD:Available",BV_RCOLOR, BV_MCASE); if ( $link && !$sold ) $linkref = HTML_href($link,$boatname,"B"); else $linkref = $boatname; if ( $show == "local" ) $linkref .= " (LO)"; $refs = ""; if ( sizeof($icon_ref) >1 ) { foreach ( $icon_ref as $ref ) { if ( $ref <> "" ) { $refs .= icon_ref($ref); } } } if ( $uscg && $docnbr ) { $hull = uscg_documentation($docnbr, $hull ); // Link to USCG database details } elseif ( $canada && $docnbr ) { $hull = canada_documentation($docnbr, $hull ); // Link to Transport Canada database details } $sub = "|$linkref $refs|$type|$year|$hull|$loc|$price|$status|$boatname"; if ( $vessel_info && $show_vessel_info && LOCALSERVER ) { include("vessel_info_table.php"); // sets $vit as template object $vessel_info = $vit->sprint_tplt(); $vit -> destruct(); $modal = new template("boatsforsale_modal_template.htm"); $modal->tplt_fill("VESSEL_INFO_TABLE",$vessel_info); $modal->tplt_fill("MODAL",$sub); $modal_info = $modal->sprint_tplt(); $modal->destruct(); $sub .= "|$modal_info"; } $page->tplt_fill("BOAT",$sub); } $page->tplt_snap(); } elseif ( $page->isTag("STATUS") ) { $page->tplt_fill( "STATUS", TPLT_ERASE ); $page->tplt_fill( "STATUS", $page->tplt_snap_status() ); } @ob_end_clean(); echo $page->sunload(TPLT_AUTOCLEAN, TPLT_NOHEADERS); ?>