forked from arsava/dokuwiki-template-vector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinc_cite.php
180 lines (162 loc) · 7.39 KB
/
inc_cite.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
<?php
/**
* Content for the citation page
*
* This file will be imported by the "main.php".
*
*
* LICENSE: This file is open source software (OSS) and may be copied under
* certain conditions. See COPYING file for details or try to contact
* the author(s) of this file in doubt.
*
* @license GPLv2 (http://www.gnu.org/licenses/gpl2.html)
* @author ARSAVA <[email protected]>
* @link https://www.dokuwiki.org/template:vector
* @link https://www.dokuwiki.org/devel:templates
*/
//check if we are running within the DokuWiki environment
if (!defined("DOKU_INC")){
die();
}
//detect rev
$rev = (int)$INFO["rev"];
if ($rev < 1){
$rev = (int)$INFO["lastmod"];
}
//set permanent URL
$permurl = DOKU_URL.DOKU_SCRIPT."?id=".getID()."&rev=".$rev; //no wl() here to get absolute URLs working without URL rewriting and stuff
?>
<h1><a name="bibliographic_details" id="bibliographic_details"><?php echo hsc($lang["vector_cite_bibdetailsfor"]); ?> "<?php tpl_pagetitle(); ?>"</a></h1>
<div class="level2">
<ul>
<li class="level1">
<div class="li"><?php echo hsc($lang["vector_cite_pagename"]); ?>: <?php tpl_pagetitle(); ?></div>
</li>
<li class="level1">
<div class="li"><?php echo hsc($lang["vector_cite_author"]); ?>: <?php echo tpl_getConf("vector_cite_author"); ?></div>
</li>
<li class="level1">
<div class="li"><?php echo hsc($lang["vector_cite_publisher"]); ?>: <?php echo hsc($conf["title"]); ?>.</div>
</li>
<li class="level1">
<div class="li"><?php echo hsc($lang["vector_cite_dateofrev"]); ?>: <?php echo gmdate("j F Y H:i T", $rev); ?></div>
</li>
<li class="level1">
<div class="li"><?php echo hsc($lang["vector_cite_dateretrieved"]); ?>: <?php echo gmdate("j F Y H:i T"); ?></div>
</li>
<li class="level1">
<div class="li"><?php echo hsc($lang["vector_cite_permurl"]); ?>: <a rel="nofollow" href="<?php echo hsc($permurl); ?>"><?php echo hsc($permurl); ?></a></div>
</li>
<li class="level1">
<div class="li"><?php echo hsc($lang["vector_cite_pageversionid"]); ?>: <?php echo hsc($rev); ?></div>
</li>
</ul>
<p>
<?php echo hsc($lang["vector_cite_checkstandards"]); ?>
</p>
</div>
<h2><a name="citation_styles_for" id="citation_styles_for"><?php echo hsc($lang["vector_cite_citationstyles"]); ?> "<?php tpl_pagetitle(); ?>"</a></h2>
<h3><a name="apa_style" id="apa_style">APA</a></h3>
<div class="level3">
<p>
<?php tpl_pagetitle(); ?>. (<?php echo gmdate("Y, M j", $rev); ?>).
<?php echo hsc($lang["vector_cite_in"]); ?> <em><?php echo hsc($conf["title"]); ?></em>.
<?php echo hsc($lang["vector_cite_retrieved"])." ".gmdate("H:i, F j, Y,")." ".hsc($lang["vector_cite_from"]); ?>
<a rel="nofollow" href="<?php echo hsc($permurl); ?>"><?php echo hsc($permurl); ?></a>.
</p>
</div>
<h3><a name="mla_style" id="mla_style">MLA</a></h3>
<div class="level3">
<p>
<?php echo tpl_getConf("vector_cite_author"); ?>.
"<?php tpl_pagetitle(); ?>".
<em><?php echo hsc($conf["title"]); ?></em>.
<?php echo gmdate("j M. Y", $rev); ?>. Web. <?php echo gmdate("j M. Y, H:i"); ?>
</p>
</div>
<h3><a name="mhra_style" id="mhra_style">MHRA</a></h3>
<div class="level3">
<p>
<?php echo tpl_getConf("vector_cite_author"); ?>,
'<?php tpl_pagetitle(); ?>',
<em><?php echo hsc($conf["title"]); ?></em>,
<?php echo gmdate("j F Y, H:i T", $rev); ?>,
<<a rel="nofollow" href="<?php echo hsc($permurl); ?>"><?php echo hsc($permurl); ?></a>> [<?php echo hsc($lang["vector_cite_accessed"])." ".gmdate("j F Y"); ?>]
</p>
</div>
<h3><a name="chicago_style" id="chicago_style">Chicago</a></h3>
<div class="level3">
<p>
<?php echo tpl_getConf("vector_cite_author"); ?>,
"<?php tpl_pagetitle(); ?>",
<em><?php echo hsc($conf["title"]); ?></em>,
<a rel="nofollow" href="<?php echo hsc($permurl); ?>"><?php echo hsc($permurl); ?></a> (<?php echo hsc($lang["vector_cite_accessed"])." ".gmdate("F j, Y"); ?>).
</p>
</div>
<h3><a name="cbe_cse_style" id="cbe_cse_style">CBE/CSE</a></h3>
<div class="level3">
<p>
<?php echo tpl_getConf("vector_cite_author"); ?>.
<?php tpl_pagetitle(); ?> [Internet].
<?php echo hsc($conf["title"])?>; <?php echo gmdate("Y M j, H:i T", $rev); ?> [<?php echo hsc($lang["vector_cite_cited"])." ".gmdate("Y M j"); ?>].
<?php echo hsc($lang["vector_cite_availableat"]); ?>: <a rel="nofollow" href="<?php echo hsc($permurl); ?>"><?php echo hsc($permurl); ?></a>.
</p>
</div>
<h3><a name="bluebook_style" id="bluebook_style">Bluebook</a></h3>
<div class="level3">
<p>
<?php tpl_pagetitle(); ?>,
<a rel="nofollow" href="<?php echo hsc($permurl); ?>"><?php echo hsc($permurl); ?></a> (<?php echo hsc($lang["vector_cite_lastvisited"])." ".gmdate("F j, Y"); ?>).
</p>
</div>
<h3><a name="ama_style" id="ama_style">AMA</a></h3>
<div class="level3">
<p>
<?php echo tpl_getConf("vector_cite_author"); ?>.
<?php tpl_pagetitle(); ?>.
<?php echo hsc($conf["title"])?>.
<?php echo gmdate("F j, Y, H:i T", $rev); ?>.
<?php echo hsc($lang["vector_cite_availableat"]); ?>: <a rel="nofollow" href="<?php echo hsc($permurl); ?>"><?php echo hsc($permurl); ?></a>.
<?php echo hsc($lang["vector_cite_accessed"])." ".gmdate("F j, Y"); ?>.
</p>
</div>
<h3><a name="bibtex_entry" id="bibtex_entry">BibTeX</a></h3>
<div class="level3">
<pre>
@misc{ wiki:xxx,
author = "<?php echo str_replace(",", "{,}", tpl_getConf("vector_cite_author")); ?>",
title = "<?php str_replace(",", "{,}", tpl_pagetitle()); ?> --- <?php echo str_replace(",", "{,}", hsc($conf["title"])); ?>",
year = "<?php echo gmdate("Y", $rev); ?>",
url = "<?php echo str_replace(",", "{,}", hsc($permurl)); ?>",
note = "[Online; accessed <?php echo gmdate("j-F-Y"); ?>]"
}
</pre>
<p>
<?php echo hsc($lang["vector_cite_latexusepackagehint"]); ?>:
</p>
<pre>
@misc{ wiki:xxx,
author = "<?php echo str_replace(",", "{,}", tpl_getConf("vector_cite_author")); ?>",
title = "<?php str_replace(",", "{,}", tpl_pagetitle()); ?> --- <?php echo str_replace(",", "{,}", hsc($conf["title"])); ?>",
year = "<?php echo gmdate("Y", $rev); ?>",
url = "\url{<?php echo str_replace(",", "{,}", hsc($permurl)); ?>}",
note = "[Online; accessed <?php echo gmdate("j-F-Y"); ?>]"
author = "<?php echo tpl_getConf("vector_cite_author"); ?>",
title = "<?php tpl_pagetitle(); ?> --- <?php echo hsc($conf["title"]); ?>",
year = "<?php echo gmdate("Y", $rev); ?>",
url = "\url{<?php echo hsc($permurl); ?>}",
note = "[Online; accessed <?php echo gmdate("j-F-Y"); ?>]"
}
</pre>
</div>
<h3><a name="talk_pages" id="talk_pages"><?php echo hsc($lang["vector_cite_discussionpages"]); ?></a></h3>
<div class="level3">
<dl>
<dt><?php echo hsc($lang["vector_cite_markup"]); ?></dt>
<dd>[[<?php echo hsc(getID()); ?>|<?php tpl_pagetitle(); ?>]] ([[<?php echo hsc(getID()."?rev=".$rev); ?>|<?php echo hsc($lang["vector_cite_thisversion"]); ?>]])</dd>
</dl>
<dl>
<dt><?php echo hsc($lang["vector_cite_result"]); ?></dt>
<dd><a rel="nofollow" class="wikilink1" href="<?php echo hsc(wl(cleanID(getId()))); ?>"><?php tpl_pagetitle(); ?></a> (<a rel="nofollow" class="wikilink1" href="<?php echo hsc($permurl); ?>"><?php echo hsc($lang["vector_cite_thisversion"]); ?></a>)</dd>
</dl>
</div>