redirect(FUSION_SELF.$aidlink."&error=".$error);
$tabsettings = dbarray(dbquery("SELECT * FROM ".DB_BOOTSTRAP_TABS.""));
$error = 0;
if (isset($_POST['savesettings'])) {
$result = dbquery("UPDATE ".DB_BOOTSTRAP_TABS." SET
bs_tab_style='".(isNum($_POST['bs_tab_style']) ? $_POST['bs_tab_style'] : "0")."',
if (!$result) { $error = 1; }
redirect(FUSION_SELF.$aidlink."&error=". $error);
}
if (check_post('savesettings')) {
$data = [
'bs_tab_style' => sanitizer('bs_tab_style', 0, 'bs_tab_style'),
];
dbquery_insert(DB_BOOTSTRAP_TABS, $data, 'update');
// this is the same thing but it doesn't look good
/*dbquery("UPDATE ".DB_BOOTSTRAP_TABS." SET
bs_tab_style=:bs_tab_style,
", [
':bs_tab_style' : post('bs_tab_style', FILTER_SANITIZE_NUMBER_INT),
]);*/
if (fusion_safe()) {
addnotice('success', 'Updated....'); // thanks to sessions, after refresh you will see the notice and no need old style error messages
redirect(FUSION_SELF.$aidlink);
}
}
$_POST['...']
you should use post('...')
.check_post('....')
or for array check_post(['....'])
is the same as isset($_POST['....'])
post('....')
or array post(['....'])
is the same as $_POST['....']
Quote
This item cannot be infused
if (check_post('savetab1settings')) {
$data = [
'tab1_enable' => sanitizer('tab1_enable', 0, 'tab1_enable'),
'tab1_name' => sanitizer('tab1_name', 0, 'tab1_name'),
'tab1_content' => sanitizer('tab1_content', 0, 'tab1_content'),
];
dbquery_insert(DB_BOOTSTRAP_TABS, $data, 'update');
if (fusion_safe()) {
addnotice('success', 'Updated....'); // thanks to sessions, after refresh you will see the notice and no need old style error messages
redirect(FUSION_SELF.$aidlink);
}
}
$data = [
'tab1_enable' => sanitizer('tab1_enable', 0, 'tab1_enable'),
'tab1_name' => sanitizer('tab1_name', '', 'tab1_name'), // i assume this is string
'tab1_content' => sanitizer('tab1_content', '', 'tab1_content'), // and this too
];
Quote
so far I have not been able to get it to infuse
foreach ($infs as $i => $inf) {
$adminpanel = !empty($inf['mlt_adminpanel'][LANGUAGE][0]) ? $inf['mlt_adminpanel'][LANGUAGE][0] : $inf['adminpanel'][0];
Line 70 -- 1 hour ago
Undefined offset: 0
$title = $inf['status'] > 0 ? '<a
href="'.INFUSIONS.$inf['folder'].'/'.$adminpanel['panel'].fusion_get_aidlink().'">'.$inf['title'].'</a>' : $inf['title'];
Line 89 -- 1 hour ago
Trying to access array offset on value of type null
echo "<div class='hidden-xs hidden-sm col-md-1 col-lg-1'><span class='badge'>".$adminpanel['rights']."</span></div>n";
Line 93 -- 1 hour ago
Trying to access array offset on value of type null
echo "<div class='hidden-xs hidden-sm col-md-2 col-lg-1'>".(!empty($inf['version']) ? $inf['version'] : '')."</div>n";
95 echo "<div class='hidden-xs hidden-sm col-md-12 col-md-offset-2 col-lg-3 col-lg-offset-0'>".($inf['url'] ? "<a href='".$inf['url']."'
target='_blank'>" : "")." ".(!empty($inf['developer']) ? $inf['developer'] : $locale['410'])." ".($inf['url'] ? "</a>" : "")."
<br/>".($inf['email'] ? "<a href='mailto:".$inf['email']."'>".$locale['409']."</a>" : '')."</div>n";
if (check_post('savetab1settings')) {
$data = [
'tab1_enable' => sanitizer('tab1_enable', 0, 'tab1_enable'),
'tab1_name' => sanitizer('tab1_name', '', 'tab1_name'),
'tab1_content' => sanitizer('tab1_content', '', 'tab1_content'),
];
dbquery_insert(DB_BOOTSTRAP_TABS, $data, 'update');
if (fusion_safe()) {
addnotice('success', 'Updated....'); // thanks to sessions, after refresh you will see the notice and no need old style error messages
redirect(FUSION_SELF.$aidlink);
}
}
'tab1_id' => sanitizer('tab1_id', 0, 'tab1_id'),
and in form add hidden input that has current id as value. Function dbquery_insert should autodetect it, but not always it's possible to detect.dbquery_insert(DB_BOOTSTRAP_TABS, $data, 'update', , ['primary_key' => 'tab1_name']);
dbquery("UPDATE ".DB_BOOTSTRAP_TABS." SET
tab1_enable=:tab1_enable,....
", [
':tab1_enable' : post('tab1_enable', FILTER_SANITIZE_NUMBER_INT),
]);
dbquery("UPDATE table SET column=:value1", [
':value1' : 'value',
]);
$tab2_name = "";
$tab2_content = "";
$tabsettings = dbarray(dbquery("SELECT * FROM ".DB_BOOTSTRAP_TABS.""));
if (isset($_POST['savetab2settings'])) {
$result = dbquery("UPDATE ".DB_BOOTSTRAP_TABS." SET
tab2_enable='".(isNum($_POST['tab2_enable']) ? $_POST['tab2_enable'] : "0")."',
tab2_name='".stripslashes($_POST['tab2_name'])."',
tab2_content='".addslashes($_POST['tab2_content'])."'");
}
$tab2_name = "";
$tab2_content = "";
$tabsettings = dbarray(dbquery("SELECT * FROM ".DB_BOOTSTRAP_TABS.""));
if (check_post('savetab2settings')) {
$data = [
'tab2_enable' => sanitizer('tab2_enable', 0, 'tab2_enable'),
'tab2_name' => sanitizer('tab2_name', '', 'tab2_name'),
'tab2_content' => sanitizer('tab2_content', '', 'tab2_content'),
];
dbquery_insert(DB_BOOTSTRAP_TABS, $data, 'update');
if (fusion_safe()) {
addnotice('success', 'Updated....'); // thanks to sessions, after refresh you will see the notice and no need old style error messages
redirect(FUSION_SELF.$aidlink);
}
}
$result = dbquery("UPDATE ".DB_BOOTSTRAP_TABS." SET
tab2_enable='".(isNum($_POST['tab2_enable']) ? $_POST['tab2_enable'] : "0")."',
tab2_name='".stripslashes($_POST['tab2_name'])."',
tab2_content='".addslashes($_POST['tab2_content'])."'
");
$result = dbquery("UPDATE ".DB_BOOTSTRAP_TABS." SET
tab2_enable=:tab2_enable,
tab2_name=:tab2_name,
tab2_content=:tab2_content
", [
':tab2_enable' => (isNum($_POST['tab2_enable']) ? $_POST['tab2_enable'] : "0"),
':tab2_name' => stripslashes($_POST['tab2_name']),
':tab2_content' => addslashes($_POST['tab2_content']),
]);
Category Forum
Modifications and Requests - 9Labels
Statistics
3 participants
Notifications
You are not receiving notifications from this thread.
Related Questions