[xoops-cvslog 252] CVS update: xoops2jp/html/modules/xoopsfaq/admin

Back to archive index

onokazu onoka****@users*****
2005年 7月 18日 (月) 19:21:53 JST


Index: xoops2jp/html/modules/xoopsfaq/admin/index.php
diff -u xoops2jp/html/modules/xoopsfaq/admin/index.php:1.2.6.2.2.1 xoops2jp/html/modules/xoopsfaq/admin/index.php:1.2.6.2.2.2
--- xoops2jp/html/modules/xoopsfaq/admin/index.php:1.2.6.2.2.1	Mon Jul 18 17:46:30 2005
+++ xoops2jp/html/modules/xoopsfaq/admin/index.php	Mon Jul 18 19:21:53 2005
@@ -1,5 +1,5 @@
 <?php
-// $Id: index.php,v 1.2.6.2.2.1 2005/07/18 08:46:30 onokazu Exp $
+// $Id: index.php,v 1.2.6.2.2.2 2005/07/18 10:21:53 onokazu Exp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -196,14 +196,16 @@
 if ($op == "addcontentsgo") {
     $category_id = !empty($_POST['category_id']) ? intval($_POST['category_id']) : 0;
     if ($category_id > 0) {
-        foreach (array('contents_order', 'contents_visible', 'contents_nohtml', 'contents_nosmiley', 'contents_noxcode') as $toint) {
-            ${$toint} = !empty($_POST[$toint]) ? intval($_POST[$toint]) : 0;
-        }
+        $contents_nohtml = !empty($_POST['contents_nohtml']) ? 1 : 0;
+        $contents_nosmiley = !empty($_POST['contents_nosmiley']) ? 1 : 0;
+        $contents_noxcode = !empty($_POST['contents_noxcode']) ? 1 : 0;
+        $contents_visible = !empty($_POST['contents_visible']) ? 1 : 0;
+        $contents_order = !empty($_POST['contents_order']) ? intval($_POST['contents_order']) : 0;
         $myts =& MyTextSanitizer::getInstance();
         $title = $myts->stripSlashesGPC($_POST['contents_title']);
         $contents = $myts->makeTareaData4Save($_POST['contents_contents']);
         $newid = $xoopsDB->genId($xoopsDB->prefix("xoopsfaq_contents")."_contents_id_seq");
-        $sql = "INSERT INTO ".$xoopsDB->prefix("xoopsfaq_contents")." (contents_id, category_id, contents_title, contents_contents, contents_time, contents_order, contents_visible, contents_nohtml, contents_nosmiley, contents_noxcode) VALUES ($newid, $category_id, ".$xoopsDB->quoteString($title).", ".$xoopsDB->quoteString($contents).", ".time().", ".$contents_order.", ".$contents_visible.", ".$contents_nohtml.", ".$contents_nosmiley.", ".contents_noxcode.")";
+        $sql = "INSERT INTO ".$xoopsDB->prefix("xoopsfaq_contents")." (contents_id, category_id, contents_title, contents_contents, contents_time, contents_order, contents_visible, contents_nohtml, contents_nosmiley, contents_noxcode) VALUES ($newid, $category_id, ".$xoopsDB->quoteString($title).", ".$xoopsDB->quoteString($contents).", ".time().", ".$contents_order.", ".$contents_visible.", ".$contents_nohtml.", ".$contents_nosmiley.", ".$contents_noxcode.")";
         if (!$xoopsDB->query($sql)) {
             xoops_cp_header();
             echo "Could not add contents";


xoops-cvslog メーリングリストの案内
Back to archive index