-
Notifications
You must be signed in to change notification settings - Fork 1
/
single-articles.bak.php
415 lines (354 loc) · 21.9 KB
/
single-articles.bak.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
<?php
if(isset($_GET['galley']) && $_GET['galley'] == 'print') {
get_template_part( 'article', 'print' );
return;
}
elseif(isset($_GET['galley']) && $_GET['galley'] == 'index') {
get_template_part( 'article', 'index' );
return;
}
elseif(isset($_GET['galley']) && $_GET['galley'] == 'citations') {
get_template_part( 'article', 'citations' );
return;
}
elseif(isset($_GET['galley']) && $_GET['galley'] == 'references') {
get_template_part( 'article', 'find-references' );
return;
}
elseif(isset($_GET['galley']) && $_GET['galley'] == 'mail') {
get_template_part( 'article', 'mail' );
return;
}
?>
<?php get_header(); ?>
<div class="row dp-flex">
<div class="col-md-9 blocks margin-lr-10">
<div class="col-md-12">
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
$issue_id = get_post_meta(get_the_ID(),'issue_post_id',true);
$volume = get_post_meta($issue_id,'volume',true);
?>
<div id="main">
<div id="content">
<div class="addthis_container">
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<div class="addthis_inline_share_toolbox"></div>
</div>
<?php
if(isset($_GET['galley']) && $_GET['galley'] == 'pdf') {
$pdf_file = get_post_meta(get_the_ID(),'pdf_file',true);
if( $pdf_file ) {
?>
<div id="pdfDownloadLinkContainer">
<a class="action pdf" id="pdfDownloadLink" target="_parent" onclick="ga('send', 'event','pdf', 'downloads', 'pdf downloads', 0,{'nonInteraction': 1})" href="<?php echo $pdf_file; ?>">Download this PDF file</a>
</div>
<div>
<p><?php if(get_field('doi')){ ?>
DOI: <a href="<?php the_field('doi_link'); ?>" class="doi"><?php the_field('doi'); ?></a>
<?php } else { ?>
<?php } ?>
</p>
</div>
<div class="hidden-xs hidden-sm">
<div id="pdf-wrap"></div>
<script>PDFObject.embed('<?php echo $pdf_file; ?>', "#pdf-wrap");</script>
</div>
<?php
$authors = get_post_meta(get_the_ID(), 'authors', true);
?>
<div class="separator"><br></div>
<div class="visible-xs visible-sm">
<iframe id="pdfviewer" src="https://docs.google.com/gview?embedded=true&url=<?php echo $pdf_file; ?>&embedded=true"
frameborder="0" width="100%" height="400px"></iframe>
</div>
<?php if( get_the_ID() == '2176' || get_the_ID() == '16745' || get_the_ID() == '17727' ){
}else{ ?>
<div class="author-section-bottom">
<div class="blockTitle"> About the Authors </div>
<?php
$authors = get_post_meta(get_the_ID(), 'authors', true);
$out = array();
foreach($authors as $key=>$author) { ?>
<div id="authorBio">
<div>
<p><em><?php echo $author['first_name'].' '.$author['middle_name'].' '.$author['last_name'] ?></em>
<?php if(array_key_exists("email",$author)){?>
<a href="mailto:<?php echo $author['email']; ?>">
(<?php echo $author['email']; ?>)</a></p>
<?php }else echo ""; ?>
<p><?php echo $author['biography']; ?></p>
<p><?php echo $author['affiliation']; ?></p>
</div>
</div>
<div class="separator"></div>
<?php } ?>
<?php if(get_field('manuscript_editor')){ ?>
<p style="color:#595959"><b>Manuscript Editor: </b> <?php the_field('manuscript_editor'); ?> </p>
<?php } ?>
<?php
// Peer section for pdf
$peers = get_post_meta(get_the_ID(), 'peers', true);
?>
<?php if(!empty($peers[0]['name'])) { ?>
<p style="color:#595959"><b>Peer Reviewers: </b> <em>
<?php foreach ($peers as $key => $peer) { ?>
<?php echo $peer['name'] . ', '; ?>
<?php }?>
</em></p>
<?php }?>
</div>
<div>
<p>If you are an Indian national, you may support us by making donation. If you are a foreign national
you can buy subscription of the print edition of the journal for yourself as well as gift subscriptions to others.
All (Indians as well as foreigners) who can afford to are also requested to use our Pay What You Want system as an author you are submitting your manuscript for publication (pay a processing fee) or as a reader when you are accessing the full text or pdf of an article (pay an access fee).</p>
</div>
<?php } ?>
<?php
}
}
elseif(isset($_GET['galley']) && $_GET['galley'] == 'html') {
if(get_the_ID()>=17690){
?>
<div id="articleTitle"><h3><?php echo get_the_title(); ?></h3></div>
<div id="authorString">
<em>
<?php
$authors = get_post_meta(get_the_ID(), 'authors', true);
$out = array();
if(!empty($authors)){
foreach($authors as $key=>$author) {
$authStr=$author['first_name'].' '.$author['middle_name'].' '.$author['last_name'];
//if($author['primary_contact']) {
array_push($out, $authStr);
}
echo implode(', ', $out);
}
?>
</em>
<p>
<span class="article_publish_date pull-left">Published On : <?php echo get_the_date('d-m-Y') ?></span>
<?php if (get_field('doi')) { ?>
<span class="pull-right"> DOI: <a href="<?php the_field('doi_link'); ?>"
class="doi"><?php the_field('doi'); ?></a></span>
<?php } else { ?>
<?php } ?>
</p>
</div>
<div class="clearfix"></div>
<div class="article_count_container">
<div class="article-count-wrapper">
Article Views:
<div class="lds-ellipsis" id="place-holder"><p id="article_count"></p>
<div></div>
</div>
,PDF Downloads:
<div class="lds-ellipsis" id="pdf-place-holder"><p id="pdfDownloadCount"></p>
<div></div>
</div>
</div>
</div>
<?php }
else{
}?>
<script>
jQuery(document).ready(function($){$(".section").first().prepend($(".about-author-content").html());});
</script>
<div class="about-author-content" style="display: none;">
<div class="block" id="articleToolsInContent" style="float: right; border-bottom: 0; border: 1px solid #ddd;">
<h4 class="blockTitle">Article Tools</h4>
<?php if( get_post_meta(get_the_ID(),'pdf_file',true) ) { ?>
<div class="articleToolItem">
<img src="<?php echo THEME_URL; ?>/images/abstract.png" class="articleToolIcon">
<a href="<?php echo add_query_arg( 'galley', 'pdf', get_permalink(get_the_ID()) ); ?>" class="file" target="_parent">PDF</a><br>
</div>
<?php } ?>
<script>
jQuery(document).ready(function($) {
$('a.new-window').click(function() {
window.open($(this).attr('href'),'title', 'width=700, height=400');
return false;
});
$.get("ijmewp/ArticleCountAPI/article_count_api.php", function (data) {
$(".result").html(data);
})
});
</script>
<div class="articleToolItem">
<img src="<?php echo THEME_URL; ?>/images/printArticle.png" class="articleToolIcon"> <a href="<?php echo add_query_arg( 'galley', 'print', get_permalink(get_the_ID()) ); ?>">Print this article</a>
</div>
<div class="articleToolItem">
<img src="<?php echo THEME_URL; ?>/images/metadata.png" class="articleToolIcon"> <a href="#" onclick="window.open('<?php echo add_query_arg( 'galley', 'index', get_permalink(get_the_ID()) ); ?>','_blank')">Indexing metadata</a><br>
</div>
<div class="articleToolItem">
<img src="<?php echo THEME_URL; ?>/images/citeArticle.png" class="articleToolIcon"> <a href="<?php echo add_query_arg( 'galley', 'citations', get_permalink(get_the_ID()) ); ?>" target="_blank" >How to cite item</a><br>
</div>
<div class="articleToolItem">
<img src="<?php echo THEME_URL; ?>/images/findingReferences.png" class="articleToolIcon"> <a href="<?php echo add_query_arg( 'galley', 'references', get_permalink(get_the_ID()) ); ?>" target="_blank" >Finding References</a>
</div>
<div class="articleToolItem">
<img src="<?php echo THEME_URL; ?>/images/emailArticle.png" class="articleToolIcon"> <a href="<?php echo add_query_arg( 'galley', 'mail', get_permalink(get_the_ID()) ).'&to=author'; ?>" target="_blank">Email the author</a>
</div>
<div class="articleToolItem">
<img src="<?php echo THEME_URL; ?>/images/postComment.png" class="articleToolIcon">
<a href="#comments">Post a Comment</a>
</div>
</div>
</div>
<div class="singleContentArticle"><?php the_content(); ?></div>
<?php
$authors = get_post_meta(get_the_ID(), 'authors', true);
if(empty($authors)){
echo '<div class="author-section-bottom">';
echo '<div class="blockTitle"> </div>';
}else{
?>
<div class="author-section-bottom">
<div class="blockTitle"> About the Authors </div>
<?php }
$authors = get_post_meta(get_the_ID(), 'authors', true);
$out = array();
if(!empty($authors)){
foreach($authors as $key=>$author) { ?>
<div id="authorBio">
<div>
<p><em><?php echo $author['first_name'].' '.$author['middle_name'].' '.$author['last_name'] ?></em>
<?php if(array_key_exists("email",$author)){?>
<a href="mailto:<?php echo $author['email']; ?>">
(<?php echo $author['email']; ?>)</a></p>
<?php }else echo ""; ?>
<p><?php echo $author['biography']; ?></p>
<p><?php echo $author['affiliation']; ?></p>
</div>
</div>
<div class="separator"></div>
<?php }} ?>
<?php if(get_field('manuscript_editor')){ ?>
<p style="color:#595959"><b>Manuscript Editor: </b> <?php the_field('manuscript_editor'); ?> </p>
<?php } ?>
<?php
$peers = get_post_meta(get_the_ID(), 'peers', true);
?>
<?php if(!empty($peers[0]['name'])) { ?>
<p style="color:#595959"><b>Peer Reviewers: </b> <em>
<?php foreach ($peers as $key => $peer) { ?>
<?php echo $peer['name'] . ', '; ?>
<?php }?>
</em></p>
<?php }?>
</div>
<div>
<p><em>If you are an Indian national, you may support us by making donation. If you are a foreign national
you can buy subscription of the print edition of the journal for yourself as well as gift subscriptions to others.
All (Indians as well as foreigners) who can afford to are also requested to use our Pay What You Want system as an author you are submitting your manuscript for publication (pay a processing fee) or as a reader when you are accessing the full text or pdf of an article (pay an access fee).</em></p>
</div>
<!-- Peer section ----2 ------>
<?php }
else {
?>
<div id="articleTitle"><h3><?php echo get_the_title(); ?></h3></div>
<div id="authorString">
<em>
<?php
$authors = get_post_meta(get_the_ID(), 'authors', true);
$out = array();
if(!empty($authors)){
foreach($authors as $key=>$author) {
$authStr=$author['first_name'].' '.$author['middle_name'].' '.$author['last_name'];
//if($author['primary_contact']) {
array_push($out, $authStr);
}
echo implode(', ', $out);
}
?>
</em>
<p>
<span class="article_publish_date pull-left">Published On : <?php echo get_the_date('d-m-Y') ?></span>
<?php if (get_field('doi')) { ?>
<span class="pull-right"> DOI: <a href="<?php the_field('doi_link'); ?>"
class="doi"><?php the_field('doi'); ?></a></span>
<?php } else { ?>
<?php } ?>
</p>
</div>
<div class="clearfix"></div>
<div class="article_count_container">
<div class="article-count-wrapper">
Article Views:
<div class="lds-ellipsis" id="place-holder"><p id="article_count"></p>
<div></div>
</div>
,PDF Downloads:
<div class="lds-ellipsis" id="pdf-place-holder"><p id="pdfDownloadCount"></p>
<div></div>
</div>
</div>
</div>
<br/>
<?php if( get_the_ID() == '16706' && !is_front_page() ){ ?>
<div id="articleAbstract1" style = "padding: 30px 0 0px !important;">
<?php }else{ ?>
<div id="articleAbstract">
<h4>Abstract</h4>
<?php } ?>
<div><?php the_excerpt(); ?></div>
</div>
<?php if( get_the_ID() != '16706' && !is_front_page()){ ?>
<div id="articleFullText">
<h4>Full Text</h4>
<?php
$pdfUrl = add_query_arg( 'galley', 'pdf', get_permalink(get_the_ID()) );
$htmlUrl = add_query_arg( 'galley', 'html', get_permalink(get_the_ID()) );
?>
<a class="file" onclick="showSupportModal('<?php echo $htmlUrl ?>')" href="#">HTML</a>
<?php if(!empty($pdfUrl)) { ?>
<a class="file" onclick="showSupportModal('<?php echo $pdfUrl?>')" href="#">PDF</a>
<?php } ?>
</div>
<?php
if(get_ojs_article_ID(get_the_ID()) > 0 ){; ?>
<div id="articleHistory">
<h4>Article History</h4>
<p class="articleHistory-item">Date Submitted:<?php echo get_submission_date(get_ojs_article_ID(get_the_ID()));?></p>
<p class="articleHistory-item">Date Published: <?php echo get_published_date(get_ojs_article_ID(get_the_ID()));?></p>
</div>
<?php } }?>
<?php
}
?>
<?php if(get_post_type() == 'page') the_content(); ?>
</div><!--content-->
</div><!--main-->
<div class="clearfix"></div>
<?php
comments_template();
} // end while
} // end if
?>
</div>
<div class="col-md-3 article-count-container">
<script>
jQuery(document).ready(function($) {
let post_slug = "<?php echo $slug = get_post_field( 'post_name', get_post() ); ?>";
url = "/ArticleCountAPI/article_count_api.php?article_name="+post_slug;
$.get(url,function (data) {
$(".result").html(data);
document.getElementById('place-holder').classList.remove('lds-ellipsis') ;
document.getElementById('article_count').innerText = JSON.parse(data).pageView;
document.getElementById('pdf-place-holder').classList.remove('lds-ellipsis') ;
document.getElementById('pdfDownloadCount').innerText = JSON.parse(data).pdfView;
})
});
</script>
<!-- Go to www.addthis.com/dashboard to customize your tools -->
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5d1b0148a07aaf99"></script>
</div>
</div>
<!-- <div class="clearfix visible-xs visible-sm"></div>-->
<div class="col-md-3 blocks margin-r-10">
<?php get_sidebar(); ?>
</div>
</div>
<?php get_footer(); ?>