Changeset 2850884
- Timestamp:
- 01/19/2023 07:23:04 AM (3 years ago)
- Location:
- outgrow/trunk
- Files:
-
- 2 edited
-
outgrow-api.php (modified) (10 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
outgrow/trunk/outgrow-api.php
r2644079 r2850884 167 167 if (isset($_POST['header_script1'])) { 168 168 if($_POST['header_script1']!=""){ 169 $hello="hello"; 169 170 $out=check_Repeat($_POST['header_script1']); 170 171 if($out!="present"){ 171 172 global $wpdb; 173 172 174 $apiKey = sanitize_text_field($_POST['header_script1']); 173 175 $table_name = 'wp_outgrow_calci_table'; … … 182 184 $meta = array(); 183 185 if($res->data){ 184 $calci_count = count ($res->data);186 $calci_count = count_($res->data); 185 187 } 186 188 if ($res->success == "true" || $res->code != 401 && $calci_count>0) { … … 237 239 ); 238 240 // live api 239 $request = Requests::get('https://api-calc.outgrow.co/api/v1/calculator?status=Live&type=All&sort=alpha_as', $headers);241 $request = Requests::get('https://api-calc.outgrow.co/api/v1/calculator?status=Live&type=All&sort=alpha_as', $headers); 240 242 $res = json_decode($request->body); 241 243 if ($res->code == 401 ) { … … 268 270 <form name="form1" method="post" style="margin-bottom:0em;" > 269 271 <div class="main-text-area" > 270 <input type="text" name="header_script1 " class="select-box" id="header_script" Placeholder="Enter/Select API KEY" autocomplete="off">272 <input type="text" name="header_script1[]" class="select-box" id="header_script" Placeholder="Enter/Select API KEY" autocomplete="off"> 271 273 <span class="select-img" onclick="showOption()"> 272 274 <img src="<?php echo plugins_url('/images/select.png', __FILE__) ?>" alt="arrow"> … … 277 279 <div id="main-section-option" style="display: none;"> 278 280 <form name="form1" style="margin-bottom:0em;" method="post"> 279 <ul class="main-list"> 280 <?php 281 global $wpdb; 282 $db_result = $wpdb->get_results('select * from wp_outgrow_calci_api_table'); 281 <ul class="main-list"> 282 283 <?php 284 global $wpdb; 285 $db_result = $wpdb->get_results('select * from wp_outgrow_calci_api_table');?> 286 287 288 <?php 283 289 if($db_result){ 284 290 foreach ($db_result as $db_row) { 285 291 ?> 286 292 <li id="api-list"> 287 <input type="button" class="option" id="select-api-key" onclick="selectKey('<?php echo $db_row->api_key ?>')" name ="show_data" value="<?php echo $db_row->api_key ?>"> 293 <input type="button" class="option" id="select-api-key" onclick="selectKey('<?php echo $db_row->api_key ?>')" name ="show_data" value="<?php echo $db_row->api_key ?>"> <?php echo ($_POST['header_script1']);?> 288 294 <button name="delete_data" class="list-close" value="<?php echo $db_row->api_key ?>">x</button> 289 295 </li> … … 291 297 } 292 298 } 299 else{ 300 foreach ($_POST['header_script1'] as $demoel) 301 { 302 ?> 303 <li id="api-list"> 304 <input type="button" class="option" id="select-api-key" 305 onclick="selectKey('<?php echo $demoel; ?>')" name ="show_data" value="<?php echo $demoel; echo $hello;?>"> 306 <button name="delete_data" class="list-close" value="<?php echo $demoel; ?>">x</button> 307 </li> 308 <?php 309 } 310 } 293 311 ?> 294 312 </ul> … … 388 406 'api_key' => $item 389 407 )); 390 if(count ($apiArray)==1){408 if(count_($apiArray)==1){ 391 409 setcookie('API', null, -1, '/'); 392 410 } … … 530 548 531 549 // add_action('wp_before_admin_bar_render', 'wpb_custom_logo'); 532 550 function count_($array) { 551 echo $array; ?> 552 <?php console_log($array); ?> <? 553 return is_array($array) ? count_($array) : 0; 554 } 533 555 534 556 // for api key … … 536 558 global $wpdb; 537 559 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 538 if (count ($wpdb->get_var('SHOW TABLE LIKE "wp_outgrow_calci_api_table"') < 0)) {560 if (count_($wpdb->get_var('SHOW TABLE LIKE "wp_outgrow_calci_api_table"') < 0)) { 539 561 $sql_query_to_create_table = "CREATE TABLE `wp_outgrow_calci_api_table` ( 540 562 `api_key` varchar(160) NOT NULL , … … 548 570 global $wpdb; 549 571 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 550 if (count ($wpdb->get_var('SHOW TABLE LIKE "wp_outgrow_calci_table"') < 0)) {572 if (count_($wpdb->get_var('SHOW TABLE LIKE "wp_outgrow_calci_table"') < 0)) { 551 573 $sql_query_to_create_table = "CREATE TABLE `wp_outgrow_calci_table` ( 552 574 `name` varchar(50) NOT NULL, -
outgrow/trunk/readme.txt
r2634568 r2850884 4 4 Tags: outgrow, quizzes, calculators, polls, interactive calculators, trending calculators, trending quizzes,outgrow calci, outgrow calculator, outgrow quiz, outgrow quizzes, calculator, quiz 5 5 Requires at least:5.2 6 Tested up to: 5.8.27 Stable tag: 2. 06 Tested up to: 6.0.2 7 Stable tag: 2.1 8 8 Requires PHP: 5.2.4 9 9 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.