[ Index ]
 

Code source de e107 0.7.8

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/e107_plugins/content/ -> content_submit.php (source)

   1  <?php
   2  /*
   3  +---------------------------------------------------------------+
   4  |        e107 website system
   5  |        /admin/review.php
   6  |
   7  |        ©Steve Dunstan 2001-2002
   8  |        http://e107.org
   9  |        jalist@e107.org
  10  |
  11  |        Released under the terms and conditions of the
  12  |        GNU General Public License (http://gnu.org).
  13  |
  14  |        $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/content_submit.php,v $
  15  |        $Revision: 1.25 $
  16  |        $Date: 2006/12/07 12:57:01 $
  17  |        $Author: mrpete $
  18  +---------------------------------------------------------------+
  19  */
  20  
  21  require_once ("../../class2.php");
  22  
  23  $plugindir = e_PLUGIN."content/";
  24  
  25  require_once ($plugindir."content_shortcodes.php");
  26  require_once(e_HANDLER."form_handler.php");
  27  require_once(e_HANDLER."userclass_class.php");
  28  $rs = new form;
  29  require_once ($plugindir."handlers/content_class.php");
  30  $aa = new content;
  31  require_once ($plugindir."handlers/content_db_class.php");
  32  $adb = new contentdb;
  33  require_once ($plugindir."handlers/content_form_class.php");
  34  $aform = new contentform;
  35  require_once(e_HANDLER."file_class.php");
  36  $fl = new e_file;
  37  e107_require_once(e_HANDLER.'arraystorage_class.php');
  38  $eArrayStorage = new ArrayData();
  39  
  40  //these have to be set for the tinymce wysiwyg
  41  $e_wysiwyg    = "content_text";
  42  global $tp;
  43  
  44  $lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content.php';
  45  include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content.php');
  46  
  47  if(e_QUERY){
  48      $qs = explode(".", e_QUERY);
  49  }
  50  
  51  // define e_pagetitle
  52  $aa -> setPageTitle();
  53  
  54  require_once(HEADERF);
  55  
  56  if(isset($_POST['create_content'])){
  57      if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none" && $_POST['content_author_name'] != "" && $_POST['content_author_email'] != ""){
  58          $adb -> dbContent("create", "submit");
  59      }else{
  60          $message = CONTENT_ADMIN_SUBMIT_LAN_4;
  61      }
  62  }
  63  
  64  if(isset($qs[0]) && $qs[0] == "s"){
  65      $message = CONTENT_ADMIN_SUBMIT_LAN_2."<br /><br />".CONTENT_ADMIN_SUBMIT_LAN_5;
  66      $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
  67      require_once(FOOTERF);
  68      exit;
  69  }
  70  if(isset($qs[0]) && $qs[0] == "d"){
  71      $message = CONTENT_ADMIN_SUBMIT_LAN_3."<br /><br />".CONTENT_ADMIN_SUBMIT_LAN_5;
  72      $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
  73      require_once(FOOTERF);
  74      exit;
  75  }
  76  
  77  if(isset($message)){
  78      $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
  79  }
  80  
  81  if(!isset($qs[0])){
  82      if(!$sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_icon, content_pref", "content_parent = '0' AND content_class REGEXP '".e_CLASS_REGEXP."' ORDER BY content_heading")){
  83          $text .= "<div style='text-align:center;'>".CONTENT_ADMIN_SUBMIT_LAN_0."</div>";
  84      }else{
  85          if(!isset($CONTENT_SUBMIT_TYPE_TABLE)){
  86              if(is_readable(e_THEME.$pref['sitetheme']."/content/content_submit_type_template.php")){
  87                  require_once(e_THEME.$pref['sitetheme']."/content/content_submit_type_template.php");
  88              }else{
  89                  require_once(e_PLUGIN."content/templates/content_submit_type_template.php");
  90              }
  91          }
  92          $sql2 = "";
  93          $content_submit_type_table_string = "";
  94          $count = "0";
  95          while($row = $sql -> db_Fetch()){
  96              if(!is_object($sql2)){ $sql2 = new db; }
  97  
  98              $content_pref                    = $eArrayStorage->ReadArray($row['content_pref']);
  99              $content_pref["content_cat_icon_path_large"] = ($content_pref["content_cat_icon_path_large"] ? $content_pref["content_cat_icon_path_large"] : "{e_PLUGIN}content/images/cat/48/" );
 100              $content_pref["content_cat_icon_path_small"] = ($content_pref["content_cat_icon_path_small"] ? $content_pref["content_cat_icon_path_small"] : "{e_PLUGIN}content/images/cat/16/" );
 101              $content_cat_icon_path_large    = $tp -> replaceConstants($content_pref["content_cat_icon_path_large"]);
 102              $content_cat_icon_path_small    = $tp -> replaceConstants($content_pref["content_cat_icon_path_small"]);
 103              $content_icon_path                = $tp -> replaceConstants($content_pref["content_icon_path"]);
 104              if($content_pref["content_submit"] && check_class($content_pref["content_submit_class"])){
 105                  $content_submit_type_table_string .= $tp -> parseTemplate($CONTENT_SUBMIT_TYPE_TABLE, FALSE, $content_shortcodes);
 106                  $count = $count + 1;
 107              }
 108          }
 109          if($count == "0"){
 110              $text .= "<div style='text-align:center;'>".CONTENT_ADMIN_SUBMIT_LAN_0."</div>";
 111          }else{
 112              $text = $CONTENT_SUBMIT_TYPE_TABLE_START.$content_submit_type_table_string.$CONTENT_SUBMIT_TYPE_TABLE_END;
 113          }
 114      }
 115      $caption = CONTENT_ADMIN_SUBMIT_LAN_1;
 116      $ns -> tablerender($caption, $text);
 117  }
 118  
 119  if(isset($qs[0]) && $qs[0]=="content" && $qs[1] == "submit" && is_numeric($qs[2]) && !isset($qs[3])){
 120      //check if valid categories exist for this main parent
 121      $array            = $aa -> getCategoryTree("", intval($qs[2]), TRUE);
 122      $validparent    = implode(",", array_keys($array));
 123      $qry            = " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ";
 124      $sql2            = new db;
 125      //$contenttotal    = $sql2 -> db_Count($plugintable, "(*)", "WHERE ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' " );
 126      $aform -> show_create_content("submit");
 127  }
 128  
 129  require_once(FOOTERF);
 130  
 131  ?>


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7