Skip to content

Commit

Permalink
- use custom thumbnail sizes
Browse files Browse the repository at this point in the history
- adapt NetLicensing auth. method (apiKey)
  • Loading branch information
R.Brown committed Apr 14, 2014
1 parent fff82c0 commit b9b3fb1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
2 changes: 2 additions & 0 deletions credit-tracker-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ function credit_tracker_table_shortcode($atts)

if (is_numeric($size)) {
$size = array($size, $size);
} else if (stripos($size, 'x') !== false) {
$size = explode('x', $size);
}

$request = array(
Expand Down
2 changes: 1 addition & 1 deletion credit-tracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Requires at least: 3.5.1
* Tested up to: 3.8.1
* Tested up to: 3.8.3
*
* @package Credit_Tracker
* @author Labs64 <[email protected]>
Expand Down
6 changes: 3 additions & 3 deletions options.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


define('CT_OPTIONS', 'CT_OPTIONS');
define('API_KEY', 'bd58df75-36be-44e2-811b-063fd3957182');
define('API_KEY', '31c7bc4e-90ff-44fb-9f07-b88eb06ed9dc');


if (is_admin()) {
Expand Down Expand Up @@ -254,8 +254,8 @@ function print_reference_section()
default behavior, if no ID is specified, is to display all images containing author info.</p>

<p>&nbsp;&nbsp;<strong>size</strong> <i>(optional)</i> - specify the image size to use for the thumbnail
display. Valid values include "thumbnail", "medium", "large", "full". The default value is
"thumbnail".</p>
display. Valid values include "thumbnail", "medium", "large", "full" or numeric values (e.g. "50" or "100x50").
The default value is "thumbnail".</p>

<p>&nbsp;&nbsp;<strong>style</strong> <i>(optional)</i> - specify the table CSS style. Valid values
include "default", "mercury", "mars". The default value is "default".</p>
Expand Down
8 changes: 1 addition & 7 deletions php/netlicensing/netlicensing.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,15 @@ class NetLicensing

private $curl = null;

public $apiKey;

/**
* Initializes a NetLicensing object
**/
function __construct($apiKey)
{
$this->apiKey = $apiKey;

$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : 'NetLicensing/PHP ' . PHP_VERSION . ' (http://netlicensing.labs64.com)';

$this->curl = new Curl();
$this->curl->headers['Authorization'] = 'Basic ' . base64_encode("apiKey:" . $apiKey);
$this->curl->headers['Accept'] = 'application/json';
$this->curl->user_agent = $user_agent;
}
Expand All @@ -45,9 +42,6 @@ function validate($productNumber, $licenseeNumber, $licenseeName = '')
$licenseeName = $licenseeNumber;
}
$url = self::NLIC_BASE_URL . '/licensee/' . $licenseeNumber . '/validate?productNumber=' . $productNumber . '&name=' . $licenseeName;
if (!empty($this->apiKey)) {
$url .= '&apiKey=' . $this->apiKey;
}

$response = $this->curl->get($url, $vars = array());

Expand Down
5 changes: 3 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: labs64
Tags: credit, attribution, legal, copyright, owner, author, media library, media, image, photo, license, royalty-free, RF, Creative Commons, stock, attachment, fotolia, bildnachweis, impressum, imprint, microdata, NetLicensing
Requires at least: 3.5.1
Tested up to: 3.8.1
Tested up to: 3.8.3
Stable tag: 0.9.12
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -131,7 +131,8 @@ Yes you can! Join in on our [GitHub repository](https://github.com/Labs64/credit
== Changelog ==

= 0.9.12 =
* ...
* Add custom sizes at the credit table
* Adapt NetLicensing authentication using apiKey

= 0.9.11 =
* German translation by Michail Preissnerov
Expand Down

0 comments on commit b9b3fb1

Please sign in to comment.