forked from nextcloud/nextcloud.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-news.php
88 lines (77 loc) · 3.34 KB
/
page-news.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
<?php
require(dirname(__FILE__).'/../../../contribook/main/contribook/lib_contribook.php');
?>
<div class="row page-content-header">
<div class="col-sm-7">
<h1>Nextcloud Planet</h1>
<a href="/blogfeed" class="rss-button"><img style="vertical-align: top;" width=35 class="img-circle" src="<?php echo get_template_directory_uri(); ?>/assets/img/social/rss.png"></img></a>
<p>Welcome to Nextcloud News, our contributor blog roll. Nextcloud contributors should <a href="mailto:[email protected]">ask to get added</a>!</p>
<p>Opinions are the responsibility of those who express them. See our <a href="/privacy">privacy policy</a>.</p>
<p>If you'd like to stay up to date with Nextcloud news you could also <a href="https://newsletter.nextcloud.com/?p=subscribe&id=1">subscribe to our newsletter</a>! A RSS feed with only release updates can be <a href="https://github.com/nextcloud/server/releases.atom">found here <i class="icon-rss icon"></i></a></p>
</div>
</div>
<div class="row">
<div class="col-sm-7">
<div class="page-content">
<?php
$url=explode('/',$_SERVER['REQUEST_URI']);
if(isset($url[2])) $page= (int) $url[2]; else $page=1;
if($page<1) $page=1;
echo('<div id="container" class="transitions-enabled infinite-scroll clearfix">');
CONTRIBOOK_BLOG::show(($page-1)*5,5);
echo('</div>');
// If not on ssl, show the page link
$ssl = is_ssl() ? '' : 'style="display: block !important; margin-bottom: 60px;"';
echo('
<nav id="page-nav" '.$ssl.'>
<a href="/news/'.($page+1).'" style="float: right">Next Page</a>
</nav>
');
?>
<script>
$(function(){
var $container = $('#container');
$container.imagesLoaded(function(){
$container.masonry({
itemSelector: '.box',
columnWidth: 100
});
});
$container.infinitescroll({
navSelector : '#page-nav', // selector for the paged navigation
nextSelector : '#page-nav a', // selector for the NEXT link (to page 2)
itemSelector : '.box', // selector for all items you'll retrieve
loading: {
finishedMsg: 'No more pages to load.',
img: '<?php echo get_template_directory_uri(); ?>/assets/img/common/loading.gif'
}
},
// trigger Masonry as a callback
function( newElements ) {
// hide new items while they are loading
var $newElems = $( newElements ).css({ opacity: 0 });
// ensure that images load before adding to masonry layout
$newElems.imagesLoaded(function(){
// show elems now they're ready
$newElems.animate({ opacity: 1 });
$container.masonry( 'appended', $newElems, true );
});
}
);
});
</script>
</div>
</div>
<div class="sidebar col-sm-4 col-sm-offset-1">
<?php
echo('<h2><i class="icon-twitter"></i> The latest twitter posts</h2>');
CONTRIBOOK_MICROBLOG::show(0,10);
echo('</td><td valign="top">');
echo('<h2><i class="icon-comment"></i> The latest from the forum</h2>');
CONTRIBOOK_FORUM::show(0,10);
echo('<h2><i class="icon-cloud"></i> Nextcloud News</h2>');
CONTRIBOOK_NEWS::show(0,10);
?>
</div>
</div>
</div>