Solved

Add sortable headers to wordpress calendar plugin

Posted on 2009-03-31
3
670 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
The viewer will learn how to count occurrences of each item in an array.

632 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