�����ÿþ�;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 90 ÿÛ�C1Ú´áMò nCÛ¸¬#H‚»‘rö«ñÃvG¯ëMeR’¯ÝRC¡ô5ecù˜�<‘‘Š· ©Üp2z·¥�T¬FGÝaÉÅ'”6ÆÊS9cÜÖ²Û…‰r»MP»�”q“Uboc5¶¨bßxzzô¾gž•Nê~^@såüÛ}ê½µùhÁýã‘ž†«”.j‚¥G©8"¥-‰Wi©Ã:ÍågŽFìw㊳~êB¸‡+ïÏ4U‚ȪýÑŸÆ$A•#è½?Š,„g–9¦ä¾F ž�îE�'ÝSŒç\úÔò&øÈîpxêM1Ðm$w#j°WSÁ=:zS9P.})ÛwÆŸ9À”ॢ-ÀÏ:î•AÊ«íö¤22Û@;p«ò·¹4¼¢d}øÎIíô§€²†±¯ZŒJüÒ`*õǽ¹ 7`S#Œ+&zAîL3»wY0C˜Çd²ðÄrÆŒ(NÐW•ÉOCM yÉÇ#±5,ÌGRWåÍ,¸VŒpè‹“Žæ²9cÉÓqÇò#HÛr¡J�;ÔÅ $ñ³bHú? =ª>¬0@í@Æ¡ƒnñëM“ %pB®ëRI—Y�8!³°})ƒåbä¸g±µ0x'1ïI:瞇…?oúÞpTä7· ¨w)ÀÚǨ>‚€À1á¸Ævã¯Zd¹8n†N?#Þ¤s´±#åë´u¤“îO:Ú"fPO9ö¨‰Ä~¥N1è}iîØidSê}iZ0äF¥0#—pØ;³ÎIâ´4럳†…Ê[šÏsæÈ2¸ãŽæ€û<žËdŸJ@nÝ[ýégNOZÀ¾²ýÔ¨�Élÿ�ú«^ÎíN!”äžTš’êØIr†Ž�ÔÓ™*fHJýí¥ ú{ÔN
<?php /* Utilisation des Web services Piwigo pour afficher les photos dans une page ModX * Code provenant de la doc Piwigo: * http://fr.piwigo.org/doc/doku.php?id=projet:developpement:web_services */ if (!function_exists(images)) { function images($base_url,$ws,$format,$method,$options) { // Initialisation de la session $session = curl_init(); // Valeurs par défaut $output = ``; $base_url = (isset($base_url)) ? $base_url :'http://fr.piwigo.org/demo/'; $ws = (isset($ws)) ? $ws : 'ws.php'; $format = (isset($format)) ? $format : 'php'; $method = (isset($method)) ? $method : 'pwg.categories.getImages'; $options = (isset($options)) ? $options : '&order=random&per_page=1'; /* Construction de l'URL */ $url = $base_url . $ws .'?format='.$format . '&method=' . $method . '&' . $options; // Configuration des options de CURL curl_setopt($session, CURLOPT_URL,$url); curl_setopt($session, CURLOPT_HEADER, 0); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Exécution de la session $response = curl_exec($session); /* Ici nous réceptionnons le tableau sérialisé de la requête */ $thumbc = unserialize($response);/* que nous "désérialisons" */ curl_close($session); /* Fermeture des ressources */ if ($thumbc["stat"]=='ok') /* Réponse correcte ? */ { /* On isole chaque élément du tableau des résultats (comprendre les images)… */ for ($i=0;$i<$thumbc["result"]["images"]["count"];$i++) { /* … Et pour chaque élément, on “charge” une variable $picture qui contiendra toutes les infos relatives à chaque image. * dans $picture nous avons : id, width, height, hit, file, name, comment, tn_url, element_url, date_creation, date_available, categories[page_url] */ $picture = $thumbc["result"]["images"]["_content"][$i]; } foreach ($picture as $picture) { $output .= '<a href="' . $picture->get('page_url') . 'title="' . '">' . '<img src="' . $picture->get('tn_url') . '" title="' . $picture->get('name') . '" /></a><span class="imgInfosCls">' . 'Hits :' . $picture->get('hit') . '<br />' . $picture->get('comment') . '<br />' . $picture->get('width') . '<br />' . $picture->get('height').'</span>'; /* $resourceArray = $resource->toArray(); $output .= $modx->getChunk($tpl,$resourceArray); */ } } else { $output = '<b>Il y a eu une erreur</b>. L\'url: <i>'. $url .'</i> n\'a pu être consultée.'; } return $output; } } return images($base_url,$ws,$format,$method,$options);
Fatal error: Call to a member function get() on a non-object in
. $picture->get('page_url') . 'title="' . '">' . '<img src="'
for ($i=0;$i<$thumbc["result"]["images"]["count"];$i++)
$picture->($categories['page_url'])
foreach ($resources as $resource) { $output .= '<li><a href="'.$modx->makeUrl($resource->get('id')).'">'.$resource->get('pagetitle').'</a></li>'; }
for ($i=0;$i<$thumbc["result"]["images"]["count"];$i++) /* (g) */ { $picture = $thumbc["result"]["images"]["_content"][$i]; /* (h) */
$HTML_txt = '<a href="http://www.monsite.com/magalerie/picture.php?/' . $picture['id'].'" title="'.$picture['name'].'">'.'<img src="' . $picture['tn_url'].'" alt="'.$picture['name'] . '" /></a><span class="caption">['.$picture['width'].'x' . $picture['height'].'] - '.'Hits : ' . $picture['hit'].'</span><br/>'; echo $HTML_txt;
… /* … Et pour chaque élément, on “charge” une variable $picture qui contiendra toutes les infos relatives à chaque image. * dans $picture nous avons : id, width, height, hit, file, name, comment, tn_url, element_url, date_creation, date_available, categories[page_url] */ $picture = $thumbc["result"]["images"]["_content"][$i]; } foreach ($picture as $picture) { $output .= '<a href="' . $picture['categories']['page_url'] . 'title="' . '">' . '<img src="' . $picture['tn_url'] . '" title="' . $picture['name'] . '" /></a><span class="imgInfosCls">' . 'Hits :' . $picture['hit'] . '<br />' . $picture['comment'] . '<br />' . $picture['width'] . '<br />' . $picture['height'].'</span>'; /* $resourceArray = $resource->toArray(); $output .= $modx->getChunk($tpl,$resourceArray); */ } …
Array ( [id] => 145 [width] => 640 [height] => 480 [hit] => 0 [file] => Roadtrip_011.jpg [name] => [comment] => [date_creation] => 2009-01-07 00:00:00 [date_available] => 2009-07-30 19:19:22 [tn_url] => http://galeries.aide-en-info.net/galleries/Photographie/Roadtrip/thumbnail/TN-Roadtrip_011.jpg [element_url] => http://galeries.aide-en-info.net/galleries/Photographie/Roadtrip/Roadtrip_011.jpg [categories] => Array ( [0] => Array ( [id] => 23 [url] => http://galeries.aide-en-info.net/index.php?/category/23 [page_url] => http://galeries.aide-en-info.net/picture.php?/145/category/23 ) ) )
Fatal error: Cannot use string offset as an array in /core/cache/includes/elements/modsnippet/36.include.cache.php on line 51
//$url_image = $picture['categories'][0]['page_url'] ; $url_tn = $picture['tn_url'] ; $name = $picture['name'] ; $hits = $picture['hit'] ; $comments = $picture['comment'] ; $width = $picture['width'] ; $height = $picture['height'] ; $output .= '<a href="'.$url_image.'" title="'.$name.'"><img src="'.$url_tn.'" title="'.$name.'"/></a><span class="imgInfosCls">Hits:'.$hits.'<br /></span>' ;
<a href="" title=""><img src="" title=""/></a><span class="imgInfosCls">Hits:<br /> </span><a href="" title=""><img src="" title=""/></a><span class="imgInfosCls">Hits:<br /> </span><a href="" title=""><img src="" title=""/></a><span class="imgInfosCls">Hits:<br /> </span><a href="" title=""><img src="" title=""/></a><span class="imgInfosCls">Hits:<br /> </span><a href="" title="R"><img src="R" title="R"/></a><span class="imgInfosCls">Hits:R<br /> </span><a href="" title=""><img src="" title=""/></a><span class="imgInfosCls">Hits:<br /> </span><a href="" title=""><img src="" title=""/></a><span class="imgInfosCls">Hits:<br /> </span><a href="" title="2"><img src="2" title="2"/></a><span class="imgInfosCls">Hits:2<br /> </span><a href="" title="2"><img src="2" title="2"/></a><span class="imgInfosCls">Hits:2<br /> </span><a href="" title="h"><img src="h" title="h"/></a><span class="imgInfosCls">Hits:h<br /> </span><a href="" title="h"><img src="h" title="h"/></a><span class="imgInfosCls">Hits:h<br /> </span><a href="" title=""><img src="" title=""/></a><span class="imgInfosCls">Hits:<br /></span>
Fatal error: Cannot use string offset as an array in modxR/core/cache/includes/elements/modsnippet/36.include.cache.php on line 51)