-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdivesite.php
executable file
·82 lines (73 loc) · 2.29 KB
/
divesite.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
/**
* Filename: divesite.php
* Function: This file shows a list of dive sites, or the details for a dive site,
* for phpDivingLog.
* @author Lloyd Borrett - www.borrett.id.au Rob Lensen <[email protected]>
* @package phpdivinglog
* @version $Rev$
* Last Modified: $Date$
*
* @copyright (C) 2006 Lloyd Borrett - http://www.borrett.id.au
*
* Adapted from code by Olaf van Zandwijk - http://enschede.vanzandwijk.net
*
* For use with Diving Log by Sven Knoch - http://www.divinglog.de
*
*/
$config_file = "./config.inc.php";
require_once($config_file);
$request = new HandleRequest();
$request->set_request_uri($_SERVER['REQUEST_URI']);
$request->set_file_depth(0);
$request->handle_url();
$links = new TopLevelMenu($request);
$divesite = new Divesite();
$divesite->set_divesite_info($request);
$result = $divesite->get_divesite_info();
global $_config;
if ($divesite->get_request_type() == 1) {
$t->assign('divesite_id', $divesite->divesite_nr);
/**
* Get the page header
*/
$pagetitle = $_lang['dive_site_pagetitle'] . $result['Place'];
$t->assign('pagetitle', $pagetitle);
$t->assign('colspanlinks', '4');
// First, Previous, Next, Last links and Dive #
$links->get_std_links();
$links->get_nav_links($request);
// Show main dive site details
$divesite->set_main_divesite_details();
$divesite->set_divesite_pictures();
$divesite->set_dives_at_location();
// Comments
$divesite->set_divesite_comments();
} elseif ($divesite->get_request_type() == 0) {
$links->get_ovv_links();
$divesite->get_divesite_overview();
/**
* Get the page header
*/
$pagetitle = $_lang['dive_sites'];
$t->assign('pagetitle', $pagetitle);
/*
if ($_config['length']) {
$MaxDepth = MetreToFeet($locationlist[$i]['MaxDepth'], 0) ." ". $_lang['unit_length_short_imp'];
} else {
$MaxDepth = $locationlist[$i]['MaxDepth'] ." ". $_lang['unit_length_short'] ;
}
*/
} else {
echo "strange...";
}
$t->assign('base_page', 'divesite.php');
$t->assign('colspanlinks', '4');
if ($_config['embed_mode'] == TRUE) {
// Get the HTML output and send it to the requesting
include('header.php');
$t->display('divesite.tpl');
include('footer.php');
} else {
$t->display('divesite.tpl');
}