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

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

  ViewVC Help
Powered by ViewVC 1.1.26