Changeset 2333508
- Timestamp:
- 07/01/2020 12:55:58 PM (6 years ago)
- Location:
- display-your-zenodo-community
- Files:
-
- 5 added
- 10 edited
- 12 copied
-
assets/screenshot-2.png (modified) (previous)
-
assets/screenshot-3.png (added)
-
tags/1.1.0 (copied) (copied from display-your-zenodo-community/trunk)
-
tags/1.1.0/AUTHORS (copied) (copied from display-your-zenodo-community/trunk/AUTHORS)
-
tags/1.1.0/CHANGELOG.md (copied) (copied from display-your-zenodo-community/trunk/CHANGELOG.md) (1 diff)
-
tags/1.1.0/README.md (copied) (copied from display-your-zenodo-community/trunk/README.md) (3 diffs)
-
tags/1.1.0/README.txt (copied) (copied from display-your-zenodo-community/trunk/README.txt) (5 diffs)
-
tags/1.1.0/admin (copied) (copied from display-your-zenodo-community/trunk/admin)
-
tags/1.1.0/admin/class-display-your-zenodo-community-admin.php (modified) (2 diffs)
-
tags/1.1.0/admin/partials/display-your-zenodo-community-admin-display.php (copied) (copied from display-your-zenodo-community/trunk/admin/partials/display-your-zenodo-community-admin-display.php) (2 diffs)
-
tags/1.1.0/includes (copied) (copied from display-your-zenodo-community/trunk/includes)
-
tags/1.1.0/includes/class-display-your-zenodo-community.php (copied) (copied from display-your-zenodo-community/trunk/includes/class-display-your-zenodo-community.php) (1 diff)
-
tags/1.1.0/public (copied) (copied from display-your-zenodo-community/trunk/public)
-
tags/1.1.0/public/class-display-your-zenodo-community-public.php (copied) (copied from display-your-zenodo-community/trunk/public/class-display-your-zenodo-community-public.php) (4 diffs)
-
tags/1.1.0/public/images (added)
-
tags/1.1.0/public/images/Logo-plugin-Zenodo-for-Wordpress.jpg (added)
-
tags/1.1.0/zenodo-plugin.php (copied) (copied from display-your-zenodo-community/trunk/zenodo-plugin.php) (1 diff)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/README.md (modified) (3 diffs)
-
trunk/README.txt (modified) (5 diffs)
-
trunk/admin/class-display-your-zenodo-community-admin.php (modified) (2 diffs)
-
trunk/admin/partials/display-your-zenodo-community-admin-display.php (modified) (2 diffs)
-
trunk/includes/class-display-your-zenodo-community.php (modified) (1 diff)
-
trunk/public/class-display-your-zenodo-community-public.php (modified) (4 diffs)
-
trunk/public/images (added)
-
trunk/public/images/Logo-plugin-Zenodo-for-Wordpress.jpg (added)
-
trunk/zenodo-plugin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
display-your-zenodo-community/tags/1.1.0/CHANGELOG.md
r2308089 r2333508 6 6 7 7 ## [Unreleased] 8 9 ## [1.1.0] - 2020-07-01 10 ### Added 11 - The plugin now allows users to retrieve their publications with their ORCID and not only Community publications 12 ### Changed 13 - Change name of plugin (old `Display your Zenodo Community`) 14 - Screenshots have been updated 8 15 9 16 ## [1.0.3] - 2020-05-19 -
display-your-zenodo-community/tags/1.1.0/README.md
r2308086 r2333508 1 # Display your Zenodo Community1 # Display your Zenodo Publications 2 2 3 This WordPress plugin allows users to display content of their [Zenodo](https://zenodo.org/) Community o n Wordpress pages, for instance, if they wish to integrate a dynamic bibliography of their work with their blog or website.3 This WordPress plugin allows users to display content of their [Zenodo](https://zenodo.org/) Community or the publications of an author using an ORCID on Wordpress pages, for instance, if they wish to integrate a dynamic bibliography of their work with their blog or website. 4 4 To do so, access to the [Zenodo REST API](https://developers.zenodo.org/) is required, without it, the 5 5 plugin will not work. When using this plugin, you will also need to accept the Zenodo’s [Privacy Policy](https://about.zenodo.org/privacy-policy/) and its [Terms of Use](https://about.zenodo.org/terms/). … … 10 10 # Install (via WordPress plugins) 11 11 1. Install via [WordPress plugins](https://www.wordpress.org/plugins/display-your-zenodo-community) 12 1. Activate the plugin through the 'Plugins' menu in WordPress 12 13 13 14 # Install (manually) … … 15 16 1. Activate the plugin through the 'Plugins' menu in WordPress 16 17 17 A very simple administration page (in Settings -> Zenodo) to choose your Zenodo community (e.g. `dariah` or `operaseu`). 18 A very simple administration page (in Settings -> Zenodo) to choose your Zenodo community (e.g. `dariah` or `operaseu 19 `) or choose your personal ORCID. 18 20 On the page you want to present the Zenodo data, add the shortcode `[display-your-zenodo-community]` to see the publications. 19 21 # How does it work? 20 With API request directly to Zenodo, with your community identifier added in the admin page, you can retrieve some21 information of disseminated data on Zenodo.22 With API request directly to Zenodo, with your community identifier or your ORCID added in the admin page, you can 23 retrieve some information of disseminated data on Zenodo. -
display-your-zenodo-community/tags/1.1.0/README.txt
r2308089 r2333508 1 === Display your Zenodo Community===1 === Display your Zenodo Publications === 2 2 Contributors: yoannspace 3 3 Donate link: … … 6 6 Tested up to: 5.4 7 7 Requires PHP: 5.6.35 8 Stable tag: 1. 0.38 Stable tag: 1.1.0 9 9 License: Apache License - 2.0 10 10 License URI: http://www.apache.org/licenses/LICENSE-2.0 11 11 12 This WordPress plugin allows users to see their Zenodo Community data.12 This WordPress plugin allows users to see their Zenodo publications (either from a Community or related to their ORCID). 13 13 14 14 == Description == 15 15 16 This WordPress plugin allows users to display content of their [Zenodo](https://zenodo.org/) Community o n Wordpress pages, for instance, if they wish to integrate a dynamic bibliography of their work with their blog or website.16 This WordPress plugin allows users to display content of their [Zenodo](https://zenodo.org/) Community or the publications of an author using an ORCID on Wordpress pages, for instance, if they wish to integrate a dynamic bibliography of their work with their blog or website. 17 17 To do so, access to the [Zenodo REST API](https://developers.zenodo.org/) is required, without it, the plugin will not work. When using this plugin, you will also need to accept the Zenodo’s [Privacy Policy](https://about.zenodo.org/privacy-policy/) and its [Terms of Use](https://about.zenodo.org/terms/). 18 18 Originally, the plugin has been created for and by [DARIAH-EU](https://www.dariah.eu). You can find it implemented here: [https://www.dariah.eu/about/publications/](https://www.dariah.eu/about/publications/). … … 20 20 == Installation == 21 21 22 Via WordPress plugins 23 1. Install via [WordPress plugins](https://www.wordpress.org/plugins/display-your-zenodo-community) 24 1. Activate the plugin through the 'Plugins' menu in WordPress 25 26 Manually 22 27 1. Upload directory `display-your-zenodo-community` to the `/wp-content/plugins/` directory 23 28 1. Activate the plugin through the 'Plugins' menu in WordPress … … 28 33 == Frequently Asked Questions == 29 34 30 None 35 = I don't have an ORCID, can I still use the plugin to display my publications with my name? = 36 Unfortunately, no. The reason being that queries to the Zenodo API do not work well with names since they can't 37 differentiate authors. 31 38 32 39 == Screenshots == … … 34 41 1. Display of the Zenodo Community data on the DARIAH-EU website 35 42 2. Very simple administration page to choose your Zenodo community 43 3. Very simple administration page to choose your ORCID 36 44 37 45 == Changelog == 46 47 = 1.1.0 = 48 * The plugin now allows users to retrieve their publications with their ORCID and not only Community publications 49 * Change name of plugin (old `Display your Zenodo Community`) 50 * Screenshots have been updated 38 51 39 52 = 1.0.3 = -
display-your-zenodo-community/tags/1.1.0/admin/class-display-your-zenodo-community-admin.php
r2294132 r2333508 127 127 */ 128 128 public function options_update() { 129 register_setting( $this->plugin_name, $this->plugin_name, array( 'sanitize_callback' => array( $this, 'validate' ), 'default' => array( 'id_community ' => '' ) ) );129 register_setting( $this->plugin_name, $this->plugin_name, array( 'sanitize_callback' => array( $this, 'validate' ), 'default' => array( 'id_community_orcid' => '', 'choice' => '' ) ) ); 130 130 } 131 131 /** … … 137 137 // All checkboxes inputs 138 138 $valid = array(); 139 $valid['id_community'] = (isset($input['id_community']) && !empty($input['id_community'])) ? sanitize_text_field($input['id_community']) : ''; 139 $valid['id_community_orcid'] = (isset($input['id_community_orcid']) && !empty($input['id_community_orcid'])) ? 140 sanitize_text_field($input['id_community_orcid']) : ''; 141 $valid['choice'] = sanitize_text_field($input['choice']); 140 142 return $valid; 141 143 } -
display-your-zenodo-community/tags/1.1.0/admin/partials/display-your-zenodo-community-admin-display.php
r2308086 r2333508 21 21 22 22 <h2 class="nav-tab-wrapper">Zenodo Settings</h2> 23 <p>Please select in the dropdown list either "Community" or "ORCID" and enter the value corresponding.</p> 24 <p>If you select "Community", please enter a value such as "dariah" so a query on 25 https://zenodo.org/api/records/?communities=dariah returns results.</p> 26 <p>If you select "ORCID", please enter a value such as "0000-0002-5350-067X" so a query on 27 https://zenodo.org/api/records/?q=creators.orcid:"0000-0002-5350-067X" returns results.</p> 23 28 24 29 <form method="post" name="display_your_zenodo_community_options" action="options.php"> … … 27 32 //Grab all options 28 33 $display_your_zenodo_community_options = get_option( $this->plugin_name ); 29 $id_community = $display_your_zenodo_community_options['id_community']; 34 $choice = $display_your_zenodo_community_options['choice']; 35 $id_community_orcid = $display_your_zenodo_community_options['id_community_orcid']; 30 36 31 37 $html = "<tr> 32 38 <th scope=\"row\"> 33 <label for=\"" . $this->plugin_name . "-id-community\">" . translate('Name of community (e.g. dariah)', 39 <label for=\"" . $this->plugin_name . "-choice\">" . translate('Choice of community or orcid', 40 $this->plugin_name) . "</label> 41 </th> 42 <td> 43 <select name=\"" . $this->plugin_name . "[choice]\" id=\"" . $this->plugin_name . "-choice\"> 44 <option value=\"community\"" . (($choice=='community')?" selected=\"selected\"":"") . ">Community</option> 45 <option value=\"orcid\"" . (($choice=='orcid')?" selected=\"selected\"":"") . ">ORCID</option> 46 </select> 47 </td> 48 </tr>"; 49 $html .= "<tr> 50 <th scope=\"row\"> 51 <label for=\"" . $this->plugin_name . "-id-community-orcid\">" . translate('Value (e.g. dariah or 0000-0002-5350-067X)', 34 52 $this->plugin_name) . "</label> 35 53 </th> 36 54 <td> 37 <input name=\"" . $this->plugin_name . "[id_community ]\" id=\"" . $this->plugin_name38 . "-id-community \" value=\"" . $id_community. "\" type=\"text\">55 <input name=\"" . $this->plugin_name . "[id_community_orcid]\" id=\"" . $this->plugin_name 56 . "-id-community-orcid\" value=\"" . $id_community_orcid . "\" type=\"text\"> 39 57 </td> 40 58 </tr>"; -
display-your-zenodo-community/tags/1.1.0/includes/class-display-your-zenodo-community.php
r2308089 r2333508 54 54 $this->version = ZENODO_PLUGIN_VERSION; 55 55 } else { 56 $this->version = '1. 0.3';56 $this->version = '1.1.0'; 57 57 } 58 58 $this->plugin_name = 'display-your-zenodo-community'; -
display-your-zenodo-community/tags/1.1.0/public/class-display-your-zenodo-community-public.php
r2300116 r2333508 96 96 */ 97 97 public function display_zenodo_data() { 98 $display_your_zenodo_community_options = get_option( $this->plugin_name ); 99 $choice = $display_your_zenodo_community_options['choice']; 100 $id_community_orcid = $display_your_zenodo_community_options['id_community_orcid']; 101 98 102 $page = 1; 99 103 if( is_numeric( get_query_var( 'zenodo_page' ) ) ) { … … 109 113 $html .= "<span class=\"wphal-nbtot\">"; 110 114 $html .= $result_api->aggregations->access_right->buckets[0]->doc_count; 111 $html .= "</span>" . " documents"; 115 $html .= "</span>" . " documents (from " . ($choice=='community'?"Community \"":"ORCID \"") . 116 $id_community_orcid . "\")"; 112 117 $html .= "</div>"; 113 118 } … … 129 134 } 130 135 if( isset( $hit->metadata->version ) ) { 131 $html .= " (Version " . $hit->metadata->version . ") .";132 } 133 $html .= " Zenodo.";136 $html .= " (Version " . $hit->metadata->version . ")"; 137 } 138 $html .= ". Zenodo."; 134 139 if( isset( $hit->links->doi ) ) { 135 140 $html .= " <a href='" . $hit->links->doi . "'>" . $hit->links->doi . "</a>"; … … 215 220 public function zp_retrieve_json( $page = 1 ) { 216 221 $display_your_zenodo_community_options = get_option( $this->plugin_name ); 217 $id_community = $display_your_zenodo_community_options['id_community']; 218 if( $id_community !== '' ) { 219 $zenodo_api_url = "https://zenodo.org/api/records/?sort=mostrecent&size=10&communities=" . $id_community; 222 $choice = $display_your_zenodo_community_options['choice']; 223 $id_community_orcid = $display_your_zenodo_community_options['id_community_orcid']; 224 225 $zenodo_api_url = ""; 226 if( $choice == 'community' ) { 227 $zenodo_api_url = "https://zenodo.org/api/records/?sort=mostrecent&size=10&communities=" . $id_community_orcid; 220 228 $zenodo_api_url .= "&page=" . $page; 221 222 229 } elseif ( $choice == 'orcid' ) { 230 $zenodo_api_url = "https://zenodo.org/api/records/?q=creators.orcid:%22" . $id_community_orcid . "%22"; 231 $zenodo_api_url .= "&page=" . $page; 232 } 233 if( $id_community_orcid !== '' && $zenodo_api_url !== '' ) { 223 234 $request = wp_remote_get( $zenodo_api_url ); 224 235 if( is_wp_error( $request ) ) { -
display-your-zenodo-community/tags/1.1.0/zenodo-plugin.php
r2308089 r2333508 14 14 * 15 15 * @wordpress-plugin 16 * Plugin Name: Display your Zenodo Community16 * Plugin Name: Display your Zenodo Publications 17 17 * Plugin URI: https://github.com/dariah-eric/display-your-zenodo-community 18 18 * Description: This plugin allows user to view their community data from Zenodo on WordPress 19 * Version: 1. 0.319 * Version: 1.1.0 20 20 * Author: DARIAH-EU 21 21 * Author URI: https://www.dariah.eu -
display-your-zenodo-community/trunk/CHANGELOG.md
r2308089 r2333508 6 6 7 7 ## [Unreleased] 8 9 ## [1.1.0] - 2020-07-01 10 ### Added 11 - The plugin now allows users to retrieve their publications with their ORCID and not only Community publications 12 ### Changed 13 - Change name of plugin (old `Display your Zenodo Community`) 14 - Screenshots have been updated 8 15 9 16 ## [1.0.3] - 2020-05-19 -
display-your-zenodo-community/trunk/README.md
r2308086 r2333508 1 # Display your Zenodo Community1 # Display your Zenodo Publications 2 2 3 This WordPress plugin allows users to display content of their [Zenodo](https://zenodo.org/) Community o n Wordpress pages, for instance, if they wish to integrate a dynamic bibliography of their work with their blog or website.3 This WordPress plugin allows users to display content of their [Zenodo](https://zenodo.org/) Community or the publications of an author using an ORCID on Wordpress pages, for instance, if they wish to integrate a dynamic bibliography of their work with their blog or website. 4 4 To do so, access to the [Zenodo REST API](https://developers.zenodo.org/) is required, without it, the 5 5 plugin will not work. When using this plugin, you will also need to accept the Zenodo’s [Privacy Policy](https://about.zenodo.org/privacy-policy/) and its [Terms of Use](https://about.zenodo.org/terms/). … … 10 10 # Install (via WordPress plugins) 11 11 1. Install via [WordPress plugins](https://www.wordpress.org/plugins/display-your-zenodo-community) 12 1. Activate the plugin through the 'Plugins' menu in WordPress 12 13 13 14 # Install (manually) … … 15 16 1. Activate the plugin through the 'Plugins' menu in WordPress 16 17 17 A very simple administration page (in Settings -> Zenodo) to choose your Zenodo community (e.g. `dariah` or `operaseu`). 18 A very simple administration page (in Settings -> Zenodo) to choose your Zenodo community (e.g. `dariah` or `operaseu 19 `) or choose your personal ORCID. 18 20 On the page you want to present the Zenodo data, add the shortcode `[display-your-zenodo-community]` to see the publications. 19 21 # How does it work? 20 With API request directly to Zenodo, with your community identifier added in the admin page, you can retrieve some21 information of disseminated data on Zenodo.22 With API request directly to Zenodo, with your community identifier or your ORCID added in the admin page, you can 23 retrieve some information of disseminated data on Zenodo. -
display-your-zenodo-community/trunk/README.txt
r2308089 r2333508 1 === Display your Zenodo Community===1 === Display your Zenodo Publications === 2 2 Contributors: yoannspace 3 3 Donate link: … … 6 6 Tested up to: 5.4 7 7 Requires PHP: 5.6.35 8 Stable tag: 1. 0.38 Stable tag: 1.1.0 9 9 License: Apache License - 2.0 10 10 License URI: http://www.apache.org/licenses/LICENSE-2.0 11 11 12 This WordPress plugin allows users to see their Zenodo Community data.12 This WordPress plugin allows users to see their Zenodo publications (either from a Community or related to their ORCID). 13 13 14 14 == Description == 15 15 16 This WordPress plugin allows users to display content of their [Zenodo](https://zenodo.org/) Community o n Wordpress pages, for instance, if they wish to integrate a dynamic bibliography of their work with their blog or website.16 This WordPress plugin allows users to display content of their [Zenodo](https://zenodo.org/) Community or the publications of an author using an ORCID on Wordpress pages, for instance, if they wish to integrate a dynamic bibliography of their work with their blog or website. 17 17 To do so, access to the [Zenodo REST API](https://developers.zenodo.org/) is required, without it, the plugin will not work. When using this plugin, you will also need to accept the Zenodo’s [Privacy Policy](https://about.zenodo.org/privacy-policy/) and its [Terms of Use](https://about.zenodo.org/terms/). 18 18 Originally, the plugin has been created for and by [DARIAH-EU](https://www.dariah.eu). You can find it implemented here: [https://www.dariah.eu/about/publications/](https://www.dariah.eu/about/publications/). … … 20 20 == Installation == 21 21 22 Via WordPress plugins 23 1. Install via [WordPress plugins](https://www.wordpress.org/plugins/display-your-zenodo-community) 24 1. Activate the plugin through the 'Plugins' menu in WordPress 25 26 Manually 22 27 1. Upload directory `display-your-zenodo-community` to the `/wp-content/plugins/` directory 23 28 1. Activate the plugin through the 'Plugins' menu in WordPress … … 28 33 == Frequently Asked Questions == 29 34 30 None 35 = I don't have an ORCID, can I still use the plugin to display my publications with my name? = 36 Unfortunately, no. The reason being that queries to the Zenodo API do not work well with names since they can't 37 differentiate authors. 31 38 32 39 == Screenshots == … … 34 41 1. Display of the Zenodo Community data on the DARIAH-EU website 35 42 2. Very simple administration page to choose your Zenodo community 43 3. Very simple administration page to choose your ORCID 36 44 37 45 == Changelog == 46 47 = 1.1.0 = 48 * The plugin now allows users to retrieve their publications with their ORCID and not only Community publications 49 * Change name of plugin (old `Display your Zenodo Community`) 50 * Screenshots have been updated 38 51 39 52 = 1.0.3 = -
display-your-zenodo-community/trunk/admin/class-display-your-zenodo-community-admin.php
r2294132 r2333508 127 127 */ 128 128 public function options_update() { 129 register_setting( $this->plugin_name, $this->plugin_name, array( 'sanitize_callback' => array( $this, 'validate' ), 'default' => array( 'id_community ' => '' ) ) );129 register_setting( $this->plugin_name, $this->plugin_name, array( 'sanitize_callback' => array( $this, 'validate' ), 'default' => array( 'id_community_orcid' => '', 'choice' => '' ) ) ); 130 130 } 131 131 /** … … 137 137 // All checkboxes inputs 138 138 $valid = array(); 139 $valid['id_community'] = (isset($input['id_community']) && !empty($input['id_community'])) ? sanitize_text_field($input['id_community']) : ''; 139 $valid['id_community_orcid'] = (isset($input['id_community_orcid']) && !empty($input['id_community_orcid'])) ? 140 sanitize_text_field($input['id_community_orcid']) : ''; 141 $valid['choice'] = sanitize_text_field($input['choice']); 140 142 return $valid; 141 143 } -
display-your-zenodo-community/trunk/admin/partials/display-your-zenodo-community-admin-display.php
r2308086 r2333508 21 21 22 22 <h2 class="nav-tab-wrapper">Zenodo Settings</h2> 23 <p>Please select in the dropdown list either "Community" or "ORCID" and enter the value corresponding.</p> 24 <p>If you select "Community", please enter a value such as "dariah" so a query on 25 https://zenodo.org/api/records/?communities=dariah returns results.</p> 26 <p>If you select "ORCID", please enter a value such as "0000-0002-5350-067X" so a query on 27 https://zenodo.org/api/records/?q=creators.orcid:"0000-0002-5350-067X" returns results.</p> 23 28 24 29 <form method="post" name="display_your_zenodo_community_options" action="options.php"> … … 27 32 //Grab all options 28 33 $display_your_zenodo_community_options = get_option( $this->plugin_name ); 29 $id_community = $display_your_zenodo_community_options['id_community']; 34 $choice = $display_your_zenodo_community_options['choice']; 35 $id_community_orcid = $display_your_zenodo_community_options['id_community_orcid']; 30 36 31 37 $html = "<tr> 32 38 <th scope=\"row\"> 33 <label for=\"" . $this->plugin_name . "-id-community\">" . translate('Name of community (e.g. dariah)', 39 <label for=\"" . $this->plugin_name . "-choice\">" . translate('Choice of community or orcid', 40 $this->plugin_name) . "</label> 41 </th> 42 <td> 43 <select name=\"" . $this->plugin_name . "[choice]\" id=\"" . $this->plugin_name . "-choice\"> 44 <option value=\"community\"" . (($choice=='community')?" selected=\"selected\"":"") . ">Community</option> 45 <option value=\"orcid\"" . (($choice=='orcid')?" selected=\"selected\"":"") . ">ORCID</option> 46 </select> 47 </td> 48 </tr>"; 49 $html .= "<tr> 50 <th scope=\"row\"> 51 <label for=\"" . $this->plugin_name . "-id-community-orcid\">" . translate('Value (e.g. dariah or 0000-0002-5350-067X)', 34 52 $this->plugin_name) . "</label> 35 53 </th> 36 54 <td> 37 <input name=\"" . $this->plugin_name . "[id_community ]\" id=\"" . $this->plugin_name38 . "-id-community \" value=\"" . $id_community. "\" type=\"text\">55 <input name=\"" . $this->plugin_name . "[id_community_orcid]\" id=\"" . $this->plugin_name 56 . "-id-community-orcid\" value=\"" . $id_community_orcid . "\" type=\"text\"> 39 57 </td> 40 58 </tr>"; -
display-your-zenodo-community/trunk/includes/class-display-your-zenodo-community.php
r2308089 r2333508 54 54 $this->version = ZENODO_PLUGIN_VERSION; 55 55 } else { 56 $this->version = '1. 0.3';56 $this->version = '1.1.0'; 57 57 } 58 58 $this->plugin_name = 'display-your-zenodo-community'; -
display-your-zenodo-community/trunk/public/class-display-your-zenodo-community-public.php
r2300116 r2333508 96 96 */ 97 97 public function display_zenodo_data() { 98 $display_your_zenodo_community_options = get_option( $this->plugin_name ); 99 $choice = $display_your_zenodo_community_options['choice']; 100 $id_community_orcid = $display_your_zenodo_community_options['id_community_orcid']; 101 98 102 $page = 1; 99 103 if( is_numeric( get_query_var( 'zenodo_page' ) ) ) { … … 109 113 $html .= "<span class=\"wphal-nbtot\">"; 110 114 $html .= $result_api->aggregations->access_right->buckets[0]->doc_count; 111 $html .= "</span>" . " documents"; 115 $html .= "</span>" . " documents (from " . ($choice=='community'?"Community \"":"ORCID \"") . 116 $id_community_orcid . "\")"; 112 117 $html .= "</div>"; 113 118 } … … 129 134 } 130 135 if( isset( $hit->metadata->version ) ) { 131 $html .= " (Version " . $hit->metadata->version . ") .";132 } 133 $html .= " Zenodo.";136 $html .= " (Version " . $hit->metadata->version . ")"; 137 } 138 $html .= ". Zenodo."; 134 139 if( isset( $hit->links->doi ) ) { 135 140 $html .= " <a href='" . $hit->links->doi . "'>" . $hit->links->doi . "</a>"; … … 215 220 public function zp_retrieve_json( $page = 1 ) { 216 221 $display_your_zenodo_community_options = get_option( $this->plugin_name ); 217 $id_community = $display_your_zenodo_community_options['id_community']; 218 if( $id_community !== '' ) { 219 $zenodo_api_url = "https://zenodo.org/api/records/?sort=mostrecent&size=10&communities=" . $id_community; 222 $choice = $display_your_zenodo_community_options['choice']; 223 $id_community_orcid = $display_your_zenodo_community_options['id_community_orcid']; 224 225 $zenodo_api_url = ""; 226 if( $choice == 'community' ) { 227 $zenodo_api_url = "https://zenodo.org/api/records/?sort=mostrecent&size=10&communities=" . $id_community_orcid; 220 228 $zenodo_api_url .= "&page=" . $page; 221 222 229 } elseif ( $choice == 'orcid' ) { 230 $zenodo_api_url = "https://zenodo.org/api/records/?q=creators.orcid:%22" . $id_community_orcid . "%22"; 231 $zenodo_api_url .= "&page=" . $page; 232 } 233 if( $id_community_orcid !== '' && $zenodo_api_url !== '' ) { 223 234 $request = wp_remote_get( $zenodo_api_url ); 224 235 if( is_wp_error( $request ) ) { -
display-your-zenodo-community/trunk/zenodo-plugin.php
r2308089 r2333508 14 14 * 15 15 * @wordpress-plugin 16 * Plugin Name: Display your Zenodo Community16 * Plugin Name: Display your Zenodo Publications 17 17 * Plugin URI: https://github.com/dariah-eric/display-your-zenodo-community 18 18 * Description: This plugin allows user to view their community data from Zenodo on WordPress 19 * Version: 1. 0.319 * Version: 1.1.0 20 20 * Author: DARIAH-EU 21 21 * Author URI: https://www.dariah.eu
Note: See TracChangeset
for help on using the changeset viewer.