delete .wordpress
This commit is contained in:
parent
14882133ff
commit
5d97559b55
Binary file not shown.
Before Width: | Height: | Size: 29 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 42 KiB |
|
@ -1,169 +0,0 @@
|
||||||
<?php
|
|
||||||
/*
|
|
||||||
Plugin Name: Citations tools
|
|
||||||
Description: Some tools for scientific and editorial bloggers.
|
|
||||||
Version: 0.3.2
|
|
||||||
Author: Gianluigi Filippelli
|
|
||||||
Author URI: http://dropseaofulaula.blogspot.it/
|
|
||||||
Plugin URI: https://ulaulaman.github.io/citations-tools/
|
|
||||||
License: GPLv2 or later
|
|
||||||
*/
|
|
||||||
/* ------------------------------------------------------ */
|
|
||||||
# ---------------------------------------------------------
|
|
||||||
|
|
||||||
# doi
|
|
||||||
add_shortcode('ctdoi', 'ctdoi');
|
|
||||||
|
|
||||||
function ctdoi ($atts, $content = null) {
|
|
||||||
|
|
||||||
extract(
|
|
||||||
shortcode_atts(
|
|
||||||
array(
|
|
||||||
'code' => null
|
|
||||||
),
|
|
||||||
$atts
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$link = '<a href="https://dx.doi.org/'.$code.'" target="doi">'.$content.'</a>';
|
|
||||||
|
|
||||||
return $link;
|
|
||||||
}
|
|
||||||
|
|
||||||
# doi resolver
|
|
||||||
add_shortcode('ctdoiresolve', 'ctdoiresolve');
|
|
||||||
|
|
||||||
function ctdoiresolve ($atts, $content = null) {
|
|
||||||
|
|
||||||
extract(
|
|
||||||
shortcode_atts(
|
|
||||||
array(
|
|
||||||
'code' => null,
|
|
||||||
'arxiv' => null,
|
|
||||||
'pdfurl' => null,
|
|
||||||
'archiveurl' => null
|
|
||||||
),
|
|
||||||
$atts
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$fullCitation = null;
|
|
||||||
$getfile = 'https://search.crossref.org/dois?sort=score&page=1&rows=1&q='.$code;
|
|
||||||
$jsondata = file_get_contents($getfile);
|
|
||||||
$array = json_decode($jsondata,true);
|
|
||||||
$item=$array[0];
|
|
||||||
$doi = $item['doi'];
|
|
||||||
$coins = $item['coins'];
|
|
||||||
$fullCitation =$item['fullCitation'];
|
|
||||||
|
|
||||||
$citation = '<div class="paperbox">'.$fullCitation.' doi:<a href="https://dx.doi.org/'.$code.'" target="doi">'.$code.'</a>';
|
|
||||||
|
|
||||||
if ( $arxiv <> null )
|
|
||||||
{$citation = $citation.' (<a href="https://arxiv.org/abs/'.$arxiv.'" target="arxiv">arXiv</a>)';}
|
|
||||||
else
|
|
||||||
{$citation = $citation;}
|
|
||||||
|
|
||||||
if ( $pdfurl <> null )
|
|
||||||
{$citation = $citation.' (<a href="'.$pdfurl.'" target="pdf">pdf</a>)';}
|
|
||||||
else
|
|
||||||
{$citation = $citation;}
|
|
||||||
|
|
||||||
if ( $archiveurl <> null )
|
|
||||||
{$citation = $citation.' (<a href="'.$archiveurl.'" target="archive">archive.org</a>)';}
|
|
||||||
else
|
|
||||||
{$citation = $citation;}
|
|
||||||
|
|
||||||
$results = $citation.'</div>';
|
|
||||||
|
|
||||||
return $results;
|
|
||||||
}
|
|
||||||
|
|
||||||
# paperdata
|
|
||||||
add_shortcode('paperdata', 'paperdata');
|
|
||||||
|
|
||||||
function paperdata ($atts, $content = null) {
|
|
||||||
|
|
||||||
extract(
|
|
||||||
shortcode_atts(
|
|
||||||
array(
|
|
||||||
'auth' => null,
|
|
||||||
'year' => null,
|
|
||||||
'title' => null,
|
|
||||||
'journal' => null,
|
|
||||||
'vol' => null,
|
|
||||||
'issue' => null,
|
|
||||||
'pages' => null,
|
|
||||||
'code' => null,
|
|
||||||
'arxiv' => null,
|
|
||||||
'pdfurl' => null,
|
|
||||||
'archiveurl' => null
|
|
||||||
),
|
|
||||||
$atts
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
$fullcitation = null;
|
|
||||||
|
|
||||||
if ( $auth <> null )
|
|
||||||
{$fullcitation = $fullcitation.$auth;}
|
|
||||||
else
|
|
||||||
{$fullcitation = $fullcitation;}
|
|
||||||
|
|
||||||
if ( $year <> null )
|
|
||||||
{$fullcitation = $fullcitation.', '.$year;}
|
|
||||||
else
|
|
||||||
{$fullcitation = $fullcitation;}
|
|
||||||
|
|
||||||
if ( $title <> null )
|
|
||||||
{$fullcitation = $fullcitation.', '.$title;}
|
|
||||||
else
|
|
||||||
{$fullcitation = $fullcitation;}
|
|
||||||
|
|
||||||
if ( $journal <> null )
|
|
||||||
{$fullcitation = $fullcitation.', <em>'.$journal.'</em>';}
|
|
||||||
else
|
|
||||||
{$fullcitation = $fullcitation;}
|
|
||||||
|
|
||||||
if ( $vol <> null )
|
|
||||||
{$fullcitation = $fullcitation.', vol.'.$vol;}
|
|
||||||
else
|
|
||||||
{$fullcitation = $fullcitation;}
|
|
||||||
|
|
||||||
if ( $issue <> null )
|
|
||||||
{$fullcitation = $fullcitation.', n.'.$issue;}
|
|
||||||
else
|
|
||||||
{$fullcitation = $fullcitation;}
|
|
||||||
|
|
||||||
if ( $pages <> null )
|
|
||||||
{$fullcitation = $fullcitation.', pp. '.$pages;}
|
|
||||||
else
|
|
||||||
{$fullcitation = $fullcitation;}
|
|
||||||
|
|
||||||
$citation = '<div class="paperbox">'.$fullcitation;
|
|
||||||
|
|
||||||
if ( $code <> null )
|
|
||||||
{$citation = $citation.' doi:<a href="https://dx.doi.org/'.$code.'" target="doi">'.$code.'</a>';}
|
|
||||||
else
|
|
||||||
{$citation = $citation;}
|
|
||||||
|
|
||||||
if ( $arxiv <> null )
|
|
||||||
{$citation = $citation.' (<a href="https://arxiv.org/abs/'.$arxiv.'" target="arxiv">arXiv</a>)';}
|
|
||||||
else
|
|
||||||
{$citation = $citation;}
|
|
||||||
|
|
||||||
if ( $pdfurl <> null )
|
|
||||||
{$citation = $citation.' (<a href="'.$pdfurl.'" target="pdf">pdf</a>)';}
|
|
||||||
else
|
|
||||||
{$citation = $citation;}
|
|
||||||
|
|
||||||
if ( $archiveurl <> null )
|
|
||||||
{$citation = $citation.' (<a href="'.$archiveurl.'" target="archive">archive.org</a>)';}
|
|
||||||
else
|
|
||||||
{$citation = $citation;}
|
|
||||||
|
|
||||||
$results = $citation.'</div>';
|
|
||||||
|
|
||||||
return $results;
|
|
||||||
|
|
||||||
}
|
|
||||||
/* ------------------------------------------------------ */
|
|
|
@ -1,83 +0,0 @@
|
||||||
=== Citations tools ===
|
|
||||||
Contributors: ulaulaman
|
|
||||||
Tags: doi, citations, research, blog, blogging, research blogging, arXiv
|
|
||||||
Requires at least: 4.8.5
|
|
||||||
Tested up to: 4.9.5
|
|
||||||
Requires PHP: 7.0.18
|
|
||||||
Stable tag: trunk
|
|
||||||
License: GPLv2 or later
|
|
||||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
||||||
|
|
||||||
Developer version of the homonym plugin on Worpdress repository
|
|
||||||
Some tools for scientific and editorial bloggers.
|
|
||||||
|
|
||||||
== Description ==
|
|
||||||
The plugin add a shortcode in order to link a paper using its doi code. You can also use an other shortcode to resolve doi code and publish a full citation apa formatted. It is also a shortcode for manual citations.
|
|
||||||
|
|
||||||
## Link doi
|
|
||||||
|
|
||||||
Using the standard for doi link, the plugin introduce a shortcode in order to create a link to a paper provided by doi.
|
|
||||||
**How to use the shortcode**:
|
|
||||||
|
|
||||||
[ctdoi code="..."]Title of the paper[/doi]
|
|
||||||
|
|
||||||
## Doi resolver
|
|
||||||
|
|
||||||
The plugin send the doi code to [Crossref Metadata Search](https://search.crossref.org/), get the information and publish a full citation in apa standard with the shortcode [ctdoiresolve ...].
|
|
||||||
**How to use the shortcode**:
|
|
||||||
|
|
||||||
[ctdoiresolve code="..."]
|
|
||||||
|
|
||||||
There are also three optional parameters:
|
|
||||||
|
|
||||||
[ctdoiresolve code="..." arxiv="..."]
|
|
||||||
|
|
||||||
if the paper has an arXiv version
|
|
||||||
|
|
||||||
[ctdoiresolve code="..." pdfurl="..."]
|
|
||||||
|
|
||||||
if the paper has a free pdf version
|
|
||||||
|
|
||||||
[ctdoiresolve code="..." archiveurl="..."]
|
|
||||||
|
|
||||||
if the paper has a free version on [archive.org](https://archive.org/)
|
|
||||||
|
|
||||||
## Manual citations
|
|
||||||
|
|
||||||
There's also a shortcode for manual citations, [paperdata ...]. You can use it with the following syntax:
|
|
||||||
|
|
||||||
[paperdata auth="author/s name/s" year="..." title="..." journal="..." vol="..." issue="..." pages="..." code="..."]
|
|
||||||
|
|
||||||
You can also use the arxiv, pdfurl, archiveurl parameters.
|
|
||||||
|
|
||||||
## Styling
|
|
||||||
|
|
||||||
You can style citations adding in your css theme the class "paperdata".
|
|
||||||
|
|
||||||
## External service
|
|
||||||
|
|
||||||
**Digital Object Identifier**, or *DOI*, is a persistent identifier used to uniquely identify objects, standardized by the **International Organization for Standardization** (*ISO*). DOIs are mainly used to identify academic, professional, and government information, such as journal articles, research reports and data sets, official publications.
|
|
||||||
|
|
||||||
***Citations tools*** uses the [CrossRef Metadata API](http://search.crossref.org/help/api) to retrieve complete publication information using the doi code as a search query. CrossRef is a part of the [doi system](https://dx.doi.org/).
|
|
||||||
|
|
||||||
== Screenshots ==
|
|
||||||
1. The doi resolver: the shortcode (up) and the results (down)
|
|
||||||
|
|
||||||
== Installation ==
|
|
||||||
1. Extract the citations-tools.zip file and upload its contents to the /wp-content/plugins/ directory. Alternately, you can install directly from the Plugin directory within your WordPress Install.
|
|
||||||
2. Activate the plugin through the "Plugins" menu in WordPress.
|
|
||||||
3. Use the shortcode into your posts or pages.
|
|
||||||
|
|
||||||
== Changelog ==
|
|
||||||
* 0.3.2 add compatibility with Wordpress 4.9.5
|
|
||||||
* 0.3.1 fix error in html script in [ctdoi] shortcode
|
|
||||||
* 0.3 add shortcode for manual citations
|
|
||||||
* 0.2.6.1 update readme.txt
|
|
||||||
* 0.2.6 add archive.org link in doi resolver as shortcode's parameter
|
|
||||||
* 0.2.5 fix error code
|
|
||||||
* 0.2.4 changed functions names
|
|
||||||
* 0.2.3 add pdf link in doi resolver as shortcode's parameter
|
|
||||||
* 0.2.2 add arXiv link in doi resolver as shortcode's parameter
|
|
||||||
* 0.2.1 add doi link in doi resolver
|
|
||||||
* 0.2 add shortcode to resolve doi using code
|
|
||||||
* 0.1 shortcode for doi link
|
|
Loading…
Reference in New Issue