Example #1
0
function mf_sponsor_list($category_name, $slug = '')
{
    //get the list of links based on faire name
    $sponsors = get_bookmarks(array('orderby' => 'name', 'category_name' => $category_name, 'limit' => 40));
    $slugData = get_term_by('slug', $slug, 'link_category', OBJECT);
    if (is_object($slugData)) {
        $slugCat = get_objects_in_term($slugData->term_id, 'link_category');
    } else {
        $slugCat = array();
    }
    //get the list of links based on sponsor category name
    $slugData = get_term_by('slug', $category_name, 'link_category', OBJECT);
    $sponsorName = get_objects_in_term($slugData->term_id, 'link_category');
    //find the links that are in both the sponsor category and specified faire
    if (!empty($slugCat)) {
        $category = array_intersect($slugCat, $sponsorName);
    } else {
        $category = $sponsorName;
    }
    $include = implode(',', $category);
    $sponsors = array();
    if (!empty($include)) {
        $sponsors = get_bookmarks(array('orderby' => 'name', 'limit' => 40, 'include' => $include));
    }
    // Get the output started.
    $output = '<ul>';
    // Loop through each block of sponsors
    foreach ($sponsors as $idx => $spon) {
        //foreach ($sponsor as $spon) {
        $output .= '<li><a href="' . esc_url($spon->link_url) . '"><img src="' . legacy_get_resized_remote_image_url($spon->link_image, 125, 105) . '" alt=""></a></li>';
        //}
    }
    $output .= '</ul>';
    return $output;
}
Example #2
0
$entries = GFAPI::get_entries(24, null, $sorting, array('offset' => 0, 'page_size' => 10));
?>
                    
                    <?php 
foreach ($entries as $entry) {
    ?>
                    <div class="slide" data-url="<?php 
    echo $entry['4'];
    ?>
">
                        <div class="bg-stretch">
                            <a href="<?php 
    echo $entry['4'];
    ?>
"><img src="<?php 
    echo legacy_get_resized_remote_image_url($entry['1'], 1274, 370);
    ?>
" alt="Maker Faire slide show image"></a>
                        </div>
                        <div class="text-box">
                            <div class="container">
                                <div class="row">
                                    <div class="col-xs-12">
                                    <a href="<?php 
    echo $entry['4'];
    ?>
" style="color:#FFF;">
                                        <h1><?php 
    echo $entry['2'];
    ?>
</h1>
Example #3
0
/**
 * The new and improved schedule by location shortcode.
 *
 * We wanted a better code base that is more maintainable and performant that also supports our new location architecture.
 * To use, pass in the location_id attribute in the shortcode with the locations ID along with what faire you want applications from. Passing the faire is necessary for future archiving.
 * From there we'll query all events for each day and cache them.
 * Now we'll loop through each day spitting out all applications scheduled for those days from 10am to closing of that day.
 *
 * @param  array $atts The attributes being passed through the shortcode
 * @return string
 */
function mf_display_schedule_by_location($atts)
{
    global $mfform;
    $data = shortcode_atts(array('location_id' => '', 'faire' => MF_CURRENT_FAIRE), $atts);
    // Get the faire date array. If the
    $faire_date = mf_get_faire_date(sanitize_title($data['faire']));
    // Make sure we actually passed a valid faire...
    if (empty($faire_date)) {
        return '<h3>Not a valid faire!</h3>';
    }
    // Get the location object.
    $location = get_post(absint($data['location_id']));
    // Get Saturday events by location
    $saturday = wp_cache_get(sanitize_title($location->post_title) . '_saturday_schedule_' . sanitize_title($data['faire']), 'locations');
    if ($saturday === false) {
        $events_saturday_args = array('post_type' => 'event-items', 'orderby' => 'meta_value', 'order' => 'ASC', 'meta_key' => 'mfei_start', 'posts_per_page' => 30, 'faire' => sanitize_title($data['faire']), 'meta_query' => array(array('key' => 'mfei_day', 'value' => 'Saturday'), array('key' => 'faire_location', 'value' => serialize(array(absint($data['location_id']))))));
        $saturday = new WP_Query($events_saturday_args);
        wp_cache_set(sanitize_title($location->post_title) . '_saturday_schedule_' . sanitize_title($data['faire']), $saturday, 'locations', 300);
    }
    // Get Sunday Events by location
    $sunday = wp_cache_get(sanitize_title($location->post_title) . '_sunday_schedule_' . sanitize_title($data['faire']), 'locations');
    if ($sunday === false) {
        $events_sunday_args = array('post_type' => 'event-items', 'orderby' => 'meta_value', 'order' => 'ASC', 'meta_key' => 'mfei_start', 'posts_per_page' => 30, 'faire' => sanitize_title($data['faire']), 'meta_query' => array(array('key' => 'mfei_day', 'value' => 'Sunday'), array('key' => 'faire_location', 'value' => serialize(array(absint($data['location_id']))))));
        $sunday = new WP_Query($events_sunday_args);
        wp_cache_set(sanitize_title($location->post_title) . '_sunday_schedule_' . sanitize_title($data['faire']), $sunday, 'locations', 300);
    }
    $output = '<div class="row"><div class="col-xs-11"><h2><a href="' . esc_url(get_permalink(absint($data['location_id'])) . '?faire=' . $data['faire']) . '">' . esc_html($location->post_title) . '</a></h2></div> <div class="col-xs-1 pull-right" style="position:relative; top:7px;"><a href="#" onclick="window.print();return false;"><img src="' . get_stylesheet_directory_uri() . '/images/print-ico.png" alt="Print this schedule" /></a></div></div>';
    if (!empty($location->post_excerpt)) {
        $output .= '<div class="alert alert-info">' . wp_kses_post(Markdown($location->post_excerpt)) . '</div>';
    }
    // Let's loop through each day and spit out a schedule?
    $days = array('saturday', 'sunday');
    foreach ($days as $key => $day) {
        // Make sure something was actually returned
        if (${$day}->found_posts >= 1) {
            // Start the schedule
            $output .= '<table id="' . esc_attr($day) . '" class="table table-striped table-bordered table-schedule">';
            $output .= '<thead><tr><th colspan="2">' . esc_html(date('l dS, Y', strtotime($faire_date[ucfirst($day)]))) . '</th></tr></thead>';
            // Loop through the events and get the applications
            while (${$day}->have_posts()) {
                ${$day}->the_post();
                $event_id = get_the_ID();
                $meta = get_post_meta(absint(get_the_ID()));
                $app_obj = get_post(absint($meta['mfei_record'][0]));
                $app = json_decode(mf_convert_newlines(str_replace("\\'", "'", $app_obj->post_content)));
                $output .= '<tr>';
                $output .= '<td width="150" style="max-width:150px;">';
                $output .= '<h5>' . esc_html($meta['mfei_day'][0]) . '</h5>';
                $output .= '<p>' . esc_html($meta['mfei_start'][0]) . ' &mdash; ' . esc_html($meta['mfei_stop'][0]) . '</p>';
                if (isset($app->{$mfform->merge_fields('form_photo', $app->form_type)}) || has_post_thumbnail(absint($event_id)) || isset($app->{$mfform->merge_fields('user_photo', $app->form_type)})) {
                    $output .= '<div class="pull-left">';
                    // We may want to over ride the photo of an application on the schedule page by checking if there is a featured image on the event item
                    if (has_post_thumbnail(absint($event_id))) {
                        $output .= get_the_post_thumbnail(absint($event_id), 'schedule-thumb');
                    } elseif ($app->form_type == 'performer' || $app->form_type == 'exhibit') {
                        $output .= '<a href="' . get_permalink(absint($app_obj->ID)) . '"><img class="img-thumbnail" src="' . legacy_get_resized_remote_image_url($app->{$mfform->merge_fields('user_photo', $app->form_type)}, 140, 140) . '" alt="' . esc_attr($app_obj->post_title) . '"></a>';
                    } elseif (!empty($app->{$mfform->merge_fields('user_photo', $app->form_type)}[0])) {
                        $output .= '<a href="' . get_permalink(absint($app_obj->ID)) . '"><img class="img-thumbnail" src="' . legacy_get_resized_remote_image_url($app->{$mfform->merge_fields('user_photo', $app->form_type)}[0], 140, 140) . '" alt="' . esc_attr($app_obj->post_title) . '"></a>';
                    } else {
                        $output .= '<a href="' . get_permalink(absint($app_obj->ID)) . '"><img class="img-thumbnail" src="' . legacy_get_resized_remote_image_url(mf_get_the_maker_image($app), 140, 140) . '" alt="' . esc_attr($app_obj->post_title) . '"></a>';
                    }
                    $output .= '</div>';
                }
                $output .= '</td><td>';
                $output .= '<h3><a href="' . get_permalink(absint($app_obj->ID)) . '">' . get_the_title(absint($app_obj->ID)) . '</a></h3>';
                // Presenter Name(s)
                if (!empty($app->presenter_name)) {
                    $output .= '<h4 class="maker-name">' . implode(', ', $app->presenter_name) . '</h4>';
                }
                // Application Descriptions
                $description = $app->{$mfform->merge_fields('project_description', $app->form_type)};
                if (!empty($description)) {
                    $output .= Markdown(stripslashes(wp_filter_post_kses(mf_convert_newlines($description))));
                }
                // Add our video link for video coverage
                if (!empty($meta['mfei_coverage'][0])) {
                    $output .= '<p><a href="' . esc_url($meta['mfei_coverage'][0]) . '" class="btn btn-xs btn-primary">Watch Video</a></p>';
                }
                $output .= '</td>';
                $output .= '</tr>';
            }
            $output .= '</table>';
            wp_reset_postdata();
        }
    }
    // OMG WTF JUST HAPPENED. LET'S JUST RETURN THIS. :P
    return $output;
}
 public function get_value_entry_list($value, $entry, $field_id, $columns, $form)
 {
     if ($this->multipleFiles) {
         $uploaded_files_arr = empty($value) ? array() : json_decode($value, true);
         $file_count = count($uploaded_files_arr);
         if ($file_count > 1) {
             $value = empty($uploaded_files_arr) ? '' : sprintf(__('%d files', 'gravityforms'), count($uploaded_files_arr));
             return $value;
         } elseif ($file_count == 1) {
             $value = $uploaded_files_arr[0];
         }
     }
     $file_path = $value;
     if (!empty($file_path)) {
         //displaying thumbnail (if file is an image) or an icon based on the extension
         $thumb = GFEntryList::get_icon_url($file_path);
         $file_path = esc_attr($file_path);
         $file_path = legacy_get_resized_remote_image_url($file_path, 125, 125);
         $value = "<a class='thickbox' href='{$file_path}' target='_blank' title='" . __('Click to view', 'gravityforms') . "'><img class='thickbox' style='width: 125px;' src='{$file_path}'/></a>";
     }
     return $value;
 }
function get_mf_schedule_by_faire($faire, $day = '', $area = '', $subarea = '')
{
    $faire = strtoupper($faire);
    $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
    if ($mysqli->connect_errno) {
        echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
    }
    $select_query = "SELECT  area.area,subarea.subarea,subarea.nicename,\n                                entity.lead_id as entry_id, DAYNAME(schedule.start_dt) as day,\n                                entity.project_photo as photo, schedule.start_dt, schedule.end_dt, \n                                entity.presentation_title, entity.desc_short as description,  \n                                (select  group_concat( distinct concat(maker.`FIRST NAME`,' ',maker.`LAST NAME`) separator ', ') as Makers\n                                    from    wp_mf_maker maker, \n                                            wp_mf_maker_to_entity maker_to_entity\n                                    where   schedule.entry_id           = maker_to_entity.entity_id  AND\n                                            maker_to_entity.maker_id    = maker.maker_id AND\n                                            maker_to_entity.maker_type != 'Contact' \n                                    group by maker.lead_id\n                                )  as makers_list    ,\n                                (select  Photo from    wp_mf_maker maker, \n                                            wp_mf_maker_to_entity maker_to_entity\n                                    where   schedule.entry_id           = maker_to_entity.entity_id  AND\n                                            maker_to_entity.maker_id    = maker.maker_id AND\n                                            maker_to_entity.maker_type = 'presenter' \n                                    group by maker.lead_id\n                                )  as maker_photo     \n                        \n                        FROM    wp_mf_schedule schedule, \n                                wp_mf_entity entity, \n                                wp_mf_location location, \n                                wp_mf_faire_subarea subarea, \n                                wp_mf_faire_area area\n                                                            \n                        where   schedule.entry_id   = entity.lead_id \n                                AND entity.status       = 'Accepted' \n                                and location.entry_id   = schedule.entry_id\n                                and location.ID         = schedule.location_id\n                                and subarea.id          = location.subarea_id\n                                and area.id             = subarea.area_id\n                                and schedule.faire      = '" . $faire . "' " . " ORDER BY   subarea.sort_order, \n                                    schedule.start_dt ASC";
    $mysqli->query("SET NAMES 'utf8'");
    $result = $mysqli->query($select_query) or trigger_error($mysqli->error . "[{$select_query}]");
    // Initalize the schedule container
    $schedules = array();
    // Loop through the posts
    while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
        // Return some post meta
        $entry_id = $row['entry_id'];
        $app_id = $entry_id;
        $day = $row['day'];
        $start = strtotime($row['start_dt']);
        $stop = strtotime($row['end_dt']);
        $schedule['nicename'] = $row['nicename'];
        $schedule['subarea'] = $row['subarea'];
        // REQUIRED: Schedule ID
        $schedule['id'] = $entry_id;
        $schedule_name = isset($row['presentation_title']) ? $row['presentation_title'] : '';
        // Get Maker and Project Photo images.  Use the maker if it is set.
        $maker_photo = !empty($row['maker_photo']) ? $row['maker_photo'] : '';
        $project_photo = !empty($row['photo']) ? $row['photo'] : '';
        $app_photo = empty($maker_photo) ? $project_photo : $maker_photo;
        //find out if there is an override image for this page
        $overrideImg = findOverride($entry_id, 'schedule');
        if ($overrideImg != '') {
            $app_photo = $overrideImg;
        }
        // REQUIED: Application title paired to scheduled item
        $schedule['name'] = html_entity_decode($schedule_name, ENT_COMPAT, 'utf-8');
        $schedule['time_start'] = date(DATE_ATOM, $start);
        $schedule['time_end'] = date(DATE_ATOM, $stop);
        $schedule['day'] = $day;
        $schedule['project_description'] = isset($row['description']) ? $row['description'] : '';
        // Rename the field, keeping 'time_end' to ensure this works.
        $schedule['time_stop'] = date(DATE_ATOM, strtotime('-1 hour', $stop));
        // Schedule thumbnails. Nothing more than images from the application it is tied to
        $schedule['thumb_img_url'] = esc_url(legacy_get_resized_remote_image_url($app_photo, '80', '80'));
        $schedule['large_img_url'] = esc_url(legacy_get_resized_remote_image_url($app_photo, '600', '600'));
        // A list of applications assigned to this event (should only be one really...)
        $schedule['entity_id_refs'] = array(absint($entry_id));
        // Application Makers
        $schedule['maker_list'] = !empty($row['makers_list']) ? $row['makers_list'] : null;
        $maker_ids = array();
        // Put the application into our list of schedules
        array_push($schedules, $schedule);
    }
    return $schedules;
}
Example #6
0
 // Loop through the posts
 while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
     // Store the app information
     //$app_data = json_decode( mf_clean_content( $post->post_content ) );
     // REQUIRED: Application ID
     $app['id'] = absint($row['lead_id']);
     // REQUIRED: Application name
     $app['name'] = html_entity_decode($row['presentation_title'], ENT_COMPAT, 'utf-8');
     // Application Thumbnail and Large Images
     $app_image = $row['project_photo'];
     //find out if there is an override image for this page
     $overrideImg = findOverride($row['lead_id'], 'app');
     if ($overrideImg != '') {
         $app_image = $overrideImg;
     }
     $app['thumb_img_url'] = esc_url(legacy_get_resized_remote_image_url($app_image, '80', '80'));
     $app['large_image_url'] = esc_url($app_image);
     // Should actually be this... Adding it in for the future.
     $app['large_img_url'] = esc_url($app_image);
     // Application Locations
     $app['venue_id_ref'] = $row['venue_id'];
     // Mobile App Discover
     $app['mobile_app_discover'] = $row['mobile_app_discover'];
     // Application Makers
     $app_id = $app['id'];
     // get the entity id
     $maker_ids = $row['exhibit_makers'];
     $app['exhibit_makers'] = !empty($maker_ids) ? explode(',', $maker_ids) : null;
     // Application Categories
     $category_ids = $row['Categories'];
     $app['category_id_refs'] = explode(',', $category_ids);
    /**
     * Current Faire Page
     */
    function display_current_faire_page()
    {
        //must check that the user has the required capability
        if (!current_user_can($this->user_capabilities)) {
            wp_die(__('You do not have sufficient permissions to access this page.', 'make'));
        }
        // Get any query variables if set
        $query_vars = $this->get_query_vars();
        // Check if we are filtering our results by post type.
        if (empty($query_vars['post_status']) || $query_vars['post_status'] == 'all') {
            $post_status = array_slice($this->post_status, 1);
        } else {
            $post_status = $query_vars['post_status'];
        }
        $args = array('faire' => $this->current_faire, 'post_type' => $this->post_type, 'post_status' => $post_status, 'posts_per_page' => $query_vars['posts_per_page'], 'paged' => $query_vars['paged'], 'cat' => $query_vars['category'], 'tag' => $query_vars['tag'], 'type' => $query_vars['app_type'], 'meta_key' => $query_vars['edu_day'], 'orderby' => $query_vars['order_by'], 's' => $query_vars['search'], 'p' => $query_vars['post_id']);
        $query = new WP_Query($args);
        ?>
			<div class="wrap">
				<h1><?php 
        echo $this->submenu_data['page_title'];
        ?>
</h1>
				<ul class="subsubsub">
					<?php 
        echo $this->count_post_status();
        ?>
				</ul>

				<form method="get" class="posts-filter">
					<input type="hidden" name="post_type" value="<?php 
        echo esc_attr($_REQUEST['post_type']);
        ?>
" />
					<input type="hidden" name="page" value="<?php 
        echo esc_attr($_REQUEST['page']);
        ?>
" />
					<?php 
        wp_nonce_field('overview-form-save', $this->nonce_name, false);
        ?>

					<p class="search-box">
						<label for="post-search-input" class="screen-reader-text">Search All Applications</label>
						<input type="search" id="post-search-input" name="s" value="<?php 
        echo isset($query_vars['search']) ? esc_attr($query_vars['search']) : '';
        ?>
">
						<input type="submit" name="" id="search-submit" class="button" value="Search All Applications">
					</p>

					<div class="tablenav top">
						<?php 
        echo $this->application_type_dropdown();
        ?>
						<?php 
        echo $this->categories_dropdown();
        ?>
						<?php 
        echo $this->tags_dropdown();
        ?>
						<?php 
        echo $this->orderby_dropdown();
        ?>
						<?php 
        echo $this->posts_per_page_dropdown(array(20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 1000));
        ?>
						<label for="post-search-id" class="screen-reader-text">Search by Project ID</label>
						<input type="search" id="post-search-id" name="p" placeholder="Project ID" value="<?php 
        echo isset($_GET['p']) && !empty($_GET['p']) ? esc_attr($_GET['p']) : '';
        ?>
">
						<input type="submit" name="" id="filter-submit" class="button" value="Filter All Content">
						<button class="button"><a href="<?php 
        echo esc_url(admin_url($this->submenu_data['page_url']));
        ?>
">Reset Filters</a></button>
						<div class="tablenav-pages">
							<span class="displaying-num"><?php 
        echo absint($query->found_posts);
        ?>
 Items</span>
							<?php 
        echo $this->get_pagination_link($query->max_num_pages, $query_vars['paged']);
        ?>
						</div>

					</div>

					<table id="current-faire" class="wp-list-table widefat fixed pages">
						<thead>
							<tr>
								<?php 
        foreach ($this->columns as $column => $details) {
            ?>
									<th scope="col" id="<?php 
            echo $column;
            ?>
" class="manage-column column-<?php 
            echo $column;
            echo $details['sortable'] ? ' table-sortable' : '';
            ?>
"<?php 
            echo $this->check_screen_options($column, false, $details['default']);
            ?>
><?php 
            echo $details['label'];
            ?>
</th>
								<?php 
        }
        ?>
							</tr>
						</thead>
						<tfoot>
							<tr>
								<?php 
        foreach ($this->columns as $column => $details) {
            ?>
									<th scope="col" id="<?php 
            echo $column;
            ?>
" class="manage-column column-<?php 
            echo $column;
            echo $details['sortable'] ? ' table-sortable' : '';
            ?>
"<?php 
            echo $this->check_screen_options($column, false, $details['default']);
            ?>
><?php 
            echo $details['label'];
            ?>
</th>
								<?php 
        }
        ?>
							</tr>
						</tfoot>
						<tbody id="the-list">
							<?php 
        global $post, $wp_post_statuses;
        if (!empty($query->posts)) {
            foreach ($query->posts as $post) {
                setup_postdata($post);
                // Set just a couple of variables.... :/
                $json = json_decode(str_replace('\\', '\\\\', $post->post_content));
                $post_id = absint($post->ID);
                $app_image = mf_get_the_maker_image($json);
                $post_status = $wp_post_statuses[get_post_status()]->label;
                $maker_name = !empty($json->name) ? $json->name : '';
                $app_type = get_the_term_list($post_id, 'type', '', ', ', '');
                $description = !empty($json->public_description) ? mf_clean_content($json->public_description) : '';
                $cats = get_the_category_list(', ', '', $post_id);
                $tags = get_the_term_list($post_id, 'post_tag', null, ', ');
                $location = mf_get_locations($post_id);
                $featured = get_post_meta($post_id, '_ef_editorial_meta_checkbox_featured', true);
                $commercial = !empty($json->sales) ? sanitize_text_field($this->convert_boolean($json->sales)) : '';
                $edu_day = get_post_meta($post_id, '_ef_editorial_meta_checkbox_education-day', true);
                echo '<tr id="post-' . absint($post->ID) . '" valign="top">';
                echo '<td class="post_photo column-post_photo"' . $this->check_screen_options('post_photo', false, true) . '>';
                if (!empty($app_image)) {
                    echo '<img src="' . legacy_get_resized_remote_image_url(esc_url($app_image), 130, 130, true) . '" width="130" height="130">';
                }
                echo '</td>';
                echo '<td class="post_id column-post_id"' . $this->check_screen_options('post_id', false, true) . '>' . $post_id . '</td>';
                echo '<td class="post_status column-post_status"' . $this->check_screen_options('post_status', false, true) . '>' . $post_status . '</td>';
                echo '<td class="post_title column-post_title"' . $this->check_screen_options('post_title', false, true) . '><strong><a href="' . get_edit_post_link(absint($post->ID)) . '">' . esc_html(get_the_title()) . '</a></strong>
												<div class="row-actions">
													<span class="inline hide-if-no-js"><a href="' . get_edit_post_link(absint($post->ID)) . '">Edit</a> | </span>
													<span class="view"><a href="' . get_permalink() . '">View</a></span>
												</div>
											  </td>';
                echo '<td class="post_author column-post_author"' . $this->check_screen_options('post_author', false, true) . '>' . esc_html($maker_name) . '</td>';
                echo '<td class="post_type column-post_type"' . $this->check_screen_options('post_type', false, true) . '>' . $app_type . '</td>';
                echo '<td class="post_description column-post_description"' . $this->check_screen_options('post_description', false, true) . '>' . wp_trim_words(Markdown(wp_kses_post($description)), 15) . '</td>';
                echo '<td class="cats column-cats"' . $this->check_screen_options('cats', false, true) . '>' . $cats . '</td>';
                echo '<td class="tags column-tags"' . $this->check_screen_options('tags', false, true) . '>' . $tags . '</td>';
                echo '<td class="location column-location"' . $this->check_screen_options('location', false, true) . '>' . esc_html($location) . '</td>';
                echo '<td class="featured_maker column-featured_maker"' . $this->check_screen_options('featured_maker', false, true) . '>' . $this->convert_boolean($featured) . '</td>';
                echo '<td class="post_date column-post_date"' . $this->check_screen_options('post_date', false, true) . '>' . $this->process_dates($post->post_date, $post->post_modified) . '</td>';
                echo '<td class="commercial column-commercial"' . $this->check_screen_options('commercial', false, true) . '>' . $commercial . '</td>';
                echo '<td class="education_day column-education_day"' . $this->check_screen_options('education_day', false, true) . '>' . $this->convert_boolean($edu_day) . '</td>';
                echo '</tr>';
            }
        } else {
            echo '<tr class="no-items"><td class="colspanchange" colspan="3">No content found.</td></tr>';
        }
        ?>
						</tbody>

					</table>
					<div class="tablenav bottom">

						<div class="tablenav-pages">
							<span class="displaying-num"><?php 
        echo absint($query->found_posts);
        ?>
 Items</span>
							<?php 
        echo $this->get_pagination_link($query->max_num_pages, $query_vars['paged']);
        ?>
						</div>

					</div>
				</form>
			</div>
		<?php 
    }
Example #8
0
function displayContent($content, $lead, $fieldData, $display = 'table')
{
    global $display_empty_fields;
    $return = '';
    if ($display == 'table') {
        $return .= '<table>';
    }
    $form = GFAPI::get_form($lead['form_id']);
    foreach ($content as $fieldID) {
        if (isset($fieldData[$fieldID])) {
            $field = $fieldData[$fieldID];
            $value = RGFormsModel::get_lead_field_value($lead, $field);
            if (RGFormsModel::get_input_type($field) != 'fileupload') {
                $display_value = GFCommon::get_lead_field_display($field, $value, $lead['currency']);
                $display_value = apply_filters('gform_entry_field_value', $display_value, $field, $lead, $form);
            } else {
                //display images in a grid
                if ($value != '') {
                    $display_value = '<img width="100px" src="' . legacy_get_resized_remote_image_url($value, 100, 100) . '" alt="" />';
                } else {
                    $display_value = '';
                }
            }
            if ($display_empty_fields || !empty($display_value) || $display_value === '0') {
                $display_value = empty($display_value) && $display_value !== '0' ? '&nbsp;' : $display_value;
                if ($display == 'table') {
                    $content = '
                            <tr>
                            <td colspan="2" class="entry-view-field-name">' . esc_html(GFCommon::get_label($field)) . '</td>
                            </tr>
                            <tr>
                            <td colspan="2" class="entry-view-field-value">' . $display_value . '</td>
                            </tr>';
                } else {
                    $content = '<div style="' . ($field['cssClass'] == '' ? 'float:left;' : '') . 'padding:5px;margin:10px" class="' . $field['cssClass'] . '">' . esc_html(GFCommon::get_label($field)) . '<br/>' . $display_value . '</div>';
                }
                $content = apply_filters('gform_field_content', $content, $field, $value, $lead['id'], $form['id']);
                $return .= $content;
            }
        }
    }
    if ($display == 'table') {
        $return .= '</table>';
    }
    if ($display == 'grid') {
        $return .= '<div class="clear"></div>';
    }
    return $return;
}
" alt="Slide gallery thumbnail"></a>
				 				</div>
                              	<?php 
for ($i = 0; $i < count($entries); $i++) {
    if ($i == $randEntryKey) {
        continue;
    }
    ?>
					 				<div class="slide">
                                                                            <?php 
    //find out if there is an override image for this page
    $overrideImg = findOverride($entries[$i]['id'], 'mtm');
    $projPhoto = $overrideImg == '' ? $entries[$i]['22'] : $overrideImg;
    ?>
					     				<a href="#"><img class="cycle-gallery-thumb" src="<?php 
    echo legacy_get_resized_remote_image_url($projPhoto, 95, 95);
    ?>
" alt="Slide gallery thumbnail"></a>
					 				</div>
                             	<?php 
}
// end for
?>
							</div>
						</div>
						<a class="btn-prev" href="#"><i class="icon-arrow-left"></i></a>
						<a class="btn-next" href="#"><i class="icon-arrow-right"></i></a>
					</div>
				</div>
			</div>
		</div>
Example #10
0
     $schedule['time_start'] = date(DATE_ATOM, strtotime('+4 hour', $start));
     $schedule['time_end'] = date(DATE_ATOM, strtotime('+4 hour', $stop));
     //ORIGINAL CALL
     //$schedule['time_start'] = date( DATE_ATOM, strtotime( '-1 hour', strtotime( $dates[$day] . $start . $dates['time_zone'] ) ) );
     //$schedule['time_end'] = date( DATE_ATOM, strtotime( '-1 hour', strtotime( $dates[$day] . $stop . $dates['time_zone'] ) ) );
     // Rename the field, keeping 'time_end' to ensure this works.
     $schedule['time_stop'] = date(DATE_ATOM, strtotime('+4 hour', $stop));
     // Schedule thumbnails. Nothing more than images from the application it is tied to
     $app_image = $project_photo;
     //find out if there is an override image for this page
     $overrideImg = findOverride($entry_id, 'app');
     if ($overrideImg != '') {
         $app_image = $overrideImg;
     }
     $schedule['thumb_img_url'] = esc_url(legacy_get_resized_remote_image_url($app_image, '80', '80'));
     $schedule['large_img_url'] = esc_url(legacy_get_resized_remote_image_url($app_image, '600', '600'));
     // REQUIRED: Venue ID reference
     //$schedule['venue_id_ref'] = $row[11];                //??
     $maker_ids = $row['exhibit_makers'];
     $app['exhibit_makers'] = !empty($maker_ids) ? explode(',', $maker_ids) : null;
     // A list of applications assigned to this event (should only be one really...)
     $schedule['entity_id_refs'] = array_merge(array($entry_id));
     // Application Makers
     $schedule['maker_id_refs'] = $maker_ids;
     // Put the application into our list of schedules
     array_push($schedules, $schedule);
 }
 $header = array('header' => array('version' => esc_html(MF_EVENTBASE_API_VERSION), 'results' => intval($result->num_rows)));
 // Merge the header and the entities
 $merged = array_merge($header, array('schedule' => $schedules));
 // Output the JSON
Example #11
0
function makerfaire_news_rss()
{
    ?>
	<div class="newsies">
		<div class="news post">
			<h3 style="color: #fc040c;">
				<a href="http://makezine.com/tag/maker-faire/">Latest Maker Faire News</a>
			</h3>
			<?php 
    $fs = makerfaire_index_feed();
    foreach ($fs as $f) {
        $a = $f['i']->get_authors();
        ?>
				<div class="row">
					<div class="col-md-2">
						<a href="<?php 
        echo esc_url($f['i']->get_link());
        ?>
" title="<?php 
        echo esc_attr($f['i']->get_title());
        ?>
"><img class="img-thumbnail faire-thumb " alt="<?php 
        echo legacy_get_resized_remote_image_url(esc_attr($f['i']->get_title()), 308, 202);
        ?>
" src="<?php 
        echo esc_url($f['src']);
        ?>
" /></a>
					</div>
					<div class="col-md-6">
					<h2><a href="<?php 
        echo esc_url($f['i']->get_link());
        ?>
"><?php 
        echo esc_html($f['i']->get_title());
        ?>
</a></h2>
					<?php 
        echo str_replace(array($f['img'], '<p><a href="' . $f['i']->get_link() . '">Read the full article on MAKE</a></p>'), '', html_entity_decode(esc_html($f['i']->get_description())));
        ?>
					
					<!-- READ FULL STORY BUTTON AND LINK
					 <p class="read_more" style="margin:10px 0"><strong>
					<a class="btn btn-primary btn-xs" href="<?php 
        /*  echo esc_url($f['i']->get_link()); */
        ?>
">Read full story &raquo;</a></strong></p> 
					-->

					<!-- AUTHOR AND CATEGORY DESCRIPTIONS
					<ul class="unstyled">
						<li>Posted by <?php 
        /* echo esc_html($a[0]->name); ?> | <?php echo esc_html($f['i']->get_date()); ?></li>
        			<li>Categories: <?php foreach($f['i']->get_categories() as $cat) : echo esc_html($cat->term.', '); endforeach; */
        ?>
</li>
					</ul> 
					-->
					</div>
				</div>
			<?php 
    }
    ?>
		</div>
	</div>
	<h4><a href="http://makezine.com/tag/maker-faire/">Read More &rarr;</a></h4>
<?php 
}
Example #12
0
?>
</h2>
      <hr />
      <?php 
if ($isGroup) {
    echo '<div class="row padbottom">
                ', !empty($groupphoto) ? '<img class="col-md-3 pull-left img-responsive" src="' . legacy_get_resized_remote_image_url($groupphoto, 200, 250) . '" alt="Group Image">' : '<img class="col-md-3 pull-left img-responsive" src="' . get_stylesheet_directory_uri() . '/images/maker-placeholder.jpg" alt="Group Image">';
    echo '<div class="col-md-5">
                  <h3 style="margin-top: 0px;">' . $groupname . '</h3>
                  <p>' . make_clickable($groupbio) . '</p>
                </div>
              </div>';
} else {
    foreach ($makers as $maker) {
        echo '<div class="row padbottom">
                  ', !empty($maker['photo']) ? '<img class="col-md-3 pull-left img-responsive" src="' . legacy_get_resized_remote_image_url($maker['photo'], 200, 250) . '" alt="Maker Image">' : '<img class="col-md-3 pull-left img-responsive" src="' . get_stylesheet_directory_uri() . '/images/maker-placeholder.jpg" alt="Maker Image">';
        echo '<div class="col-md-5">
                    <h3 style="margin-top: 0px;">' . $maker['firstname'] . ' ' . $maker['lastname'] . '</h3>
                    <p>' . make_clickable($maker['bio']) . '</p>
                  </div>
                </div>';
    }
}
?>

      <?php 
if (!empty(display_entry_schedule($entryId))) {
    display_entry_schedule($entryId);
}
?>
      <br />