Пример #1
0
<?php

use Picturae\Mediabank\Client;
use Picturae\Mediabank\URL;
// Make sure you run composer install first
require __DIR__ . '/../../vendor/autoload.php';
// Change to your API key
$apiKey = '84fb6dde-1718-11e4-abe0-fff30396f5b7';
$url = new URL();
$client = new Client($apiKey);
$media = null;
if ($url->isDetail()) {
    $id = $url->getUUID();
    $media = $client->getMedia($id);
    $asset = $url->getMediaUUID();
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset=utf-8 />
        <title>Mediabank demo</title>

        <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
        <script src="//images.memorix.nl/topviewer/1.0/src/topviewer.compressed.js?v=1.0" type="text/javascript"></script>
        <script src="//webservices.picturae.com/mediabank/2.0/dist/js/mediabank-deps.min.js" type="text/javascript"></script>
        <script src="//webservices.picturae.com/mediabank/2.0/dist/js/mediabank-partials.min.js" type="text/javascript"></script>
        <script src="//webservices.picturae.com/mediabank/2.0/dist/js/mediabank.min.js" type="text/javascript"></script>
        <script>
            angular.element(document).ready(function () {
                angular.module('Mediabank.Boot')
Пример #2
0
<?php

use Picturae\Mediabank\Client;
use Picturae\Mediabank\URL;
use Sitemap\Collection;
use Sitemap\Formatter\XML\SitemapIndex;
use Sitemap\Formatter\XML\URLSet;
use Sitemap\Sitemap\SitemapEntry;
require_once 'vendor/autoload.php';
$url = new URL();
$link = $url->getCurrentURL();
// Change to your API key
$apiKey = '84fb6dde-1718-11e4-abe0-fff30396f5b7';
// Your base url for the mediabank application /detail/{id} is the route for the permalink
// your application would be installed under http://demo.webservices.picturae.pro/mediabank/
$baseURL = 'http://demo.webservices.picturae.pro/mediabank/detail/';
$client = new Client($apiKey);
// This part should be cached to avoid the extra request
$rows = 100;
$result = $client->search(['rows' => $rows]);
$pages = $result->metadata->pagination->pages;
$currentPage = null;
if (isset($_GET['page'])) {
    $currentPage = (int) $_GET['page'];
}
$collection = new Collection();
if ($currentPage) {
    // Render the sitemap for the current page
    $result = $client->search(['rows' => $rows, 'page' => $currentPage]);
    foreach ($result->media as $media) {
        $basic = new SitemapEntry($baseURL . $media->id);