function srz_yt_album_shortcode($atts) { if (!isset($atts['id'])) { return 'Invalid shortcode... ID missing'; } $albumid = $atts['id']; $album = SrizonYTDB::GetAlbum($albumid); if (!$album) { return 'Album Not found. Check the shortcode'; } if (isset($_GET['debugsrzyt'])) { echo '<pre>'; print_r($album); echo '</pre>'; } $videos = srz_yt_get_album_api($album); $output = ''; if (isset($GLOBALS['scroller_id'])) { $GLOBALS['scroller_id']++; } else { $GLOBALS['scroller_id'] = 1; } $scroller_id = 'srizonytscroller' . $GLOBALS['scroller_id']; $paging_id = 'ytpage' . $GLOBALS['scroller_id']; if (is_array($videos)) { if (count($videos) > $album['totalvid']) { $videos = array_slice($videos, 0, $album['totalvid']); } if ($album['liststyle'] == 'fullpage') { include 'srizon-yt-album-fullpage.php'; } else { if ($album['liststyle'] == 'description') { include 'srizon-yt-album-description.php'; } else { if ($album['liststyle'] == 'respslider') { $output .= 'This layout is available on pro version only'; } } } } return $output; //else return 'will process album with id: '.$atts['id']. ' now!'; }
static function SyncAlbum($id) { $album = SrizonYTDB::GetAlbum($id); delete_transient(md5($album['api_id'])); }
function srz_yt_albums_sync() { if (isset($_GET['id'])) { SrizonYTDB::SyncAlbum($_GET['id']); } echo '<h2>Cached Data Deleted! Album will be synced on next load. There\'s a backup cache. In case the sync fails data will be loaded from backup cache.</h2>'; echo '<a href="admin.php?page=SrzYt-Albums">Go Back to Albums</a>'; }