]> _ Git - cubeextranet.git/commitdiff
done #1118 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 6 Feb 2017 15:35:15 +0000 (15:35 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 6 Feb 2017 15:35:15 +0000 (15:35 +0000)
inc/ws/Controlleur/class.ws.url.php

index 7b80e54b4074d31a5720634fc26a0c8e6b20fec6..36e650b38b95a8e27dff5576641e132c08b75222 100644 (file)
@@ -1310,7 +1310,7 @@ html{height:100%}' . "\n";
                // EntĂȘtes Facebook
                $meta['og:title'] = ($book->parametres->facebook_title == '') ? $book->parametres->title : $book->parametres->facebook_title;
                if ($book->parametres->facebook_description != '') {
-                        $meta['og:description'] = $book->parametres->facebook_description;
+                       $meta['og:description'] = $book->parametres->facebook_description;
                }
                $meta['og:image'] = 'https://workshop.fluidbook.com/services/facebook_thumbnail?id=' . $book->book_id . '&j=' . TIME;
 
@@ -2099,4 +2099,37 @@ html{height:100%}' . "\n";
                return $res;
        }
 
+       public function orpiref($args) {
+               $ref = $args[1];
+
+
+               $client = new Zend_Http_Client();
+               $client->setAdapter('Zend_Http_Client_Adapter_Curl');
+               $client->setEncType(Zend_Http_Client::ENC_FORMDATA);
+               $client->setMethod(Zend_Http_Client::POST);
+               $client->setParameterPost(array('reference' => $ref));
+               $client->setUri('https://www.orpi.com/recherche/search_by_reference');
+               $client->setHeaders(array('X-Requested-With' => 'XMLHttpRequest'));
+               $response = $client->request();
+
+               $json = $response->getBody();
+               $res = 'https://www.orpi.com';
+               if ($json === false) {
+                       header('Location: ' . $res);
+                       exit;
+               }
+               $r = json_decode($json);
+               if ($r === false) {
+                       header('Location: ' . $res);
+                       exit;
+               }
+
+               if (isset($r->success) && $r->success && isset($r->location)) {
+                       header('Location: ' . $res . $r->location);
+                       exit;
+               }
+
+               header('Location: ' . $res);
+       }
+
 }