Archive

Tasmaina Results and News Archive

 
$cell = 'class="cell small" style="padding: 5px 0px;'; $state = 15;

foreach ($mytags as $mytag) {

switch($mytag) {
case 'results':
$icon = 'results.png';
break;
case 'news':
$icon = 'info.png';
break;
}

$args = 'cat='.$state.'&tag='.$mytag; $filetype = 'pdf';
query_posts( $args );
while (have_posts()) : the_post();
$permalink = get_permalink($post->ID); $slug = basename($permalink);
$postTitle = get_the_title($post->post_title);
$modified = get_the_modified_date($post->ID);
$filename = “/cms/wp-content/$mytag/$slug.$filetype”;

if(file_exists( $_SERVER{‘DOCUMENT_ROOT’} . $filename)) {
$location = “location.href=’$filename’;”;
$icon2 = $filetype.’.png’;
}

if(!file_exists( $_SERVER{‘DOCUMENT_ROOT’} . $filename)) {
$location = “location.href=’$permalink’;”;
$icon2 = ‘page.png’;
}
$yyyymmdd = date(“Y-m-d”, strtotime($modified));
$records[$latest++] = $yyyymmdd.’|’.$location.’|’.$icon.’|’.$icon2.’|’.$cell.’|’.$postTitle; $latest++;
endwhile;
wp_reset_query();
}

arsort($records);
foreach($records as $record) {
$v = explode(‘|’, $record);
$dateformat =”%B %e, %Y”; /* http://php.net/manual/en/function.strftime.php */

echo ‘

 
 
‘.$v[5].’
‘.strftime($dateformat,strtotime($v[0])).’

‘;
} ?>