/[inncomm]/index.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

Diff of /index.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dpavlin, Thu Dec 7 17:01:39 2000 UTC revision 1.2 by dpavlin, Fri Dec 8 08:27:32 2000 UTC
# Line 110  if (md5($PHP_AUTH_USER.$PHP_AUTH_PW) != Line 110  if (md5($PHP_AUTH_USER.$PHP_AUTH_PW) !=
110                          if (isset($GLOBALS[$what])) {                          if (isset($GLOBALS[$what])) {
111                                  $GLOBALS[$what]="true";                                  $GLOBALS[$what]="true";
112                          } else {                          } else {
113                                  $GLOBALS[$what]="flase";                                  $GLOBALS[$what]="false";
114                          }                          }
115                  }                  }
116    
117                  fix_checkbox("analitical");                  fix_checkbox("analitical");
118                  fix_checkbox("solution");                  fix_checkbox("solution");
119    
120                  $dbh->dbh_do(fixsql("insert into poruke (thread_id,reply_id,osoba_id,sadrzaj,level,pos,analitical,solution) values ($thread_id,$reply_id,$osoba_id,'$sadrzaj',$level,'$pos',$analitical,$solution)"));                  $sadrzaj=trim($sadrzaj);
121                    $dbh->dbh_do(fixsql("insert into poruke (thread_id,reply_id,osoba_id,sadrzaj,level,pos,analitical,solution) values ($thread_id,$p,$osoba_id,'$sadrzaj',$level,'$pos',$analitical,$solution)"));
122    
123                  $sth=$dbh->prepare("select currval('poruke_id_seq') as id");                  $sth=$dbh->prepare("select currval('poruke_id_seq') as id");
124                  $sth->execute();                  $sth->execute();
# Line 125  if (md5($PHP_AUTH_USER.$PHP_AUTH_PW) != Line 126  if (md5($PHP_AUTH_USER.$PHP_AUTH_PW) !=
126                  if ($row=$sth->fetchrow_hash()) {                  if ($row=$sth->fetchrow_hash()) {
127                          $p=$row[id];    // poruka_id for later                          $p=$row[id];    // poruka_id for later
128                  }                  }
129                    $what="show";
130    
131          } elseif (isset($insert_newtopic)) {          } elseif (isset($insert_newtopic)) {
132    
# Line 136  if (md5($PHP_AUTH_USER.$PHP_AUTH_PW) != Line 138  if (md5($PHP_AUTH_USER.$PHP_AUTH_PW) !=
138                          $sth->execute();                          $sth->execute();
139                          if ($row=$sth->fetchrow_hash()) {                          if ($row=$sth->fetchrow_hash()) {
140                                  $t=$row[id];    // topic for later                                  $t=$row[id];    // topic for later
141                                    $title=trim($title);
142                                  $dbh->dbh_do(fixsql("insert into topics (id,title) values ($t,'$title')"));                                  $dbh->dbh_do(fixsql("insert into topics (id,title) values ($t,'$title')"));
143                          }                          }
144                  }                  }
# Line 143  if (md5($PHP_AUTH_USER.$PHP_AUTH_PW) != Line 146  if (md5($PHP_AUTH_USER.$PHP_AUTH_PW) !=
146    
147  //----- end of inserts/updates...  //----- end of inserts/updates...
148    
149  if ($what=="reply" && isset($t)) {  if (($what=="reply" || $what="show") && isset($t)) {
150          $sql_where=" and topics.id=$t";          $sql_where=" and topics.id=$t";
151  }  }
152    
153    if ($solution_room == 1) {
154            // don't limit just to topics starts
155            $sql_where.=" and poruke.thread_id=topics.id and poruke.thread_id!=0";
156    } else {
157            // limit just to topics start
158            $sql_where.=" and poruke.id=topics.id and poruke.thread_id=0";
159    }
160    
161  $sth = $dbh->prepare("select topics.id as topic_id,title,sadrzaj,full_name,poruke.datum as datum  $sth = $dbh->prepare("select topics.id as topic_id,title,sadrzaj,full_name,poruke.datum as datum
162          from topics,poruke,osobe          from topics,poruke,osobe
163          where poruke.thread_id=0 and poruke.id=topics.id and poruke.osoba_id=osobe.id $sql_where $sql_poruke_where          where poruke.osoba_id=osobe.id $sql_where $sql_poruke_where
164          order by datum asc          order by datum asc
165          ");          ");
166    
167  $sth->execute();  $sth->execute();
168  $topics="";  $topics="";
169  while ($row=$sth->fetchrow_hash()) {  while ($row=$sth->fetchrow_hash()) {
# Line 160  while ($row=$sth->fetchrow_hash()) { Line 172  while ($row=$sth->fetchrow_hash()) {
172                  AUTHOR => $row[full_name],                  AUTHOR => $row[full_name],
173                  DATE => $row[datum],                  DATE => $row[datum],
174                  SADRZAJ => $row[sadrzaj],                  SADRZAJ => $row[sadrzaj],
175                  COMMENTS => "<a href=\"$PHP_SELF?what=reply&t=$row[topic_id]\">comments&gt;&gt;</a>",                  COMMENTS => "<a href=\"$PHP_SELF?what=show&t=$row[topic_id]\">comments&gt;&gt;</a>",
176                  PHP_SELF => $PHP_SELF                  PHP_SELF => $PHP_SELF
177          ));          ));
178          $tpl->parse(ROWS,".theader");          $tpl->parse(ROWS,".theader");
# Line 180  while ($row=$sth->fetchrow_hash()) { Line 192  while ($row=$sth->fetchrow_hash()) {
192                                  $l_ul.="<ul>";                                  $l_ul.="<ul>";
193                                  $r_ul.="</ul>";                                  $r_ul.="</ul>";
194                          }                          }
195                            // don't indent in solution room
196                            if ($solution_room == 1) { $l_ul=$r_ul=""; }
197                          $tpl->assign( array(                          $tpl->assign( array(
198                                  L_INDENT => $l_ul,                                  L_INDENT => $l_ul,
199                                  R_INDENT => $r_ul                                  R_INDENT => $r_ul
200                                  ));                                  ));
201                          $topic=trim(strip_tags($row2[topic]));                          $topic=trim(strip_tags($row2[topic]));
202                          if (isset($p) && $p == $row2[id]) {                          if (isset($p) && $p == $row2[id] && $what=="reply") {
203                                  $topic="<font color=red>$topic...</font>";                                  $topic="<font color=red>$topic...</font>";
204                                  $tpl->assign( array( P => $p ));                                  $tpl->assign( array( P => $p, T => $t ));
205                                  $tpl->parse(CHECKBOXES, ".checkboxes");                                  if ($analitical_room == 1) {
206                                            $tpl->parse(CHECKBOXES, ".checkboxes");
207                                    }
208                                  $tpl->parse(REPLY, ".reply");                                  $tpl->parse(REPLY, ".reply");
209                            } elseif (isset($p) && $p == $row2[id]) {
210                                    $topic="<font color=red>$topic...</font>";
211                                    $tpl->assign( array( P => $p, T => $t ));
212                          } else {                          } else {
213                                  if (!isset($p)) { $p=$t; }                                  if (!isset($p)) { $p=$t; }
214                                  $tmp_t=$row2[thread_id];                                  $tmp_t=$row2[thread_id];
# Line 216  while ($row=$sth->fetchrow_hash()) { Line 235  while ($row=$sth->fetchrow_hash()) {
235                  // non-unroll topics                  // non-unroll topics
236                  $tpl->assign( array(                  $tpl->assign( array(
237                                  SADRZAJ => $row[sadrzaj],                                  SADRZAJ => $row[sadrzaj],
238                                  COMMENTS => "<a href=\"$PHP_SELF?what=reply&t=$row[topic_id]\">comments&gt;&gt;</a>"                                  COMMENTS => "<a href=\"$PHP_SELF?what=show&t=$row[topic_id]\">comments&gt;&gt;</a>"
239                          ));                          ));
240  #               $tpl->parse(ROWS,".theader");  #               $tpl->parse(ROWS,".theader");
241                  $tpl->parse(ROWS,".trow");                  $tpl->parse(ROWS,".trow");
# Line 237  $tpl->parse(MAIN, "listall"); Line 256  $tpl->parse(MAIN, "listall");
256  if ($what == "new") {  if ($what == "new") {
257          $tpl->parse(MAIN, ".newtopic");          $tpl->parse(MAIN, ".newtopic");
258          $tpl->assign(array( TITLE => "Start of new topic" ));          $tpl->assign(array( TITLE => "Start of new topic" ));
259    } elseif ($what == "show") {
260            $tpl->assign(array(
261                    TITLE => "Select article for reply",
262                    P => $p
263            ));
264  } elseif ($what == "reply") {  } elseif ($what == "reply") {
265          $tpl->assign(array(          $tpl->assign(array(
266                  TITLE => "Reply to selected article",                  TITLE => "Reply to selected article",
267                  P => $p                  P => $p
268          ));          ));
 #       $tpl->parse(MAIN, ".reply");  
269  }  }
270  $tpl->parse(MAIN, "main");  $tpl->parse(MAIN, "main");
271    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26