Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

New formular Field in Forum - need help with save data in DB

i want a formular field in my Forum so i have add this in administration/forums.php and add a row in my database sound "preferred"
see attached picture

i have add the field in my code and it works perfect (see image) .. but what not work is the the data save in my DB.
I get no errors ... but my DB Flied "preferred" is always empty and i know not why.
Here my modificied part where the script write data in DB (i hope thats all parts what i have to change)

what i change (makred with red)
1.) ...... (forum_cat, forum_name, preferred, forum_order, forum_description, forum_moderators,......
2.) ...VALUES ('0', '$cat_name', '','$cat_order', '', '', '0', '0', '0', '0', '0', '0', '0', '0')"); ...

and near end of this code

1.) ....(forum_cat, forum_name, preferred, forum_order, forum_description, forum_moderators, ...
2.) ....VALUES ('".$forum_cat."', '".$forum_name."', '0','".$forum_order."', '".$forum_description."', '103', '101', '101', '101', '0', '0', '0', '0', '0', '0', '0')");...

in attchament y pic of my database and the complete administration/forums.php

CodeDownload  
if (isset($_POST['save_cat'])) {
   $cat_name = trim(stripinput($_POST['cat_name']));
   if ($cat_name != "") {
      if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['forum_id']) && isnum($_GET['forum_id'])) && (isset($_GET['t']) && $_GET['t'] == "cat")) {
         $result = dbquery("UPDATE ".DB_FORUMS." SET forum_name='$cat_name' WHERE forum_id='".$_GET['forum_id']."'");
         redirect(FUSION_SELF.$aidlink."&status=savecu");
      } else {
         $cat_order = isnum($_POST['cat_order']) ? $_POST['cat_order'] : "";
         if(!$cat_order) $cat_order=dbresult(dbquery("SELECT MAX(forum_order) FROM ".DB_FORUMS." WHERE forum_cat='0'"),0)+1;
         $result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order+1 WHERE forum_cat='0' AND forum_order>='$cat_order'");
         $result = dbquery("INSERT INTO ".DB_FORUMS." (forum_cat, forum_name, preferred, forum_order, forum_description, forum_moderators, forum_access, forum_post, forum_reply, forum_poll, forum_vote, forum_attach, forum_lastpost, forum_lastuser) VALUES ('0', '$cat_name', '','$cat_order', '', '', '0', '0', '0', '0', '0', '0', '0', '0')");
         redirect(FUSION_SELF.$aidlink."&status=savecn");
      }
   } else {
      redirect(FUSION_SELF.$aidlink."&status=savect");
   }
} elseif (isset($_POST['save_forum'])) {
   $forum_name = trim(stripinput($_POST['forum_name']));
   $forum_description = trim(stripinput($_POST['forum_description']));
   $forum_cat = isnum($_POST['forum_cat']) ? $_POST['forum_cat'] : 0;
   if ($forum_name != "") {
      if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['forum_id']) && isnum($_GET['forum_id'])) && (isset($_GET['t']) && $_GET['t'] == "forum")) {
         $forum_mods = $_POST['forum_mods'];
         $forum_access = isnum($_POST['forum_access']) ? $_POST['forum_access'] : 0;
         $forum_post = isnum($_POST['forum_post']) ? $_POST['forum_post'] : 0;
         $forum_reply = isnum($_POST['forum_reply']) ? $_POST['forum_reply'] : 0;
         $forum_attach = isnum($_POST['forum_attach']) ? $_POST['forum_attach'] : 0;
         $forum_attach_download = isnum($_POST['forum_attach_download']) ? $_POST['forum_attach_download'] : 0;
         $forum_poll = isnum($_POST['forum_poll']) ? $_POST['forum_poll'] : 0;
         $forum_vote = isnum($_POST['forum_vote']) ? $_POST['forum_vote'] : 0;
         $forum_merge = (isset($_POST['forum_merge']) && isnum($_POST['forum_merge']) ? $_POST['forum_merge'] : 0);
         $result = dbquery("UPDATE ".DB_FORUMS." SET forum_name='".$forum_name."', forum_cat='".$forum_cat."', forum_description='".$forum_description."', forum_moderators='".$forum_mods."', forum_access='".$forum_access."', forum_post='".$forum_post."', forum_reply='".$forum_reply."', forum_attach='".$forum_attach."', forum_attach_download='".$forum_attach_download."', forum_poll='".$forum_poll."', forum_vote='".$forum_vote."', forum_merge='".$forum_merge."' WHERE forum_id='".$_GET['forum_id']."'");
         redirect(FUSION_SELF.$aidlink."&status=savefu");
      } else {
         $uniqueCheck = dbcount("(forum_id)", DB_FORUMS, "forum_cat='".$forum_cat."' AND forum_name='".$forum_name."'");
         if ($uniqueCheck != 0) { redirect(FUSION_SELF.$aidlink."&status=saveft"); }
         $forum_order = isnum($_POST['forum_order']) ? $_POST['forum_order'] : "";
         if(!$forum_order) $forum_order=dbresult(dbquery("SELECT MAX(forum_order) FROM ".DB_FORUMS." WHERE forum_cat='$forum_cat'"),0)+1;
         $result = dbquery("UPDATE ".DB_FORUMS." SET forum_order=forum_order+1 WHERE forum_cat='$forum_cat' AND forum_order>='$forum_order'");
         $result = dbquery("INSERT INTO ".DB_FORUMS." (forum_cat, forum_name, preferred, forum_order, forum_description, forum_moderators, forum_access, forum_post, forum_reply, forum_attach, forum_attach_download, forum_poll, forum_vote, forum_lastpost, forum_lastuser, forum_merge) VALUES ('".$forum_cat."', '".$forum_name."', '0','".$forum_order."', '".$forum_description."', '103', '101', '101', '101', '0', '0', '0', '0', '0', '0', '0')");
         redirect(FUSION_SELF.$aidlink."&status=savefn");



Merged on Oct 20 2015 at 14:59:46:
none can help? i have atm no idea whats wrong but it dosent work :(
Catzenjaeger attached the following file:
forums.zip [1.32kB / 112 Downloads]
2_5.jpg [32.68kB / 25 Downloads]
1_8.jpg [203.95kB / 26 Downloads]
Thread Information
Author
Replies
1 post
Views
618 times
Last Post
Last updated on 4 years ago
Related Threads
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Catzenjaeger