Changeset 995441
- Timestamp:
- 09/23/2014 02:57:01 PM (12 years ago)
- Location:
- button-maker/trunk
- Files:
-
- 4 edited
-
buttons.php (modified) (10 diffs)
-
data_show.php (modified) (4 diffs)
-
edit_btn.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
button-maker/trunk/buttons.php
r995372 r995441 6 6 Author: Pluginhandy 7 7 Author URI: http://pluginhandy.com/ 8 Version: 1. 0.08 Version: 1.1 9 9 Text Domain: 10 10 License: GPL version 2 or later - … … 25 25 $comp_table_prefix=$wpdb->prefix; 26 26 define('PROF_TABLE_PREFIX', $comp_table_prefix); 27 $btntable = PROF_TABLE_PREFIX."custom_btns"; 27 28 28 29 function demo_install() … … 64 65 add_action('wp_ajax_map_post_type_show','map_post_type_show'); 65 66 function map_post_type_show() { 67 $btntable = PROF_TABLE_PREFIX."custom_btns"; 66 68 if(isset($_POST['btn_id'])) { 67 69 global $wpdb; 70 68 71 //echo "<pre>";print_r($_POST);die(); 69 72 $id = $_POST['btn_id']; 70 73 /* update clicks */ 71 $wpdb->query("UPDATE ` wp_custom_btns` set clicks=(clicks+1) where id=$id");74 $wpdb->query("UPDATE `$btntable` set clicks=(clicks+1) where id=$id"); 72 75 73 $getbtn = $wpdb->get_results("Select * from ` wp_custom_btns` where id=$id");76 $getbtn = $wpdb->get_results("Select * from `$btntable` where id=$id"); 74 77 if($getbtn != NULL) { 75 78 $url = $getbtn[0]->url; … … 91 94 foreach($getbtns as $btnid) { 92 95 /* update impressions */ 93 $wpdb->query("UPDATE ` wp_custom_btns` set impressions=(impressions+1) where id=$btnid");96 $wpdb->query("UPDATE `$btntable` set impressions=(impressions+1) where id=$btnid"); 94 97 } 95 98 … … 155 158 156 159 if(isset($_POST['save_btn'])) { 157 //echo "<pre>";print_r($_POST);exit; 160 //$tables = $wpdb->get_results("Select * from `$btntable`"); 161 //echo "<pre>";print_r($tables);print_r($_POST);exit; 158 162 $text = $_POST['btn_text']; 159 163 $size = $_POST['font_size']; … … 167 171 $html = trim($_POST['btn_html']); 168 172 $current_time = time(); 169 $wpdb->query("INSERT INTO ` wp_custom_btns`(`text`, `size`, `color`, `height`, `width`, `background`, `hover`, `shape`, `url`, `clicks`, `impressions`, `html`, `created_at`) VALUES('$text','$size','$color','$height','$width','$backcolor','$hovercolor','$shape','$url','0','0','$html','$current_time')");173 $wpdb->query("INSERT INTO `$btntable`(`text`, `size`, `color`, `height`, `width`, `background`, `hover`, `shape`, `url`, `clicks`, `impressions`, `html`, `created_at`) VALUES('$text','$size','$color','$height','$width','$backcolor','$hovercolor','$shape','$url','0','0','$html','$current_time')"); 170 174 $nextpage = site_url().'/wp-admin/admin.php?page=button-maker/buttons.php'; 171 175 echo "<script type='text/javascript'>document.location.href='$nextpage';</script>"; … … 186 190 $url = $_POST['url']; 187 191 $html = trim($_POST['btn_html']); 188 $wpdb->query("UPDATE ` wp_custom_btns` set text='$text',size='$size',color='$color',height='$height',width='$width',background='$backcolor',hover='$hovercolor',url='$url',shape='$shape',html='$html' where id=$id");192 $wpdb->query("UPDATE `$btntable` set text='$text',size='$size',color='$color',height='$height',width='$width',background='$backcolor',hover='$hovercolor',url='$url',shape='$shape',html='$html' where id=$id"); 189 193 $nextpage = site_url().'/wp-admin/admin.php?page=button-maker/buttons.php'; 190 194 echo "<script type='text/javascript'>document.location.href='$nextpage';</script>"; … … 212 216 $isshow = $_POST['is_show']; 213 217 $order = $_POST['order']; 214 $wpdb->query("UPDATE ` wp_custom_btns` SET `show` = '0' WHERE `show` =1;");218 $wpdb->query("UPDATE `$btntable` SET `show` = '0' WHERE `show` =1;"); 215 219 foreach($isshow as $show) { 216 $wpdb->query("UPDATE ` wp_custom_btns` SET `show` = '1' WHERE `id` =$show;");220 $wpdb->query("UPDATE `$btntable` SET `show` = '1' WHERE `id` =$show;"); 217 221 } 218 222 if($order != NULL) { 219 223 foreach($order as $key=>$value) { 220 $wpdb->query("UPDATE ` wp_custom_btns` SET `order` = '$value' WHERE `id` =$key;");224 $wpdb->query("UPDATE `$btntable` SET `order` = '$value' WHERE `id` =$key;"); 221 225 } 222 226 } … … 234 238 235 239 global $wpdb; 236 240 $btntable = PROF_TABLE_PREFIX."custom_btns"; 237 241 /* get all custom buttons */ 238 $getbtns = $wpdb->get_results("Select * from ` wp_custom_btns` WHERE `show`=1 order by `order` asc");242 $getbtns = $wpdb->get_results("Select * from `$btntable` WHERE `show`=1 order by `order` asc"); 239 243 if($getbtns != NULL) { 240 244 $btns = array(); … … 273 277 274 278 global $wpdb; 275 279 $btntable = PROF_TABLE_PREFIX."custom_btns"; 276 280 /* get all custom buttons */ 277 $getbtns = $wpdb->get_results("Select * from ` wp_custom_btns` WHERE `show`=1 order by created_at asc");281 $getbtns = $wpdb->get_results("Select * from `$btntable` WHERE `show`=1 order by created_at asc"); 278 282 if($getbtns != NULL) { 279 283 $btns = ''; -
button-maker/trunk/data_show.php
r995372 r995441 28 28 </script> 29 29 <?php global $wpdb; 30 $btntable = PROF_TABLE_PREFIX."custom_btns"; 30 31 if(isset($_GET['editid']) && $_GET['editid'] != NULL) { 31 32 include 'edit_btn.php'; … … 33 34 34 35 $id = $_GET['delid']; 35 $query = "Delete from wp_custom_btnswhere id=$id";36 $query = "Delete from $btntable where id=$id"; 36 37 $wpdb->query($query); 37 38 $nextpage = site_url().'/wp-admin/admin.php?page=button-maker/buttons.php'; … … 42 43 43 44 $id = $_GET['clearid']; 44 $query = "Update wp_custom_btnsset clicks=0,impressions=0 where id=$id";45 $query = "Update $btntable set clicks=0,impressions=0 where id=$id"; 45 46 $wpdb->query($query); 46 47 $nextpage = site_url().'/wp-admin/admin.php?page=button-maker/buttons.php'; … … 49 50 50 51 } else { 51 $buttons = $wpdb->get_results("Select * from ` wp_custom_btns` order by id desc");52 $buttons = $wpdb->get_results("Select * from `$btntable` order by id desc"); 52 53 //echo "<pre>";print_r($buttons);exit; ?> 53 54 <div class="show_btns"> -
button-maker/trunk/edit_btn.php
r995372 r995441 45 45 <?php global $wpdb; 46 46 $id = $_GET['editid']; 47 $getbtn = $wpdb->get_results("Select * from ` wp_custom_btns` where id=$id");47 $getbtn = $wpdb->get_results("Select * from `$btntable` where id=$id"); 48 48 $shape = $getbtn[0]->shape; 49 49 //echo "<pre>";print_r($getbtn);exit; ?> -
button-maker/trunk/readme.txt
r995372 r995441 131 131 132 132 Issue 1: No changes 133 Issue 1.1 resolved issue with permissions for saving buttons134 133 135 134 136 135 == Upgrade Notice == 137 136 138 Please note that an updated version now exists. This fixes the issues with saving buttons due to permission errors. 137 No upgrades to date
Note: See TracChangeset
for help on using the changeset viewer.