Solved

Add sortable headers to wordpress calendar plugin

Posted on 2009-03-31
3
668 Views
Last Modified: 2012-06-21
Hello all,
I'm using a wordpress blog plugin called "Gigs Calendar" (http://wordpress.org/extend/plugins/gigs-calendar/) the calendar list shows the event name, date, and venue, etc through the use of a template. (Check out http://businessethics.tv/jewishneighbor/?page_id=2 to see an example.) I'd like to make the headers sort the entries.  I've pasted the code from the list template page below. Is there a simple way to add this? Thanks much!
<div class="gigs-calendar">
	<table class="gigs calendar <?php echo $upcoming ? 'upcoming' : 'archive' ?>">
		<?php if ( !empty($caption) ) : ?>
			<caption><?php echo $caption; ?></caption>
		<?php endif; ?>
		<?php if ( $options['list-headers'] ) : ?>
			<thead><tr>
				<?php foreach ( $show_fields as $field ) : ?>
					<th><?php echo $listFields[$field]; ?></th>
				<?php endforeach; ?>
			</tr></thead>
		<?php endif; ?>
		<tbody>
			<?php foreach ( $gigs as $gkey => $g ) : ?>
				<?php foreach ( $g->performances as $key => $p ) : ?>
					<tr id="performance-<?php echo $p->id; ?>" class="<?php echo ($gkey % 2) ? 'even' : 'odd'; ?> <?php echo $key == 0 ? 'gig' : 'performance'; ?> gig-<?php echo $g->id; ?> <?php echo dtcGigs::get_gig_css_classes($g) ?>">
						<?php 
							if ( $key == 0 ) {
								$fields = array(
									'city' => '<td class="city" valign="top">{' . $g->cityState . '}</td>',
									'country' => '<td class="country" valign="top">{' . $g->country . '}</td>',
									'venue' => '<td class="venue" valign="top">{' . $g->name . '}</td>',
									'eventName' => '<td class="eventName" valign="top">{' . $g->eventName . '}</td>',
									'date' => '<td class="date" valign="top">{' . $g->date . '}</td>',
									'time' => '<td class="time" valign="top">{' . $p->time . '}</td>',
									'shortNotes' => '<td class="shortNotes" valign="top">{' . $p->shortNotes . '}</td>',
									'tickets' => ( $upcoming ? '<td class="tickets icon" valign="top">' . ( !empty($p->link) ? '<a target="_blank" href="' . $p->link . '"><img alt="' . __('Buy Tickets', $gcd) . '" title="' . __('Buy Tickets', $gcd) . '" class="clickable tickets" src="' . $folder . 'images/money_dollar.png" /></a>' : '') . '</td>' : '' ),
									'map' => '<td class="map icon" valign="top">' . ($g->mapLink ? '<a target="_blank" href="' . $g->mapLink . '"><img alt="' . __('Map', $gcd) . '" title="' . __('Map', $gcd) . '" class="clickable map" src="' . $folder . 'images/world.png" /></a>' : '') . '</td>',
								);
							} else {
								$fields = array(
									'city' => '<td class="city" valign="top"></td>',
									'country' => '<td class="country" valign="top"></td>',
									'venue' => '<td class="venue" valign="top"></td>',
									'eventName' => '<td class="eventName" valign="top"></td>',
									'date' => '<td class="date" valign="top"></td>',
									'time' => '<td class="time" valign="top">{' . $p->time . '}</td>',
									'shortNotes' => '<td class="shortNotes" valign="top">{' . $p->shortNotes . '}</td>',
									'tickets' => ( $upcoming ? '<td class="tickets icon" valign="top">' . ( !empty($p->link) ? '<a target="_blank" href="' . $p->link . '"><img alt="' . __('Buy Tickets', $gcd) . '" title="' . __('Buy Tickets', $gcd) . '" class="clickable tickets" src="' . $folder . 'images/money_dollar.png" /></a>' : '') . '</td>' : '' ),
									'map' => '<td class="map icon" valign="top"></td>',
								);
							}
							echo dtcGigs::selectFields($fields, $g);
						?>
					</tr>
				<?php endforeach; ?>
			<?php endforeach; ?>
		</tbody>
	</table>
	<?php if ( empty($gigs) && $upcoming ) : ?>
		<div class="no-gigs"><?php echo $options['no-upcoming']; ?></div>
	<?php elseif ( empty($gigs) ) : ?>
		<div class="no-gigs"><?php echo $options['no-past']; ?></div>
	<?php endif; ?>
</div>

Open in new window

0
Comment
Question by:frittonweb
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
oleggold earned 500 total points
ID: 24103149
0
 
LVL 21

Assisted Solution

by:oleggold
oleggold earned 500 total points
ID: 24103150
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question