-
Notifications
You must be signed in to change notification settings - Fork 6
/
archive-download.php
70 lines (56 loc) · 2.52 KB
/
archive-download.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* The template for displaying download archive pages.
*
* @package Panda3D
*/
get_header();
?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php if (have_posts()) { ?>
<?php
$latest_download = wp_get_recent_posts(array(
'numberposts' => 1,
'post_type' => 'download',
'post_status' => 'publish'
))[0];
$latest_id = $latest_download['ID'];
$latest_version = get_field('version_number', $latest_id);
$latest_title = $latest_download['post_title'];
$latest_release_date = date_i18n(get_option('date_format'), strtotime($latest_download['post_date']));
$latest_category = get_the_terms($latest_id, 'download_category')[0];
?>
<?php include(locate_template('template-parts/downloads/download-header.php')); ?>
<div class="archive-download__content">
<?php include(locate_template('template-parts/downloads/download-list.php')); ?>
<?php if (!is_tax('download_category', 'runtime')) { ?>
<h1>Development Builds</h1>
<div class="block block--info">
<div class="block__icon">
<i class="fas fa-flask"></i>
</div>
<div class="block__content">
<p>If you wish to try out an in-development version of Panda3D, you can find preview builds of Panda3D at <a href="/download.php?version=devel">this link</a>. But be careful, these builds may be unstable!</p>
</div>
</div>
<?php } ?>
<?php if (!is_tax('download_category', 'runtime')) { ?>
<h1>Runtime</h1>
<div class="block block--info block--warning">
<div class="block__icon">
<i class="fas fa-minus-hexagon"></i>
</div>
<div class="block__content">
<p>The Panda3D Runtime, used to run .p3d files, is now deprecated. You can access archived versions at <a href="/download/runtime">this link</a>.</p>
</div>
</div>
<?php } ?>
</div>
<?php } else { ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php } ?>
</main>
</div>
<?php
get_footer();