Last active
December 20, 2015 04:18
-
-
Save lildude/6069369 to your computer and use it in GitHub Desktop.
PHP code and phpZenfolio calls used in the Coin Slider example at http://phpzenfolio.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="slider" style="background-color:#fff;margin:0 auto;"> | |
<?php | |
if ( !class_exists( 'phpZenfolio' ) ) { | |
require_once( 'phpZenfolio/phpZenfolio.php' ); | |
} | |
$out = ''; | |
$f = new phpZenfolio( 'AppName=phpZenfolio Demo (http://phpzenfolio.com)' ); | |
$f->enableCache( 'type=fs', 'cache_dir='.HABARI_PATH . '/user/cache/', 'cache_expire=86400' ); | |
// Taken from the source of http://demo.zenfolio.com/ | |
$set = $f->LoadPhotoSet( 844670625, 'Level1', TRUE ); | |
foreach ( $set['Photos'] as $p ) { | |
try { | |
$c = $f->LoadPublicProfile( $p['Owner'] ); | |
$out .= '<a href="'.$p['PageUrl'].'" title="Visit Photo Page" target="_blank">'; | |
$out .= '<img src="'.phpZenfolio::imageUrl($p, 3).'" title="Copyright © '.$c['DisplayName'].'" />'; | |
$out .= '<span><span class="alignleft">'.$p['Title'].'</span>Copyright © '.$c['DisplayName'].'</span>'; | |
$out .= '</a>'; | |
} | |
catch ( Exception $e ) { | |
// This happens if the photo still exists, but the account has gone missing. | |
continue; | |
} | |
} | |
echo $out; | |
?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment