1
1
<?php
2
2
get_header ();
3
3
get_post ();
4
+ global $ _set ;
5
+ $ settings = $ _set ->settings ;
6
+ $ section_title = (!empty ($ settings ['chapters_title ' ])) ? $ settings ['chapters_title ' ] : 'Chapters ' ;
4
7
?>
5
8
<section class="main-content space-top">
6
9
<div class="grid-container">
7
- <div class="grid-x grid-padding-x">
10
+ <div class="grid-x grid-padding-x align-center ">
8
11
<div class="cell large-12">
9
- <div class="entry-header">
10
- <h1 class="entry-title">Chapters</h1>
12
+ <div class="grid-x align-center">
13
+ <div class="large-10 cell">
14
+ <div class="entry-header">
15
+ <h1 class="entry-title"><?php echo $ section_title ?> </h1>
16
+ </div>
17
+ <section class="entry-content">
18
+ <div class="post-content">
19
+ <?php echo apply_filters ('the_content ' , $ settings ['chapters_content ' ]); ?>
20
+ </div>
21
+ </section>
22
+ </div>
11
23
</div>
24
+
12
25
<div class="view-switch">
13
26
<div class="grid-x align-justify">
14
27
<div class="cell large-3 title">
23
36
<div class="world-map view-content active" id="view-map">
24
37
<?php get_template_part ('template-parts/maps/world ' ,'map ' ); ?>
25
38
<div id="world-map-info">
26
- <h2 class="chapter-title">CC titirilquen </h2>
27
- <p class="chapter-line">Founded on <span class="chapter-date">29 May, 2018 </span> </p>
28
- <p class="chapter-lead">Chapter Lead: <span class="chapter-lead-name">Juan Carlos bodoque </span></p>
39
+ <h2 class="chapter-title"></h2>
40
+ <p class="chapter-line">Founded on <span class="chapter-date"></span> </p>
41
+ <p class="chapter-lead">Chapter Lead: <span class="chapter-lead-name"></span></p>
29
42
<p class="chapter-buttons">
30
43
<a href="#" class="button warning contact">Contact</a>
31
44
<a href="#" class="button warning url">Web</a>
50
63
$ chapters = Commoners::get_chapters ();
51
64
if (!empty ($ chapters )) {
52
65
foreach ($ chapters as $ chapter ) {
66
+ $ chapter_url = (!empty ($ chapter ->cc_chapters_url )) ? '<a href=" ' . filter_var ($ chapter ->cc_chapters_url , FILTER_VALIDATE_URL ) .'" target="_blank" class="button secondary tiny">View</a> ' : 'No url ' ;
53
67
echo '<tr> ' ;
54
68
echo '<td> ' .$ chapter ->post_title .'</td> ' ;
55
69
echo '<td> ' . $ chapter ->cc_chapters_date . '</td> ' ;
56
70
echo '<td> ' . $ chapter ->cc_chapters_email . '</td> ' ;
57
71
echo '<td> ' . get_user_by ('id ' , $ chapter ->cc_chapters_chapter_lead )->display_name . '</td> ' ;
58
72
echo '<td> ' . get_user_by ('id ' , $ chapter ->cc_chapters_member_gnc )->display_name . '</td> ' ;
59
- echo '<td> ' . $ chapter -> cc_chapters_url . '</td> ' ;
73
+ echo '<td> ' . $ chapter_url . '</td> ' ;
60
74
echo '</tr> ' ;
61
75
}
62
76
}
66
80
</div>
67
81
</div>
68
82
</div>
83
+ <div class="grid-x grid-padding-x align-center">
84
+ <div class="cell large-10">
85
+ <div class="chapter-stats">
86
+ <?php $ global_stats = Commoners::stats (); ?>
87
+ <div class="grid-x grid-margin-x large-up-3 medium-up-3 small-up-3">
88
+ <?php if (!empty ($ global_stats ['total_members ' ])) : ?>
89
+ <div class="cell">
90
+ <article class="stat-box">
91
+ <span class="stat-number"><?php echo $ global_stats ['total_members ' ]; ?> </span>
92
+ <span class="title">Users</span>
93
+ </article>
94
+ </div>
95
+ <?php endif ; ?>
96
+ <?php if (!empty ($ global_stats ['active_chapters ' ])) : ?>
97
+ <div class="cell">
98
+ <article class="stat-box">
99
+ <span class="stat-number"><?php echo $ global_stats ['active_chapters ' ]; ?> </span>
100
+ <span class="title">Chapters</span>
101
+ </article>
102
+ </div>
103
+ <?php endif ; ?>
104
+ <?php if (!empty ($ global_stats ['in-progress_chapters ' ])) : ?>
105
+ <div class="cell">
106
+ <article class="stat-box with-subtitle">
107
+ <span class="stat-number"><?php echo $ global_stats ['in-progress_chapters ' ]; ?> </span>
108
+ <span class="subtitle">In-progress</span>
109
+ <span class="title">Chapters</span>
110
+ </article>
111
+ </div>
112
+ <?php endif ; ?>
113
+ </div>
114
+ </div>
115
+ </div>
116
+ </div>
69
117
</div>
70
118
</section>
71
119
<?php get_footer (); ?>
0 commit comments