function handleOption($option, $currentValue) { if ($option == "zenpage_homepage") { $unpublishedpages = query_full_array("SELECT titlelink FROM " . prefix('pages') . " WHERE `show` != 1 ORDER by `sort_order`"); if (empty($unpublishedpages)) { echo gettext("No unpublished pages available"); // clear option if no unpublished pages are available or have been published meanwhile // so that the normal gallery index appears and no page is accidentally set if set to unpublished again. setThemeOption('zenpage_homepage', 'none', NULL, 'zpEnlighten'); } else { echo '<input type="hidden" name="' . CUSTOM_OPTION_PREFIX . 'selector-zenpage_homepage" value="0" />' . "\n"; echo '<select id="' . $option . '" name="zenpage_homepage">' . "\n"; if ($currentValue === "none") { $selected = " selected = 'selected'"; } else { $selected = ""; } echo "<option{$selected}>" . gettext("none") . "</option>"; foreach ($unpublishedpages as $page) { if ($currentValue === $page["titlelink"]) { $selected = " selected = 'selected'"; } else { $selected = ""; } echo "<option{$selected}>" . $page["titlelink"] . "</option>"; } echo "</select>\n"; } } }
function __construct() { $me = basename(dirname(__FILE__)); setThemeOptionDefault('zenpage_zp_index_news', false); setThemeOptionDefault('Allow_search', true); setThemeOptionDefault('Use_thickbox', true); setThemeOptionDefault('zenpage_homepage', 'none'); setThemeOptionDefault('zenpage_contactpage', true); setThemeOptionDefault('zenpage_custommenu', false); setThemeOptionDefault('albums_per_page', 6); setThemeOptionDefault('albums_per_row', 2); setThemeOptionDefault('images_per_page', 20); setThemeOptionDefault('images_per_row', 5); setThemeOption('image_size', 580, NULL, 'zenpage'); setThemeOption('image_use_side', 'longest', NULL, 'zenpage'); setThemeOption('thumb_size', 95, NULL, 'zenpage'); setThemeOptionDefault('thumb_crop_width', 95); setThemeOptionDefault('thumb_crop_height', 95); setThemeOptionDefault('thumb_crop', 1); setThemeOptionDefault('thumb_transition', 1); if (extensionEnabled('zenpage')) { setThemeOption('custom_index_page', 'gallery', NULL, 'zenpage', false); } else { setThemeOption('custom_index_page', '', NULL, 'zenpage', false); } if (class_exists('cacheManager')) { cacheManager::deleteThemeCacheSizes($me); cacheManager::addThemeCacheSize($me, NULL, 580, 580, NULL, NULL, NULL, NULL, NULL, false, NULL, true); cacheManager::addThemeCacheSize($me, 95, NULL, NULL, getThemeOption('thumb_crop_width'), getThemeOption('thumb_crop_height'), NULL, NULL, true, NULL, NULL, NULL); } if (function_exists('createMenuIfNotExists')) { $menuitems = array(array('type' => 'menulabel', 'title' => gettext('News Articles'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All news'), 'link' => 'printAllNewsCategories("All news",TRUE,"","menu-active",false,false,false,"list",false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1), array('type' => 'menulabel', 'title' => gettext('Gallery'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'custompage', 'title' => gettext('Gallery index'), 'link' => 'gallery', 'show' => 1, 'nesting' => 1), array('type' => 'menufunction', 'title' => gettext('All Albums'), 'link' => 'printAlbumMenuList("list",NULL,"","menu-active","submenu","menu-active","",false,false,false,false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1), array('type' => 'menulabel', 'title' => gettext('Pages'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All pages'), 'link' => 'printPageMenu("list","","menu-active","submenu","menu-active","",0,false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1)); createMenuIfNotExists($menuitems, 'zenpage'); } }
function ThemeOptions() { setThemeOptionDefault('zenpage_zp_index_news', false); setThemeOptionDefault('Allow_search', true); setThemeOptionDefault('Use_thickbox', true); setThemeOptionDefault('zenpage_homepage', 'none'); setThemeOptionDefault('zenpage_contactpage', true); setThemeOptionDefault('zenpage_custommenu', false); setThemeOptionDefault('albums_per_row', 2); setThemeOptionDefault('images_per_row', 5); setThemeOptionDefault('thumb_transition', 1); setOptionDefault('zp_plugin_colorbox', 1); setOptionDefault('colorbox_zenpage_album', 1); setOptionDefault('colorbox_zenpage_image', 1); setOptionDefault('colorbox_zenpage_search', 1); if (getOption('zp_plugin_zenpage')) { setThemeOption('custom_index_page', 'gallery', NULL, NULL, false); } else { setThemeOption('custom_index_page', '', NULL, NULL, false); } if (function_exists('createMenuIfNotExists')) { $menuitems = array(array('type' => 'menulabel', 'title' => gettext('News Articles'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All news'), 'link' => 'printAllNewsCategories("All news",TRUE,"","menu-active",false,false,false,"list",false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1), array('type' => 'menulabel', 'title' => gettext('Gallery'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'custompage', 'title' => gettext('Gallery index'), 'link' => 'gallery', 'show' => 1, 'nesting' => 1), array('type' => 'menufunction', 'title' => gettext('All Albums'), 'link' => 'printAlbumMenuList("list",NULL,"","menu-active","submenu","menu-active","",false,false,false,false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1), array('type' => 'menulabel', 'title' => gettext('Pages'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All pages'), 'link' => 'printPageMenu("list","","menu-active","submenu","menu-active","",0,false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1)); createMenuIfNotExists($menuitems, 'zenpage'); } }
function ThemeOptions() { // force core theme options for this theme setThemeOption('albums_per_row', 3, null, 'libratus'); setThemeOption('images_per_row', 6, null, 'libratus'); setThemeOption('image_use_side', 'longest', null, 'libratus'); setThemeOptionDefault('image_size', 800, null, 'libratus'); setThemeOption('image_use_side', 'longest', null, 'libratus'); setThemeOption('thumb_size', 300, null, 'libratus'); // set core theme option defaults setThemeOptionDefault('albums_per_page', 15); setThemeOptionDefault('images_per_page', 30); setThemeOptionDefault('thumb_crop', false); // set libratus option defaults setThemeOptionDefault('libratus_maxwidth', '1400'); setThemeOptionDefault('libratus_ss_type', 'random'); setThemeOptionDefault('libratus_ss_album', ''); setThemeOptionDefault('libratus_ss_interval', 5000); setThemeOptionDefault('libratus_index_fullwidth', false); setThemeOptionDefault('libratus_date_albums', true); setThemeOptionDefault('libratus_date_images', true); setThemeOptionDefault('libratus_date_news', true); setThemeOptionDefault('libratus_date_pages', true); setThemeOptionDefault('libratus_social', true); setThemeOptionDefault('libratus_download', true); setThemeOptionDefault('libratus_customcss', ''); setThemeOptionDefault('libratus_facebook', ''); setThemeOptionDefault('libratus_twitter', ''); setThemeOptionDefault('libratus_google', ''); setThemeOptionDefault('libratus_copy', '© ' . date("Y")); setThemeOptionDefault('libratus_analytics', ''); setThemeOptionDefault('libratus_analytics_type', 'universal'); setThemeOptionDefault('libratus_stats_images_popular', true); setThemeOptionDefault('libratus_stats_images_latestbyid', true); setThemeOptionDefault('libratus_stats_images_mostrated', true); setThemeOptionDefault('libratus_stats_images_toprated', true); setThemeOptionDefault('libratus_stats_albums_popular', true); setThemeOptionDefault('libratus_stats_albums_latestbyid', true); setThemeOptionDefault('libratus_stats_albums_mostrated', true); setThemeOptionDefault('libratus_stats_albums_toprated', true); setThemeOptionDefault('libratus_stats_albums_latestupdated', true); setThemeOptionDefault('libratus_stats_number', 30); setThemeOptionDefault('libratus_bottom_stats_number', 5); setThemeOptionDefault('libratus_bottom_stats_perrow', 3); setThemeOptionDefault('libratus_stats_images_popular_bottom', true); setThemeOptionDefault('libratus_stats_images_latestbyid_bottom', true); setThemeOptionDefault('libratus_stats_images_toprated_bottom', true); setThemeOptionDefault('libratus_related_maxnumber', 10); if (class_exists('cacheManager')) { $me = basename(dirname(__FILE__)); cacheManager::deleteThemeCacheSizes($me); cacheManager::addThemeCacheSize($me, getThemeOption('image_size'), NULL, NULL, NULL, NULL, NULL, NULL, false, getOption('fullimage_watermark'), NULL, NULL); // full image size cacheManager::addThemeCacheSize($me, getThemeOption('thumb_size'), NULL, NULL, NULL, NULL, NULL, NULL, true, getOption('Image_watermark'), NULL, NULL); // default thumb cacheManager::addThemeCacheSize($me, NULL, getThemeOption('libratus_maxwidth'), 550, NULL, NULL, NULL, NULL, true, getOption('Image_watermark'), NULL, NULL); //big header images } }
function __construct() { // force core theme options for this theme setThemeOption('albums_per_row', 2, null, 'zpfocus'); setThemeOption('images_per_row', 3, null, 'zpfocus'); setThemeOption('thumb_size', 160, null, 'zpfocus'); setThemeOption('thumb_crop', 0, null, 'zpfocus'); setThemeOption('image_size', 800, null, 'zpfocus'); //for sized cb target option only setThemeOption('image_use_side', 'longest', null, 'zpfocus'); setThemeOption('custom_index_page', '', null, 'zpfocus'); // set core theme option defaults setThemeOptionDefault('albums_per_page', 6); setThemeOptionDefault('images_per_page', 9); setThemeOptionDefault('thumb_transition', 2); // set theme option defaults $str = ''; setOptionDefault('zpfocus_tagline', getAllTranslations($str)); gettext($str = 'A ZenPhoto / ZenPage Powered Theme'); setThemeOptionDefault('zpfocus_allow_search', true); setThemeOptionDefault('zpfocus_show_archive', true); setThemeOptionDefault('zpfocus_use_colorbox', true); setThemeOptionDefault('zpfocus_use_colorbox_slideshow', true); setThemeOptionDefault('zpfocus_homepage', 'none'); setThemeOptionDefault('zpfocus_spotlight', 'manual'); setOptionDefault('zpfocus_spotlight_text', getAllTranslations($str)); gettext($str = '<p>This is the <span class="spotlight-span">spotlight</span> area that can be set in the theme options. You can either enter the text manually in the options or set it to display the latest news if ZenPage is being used. If you want nothing to appear here, set the spotlight to none.</p>'); setThemeOptionDefault('zpfocus_show_credit', false); setThemeOptionDefault('zpfocus_menutype', 'dropdown'); setThemeOptionDefault('zpfocus_logotype', true); setThemeOptionDefault('zpfocus_logofile', 'logo.jpg'); setThemeOptionDefault('zpfocus_showrandom', 'rotator'); setThemeOptionDefault('zpfocus_rotatoreffect', 'fade'); setThemeOptionDefault('zpfocus_rotatorspeed', '3000'); setThemeOptionDefault('zpfocus_cbtarget', true); setThemeOptionDefault('zpfocus_cbstyle', 'example3'); setThemeOptionDefault('zpfocus_cbtransition', 'fade'); setThemeOptionDefault('zpfocus_cbssspeed', '2500'); setThemeOptionDefault('zpfocus_final_link', 'nolink'); setThemeOptionDefault('zpfocus_news', true); // plugin options setOptionDefault('jcarousel_zpfocus_image', 1); if (class_exists('cacheManager')) { cacheManager::deleteThemeCacheSizes('zpfocus'); cacheManager::addThemeCacheSize('zpfocus', null, 600, 900, null, null, null, null, false, getOption('fullimage_watermark'), false, true); cacheManager::addThemeCacheSize('zpfocus', null, 300, 300, 300, 300, null, null, true, getOption('fullimage_watermark'), false, false); if (getOption('zpfocus_use_colorbox') && getOption('zpfocus_cbtarget')) { cacheManager::addThemeCacheSize('zpfocus', 800, null, null, null, null, null, null, false, getOption('fullimage_watermark'), false, false); } } }
function __construct() { $me = basename(dirname(__FILE__)); setThemeOptionDefault('Theme_logo', ''); setThemeOptionDefault('Allow_search', true); setThemeOptionDefault('Slideshow', true); setThemeOptionDefault('Graphic_logo', '*'); setThemeOptionDefault('Watermark_head_image', true); setThemeOptionDefault('effervescence_personality', 'image_page'); setThemeOptionDefault('effervescence_transition', 'slide-hori'); setThemeOptionDefault('effervescence_caption_location', 'image'); setThemeOptionDefault('Theme_colors', 'kish-my father'); setThemeOptionDefault('effervescence_menu', ''); setThemeOptionDefault('albums_per_page', 9); setThemeOptionDefault('albums_per_row', 3); setThemeOptionDefault('images_per_page', 20); setThemeOptionDefault('images_per_row', 5); setThemeOption('image_size', 595, NULL, 'effervescence+'); setThemeOption('image_use_side', 'longest', NULL, 'effervescence+'); setThemeOptionDefault('thumb_transition', 1); setThemeOptionDefault('thumb_size', 90); setThemeOptionDefault('thumb_crop_width', 90); setThemeOptionDefault('thumb_crop_height', 90); setThemeOptionDefault('thumb_crop', 1); setThemeOptionDefault('gallery_index', 1); setThemeOptionDefault('effervescence_daily_album_image', 1); setThemeOptionDefault('effervescence_daily_album_image_effect', ''); setOptionDefault('colorbox_' . $me . '_album', 1); setOptionDefault('colorbox_' . $me . '_favorites', 1); setOptionDefault('colorbox_' . $me . '_image', 1); setOptionDefault('colorbox_' . $me . '_search', 1); if (class_exists('cacheManager')) { cacheManager::deleteThemeCacheSizes($me); cacheManager::addThemeCacheSize($me, 595, NULL, NULL, NULL, NULL, NULL, NULL, false, NULL, NULL, NULL); cacheManager::addThemeCacheSize($me, getThemeOption('thumb_size'), NULL, NULL, getThemeOption('thumb_crop_width'), getThemeOption('thumb_crop_height'), NULL, NULL, true, NULL, NULL, NULL); cacheManager::addThemeCacheSize($me, NULL, 180, 80, NUll, NULL, NULL, NULL, true, NULL, NULL, NULL); } if (function_exists('createMenuIfNotExists')) { $menuitems = array(array('type' => 'menulabel', 'title' => gettext('News Articles'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All news'), 'link' => 'printAllNewsCategories("All news",TRUE,"","menu-active",false,false,false,"list",false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1), array('type' => 'html', 'title' => gettext('News Articles Rule'), 'link' => '<li class="menu_rule menu_menulabel"></li>', 'show' => 1, 'include_li' => 0, 'nesting' => 0), array('type' => 'custompage', 'title' => gettext('Gallery'), 'link' => 'gallery', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All Albums'), 'link' => 'printAlbumMenuList("list",NULL,"","menu-active","submenu","menu-active","",false,false,false,false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1), array('type' => 'html', 'title' => gettext('Gallery Rule'), 'link' => '<li class="menu_rule menu_menulabel"></li>', 'show' => 1, 'include_li' => 0, 'nesting' => 0), array('type' => 'menulabel', 'title' => gettext('Pages'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All pages'), 'link' => 'printPageMenu("list","","menu-active","submenu","menu-active","",0,false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1, getOption("menu_manager_truncate_string")), array('type' => 'html', 'title' => gettext('Pages Rule'), 'link' => '<li class="menu_rule menu_menulabel"></li>', 'show' => 1, 'include_li' => 0, 'nesting' => 0), array('type' => 'menulabel', 'title' => gettext('Archive'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'custompage', 'title' => gettext('Gallery and News'), 'link' => 'archive', 'show' => 1, 'nesting' => 1), array('type' => 'html', 'title' => gettext('Archive Rule'), 'link' => '<li class="menu_rule menu_menulabel"></li>', 'show' => 1, 'include_li' => 0, 'nesting' => 0)); if (extensionEnabled('rss')) { $rssItems = array(array('type' => 'menulabel', 'title' => gettext('RSS'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'customlink', 'title' => gettext('Gallery'), 'link' => WEBPATH . '/index.php?rss', 'show' => 1, 'nesting' => 1), array('type' => 'customlink', 'title' => gettext('News'), 'link' => getRSSLink('news'), 'show' => 1, 'nesting' => 1), array('type' => 'customlink', 'title' => gettext('News and Gallery'), 'link' => getRSSLink('news') . '&withimages', 'show' => 1, 'nesting' => 1)); $menuitems = array_merge($menuitems, $rssItems); } createMenuIfNotExists($menuitems, 'effervescence'); } }
function __construct() { $me = basename(dirname(__FILE__)); setThemeOptionDefault('Allow_search', true); setThemeOptionDefault('Allow_cloud', true); setThemeOptionDefault('albums_per_page', 6); setThemeOptionDefault('albums_per_row', 2); setThemeOptionDefault('images_per_page', 20); setThemeOptionDefault('images_per_row', 5); setThemeOption('image_size', 520, NULL, 'garland'); setThemeOption('image_use_side', 'longest', NULL, 'garland'); setThemeOptionDefault('thumb_transition', 1); setThemeOption('thumb_size', 85, NULL, 'garland'); setThemeOptionDefault('thumb_crop_width', 85); setThemeOptionDefault('thumb_crop_height', 85); setThemeOptionDefault('thumb_crop', 1); setThemeOptionDefault('garland_customHome', ''); setThemeOptionDefault('garland_personality', 'image_page'); setThemeOptionDefault('garland_transition', 'slide-hori'); setThemeOptionDefault('garland_caption_location', 'image'); setOptionDefault('colorbox_' . $me . '_image', 1); setOptionDefault('colorbox_' . $me . '_album', 1); setOptionDefault('colorbox_' . $me . '_search', 1); setThemeOptionDefault('garland_menu', ''); if (extensionEnabled('zenpage')) { setThemeOption('custom_index_page', 'gallery', NULL, 'garland', false); } else { setThemeOption('custom_index_page', '', NULL, 'garland', false); } if (class_exists('cacheManager')) { $me = basename(dirname(__FILE__)); cacheManager::deleteThemeCacheSizes($me); cacheManager::addThemeCacheSize($me, 520, NULL, NULL, NULL, NULL, NULL, NULL, false, NULL, NULL, NULL); cacheManager::addThemeCacheSize($me, 85, NULL, NULL, getThemeOption('thumb_crop_width'), getThemeOption('thumb_crop_height'), NULL, NULL, true, NULL, NULL, NULL); } if (function_exists('createMenuIfNotExists')) { $menuitems = array(array('type' => 'menulabel', 'title' => gettext('News Articles'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All news'), 'link' => 'printAllNewsCategories("All news",TRUE,"","menu-active",false,"inner_ul",false,"list",false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1), array('type' => 'html', 'title' => gettext('News Articles Rule'), 'link' => '<li class="menu_rule menu_menulabel"></li>', 'show' => 1, 'include_li' => 0, 'nesting' => 0), array('type' => 'custompage', 'title' => gettext('Gallery'), 'link' => 'gallery', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All Albums'), 'link' => 'printAlbumMenuList("list",NULL,"","menu-active","inner_ul","menu-active","",false,false,false,false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1), array('type' => 'html', 'title' => gettext('Gallery Rule'), 'link' => '<li class="menu_rule menu_menulabel"></li>', 'show' => 1, 'include_li' => 0, 'nesting' => 0), array('type' => 'menulabel', 'title' => gettext('Pages'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All pages'), 'link' => 'printPageMenu("list","","menu-active","inner_ul","menu-active","",0,false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1, getOption("menu_manager_truncate_string")), array('type' => 'html', 'title' => gettext('Pages Rule'), 'link' => '<li class="menu_rule menu_menulabel"></li>', 'show' => 1, 'include_li' => 0, 'nesting' => 0)); createMenuIfNotExists($menuitems, 'garland'); } }
function ThemeOptions() { // force core theme options for this theme setThemeOption('albums_per_row', 3, null, 'zpskeleton'); setThemeOption('images_per_row', 8, null, 'zpskeleton'); setThemeOption('thumb_size', 220, null, 'zpskeleton'); setThemeOption('image_size', 630, null, 'zpskeleton'); setThemeOption('image_use_side', 'longest', null, 'zpskeleton'); setThemeOption('custom_index_page', 'none', null, 'zpskeleton'); // set core theme option defaults setThemeOptionDefault('albums_per_page', 6); setThemeOptionDefault('images_per_page', 9); setThemeOptionDefault('thumb_transition', 2); setThemeOptionDefault('thumb_crop', 0); // set theme option defaults setThemeOptionDefault('zpskel_usenews', true); setThemeOptionDefault('zpskel_debuguser', false); setThemeOptionDefault('zpskel_disablewarning', false); setThemeOptionDefault('zpskel_pptarget', 'sized'); setThemeOptionDefault('zpskel_strip', 'latest'); setThemeOptionDefault('zpskel_thumbsize', 'large'); setThemeOptionDefault('zpskel_download', true); setThemeOptionDefault('zpskel_archive', true); setThemeOptionDefault('zenpage_homepage', 'none'); if (class_exists('cacheManager')) { cacheManager::deleteThemeCacheSizes('zpskeleton'); cacheManager::addThemeCacheSize('zpskeleton', null, 420, 200, 420, 200, null, null, null, true, getOption('Image_watermark'), false, false); // album thumbs cacheManager::addThemeCacheSize('zpskeleton', 220, null, null, null, null, null, null, true, getOption('Image_watermark'), false, false); // image thumbs: uncropped large cacheManager::addThemeCacheSize('zpskeleton', 190, null, null, null, null, null, null, true, getOption('Image_watermark'), false, false); // image thumbs: uncropped small cacheManager::addThemeCacheSize('zpskeleton', null, 190, 190, 190, 190, null, null, true, getOption('Image_watermark'), false, false); // bottom image strip cacheManager::addThemeCacheSize('zpskeleton', 420, null, null, null, null, null, null, false, getOption('fullimage_watermark'), null, null); // mobile full cacheManager::addThemeCacheSize('zpskeleton', 630, null, null, null, null, null, null, false, getOption('fullimage_watermark'), null, null); // desktop full } }
function __construct() { $me = basename(dirname(__FILE__)); setThemeOptionDefault('Allow_search', true); setThemeOptionDefault('thumb_transition', 1); setThemeOption('thumb_size', 79, NULL, 'zpmobile'); setThemeOptionDefault('thumb_crop_width', 79); setThemeOptionDefault('thumb_crop_height', 79); setThemeOptionDefault('thumb_crop', 1); setThemeOptionDefault('albums_per_page', 6); setThemeOptionDefault('albums_per_row', 1); setThemeOptionDefault('images_per_page', 24); setThemeOptionDefault('images_per_row', 6); setOptionDefault('colorbox_zpmobile_album', 1); setOptionDefault('colorbox_zpmobile_favorites', 1); setOptionDefault('colorbox_zpmobile_image', 1); setOptionDefault('colorbox_zpmobilet_search', 1); if (class_exists('cacheManager')) { cacheManager::deleteThemeCacheSizes('zpMobile'); cacheManager::addThemeCacheSize('zpMobile', NULL, 79, 79, 79, 79, NULL, NULL, true, NULL, NULL, NULL); } }
function ThemeOptions() { setThemeOptionDefault('Allow_search', true); setThemeOptionDefault('Allow_cloud', true); setThemeOptionDefault('albums_per_row', 2); setThemeOptionDefault('images_per_row', 5); setThemeOptionDefault('thumb_transition', 1); setThemeOptionDefault('thumb_size', 85); setOptionDefault('colorbox_garland_image', 1); setOptionDefault('colorbox_garland_album', 1); setOptionDefault('colorbox_garland_search', 1); setThemeOptionDefault('garland_menu', ''); if (getOption('zp_plugin_zenpage')) { setThemeOption('custom_index_page', 'gallery', NULL, NULL, false); } else { setThemeOption('custom_index_page', '', NULL, NULL, false); } if (function_exists('createMenuIfNotExists')) { $menuitems = array(array('type' => 'menulabel', 'title' => gettext('News Articles'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All news'), 'link' => 'printAllNewsCategories("All news",TRUE,"","menu-active",false,"inner_ul",false,"list",false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1), array('type' => 'html', 'title' => gettext('News Articles Rule'), 'link' => '<li class="menu_rule menu_menulabel"></li>', 'show' => 1, 'include_li' => 0, 'nesting' => 0), array('type' => 'custompage', 'title' => gettext('Gallery'), 'link' => 'gallery', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All Albums'), 'link' => 'printAlbumMenuList("list",NULL,"","menu-active","inner_ul","menu-active","",false,false,false,false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1), array('type' => 'html', 'title' => gettext('Gallery Rule'), 'link' => '<li class="menu_rule menu_menulabel"></li>', 'show' => 1, 'include_li' => 0, 'nesting' => 0), array('type' => 'menulabel', 'title' => gettext('Pages'), 'link' => '', 'show' => 1, 'nesting' => 0), array('type' => 'menufunction', 'title' => gettext('All pages'), 'link' => 'printPageMenu("list","","menu-active","inner_ul","menu-active","",0,false,getOption("menu_manager_truncate_string"));', 'show' => 1, 'include_li' => 0, 'nesting' => 1, getOption("menu_manager_truncate_string")), array('type' => 'html', 'title' => gettext('Pages Rule'), 'link' => '<li class="menu_rule menu_menulabel"></li>', 'show' => 1, 'include_li' => 0, 'nesting' => 0)); createMenuIfNotExists($menuitems, 'garland'); } }
// Check some settings $zenpage = extensionEnabled('zenpage'); if (getOption('zpbase_newsname') == '') { $newsname = gettext('News'); } else { $newsname = getOption('zpbase_newsname'); } $image_page = 'popup'; $galleryactive = ''; $layoutbodyclass = ''; $sspage = false; $objectclass = ''; $rss_option = null; $rss_title = null; // tinymce input not good for responsiveness...overkill anyway. setThemeOption('tinymce4_comments', false, null, 'zpbase'); function my_checkPageValidity($request, $gallery_page, $page) { switch ($gallery_page) { case 'gallery.php': $gallery_page = 'index.php'; // same as an album gallery index break; case 'index.php': if (!extensionEnabled('zenpage') || getOption('zbase_indexlayout') != 'news') { // only one index page if zenpage plugin is enabled & displaying break; } default: if ($page != 1) { return false;
setOptionDefault('RSS_comments', 1); setOptionDefault('RSS_articles', 1); setOptionDefault('RSS_pages', 1); setOptionDefault('RSS_article_comments', 1); setOptionDefault('AlbumThumbSelect', 1); setOptionDefault('site_email', "zenphoto@" . $_SERVER['SERVER_NAME']); setOptionDefault('site_email_name', 'ZenPhoto20'); //effervescence_plus migration if (file_exists(SERVERPATH . '/' . THEMEFOLDER . '/effervescence_plus')) { if ($_zp_gallery->getCurrentTheme() == 'effervescence_plus') { $_zp_gallery->setCurrentTheme('effervescence+'); $_zp_gallery->save(); } $options = query_full_array('SELECT LCASE(`name`) as name, `value` FROM ' . prefix('options') . ' WHERE `theme`="effervescence_plus"'); foreach ($options as $option) { setThemeOption($option['name'], $option['value'], NULL, 'effervescence+', true); } zpFunctions::removeDir(SERVERPATH . '/' . THEMEFOLDER . '/effervescence_plus'); } ?> <p> <?php $deprecate = false; $themes = array_keys($_zp_gallery->getThemes()); natcasesort($themes); echo gettext('Theme setup:') . '<br />'; foreach ($themes as $key => $theme) { if (protectedTheme($theme)) { unset($themes[$key]); } else { $deprecate = true;
/** * Returns a randomly selected image from the album or one of its subalbums * if the album has no images. * (May return NULL if no images found) * * @param mixed $rootAlbum optional album object/folder from which to get the image. * @param bool $daily set to true to change picture only once a day. * * @return object */ function getRandomImagesAlbum($rootAlbum = NULL, $daily = false) { global $_zp_current_album, $_zp_gallery, $_zp_current_search; if (empty($rootAlbum)) { $album = $_zp_current_album; } else { if (is_object($rootAlbum)) { $album = $rootAlbum; } else { $album = newAlbum($rootAlbum); } } if ($daily && ($potd = getOption('picture_of_the_day:' . $album->name))) { $potd = getSerializedArray($potd); if (date('Y-m-d', $potd['day']) == date('Y-m-d')) { $rndalbum = newAlbum($potd['folder']); $image = newImage($rndalbum, $potd['filename']); if ($image->exists) { return $image; } } } $album->setSortType('random'); $image = $album->getImage(0); if (!$image) { $album->setSortType('random', 'album'); foreach ($album->getAlbums() as $subalbum) { if ($image = getRandomImagesAlbum($subalbum)) { break; } } } if ($image && $image->exists) { if ($daily) { $potd = array('day' => time(), 'folder' => $image->getAlbumName(), 'filename' => $image->getFileName()); setThemeOption('picture_of_the_day:' . $album->name, serialize($potd), NULL, $_zp_gallery->getCurrentTheme()); } return $image; } return NULL; }
function processCustomOptionSave($returntab, $themename = NULL, $themealbum = NULL) { foreach ($_POST as $postkey => $value) { if (preg_match('/^' . CUSTOM_OPTION_PREFIX . '/', $postkey)) { // custom option! $key = substr($postkey, strpos($postkey, '-') + 1); $switch = substr($postkey, strlen(CUSTOM_OPTION_PREFIX), -strlen($key) - 1); switch ($switch) { case 'text': $value = process_language_string_save($key, 1); break; case 'cleartext': if (isset($_POST[$key])) { $value = sanitize($_POST[$key], 0); } else { $value = ''; } break; case 'chkbox': $value = (int) isset($_POST[$key]); break; default: if (isset($_POST[$key])) { $value = sanitize($_POST[$key], 1); } else { $value = ''; } break; } if ($themename) { setThemeOption($key, $value, $themealbum, $themename); } else { setOption($key, $value); } } else { if (strpos($postkey, 'show-') === 0) { if ($value) { $returntab .= '&' . $postkey; } } } } return $returntab; }
if ($prevRel < 1690) { // cleanup root album DB records $gallery->garbageCollect(true, true); } // 1.1.7 conversion to the theme option tables $albums = $gallery->getAlbums(); foreach ($albums as $albumname) { $album = new Album($gallery, $albumname); $theme = $album->getAlbumTheme(); if (!empty($theme)) { $tbl = prefix(getOptionTableName($album->name)); $sql = "SELECT `name`,`value` FROM " . $tbl; $result = query_full_array($sql, true); if (is_array($result)) { foreach ($result as $row) { setThemeOption($album, $row['name'], $row['value']); } } query('DROP TABLE ' . $tbl, true); } } // 1.2 force up-convert to tag tables $convert = false; $result = query_full_array("SHOW COLUMNS FROM " . prefix('images') . ' LIKE "%tags%"'); if (is_array($result)) { foreach ($result as $row) { if ($row['Field'] == 'tags') { $convert = true; break; } }
function ThemeOptions() { // force core theme options for this theme setThemeOption('thumb_size', 168, null, 'zpmasonry'); setThemeOption('thumb_crop', 1, null, 'zpmasonry'); setThemeOption('image_use_side', 'longest', null, 'zpmasonry'); setThemeOption('custom_index_page', 'none', null, 'zpmasonry'); // set core theme option defaults setThemeOptionDefault('image_size', 1200); setThemeOptionDefault('albums_per_row', 6); setThemeOptionDefault('images_per_row', 9); setThemeOptionDefault('albums_per_page', 16); setThemeOptionDefault('images_per_page', 32); setThemeOptionDefault('thumb_transition', 2); // set theme option defaults setOptionDefault('zpmas_usenews', true); setOptionDefault('zpmas_css', 'dark'); setOptionDefault('zpmas_logo', ''); setOptionDefault('zpmas_logoheight', ''); setOptionDefault('zpmas_zpsearchcount', 2); setOptionDefault('zpmas_finallink', 'nolink'); setOptionDefault('zpmas_disablemeta', false); setOptionDefault('zpmas_imagetitle', false); setOptionDefault('zpmas_thumbsize', 'small'); setOptionDefault('zpmas_thumbcrop', true); setOptionDefault('zpmas_infscroll', true); setOptionDefault('zpmas_fixsidebar', true); setOptionDefault('zpmas_cbtarget', true); setOptionDefault('zpmas_cbstyle', 'example3'); setOptionDefault('zpmas_cbtransition', 'fade'); setOptionDefault('zpmas_cbssspeed', '2500'); setOptionDefault('zpmas_ss', true); setOptionDefault('zpmas_sstype', 'random'); setOptionDefault('zpmas_sscount', 5); setOptionDefault('zpmas_sseffect', 'fade'); setOptionDefault('zpmas_ssspeed', '4000'); setOptionDefault('jcarousel_zpmasonry_image', 1); if (class_exists('cacheManager')) { cacheManager::deleteThemeCacheSizes('zpmasonry'); cacheManager::addThemeCacheSize('zpmasonry', null, 108, 108, 108, 108, null, null, null, true, getOption('Image_watermark'), false, false); // image thumbs - small cacheManager::addThemeCacheSize('zpmasonry', null, 248, 248, 248, 248, null, null, true, getOption('Image_watermark'), false, false); // album thumbs - small - square cacheManager::addThemeCacheSize('zpmasonry', null, 248, 125, 248, 125, null, null, true, getOption('Image_watermark'), false, false); // album thumbs - small - landscape cacheManager::addThemeCacheSize('zpmasonry', null, 528, 528, 528, 528, null, null, true, getOption('Image_watermark'), false, false); // fp slideshow - small - square cacheManager::addThemeCacheSize('zpmasonry', null, 528, 270, 528, 270, null, null, true, getOption('Image_watermark'), false, false); // fp slideshow - small - landscape cacheManager::addThemeCacheSize('zpmasonry', null, 168, 168, 168, 168, null, null, null, true, getOption('Image_watermark'), false, false); // image thumbs - large cacheManager::addThemeCacheSize('zpmasonry', null, 368, 368, 368, 368, null, null, true, getOption('Image_watermark'), false, false); // album thumbs - large - square cacheManager::addThemeCacheSize('zpmasonry', null, 368, 200, 368, 200, null, null, true, getOption('Image_watermark'), false, false); // album thumbs - large - landscape cacheManager::addThemeCacheSize('zpmasonry', null, 768, 768, 768, 768, null, null, true, getOption('Image_watermark'), false, false); // fp slideshow - large - square cacheManager::addThemeCacheSize('zpmasonry', null, 768, 360, 768, 360, null, null, true, getOption('Image_watermark'), false, false); // fp slideshow - large - landscape cacheManager::addThemeCacheSize('zpmasonry', 1200, null, null, null, null, null, null, false, getOption('fullimage_watermark'), null, null); // full image } }
function ThemeOptions() { // force core theme options for this theme setThemeOption('albums_per_row', 3, null, 'zpbase'); setThemeOption('images_per_row', 3, null, 'zpbase'); setThemeOption('image_use_side', 'longest', null, 'zpbase'); // set core theme option defaults setThemeOptionDefault('albums_per_page', 6); setThemeOptionDefault('images_per_page', 12); setThemeOptionDefault('thumb_crop', false); // set zpbase option defaults setThemeOptionDefault('zpbase_pnglogo', ''); setThemeOptionDefault('zpbase_style', 'light'); setThemeOptionDefault('zpbase_maxwidth', '960'); setThemeOptionDefault('zpbase_verticalscale', true); setThemeOptionDefault('zpbase_align', 'center'); setThemeOptionDefault('zpbase_date_albums', true); setThemeOptionDefault('zpbase_date_images', true); setThemeOptionDefault('zpbase_date_news', true); setThemeOptionDefault('zpbase_date_pages', true); setThemeOptionDefault('zpbase_social', true); setThemeOptionDefault('zpbase_download', true); setThemeOptionDefault('zpbase_selectmenu', 'chosen'); setThemeOptionDefault('zpbase_indexlayout', 'index-grid'); setThemeOptionDefault('zpbase_galleryishome', true); setThemeOptionDefault('zpbase_defaultalbum', 'album-grid'); setThemeOptionDefault('zpbase_newsstyle', 'masonry-style'); setThemeOptionDefault('zpbase_searchlayout', 'search-masonry'); setThemeOptionDefault('zpbase_usenews', true); setThemeOptionDefault('zpbase_newsname', ''); setThemeOptionDefault('zpbase_archive', true); setThemeOptionDefault('zpbase_iscrollbehavior', 'manual-first'); setThemeOptionDefault('zpbase_galss', true); setThemeOptionDefault('zpbase_galclicknext', false); setThemeOptionDefault('zpbase_galcropop', 'landscape'); setThemeOptionDefault('zpbase_galpan', false); setThemeOptionDefault('zpbase_galcaption', false); setThemeOptionDefault('zpbase_galhomeop', 'albums'); setThemeOptionDefault('zpbase_galhomecount', 30); setThemeOptionDefault('zpbase_galautoplay', false); setThemeOptionDefault('zpbase_galinterval', '4000'); setThemeOptionDefault('zpbase_galtrans', 'fadeslide'); setThemeOptionDefault('zpbase_galtranspeed', '400'); setThemeOptionDefault('zpbase_galhistory', true); setThemeOptionDefault('zpbase_galbigsize', 1200); setThemeOptionDefault('zpbase_googlefont1', ''); setThemeOptionDefault('zpbase_googlefont2', ''); setThemeOptionDefault('zpbase_fontsize', '12'); setThemeOptionDefault('zpbase_customcss', ''); setThemeOptionDefault('zpbase_bg', ''); setThemeOptionDefault('zpbase_facebook', ''); setThemeOptionDefault('zpbase_twitter', ''); setThemeOptionDefault('zpbase_google', ''); setThemeOptionDefault('zpbase_copy', '© ' . date("Y")); setThemeOptionDefault('zpbase_cbtarget', true); setThemeOptionDefault('zpbase_nodetailpage', false); setThemeOptionDefault('zpbase_disqus', false); setThemeOptionDefault('zpbase_disqus_shortname', ''); setThemeOptionDefault('zpbase_disqus_comment_form_albums', true); setThemeOptionDefault('zpbase_disqus_comment_form_images', true); setThemeOptionDefault('zpbase_disqus_comment_form_pages', false); setThemeOptionDefault('zpbase_disqus_comment_form_articles', true); setThemeOptionDefault('zpbase_magnific_grid', false); setThemeOptionDefault('zpbase_magnific_masonry', true); setThemeOptionDefault('zpbase_magnific_sds', true); setThemeOptionDefault('zpbase_magnific_target', 'image'); setThemeOptionDefault('zpbase_mobiletogrid', true); setThemeOptionDefault('zpbase_sds_maxheight', 500); setThemeOptionDefault('zpbase_sds_pagination', 'paginate'); setThemeOptionDefault('zpbase_analytics', ''); setThemeOptionDefault('zpbase_analytics_type', 'universal'); // set image sizes based on maxwidth setThemeOption('image_size', round(getOption('zpbase_maxwidth')), null, 'zpbase'); setThemeOption('thumb_size', round(0.31 * getOption('zpbase_maxwidth')), null, 'zpbase'); if (class_exists('cacheManager')) { $me = basename(dirname(__FILE__)); cacheManager::deleteThemeCacheSizes($me); cacheManager::addThemeCacheSize($me, getThemeOption('image_size'), NULL, NULL, NULL, NULL, NULL, NULL, false, getOption('fullimage_watermark'), NULL, NULL); // full image size cacheManager::addThemeCacheSize($me, getThemeOption('thumb_size'), NULL, NULL, NULL, NULL, NULL, NULL, true, getOption('Image_watermark'), NULL, NULL); // default thumb cacheManager::addThemeCacheSize($me, getThemeOption('zpbase_galbigsize'), NULL, NULL, NULL, NULL, NULL, NULL, false, getOption('fullimage_watermark'), NULL, NULL); //slideshow big image cacheManager::addThemeCacheSize($me, NULL, NULL, getOption('zpbase_sds_maxheight'), NULL, NULL, NULL, NULL, true, getOption('Image_watermark'), NULL, NULL); //sds layout image } }
/** * Returns a randomly selected image from the album or its subalbums. (May be NULL if none exists) * * @param mixed $rootAlbum optional album object/folder from which to get the image. * @param bool $daily set to true to change picture only once a day. * * @return object */ function getRandomImagesAlbum($rootAlbum = NULL, $daily = false) { global $_zp_current_album, $_zp_gallery, $_zp_current_search; if (empty($rootAlbum)) { $album = $_zp_current_album; } else { if (is_object($rootAlbum)) { $album = $rootAlbum; } else { $album = newAlbum($rootAlbum); } } if ($daily && ($potd = getOption('picture_of_the_day:' . $album->name))) { $potd = getSerializedArray($potd); if (date('Y-m-d', $potd['day']) == date('Y-m-d')) { $rndalbum = newAlbum($potd['folder']); $image = newImage($rndalbum, $potd['filename']); if ($image->exists) { return $image; } } } $image = NULL; if ($album->isDynamic()) { $images = $album->getImages(0); shuffle($images); while (count($images) > 0) { $result = array_pop($images); if (Gallery::validImage($result['filename'])) { $image = newImage(newAlbum($result['folder']), $result['filename']); } } } else { $albumfolder = $album->getFileName(); if ($album->isMyItem(LIST_RIGHTS)) { $imageWhere = ''; $albumInWhere = ''; } else { $imageWhere = " AND " . prefix('images') . ".show=1"; $albumInWhere = prefix('albums') . ".show=1"; } $query = "SELECT id FROM " . prefix('albums') . " WHERE "; if ($albumInWhere) { $query .= $albumInWhere . ' AND '; } $query .= "folder LIKE " . db_quote(db_LIKE_escape($albumfolder) . '%'); $result = query($query); if ($result) { $albumInWhere = prefix('albums') . ".id IN ("; while ($row = db_fetch_assoc($result)) { $albumInWhere = $albumInWhere . $row['id'] . ", "; } db_free_result($result); $albumInWhere = ' AND ' . substr($albumInWhere, 0, -2) . ')'; $sql = 'SELECT `folder`, `filename` ' . ' FROM ' . prefix('images') . ', ' . prefix('albums') . ' WHERE ' . prefix('albums') . '.folder!="" AND ' . prefix('images') . '.albumid = ' . prefix('albums') . '.id ' . $albumInWhere . $imageWhere . ' ORDER BY RAND()'; $result = query($sql); $image = filterImageQuery($result, $album->name); } } if ($image) { if ($daily) { $potd = array('day' => time(), 'folder' => $image->getAlbumName(), 'filename' => $image->getFileName()); setThemeOption('picture_of_the_day:' . $album->name, serialize($potd), NULL, $_zp_gallery->getCurrentTheme()); } } return $image; }
function handleOption($option, $currentValue) { if ($option == 'css_style') { echo '<select style="width: 200px;" id="' . $option . '" name="' . $option . '"' . ">\n"; echo '<option value="dark"'; if ($currentValue == 'dark') { echo ' selected="selected">Dark</option>\\n'; } else { echo '>Dark</option>\\n'; } echo '<option value="light"'; if ($currentValue == 'light') { echo ' selected="selected">Light</option>\\n'; } else { echo '>Light</option>\\n'; } echo "</select>\n"; } if ($option == 'color_style') { echo '<select style="width: 200px;" id="' . $option . '" name="' . $option . '"' . ">\n"; echo '<option value="default"'; if ($currentValue == 'default') { echo ' selected="selected">Default</option>\\n'; } else { echo '>Default</option>\\n'; } echo '<option value="custom"'; if ($currentValue == 'custom') { echo ' selected="selected">Custom</option>\\n'; } else { echo '>Custom</option>\\n'; } echo "</select>\n"; } if ($option == 'zenpage_homepage') { $unpublishedpages = query_full_array("SELECT titlelink, title FROM " . prefix('pages') . " WHERE `show` != 1 ORDER by `sort_order`"); if (empty($unpublishedpages)) { echo gettext("No unpublished pages available"); // clear option if no unpublished pages are available or have been published meanwhile // so that the normal gallery index appears and no page is accidentally set if set to unpublished again. setThemeOption('zenpage_homepage', 'none', NULL, 'zpArdoise'); } else { echo '<input type="hidden" name="' . CUSTOM_OPTION_PREFIX . 'selector-zenpage_homepage" value=0 />' . "\n"; echo '<select id="' . $option . '" name="' . $option . '">' . "\n"; echo '<option value="none"'; if ($currentValue == 'none') { echo ' selected="selected">' . gettext("none") . '</option>\\n'; } else { echo '>' . gettext("none") . '</option>\\n'; } foreach ($unpublishedpages as $page) { if ($currentValue == $page["titlelink"]) { $selected = ' selected="selected"'; } else { $selected = ''; } echo '<option value="' . $page["titlelink"] . '"' . $selected . '>' . get_language_string($page["title"]) . '</option>'; } echo "</select>\n"; } } if ($option == 'image_statistic') { echo '<select style="width: 200px;" id="' . $option . '" name="' . $option . '"' . ">\n"; echo '<option value="none"'; if ($currentValue == 'none') { echo ' selected="selected">None</option>\\n'; } else { echo '>None</option>\\n'; } echo '<option value="random"'; if ($currentValue == 'random') { echo ' selected="selected">Random</option>\\n'; } else { echo '>Random</option>\\n'; } echo '<option value="popular"'; if ($currentValue == 'popular') { echo ' selected="selected">Popular</option>\\n'; } else { echo '>Popular</option>\\n'; } echo '<option value="latest"'; if ($currentValue == 'latest') { echo ' selected="selected">Latest</option>\\n'; } else { echo '>Latest</option>\\n'; } echo '<option value="latest-date"'; if ($currentValue == 'latest-date') { echo ' selected="selected">Latest-date</option>\\n'; } else { echo '>Latest-date</option>\\n'; } echo '<option value="latest-mtime"'; if ($currentValue == 'latest-mtime') { echo ' selected="selected">Latest-mtime</option>\\n'; } else { echo '>Latest-mtime</option>\\n'; } echo '<option value="mostrated"'; if ($currentValue == 'mostrated') { echo ' selected="selected">Most Rated</option>\\n'; } else { echo '>Most Rated</option>\\n'; } echo '<option value="toprated"'; if ($currentValue == 'toprated') { echo ' selected="selected">Top Rated</option>\\n'; } else { echo '>Top Rated</option>\\n'; } echo "</select>\n"; } }
setThemeOption('images_per_row', $images_per_row, $table, $themename); } if (isset($_POST['thumb_transition'])) { setThemeOption('thumb_transition', (int) (sanitize_numeric($_POST['thumb_transition']) - 1 && true), $table, $themename); } if (isset($_POST['custom_index_page'])) { setThemeOption('custom_index_page', sanitize($_POST['custom_index_page'], 3), $table, $themename); } $otg = getThemeOption('thumb_gray', $table, $themename); setThemeOption('thumb_gray', (int) isset($_POST['thumb_gray']), $table, $themename); if ($otg = getThemeOption('thumb_gray', $table, $themename)) { $wmo = 99; } // force cache clear $oig = getThemeOption('image_gray', $table, $themename); setThemeOption('image_gray', (int) isset($_POST['image_gray']), $table, $themename); if ($oig = getThemeOption('image_gray', $table, $themename)) { $wmo = 99; } // force cache clear if ($nch != $ch || $ncw != $cw) { // the crop height/width has been changed $sql = 'UPDATE ' . prefix('images') . ' SET `thumbX`=NULL,`thumbY`=NULL,`thumbW`=NULL,`thumbH`=NULL WHERE `thumbY` IS NOT NULL'; query($sql); $wmo = 99; // force cache clear as well. } } } } /* * * Plugin Options ** */
/** * * Set defaults for standard theme options incase the theme has not done so * @param string $theme * @param int $albumid zero or the album "owning" the theme */ function standardThemeOptions($theme, $album) { setThemeOption('albums_per_page', 6, $album, $theme, true); setThemeOption('albums_per_row', 3, $album, $theme, true); setThemeOption('images_per_page', 20, $album, $theme, true); setThemeOption('images_per_row', 5, $album, $theme, true); setThemeOption('image_size', 595, $album, $theme, true); setThemeOption('image_use_side', 'longest', $album, $theme, true); setThemeOption('thumb_size', 100, $album, $theme, true); setThemeOption('thumb_crop_width', 100, $album, $theme, true); setThemeOption('thumb_crop_height', 100, $album, $theme, true); setThemeOption('thumb_crop', 1, $album, $theme, true); setThemeOption('thumb_transition', 1, $album, $theme, true); }
/** * Returns a randomly selected image from the album or its subalbums. (May be NULL if none exists) * * @param mixed $rootAlbum optional album object/folder from which to get the image. * @param bool $daily set to true to change picture only once a day. * @param bool $showunpublished set true to consider all images * * @return object */ function getRandomImagesAlbum($rootAlbum = NULL, $daily = false, $showunpublished = false) { global $_zp_current_album, $_zp_gallery, $_zp_current_search; if (empty($rootAlbum)) { $album = $_zp_current_album; } else { if (is_object($rootAlbum)) { $album = $rootAlbum; } else { $album = new Album($_zp_gallery, $rootAlbum); } } if ($daily && ($potd = getOption('picture_of_the_day:' . $album->name))) { $potd = unserialize($potd); if (date('Y-m-d', $potd['day']) == date('Y-m-d')) { $rndalbum = new Album($_zp_gallery, $potd['folder']); $image = newImage($rndalbum, $potd['filename']); if ($image->exists) { return $image; } } } $image = NULL; if ($album->isDynamic()) { $images = $album->getImages(0); shuffle($images); while (count($images) > 0) { $result = array_pop($images); if (is_valid_image($result['filename'])) { $image = newImage(new Album(new Gallery(), $result['folder']), $result['filename']); } } } else { $albumfolder = $album->getFolder(); if ($album->isMyItem(LIST_RIGHTS) || $showunpublished) { $imageWhere = ''; $albumNotWhere = ''; $albumInWhere = ''; } else { $imageWhere = " AND " . prefix('images') . ".show=1"; $albumNotWhere = getProtectedAlbumsWhere(); $albumInWhere = prefix('albums') . ".show=1"; } $query = "SELECT id FROM " . prefix('albums') . " WHERE "; if ($albumInWhere) { $query .= $albumInWhere . ' AND '; } $query .= "folder LIKE " . db_quote($albumfolder . '%'); $result = query_full_array($query); if (is_array($result) && count($result) > 0) { $albumInWhere = prefix('albums') . ".id in ("; foreach ($result as $row) { $albumInWhere = $albumInWhere . $row['id'] . ", "; } $albumInWhere = ' AND ' . substr($albumInWhere, 0, -2) . ')'; $c = 0; while (is_null($image) && $c < 10) { $result = query_single_row('SELECT COUNT(*) AS row_count ' . ' FROM ' . prefix('images') . ', ' . prefix('albums') . ' WHERE ' . prefix('albums') . '.folder!="" AND ' . prefix('images') . '.albumid = ' . prefix('albums') . '.id ' . $albumInWhere . $albumNotWhere . $imageWhere); $rand_row = rand(0, $result['row_count'] - 1); $result = query_single_row('SELECT ' . prefix('images') . '.filename, ' . prefix('albums') . '.folder ' . ' FROM ' . prefix('images') . ', ' . prefix('albums') . ' WHERE ' . prefix('images') . '.albumid = ' . prefix('albums') . '.id ' . $albumInWhere . $albumNotWhere . $imageWhere . ' LIMIT ' . $rand_row . ', 1'); $imageName = $result['filename']; if (is_valid_image($imageName)) { $image = newImage(new Album(new Gallery(), $result['folder']), $imageName); } $c++; } } } if ($daily && is_object($image)) { $potd = array('day' => time(), 'folder' => $result['folder'], 'filename' => $result['filename']); setThemeOption('picture_of_the_day:' . $album->name, serialize($potd)); } return $image; }
/** * Used to set default values for theme specific options * * @param string $key * @param mixed $value */ function setThemeOptionDefault($key, $value) { $bt = debug_backtrace(); $b = array_shift($bt); $theme = basename(dirname($b['file'])); setThemeOption($key, $value, NULL, $theme, true); }
function ThemeOptions() { setThemeOption('thumb_size', 120, NULL, 'grey-simplicity'); setThemeOptionDefault('highslide', 1); }
case 'chkbox': if (isset($_POST[$key])) { $value = 1; } else { $value = 0; } break; default: if (isset($_POST[$key])) { $value = sanitize($_POST[$key], 1); } else { $value = ''; } break; } setThemeOption($table, $key, $value); } } } if ($woh != getOption('watermark_h_offset') || $wow != getOption('watermark_w_offset') || $ws != getOption('watermark_scale') || $wus != getOption('watermark_allow_upscale') || $wmchange) { $gallery->clearCache(); // watermarks (or lack there of) are cached, need to start fresh if the options haave changed } if (empty($notify)) { $notify = '?saved'; } header("Location: " . $notify . $returntab); exit; } } }
function setBoolThemeOption($album, $key, $bool) { if ($bool) { $value = 1; } else { $value = 0; } setThemeOption($album, $key, $value); }