-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharticle-find-references.php
executable file
·97 lines (83 loc) · 4.31 KB
/
article-find-references.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
<?php
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
get_header('common');
?>
<div id="content">
<script type="text/javascript">
function invokeGoogleScholar() {
var googleScholarForm = document.getElementById('googleScholar');
googleScholarForm.as_q.value = document.getElementById('inputForm').title.value;
googleScholarForm.as_sauthors.value = document.getElementById('inputForm').author.value;
googleScholarForm.submit();
}
function invokeWLA() {
var wlaForm = document.getElementById('wla');
wlaForm.q.value = document.getElementById('inputForm').title.value + " " + document.getElementById('inputForm').author.value;
wlaForm.submit();
}
</script>
<h3><?php echo get_the_title(); ?></h3>
<!-- Include the real forms for each of the search engines -->
<form id="googleScholar" method="get" action="http://scholar.google.com/scholar">
<input type="hidden" name="as_q" value="" />
<input type="hidden" name="as_sauthors" value="" />
<input type="hidden" name="btnG" value="Search Scholar" />
<input type="hidden" name="as_occt" value="any" />
<input type="hidden" name="as_allsubj" value="all" />
</form>
<form id="wla" method="get" action="http://search.live.com/results.aspx">
<input type="hidden" name="q" value="" />
<input type="hidden" name="scope" value="academic" />
</form>
<form id="inputForm" target="#">
<!-- Display the form fields -->
<table width="100%" class="data">
<tr valign="top">
<td class="label" width="20%"><label for="author">Author</label></td>
<?php
$authors = get_post_meta(get_the_ID(), 'authors', true);
$authors_array = array();
if(!empty($authors)){
foreach($authors as $author) $authors_array[] = $author['last_name'].' '.$author['first_name'];
?>
<td class="value" width="80%"><input name="author" id="author" type="text" size="20" maxlength="40" class="textField" value="<?php echo implode(',', $authors_array) ?>" /></td>
<?php }else{ ?>
<td class="value" width="80%"><input name="author" id="author" type="text" size="20" maxlength="40" class="textField" value=" " /></td>
<?php } ?>
</tr>
<tr valign="top">
<td class="label"><label for="title">Title</label></td>
<td class="value"><input type="text" id="title" name="title" size="40" maxlength="40" class="textField" value="<?php echo get_the_title(); ?>" /></td>
</tr>
</table>
<!-- Display the search engine options -->
<table class="listing" width="100%">
<tr valign="top">
<td width="10%"><input value="Search" type="button" onclick="invokeGoogleScholar()" class="button" /></td>
<td width="2%">1.</td>
<td width="88%">Google Scholar</td>
</tr>
<tr valign="top">
<td><input value="Search" type="button" onclick="invokeWLA()" class="button" /></td>
<td>2.</td>
<td>Windows Live Academic</td>
</tr>
</table>
</form>
</div>
</div>
<?php
}
}
else {
?>
Unknown article
<?php
}
?>
<div class="separator"></div>
<input type="button" onclick="window.close()" value="Close" class="button defaultButton">
<div class="separator"></div>
<?php get_footer('common'); ?>