This repository has been archived by the owner on Jan 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
page_source.php
137 lines (122 loc) · 3.98 KB
/
page_source.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/*
Template Name: _source
*/
?>
<?php get_header(); global $user_ID, $wp_rewrite; ?>
<?php
if(isset($wp_query->query_vars['domain'])) {
$source = rawurlencode($wp_query->query_vars['domain']);
} else {
$source = '...';
}
?>
<div class="container">
<div class="row subpage-title">
<h1><?php _e('Pins from', 'pinc') ?> <a href="http://<?php echo $source; ?>" target="_blank"><?php echo $source; ?></a></h1>
</div>
</div>
<div class="container-fluid">
<div class="row">
<?php
$pnum = isset($_GET['pnum']) ? intval($_GET['pnum']) : 1;
$args = array(
'meta_query' => array(
'relation' => 'AND',
array(
'key' => '_Photo Source Domain',
'value' => $source
),
array(
'relation' => 'OR',
array(
'key' => '_Original Post ID',
'compare' => 'NOT EXISTS'
),
array(
'key' => '_Original Post ID',
'value' => 'deleted'
)
)
),
'paged' => $pnum
);
query_posts($args);
$maxpage = $wp_query->max_num_pages;
?>
<div id="ajax-loader-masonry" class="ajax-loader"></div>
<div id="masonry" class="row">
<?php $count_ad = 1; if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if (of_get_option('frontpage1_ad') == $count_ad && of_get_option('frontpage1_ad_code') != '' && ($pnum == 1 || of_get_option('infinitescroll') == 'disable')) { ?>
<div class="thumb thumb-ad-wrapper">
<div class="thumb-ad">
<?php eval('?>' . of_get_option('frontpage1_ad_code')); ?>
</div>
</div>
<?php } ?>
<?php if (of_get_option('frontpage2_ad') == $count_ad && of_get_option('frontpage2_ad_code') != '' && ($pnum == 1 || of_get_option('infinitescroll') == 'disable')) { ?>
<div class="thumb thumb-ad-wrapper">
<div class="thumb-ad">
<?php eval('?>' . of_get_option('frontpage2_ad_code')); ?>
</div>
</div>
<?php } ?>
<?php if (of_get_option('frontpage3_ad') == $count_ad && of_get_option('frontpage3_ad_code') != '' && ($pnum == 1 || of_get_option('infinitescroll') == 'disable')) { ?>
<div class="thumb thumb-ad-wrapper">
<div class="thumb-ad">
<?php eval('?>' . of_get_option('frontpage3_ad_code')); ?>
</div>
</div>
<?php } ?>
<?php if (of_get_option('frontpage4_ad') == $count_ad && of_get_option('frontpage4_ad_code') != '' && ($pnum == 1 || of_get_option('infinitescroll') == 'disable')) { ?>
<div class="thumb thumb-ad-wrapper">
<div class="thumb-ad">
<?php eval('?>' . of_get_option('frontpage4_ad_code')); ?>
</div>
</div>
<?php } ?>
<?php if (of_get_option('frontpage5_ad') == $count_ad && of_get_option('frontpage5_ad_code') != '' && ($pnum == 1 || of_get_option('infinitescroll') == 'disable')) { ?>
<div class="thumb thumb-ad-wrapper">
<div class="thumb-ad">
<?php eval('?>' . of_get_option('frontpage5_ad_code')); ?>
</div>
</div>
<?php } ?>
<?php
get_template_part('index-masonry-inc');
$count_ad++;
endwhile;
else :
?>
<div class="container">
<div class="row">
<div class="bigmsg">
<h2><?php _e('Nothing yet.', 'pinc'); ?></h2>
</div>
</div>
</div>
<?php
endif;
wp_reset_query();
?>
</div>
<?php if ($maxpage != 0) { ?>
<div id="navigation">
<ul class="pager">
<?php if ($pnum != 1 && $maxpage >= $pnum) { ?>
<li id="navigation-previous">
<a href="<?php $permalink = get_permalink(); if (substr($permalink,-1) == '/') { $permalink = substr($permalink,0,-1); } echo $permalink . '/' . $source . '?pnum=' . ($pnum-1); ?>"><?php _e('« Previous', 'pinc') ?></a>
</li>
<?php } ?>
<?php if ($maxpage != 1 && $maxpage != $pnum) { ?>
<li id="navigation-next">
<a href="<?php $permalink = get_permalink(); if (substr($permalink,-1) == '/') { $permalink = substr($permalink,0,-1); } echo $permalink . '/' . $source . '?pnum=' . ($pnum+1); ?>"><?php _e('Next »', 'pinc') ?></a>
</li>
<?php } ?>
</ul>
</div>
<?php } ?>
</div>
</div>
<div class="modal" id="post-lightbox" tabindex="-1" aria-hidden="true" role="article"></div>
<?php get_footer(); ?>