/[pliva-si]/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.7 - (hide annotations)
Tue Nov 20 08:48:14 2001 UTC (22 years, 5 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +4 -2 lines
new dbi, prijevodi, corporate news

1 ravilov 1.1 <?
2 dpavlin 1.7 // require('class.DBI');
3     require("dbi_pgsql.php");
4    
5 dpavlin 1.3 $db="plivasi";
6 dpavlin 1.7 $dbh = new DBI($db,"dpavlin","");
7 ravilov 1.1
8     if (!$WAP && ( strstr($accept,"text/vnd.wap.wml") || strstr($accept,"hdml;version=3.0") ) ) {
9     Header("Location: wap.php");
10     header("Content-type: text/vnd.wap.wml");
11     exit;
12     }
13    
14     $sql_section="";
15    
16     $url=basename($PHP_SELF);
17     if ($QUERY_STRING) $url.="?$QUERY_STRING";
18    
19     if ($section) $sql_section=" and section='$section'";
20    
21     $sth = $dbh->prepare("select item from menu where url = '$url' $sql_section limit 1");
22     $sth->execute();
23     global $menu_item;
24     if ($row=$sth->fetchrow_hash()) {
25 dpavlin 1.6 $menu_item=str_replace("\\n"," ",$row[0]);
26 ravilov 1.1 }
27 dpavlin 1.3
28     // generate random numbers of pictures on top-right corner
29     $rnd=range(1,5);
30     srand(time());
31     shuffle($rnd);
32 ravilov 1.1
33 dpavlin 1.4 // parse /preview url
34    
35 dpavlin 1.5 global $visible_is_true;
36    
37 dpavlin 1.4 $preview_url="/preview";
38 dpavlin 1.5 if (substr($GLOBALS[REQUEST_URI],0,strlen($preview_url)) == $preview_url) {
39 dpavlin 1.4 $is_preview=1;
40     $visible_is_true = "true"; // visible can be true or false
41     } else {
42     $visible_is_true = "visible is true"; // limit output just to visible
43     }
44 ravilov 1.1 ?>

  ViewVC Help
Powered by ViewVC 1.1.26