/[gnuheter]/gnuheter/pollcomments.php
ViewVC logotype

Diff of /gnuheter/pollcomments.php

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

revision 1.13 by metaur, Fri Nov 15 08:16:44 2002 UTC revision 1.14 by metaur, Thu Nov 21 01:20:21 2002 UTC
# Line 288  function reply($pid, $sid, $mode, $order Line 288  function reply($pid, $sid, $mode, $order
288          $reason = ""; $score = 0;          $reason = ""; $score = 0;
289          dbconnect();          dbconnect();
290          if ($pid!=0) {          if ($pid!=0) {
291                  list($date, $name, $email, $url, $subject, $comment, $score, $reason) = mysql_fetch_row(mysql_query("SELECT date, name, email, url, subject, comment, score, reason FROM pollcomments WHERE tid='$pid'"));                  list($date, $name, $email, $url, $subject, $comment, $score,
292                         $reason) = mysql_fetch_row(mysql_query("SELECT date, ".
293                                     "name, email, url, subject, comment, score, ".
294                                     "reason FROM pollcomments WHERE tid='$pid'"));
295          } else {          } else {
296                  list($date, $subject, $temp_comment, $comment, $name, $notes) = mysql_fetch_row(mysql_query("SELECT NOW(), pollTitle, NULL, NULL, NULL, NULL FROM poll_desc WHERE pollID='$sid'"));                  list($date, $subject, $temp_comment, $comment, $name,
297                         $notes) = mysql_fetch_row(mysql_query("SELECT NOW(), ".
298                                    "pollTitle, NULL, NULL, NULL, NULL FROM ".
299                                    "poll_desc WHERE pollID='$sid'"));
300          }          }
301          if ($comment == "") $comment = $temp_comment;          if ($comment == "") $comment = $temp_comment;
302    
# Line 325  function reply($pid, $sid, $mode, $order Line 331  function reply($pid, $sid, $mode, $order
331                  echo "<input type=\"checkbox\" name=\"postanon\"> Posta anonymt<br>\n";                  echo "<input type=\"checkbox\" name=\"postanon\"> Posta anonymt<br>\n";
332                  echo "<input type=\"checkbox\" name=\"medsig\" checked> Infoga signatur<br>\n";                  echo "<input type=\"checkbox\" name=\"medsig\" checked> Infoga signatur<br>\n";
333          }          }
334          if($speling) {          if($speling) {  
335                  echo "<input type=\"checkbox\" id=\"spell\" name=\"spell\"" . (($spell) ? " checked" : "")  . ">&nbsp;<label for=\"spell\">Kontrollera stavning</label><br>\n";                  echo "<input type=\"checkbox\" id=\"spell\" name=\"spell\"" . (($spell) ? " checked" : "")  . ">&nbsp;<label for=\"spell\">Kontrollera stavning</label><br>\n";
336          }          }
   
337          echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">\n"          echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">\n"
338                  ."<input class=\"textbox\" type=\"hidden\" name=\"sid\" value=\"$sid\"><input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">\n"              ."<input class=\"textbox\" type=\"hidden\" name=\"sid\" value=\"$sid\">"
339                  ."<input class=\"textbox\" type=\"hidden\" name=\"order\" value=\"$order\"><input class=textbox type=\"hidden\" name=\"thold\" value=\"$thold\">\n"              ."<input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">\n"
340                  ."<input type=\"submit\" name=\"op\" value=\"Preview\" class=\"button\">\n"              ."<input class=\"textbox\" type=\"hidden\" name=\"order\" value=\"$order\">"
341                  ."<input type=\"submit\" name=\"op\" value=\"Ok!\" class=\"button\"> <select name=\"posttype\"><option value=\"exttrans\">Extrans (HTML till text)<option value=\"html\" >HTML-formatterad<option value=\"plaintext\" selected>Vanlig text</select></form><br>\n";              ."<input class=\"textbox\" type=\"hidden\" name=\"thold\" value=\"$thold\">\n"
342                ."<input type=\"submit\" name=\"op\" value=\"Preview\" class=\"button\">\n"
343                ."<input type=\"submit\" name=\"op\" value=\"Ok!\" class=\"button\"> "
344                ."<select name=\"posttype\">"
345                ."<option value=\"source\">Källkod"
346                ."<option value=\"html\">HTML-formatterad"
347                ."<option value=\"plaintext\" selected>Vanlig text"
348                ."</select></form><br>\n";
349    
350          include('footer.php');          include('footer.php');
351  }  }
352    
353  function replyPreview ($medsig, $pid, $sid, $subject, $comment, $postanon, $mode, $order, $thold, $posttype, $spell) {  function replyPreview ($medsig, $pid, $sid, $subject, $comment, $postanon, $mode, $order, $thold, $posttype, $spell) {
354          global $mainfile,$dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI;          global $mainfile,$dbhost,$dbuname,$dbpass,$dbname,$REQUEST_URI;
355          if(!@$mainfile)          if(!@$mainfile)
356                  include('header.php');                  include('header.php');
357          else {          else {
# Line 353  function replyPreview ($medsig, $pid, $s Line 365  function replyPreview ($medsig, $pid, $s
365          $subject = strip_tags($subject);          $subject = strip_tags($subject);
366          $comment = stripslashes($comment);          $comment = stripslashes($comment);
367    
368          if (!isset($pid) || !isset($sid)) { echo "Something is not right with passing a variable to this function. This message is just to keep things from messing up down the road"; exit(); }          if (!isset($pid) || !isset($sid)) { echo "<img src=\"images/warning.png\">Någonting är väldigt fel."; exit(); }
369    
370          if ($user and !$postanon)          if ($user and !$postanon)
371                  $name = $cookie[1];                  $name = $cookie[1];
372          else {          else {
373                  $name = $anonymous; $usersig=""; }                  $name = $anonymous; $usersig=""; }
374    
375          if ($posttype == "exttrans")          if ($posttype == "source")
376                  $viewcomment = nl2br(htmlspecialchars($comment)).$usersig;              $viewcomment = '<pre>'.nowordlinksshow($comment).'</pre>'.$usersig;
377          else {          else {
378            $comment = filter_text($comment);            $comment = filter_text($comment);
379            if ($posttype == "plaintext")            if ($posttype == "plaintext")
# Line 391  function replyPreview ($medsig, $pid, $s Line 403  function replyPreview ($medsig, $pid, $s
403                  echo "<input type=\"checkbox\" name=\"postanon\" $postanon_check> Posta anonymt<br>\n";                  echo "<input type=\"checkbox\" name=\"postanon\" $postanon_check> Posta anonymt<br>\n";
404                  echo "<input type=\"checkbox\" name=\"medsig\" $medsig_check> Infoga signatur<br>\n";                  echo "<input type=\"checkbox\" name=\"medsig\" $medsig_check> Infoga signatur<br>\n";
405          }          }
406          if($speling) {          if ($speling) {
407                  echo "<input type=\"checkbox\" id=\"spell\" name=\"spell\"" . (($spell) ? " checked" : "")  . ">&nbsp;<label for=\"spell\">Kontrollera stavning</label><br>\n";                  echo "<input type=\"checkbox\" id=\"spell\" name=\"spell\"" . (($spell) ? " checked" : "")  . ">&nbsp;<label for=\"spell\">Kontrollera stavning</label><br>\n";
408          }          }
409          echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">"          echo "<input class=\"textbox\" type=\"hidden\" name=\"pid\" value=\"$pid\">"
410                  ."<input class=\"textbox\" type=\"hidden\" name=\"pollID\" value=\"$sid\"><input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">\n"              ."<input class=\"textbox\" type=\"hidden\" name=\"pollID\" value=\"$sid\">"
411                  ."<input class=\"textbox\" type=\"hidden\" name=\"order\" value=\"$order\"><input class=\"textbox\" type=\"hidden\" name=\"thold\" value=\"$thold\">\n"              ."<input class=\"textbox\" type=\"hidden\" name=\"mode\" value=\"$mode\">\n"
412                  ."<input type=\"submit\" name=\"op\" value=\"Preview\" class=\"button\">\n"              ."<input class=\"textbox\" type=\"hidden\" name=\"order\" value=\"$order\">"
413                  ."<input type=\"submit\" name=\"op\" value=\"Ok!\" class=\"button\"> <select name=\"posttype\"><option value=\"exttrans\"";              ."<input class=\"textbox\" type=\"hidden\" name=\"thold\" value=\"$thold\">\n"
414          if ($posttype == "exttrans") echo " selected";              ."<input type=\"submit\" name=\"op\" value=\"Preview\" class=\"button\">\n"
415                  echo ">Extrans (HTML till text)<option value=\"html\"";;              ."<input type=\"submit\" name=\"op\" value=\"Ok!\" class=\"button\"> "
416                  if ($posttype=="html") echo " selected";              ."<select name=\"posttype\">"
417                  echo ">HTML-formatterad<option value=\"plaintext\"";              ."<option value=\"source\"";
418                  if (($posttype!="exttrans") && ($posttype!="html")) echo " selected";          if ($posttype == "source") echo " selected";
419                  echo ">Vanlig text</select></form><br>\n";          echo ">Källkod".
420                 "<option value=\"html\"";
421            if ($posttype == "html") echo " selected";
422            echo ">HTML-formatterad".
423                 "<option value=\"plaintext\"";
424            if (($posttype != "source") && ($posttype != "html"))
425                echo " selected";
426            echo ">Vanlig text".
427                 "</select></form><br>\n";
428    
429          include('footer.php');          include('footer.php');
430  }  }
# Line 417  function CreateTopic ($medsig, $postanon Line 437  function CreateTopic ($medsig, $postanon
437          $subject = FixQuotes(filter_text($subject, "nohtml"));          $subject = FixQuotes(filter_text($subject, "nohtml"));
438          if ($user && $medsig && ($cookie[11]!="")) $usersig="<br>".stripslashes($cookie[11]);          if ($user && $medsig && ($cookie[11]!="")) $usersig="<br>".stripslashes($cookie[11]);
439          else $usersig="";          else $usersig="";
440          if ($posttype == "exttrans")          if ($posttype == "source")
441                  $comment = FixQuotes(nl2br(htmlspecialchars($comment)));                  $comment = FixQuotes('<pre>'.nowordlinksshow($comment).'</pre>');
442          elseif ($posttype == "plaintext")          elseif ($posttype == "plaintext")
443                  $comment = FixQuotes(nl2br(filter_text($comment)));                  $comment = FixQuotes(nl2br(filter_text($comment)));
444          else          else

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26