Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #3 from jmr06005/master
Updating list view
  • Loading branch information
jmr06005 committed Nov 22, 2017
2 parents 1640dbe + f8aa591 commit 28138ff
Showing 1 changed file with 50 additions and 33 deletions.
83 changes: 50 additions & 33 deletions templates/archive-programs.php
Expand Up @@ -572,12 +572,12 @@ if(($search_results && $search_results->RECORDCOUNT > 0)){
if($_GET['category'] == 'all'){ if($_GET['category'] == 'all'){
foreach($groups as $key=>$group){ foreach($groups as $key=>$group){
if($key == 'all') continue; if($key == 'all') continue;
echo '<h2 style="clear:left">'.$programTabIDs[$key].'</h2>'; echo '<h2 class="sorting-header">'.$programTabIDs[$key].'</h2>';
display($group); display($group);
} }
} }
else{ else{
echo '<h2 style="clear:left">'.$programTabIDs[$_GET['category']].'</h2>'; echo '<h2 class="sorting-header">'.$programTabIDs[$_GET['category']].'</h2>';
display($posts); display($posts);
} }
?> ?>
Expand All @@ -592,6 +592,10 @@ if(($search_results && $search_results->RECORDCOUNT > 0)){
<!-- Grid End --> <!-- Grid End -->
<!-- List Start --> <!-- List Start -->
<div class="tab-pane" id="tab2"> <div class="tab-pane" id="tab2">
<?php if(!empty($posts)):
function displayList($posts = array()){
global $programs;
?>
<ol class="program-list-view" > <ol class="program-list-view" >
<li class="program-list <?php if($tags){ foreach($tags as $tag){echo ' '.strtolower(str_replace($search, $replace, $tag->name));} } ?>"> <li class="program-list <?php if($tags){ foreach($tags as $tag){echo ' '.strtolower(str_replace($search, $replace, $tag->name));} } ?>">
<ul id="badge-list" class="program-headers"> <ul id="badge-list" class="program-headers">
Expand All @@ -611,42 +615,55 @@ if(($search_results && $search_results->RECORDCOUNT > 0)){
</li> </li>
</ul> </ul>
</li> </li>
<?php if(!empty($posts)): foreach($posts as $post): setup_postdata($post); ?> <?php
<?php $tags = get_the_tags(); foreach($posts as $post){ ?>
$search = array(" ", "/"); <?php $tags = get_the_tags($post->ID);
$replace = array("", "-"); $search = array(" ", "/");
$terraid = get_post_meta( get_the_ID(), 'apply-link', true ); $replace = array("", "-");
$terraid = explode('Program_ID=',$terraid); $terraid = get_post_meta( $post->ID, 'apply-link', true );
$terraid = explode('&',$terraid[1]); $terraid = explode('Program_ID=',$terraid);
$terraid = $terraid[0];?> $terraid = explode('&',$terraid[1]);
<li class="program-list <?php if($tags){ foreach($tags as $tag){echo ' '.strtolower(str_replace($search, $replace, $tag->name));} } ?>"> $terraid = $terraid[0];?>
<ul id="badge-list"> <li class="program-list <?php if($tags){ foreach($tags as $tag){echo ' '.strtolower(str_replace($search, $replace, $tag->name));} } ?>">
<a href="<?php the_permalink() ?>"> <ul id="badge-list">
<li class="list-img"> <a href="<?php echo get_the_permalink($post->ID) ?>">
<?php the_post_thumbnail('thumbnail');?> <li class="list-img">
</li> <?php echo get_the_post_thumbnail($post->ID, 'thumbnail');?>
<li class="list-title"> </li>
<?php the_title(); ?> <li class="list-title">
</li> <?php echo get_the_title($post->ID); ?>
<li class="list-city"> </li>
<?php echo $programs[$terraid]->PROGRAM_CITY;//$key="program-city"; echo get_post_meta($post->ID, $key, true); ?> <li class="list-city">
</li> <?php echo $programs[$terraid]->PROGRAM_CITY;//$key="program-city"; echo get_post_meta($post->ID, $key, true); ?>
<li class="list-country"> </li>
<?php echo $programs[$terraid]->PROGRAM_COUNTRY;//$key="program-country"; echo get_post_meta($post->ID, $key, true); ?> <li class="list-country">
</li> <?php echo $programs[$terraid]->PROGRAM_COUNTRY;//$key="program-country"; echo get_post_meta($post->ID, $key, true); ?>
<li class="list-region"> </li>
<?php echo $programs[$terraid]->PROGRAM_REGION;//$key="program-region"; echo get_post_meta($post->ID, $key, true); ?> <li class="list-region">
</li> <?php echo $programs[$terraid]->PROGRAM_REGION;//$key="program-region"; echo get_post_meta($post->ID, $key, true); ?>
</a> </li>
</ul> </a>
</li> </ul>
<?php endforeach?> </li>
<?php }
echo '</ol>';
} // end function displayList
if($_GET['category'] == 'all'){
foreach($groups as $key=>$group){
if($key == 'all') continue;
echo '<h2 class="sorting-header">'.$programTabIDs[$key].'</h2>';
displayList($group);
}
}
else{
echo '<h2 class="sorting-header">'.$programTabIDs[$_GET['category']].'</h2>';
displayList($posts);
}?>
<?php else: ?> <?php else: ?>
<p> <p>
<?php _e('Sorry, no exchange programs are listed.'); ?> <?php _e('Sorry, no exchange programs are listed.'); ?>
</p> </p>
<?php endif; ?> <?php endif; ?>
</ol>
</div> </div>
<!-- List End --> <!-- List End -->
</div> </div>
Expand Down

0 comments on commit 28138ff

Please sign in to comment.