Changeset 469958
- Timestamp:
- 12/01/2011 07:00:48 PM (14 years ago)
- Location:
- wp2phone/trunk
- Files:
-
- 9 edited
-
css/style.css (modified) (2 diffs)
-
includes/add-comment.php (modified) (2 diffs)
-
includes/content_page.php (modified) (8 diffs)
-
includes/functions.php (modified) (5 diffs)
-
includes/main_page.php (modified) (2 diffs)
-
includes/request-comment.php (modified) (1 diff)
-
includes/request-post.php (modified) (2 diffs)
-
plugin.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp2phone/trunk/css/style.css
r459686 r469958 1 1 label 2 2 { 3 line-height:20px; 4 vertical-align:middle; 5 float:left; 6 width: 180px; 7 color:#000000; 8 } 9 3 line-height:20px; 4 vertical-align:middle; 5 float:left; 6 width: 180px; 7 color:#000000; 8 } 10 9 .wp2p_description 11 10 { … … 18 17 height:50px; 19 18 } 20 21 19 .changeCursor 22 20 { 23 cursor:move;21 cursor:move; 24 22 } -
wp2phone/trunk/includes/add-comment.php
r454994 r469958 13 13 header('content-type: text/json; charset=utf-8'); 14 14 15 if (isset($_ GET['wp2p-post']) && isset($_GET['wp2p-author']) && isset($_GET['wp2p-email']) && isset($_GET['wp2p-content']))15 if (isset($_POST['wp2p-post-id']) && isset($_POST['wp2p-author']) && isset($_POST['wp2p-email']) && isset($_POST['wp2p-content'])) 16 16 { 17 17 require_once('../../../../wp-load.php'); … … 22 22 $version = ''; 23 23 24 //////////////********************** EN COURS DE DEV ************************///////////////////////25 26 27 $time = current_time('mysql');28 29 24 $data = array( 30 'comment_post_ID' => $_GET['wp2p-post-id'],31 'comment_author' => $_ GET['wp2p-author'],32 'comment_author_email' => $_ GET['wp2p-email'],25 'comment_post_ID' => (int)$_POST['wp2p-post-id'], 26 'comment_author' => $_POST['wp2p-author'], 27 'comment_author_email' => $_POST['wp2p-email'], 33 28 'comment_author_url' => '', 34 'comment_content' => $_ GET['wp2p-content'],35 'comment_type' => ,29 'comment_content' => $_POST['wp2p-content'], 30 'comment_type' => '', 36 31 'comment_parent' => 0, 37 32 'user_id' => 0, 38 'comment_author_IP' => $_SERVER['REMOTE_ADDR'] ;,33 'comment_author_IP' => $_SERVER['REMOTE_ADDR'], 39 34 'comment_agent' => 'wp2phone', 40 'comment_date' => $time,35 'comment_date' => current_time('mysql') 41 36 /*'comment_approved' => 1,*/ 42 37 ); 43 38 44 39 $comment_ID = wp_insert_comment($data); 40 if ($comment_ID != 0) 41 { 42 $result['status'] = 'OK'; 43 $result['comment_ID'] = $comment_ID; 45 44 46 $result['comment_ID'] = $comment_ID; 47 48 echo json_encode($result); 45 echo json_encode($result); 46 } 47 else 48 { 49 echo '{"status":"ERR", "error":"insert comment error"}'; 50 } 49 51 } 50 52 else 51 53 { 52 echo '{ }';54 echo '{"status":"ERR", "error":"invalid request"}'; 53 55 } 54 56 -
wp2phone/trunk/includes/content_page.php
r459686 r469958 43 43 $tab['show-date'] = wp2p_check_box_stat; 44 44 $tab['show-web-version'] = wp2p_check_box_stat; 45 $tab['show-image-header'] = wp2p_check_box_stat; 46 $tab['show-date-post'] = wp2p_check_box_stat; 47 $tab['show-title-post'] = wp2p_check_box_stat; 48 $tab['show-share'] = wp2p_check_box_stat; 45 49 if (isset($_SESSION) and !empty($_SESSION['colors'])) 46 50 { … … 112 116 $tab['show-web-version'] ='checked'; 113 117 } 118 119 120 if ($tab_table[(int)$result]['show-date-post'] == 1 ) 121 { 122 $tab['show-date-post'] ='checked'; 123 } 124 if ($tab_table[(int)$result]['show-title-post'] == 1 ) 125 { 126 $tab['show-title-post'] ='checked'; 127 } 128 if ($tab_table[(int)$result]['show-image-header'] == 1 ) 129 { 130 $tab['show-image-header'] ='checked'; 131 } 132 if ($tab_table[(int)$result]['show-share'] == 1 ) 133 { 134 $tab['show-share'] ='checked'; 135 } 136 114 137 if($tab['type'] == "category") 115 138 { … … 265 288 <table> 266 289 <p> 267 <label><?php echo __( 'Show thumbnail in list view', 'wp2phone_conversion')." :"?></label> 268 <span id="wp2p_checkbox_to_hide"> 269 <input type="checkbox" name="show-image" id="show-image" value="1" <?php echo $tab['show-image']; ?> > 270 <?php echo __('in list view', 'wp2phone_conversion' ); ?> 271 <br/> 272 </span> 290 <label for="show-image-post"><?php echo __( 'Show thumbnail', 'wp2phone_conversion')." :"?></label> 291 273 292 <input type="checkbox" name="show-image-post" id="show-image-post" value="1" <?php echo $tab['show-image-post']; ?> > 274 <?php echo __('in post view', 'wp2phone_conversion' ); ?> 275 293 </input> 276 294 </p> 277 295 <p> 278 <label for="show-date"><?php echo __( 'Show date', 'wp2phone_conversion')." :"?></label> 279 <input type="checkbox" name="show-date" id="show-date" value="1" <?php echo $tab['show-date']; ?> > 296 <label for="show-date-post"><?php echo __( 'Show date', 'wp2phone_conversion')." :"?></label> 297 <input type="checkbox" name="show-date-post" id="show-date-post" value="1" <?php echo $tab['show-date-post']; ?> > 298 </input> 299 </p> 300 <p> 301 <label for="show-title-post"><?php echo __( 'Show title', 'wp2phone_conversion')." :"?></label> 302 <input type="checkbox" name="show-title-post" id="show-title-post" value="1" <?php echo $tab['show-title-post']; ?> > 280 303 </input> 281 304 </p> … … 288 311 <label for="show-web-version"><?php echo __( 'Show web version', 'wp2phone_conversion')." :"?></label> 289 312 <input type="checkbox" name="show-web-version" id="show-web-version" value="1" <?php echo $tab['show-web-version']; ?> > 313 </input> 314 </p> 315 <p> 316 <label for="show-share"><?php echo __( 'Show share button', 'wp2phone_conversion')." :"?></label> 317 <input type="checkbox" name="show-share" id="show-share" value="1" <?php echo $tab['show-share']; ?> > 290 318 </input> 291 319 </p> … … 349 377 <input type="text" name="header-link" id="header-link" size="50" value="<?php echo $tab['header-link']?>"> 350 378 </p> 379 <p> 380 <label for="show-image-header"><?php echo __( 'Show thumbnails', 'wp2phone_conversion')." :"?></label> 381 <input type="checkbox" name="show-image-header" id="show-image-header" value="1" <?php echo $tab['show-image-header']; ?> > 382 <?php echo __('in header', 'wp2phone_conversion' ); ?> 383 </input> 384 </p> 385 <p> 386 <label for="show-image"><?php echo __( 'Show thumbnail', 'wp2phone_conversion')." :"?></label> 387 <input type="checkbox" name="show-image" id="show-image" value="1" <?php echo $tab['show-image']; ?> > 388 <?php echo __('in rows', 'wp2phone_conversion' ); ?> 389 </input> 390 </p> 391 <p> 392 <label for="show-date"><?php echo __( 'Show date', 'wp2phone_conversion')." :"?></label> 393 <input type="checkbox" name="show-date" id="show-date" value="1" <?php echo $tab['show-date']; ?> > 394 <?php echo __('in rows', 'wp2phone_conversion' ); ?> 395 </input> 396 </p> 397 <br/> 398 </p> 351 399 </td> 352 400 </tr> … … 364 412 { 365 413 jQuery('#body_settings').hide(); 366 jQuery('#wp2p_checkbox_to_hide').hide();367 414 } 368 415 }); … … 370 417 { 371 418 jQuery('#body_settings').fadeOut("10"); 372 jQuery('#wp2p_checkbox_to_hide').fadeOut("10");373 419 }); 374 420 jQuery("#type2").click(function () 375 421 { 376 422 jQuery('#body_settings').fadeIn("slow"); 377 jQuery('#wp2p_checkbox_to_hide').fadeIn("slow");378 423 }); 379 424 jQuery("#type3").click(function () 380 425 { 381 426 jQuery('#body_settings').fadeIn("slow"); 382 jQuery('#wp2p_checkbox_to_hide').fadeIn("slow");383 427 }); 384 428 </script> … … 563 607 if(isset($_POST['show-web-version'])) $tab['show-web'] = (int)$_POST['show-web-version']; 564 608 else $tab['show-web'] = 0; 609 if(isset($_POST['show-date-post'])) $tab['show-date-post'] = (int)$_POST['show-date-post']; 610 else $tab['show-date-post'] = 0; 611 if(isset($_POST['show-title-post'])) $tab['show-title-post'] = (int)$_POST['show-title-post']; 612 else $tab['show-title-post'] = 0; 613 if(isset($_POST['show-image-header'])) $tab['show-image-header'] = (int)$_POST['show-image-header']; 614 else $tab['show-image-header'] = 0; 615 if(isset($_POST['show-share'])) $tab['show-share'] = (int)$_POST['show-share']; 616 else $tab['show-share'] = 0; 565 617 566 618 if($tab['type'] == "category") $tab['id'] = (int)$_POST['selector1']; -
wp2phone/trunk/includes/functions.php
r459686 r469958 11 11 /************************************************************************************************/ 12 12 13 define('wp2p_nav_color', '#000000'); 14 define('wp2p_back_color', '#424242'); 15 define('wp2p_text_color', '#444444'); 16 define('wp2p_select_color', '#999999'); 17 define('wp2p_cell_color', '#cccccc'); 18 define('wp2p_icon_name', '53-house.png'); 19 define('wp2p_check_box_stat', 'checked'); 20 13 21 /************************************************************************************************/ 14 22 /* ICONS SELECTOR */ 15 23 /************************************************************************************************/ 16 define('wp2p_nav_color', '#000000');17 define('wp2p_back_color', '#424242');18 define('wp2p_text_color', '#444444');19 define('wp2p_select_color', '#999999');20 define('wp2p_cell_color', '#cccccc');21 define('wp2p_icon_name', '53-house.png');22 define('wp2p_check_box_stat', 'checked');23 24 24 25 function wp2p_icon_reader() … … 50 51 } 51 52 52 /************************************************************************************************ ****/53 /* IMAGE UPLOAD */54 /************************************************************************************************ ****/53 /************************************************************************************************/ 54 /* IMAGE UPLOAD */ 55 /************************************************************************************************/ 55 56 56 57 function wp2p_file_upload_area($label_name, $name, $image_name, $min_width, $min_height, $max_width, $max_height) … … 353 354 update_option( 'wp2p_published','true'); 354 355 } 355 elseif ($str == "edited")356 elseif ($str == "edited") 356 357 { 357 358 update_option( 'wp2p_published','false'); … … 366 367 { 367 368 $pref = get_option('wp2p_pref'); 368 if ($pref and $pref['app-token'] != '' and $pref['push-post'] != 0and isset($_POST['publish'] ))369 if ($pref and ($pref['app-token'] != '') and ($pref['push-post'] != 0) and isset($_POST['publish'] )) 369 370 { 370 371 if(has_tag( $pref['push-tag'], $post_id)) … … 389 390 curl_setopt($tuCurl, CURLOPT_POSTFIELDS, $data); 390 391 $tuData = curl_exec($tuCurl); 392 curl_close($tuCurl); 391 393 } 392 394 } -
wp2phone/trunk/includes/main_page.php
r459686 r469958 64 64 <thead> 65 65 <tr> 66 <th><?php echo __( 'Plugin status', 'wp2phone_conversion') ;?></th>66 <th><?php echo __( 'Plugin status', 'wp2phone_conversion').' ('.__( 'version', 'wp2phone_conversion').' '.WP2PHONE_VERSION.')';?></th> 67 67 </tr> 68 68 </thead> … … 73 73 $message = wp2p_check_plugin_installation_error(); 74 74 if(!$message) 75 echo __( 'Plugin successfully installed ', 'wp2phone_conversion');75 echo __( 'Plugin successfully installed.', 'wp2phone_conversion'); 76 76 else 77 77 echo __( 'The plugin require folder permissions change :', 'wp2phone_conversion' ).' <span style="color:red;">'.$message.'</span>'; -
wp2phone/trunk/includes/request-comment.php
r454994 r469958 27 27 if ($get_type == 'post') // all comments from post_ID 28 28 { 29 $result = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID=".$get_id." AND comment_approved= 1ORDER BY comment_date DESC LIMIT 50");29 $result = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID=".$get_id." AND comment_approved='1' ORDER BY comment_date DESC LIMIT 50"); 30 30 } 31 31 elseif ($get_type == 'comment') // a single comment from its comment_ID 32 32 { 33 $result = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_ID=".$get_id." AND comment_approved= 1LIMIT 1");33 $result = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_ID=".$get_id." AND comment_approved='1' LIMIT 1"); 34 34 } 35 35 else -
wp2phone/trunk/includes/request-post.php
r454994 r469958 48 48 foreach ($result as $row/*$pos=>$value*/) 49 49 { 50 //echo $row->ID;51 52 50 $result1 = $wpdb->get_results("SELECT pm.meta_value FROM $wpdb->postmeta pm WHERE pm.post_id=".$row->ID." AND pm.meta_key='wp2phone_thumbnail' LIMIT 1"); 53 51 if (count($result1) > 0) … … 58 56 { 59 57 $result2 = $wpdb->get_results("SELECT p.ID, p.guid FROM $wpdb->posts p, $wpdb->postmeta pm WHERE pm.post_id=".$row->ID." AND pm.meta_key='_thumbnail_id' AND p.ID=pm.meta_value AND p.post_type='attachment' LIMIT 1"); 60 //echo "nb = ".count($result2)."--";61 //echo $result2[0]->guid;62 58 if (count($result2) > 0) 63 59 { -
wp2phone/trunk/plugin.php
r459686 r469958 3 3 Plugin Name: wp2phone 4 4 Plugin URI: http://wp2phone.com 5 Version: 0.1. 15 Version: 0.1.2 6 6 Description: wp2phone is a complete solution to publish the content of your WordPress website in a native iPhone/iPad app. 7 7 Author: wp2phone … … 14 14 15 15 if (defined('WP2PHONE_VERSION')) return; 16 define('WP2PHONE_VERSION', '0.1. 1');16 define('WP2PHONE_VERSION', '0.1.2'); 17 17 18 18 /************************************************************************************************/ … … 86 86 $tab['show-date'] = 1; 87 87 $tab['show-web'] = 1; 88 $tab['show-image-header'] = 1; 89 $tab['show-date-post'] = 1; 90 $tab['show-title-post'] = 1; 91 $tab['show-share'] = 1; 92 88 93 $tab_table[0] = $tab; 89 94 } -
wp2phone/trunk/readme.txt
r459686 r469958 4 4 Requires at least: 2.9 5 5 Tested up to: 3.2.1 6 Stable tag: 0.1. 16 Stable tag: 0.1.2 7 7 License: GPLv2 8 8
Note: See TracChangeset
for help on using the changeset viewer.