Changeset 1511112
- Timestamp:
- 10/09/2016 01:30:04 PM (8 years ago)
- Location:
- custom-tables/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
custom-tables/trunk/custom-tables.php
r1509473 r1511112 445 445 function smarttag_form($atts) { 446 446 global $wpdb; 447 extract(shortcode_atts(array('id' => '', 'limit' => '50', 'def' => false ), $atts));447 extract(shortcode_atts(array('id' => '', 'limit' => '50', 'def' => false, 'url' => ''), $atts)); 448 448 449 449 if ($this->prem_chk() !== true) { $out = __('Premium functionality has not been activated in the plugin. Please check for a valid licence!', 'wct'); } -
custom-tables/trunk/pages/show_form.php
r1509473 r1511112 21 21 if ($form->r_filter != '') { $filter = "AND ".sqldatefilter(stripslashes($form->r_filter)); } else { $filter = ''; } 22 22 if ($form->toapprove == '1') { 23 $wpdb->get_row("UPDATE `".$wpdb->prefix."wct".$form->r_table."` SET `status`='passive' WHERE `status` != 'passive' AND `id`='".mres($_GET['wctdfid'])."' ".$filter." LIMIT 1;"); 23 24 do_action('wct_formupdate', array('id' => $_GET['wctdfid'], 'action' => 'update')); 24 $wpdb->get_row("UPDATE `".$wpdb->prefix."wct".$form->r_table."` SET `status`='passive' WHERE `status` != 'passive' AND `id`='".mres($_GET['wctdfid'])."' ".$filter." LIMIT 1;");25 25 } 26 26 else { 27 $wpdb->get_row("DELETE FROM `".$wpdb->prefix."wct".$form->r_table."` WHERE `status` != 'passive' AND `id`='".mres($_GET['wctdfid'])."' ".$filter." LIMIT 1;"); 27 28 do_action('wct_formupdate', array('id' => $_GET['wctdfid'], 'action' => 'delete')); 28 $wpdb->get_row("DELETE FROM `".$wpdb->prefix."wct".$form->r_table."` WHERE `status` != 'passive' AND `id`='".mres($_GET['wctdfid'])."' ".$filter." LIMIT 1;");29 29 } 30 30 if ($form->smail == '1') { … … 32 32 } 33 33 $_GET['wctdfid'] = ''; 34 if ($url != '') { wp_redirect( $url ); exit; } 34 35 } 35 36 elseif ($_GET['wctefid'] == 'save') { … … 80 81 if ($_GET['wct'.$tmpvar.'fid'] == '' AND $form->rights[2] == '1') { 81 82 if ($form->smail == '1') { 82 do_action('wct_formupdate', array('id' => $_GET['wctdfid'], 'action' => 'new'));83 83 $wpdb->get_row("INSERT INTO `".$wpdb->prefix."wct".$form->r_table."` SET ".$sqlstring.", `status`='".($form->toapprove != '1' ? 'active' : 'draft')."';"); 84 84 $tableid = $wpdb->insert_id; … … 86 86 } 87 87 else { 88 do_action('wct_formupdate', array('id' => $_GET['wctdfid'], 'action' => 'new'));89 88 $wpdb->get_row("INSERT INTO `".$wpdb->prefix."wct".$form->r_table."` SET ".$sqlstring.", `status`='active';"); 90 89 } 90 do_action('wct_formupdate', array('id' => $_GET['wctdfid'], 'action' => 'new')); 91 if ($url != '') { wp_redirect( $url ); exit; } 91 92 } 92 93 elseif ($_GET['wct'.$tmpvar.'fid'] != '' AND $form->rights[1] == '1') { 93 94 if ($form->smail == '1') { 94 do_action('wct_formupdate', array('id' => $_GET['wctdfid'], 'action' => 'update'));95 95 $wpdb->get_row("UPDATE `".$wpdb->prefix."wct".$form->r_table."` SET ".$sqlstring.",`status`='".($form->toapprove != '1' ? 'active' : 'draft')."' WHERE `status`!='passive' AND `id`='".mres($_GET['wct'.$tmpvar.'fid'])."' LIMIT 1;"); 96 96 $createid = $wpdb->insert_id; 97 97 if ($createid != '0') { wp_mail(get_option( 'admin_email' ), "Custom Forms - ".__('Entry was updated','wct'),"Please check the if the Entry can be published (located in draft Section).\r\n\r\nLink ".admin_url('admin.php?page=wct_table_'.$form->r_table.'&wcttab=content&wcttab2=draft&action=edit&wcts=0&rid='.$createid)); } 98 do_action('wct_formupdate', array('id' => $_GET['wctdfid'], 'action' => 'new')); 98 99 } 99 100 else { 101 102 $wpdb->get_row("UPDATE `".$wpdb->prefix."wct".$form->r_table."` SET ".$sqlstring." WHERE `status`!='passive' AND `id`='".mres($_GET['wct'.$tmpvar.'fid'])."' LIMIT 1;"); 100 103 do_action('wct_formupdate', array('id' => $_GET['wctdfid'], 'action' => 'update')); 101 $wpdb->get_row("UPDATE `".$wpdb->prefix."wct".$form->r_table."` SET ".$sqlstring." WHERE `status`!='passive' AND `id`='".mres($_GET['wct'.$tmpvar.'fid'])."' LIMIT 1;");102 }104 } 105 if ($url != '') { wp_redirect( $url ); exit; } 103 106 } 104 107 }
Note: See TracChangeset
for help on using the changeset viewer.