Exemple #1
0
/** 
 * Display events for a fraternity
 **/
function ifcrush_display_events($frat_letters)
{
    global $wpdb;
    $event_table_name = $wpdb->prefix . "ifc_event";
    $query = "SELECT * FROM {$event_table_name} where fratID='{$frat_letters}'";
    $allevents = $wpdb->get_results($query);
    if ($allevents) {
        create_event_table_header();
        // make a table header
        create_event_add_row($frat_letters);
        foreach ($allevents as $event) {
            // populate the rows with db info
            //echo "<pre>"; print_r($event); echo "</pre>";
            create_event_table_row($event);
        }
        create_event_table_footer();
        // end the table
    } else {
        ?>
<h3>No events.  Add one!</h3><?php 
        create_event_table_header();
        // make a table header
        create_event_add_row($frat_letters);
        create_event_table_footer();
        // end the table
    }
}
Exemple #2
0
/** 
 * Display events for a fraternity
 * Args - the fraternity letters specified by the meta data ifcrush_frat_letters
 *
 **/
function ifcrush_display_events($frat_letters)
{
    global $wpdb;
    $event_table_name = $wpdb->prefix . "ifc_event";
    $query = "SELECT * FROM {$event_table_name} where fratID='{$frat_letters}'";
    $allevents = $wpdb->get_results($query);
    create_event_table_header();
    create_event_add_row($frat_letters);
    if ($allevents) {
        foreach ($allevents as $event) {
            create_event_table_row($event);
        }
    } else {
        ?>
<h3>No events.  Add one!</h3><?php 
    }
    create_event_table_footer();
    // end the table
}