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

Updating list view #3

Merged
merged 1 commit into from Nov 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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'){
foreach($groups as $key=>$group){
if($key == 'all') continue;
echo '<h2 style="clear:left">'.$programTabIDs[$key].'</h2>';
echo '<h2 class="sorting-header">'.$programTabIDs[$key].'</h2>';
display($group);
}
}
else{
echo '<h2 style="clear:left">'.$programTabIDs[$_GET['category']].'</h2>';
echo '<h2 class="sorting-header">'.$programTabIDs[$_GET['category']].'</h2>';
display($posts);
}
?>
Expand All @@ -592,6 +592,10 @@ if(($search_results && $search_results->RECORDCOUNT > 0)){
<!-- Grid End -->
<!-- List Start -->
<div class="tab-pane" id="tab2">
<?php if(!empty($posts)):
function displayList($posts = array()){
global $programs;
?>
<ol class="program-list-view" >
<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">
Expand All @@ -611,42 +615,55 @@ if(($search_results && $search_results->RECORDCOUNT > 0)){
</li>
</ul>
</li>
<?php if(!empty($posts)): foreach($posts as $post): setup_postdata($post); ?>
<?php $tags = get_the_tags();
$search = array(" ", "/");
$replace = array("", "-");
$terraid = get_post_meta( get_the_ID(), 'apply-link', true );
$terraid = explode('Program_ID=',$terraid);
$terraid = explode('&',$terraid[1]);
$terraid = $terraid[0];?>
<li class="program-list <?php if($tags){ foreach($tags as $tag){echo ' '.strtolower(str_replace($search, $replace, $tag->name));} } ?>">
<ul id="badge-list">
<a href="<?php the_permalink() ?>">
<li class="list-img">
<?php the_post_thumbnail('thumbnail');?>
</li>
<li class="list-title">
<?php the_title(); ?>
</li>
<li class="list-city">
<?php echo $programs[$terraid]->PROGRAM_CITY;//$key="program-city"; echo get_post_meta($post->ID, $key, true); ?>
</li>
<li class="list-country">
<?php echo $programs[$terraid]->PROGRAM_COUNTRY;//$key="program-country"; echo get_post_meta($post->ID, $key, true); ?>
</li>
<li class="list-region">
<?php echo $programs[$terraid]->PROGRAM_REGION;//$key="program-region"; echo get_post_meta($post->ID, $key, true); ?>
</li>
</a>
</ul>
</li>
<?php endforeach?>
<?php
foreach($posts as $post){ ?>
<?php $tags = get_the_tags($post->ID);
$search = array(" ", "/");
$replace = array("", "-");
$terraid = get_post_meta( $post->ID, 'apply-link', true );
$terraid = explode('Program_ID=',$terraid);
$terraid = explode('&',$terraid[1]);
$terraid = $terraid[0];?>
<li class="program-list <?php if($tags){ foreach($tags as $tag){echo ' '.strtolower(str_replace($search, $replace, $tag->name));} } ?>">
<ul id="badge-list">
<a href="<?php echo get_the_permalink($post->ID) ?>">
<li class="list-img">
<?php echo get_the_post_thumbnail($post->ID, 'thumbnail');?>
</li>
<li class="list-title">
<?php echo get_the_title($post->ID); ?>
</li>
<li class="list-city">
<?php echo $programs[$terraid]->PROGRAM_CITY;//$key="program-city"; echo get_post_meta($post->ID, $key, true); ?>
</li>
<li class="list-country">
<?php echo $programs[$terraid]->PROGRAM_COUNTRY;//$key="program-country"; echo get_post_meta($post->ID, $key, true); ?>
</li>
<li class="list-region">
<?php echo $programs[$terraid]->PROGRAM_REGION;//$key="program-region"; echo get_post_meta($post->ID, $key, true); ?>
</li>
</a>
</ul>
</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: ?>
<p>
<?php _e('Sorry, no exchange programs are listed.'); ?>
</p>
<?php endif; ?>
</ol>
</div>
<!-- List End -->
</div>
Expand Down