Plugin Directory

Changeset 2871683


Ignore:
Timestamp:
02/27/2023 12:40:31 PM (3 years ago)
Author:
devmontdigital
Message:

Backend option page updates

Location:
display-medium-stories
Files:
2 added
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • display-medium-stories/trunk/assets/js/script.js

    r2832393 r2871683  
    2626  output_cont_size.innerHTML = this.value;
    2727}
     28
     29var md_info = document.getElementById('md-info-tab');
     30md_info.addEventListener('click', function() {
     31  this.classList.add('active');
     32  document.getElementById('md-grid').classList.remove('show');
     33  document.getElementById('md-grid').classList.remove('active');
     34  document.getElementById('md-info').classList.add('show');
     35  document.getElementById('md-info').classList.add('active');
     36  document.getElementById('md-settings').classList.remove('show');
     37  document.getElementById('md-settings').classList.remove('active');
     38  document.getElementById('md-grid-tab').classList.remove('active');
     39  document.getElementById('md-settings-tab').classList.remove('active');
     40});
     41
     42var md_grid = document.getElementById('md-grid-tab');
     43md_grid.addEventListener('click', function() {
     44  this.classList.add('active');
     45  document.getElementById('md-grid').classList.add('show');
     46  document.getElementById('md-grid').classList.add('active');
     47  document.getElementById('md-info').classList.remove('show');
     48  document.getElementById('md-info').classList.remove('active');
     49  document.getElementById('md-settings').classList.remove('show');
     50  document.getElementById('md-settings').classList.remove('active');
     51  document.getElementById('md-info-tab').classList.remove('active');
     52  document.getElementById('md-settings-tab').classList.remove('active');
     53});
     54
     55var md_grid = document.getElementById('md-settings-tab');
     56md_grid.addEventListener('click', function() {
     57  this.classList.add('active');
     58  document.getElementById('md-grid').classList.remove('show');
     59  document.getElementById('md-grid').classList.remove('active');
     60  document.getElementById('md-info').classList.remove('show');
     61  document.getElementById('md-info').classList.remove('active');
     62  document.getElementById('md-settings').classList.add('show');
     63  document.getElementById('md-settings').classList.add('active');
     64    document.getElementById('md-info-tab').classList.remove('active');
     65  document.getElementById('md-grid-tab').classList.remove('active');
     66});
  • display-medium-stories/trunk/includes/settings.php

    r2832393 r2871683  
    3333            $current_page = admin_url($_GET["page"]);
    3434            if (strstr($current_page, "medium-post")) {
    35                 wp_enqueue_style('bootstrap-toggle-min',       MP_PLUGIN_DIR_URL . "assets/css/bootstrap-toggle.min.css");
    3635                wp_enqueue_style('admin-bootstrap-style',      MP_PLUGIN_DIR_URL . "assets/bootstrap/css/bootstrap.min.css");
    3736                wp_enqueue_style('admin-style',                MP_PLUGIN_DIR_URL . "assets/css/admin-style.css");
     
    4948            wp_enqueue_script('admin-script',               MP_PLUGIN_DIR_URL . "assets/js/script.js", array('jquery'));
    5049            wp_enqueue_script('admin-bootstrap-script',     MP_PLUGIN_DIR_URL . "assets/bootstrap/js/bootstrap.min.js", array('jquery'));
    51             wp_enqueue_script('jquery',                     MP_PLUGIN_DIR_URL . "assets/js/jquery.min.js");
    52             wp_enqueue_script('bootstrap-toggle-min',       MP_PLUGIN_DIR_URL . "assets/js/bootstrap-toggle.min.js", array('jquery'));
    5350            settings_fields('medium-post-settings-group');
    5451            do_settings_sections('medium-post-settings-group');
     
    7774                <div class="row m-0">
    7875                    <div class="col-md-12 p-0">
    79                         <div class="nav flex-column nav-pills tab_Wrapper" id="v-pills-tab" role="tablist" aria-orientation="vertical">
    80                             <a class="nav-link font-weight-bold active" id="md-info-tab" data-toggle="pill" href="#md-info" role="tab" aria-controls="md-info" aria-selected="true">
     76                        <div class="nav flex-column nav-pills tab_Wrapper" >
     77                            <a class="nav-link font-weight-bold active" id="md-info-tab" href="javascript:void(0)">
    8178                                <svg class="admin-icons" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-info-circle" viewBox="0 0 16 16">
    8279                                    <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z" />
     
    8481                                </svg>Information
    8582                            </a>
    86                             <a class="nav-link font-weight-bold " id="md-grid-tab" data-toggle="pill" href="#md-grid" role="tab" aria-controls="md-grid" aria-selected="false">
     83                            <a class="nav-link font-weight-bold " id="md-grid-tab" href="javascript:void(0)">
    8784                                <svg class="admin-icons" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-newspaper" viewBox="0 0 16 16">
    8885                                    <path d="M0 2.5A1.5 1.5 0 0 1 1.5 1h11A1.5 1.5 0 0 1 14 2.5v10.528c0 .3-.05.654-.238.972h.738a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 1 1 0v9a1.5 1.5 0 0 1-1.5 1.5H1.497A1.497 1.497 0 0 1 0 13.5v-11zM12 14c.37 0 .654-.211.853-.441.092-.106.147-.279.147-.531V2.5a.5.5 0 0 0-.5-.5h-11a.5.5 0 0 0-.5.5v11c0 .278.223.5.497.5H12z" />
     
    9087                                </svg>Layout Style
    9188                            </a>
    92                             <a class="nav-link font-weight-bold " id="md-settings-tab" data-toggle="pill" href="#md-settings" role="tab" aria-controls="md-settings" aria-selected="false">
     89                            <a class="nav-link font-weight-bold " id="md-settings-tab" href="javascript:void(0)">
    9390                                <svg class="admin-icons" xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-gear" viewBox="0 0 16 16">
    9491                                    <path d="M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492zM5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0z" />
     
    108105                                    <div class="md-accor-box">
    109106                                        <div class="card-header" id="headingOne">
    110                                             <a class="btn btn-link" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
    111                                                 <h5 class="mb-0">For user accounts and publications.</h5>
    112                                                 <i class="far fa-chevron-down"></i>
    113                                             </a>
    114                                         </div>
    115                                         <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordion">
     107                                                <h5>For user accounts and publications.</h5>
     108                                        </div>
     109                                        <div id="collapseOne" class="collapse show " aria-labelledby="headingOne" data-parent="#accordion">
    116110                                            <div class="card-body">
    117111                                                <p>To use this plugin on any page or post add shortcode with user handle.</p>
     
    130124                                    </div>
    131125                                    <div class="md-accor-box">
    132                                         <div class="card-header" id="headingTwo">
    133                                             <a class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
    134                                                 <h5 class="mb-0">Advanced usage and customization</h5>
    135                                                 <i class="far fa-chevron-down"></i>
    136                                             </a>
    137                                         </div>
    138                                         <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
     126                                        <div class="card-header" id="headingTwo"> 
     127                                            <h5>Advanced usage and customization</h5>
     128                                        </div>
     129                                        <div id="collapseTwo" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordion">
    139130                                            <div class="card-body">
    140131                                                <p>There are additional features that can be implemented using Medium Posts.</p>
     
    384375                                                    ?>
    385376                                                    <select class="custom-select form__field" id="inputGroupSelect04" name="mpost_date_format">
    386                                                         <?php echo esc_attr($opt); ?>
     377                                                        <?php echo $opt; ?>
    387378                                                    </select>
    388379                                                    <label for="mpost_date_format" class="form__label">Select Date Format</label>
  • display-medium-stories/trunk/medium-post.php

    r2832393 r2871683  
    44 * Plugin URI:        https://devmontdigital.io/products/medium-plugin
    55 * Description:       This is custom made plugin use to get medium post on wordpress website
    6  * Version:           7.4
     6 * Version:           7.4.1
    77 * Requires at least: 6.0
    88 * Requires PHP:      7.4
  • display-medium-stories/trunk/readme.txt

    r2832393 r2871683  
    55Requires PHP: 7.4
    66Tested up to: 6.1
    7 Stable tag: 7.4
     7Stable tag: 7.4.1
    88License: GPLv2 or later
    99
    10 TheThis plugin is a powerful, professionally developed tool to show the medium stories in WordPress websites.
     10This plugin is a powerful, professionally developed tool to show the medium stories in WordPress websites.
    1111
    1212== Description ==
  • display-medium-stories/trunk/views/shortcode.php

    r2832393 r2871683  
    105105    $handle             = $a['handle'];
    106106    $offset             = $a['offset'];
    107     $content = null;
    108     // $medium_url = "https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/" . $handle;
    109     // try {
    110     //  $ch = curl_init();
    111     //  if (false === $ch)
    112     //      throw new Exception('failed to initialize');
    113     //  curl_setopt($ch, CURLOPT_URL, $medium_url);
    114     //  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    115     //  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
    116     //  $content = curl_exec($ch);
    117 
    118     //  if (false === $content)
    119     //      throw new Exception(curl_error($ch), curl_errno($ch));
    120     // } catch (Exception $e) {
    121     //  trigger_error(
    122     //      sprintf(
    123     //          'Curl failed with error #%d: %s',
    124     //          $e->getCode(),
    125     //          $e->getMessage()
    126     //      ),
    127     //  );
    128     // }
    129     $response = wp_remote_get( 'https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/' . $handle );
    130     $content     = wp_remote_retrieve_body( $response );
    131     $items = array();
    132     $count = 1;
     107    $content            = null;
     108    $response           = wp_remote_get( 'https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/' . $handle );
     109    $content            = wp_remote_retrieve_body( $response );
     110    $items              = array();
     111    $count              = 1;
    133112   
    134113   
     
    428407    // Slider Design Three End
    429408endif;
    430     // echo  esc_html__($html);
    431     // $aaa = esc_attr( $html ): string;
    432     // echo $aaa;
    433     // echo sanitize_html_class($html);
    434409    echo apply_filters( 'esc_html', $html, $html);
    435     // echo _wp_specialchars( $html);
    436     // echo wp_kses_post($html,'content');
    437     // echo apply_filters( 'attribute_escape', $html, $html );
    438410    if (empty($items)) echo apply_filters( 'esc_html', "<div class='display-medium-no-post'>No posts foundss!</div>","<div class='display-medium-no-post'>No posts foundss!</div>");
    439411    return ob_get_clean();
    440412}
    441413add_shortcode('display-medium-article', 'devmont_medium_post');
    442 
    443 // function esc_attr( $text ) {
    444 //  $safe_text = wp_check_invalid_utf8( $text );
    445 //  $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
    446 //  /**
    447 //   * Filters a string cleaned and escaped for output in an HTML attribute.
    448 //   *
    449 //   * Text passed to esc_attr() is stripped of invalid or special characters
    450 //   * before output.
    451 //   *
    452 //   * @since 2.0.6
    453 //   *
    454 //   * @param string $safe_text The text after it has been escaped.
    455 //   * @param string $text      The text prior to being escaped.
    456 //   */
    457 //  return apply_filters( 'attribute_escape', $safe_text, $text );
    458 // }
    459 // apply_filters( 'attribute_escape', string $safe_text, string $text );
    460 ?>
    461 
    462 
Note: See TracChangeset for help on using the changeset viewer.