/[corp_html]/inc/common.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/common.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.21 - (hide annotations)
Tue May 7 14:02:33 2002 UTC (22 years, 1 month ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.20: +1 -1 lines
removed newsletter (won't go to production YET), fixed title when
prev/next buttons are used

1 dpavlin 1.1 <?
2    
3 dpavlin 1.14 global $smarty,$dbh,$visible_is_true;
4 dpavlin 1.1
5 dpavlin 1.13 // just to be on safe side
6     if (! isset($visible_is_true)) {
7     $visible_is_true="visible is true";
8     }
9    
10 dpavlin 1.1 // fetch menu
11    
12 dpavlin 1.13 $sth = $dbh->prepare("select item,url,file from menu where section='$section' and $visible_is_true order by num");
13 dpavlin 1.1 $sth->execute();
14     while ($row=$sth->fetchrow_hash()) {
15     $menu[]=$row;
16     }
17    
18     $smarty->assign("menu",$menu);
19    
20     // fetch news
21    
22 dpavlin 1.17 $sth = $dbh->prepare("select id,title from news where (type='n' or type='c' or type='a' or type='i' or type='r' or type='p') and $visible_is_true order by date desc limit 5");
23 dpavlin 1.1 $sth->execute();
24     while ($row=$sth->fetchrow_hash()) {
25     $news[]=$row;
26     }
27     $smarty->assign("news",$news);
28    
29 dpavlin 1.19 $sth = $dbh->prepare("select id,title from news where (type='e' or type='f') and $visible_is_true order by priority desc,date desc limit 5");
30 dpavlin 1.4 $sth->execute();
31     while ($row=$sth->fetchrow_hash()) {
32     $events[]=$row;
33     }
34     $smarty->assign("events",$events);
35    
36 dpavlin 1.1 #include("debug.inc");
37    
38 dpavlin 1.15 // multipage
39    
40 dpavlin 1.1 if ($multi_page) {
41     $max=count($multi_page);
42     $next=$multi_page[$current+1];
43     $show=0;
44    
45     $uri=basename($GLOBALS[REQUEST_URI]);
46    
47     for ($i=0; $i<=$max; $i++) {
48     if ($multi_page[$i]==substr($uri,0,strlen($uri))) {
49     $current=$i;
50     $show=1;
51     }
52     }
53    
54     if ($current && $current!=0) {
55     $prev=$multi_page[$current-1];
56     }
57     if ($current && $current!=$max) {
58     $next=$multi_page[$current+1];
59     }
60     if ($show) {
61     $smarty->assign(array(
62 dpavlin 1.6 "multi_page_show" => 1,
63 dpavlin 1.1 "multi_page"=>$multi_page,
64     "multi_page_current"=>($current+1),
65     "multi_page_max"=>$max,
66     "multi_page_prev"=>$prev,
67     "multi_page_next"=>$next
68     ));
69     }
70    
71     }
72 dpavlin 1.15
73     // banner
74    
75     include("banner.inc");
76 dpavlin 1.1
77 dpavlin 1.20 // newsletter
78    
79     if ($from == "investor" || $form == "new" || $section == "investor" || $section=="new" ) {
80 dpavlin 1.21 //include("inc/newsletter.php");
81 dpavlin 1.20 }
82    
83 dpavlin 1.1 ?>

  ViewVC Help
Powered by ViewVC 1.1.26