forked from retostauffer/wp-wetterturnier-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
117 lines (103 loc) · 4.36 KB
/
index.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme and one
* of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query,
* e.g., it puts together the home page when no home.php file exists.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
$divclass = "";
if ( is_home() ) {
#unregister_sidebar("sidebar-2");
$divclass = "home-content";
}
//error_reporting(E_ALL);
//ini_set("display_errors", 1);
get_header(); ?>
<div id="main-content" class="main-content <?php print $divclass; ?>">
<?php
if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
// Include the featured content template.
get_template_part( 'featured-content' );
}
?>
<div id="primary" class="content-area">
<div id="content" class="site-content index-content" role="main">
<?php
query_posts( array("posts_per_page" => 2) );
global $wp_query;
if ( have_posts() ) :
// Start the Loop.
///$first_post = false;
///while ( have_posts() ) : the_post();
/// if ( $first_post ) {
/// get_template_part( 'custom-news', get_post_format() );
/// $first_post = false;
/// if ( $wp_query->found_posts > 1 ) {
/// echo "<article class=\"hentry\">\n<ul id=\"custom-news-small\">\n";
/// }
/// } else {
/// get_template_part( 'custom-news-small', get_post_format() );
/// }
///endwhile;
echo "<article class=\"hentry\">";
printf("<h1 class=\"entry-title\">%s</h1>",__("Latest News","tfchild"));
echo "<ul id=\"custom-news-small\">\n";
while ( have_posts() ) : the_post();
get_template_part( 'custom-news-small', get_post_format() );
endwhile;
// Link to older news
$lang = (function_exists('pll_current_language') ? pll_current_language('slug') : 'en');
printf("<li class=\"show-older-news\"><a href=\"/news%s/\" target=\"_self\">%s</a></li>",
$lang,__("Show older news","tfchild"));
echo "</ul>\n</article>\n";
else :
// If no content, include the "No posts found" template.
get_template_part( 'content', 'none' );
endif;
// Latest forum replies
shapeSpace_show_posts();
?>
<article class="hentry">
<h1 class="entry-title"><?php _e("Leaderboard","wpwt"); ?></h1>
<?php
global $WTuser;
// Check if there are any valid rankings at the moment
$current = $WTuser->current_tournament;
$scored = $WTuser->scored_players_per_town( $current->tdate );
// No results for the current one? Well, take the one before!
if ( ! $scored ) {
$current = $WTuser->older_tournament( $current->tdate );
}
// Looping over the different cities
//$cities = $WTuser->get_city_data();
//foreach ( $cities as $city ) {
foreach ( $WTuser->get_all_cityObj() as $cityObj ) {
print do_shortcode(sprintf("[wetterturnier_ranking type=\"weekend\" city=%d "
."hidebuttons=true "
."limit=5 slim=false header=false tdate=%d]",
$cityObj->get("ID"),$current->tdate));
}
// City-ranking
///print do_shortcode(sprintf("[wetterturnier_ranking type=\"cities\" city=\"1:2:3\" limit=3 slim=false header=false tdate=%d]",
/// $current->tdate));
//////print do_shortcode(sprintf("[wetterturnier_ranking type=\"cities\" cities=\"1,2,3,4,5\" limit=3 slim=false header=false tdate=%d]",
////// $current->tdate));
?>
</article>
</div>
<div class="twocolumn-right">
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar("content"); ?>
</div><!-- #main-content -->
<?php
get_sidebar();
get_footer();