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

Diff of /gnuheter/submit.php

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

revision 1.8 by pawal, Wed Oct 30 19:22:35 2002 UTC revision 1.9 by metaur, Sat Nov 2 18:46:42 2002 UTC
# Line 76  function PreviewStory($name, $address, $ Line 76  function PreviewStory($name, $address, $
76          global $user, $cookie;          global $user, $cookie;
77          include('header.php');          include('header.php');
78          $subject = stripslashes($subject);          $subject = stripslashes($subject);
79            $subject = check_html($subject, 'nohtml');
80          $story = stripslashes($story);          $story = stripslashes($story);
81            $story = filter_text($story);
82          html_page_head();          html_page_head();
83          echo "<p><form action=\"submit.php\" method=\"POST\">"          echo "<p><form action=\"submit.php\" method=\"POST\">"
84                  ."<b>Ditt namn: </b> ";                  ."<b>Ditt namn: </b> ";
85          if ($user) {          if ($user) {
86                  cookiedecode($user);                  cookiedecode($user);
87                  echo "<a href=\"user.php\">$cookie[1]</a> <font size=\"1\">[ <a href=\"user.php?op=logout\">Logga ut</a> ]</font>";                  echo "<a href=\"user.php\">$cookie[1]</a> <font size=\"1\">[ <a href=\"user.php?op=logout\">Logga ut</a> ]</font>";
88                    $aid = $cookie[1];
89          } else {          } else {
90                  echo "$anonymous";                  echo "$anonymous";
91                    $aid = $anonymous;
92          } ?>          } ?>
93          <p><b>Titel:</b><br>          <p><b>Titel:</b><br>
94          <input class="textbox" type="text" name="subject" size="70" maxlength="80" value="<?= "$subject"; ?>">          <input class="textbox" type="text" name="subject" size="70" maxlength="80" value="<?= htmlspecialchars($subject); ?>">
95          <br><br>          <br><br>
96          <?          <?
97          if ($topic == "") {          if ($topic == "") {
# Line 98  function PreviewStory($name, $address, $ Line 102  function PreviewStory($name, $address, $
102                  $result = mysql_query("SELECT topicimage,topicname,topictext FROM topics WHERE topicid='$topic'");                  $result = mysql_query("SELECT topicimage,topicname,topictext FROM topics WHERE topicid='$topic'");
103                  list($topicimage,$topicname,$topictext) = mysql_fetch_row($result);                  list($topicimage,$topicname,$topictext) = mysql_fetch_row($result);
104          }          }
105          themearticle($aid,$aid,"&lt;inget datum ännu&gt;", ($spell) ? spellcheck($subject) : $subject, ($spell) ? spellcheck($story) : $story, $topic,$topicname,$topicimage,$topictext);          themearticle($aid,$aid,"&lt;inget datum ännu&gt;", wordlinks(($spell) ? spellcheck($subject) : $subject), wordlinks(($spell) ? spellcheck($story) : $story), $topic,$topicname,$topicimage,$topictext);
106          echo "$warning";          echo "$warning";
107          echo "<p><b>Ämne: </b><select name=\"topic\">";          echo "<p><b>Ämne: </b><select name=\"topic\">";
108          $toplist = mysql_query("SELECT topicid, topictext FROM topics ORDER BY topictext");          $toplist = mysql_query("SELECT topicid, topictext FROM topics ORDER BY topictext");
# Line 112  function PreviewStory($name, $address, $ Line 116  function PreviewStory($name, $address, $
116          </select>          </select>
117          <p><b>Skriv in din nyhet</b>          <p><b>Skriv in din nyhet</b>
118          (HTML går bra, men dubbelkolla dina URL:ar och HTML-taggar!)<br>          (HTML går bra, men dubbelkolla dina URL:ar och HTML-taggar!)<br>
119          <textarea class="textbox" wrap="virtual" cols="70" rows="12" name="story"><?= "$story"; ?></textarea><br>          <textarea class="textbox" wrap="virtual" cols="70" rows="12" name="story"><?= htmlspecialchars($story); ?></textarea><br>
120          <font size="2">(Testade du dina länkar om de fungerade? Skrev du in dem korrekt?)</font><p>          <font size="2">(Testade du dina länkar om de fungerade? Skrev du in dem korrekt?)</font><p>
121          <?php if($speling) { ?>          <?php if($speling) { ?>
122          <input type="checkbox" id="spell" name="spell" <?= ($spell) ? "checked" : ""; ?>>&nbsp;<label for="spell">Kontrollera stavning</label><br>          <input type="checkbox" id="spell" name="spell" <?= ($spell) ? "checked" : ""; ?>>&nbsp;<label for="spell">Kontrollera stavning</label><br>
# Line 124  function PreviewStory($name, $address, $ Line 128  function PreviewStory($name, $address, $
128          include('footer.php');          include('footer.php');
129  }  }
130    
131  function submitStory($name, $address, $subject, $story, $topic) {  function submitStory($name, $address, $subject, $story, $topic, $spell) {
132          global $user, $EditedMessage, $cookie;          global $user, $EditedMessage, $cookie;
133            if ($topic == '') {
134                    PreviewStory($name, $address, $subject, $story,
135                                 $topic, $spell);
136                    return;
137            }
138          include('header.php');          include('header.php');
139          echo 'Tack för ditt bidrag!';          echo 'Tack för ditt bidrag!';
140          include('footer.php');          include('footer.php');
# Line 139  function submitStory($name, $address, $s Line 148  function submitStory($name, $address, $s
148                  $name = "Anonymous";                  $name = "Anonymous";
149          }          }
150          $subject = stripslashes(FixQuotes(check_html($subject, "nohtml")));          $subject = stripslashes(FixQuotes(check_html($subject, "nohtml")));
151          $story = stripslashes(FixQuotes($story));          $story = filter_text(stripslashes(FixQuotes($story)));
152          $result = mysql_query("insert into queue values (NULL, '$uid', '$name', '$subject', '$story', now(), '$topic')");          $result = mysql_query("insert into queue values (NULL, '$uid', '$name', '$subject', '$story', now(), '$topic')");
153          if(!$result) {          if(!$result) {
154                  echo mysql_errno(). ": ".mysql_error(). "<br>";                  echo mysql_errno(). ": ".mysql_error(). "<br>";
# Line 156  switch($op) Line 165  switch($op)
165                  PreviewStory($name, $address, $subject, $story, $topic, $spell);                  PreviewStory($name, $address, $subject, $story, $topic, $spell);
166                  break;                  break;
167          case "Ok!":          case "Ok!":
168                  SubmitStory($name, $address, $subject, $story, $topic);                  SubmitStory($name, $address, $subject, $story, $topic, $spell);
169                  break;                  break;
170          default:          default:
171                  defaultDisplay();                  defaultDisplay();

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

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