Plugin Directory

Changeset 2070726


Ignore:
Timestamp:
04/18/2019 12:56:39 PM (7 years ago)
Author:
kr4ft3r
Message:

support for parameters in url

Location:
wp-custom-html-pages
Files:
2 edited
4 copied

Legend:

Unmodified
Added
Removed
  • wp-custom-html-pages/tags/5.0.1/readme.txt

    r2056099 r2070726  
    44Requires at least: 3.6.1
    55Tested up to: 5.1
    6 Stable tag: 0.5.0
     6Stable tag: 0.5.1
    77Requires PHP: 5.2
    88License: GPL2
     
    1919
    2020== Installation ==
    21 Download from the repository (by searching for \"WP Custom HTML Pages\") and activate.
     21Download from the repository (by searching for \"WP Custom HTML Pages Milos Stojanovic\") and activate.
    2222
    2323== Upgrade ==
     
    2929== Frequently Asked Questions ==
    3030Q: Why would I need this plugin just to show an HTML page?
    31 A:  So you can quickly display your custom HTML pages without bothering to upload the page to the server. Also it is useful in cases when you don\'t have access to your hosting FTP server, or if .htaccess rules are giving you trouble to link to the page. Also, you get a pretty URI to the page rather than having to link directly to the .html document.
     31A:  So you can quickly display your custom HTML pages without bothering to upload the page to the server. It is useful in cases when you don\'t have access to your hosting FTP server, or if .htaccess rules are giving you trouble to link to the page. Also, you get a pretty URI to the page rather than having to link directly to the .html document.
    3232
    3333== Screenshots ==
     
    3636
    3737== Changelog ==
     38v 0.5.1 - Custom permalinks will now work with variable parameters within the request, if the option is enabled in settings (ie website.com/pagename?param=example will lead to /pagename). This option is OFF by default, to prevent breakings of existing setups.
    3839v 0.5.0 - Changed html column type in db to mediumtext, to allow larger html pages (unavailable in upgrade, this will require reinstallation of plugin)
    3940v 0.4.5 - Fixed PHP error messages, added quick link to the edited page
  • wp-custom-html-pages/tags/5.0.1/wp-custom-html-pages.php

    r2056092 r2070726  
    44 * Plugin URI: https://witserbia.com/wordpress-plugins/wp-custom-html-pages/
    55 * Description: Display full custom HTML on custom permalink address, or put it inside content as a shortcode
    6  * Version: 0.5.0
     6 * Version: 0.5.1
    77 * Author: Milos Stojanovic
    88 * License: GPL2
     
    296296        return;
    297297   
     298    //handle requests with parameters
     299    $query_uri_params_string = "";
     300    $query_uri_params = [];
     301    //find occurance of ? unless if first char
     302    if(get_option('wpchtmlp_opt_filter_params') && strlen($query_uri) > 0 && strpos($query_uri, '?', 1) !== false) {
     303      $query_uri_arr = explode("?", $query_uri);
     304
     305      $query_uri = $query_uri_arr[0]; //set proper uri to be everything before params
     306
     307      if( count($query_uri_arr) > 1 ) {
     308        $query_uri_params_string = $query_uri_arr[1];
     309        if(strpos($query_uri_params_string, '&') !== false) {
     310          //parse parameters TODO
     311          $query_uri_params = explode("&", $query_uri_params_string);
     312        }
     313      } // if has parameters after '?'
     314    } // if opt enabled and has '?'
     315
    298316    global $wpdb;
    299317    $table_name = $wpdb->prefix . 'wpchtmlp_pages';
     
    341359    register_setting( 'wpchtmlp-options', 'wpchtmlp_opt_allow_wp-admin' );
    342360    register_setting( 'wpchtmlp-options', 'wpchtmlp_opt_remove_table_on_uninstall' );
     361    register_setting( 'wpchtmlp-options', 'wpchtmlp_opt_filter_params' );
    343362}
    344363
     
    403422    settings_fields( 'wpchtmlp-options' );
    404423    do_settings_sections( 'wpchtmlp-options' );
    405    
     424    //wpchtmlp_opt_filter_params
    406425    echo '<table class="form-table">
     426
     427        <tr valign="top">
     428        <th><td><h3>URI Options</h3></td></th>
     429        </tr>
     430       
     431        <tr valign="top">
     432        <th scope="row">Handle parameter queries</th>
     433        <td><input type="checkbox" name="wpchtmlp_opt_filter_params" id="wpchtmlp_opt_filter_params" value="1" '.checked(get_option('wpchtmlp_opt_filter_params'),1).' />
     434        <span>&nbsp;&nbsp;Check ON to have your permalinks work with variable parameters in URL ("..?params=example..."). Check OFF if your custom permalinks use "?" character.</span></td>
     435        </tr>
    407436   
    408437        <tr valign="top">
  • wp-custom-html-pages/trunk/readme.txt

    r2056099 r2070726  
    44Requires at least: 3.6.1
    55Tested up to: 5.1
    6 Stable tag: 0.5.0
     6Stable tag: 0.5.1
    77Requires PHP: 5.2
    88License: GPL2
     
    1919
    2020== Installation ==
    21 Download from the repository (by searching for \"WP Custom HTML Pages\") and activate.
     21Download from the repository (by searching for \"WP Custom HTML Pages Milos Stojanovic\") and activate.
    2222
    2323== Upgrade ==
     
    2929== Frequently Asked Questions ==
    3030Q: Why would I need this plugin just to show an HTML page?
    31 A:  So you can quickly display your custom HTML pages without bothering to upload the page to the server. Also it is useful in cases when you don\'t have access to your hosting FTP server, or if .htaccess rules are giving you trouble to link to the page. Also, you get a pretty URI to the page rather than having to link directly to the .html document.
     31A:  So you can quickly display your custom HTML pages without bothering to upload the page to the server. It is useful in cases when you don\'t have access to your hosting FTP server, or if .htaccess rules are giving you trouble to link to the page. Also, you get a pretty URI to the page rather than having to link directly to the .html document.
    3232
    3333== Screenshots ==
     
    3636
    3737== Changelog ==
     38v 0.5.1 - Custom permalinks will now work with variable parameters within the request, if the option is enabled in settings (ie website.com/pagename?param=example will lead to /pagename). This option is OFF by default, to prevent breakings of existing setups.
    3839v 0.5.0 - Changed html column type in db to mediumtext, to allow larger html pages (unavailable in upgrade, this will require reinstallation of plugin)
    3940v 0.4.5 - Fixed PHP error messages, added quick link to the edited page
  • wp-custom-html-pages/trunk/wp-custom-html-pages.php

    r2056092 r2070726  
    44 * Plugin URI: https://witserbia.com/wordpress-plugins/wp-custom-html-pages/
    55 * Description: Display full custom HTML on custom permalink address, or put it inside content as a shortcode
    6  * Version: 0.5.0
     6 * Version: 0.5.1
    77 * Author: Milos Stojanovic
    88 * License: GPL2
     
    296296        return;
    297297   
     298    //handle requests with parameters
     299    $query_uri_params_string = "";
     300    $query_uri_params = [];
     301    //find occurance of ? unless if first char
     302    if(get_option('wpchtmlp_opt_filter_params') && strlen($query_uri) > 0 && strpos($query_uri, '?', 1) !== false) {
     303      $query_uri_arr = explode("?", $query_uri);
     304
     305      $query_uri = $query_uri_arr[0]; //set proper uri to be everything before params
     306
     307      if( count($query_uri_arr) > 1 ) {
     308        $query_uri_params_string = $query_uri_arr[1];
     309        if(strpos($query_uri_params_string, '&') !== false) {
     310          //parse parameters TODO
     311          $query_uri_params = explode("&", $query_uri_params_string);
     312        }
     313      } // if has parameters after '?'
     314    } // if opt enabled and has '?'
     315
    298316    global $wpdb;
    299317    $table_name = $wpdb->prefix . 'wpchtmlp_pages';
     
    341359    register_setting( 'wpchtmlp-options', 'wpchtmlp_opt_allow_wp-admin' );
    342360    register_setting( 'wpchtmlp-options', 'wpchtmlp_opt_remove_table_on_uninstall' );
     361    register_setting( 'wpchtmlp-options', 'wpchtmlp_opt_filter_params' );
    343362}
    344363
     
    403422    settings_fields( 'wpchtmlp-options' );
    404423    do_settings_sections( 'wpchtmlp-options' );
    405    
     424    //wpchtmlp_opt_filter_params
    406425    echo '<table class="form-table">
     426
     427        <tr valign="top">
     428        <th><td><h3>URI Options</h3></td></th>
     429        </tr>
     430       
     431        <tr valign="top">
     432        <th scope="row">Handle parameter queries</th>
     433        <td><input type="checkbox" name="wpchtmlp_opt_filter_params" id="wpchtmlp_opt_filter_params" value="1" '.checked(get_option('wpchtmlp_opt_filter_params'),1).' />
     434        <span>&nbsp;&nbsp;Check ON to have your permalinks work with variable parameters in URL ("..?params=example..."). Check OFF if your custom permalinks use "?" character.</span></td>
     435        </tr>
    407436   
    408437        <tr valign="top">
Note: See TracChangeset for help on using the changeset viewer.