forked from mcnolan/ifs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainmenu.php
More file actions
68 lines (65 loc) · 1.89 KB
/
Copy pathmainmenu.php
File metadata and controls
68 lines (65 loc) · 1.89 KB
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
<?php
/***
* INTEGRATED FLEET MANAGEMENT SYSTEM
* OBSIDIAN FLEET
* http://www.obsidianfleet.net/ifs/
*
* Developer: Frank Anon
* fanon@obsidianfleet.net
*
* Version: 1.17
* Release Date: June, 2017
*
* Copyright (C) 2003-2004 Frank Anon for Obsidian Fleet RPG
* Distributed under the terms of the GNU General Public License
* See doc/LICENSE for details
*
* This file based on code from Mambo Site Server 4.0.12
* Copyright (C) 2000 - 2002 Miro International Pty Ltd
*
* Comments: Display main menu
***/
echo '<nav>';
if(!((trim($SubMenu)=="")||($SubMenu=="0")))
$componentid=$SubMenu;
$qry="SELECT id, name, link, contenttype
FROM {$mpre}menu
WHERE componentid='$componentid' AND menutype='mainmenu' AND inuse=1
ORDER BY ordering";
$result=$database->openConnectionWithReturn($qry);
while ( list($id, $name, $link, $contenttype)=mysql_fetch_array($result) )
{
$qry2="SELECT id FROM {$mpre}menu WHERE componentid='$id'";
$result2=$database->openConnectionWithReturn($qry2);
$numres=mysql_num_rows($result2);
if ($numres!=0)
$SubMenu=$id;
else
$SubMenu="";
if ($contenttype=="mambo")
{
echo '<a href="' . $link . '&id=' . $id . '">' . $name . '</a>';
}
elseif ($contenttype=="web")
{
$correctLink= preg_match("~^https?://~i", $link);
$isindex = preg_match("~index.php~i", $link);
if ($isindex != 1 && $correctLink !=1 )
$link="//$link";
echo '<a href="' . $link . '">' . $name . '</a>';
}
elseif ($contenttype=="file")
{
echo '<a href="index.php?option=displaypage&Itemid=' . $id;
echo '&op=file&SubMenu=' . $SubMenu . '">';
echo $name . '</a>';
}
elseif ($contenttype=="typed")
{
echo '<a href="index.php?option=displaypage&Itemid=' . $id;
echo '&op=page&SubMenu=' . $SubMenu . '">';
echo $name . '</a>';
}
}
echo '</nav>';
?>