onokazu
onoka****@users*****
2005年 7月 18日 (月) 17:46:30 JST
Index: xoops2jp/html/modules/xoopsfaq/admin/index.php diff -u xoops2jp/html/modules/xoopsfaq/admin/index.php:1.2.6.2 xoops2jp/html/modules/xoopsfaq/admin/index.php:1.2.6.2.2.1 --- xoops2jp/html/modules/xoopsfaq/admin/index.php:1.2.6.2 Thu Apr 21 17:08:17 2005 +++ xoops2jp/html/modules/xoopsfaq/admin/index.php Mon Jul 18 17:46:30 2005 @@ -1,5 +1,5 @@ <?php -// $Id: index.php,v 1.2.6.2 2005/04/21 08:08:17 onokazu Exp $ +// $Id: index.php,v 1.2.6.2.2.1 2005/07/18 08:46:30 onokazu Exp $ // ------------------------------------------------------------------------ // // XOOPS - PHP Content Management System // // Copyright (c) 2000 XOOPS.org // @@ -196,11 +196,14 @@ 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; + } $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().", ".intval($_POST['contents_order']).", ".intval($_POST['contents_visible']).", ".intval($_POST['contents_nohtml']).", ".intval($_POST['contents_nosmiley']).", ".intval($_POST['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";