16 |
$smarty = new Smarty; |
$smarty = new Smarty; |
17 |
|
|
18 |
if ($part && file_exists("templates/wap-$part.tpl")) { |
if ($part && file_exists("templates/wap-$part.tpl")) { |
19 |
$dbh->dbh_do("set datestyle='german'"); |
include("stocks.inc"); |
|
|
|
|
$sql="select date(date),time(date),type,current,change,high,low,open from stocks order by stocks.date desc,stocks.insert_date asc limit 2"; |
|
|
$sth = $dbh->prepare("$sql"); |
|
|
$sth->execute(); |
|
|
while ($row=$sth->fetchrow_hash()) { |
|
|
$stock[]=$row; |
|
|
$time=$row[time]; |
|
|
$date=$row[date]; |
|
|
} |
|
|
|
|
|
if ($time == "23:23:23") $time="CLOSE"; |
|
|
|
|
20 |
$smarty->assign(array(stock=>$stock, date=>$date, time=>$time)); |
$smarty->assign(array(stock=>$stock, date=>$date, time=>$time)); |
21 |
$wml=$smarty->fetch("wap-$part.tpl"); |
$wml=$smarty->fetch("wap-$part.tpl"); |
22 |
|
|
23 |
} else { |
} else { |
24 |
|
include("news_type.inc"); |
25 |
|
|
26 |
$on_page=5; |
$on_page=5; |
27 |
|
|
28 |
$sql_where="where visible is true"; |
# $sql_where="where visible is true and type<>'p'"; |
29 |
|
$sql_where="where visible is true and (type='".join("' or type='",array_keys($wap_pics))."')"; |
30 |
|
|
31 |
if (!isset($s)) { |
if (!isset($s)) { |
32 |
$sql_limit="limit $on_page"; |
$sql_limit="limit $on_page"; |
54 |
} else { |
} else { |
55 |
$tmp=$html; |
$tmp=$html; |
56 |
} |
} |
57 |
return utf8_encode(htmlspecialchars($tmp)); |
$tmp=str_replace('$','$$',$tmp); |
58 |
|
return utf8_encode(htmlentities($tmp)); |
59 |
} |
} |
60 |
|
|
61 |
|
|
63 |
$row[title]=fixup($row[title]); |
$row[title]=fixup($row[title]); |
64 |
$row[body]=fixup($row[body]); |
$row[body]=fixup($row[body]); |
65 |
$row[town_date]=fixup($row[town_date]); |
$row[town_date]=fixup($row[town_date]); |
66 |
|
$row[pic]=$wap_pics{$row[type]}; |
67 |
|
$row[alt]=$news_type{$row[type]}; |
68 |
$data[]=$row; |
$data[]=$row; |
69 |
|
|
70 |
$num_selected++; |
$num_selected++; |
83 |
body=>$wml_body, |
body=>$wml_body, |
84 |
prev=>$prev, next=>$next, |
prev=>$prev, next=>$next, |
85 |
num_selected=>$num_selected, |
num_selected=>$num_selected, |
86 |
on_page=>$on_page |
on_page=>$on_page, |
87 |
) ); |
) ); |
88 |
$wml=$smarty->fetch("wap.tpl"); |
$wml=$smarty->fetch("wap.tpl"); |
89 |
} |
} |