/[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.2 - (hide annotations)
Wed Feb 21 15:52:38 2001 UTC (23 years, 4 months ago) by dpavlin
Branch: MAIN
Changes since 1.1: +1 -1 lines
news+community+events u jednoj tablici, back-end za editiranje

1 dpavlin 1.1 <?
2    
3     global $smarty,$dbh;
4    
5     // fetch menu
6    
7     $sth = $dbh->prepare("select item,url,file from menu where section='$section' order by num");
8     $sth->execute();
9     while ($row=$sth->fetchrow_hash()) {
10     $menu[]=$row;
11     }
12    
13     $smarty->assign("menu",$menu);
14    
15     // fetch news
16    
17 dpavlin 1.2 $sth = $dbh->prepare("select id,title from news where type='n' order by id desc limit 5");
18 dpavlin 1.1 $sth->execute();
19     while ($row=$sth->fetchrow_hash()) {
20     $news[]=$row;
21     }
22     $smarty->assign("news",$news);
23    
24     #include("debug.inc");
25    
26     if ($multi_page) {
27     $max=count($multi_page);
28     $next=$multi_page[$current+1];
29     $show=0;
30    
31     $uri=basename($GLOBALS[REQUEST_URI]);
32    
33     for ($i=0; $i<=$max; $i++) {
34     if ($multi_page[$i]==substr($uri,0,strlen($uri))) {
35     $current=$i;
36     $show=1;
37     }
38     }
39    
40     if ($current && $current!=0) {
41     $prev=$multi_page[$current-1];
42     }
43     if ($current && $current!=$max) {
44     $next=$multi_page[$current+1];
45     }
46     if ($show) {
47     $smarty->assign(array(
48     "multi_page"=>$multi_page,
49     "multi_page_current"=>($current+1),
50     "multi_page_max"=>$max,
51     "multi_page_prev"=>$prev,
52     "multi_page_next"=>$next
53     ));
54     }
55    
56     }
57    
58     ?>

  ViewVC Help
Powered by ViewVC 1.1.26