Plugin Directory

Changeset 1830452


Ignore:
Timestamp:
02/27/2018 10:43:47 PM (8 years ago)
Author:
irmau
Message:

Added short codes for share prices

Location:
irm-newsroom/trunk
Files:
2 edited

Legend:

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

    r1785853 r1830452  
    105105== Changelog ==
    106106
     107= 1.0.9 =
     108* Added short codes for share prices
     109
    107110= 1.0.8 =
    108111* Added select toggle inserting of shareprice scripts into header of site
  • irm-newsroom/trunk/irm-newsroom.php

    r1785853 r1830452  
    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.8
     19 * Version:           1.0.9
    2020 * Author:            IRM
    2121 * Author URI:        http://irmau.com
     
    208208
    209209        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>';
     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. Do not enable this if you have manually added the scripts to the header.</p>';
    211211        //echo '$share_price_toggle:' . $share_price_toggle . '<br>';
    212212        echo '<select name="share_price_toggle">';
     
    238238    if( $active_tab == "shareprice" ) {
    239239        echo '<h3>Share Price</h3>';
    240         echo '<p>If you have share prices as part of your IRM Newsroom package, you can enable them below.</p>';
     240        echo '<p>If you have share prices as part of your IRM Newsroom package, you can enable them in the <b>Configure IRM Newsroom</b> Tab.</p>';
     241        echo '<h3>Share Price Shortcodes</h3>';
     242        echo '<p>Here are some shortcodes to allow you to add share prices. </p>';
     243        echo '<h4>Small Share Price Widget</h4>';
     244        echo '<p>This will add a small share price widget</p>';
     245        echo '<code>[sharepriceSnippet]</code>';
     246        echo '<h4>Share Price Table</h4>';
     247        echo '<p>This will add a large share price table. </p>';
     248        echo '<code>[sharepriceTable]</code>';
     249        echo '<h4>Share Price Chart</h4>';
     250        echo '<p>This will add a large share price chart. </p>';
     251        echo '<code>[sharepriceChart]</code>';
    241252        echo "<p><a href='http://www.irmhelpcentre.com/irm/content/shareprice-installation.aspx?RID=1594&RedirectCount=1' target='_blank' class='button button-primary'>For help installing Share Price's please click here.</a></p>";
    242253        //
     
    452463
    453464
    454 // add the irm js
    455 //echo '<script type="text/javascript" src="http://demo.test.irmau.com/irm/js/ShowListPage.js"></script>';
     465function shortcode_spSnippet() {
     466  return '<div class="widget-wrap" style="overflow:hidden;">
     467  <div id="loadshareprice"><img class="asx-logo" src="https://www.irmau.com/site/content/images/asxLogo.png" alt="" />
     468    <div class="price" data-quoteapi="price" id="price">&nbsp;</div>
     469    <div class="market-cap" id="market-cap">Market Cap: <span data-quoteapi="marketCap">&nbsp;</span></div>
     470    <div class="spdelay">Price Delay ~20min</div>
     471  </div>
     472</div>';
     473}
     474add_shortcode('sharepriceSnippet', 'shortcode_spSnippet');
     475
     476function shortcode_spTable() {
     477  return '<div class="shareprice-col" id="sp-asx">
     478  <div class="row sptable">
     479    <div class="columns">
     480      <h4>Buy</h4>
     481      <p data-quoteapi="bid">&nbsp;</p>
     482    </div>
     483    <div class="columns">
     484      <h4>Sell</h4>
     485      <p data-quoteapi="ask">&nbsp;</p>
     486    </div>
     487    <div class="columns">
     488      <h4>First</h4>
     489      <p data-quoteapi="open">&nbsp;</p>
     490    </div>
     491    <div class="columns">
     492      <h4>High</h4>
     493      <p data-quoteapi="high">&nbsp;</p>
     494    </div>
     495    <div class="columns">
     496      <h4>Low</h4>
     497      <p data-quoteapi="low">&nbsp;</p>
     498    </div>
     499    <div class="columns">
     500      <h4>Last</h4>
     501      <p data-quoteapi="close">&nbsp;</p>
     502    </div>
     503    <div class="columns">
     504      <h4>MktPrice</h4>
     505      <p data-quoteapi="price">&nbsp;</p>
     506    </div>
     507    <div class="columns">
     508      <h4>Change</h4>
     509      <p data-quoteapi="change">&nbsp;</p>
     510    </div>
     511    <div class="columns">
     512      <h4>Percent Change</h4>
     513      <p data-quoteapi="pctChange">&nbsp;</p>
     514    </div>
     515    <div class="columns">
     516      <h4>Volume</h4>
     517      <p data-quoteapi="volume">&nbsp;</p>
     518    </div>
     519    <div class="columns">
     520      <h4>Total Trades</h4>
     521      <p data-quoteapi="tradeCount">&nbsp;</p>
     522    </div>
     523    <div class="columns">
     524      <h4>MktCap</h4>
     525      <p data-quoteapi="marketCap">&nbsp;</p>
     526    </div>
     527  </div>
     528</div>';
     529}
     530add_shortcode('sharepriceTable', 'shortcode_spTable');
     531
     532function shortcode_spChart() {
     533  return '<h2>ASX Share Chart</h2>
     534<p>Below are share charts depicting the Company\'s performance over different time periods. The trend charts update each morning. Share prices and charts by iguana2. <a href="http://iguana2.com/legal-ir">Terms of use</a><br /> &nbsp;</p>
     535<div class="centered" data-quoteapi="mainChart">
     536  <div class="irmau-main-chart" data-quoteapi="plots">&nbsp;</div>
     537  <div class="irmau-from-to"><span data-quoteapi="displayedRange.from"></span> to <span data-quoteapi="displayedRange.to"></span></div>
     538  <div>
     539    <ul class="chart-buttons">
     540      <li data-quoteapi="range=1d">Today</li>
     541      <li data-quoteapi="range=1m">1 mnth</li>
     542      <li data-quoteapi="range=3m">3 mnths</li>
     543      <li data-quoteapi="range=6m">6 mnths</li>
     544      <li data-quoteapi="range=ytd">ytd</li>
     545      <li data-quoteapi="range=1y">1 yr</li>
     546      <li data-quoteapi="range=3y">3 yrs</li>
     547      <li data-quoteapi="range=5y">5 yrs</li>
     548      <li data-quoteapi="range=10y">10 yrs</li>
     549    </ul>
     550  </div>
     551  <div class="irmau-main-chart irmau-nav-chart" data-quoteapi="navChart1">&nbsp;</div>
     552  <form data-quoteapi="preventSubmit"><input type="checkbox" data-quoteapi="volume.visible" /> Volume <input type="checkbox" data-quoteapi="announcements.visible" /> Announcements
     553    <div class="chart-button"><button data-quoteapi="download">Download CSV</button></div>
     554  </form>
     555</div>';
     556}
     557add_shortcode('sharepriceChart', 'shortcode_spChart');
     558
Note: See TracChangeset for help on using the changeset viewer.