Plugin Directory

Changeset 469958


Ignore:
Timestamp:
12/01/2011 07:00:48 PM (14 years ago)
Author:
wp2phone
Message:

Version 0.1.2

Location:
wp2phone/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • wp2phone/trunk/css/style.css

    r459686 r469958  
    11label
    22{
    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    }
    109.wp2p_description
    1110{
     
    1817            height:50px;
    1918}
    20 
    2119.changeCursor
    2220{
    23     cursor:move;
     21cursor:move;
    2422}
  • wp2phone/trunk/includes/add-comment.php

    r454994 r469958  
    1313header('content-type: text/json; charset=utf-8');
    1414
    15 if (isset($_GET['wp2p-post']) && isset($_GET['wp2p-author']) && isset($_GET['wp2p-email']) && isset($_GET['wp2p-content']))
     15if (isset($_POST['wp2p-post-id']) && isset($_POST['wp2p-author']) && isset($_POST['wp2p-email']) && isset($_POST['wp2p-content']))
    1616{
    1717    require_once('../../../../wp-load.php');
     
    2222        $version = '';
    2323   
    24     //////////////********************** EN COURS DE DEV ************************///////////////////////
    25    
    26    
    27     $time = current_time('mysql');
    28 
    2924    $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'],
    3328        'comment_author_url' => '',
    34         'comment_content' => $_GET['wp2p-content'],
    35         'comment_type' => ,
     29        'comment_content' => $_POST['wp2p-content'],
     30        'comment_type' => '',
    3631        'comment_parent' => 0,
    3732        'user_id' => 0,
    38         'comment_author_IP' => $_SERVER['REMOTE_ADDR'];,
     33        'comment_author_IP' => $_SERVER['REMOTE_ADDR'],
    3934        'comment_agent' => 'wp2phone',
    40         'comment_date' => $time,
     35        'comment_date' => current_time('mysql')
    4136        /*'comment_approved' => 1,*/
    4237    );
    4338   
    4439    $comment_ID = wp_insert_comment($data);
     40    if ($comment_ID != 0)
     41    {
     42        $result['status'] = 'OK';
     43        $result['comment_ID'] = $comment_ID;
    4544   
    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    }
    4951}
    5052else
    5153{
    52     echo '{}';
     54    echo '{"status":"ERR", "error":"invalid request"}';
    5355}
    5456
  • wp2phone/trunk/includes/content_page.php

    r459686 r469958  
    4343        $tab['show-date'] = wp2p_check_box_stat;
    4444        $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;
    4549        if (isset($_SESSION) and !empty($_SESSION['colors']))
    4650        {
     
    112116                $tab['show-web-version'] ='checked';
    113117            }
     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           
    114137            if($tab['type'] == "category")
    115138             {
     
    265288                            <table>
    266289                            <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                                     &nbsp;&nbsp;<?php echo __('in list view', 'wp2phone_conversion' ); ?>&nbsp;&nbsp;
    271                                     <br/>
    272                                     </span>
     290                                    <label for="show-image-post"><?php echo __( 'Show thumbnail', 'wp2phone_conversion')." :"?></label>
     291                                   
    273292                                    <input type="checkbox" name="show-image-post" id="show-image-post" value="1"  <?php echo $tab['show-image-post']; ?> >
    274                                     &nbsp;&nbsp;<?php echo __('in post view', 'wp2phone_conversion' ); ?>&nbsp;&nbsp;
    275293                                    </input>
    276294                                </p>
    277295                                <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']; ?> >
    280303                                    </input>
    281304                                </p>
     
    288311                                    <label for="show-web-version"><?php echo __( 'Show web version', 'wp2phone_conversion')." :"?></label>
    289312                                    <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']; ?> >
    290318                                    </input>
    291319                                </p>
     
    349377                            <input  type="text" name="header-link" id="header-link" size="50" value="<?php echo $tab['header-link']?>">
    350378                            </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                                &nbsp;&nbsp;<?php echo __('in header', 'wp2phone_conversion' ); ?>&nbsp;&nbsp;
     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                                &nbsp;&nbsp;<?php echo __('in rows', 'wp2phone_conversion' ); ?>&nbsp;&nbsp;
     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                                    &nbsp;&nbsp;<?php echo __('in rows', 'wp2phone_conversion' ); ?>&nbsp;&nbsp;
     395                                    </input>
     396                                </p>
     397                                <br/>
     398                            </p>
    351399                        </td>
    352400                    </tr>
     
    364412            {
    365413                jQuery('#body_settings').hide();
    366                 jQuery('#wp2p_checkbox_to_hide').hide();
    367414            }
    368415        });
     
    370417        {
    371418             jQuery('#body_settings').fadeOut("10");
    372              jQuery('#wp2p_checkbox_to_hide').fadeOut("10");
    373419        });
    374420        jQuery("#type2").click(function ()
    375421        {
    376422             jQuery('#body_settings').fadeIn("slow");
    377             jQuery('#wp2p_checkbox_to_hide').fadeIn("slow");
    378423        });
    379424        jQuery("#type3").click(function ()
    380425        {
    381426             jQuery('#body_settings').fadeIn("slow");
    382             jQuery('#wp2p_checkbox_to_hide').fadeIn("slow");
    383427        });
    384428    </script>
     
    563607            if(isset($_POST['show-web-version'])) $tab['show-web'] = (int)$_POST['show-web-version'];
    564608            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;
    565617           
    566618            if($tab['type'] == "category") $tab['id'] = (int)$_POST['selector1'];
  • wp2phone/trunk/includes/functions.php

    r459686 r469958  
    1111/************************************************************************************************/
    1212
     13define('wp2p_nav_color',    '#000000');
     14define('wp2p_back_color',   '#424242');
     15define('wp2p_text_color',   '#444444');
     16define('wp2p_select_color', '#999999');
     17define('wp2p_cell_color',   '#cccccc');
     18define('wp2p_icon_name',    '53-house.png');
     19define('wp2p_check_box_stat', 'checked');
     20
    1321/************************************************************************************************/
    1422/*                                      ICONS SELECTOR                                          */
    1523/************************************************************************************************/
    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');
    2324
    2425function wp2p_icon_reader()
     
    5051}
    5152
    52 /****************************************************************************************************/
    53 /*                                          IMAGE UPLOAD                                            */
    54 /****************************************************************************************************/
     53/************************************************************************************************/
     54/*                                          IMAGE UPLOAD                                        */
     55/************************************************************************************************/
    5556
    5657function wp2p_file_upload_area($label_name, $name, $image_name, $min_width, $min_height, $max_width, $max_height)
     
    353354        update_option( 'wp2p_published','true');
    354355    }
    355     elseif($str == "edited")
     356    elseif ($str == "edited")
    356357    {
    357358        update_option( 'wp2p_published','false');
     
    366367{
    367368    $pref = get_option('wp2p_pref');
    368     if ($pref and $pref['app-token'] != '' and $pref['push-post'] != 0 and isset($_POST['publish'] ))
     369    if ($pref and ($pref['app-token'] != '') and ($pref['push-post'] != 0) and isset($_POST['publish'] ))
    369370    {
    370371        if(has_tag( $pref['push-tag'], $post_id))
     
    389390                curl_setopt($tuCurl, CURLOPT_POSTFIELDS, $data);
    390391                $tuData = curl_exec($tuCurl);
     392                curl_close($tuCurl);
    391393            }
    392394        }
  • wp2phone/trunk/includes/main_page.php

    r459686 r469958  
    6464        <thead>
    6565            <tr>
    66                 <th><?php echo __( 'Plugin status', 'wp2phone_conversion');?></th>
     66                <th><?php echo __( 'Plugin status', 'wp2phone_conversion').' ('.__( 'version', 'wp2phone_conversion').' '.WP2PHONE_VERSION.')';?></th>
    6767            </tr>
    6868        </thead>
     
    7373                    $message = wp2p_check_plugin_installation_error();
    7474                    if(!$message)
    75                         echo __( 'Plugin successfully installed', 'wp2phone_conversion');
     75                        echo __( 'Plugin successfully installed.', 'wp2phone_conversion');
    7676                    else
    7777                        echo __( 'The plugin require folder permissions change :', 'wp2phone_conversion' ).' <span style="color:red;">'.$message.'</span>';
  • wp2phone/trunk/includes/request-comment.php

    r454994 r469958  
    2727    if ($get_type == 'post') // all comments from post_ID
    2828    {
    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");
     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");
    3030    }
    3131    elseif ($get_type == 'comment') // a single comment from its comment_ID
    3232    {
    33         $result = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_ID=".$get_id." AND comment_approved=1 LIMIT 1");
     33        $result = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_ID=".$get_id." AND comment_approved='1' LIMIT 1");
    3434    }
    3535    else
  • wp2phone/trunk/includes/request-post.php

    r454994 r469958  
    4848    foreach ($result as $row/*$pos=>$value*/)
    4949    {
    50         //echo $row->ID;
    51        
    5250        $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");
    5351        if (count($result1) > 0)
     
    5856        {
    5957            $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;
    6258            if (count($result2) > 0)
    6359            {
  • wp2phone/trunk/plugin.php

    r459686 r469958  
    33Plugin Name: wp2phone
    44Plugin URI: http://wp2phone.com
    5 Version: 0.1.1
     5Version: 0.1.2
    66Description: wp2phone is a complete solution to publish the content of your WordPress website in a native iPhone/iPad app.
    77Author: wp2phone
     
    1414
    1515if (defined('WP2PHONE_VERSION')) return;
    16 define('WP2PHONE_VERSION', '0.1.1');
     16define('WP2PHONE_VERSION', '0.1.2');
    1717
    1818/************************************************************************************************/
     
    8686            $tab['show-date'] = 1;
    8787            $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           
    8893            $tab_table[0] = $tab;
    8994        }
  • wp2phone/trunk/readme.txt

    r459686 r469958  
    44Requires at least: 2.9
    55Tested up to: 3.2.1
    6 Stable tag: 0.1.1
     6Stable tag: 0.1.2
    77License: GPLv2
    88
Note: See TracChangeset for help on using the changeset viewer.