get_results('SELECT date_sub( date( now( ) ) , INTERVAL ' . $from . ' MONTH ) as begin'); $from = $r[0]->begin; if (!empty($gallery['from'])) $options .= '&f_min_date_created=' . $from; $divclass = empty($gallery['divclass']) ? '' : (' class="' . $gallery['divclass'] .'"'); $class = empty($gallery['class']) ? '' : (' class="' . $gallery['class'] .'"'); $mbcategories = empty($gallery['mbcategories']) ? '' : $gallery['mbcategories']; $most_visited = empty($gallery['most_visited']) ? '' : $gallery['most_visited']; $best_rated = empty($gallery['best_rated']) ? '' : $gallery['best_rated']; $most_commented = empty($gallery['most_commented']) ? '' : $gallery['most_commented']; $random = empty($gallery['random']) ? '' : $gallery['random']; $recent_pics = empty($gallery['recent_pics']) ? '' : $gallery['recent_pics']; $calendar = empty($gallery['calendar']) ? '' : $gallery['calendar']; $tags = empty($gallery['tags']) ? '' : $gallery['tags']; $comments = empty($gallery['comments']) ? '' : $gallery['comments']; echo $before_widget; echo $title; if ($thumbnail == 'true') { // Make the Piwigo link $response = file_get_contents( $piwigo_url . 'ws.php?method=pwg.categories.getImages&format=php' . $options . '&recursive=true&order=random&f_with_thumbnail=true'); $thumbc = unserialize($response); if ($thumbc["stat"] == 'ok') { $pictures = $thumbc["result"]["images"]["_content"]; foreach ($pictures as $picture) { echo ''; } } } if ($mbcategories == 'true') { // Make the Piwigo category list $response = file_get_contents( $piwigo_url . 'ws.php?method=pwg.categories.getList&format=php&public=true'); $cats = unserialize($response); if ($cats["stat"] == 'ok') { echo ''; } } if ($most_visited == 'true' or $best_rated == 'true' or $most_commented == 'true' or $random == 'true' or $recent_pics == 'true' or $calendar == 'true' or $tags == 'true' or $comments == 'true') echo ''; echo $after_widget; ?>