Changeset 54448 in spip-zone
- Timestamp:
- Nov 14, 2011, 5:11:31 PM (8 years ago)
- Location:
- _plugins_/oembed
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/oembed/action/supprimer_provider.php
r46225 r54448 1 1 <?php 2 /** 3 * Plugin oEmbed 4 * Licence GPL3 5 * 6 */ 2 7 3 8 if (!defined('_ECRIRE_INC_VERSION')) return; 4 5 9 6 10 function action_supprimer_provider_dist(){ -
_plugins_/oembed/base/oembed.php
r46225 r54448 1 1 <?php 2 2 /** 3 * Plugin oEmbed 4 * Licence GPL3 5 * 6 */ 7 8 if (!defined('_ECRIRE_INC_VERSION')) return; 9 3 10 function oembed_declarer_tables_interfaces($interface){ 4 11 -
_plugins_/oembed/formulaires/configurer_providers.php
r47797 r54448 1 1 <?php 2 /** 3 * Plugin oEmbed 4 * Licence GPL3 5 * 6 */ 7 8 if (!defined('_ECRIRE_INC_VERSION')) return; 2 9 3 10 function formulaires_configurer_providers_charger_dist(){ -
_plugins_/oembed/inc/oembed.php
r54447 r54448 1 1 <?php 2 /** 3 * Plugin oEmbed 4 * Licence GPL3 5 * 6 */ 7 8 if (!defined('_ECRIRE_INC_VERSION')) return; 2 9 3 10 // Merci WordPress :) … … 23 30 24 31 $provider = oembed_verifier_provider($url); 25 $data_url = parametre_url($provider,'url',$url,'&');26 32 33 if ((!$provider) 34 AND (($detecter_lien != 'non') OR lire_config('oembed/detecter_lien','non')=='oui')) { 35 $provider = oembed_detecter_lien($url); 36 } 37 38 if (!$provider) 39 return false; 40 41 $data_url = parametre_url($provider['endpoint'],'url',$url,'&'); 27 42 include_spip('inc/config'); 28 43 if (is_null($maxwidth)){ … … 33 48 } 34 49 35 if ((!$provider) AND (($detecter_lien != 'non') OR lire_config('oembed/detecter_lien','non')=='oui')) {36 $provider = oembed_detecter_lien($url);37 $data_url = $provider;38 }39 40 50 $data_url = parametre_url($data_url,'maxwidth',$maxwidth,'&'); 41 51 $data_url = parametre_url($data_url,'maxheight',$maxheight,'&'); … … 45 55 return $cache[$data_url]; 46 56 57 $cache[$data_url] = false; 47 58 // on recupere le contenu de la page 48 59 include_spip('inc/distant'); 49 60 if ($data = recuperer_page($data_url)) { 50 61 if ($format == 'json') 51 return$cache[$data_url] = json_decode($data,true);62 $cache[$data_url] = json_decode($data,true); 52 63 // TODO : format xml 53 if ($format == 'xml')54 return$cache[$data_url] = false;64 //if ($format == 'xml') 65 // $cache[$data_url] = false; 55 66 } 56 67 57 return $cache[$data_url] = false; 68 // si une fonction de post-traitement est fourni pour ce provider+type, l'utiliser 69 if ($cache[$data_url]){ 70 $provider_name= strtolower($cache[$data_url]['provider_name']); 71 $type = strtolower($cache[$data_url]['type']); 72 if ($oembed_provider_posttraite = charger_fonction("posttraite_{$provider_name}_$type",'oembed',true)) 73 $cache[$data_url] = $oembed_provider_posttraite($cache[$data_url]); 74 } 75 76 return $cache[$data_url]; 58 77 } 59 78 … … 62 81 * 63 82 * @param string $url l'url à tester 64 * @return bool|string false si non ; endpoint du provider si oui 83 * @return bool|array 84 * false si non ; details du provider dans un tabeau associatif si oui 65 85 */ 66 86 function oembed_verifier_provider($url) { … … 69 89 $regex = '/' . str_replace('\*', '(.+)', preg_quote($p['scheme'], '/')) . '/'; 70 90 if (preg_match($regex, $url)) { 71 return $p ['endpoint'];91 return $p; 72 92 } 73 93 } … … 123 143 // on préfère le json au xml 124 144 if (!empty($providers['json'])) 125 return $providers['json'];145 return array('endpoint'=>$providers['json']); 126 146 elseif (!empty($providers['xml'])) 127 return $providers['xml'];147 return array('endpoint'=>$providers['xml']); 128 148 else 129 149 return false; -
_plugins_/oembed/modeles/oembed_fonctions.php
r47709 r54448 1 1 <?php 2 /** 3 * Plugin oEmbed 4 * Licence GPL3 5 * 6 */ 7 8 if (!defined('_ECRIRE_INC_VERSION')) return; 2 9 3 10 include_spip('inc/oembed'); -
_plugins_/oembed/oembed_administrations.php
r54441 r54448 1 1 <?php 2 /** 3 * Plugin oEmbed 4 * Licence GPL3 5 * 6 */ 7 2 8 if (!defined('_ECRIRE_INC_VERSION')) return; 3 9 -
_plugins_/oembed/oembed_fonctions.php
r46552 r54448 1 1 <?php 2 /** 3 * Plugin oEmbed 4 * Licence GPL3 5 * 6 */ 7 8 if (!defined('_ECRIRE_INC_VERSION')) return; 2 9 3 10 // renvoyer un mim_type text/oembed pour les videos oembed -
_plugins_/oembed/oembed_options.php
r47632 r54448 1 1 <?php 2 /** 3 * Plugin oEmbed 4 * Licence GPL3 5 * 6 */ 7 8 if (!defined('_ECRIRE_INC_VERSION')) return; 2 9 3 10 define('_DEFINIR_CONTEXTE_TYPE',true); -
_plugins_/oembed/oembed_pipelines.php
r54447 r54448 1 1 <?php 2 /** 3 * Plugin oEmbed 4 * Licence GPL3 5 * 6 */ 7 8 if (!defined('_ECRIRE_INC_VERSION')) return; 2 9 3 10 // ajouter le lien oembed dans le head des pages publiques … … 19 26 // on tente de récupérer les données oembed 20 27 if ($data = oembed_recuperer_data($flux['source'])){ 21 if ($data['type']=='photo') { 28 // si on a recupere une URL c'est direct un doc distant 29 if (isset($data['url'])) { 22 30 // on recupere les infos du document distant 23 31 if ($doc = recuperer_infos_distantes($data['url'])) { … … 33 41 } 34 42 } 35 if (($data['type']=='video') OR ($data['type']=='rich') OR ($data['type']=='link')){43 elseif(isset($data['html']) OR $data['type']=='link'){ 36 44 if ($data['type']=='link') 37 45 $data['html'] = '<a href="' . $flux['source'] . '">' . sinon($data['title'],$flux['source']) . '</a>'; -
_plugins_/oembed/paquet.xml
r54447 r54448 2 2 prefix="oembed" 3 3 categorie="multimedia" 4 version="0. 2.0"4 version="0.3.0" 5 5 etat="dev" 6 6 compatibilite="[3.0.0-dev;["
Note: See TracChangeset
for help on using the changeset viewer.