Logo Search packages:      
Sourcecode: dacode version File versions  Download package

score.php3

<?php
/* daCode _ http://www.dacode.org/
 * $Id: score.php3,v 1.24.2.4 2002/10/12 17:32:29 ruffy Exp $
 */

      $topdir = '..';
      require $topdir."/dacode.php3";

      $cache = LoadClass('Cache');
      $user = LoadClass('User');
      $comments = LoadClass('Comments');
      $session = LoadClass('Session');
      $html = LoadClass('Html');

      if (!ereg('^'.$config->baseurl,$HTTP_SERVER_VARS['HTTP_REFERER'])
            && !($session->param & pow(2,3))) {
            $title = lecho("HTTP referer");
            $nobanner = false;
            $utils = LoadClass('Utils');
            $text = $utils->warn_referer();
            $html->parsetemplate('basic.tmpl');
            exit;
      }

      if ($config->moderation_type == 1) {

            if (!($user->checked && ($user->level&pow(2,23)))) {
                  echo lecho("you bad boy...");
                  exit;
            }

            if (isset($table['action']) && $table['action'] == "mod") {
                  $cache->delete_obsolete_news($news_id);
                  $comments->mod_score($table);
                  $text = lecho("Scored!\n");
                  $text .= "<script language=\"javascript\">self.close()</script>\n";
            } else {
                  $text = '<form action="score.'.$config->php.'" type="post">'.
                        '<input type="hidden" name="table[comments_id]" value="'.$id.'" />'.
                        '<input type="hidden" name="table[score]" value="'.$score.'" />'.
                        '<input type="hidden" name="table[action]" value="mod" />'.
                        '<input type="hidden" name="news_id" value="'.$news_id.'" />'.
                        '<input type="text" name="table[info]" value="" size="20" /><br />'.
                        '<center><input type="submit" name="table[submit]" value="Submit!"></center>'.
                        '</form>';
            }
            $text = '<div class="sboxtext">'.$text.'</div>';
            $nobanner = 1;
            $html->parsetemplate('basic.tmpl');
      } elseif ($config->moderation_type == 2) {

            $comments->set_score($id,$news_id,$score,$localuserid);

            /*
             * For this type of moderation, we just close the window
             */
?>
<html>
      <head>
      <script>
            self.close();
      </script>
      </head>
<body>
Please close this window!
</body>
</html>
      <?php


      }
?>

Generated by  Doxygen 1.6.0   Back to index