Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Add sortable headers to wordpress calendar plugin

Posted on 2009-03-31
3
Medium Priority
?
675 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 2000 total points
ID: 24103149
0
 
LVL 21

Assisted Solution

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

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
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.

721 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