/[corp_html]/new.php
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 /new.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Wed Feb 21 15:52:31 2001 UTC (23 years, 2 months ago) by dpavlin
Branch: MAIN
Changes since 1.1: +3 -3 lines
news+community+events u jednoj tablici, back-end za editiranje

1 dpavlin 1.1 <?php
2     require("Smarty.class.php");
3     require("conn.inc");
4    
5     $smarty = new Smarty;
6    
7     $smarty->assign( array ( Title=>"Pliva d.d." ) );
8    
9    
10     if (isset($from)) {
11     $section=$from;
12     } else {
13     $section="new";
14     }
15    
16     if ($section == "investor") {
17     $title="INVESTOR'S PAGE";
18     $lpic="investor"; $lext=".jpg";
19     $mpic="investors.gif";
20     $back_url="investor.php";
21     } else {
22     $title="What's New";
23     $lpic="new"; $lext=".jpg";
24     $mpic="new.gif";
25     $back_url="index.php";
26     }
27    
28     $smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) );
29    
30 dpavlin 1.2 $sql_where="where visible is true";
31 dpavlin 1.1
32     if (isset($id)) {
33 dpavlin 1.2 $sql_where.=" and id=$id ";
34 dpavlin 1.1 }
35    
36     if (! isset($more) || !file_exists("./news/$more")) {
37    
38 dpavlin 1.2 $sth = $dbh->prepare("select id,title,town_date,body,more,pdf from news $sql_where order by id desc");
39 dpavlin 1.1 $sth->execute();
40     while ($row=$sth->fetchrow_hash()) {
41     $data[]=$row;
42     }
43    
44     $smarty->assign("data",$data);
45    
46     $main=$smarty->fetch("new.tpl");
47    
48     if (isset($id) && $data[0][more]) {
49     $main=join('',file("./news/".$data[0][more]));
50    
51     }
52    
53     } else { // display details
54     $main=join('',file("./news/$more"));
55     $back_url=$GLOBALS[HTTP_REFERER];
56     }
57    
58     include("common.inc");
59     $smarty->assign( array(back_url=>$back_url, MAIN=>$main));
60    
61     $smarty->display("index.tpl");
62     ?>

  ViewVC Help
Powered by ViewVC 1.1.26