1 |
ravilov |
1.1 |
<? |
2 |
|
|
require('class.DBI'); |
3 |
dpavlin |
1.3 |
$db="plivasi"; |
4 |
ravilov |
1.1 |
$dbh = new DBI("dbi:pg:$db","dpavlin",""); |
5 |
|
|
|
6 |
|
|
if (!$WAP && ( strstr($accept,"text/vnd.wap.wml") || strstr($accept,"hdml;version=3.0") ) ) { |
7 |
|
|
Header("Location: wap.php"); |
8 |
|
|
header("Content-type: text/vnd.wap.wml"); |
9 |
|
|
exit; |
10 |
|
|
} |
11 |
|
|
|
12 |
|
|
$sql_section=""; |
13 |
|
|
|
14 |
|
|
$url=basename($PHP_SELF); |
15 |
|
|
if ($QUERY_STRING) $url.="?$QUERY_STRING"; |
16 |
|
|
|
17 |
|
|
if ($section) $sql_section=" and section='$section'"; |
18 |
|
|
|
19 |
|
|
$sth = $dbh->prepare("select item from menu where url = '$url' $sql_section limit 1"); |
20 |
|
|
$sth->execute(); |
21 |
|
|
global $menu_item; |
22 |
|
|
if ($row=$sth->fetchrow_hash()) { |
23 |
|
|
$menu_item=$row[0]; |
24 |
|
|
} |
25 |
dpavlin |
1.3 |
|
26 |
|
|
// generate random numbers of pictures on top-right corner |
27 |
|
|
$rnd=range(1,5); |
28 |
|
|
srand(time()); |
29 |
|
|
shuffle($rnd); |
30 |
ravilov |
1.1 |
|
31 |
|
|
?> |