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

add.php3

<?php
/* daCode _ http://www.dacode.org/
 * $Id: add.php3,v 1.16.2.10 2003/02/07 23:16:37 ruffy Exp $
 */

      $topdir = '..';
      require $topdir."/dacode.php3";
      $utils = LoadClass('Utils');
      $session = LoadClass('Session');

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

      $table = (isset($HTTP_POST_VARS['table']))?$HTTP_POST_VARS['table']:"";
      if (is_array($table)) {
            $config->news_id = (isset($table['news_id'])) ? $table['news_id'] : "";
      }
      if (is_array($table) && isset($table['res_type'])) {
            $res_type = $table['res_type'];
      } else if (isset($HTTP_POST_VARS['res_type'])) {
            $res_type = $HTTP_POST_VARS['res_type'];
      } else if (isset($HTTP_GET_VARS['res_type'])) {
            $res_type = $HTTP_GET_VARS['res_type'];
      }
      if (is_array($table) && isset($table['news_id'])) {
            $news_id = $table['news_id'];
      } else if (isset($HTTP_POST_VARS['news_id'])) {
            $news_id = $HTTP_POST_VARS['news_id'];
      } else if (isset($HTTP_GET_VARS['news_id'])) {
            $news_id = $HTTP_GET_VARS['news_id'];
      }
      if (is_array($table) && isset($table['com_id'])) {
            $com_id = $table['com_id'];
      } else if (isset($HTTP_POST_VARS['com_id'])) {
            $com_id = $HTTP_POST_VARS['com_id'];
      } else if (isset($HTTP_GET_VARS['com_id'])) {
            $com_id = $HTTP_GET_VARS['com_id'];
      }
      $html = LoadClass('Html');
      $resources = LoadClass($config->resources[$res_type]);
      //  Those classes are used in templates
      $comments = LoadClass('Comments',1);  // NOT optimized if "add" :(
      if (is_array($table)) {
            $config->news_id = (isset($table['news_id'])) ? $table['news_id'] : "";
      }
      $user = LoadClass('User');
      $submitComment = LoadClass('SubmitComments');
      $sidebox = LoadClass('Sidebox');

      if (isset($op) &&
            $op == lecho("Change")) {
            if (isset($HTTP_POST_VARS['hide_sig']) &&
                  $HTTP_POST_VARS['hide_sig']=="on") {
                  $config->hide_sig=1;
            } else {
                  $config->hide_sig=0;
            }

            $utils->debug($resources->getTopicUrl($news_id,1,$score));
            $utils->debug("score |$score|\n");
            header("Location: ".$resources->getTopicUrl($news_id,1,$score));
            exit;
      }

      if (is_array($table)) {
            $news_id = $table['news_id'];
            $res_type = $table['res_type'];
            $config->news_id = $table['news_id'];
            $com_id = (isset($table['com_id'])) ? $table['com_id'] : "";
      } else {
            if (!isset($com_id)) $com_id = 0;
      }
  if (empty($table)) $table=array();
      $html->parsetemplate('submitcom.tmpl');
?>

Generated by  Doxygen 1.6.0   Back to index