-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpathway.php
More file actions
118 lines (108 loc) · 3.72 KB
/
pathway.php
File metadata and controls
118 lines (108 loc) · 3.72 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
/***
* INTEGRATED FLEET MANAGEMENT SYSTEM
* OBSIDIAN FLEET
* http://www.obsidianfleet.net/ifs/
*
* Developer: Frank Anon
* fanon@obsidianfleet.net
*
* Version: 1.11
* Release Date: June 3, 2004
*
* 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
*
* Date: 12/9/03
* Comments: Display pathway of navigation.
***/
if ((trim($SubMenu)!="")||($SubMenu!=0))
{
$qry = "SELECT componentid, link, contenttype, name, id
FROM {$mpre}menu WHERE id='$SubMenu'";
$result = $database->openConnectionWithReturn($qry);
$i = 0;
for ($i=0;
list($componentid, $link[$i], $contenttype[$i], $name[$i], $id[$i])=mysql_fetch_array($result);
$i++);
while ($componentid <> 0)
{
$qry = "SELECT componentid, link, contenttype, name, id
FROM {$mpre}menu WHERE id='$componentid'";
$result = $database->openConnectionWithReturn($qry);
$i = 0;
for ($i=0;
list($componentid, $link[$i], $contenttype[$i], $name[$i], $id[$i])=mysql_fetch_array($result);
$i++);
}
$j = count($name);
$j--;
print "<a href=\"index.php\">Home</a> ";
for ($k = $j; $k > 0; $k--){
if ($name[$k]!="")
{
if ($contenttype[$k]=="web")
{
$correctLink= eregi("http://", $link);
if ($correctLink==1)
$newlink= "<a href=\"$link[$k]\" target=\"_window\">$name[$k]</a>";
else
$newlink="http://$link";
}
else if ($contenttype[$k]=="file")
$newlink= " <a href=\"index.php?option=displaypage&Itemid=$id[$k]&op=file&SubMenu=$id[$k]\">$name[$k]</a>";
else if ($contenttype[$k]=="typed")
$newlink= " <a href=\"index.php?option=displaypage&Itemid=$id[$k]&op=page&SubMenu=$id[$k]\">$name[$k]</a>";
if ($newlink!="")
$path .= "| $newlink ";
}
}
echo $path;
}
else
{
$i=0;
$qry="SELECT componentid, name, link, contenttype, id
FROM {$mpre}menu WHERE id='$Itemid'";
$result=$database->openConnectionWithReturn($qry);
list($componentid, $name[$i], $link[$i], $contenttype[$i], $id[$i])=mysql_fetch_array($result);
while ($componentid <> 0)
{
$qry="SELECT componentid, name, link, contenttype, id
FROM {$mpre}menu WHERE id='$componentid'";
$result=$database->openConnectionWithReturn($qry);
for ($i=0;
list($componentid, $name[$i], $link[$i], $contenttype[$i], $id[$i])=mysql_fetch_array($result);
$i++);
}
$j = count($name);
$j--;
if (eregi("option", $REQUEST_URI))
print "<A HREF=\"index.php\">Home</A> ";
for ($k = $j; $k >= 0; $k--)
{
if ($name[$k]!="")
{
if ($contenttype[$k]=="web")
{
$correctLink= eregi("http://", $link);
if ($correctLink==1)
$newlink= "<a href=\"$link[$k]\" target=\"_window\">$name[$k]</a>";
else
$newlink="http://$link";
}
else if ($contenttype[$k]=="file")
$newlink= " <a href=\"index.php?option=displaypage&Itemid=$id[$k]&op=file&SubMenu=$id[$k]\">$name[$k]</a>";
else if ($contenttype[$k]=="typed")
$newlink= " <a href=\"index.php?option=displaypage&Itemid=$id[$k]&op=page&SubMenu=$id[$k]\">$name[$k]</a>";
if ($newlink!="")
$path .= "| $newlink ";
}
}
echo $path;
}
?>