Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Sets up the theme by loading the Mysitemyway class & initializing the framework
- * which activates all classes and functions needed for theme's operation.
- *
- * @package Mysitemyway
- * @subpackage Functions
- */
- # Load the Mysitemyway class.
- require_once( TEMPLATEPATH . '/framework.php' );
- # Get theme data.
- $theme_data = get_theme_data( TEMPLATEPATH . '/style.css' );
- # Initialize the Mysitemyway framework.
- Mysitemyway::init(array(
- 'theme_name' => $theme_data['Name'],
- 'theme_version' => $theme_data['Version']
- ));
- # Display Entroes left.
- function spotsleftShortcode($atts, $content=null) {
- extract(shortcode_atts(array(
- 'id' => ''
- ), $atts));
- $form_id = $id;
- $form = RGFormsModel::get_form_meta($form_id);
- $entry_count = RGFormsModel::get_lead_count($form['id'], '');
- $entries_left = $form["limitEntriesCount"] – $entry_count;
- if($entries_left > 1):
- $entries_left_message = $form['title']. ' – Only ' . $entries_left . ' spots left!';
- elseif($entries_left == 1):
- $entries_left_message = $form['title']. ' – Only ' . $entries_left . ' spot left!';
- else:
- $entries_left_message = $form['title']. ' - Currently sold out. Please fill out our waiting list if you wish to join';
- endif;
- return $entries_left_message;
- }
- add_shortcode('spotsleft', 'spotsleftShortcode');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment