Solved

Add sortable headers to wordpress calendar plugin

Posted on 2009-03-31
3
666 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
Comment Utility
0
 
LVL 21

Assisted Solution

by:oleggold
oleggold earned 500 total points
Comment Utility
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
htacces issue 2 37
css question 1 31
resizeing PHP image 2 21
fade new row in after record insert with jQuery/ajax/php 18 35
First things first, I say this in many of my articles, but in this one you can take it as fact. I am not in any way an expert when it comes to WordPress. I am strictly a user. I don't know the programming languages involved, and although I could pro…
With Wordpress gaining more and more popularity not only as blogging platform but as a shopping or CMS solution, it's worth to know which plugins are the first ones to grab and integrate with your website. We will briefly go over the most useful plu…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now