/[corp_html]/inc/conn.inc
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /inc/conn.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (hide annotations)
Tue Sep 18 10:38:55 2001 UTC (22 years, 7 months ago) by dpavlin
Branch: MAIN
Changes since 1.8: +5 -3 lines
fix za preview

1 dpavlin 1.1 <?
2     require('class.DBI');
3     $db="corp";
4     $dbh = new DBI("dbi:pg:$db","dpavlin","");
5    
6 dpavlin 1.4 if (!$WAP && ( strstr($accept,"text/vnd.wap.wml") || strstr($accept,"hdml;version=3.0") ) ) {
7 dpavlin 1.2 Header("Location: wap.php");
8 dpavlin 1.3 header("Content-type: text/vnd.wap.wml");
9 dpavlin 1.2 exit;
10     }
11    
12 dpavlin 1.6 $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 dpavlin 1.5 $sth->execute();
21     global $menu_item;
22     if ($row=$sth->fetchrow_hash()) {
23     $menu_item=$row[0];
24     }
25    
26 dpavlin 1.8 // parse /preview URL
27 dpavlin 1.9
28     global $is_preview,$visible_is_true;
29    
30 dpavlin 1.7 $preview_url="/preview";
31 dpavlin 1.8 if (substr($GLOBALS[REQUEST_URI],0,strlen($preview_url)) == $preview_url) {
32     $is_preview=1;
33 dpavlin 1.9 $visible_is_true = "true"; // visible can be true or false
34 dpavlin 1.8 } else {
35 dpavlin 1.9 $visible_is_true = "visible is true"; // limit output just to visible
36 dpavlin 1.8 }
37    
38 dpavlin 1.7
39 dpavlin 1.1 ?>

  ViewVC Help
Powered by ViewVC 1.1.26