-
Notifications
You must be signed in to change notification settings - Fork 0
/
showlinks.php
57 lines (55 loc) · 1.56 KB
/
showlinks.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
<?php
include_once("admin/class.db.php");
function showLinklist($categoryID,$type)
{
$conn=new DBOperation();
$html="";
$sql="SELECT * FROM categorys WHERE ID=".$categoryID;
$result=$conn->query($sql);
if ($row=$result->fetch_array()) $categoryName=$row['categoryName'];
else $categoryName="";
if (isset($categoryID)) $sql="SELECT * FROM links WHERE categoryID=".$categoryID." order by `order`";
else $sql="SELECT * FROM links";
$result=$conn->query($sql);
if (isset($type) && $type=='s')
{
$html.="<form name='form' id='form'>";
$html.="<select name='jumpMenu' id='jumpMenu'>\n";
$html.="<option selected='selected'>$categoryName</option>";
while($row=$result->fetch_array())
{
$address=$row['linkAddress'];
if (strstr($address,"http://")=="" && substr_count($address,"./")==0) $address="http://".$address;
$html.="<option value='".$address."'>";
$html.=$row['linkName'];
$html.="</option>";
}
$html.="</select>\n";
$html.="</form>\n";
}
else
{
$html="<ul>\n";
while($row=$result->fetch_array())
{
$address=$row['linkAddress'];
if (strstr($address,"http://")=="" && substr_count($address,"./")==0) $address="http://".$address;
$html.="<li><a href='".$address."' target='_blank' title='".$row['comment']."'>";
if ($categoryID==13)
{
$img=$row['logo'];
$img=str_ireplace("<p>","",$img);
$img=str_ireplace("</p>","",$img);
$html.=$img;
}
else
{
$html.=$row['linkName'];
}
$html.="</a></li>\n";
}
$html.="</ul>\n";
}
return $html;
}
?>