Plugin Directory

Changeset 1785853


Ignore:
Timestamp:
12/13/2017 01:32:21 AM (8 years ago)
Author:
irmau
Message:

Added select toggle inserting of shareprice scripts into header of site

Location:
irm-newsroom/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • irm-newsroom/trunk/README.txt

    r1772716 r1785853  
    55Tags: ASX, ASX Announcements, ASX Listed, ASX Share Price, financial data, finance, public company, stock price, stock price feed, irm, newsroom, social, distribution, investors, subscriptions.
    66Requires at least: 3.0.1
    7 Tested up to: 4.8.3
     7Tested up to: 4.9.1
    88Stable tag: 4.3
    99License: GPLv2 or later
     
    105105== Changelog ==
    106106
     107= 1.0.8 =
     108* Added select toggle inserting of shareprice scripts into header of site
     109
    107110= 1.0.7 =
    108111* Fixed error if server is missing curl
  • irm-newsroom/trunk/irm-newsroom.php

    r1772716 r1785853  
    1717 * Plugin URI:        http://www.irmnewsroom.com/
    1818 * Description:       IRM Newsroom is an ASX announcements, news and social media distribution service, which enables companies to easily communicate with investors and other stakeholders across multiple online channels – including website, email subscriptions and social media channels.
    19  * Version:           1.0.7
     19 * Version:           1.0.8
    2020 * Author:            IRM
    2121 * Author URI:        http://irmau.com
     
    6767 * @since    1.0.0
    6868 */
     69
     70
     71function iguana_js() {
     72    echo '<script src="https://quoteapi.com/lib/1.8.5/quoteapi-loader.js" integrity="sha256-Zs2jee5Cu9XOmK67dVQJDI5LqiV+faelNQm8OyslG6s= sha512-lgVikkbStJeoqvs4NNkrxcnQZM5q2WZDvD71Lo8c7F7AKW4/X/5iKuZVErv/gPS/4VdoBH642y+SHtiZA+B2ag==" crossorigin="anonymous"></script>';
     73
     74    $site_key = esc_attr( get_option('site_key') );
     75    $site_type = esc_attr( get_option('site_type') );
     76    $site_directory = esc_attr( get_option('site_directory') );
     77    $script_url = $site_type . "://" . $site_key . "/" . $site_directory . "/content/js/quoteapi.js";
     78
     79    echo '<script src="'.$script_url.'"></script>';
     80}
     81
    6982function run_irm_newsroom() {
    70 
    7183    $plugin = new Irm_Newsroom();
    7284    $plugin->run();
     85
     86    $share_price_toggle = esc_attr( get_option('share_price_toggle') );
     87    if($share_price_toggle == "on") {
     88        add_action('wp_head', 'iguana_js');
     89    }
    7390
    7491}
     
    90107    register_setting( 'irm-newsroom-group', 'site_directory' );
    91108    register_setting( 'irm-newsroom-group', 'email_landing_page' );
     109    register_setting( 'irm-newsroom-group', 'share_price_toggle' );
    92110}
    93111
     
    105123    $site_directory = esc_attr( get_option('site_directory') );
    106124    $email_landing_page = esc_attr( get_option('email_landing_page') );
     125    $share_price_toggle = esc_attr( get_option('share_price_toggle') );
     126
     127    if(!$share_price_toggle > "") {
     128        $share_price_toggle = "off";
     129    }
    107130
    108131    if(!$site_type > "") {
     
    182205        echo '<p>To show the Email Alerts Signup Form please copy and paste the shortcode below to a page on your website: </p>';
    183206        echo '<pre><code>[email_alerts_form]</code></pre>';
    184 
    185207        echo '<p><label>Email Alerts Success Page: </label> <input type="text" name="email_landing_page" value="'.$email_landing_page.'" /></p>';
     208
     209        echo '<h3>Shareprice</h3>';
     210        echo '<p>Toggle shareprice script in site header, if this is set to <b>on</b> this will insert the shareprice javascript in the header of this site for all pages.</p>';
     211        //echo '$share_price_toggle:' . $share_price_toggle . '<br>';
     212        echo '<select name="share_price_toggle">';
     213
     214        if($share_price_toggle == "off") {
     215            echo '<option value="off" selected>off</option>';
     216            echo '<option value="on">on</option>';
     217        } else {
     218            echo '<option value="off">off</option>';
     219            echo '<option value="on" selected>on</option>';
     220        }
     221        echo '</select>';
     222
    186223        settings_fields( 'irm-newsroom-group' );
    187224        do_settings_sections( 'irm-newsroom-group' );
Note: See TracChangeset for help on using the changeset viewer.