Plugin Directory

Changeset 1830549


Ignore:
Timestamp:
02/28/2018 04:09:07 AM (8 years ago)
Author:
irmau
Message:

Added Events Calendar shortcode and tab

Location:
irm-newsroom/trunk
Files:
2 edited

Legend:

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

    r1830452 r1830549  
    105105== Changelog ==
    106106
     107= 1.1.0 =
     108* Added Events Calendar shortcode and tab
     109
    107110= 1.0.9 =
    108111* Added short codes for share prices
  • irm-newsroom/trunk/irm-newsroom.php

    r1830452 r1830549  
    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.9
     19 * Version:           1.1.0
    2020 * Author:            IRM
    2121 * Author URI:        http://irmau.com
     
    146146
    147147    $irm_shortcodes_list = "";
     148    $irm_shortcodes_list = get_data("$site_type://$site_key/$site_directory/SiteData.aspx?DataType=ListPage");
     149
    148150    $irm_shortcodes_flat = "";
    149     $irm_shortcodes_list = get_data("$site_type://$site_key/$site_directory/SiteData.aspx?DataType=ListPage");
    150151    $irm_shortcodes_flat = get_data("$site_type://$site_key/$site_directory/SiteData.aspx?DataType=FlatPage");
     152
     153    $irm_events_list = "";
     154    $irm_events_list = get_data("$site_type://$site_key/$site_directory/sitedata.aspx?DataType=CalendarViewPage");
    151155
    152156    $irm_styles = "
     
    187191    <a href="?page=irm-newsroom&tab=shareprice" class="nav-tab">Shareprice</a>
    188192    <a href="?page=irm-newsroom&tab=menu" class="nav-tab">Menu</a>
     193    <a href="?page=irm-newsroom&tab=events" class="nav-tab">Events Calendar</a>
    189194    </h2>';
    190195
     
    206211        echo '<pre><code>[email_alerts_form]</code></pre>';
    207212        echo '<p><label>Email Alerts Success Page: </label> <input type="text" name="email_landing_page" value="'.$email_landing_page.'" /></p>';
     213        echo '<h3>Email Alerts Unsubscribe</h3>';
     214        echo '<p>To allow subscribers to unsubscribe from email alerts add a link to the following page:</p>';
     215        echo '<pre><code>http://'.$site_key.'/'.$site_directory.'/Unsubscribe.aspx</code></pre>';
    208216
    209217        echo '<h3>Shareprice</h3>';
     
    265273    if( $active_tab == "flat" ) {
    266274        echo $shortcodes_text;
    267         echo '</pre><h2>Flat Page Shortcodes</h2><pre>';
     275        echo '<h2>Flat Page Shortcodes</h2><pre>';
    268276        echo $irm_shortcodes_flat;
     277        echo '</pre>';
     278    }
     279
     280    if( $active_tab == "events" ) {
     281        echo '<h2>Events Calendar Shortcode</h2>';
     282        echo '<p>If you have an events calendar you can use the following code to embed it. If it is blank you will need to create a new events page in HQi.</p>';
     283        echo '<pre>';
     284        if($irm_events_list > "") {
     285            echo $irm_events_list;
     286        } else {
     287            echo "No Events Found";
     288        }
    269289        echo '</pre>';
    270290    }
     
    343363}
    344364
     365function footag_func_events( $atts ) {
     366    $id = $atts[0];
     367    $site_key = esc_attr( get_option('site_key') );
     368    $site_directory = esc_attr( get_option('site_directory') );
     369    $site_type = esc_attr( get_option('site_type') );
     370
     371    if(!$site_directory > "") {
     372        $site_directory = "site";
     373    }
     374    if(!$site_type > "") {
     375        $site_type = "http";
     376    }
     377
     378    $url = "$site_type://$site_key/$site_directory/CalendarViewXml.aspx?CategoryID" . $id;
     379    $jsurl = "$site_type://$site_key/$site_directory/js/Newsroom.js";
     380
     381    return $js_data = "
     382    <div data-calendarurl='$url'>..</div>
     383    <script type='text/javascript' src='$jsurl'></script>
     384    ";
     385
     386}
     387
    345388// get the irm generated menu
    346389function irmmenu() {
     
    371414add_shortcode( 'irmlist', 'footag_func_list' );
    372415add_shortcode( 'irmflat', 'footag_func_flat' );
     416add_shortcode( 'irmcalendarview', 'footag_func_events' );
    373417add_shortcode( 'email_alerts_form', 'email_alerts_form' );
    374418add_shortcode( 'irmmenu', 'irmmenu' );
Note: See TracChangeset for help on using the changeset viewer.