function wppa_add_admin() { global $wp_roles; global $wpdb; // Make sure admin has access rights if (wppa_user_is('administrator')) { $wp_roles->add_cap('administrator', 'wppa_admin'); $wp_roles->add_cap('administrator', 'wppa_upload'); $wp_roles->add_cap('administrator', 'wppa_import'); $wp_roles->add_cap('administrator', 'wppa_moderate'); $wp_roles->add_cap('administrator', 'wppa_export'); $wp_roles->add_cap('administrator', 'wppa_settings'); $wp_roles->add_cap('administrator', 'wppa_potd'); $wp_roles->add_cap('administrator', 'wppa_comments'); $wp_roles->add_cap('administrator', 'wppa_help'); } // See if there are comments pending moderation $com_pending = ''; $com_pending_count = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_COMMENTS . "` WHERE `status` = 'pending' OR `status` = 'spam'"); if ($com_pending_count) { $com_pending = '<span class="update-plugins"><span class="plugin-count">' . $com_pending_count . '</span></span>'; } // See if there are uploads pending moderation $upl_pending = ''; $upl_pending_count = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `status` = 'pending'"); if ($upl_pending_count) { $upl_pending = '<span class="update-plugins"><span class="plugin-count">' . $upl_pending_count . '</span></span>'; } // Compute total pending moderation $tot_pending = ''; $tot_pending_count = '0'; if (current_user_can('wppa_comments') || current_user_can('wppa_moderate')) { $tot_pending_count += $com_pending_count; } if (current_user_can('wppa_admin') || current_user_can('wppa_moderate')) { $tot_pending_count += $upl_pending_count; } if ($tot_pending_count) { $tot_pending = '<span class="update-plugins"><span class="plugin-count">' . '<b>' . $tot_pending_count . '</b>' . '</span></span>'; } $icon_url = WPPA_URL . '/img/camera16.png'; // page_title menu_title capability menu_slug function icon_url position add_menu_page('WP Photo Album', __('Photo Albums', 'wp-photo-album-plus') . $tot_pending, 'wppa_admin', 'wppa_admin_menu', 'wppa_admin', $icon_url); //,'10' ); // parent_slug page_title menu_title capability menu_slug function add_submenu_page('wppa_admin_menu', __('Album Admin', 'wp-photo-album-plus'), __('Album Admin', 'wp-photo-album-plus') . $upl_pending, 'wppa_admin', 'wppa_admin_menu', 'wppa_admin'); add_submenu_page('wppa_admin_menu', __('Upload Photos', 'wp-photo-album-plus'), __('Upload Photos', 'wp-photo-album-plus'), 'wppa_upload', 'wppa_upload_photos', 'wppa_page_upload'); // Uploader without album admin rights, but when the upload_edit switch set, may edit his own photos if (!current_user_can('wppa_admin') && wppa_opt('upload_edit') != 'none') { add_submenu_page('wppa_admin_menu', __('Edit Photos', 'wp-photo-album-plus'), __('Edit Photos', 'wp-photo-album-plus'), 'wppa_upload', 'wppa_edit_photo', 'wppa_edit_photo'); } add_submenu_page('wppa_admin_menu', __('Import Photos', 'wp-photo-album-plus'), __('Import Photos', 'wp-photo-album-plus'), 'wppa_import', 'wppa_import_photos', 'wppa_page_import'); add_submenu_page('wppa_admin_menu', __('Moderate Photos', 'wp-photo-album-plus'), __('Moderate Photos', 'wp-photo-album-plus') . $tot_pending, 'wppa_moderate', 'wppa_moderate_photos', 'wppa_page_moderate'); add_submenu_page('wppa_admin_menu', __('Export Photos', 'wp-photo-album-plus'), __('Export Photos', 'wp-photo-album-plus'), 'wppa_export', 'wppa_export_photos', 'wppa_page_export'); add_submenu_page('wppa_admin_menu', __('Settings', 'wp-photo-album-plus'), __('Settings', 'wp-photo-album-plus'), 'wppa_settings', 'wppa_options', 'wppa_page_options'); add_submenu_page('wppa_admin_menu', __('Photo of the day Widget', 'wp-photo-album-plus'), __('Photo of the day', 'wp-photo-album-plus'), 'wppa_potd', 'wppa_photo_of_the_day', 'wppa_sidebar_page_options'); add_submenu_page('wppa_admin_menu', __('Manage comments', 'wp-photo-album-plus'), __('Comments', 'wp-photo-album-plus') . $com_pending, 'wppa_comments', 'wppa_manage_comments', 'wppa_comment_admin'); add_submenu_page('wppa_admin_menu', __('Help & Info', 'wp-photo-album-plus'), __('Documentation', 'wp-photo-album-plus'), 'wppa_help', 'wppa_help', 'wppa_page_help'); }
function wppa_album_select_a($args) { global $wpdb; $args = wp_parse_args($args, array('exclude' => '', 'selected' => '', 'disabled' => '', 'addpleaseselect' => false, 'addnone' => false, 'addall' => false, 'addgeneric' => false, 'addblank' => false, 'addselected' => false, 'addseparate' => false, 'addselbox' => false, 'disableancestors' => false, 'checkaccess' => false, 'checkowner' => false, 'checkupload' => false, 'addmultiple' => false, 'addnumbers' => false, 'path' => false, 'root' => false, 'content' => false, 'sort' => true)); // Provide default selection if no selected given if ($args['selected'] === '') { $args['selected'] = wppa_get_last_album(); } // See if selection is valid if ($args['selected'] == $args['exclude'] || $args['checkupload'] && !wppa_allow_uploads($args['selected']) || $args['disableancestors'] && wppa_is_ancestor($args['exclude'], $args['selected'])) { $args['selected'] = '0'; } $albums = $wpdb->get_results("SELECT * FROM `" . WPPA_ALBUMS . "` " . wppa_get_album_order($args['root']), ARRAY_A); // Add to secondary cache if ($albums) { wppa_cache_album('add', $albums); } if ($albums) { // Filter for root if ($args['root']) { $root = $args['root']; switch ($root) { // case '0': all, will be skipped as it returns false in 'if ( $args['root'] )' case '-2': // Generic only foreach (array_keys($albums) as $albidx) { if (wppa_is_separate($albums[$albidx]['id'])) { unset($albums[$albidx]); } } break; case '-1': // Separate only foreach (array_keys($albums) as $albidx) { if (!wppa_is_separate($albums[$albidx]['id'])) { unset($albums[$albidx]); } } break; default: foreach (array_keys($albums) as $albidx) { if (!wppa_is_ancestor($root, $albums[$albidx]['id'])) { unset($albums[$albidx]); } } break; } } // Filter for must have content if ($args['content']) { foreach (array_keys($albums) as $albidx) { if (wppa_get_photo_count($albums[$albidx]['id']) <= wppa_get_mincount()) { unset($albums[$albidx]); } } } // Add paths if ($args['path']) { $albums = wppa_add_paths($albums); } else { foreach (array_keys($albums) as $index) { $albums[$index]['name'] = __(stripslashes($albums[$index]['name'])); } } // Sort if ($args['sort']) { $albums = wppa_array_sort($albums, 'name'); } } // Output $result = ''; $selected = $args['selected'] == '0' ? ' selected="selected"' : ''; if ($args['addpleaseselect']) { $result .= '<option value="0" disabled="disabled" ' . $selected . ' >' . (is_admin() ? __('- select an album -', 'wppa') : __a('- select an album -')) . '</option>'; } $selected = $args['selected'] == '0' ? ' selected="selected"' : ''; if ($args['addnone']) { $result .= '<option value="0"' . $selected . ' >' . (is_admin() ? __('--- none ---', 'wppa') : __a('--- none ---')) . '</option>'; } $selected = $args['selected'] == '0' ? ' selected="selected"' : ''; if ($args['addall']) { $result .= '<option value="0"' . $selected . ' >' . (is_admin() ? __('--- all ---', 'wppa') : __a('--- all ---')) . '</option>'; } $selected = $args['selected'] == '-2' ? ' selected="selected"' : ''; if ($args['addall']) { $result .= '<option value="-2"' . $selected . ' >' . (is_admin() ? __('--- generic ---', 'wppa') : __a('--- generic ---')) . '</option>'; } $selected = $args['selected'] == '0' ? ' selected="selected"' : ''; if ($args['addblank']) { $result .= '<option value="0"' . $selected . ' >' . '</option>'; } $selected = $args['selected'] == '-99' ? ' selected="selected"' : ''; if ($args['addmultiple']) { $result .= '<option value="-99"' . $selected . ' >' . (is_admin() ? __('--- multiple see below ---', 'wppa') : __a('--- multiple see below ---')) . '</option>'; } $selected = $args['selected'] == '0' ? ' selected="selected"' : ''; if ($args['addselbox']) { $result .= '<option value="0"' . $selected . ' >' . (is_admin() ? __('--- a selection box ---', 'wppa') : __a('--- a selection box ---')) . '</option>'; } if ($albums) { foreach ($albums as $album) { if ($args['disabled'] == $album['id'] || $args['exclude'] == $album['id'] || $args['checkupload'] && !wppa_allow_uploads($album['id']) || $args['disableancestors'] && wppa_is_ancestor($args['exclude'], $album['id'])) { $disabled = ' disabled="disabled"'; } else { $disabled = ''; } if ($args['selected'] == $album['id'] && !$disabled) { $selected = ' selected="selected"'; } else { $selected = ''; } $ok = true; // Assume this will be in the list if ($args['checkaccess'] && !wppa_have_access($album['id'])) { $ok = false; } if ($args['checkowner'] && wppa_switch('upload_owner_only')) { // Need to check if ($album['owner'] != wppa_get_user() && $album['owner'] != '--- public ---') { // Not 'mine' if (!wppa_user_is('administrator')) { // No admin $ok = false; } } } if ($selected && $args['addselected']) { $ok = true; } if ($ok) { if ($args['addnumbers']) { $number = ' ( ' . $album['id'] . ' )'; } else { $number = ''; } $result .= '<option value="' . $album['id'] . '" ' . $selected . $disabled . '>' . $album['name'] . $number . '</option>'; } } } $selected = $args['selected'] == '-1' ? ' selected="selected"' : ''; if ($args['addseparate']) { $result .= '<option value="-1"' . $selected . '>' . (is_admin() ? __('--- separate ---', 'wppa') : __a('--- separate ---')) . '</option>'; } return $result; }
function _wppa_page_import() { global $wppa_revno; global $wpdb; global $wppa_supported_photo_extensions; global $wppa_supported_video_extensions; global $wppa_supported_audio_extensions; global $wppa_session; if (wppa('ajax')) { ob_start(); } // Suppress output if ajax operation // Init $ngg_opts = get_option('ngg_options', false); $user = wppa_get_user(); // Check database wppa_check_database(true); // Update watermark settings for the user if new values supplied if (wppa_switch('watermark_on') && (wppa_switch('watermark_user') || current_user_can('wppa_settings'))) { // File if (isset($_POST['wppa-watermark-file'])) { // Sanitize input $watermark_file = $_POST['wppa-watermark-file']; if (stripos($watermark_file, '.png') !== false) { $watermark_file = sanitize_file_name($watermark_file); } else { if (!in_array($watermark_file, array('--- none ---', '---name---', '---filename---', '---description---', '---predef---'))) { $watermark_file = 'nil'; } } // Update setting update_option('wppa_watermark_file_' . $user, $watermark_file); } // Position if (isset($_POST['wppa-watermark-pos'])) { // Sanitize input $watermark_pos = $_POST['wppa-watermark-pos']; if (!in_array($watermark_pos, array('toplft', 'topcen', 'toprht', 'cenlft', 'cencen', 'cenrht', 'botlft', 'botcen', 'botrht'))) { $watermark_pos = 'nil'; } // Update setting update_option('wppa_watermark_pos_' . $user, $watermark_pos); } } // Update last used albums if (isset($_POST['wppa-photo-album'])) { update_option('wppa-photo-album-import-' . wppa_get_user(), strval(intval($_POST['wppa-photo-album']))); } if (isset($_POST['wppa-video-album'])) { update_option('wppa-video-album-import-' . wppa_get_user(), strval(intval($_POST['wppa-video-album']))); } if (isset($_POST['wppa-audio-album'])) { update_option('wppa-audio-album-import-' . wppa_get_user(), strval(intval($_POST['wppa-audio-album']))); } // Verify last albums still exist $alb = get_option('wppa-photo-album-import-' . wppa_get_user(), '0'); if ($alb) { $exists = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_ALBUMS . "` WHERE `id` = %s", $alb)); if (!$exists) { update_option('wppa-photo-album-import-' . wppa_get_user(), '0'); } } $alb = get_option('wppa-video-album-import-' . wppa_get_user(), '0'); if ($alb) { $exists = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_ALBUMS . "` WHERE `id` = %s", $alb)); if (!$exists) { update_option('wppa-video-album-import-' . wppa_get_user(), '0'); } } $alb = get_option('wppa-audio-album-import-' . wppa_get_user(), '0'); if ($alb) { $exists = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_ALBUMS . "` WHERE `id` = %s", $alb)); if (!$exists) { update_option('wppa-audio-album-import-' . wppa_get_user(), '0'); } } // Extract zip if (isset($_GET['zip'])) { wppa_extract($_GET['zip'], true); } // Set local / remote if (isset($_POST['wppa-local-remote']) && in_array($_POST['wppa-local-remote'], array('local', 'remote'))) { check_admin_referer('$wppa_nonce', WPPA_NONCE); update_option('wppa_import_source_type_' . $user, $_POST['wppa-local-remote']); } // Set import source dir ( when local ) if (isset($_POST['wppa-import-set-source-dir']) && is_dir($_POST['wppa-source'])) { check_admin_referer('$wppa_nonce', WPPA_NONCE); if (isset($_POST['wppa-source'])) { update_option('wppa_import_source_' . $user, $_POST['wppa-source']); } } // Set import source url ( when remote ) if (isset($_POST['wppa-import-set-source-url'])) { check_admin_referer('$wppa_nonce', WPPA_NONCE); if (isset($_POST['wppa-source-remote'])) { update_option('wppa_import_source_url_' . $user, esc_url($_POST['wppa-source-remote'])); update_option('wppa_import_source_url_found_' . $user, false); update_option('wppa_import_remote_max_' . $user, strval(intval($_POST['wppa-import-remote-max']))); } } // Hit the submit button if (isset($_POST['wppa-import-submit'])) { if (wppa('ajax')) { if (!wp_verify_nonce($_POST['wppa-update-check'], '$wppa_nonce')) { echo $_POST['wppa-update-check'] . ' Security check failure'; wppa_exit(); } } else { check_admin_referer('$wppa_nonce', WPPA_NONCE); } $delp = isset($_POST['del-after-p']); $delf = isset($_POST['del-after-f']); $dela = isset($_POST['del-after-a']); $delz = isset($_POST['del-after-z']); $delv = isset($_POST['del-after-v']); $delu = isset($_POST['del-after-u']); $delc = isset($_POST['del-after-c']); wppa_import_photos($delp, $dela, $delz, $delv, $delu, $delc, $delf); } elseif (isset($_GET['continue'])) { if (wp_verify_nonce($_GET['nonce'], 'dirimport')) { wppa_import_photos(); } } // If we did this by ajax, setup reporting results for it if (wppa('ajax')) { ob_end_clean(); if (wppa('ajax_import_files_done')) { echo '<span style="color:green" >' . wppa('ajax_import_files') . ' ' . __('Done!', 'wp-photo-album-plus') . '</span>'; } elseif (wppa('ajax_import_files_error')) { echo '<span style="color:red" >' . wppa('ajax_import_files') . ' ' . wppa('ajax_import_files_error') . '</span>'; } else { echo '<span style="color:red" >' . wppa('ajax_import_files') . ' ' . __('Failed!', 'wp-photo-album-plus') . '</span>'; } wppa_exit(); } // Open the Form echo '<div class="wrap">' . '<h2>' . __('Import Photos', 'wp-photo-album-plus') . '</h2>'; // See if remote is possible $can_remote = ini_get('allow_url_fopen') && function_exists('curl_init'); if (!$can_remote) { update_option('wppa_import_source_type_' . $user, 'local'); } // Get this users current source type setting ( local/remote ) $source_type = get_option('wppa_import_source_type_' . $user, 'local'); // Local. Find data we will going to need if ($source_type == 'local') { // Get curren local dir setting $source = get_option('wppa_import_source_' . $user, WPPA_DEPOT_PATH); if (!$source || !is_dir($source)) { $source = WPPA_DEPOT_PATH; update_option('wppa_import_source_' . $user, WPPA_DEPOT_PATH); } // See if the current source is the 'home' directory $is_depot = $source == WPPA_DEPOT_PATH; // See if the current source is a subdir of my depot $is_sub_depot = substr($source, 0, strlen(WPPA_DEPOT_PATH)) == WPPA_DEPOT_PATH; // Sanitize system, removes illegal files if ($is_sub_depot) { wppa_sanitize_files(); } // See what's in there $files = wppa_get_import_files(); $zipcount = wppa_get_zipcount($files); $albumcount = wppa_get_albumcount($files); $photocount = wppa_get_photocount($files); $videocount = wppa_get_video_count($files); $audiocount = wppa_get_audio_count($files); $dircount = $is_depot ? wppa_get_dircount($files) : '0'; $csvcount = $is_depot ? wppa_get_csvcount($files) : '0'; if ($ngg_opts) { $is_ngg = strpos($source, $ngg_opts['gallerypath']) !== false; // this is false for the ngg root !! } else { $is_ngg = false; } } // Remote. Find data we will going to need if ($source_type == 'remote') { wppa('is_remote', true); $source = get_option('wppa_import_source_url_' . $user, 'http://'); $source_path = $source; $source_url = $source; $is_depot = false; $is_sub_depot = false; $files = wppa_get_import_files(); $zipcount = '0'; $albumcount = '0'; $photocount = $files ? count($files) : '0'; $videocount = '0'; $audiocount = '0'; $dircount = '0'; $csvcount = '0'; $is_ngg = false; $remote_max = get_option('wppa_import_remote_max_' . $user, '10'); } // The form echo '<form' . ' action="' . wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_import_photos') . '"' . ' method="post"' . ' >'; // Admin and superuser can change import source, other users only if change source not is restricted if (wppa_user_is('administrator') || !wppa_switch('chgsrc_is_restricted')) { // Local / Remote echo '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >' . wp_nonce_field('$wppa_nonce', WPPA_NONCE, true, false) . __('Select Local or Remote', 'wp-photo-album-plus') . ($disabled = $can_remote ? '' : 'disabled="disabled"') . '<select name="wppa-local-remote" >' . '<option value="local" ' . ($source_type == 'local' ? 'selected="selected"' : '') . '>' . __('Local', 'wp-photo-album-plus') . '</option>' . '<option value="remote" ' . $disabled . ($source_type == 'remote' ? 'selected="selected"' : '') . '>' . __('Remote', 'wp-photo-album-plus') . '</option>' . '</select>'; if ($can_remote) { echo '<input' . ' type="submit"' . ' class="button-secundary"' . ' name="wppa-import-set-source"' . ' value="' . __('Set Local/Remote', 'wp-photo-album-plus') . '"' . '/>'; } else { if (!ini_get('allow_url_fopen')) { _e('The server does not allow you to import from remote locations. ( The php directive allow_url_fopen is not set to 1 )', 'wp-photo-album-plus'); } if (!function_exists('curl_init')) { _e('The server does not allow you to import from remote locations. ( The curl functions are not set up )', 'wp-photo-album-plus'); } } echo '</div>'; // Source dir / url echo '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >' . wp_nonce_field('$wppa_nonce', WPPA_NONCE, true, false) . __('Import photos from:', 'wp-photo-album-plus'); // Local: dir if ($source_type == 'local') { echo '<select name="wppa-source" >' . wppa_abs_walktree(wppa_opt('import_root'), $source) . '</select>' . '<input' . ' type="submit"' . ' class="button-secundary"' . ' name="wppa-import-set-source-dir"' . ' value="' . __('Set source directory', 'wp-photo-album-plus') . '"' . ' />'; } else { echo '<input' . ' type="text"' . ' style="width:50%"' . ' name="wppa-source-remote"' . ' value="' . $source . '"' . ' />' . __('Max:', 'wp-photo-album-plus') . '<input' . ' type="text"' . ' style="width:50px;"' . ' name="wppa-import-remote-max"' . ' value="' . $remote_max . '"' . ' />' . '<input' . ' type="submit"' . ' onclick="jQuery( \'#rem-rem\' ).css( \'display\',\'inline\' ); return true;"' . ' class="button-secundary"' . ' name="wppa-import-set-source-url"' . ' value="' . __('Find remote photos', 'wp-photo-album-plus') . '"' . ' />' . '<span id="rem-rem" style="display:none;" >' . __('Working, please wait...', 'wp-photo-album-plus') . '</span>' . '<br />' . __('You can enter either a web page address like <i>http://mysite.com/mypage/</i> or a full url to an image file like <i>http://mysite.com/wp-content/uploads/wppa/4711.jpg</i>', 'wp-photo-album-plus'); } echo '</div>'; } echo '</form>'; // check if albums exist or will be made before allowing upload if (!wppa_has_albums() && !$albumcount && !$dircount && !$csvcount) { $url = wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_admin_menu'); echo '<p>' . __('No albums exist. You must', 'wp-photo-album-plus') . ' ' . '<a href="' . $url . '" >' . __('create one', 'wp-photo-album-plus') . ' ' . '</a> ' . __('beofre you can upload your photos.', 'wp-photo-album-plus') . '</p>'; return; } // Something to import? if ($photocount || $albumcount || $zipcount || $dircount || $videocount || $audiocount || $csvcount) { // Open the form echo '<form' . ' action="' . wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_import_photos') . '"' . ' method="post"' . ' >' . wp_nonce_field('$wppa_nonce', WPPA_NONCE, true, false); // Display the zips if (PHP_VERSION_ID >= 50207 && $zipcount > '0') { echo '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >' . '<p><b>' . sprintf(_n('There is %d zipfile in the depot', 'There are %d zipfiles in the depot', $zipcount, 'wp-photo-album-plus'), $zipcount) . '</b></p>' . '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' . '<thead>' . '<tr>' . '<td>' . '<input' . ' type="checkbox"' . ' id="all-zip"' . ' checked="checked"' . ' onchange="checkAll( \'all-zip\', \'.wppa-zip\' )"' . ' />' . '<b> ' . __('Check/uncheck all', 'wp-photo-album-plus') . '</b>' . '</td>'; if ($is_sub_depot) { echo '<td>' . '<input' . ' type="checkbox"' . ' id="del-after-z"' . ' name="del-after-z"' . ' checked="checked"' . ' />' . '<b> ' . __('Delete after successful extraction.', 'wp-photo-album-plus') . '</b>' . '</td>'; } echo '</tr>' . '</thead>' . '</table>' . '<table' . ' class="form-table wppa-table widefat"' . ' style="margin-top:0;"' . ' >' . '<tr>'; $ct = 0; $idx = '0'; foreach ($files as $file) { $ext = wppa_get_ext($file); if ($ext == 'zip') { echo '<td>' . '<input' . ' type="checkbox"' . ' id="file-' . $idx . '"' . ' name="file-' . $idx . '"' . ' class="wppa-zip"' . ' checked="checked"' . ' /> ' . wppa_sanitize_file_name(basename($file)) . '</td>'; if ($ct == 3) { echo '</tr><tr>'; $ct = 0; } else { $ct++; } } $idx++; } echo '</tr>' . '</table>' . '</div>'; } // Dispay the albums ( .amf files ) if ($albumcount) { echo '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >' . '<p><b>' . sprintf(_n('There is %d albumdefinition in the depot', 'There are %d albumdefinitions in the depot', $albumcount, 'wp-photo-album-plus'), $albumcount) . '</b></p>' . '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' . '<thead>' . '<tr>' . '<td>' . '<input' . ' type="checkbox"' . ' id="all-amf"' . ' checked="checked"' . ' onchange="checkAll( \'all-amf\', \'.wppa-amf\' )"' . ' />' . '<b> ' . __('Check/uncheck all', 'wp-photo-album-plus') . '</b>' . '</td>'; if ($is_sub_depot) { echo '<td>' . '<input' . ' type="checkbox"' . ' id="del-after-a"' . ' name="del-after-a"' . ' checked="checked"' . ' />' . '<b> ' . __('Remove from depot after successful import, or if the album already exists.', 'wp-photo-album-plus') . '</b>' . '</td>'; } echo '</tr>' . '</thead>' . '</table>' . '<table' . ' class="form-table wppa-table widefat"' . ' style="margin-top:0;"' . ' >' . '<tr>'; $ct = 0; $idx = '0'; foreach ($files as $file) { $ext = wppa_get_ext($file); if ($ext == 'amf') { echo '<td>' . '<input' . ' type="checkbox"' . ' id="file-' . $idx . '"' . ' name="file-' . $idx . '"' . ' class="wppa-amf"' . ' checked="checked"' . ' />' . ' ' . basename($file) . ' ' . stripslashes(wppa_get_meta_name($file, '( ')) . '</td>'; if ($ct == 3) { echo '</tr><tr>'; $ct = 0; } else { $ct++; } } $idx++; } echo '</tr>' . '</table>' . '</div>'; } // Display the single photos if ($photocount) { echo '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >'; // Display the number of photos '<p><b>'; // Local if ($source_type == 'local') { if ($is_ngg) { printf(_n('There is %d photo in the ngg gallery', 'There are %d photos in the ngg gallery', $photocount, 'wp-photo-album-plus'), $photocount); } else { printf(_n('There is %d photo in the depot', 'There are %d photos in the depot', $photocount, 'wp-photo-album-plus'), $photocount); } } else { printf(_n('There is %d possible photo found remote', 'There are %d possible photos found remote', $photocount, 'wp-photo-album-plus'), $photocount); } // Tell if downsize on if (wppa_switch('resize_on_upload')) { echo ' ' . __('Photos will be downsized during import.', 'wp-photo-album-plus'); } echo '</b></p>'; // The album selection echo '<p class="hideifupdate" >' . __('Default album for import:', 'wp-photo-album-plus') . '<select name="wppa-photo-album" id="wppa-photo-album" >' . wppa_album_select_a(array('path' => wppa_switch('hier_albsel'), 'selected' => get_option('wppa-photo-album-import-' . wppa_get_user(), '0'), 'addpleaseselect' => true, 'checkowner' => true, 'checkupload' => true)) . '</select>' . __('Photos that have (<em>name</em>)[<em>album</em>] will be imported by that <em>name</em> in that <em>album</em>.', 'wp-photo-album-plus') . '</p>'; // Watermark if (wppa_switch('watermark_on') && (wppa_switch('watermark_user') || current_user_can('wppa_settings'))) { echo '<p>' . __('Apply watermark file:', 'wp-photo-album-plus') . '<select name="wppa-watermark-file" id="wppa-watermark-file" >' . wppa_watermark_file_select() . '</select>' . __('Position:', 'wp-photo-album-plus') . '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' . wppa_watermark_pos_select() . '</select>' . '</p>'; } // Header of photo list echo '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' . '<thead>' . '<tr>' . '<td>' . '<input' . ' type="checkbox"' . ' id="all-pho"' . ($is_sub_depot ? 'checked="checked"' : '') . ' onchange="checkAll( \'all-pho\', \'.wppa-pho\' )"' . ' />' . '<b>' . ' ' . __('Check/uncheck all', 'wp-photo-album-plus') . '</b>' . '</td>'; // Depot specific switches if ($is_sub_depot) { echo '<td>' . '<input' . ' type="checkbox"' . ' id="del-after-p"' . ' name="del-after-p"' . ' checked="checked"' . ' />' . '<b>' . ' ' . __('Remove from depot after successful import.', 'wp-photo-album-plus') . '</b>' . '</td>' . '<td>' . '<input' . ' type="checkbox"' . ' id="del-after-f"' . ' name="del-after-f"' . ' />' . '<b>' . ' ' . __('Remove from depot after failed import.', 'wp-photo-album-plus') . '</b>' . '</td>'; } // Nextgen import specific switches if ($is_ngg) { echo '<td>' . '<input' . ' type="checkbox"' . ' id="cre-album"' . ' name="cre-album"' . ' checked="checked"' . ' value="' . esc_attr(basename($source)) . '"' . ' />' . '<b>' . ' ' . __('Import into album', 'wp-photo-album-plus') . ' ' . basename($source) . '</b>' . '<small>' . __('The album will be created if it does not exist', 'wp-photo-album-plus') . '</small>' . '</td>' . '<td>' . '<input' . ' type="checkbox"' . ' id="use-backup"' . ' name="use-backup"' . ' checked="checked"' . ' />' . '<b>' . ' ' . __('Use backup if available', 'wp-photo-album-plus') . '</b>' . '</td>'; } // Update existing switch echo '<td>' . '<input' . ' type="checkbox"' . ' id="wppa-update"' . ' onchange="impUpd( this, \'#submit\' )"' . ' name="wppa-update"' . ' />' . '<b>' . ' ' . __('Update existing photos', 'wp-photo-album-plus') . '</b>' . '</td>'; // Void dups switch echo '<td>'; if (wppa_switch('void_dups')) { echo '<input' . ' type="hidden"' . ' id="wppa-nodups"' . ' name="wppa-nodups"' . ' value="true"' . ' />'; } else { echo '<input' . ' type="checkbox"' . ' id="wppa-nodups"' . ' name="wppa-nodups"' . ' checked="checked"' . ' />' . '<b>' . ' ' . __('Do not create duplicates', 'wp-photo-album-plus') . '</b>'; } echo '</td>'; // Import preview zoomable switch if (wppa_switch('import_preview')) { echo '<td>' . '<input' . ' type="checkbox"' . ' id="wppa-zoom"' . ' onclick="wppa_setCookie(\'zoompreview\', this.checked, \'365\')"' . ' />' . '<b>' . ' ' . __('Zoom previews', 'wp-photo-album-plus') . '</b>' . '<script type="text/javascript">if ( wppa_getCookie(\'zoompreview\') == true ) { jQuery(\'#wppa-zoom\').attr(\'checked\', \'checked\') }</script>' . '</td>'; } echo '</tr>' . '</thead>' . '</table>'; // Photo list echo '<table class="form-table wppa-table widefat" style="margin-top:0;" >' . '<tr>'; $ct = 0; $idx = '0'; if (is_array($files)) { foreach ($files as $file) { $ext = wppa_get_ext($file); $meta = wppa_strip_ext($file) . '.PMF'; if (!is_file($meta)) { $meta = wppa_strip_ext($file) . '.pmf'; } if (!is_file($meta)) { $meta = false; } if (in_array(strtolower($ext), $wppa_supported_photo_extensions)) { echo '<td id="td-file-' . $idx . '" >' . '<input' . ' type="checkbox"' . ' id="file-' . $idx . '"' . ' name="file-' . $idx . '"' . ' title="' . esc_attr($file) . '"' . ' class="wppa-pho"' . ($is_sub_depot ? 'checked="checked"' : '') . '/ >' . '<span' . ' id="name-file-' . $idx . '"' . ' >' . ' '; if (wppa('is_wppa_tree')) { $t = explode('uploads/wppa/', $file); echo $t[1]; } else { echo wppa_sanitize_file_name(basename($file)); } if ($meta) { echo ' ' . stripslashes(wppa_get_meta_name($meta, '( ')) . stripslashes(wppa_get_meta_album($meta, '[')); } echo '</span>'; if (wppa_switch('import_preview')) { if (wppa('is_remote')) { if (strpos($file, '//res.cloudinary.com/') !== false) { $img_url = dirname($file) . '/h_144/' . basename($file); } else { $img_url = $file; } } else { $img_url = str_replace(ABSPATH, home_url() . '/', $file); } echo '<img src="' . $img_url . '"' . ' alt="N.A."' . ' style="max-height:48px;"' . ' onmouseover="if (jQuery(\'#wppa-zoom\').attr(\'checked\')) jQuery(this).css(\'max-height\', \'144px\')"' . ' onmouseout="if (jQuery(\'#wppa-zoom\').attr(\'checked\')) jQuery(this).css(\'max-height\', \'48px\')"' . ' />'; } echo '</td>'; if ($ct == 3) { echo '</tr><tr>'; $ct = 0; } else { $ct++; } } $idx++; } } echo '</tr>' . '</table>' . '</div>'; } // Display the videos if ($videocount && wppa_switch('enable_video')) { echo '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >'; // Display available files echo '<p><b>' . sprintf(_n('There is %d video in the depot', 'There are %d videos in the depot', $videocount, 'wp-photo-album-plus'), $videocount) . '</b></p>'; // Album to import to echo '<p class="hideifupdate" >' . __('Album to import to:', 'wp-photo-album-plus') . '<select name="wppa-video-album" id="wppa-video-album">' . wppa_album_select_a(array('path' => wppa_switch('hier_albsel'), 'selected' => get_option('wppa-video-album-import-' . wppa_get_user(), '0'), 'addpleaseselect' => true, 'checkowner' => true, 'checkupload' => true)) . '</select>' . '</p>'; // Header of video list echo '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' . '<thead>' . '<tr>' . '<td>' . '<input' . ' type="checkbox"' . ' id="all-video"' . ' checked="checked"' . ' onchange="checkAll( \'all-video\', \'.wppa-video\' )"' . ' />' . '<b>' . ' ' . __('Check/uncheck all', 'wp-photo-album-plus') . '</b>' . '</td>'; if ($is_sub_depot) { echo '<td>' . '<input' . ' type="checkbox"' . ' id="del-after-v"' . ' name="del-after-v"' . ' checked="checked"' . ' />' . '<b>' . ' ' . __('Remove from depot after successful import.', 'wp-photo-album-plus') . ' <small>' . __('Files larger than 64MB will always be removed after successful import.', 'wp-photo-album-plus') . '</small>' . '</b>' . '</td>'; } echo '</tr>' . '</thead>' . '</table>'; // Video list echo '<table class="form-table wppa-table widefat" style="margin-top:0;" >' . '<tr>'; $ct = 0; $idx = '0'; if (is_array($files)) { foreach ($files as $file) { $ext = strtolower(substr(strrchr($file, "."), 1)); if (in_array(strtolower($ext), $wppa_supported_video_extensions)) { echo '<td>' . '<input' . ' type="checkbox"' . ' id="file-' . $idx . '"' . ' name="file-' . $idx . '"' . ' title="' . $file . '"' . ' class="wppa-video"' . ' checked="checked"' . ' />' . '<span' . ' id="name-file-' . $idx . '"' . ' >' . ' ' . wppa_sanitize_file_name(basename($file)) . '</span>' . '</td>'; if ($ct == 3) { echo '</tr><tr>'; $ct = 0; } else { $ct++; } } $idx++; } } echo '</tr>' . '</table>' . '</div>'; } // Display the audios if ($audiocount && wppa_switch('enable_audio')) { echo '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >'; // Display available files echo '<p><b>' . sprintf(_n('There is %d audio in the depot', 'There are %d audios in the depot', $audiocount, 'wp-photo-album-plus'), $audiocount) . '</b></p>'; // Album to import to echo '<p class="hideifupdate" >' . __('Album to import to:', 'wp-photo-album-plus') . '<select name="wppa-audio-album" id="wppa-audio-album" >' . wppa_album_select_a(array('path' => wppa_switch('hier_albsel'), 'selected' => get_option('wppa-audio-album-import-' . wppa_get_user(), '0'), 'addpleaseselect' => true, 'checkowner' => true, 'checkupload' => true)) . '</select>' . '</p>'; // Header of audio list echo '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' . '<thead>' . '<tr>' . '<td>' . '<input' . ' type="checkbox"' . ' id="all-audio"' . ' checked="checked"' . ' onchange="checkAll( \'all-audio\', \'.wppa-audio\' )"' . ' />' . '<b>' . ' ' . __('Check/uncheck all', 'wp-photo-album-plus') . '</b>' . '</td>'; // The remove box if ($is_sub_depot) { echo '<td>' . '<input' . ' type="checkbox"' . ' id="del-after-u"' . ' name="del-after-u"' . ' checked="checked"' . ' />' . '<b>' . ' ' . __('Remove from depot after successful import.', 'wp-photo-album-plus') . '</b>' . '</td>'; } echo '</tr>' . '</thead>' . '</table>'; // Audio list echo '<table class="form-table wppa-table widefat" style="margin-top:0;" >' . '<tr>'; $ct = 0; $idx = '0'; if (is_array($files)) { foreach ($files as $file) { $ext = strtolower(substr(strrchr($file, "."), 1)); if (in_array(strtolower($ext), $wppa_supported_audio_extensions)) { echo '<td>' . '<input' . ' type="checkbox"' . ' id="file-' . $idx . '"' . ' name="file-' . $idx . '"' . ' title="' . $file . '"' . ' class="wppa-audio"' . ' checked="checked"' . ' />' . '<span' . ' id="name-file-' . $idx . '"' . ' >' . ' ' . wppa_sanitize_file_name(basename($file)) . '</span>' . '</td>'; if ($ct == 3) { echo '</tr><tr>'; $ct = 0; } else { $ct++; } } $idx++; } } echo '</tr>' . '</table>' . '</div>'; } // Display the directories to be imported as albums. Do this in the depot only!! if ($is_depot && $dircount) { echo '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >'; // Display number of dirs echo '<p><b>' . sprintf(_n('There is %d albumdirectory in the depot', 'There are %d albumdirectories in the depot', $dircount, 'wp-photo-album-plus'), $dircount) . '</b></p>'; // Header of dirlist echo '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' . '<thead>' . '<tr>' . '<td>' . '<input' . ' type="checkbox"' . ' id="all-dir"' . ' checked="checked"' . ' onchange="checkAll( \'all-dir\', \'.wppa-dir\' )"' . ' />' . '<b>' . ' ' . __('Check/uncheck all', 'wp-photo-album-plus') . '</b>' . '</td>' . '</tr>' . '</thead>' . '</table>'; // Dirlist echo '<table class="form-table wppa-table widefat" style="margin-top:0;" >'; $ct = 0; $idx = '0'; foreach ($files as $dir) { if (basename($dir) == '.') { } elseif (basename($dir) == '..') { } elseif (is_dir($dir)) { echo '<tr>' . '<td>' . '<input' . ' type="checkbox"' . ' id="file-' . $idx . '"' . ' name="file-' . $idx . '"' . ' class= "wppa-dir"' . ' checked="checked"' . ' />' . ' ' . '<b>' . wppa_sanitize_file_name(basename($dir)) . '</b>'; $subfiles = glob($dir . '/*'); $subdircount = '0'; if ($subfiles) { foreach ($subfiles as $subfile) { if (is_dir($subfile) && basename($subfile) != '.' && basename($subfile) != '..') { $subdircount++; } } } $sfcount = empty($subfiles) ? '0' : wppa_get_photocount($subfiles); echo ' ' . sprintf(_n('Contains %d file', 'Contains %d files', $sfcount, 'wp-photo-album-plus'), $sfcount); if ($subdircount) { echo ' ' . sprintf(_n('and %d subdirectory', 'and %d subdirectories', $subdircount, 'wp-photo-album-plus'), $subdircount); } '</td>' . '</tr>'; } $idx++; } echo '</table>' . '</div>'; } // Display the csv files if ($is_depot && $csvcount) { echo '<div style="border:1px solid gray; padding:4px; margin: 3px 0;" >'; // Display number of files echo '<p><b>' . sprintf(_n('There is %d .csv file in the depot', 'There are %d .csv files in the depot', $csvcount, 'wp-photo-album-plus'), $csvcount) . '</b></p>'; // Header of .csv file list echo '<table class="form-table wppa-table widefat" style="margin-bottom:0;" >' . '<thead>' . '<tr>' . '<td>' . '<input' . ' type="checkbox"' . ' id="all-csv"' . ' checked="checked"' . ' onchange="checkAll( \'all-csv\', \'.wppa-csv\' )"' . ' />' . '<b>' . ' ' . __('Check/uncheck all', 'wp-photo-album-plus') . '</b>' . '</td>' . '<td>' . '<input' . ' type="checkbox"' . ' id="del-after-c"' . ' name="del-after-c"' . ' checked="checked"' . ' disabled="disabled"' . ' />' . '<b>' . ' ' . __('Remove from depot after successful import.', 'wp-photo-album-plus') . '</b>' . '</td>' . '</tr>' . '</thead>' . '</table>'; // CSV file list echo '<table class="form-table wppa-table widefat" style="margin-top:0;" >'; $ct = 0; $idx = '0'; foreach ($files as $csv) { if (is_file($csv) && strtolower(wppa_get_ext($csv)) == 'csv') { echo '<tr>' . '<td>' . '<input' . ' type="checkbox"' . ' id="file-' . $idx . '"' . ' name="file-' . $idx . '"' . ' class="wppa-csv"' . ' checked="checked"' . ' />' . ' ' . '<b>' . wppa_sanitize_file_name(basename($csv)) . ' (' . sprintf('%5.1f', filesize($csv) / 1024) . ' kb)' . '</b>' . '</td>' . '</tr>'; } $idx++; } echo '</table>' . '</div>'; } // The submit button ?> <p> <script type="text/javascript"> function wppaVfyAlbum() { var csvs = jQuery( '.wppa-csv' ); if ( jQuery( '#wppa-update' ).attr( 'checked' ) != 'checked' ) { if ( ! parseInt( jQuery( '#wppa-photo-album' ).attr( 'value' ) ) && ! parseInt( jQuery( '#wppa-video-album' ).attr( 'value' ) ) && ! parseInt( jQuery( '#wppa-audio-album' ).attr( 'value' ) ) && csvs.length == 0 ) { alert( 'Please select an album first' ); return false; } } return true; } function wppaCheckInputVars() { var checks = jQuery( ':checked' ); var nChecks = checks.length; var nMax = <?php echo ini_get('max_input_vars'); ?> ; if ( nMax == 0 ) nMax = 100; if ( nChecks > nMax ) { alert ( 'There are '+nChecks+' boxes checked or selected, that is more than the maximum allowed number of '+nMax ); return false; } var dirs = jQuery( '.wppa-dir' ); var nDirsChecked = 0; if ( dirs.length > 0 ) { var i = 0; while ( i < dirs.length ) { if ( jQuery( dirs[i] ).attr( 'checked' ) == 'checked' ) { nDirsChecked++; } i++; } } var zips = jQuery( '.wppa-zip' ); var nZipsChecked = 0; if ( zips.length > 0 ) { var i = 0; while ( i < zips.length ) { if ( jQuery( zips[i] ).attr( 'checked' ) == 'checked' ) { nZipsChecked++; } i++; } } // If no dirs to import checked, there must be an album selected if ( 0 == nDirsChecked && 0 == nZipsChecked && ! wppaVfyAlbum() ) return false; return true; } </script> <input type="submit" onclick="return wppaCheckInputVars()" class="button-primary" id="submit" name="wppa-import-submit" value="<?php _e('Import', 'wp-photo-album-plus'); ?> " /> <script type="text/javascript" > var wppaImportRuns = false; function wppaDoAjaxImport() { wppaImportRuns = true; var data = ''; data += 'wppa-update-check='+jQuery( '#wppa-update-check' ).attr( 'value' ); data += '&wppa-photo-album='+jQuery( '#wppa-photo-album' ).attr( 'value' ); data += '&wppa-video-album='+jQuery( '#wppa-video-album' ).attr( 'value' ); data += '&wppa-audio-album='+jQuery( '#wppa-audio-album' ).attr( 'value' ); data += '&wppa-watermark-file='+jQuery( '#wppa-watermark-file' ).attr( 'value' ); data += '&wppa-watermark-pos='+jQuery( '#wppa-watermark-pos' ).attr( 'value' ); if ( jQuery( '#cre-album' ).attr( 'checked' ) ) data += '&cre-album='+jQuery( '#cre-album' ).attr( 'value' ); if ( jQuery( '#use-backup' ).attr( 'checked' ) ) data += '&use-backup=on'; //+jQuery( '#use-backup' ).attr( 'value' ); if ( jQuery( '#wppa-update' ).attr( 'checked' ) ) data += '&wppa-update=on'; //+jQuery( '#wppa-update' ).attr( 'value' ); if ( jQuery( '#wppa-nodups' ).attr( 'checked' ) ) data += '&wppa-nodups=on'; //+jQuery( '#wppa-nudups' ).attr( 'value' ); if ( jQuery( '#del-after-p' ).attr( 'checked' ) ) data += '&del-after-p=on'; if ( jQuery( '#del-after-f' ).attr( 'checked' ) ) data += '&del-after-f=on'; if ( jQuery( '#del-after-v' ).attr( 'checked' ) ) data += '&del-after-v=on'; if ( jQuery( '#del-after-u' ).attr( 'checked' ) ) data += '&del-after-u=on'; data += '&wppa-import-submit=ajax'; var files = jQuery( ':checked' ); var found = false; var i=0; var elm; var fulldata; for ( i=0; i<files.length; i++ ) { found = false; // assume done elm = files[i]; // Is it a file checkbox? var temp = elm.id.split( '-' ); if ( temp[0] != 'file' ) continue; // no fulldata = data+'&import-ajax-file='+elm.title; found = true; break; } // alert( data ); if ( ! found ) { wppaStopAjaxImport(); return; // nothing left } // found one, do it var oldhtml=jQuery( '#name-'+elm.id ).html(); var xmlhttp = wppaGetXmlHttp(); xmlhttp.onreadystatechange = function() { if ( xmlhttp.readyState == 4 ) { if ( xmlhttp.status!=404 ) { var resp = xmlhttp.responseText; // if ( resp.length == 0 ) { jQuery( '#name-'+elm.id ).html('<span style="color:red" >Timeout</span>' ); wppaStopAjaxImport(); return; } // if ( resp.indexOf( 'Server' ) != -1 && resp.indexOf( 'Error' ) != -1 ) { resp = '<span style="color:red" >Server error</span>'; } jQuery( '#name-'+elm.id ).html( ' <b>'+resp+'</b>' ); elm.checked = ''; if ( jQuery( '#del-after-p' ).attr( 'checked' ) || jQuery( '#del-after-f' ).attr( 'checked' ) ) { elm.disabled = 'disabled'; elm.title = ''; } if ( wppaImportRuns ) { setTimeout( 'wppaDoAjaxImport()', 100 ); } } else { jQuery( '#name-'+elm.id ).html( ' <b>Not found</b>' ); } } } var url = wppaAjaxUrl+'?action=wppa&wppa-action=import'; xmlhttp.open( 'POST',url,true ); xmlhttp.setRequestHeader( "Content-type","application/x-www-form-urlencoded" ); xmlhttp.send( fulldata ); jQuery( '#name-'+elm.id ).html( ' <b style="color:blue" >' + '<?php _e('Working...', 'wp-photo-album-plus'); ?> ' + '</b>' ); jQuery( '#wppa-start-ajax' ).css( 'display', 'none' ); jQuery( '#wppa-stop-ajax' ).css( 'display', 'inline' ); } function wppaStopAjaxImport() { wppaImportRuns = false; jQuery( '#wppa-start-ajax' ).css( 'display', 'inline' ); jQuery( '#wppa-stop-ajax' ).css( 'display', 'none' ); } </script> <?php if (($photocount || $videocount || $audiocount) && !$albumcount && !$dircount && !$zipcount) { ?> <input id="wppa-start-ajax" type="button" onclick="if ( wppaVfyAlbum() ) { wppaDoAjaxImport() }" class="button-secundary" value="<?php esc_attr(_e('Start Ajax Import', 'wp-photo-album-plus')); ?> " /> <input id="wppa-stop-ajax" style="display:none;" type="button" onclick="wppaStopAjaxImport()" class="button-secundary" value="<?php esc_attr(_e('Stop Ajax Import', 'wp-photo-album-plus')); ?> " /> <?php } ?> </p> </form> <?php } else { if ($source_type == 'local') { wppa_ok_message(__('There are no importable files found in directory:', 'wp-photo-album-plus') . ' ' . $source); } else { wppa_ok_message(__('There are no photos found or left to process at url:', 'wp-photo-album-plus') . ' ' . $source_url); } } echo '<br /><b>'; _e('You can import the following file types:', 'wp-photo-album-plus'); echo '</b><br />'; if (PHP_VERSION_ID >= 50207) { echo '<br />'; _e('Compressed file types: .zip', 'wp-photo-album-plus'); } if (true) { echo '<br />'; _e('Photo file types:', 'wp-photo-album-plus'); foreach ($wppa_supported_photo_extensions as $ext) { echo ' .' . $ext; } } if (wppa_switch('enable_video')) { echo '<br />'; _e('Video file types:', 'wp-photo-album-plus'); foreach ($wppa_supported_video_extensions as $ext) { echo ' .' . $ext; } } if (wppa_switch('enable_audio')) { echo '<br />'; _e('Audio file types:', 'wp-photo-album-plus'); foreach ($wppa_supported_audio_extensions as $ext) { echo ' .' . $ext; } } echo '<br />'; _e('WPPA+ file types: .amf .pmf', 'wp-photo-album-plus'); echo '<br />'; _e('Directories with optional subdirs containig photos', 'wp-photo-album-plus'); echo '<br />'; _e('Custom data files of type .csv', 'wp-photo-album-plus'); echo '<br /><br />'; _e('Your depot directory is:', 'wp-photo-album-plus'); echo '<b> .../' . WPPA_DEPOT . '/</b>'; if (wppa('continue')) { wppa_warning_message(__('Trying to continue...', 'wp-photo-album-plus')); echo '<script type="text/javascript">document.location=\'' . get_admin_url() . 'admin.php?page=wppa_import_photos&continue&nonce=' . wp_create_nonce('dirimport') . '\';</script>'; } echo '<br /><br />'; wppa_album_admin_footer(); echo '</div><!-- .wrap -->'; }
function wppa_user_upload() { global $wpdb; static $done; wppa_dbg_msg('Usr_upl entered'); if ($done) { return; } // Already done $done = true; // Mark as done // Upload possible? $may_upload = wppa_switch('user_upload_on'); if (wppa_switch('user_upload_login')) { if (!is_user_logged_in()) { $may_upload = false; } // Must login } // Create album possible? $may_create = wppa_switch('user_create_on'); if (wppa_switch('user_create_login')) { if (!is_user_logged_in()) { $may_create = false; } // Must login } // Edit album possible? $may_edit = wppa_switch('user_album_edit_on'); // Do create if ($may_create) { if (wppa_get_post('wppa-fe-create')) { // Create album $nonce = wppa_get_post('nonce'); if (wppa_get_post('wppa-album-name')) { $albumname = trim(strip_tags(wppa_get_post('wppa-album-name'))); } if (!wppa_sanitize_file_name($albumname)) { $albumname = __('New Album', 'wp-photo-album-plus'); } $ok = wp_verify_nonce($nonce, 'wppa-album-check'); if (!$ok) { die('<b>' . __('ERROR: Illegal attempt to create an album.', 'wp-photo-album-plus') . '</b>'); } // Check captcha $captkey = wppa_get_randseed('session'); if (!wppa_check_captcha($captkey)) { wppa_alert(__('Wrong captcha, please try again', 'wp-photo-album-plus')); return; } $parent = strval(intval(wppa_get_post('wppa-album-parent'))); if (!wppa_user_is('administrator') && wppa_switch('default_parent_always')) { $parent = wppa_opt('default_parent'); } $album = wppa_create_album_entry(array('name' => $albumname, 'description' => strip_tags(wppa_get_post('wppa-album-desc')), 'a_parent' => $parent, 'owner' => wppa_switch('frontend_album_public') ? '--- public ---' : wppa_get_user())); if ($album) { wppa_alert(sprintf(__('Album #%s created', 'wp-photo-album-plus'), $album)); wppa_flush_treecounts($parent); wppa_create_pl_htaccess(); } else { wppa_alert(__('Could not create album', 'wp-photo-album-plus')); } } } // Do Upload if ($may_upload) { if (wppa_get_post('wppa-upload-album')) { // Upload photo $nonce = wppa_get_post('nonce'); $ok = wp_verify_nonce($nonce, 'wppa-check'); if (!$ok) { die('<b>' . __('ERROR: Illegal attempt to upload a file.', 'wp-photo-album-plus') . '</b>'); } //print_r($_POST); $alb = wppa_get_post('wppa-upload-album'); if (is_array($_FILES)) { $bret = true; $filecount = '1'; $done = '0'; $fail = '0'; foreach ($_FILES as $file) { if (!is_array($file['error'])) { $bret = wppa_do_frontend_file_upload($file, $alb); // this should no longer happen since the name is incl [] if ($bret) { $done++; } else { $fail++; } } else { $filecount = count($file['error']); for ($i = '0'; $i < $filecount; $i++) { if ($bret) { $f['error'] = $file['error'][$i]; $f['tmp_name'] = $file['tmp_name'][$i]; $f['name'] = $file['name'][$i]; $f['type'] = $file['type'][$i]; $f['size'] = $file['size'][$i]; $bret = wppa_do_frontend_file_upload($f, $alb); if ($bret) { $done++; } else { $fail++; } } } } } $points = '0'; $alert = ''; if ($done) { //SUCCESSFUL UPLOAD, ADD POINTS $points = wppa_opt('cp_points_upload') * $done; $bret = wppa_add_credit_points($points, __('Photo upload', 'wp-photo-album-plus')); $alert .= sprintf(_n('Photo successfully uploaded.', '%s photos successfully uploaded.', $done, 'wp-photo-album-plus'), $done); if ($bret) { $alert .= ' ' . sprintf(__('%s points added.', 'wp-photo-album-plus'), $points); } } if ($fail) { if (!$done) { $alert .= __('Upload failed', 'wp-photo-album-plus'); } else { $alert .= sprintf(_n('1 Upload failed', '%s uploads failed.', $fail, 'wp-photo-album-plus'), $fail); } } $reload = wppa_switch('home_after_upload') && $done ? 'home' : false; wppa_alert($alert, $reload); } } } // Do Edit if ($may_edit) { if (wppa_get_post('wppa-albumeditsubmit')) { $alb = wppa_get_post('wppa-albumeditid'); $name = wppa_get_post('wppa-albumeditname'); $name = trim(strip_tags($name)); if (!wppa_sanitize_file_name($name)) { // Empty album name is not allowed $name = 'Album-#' . $alb; } $description = wppa_get_post('wppa-albumeditdesc'); if (!wp_verify_nonce(wppa_get_post('wppa-albumeditnonce'), 'wppa_nonce_' . $alb)) { die('Security check failure'); } wppa_update_album(array('id' => $alb, 'name' => $name, 'description' => $description, 'modified' => time())); wppa_create_pl_htaccess(); } } }
function _wppa_page_upload() { global $target; global $wppa_revno; global $upload_album; // sanitize system $user = wppa_get_user(); wppa_sanitize_files(); // Sanitize album input if (isset($_POST['wppa-album'])) { $upload_album = strval(intval($_POST['wppa-album'])); } else { $upload_album = null; } // Update watermark settings for the user if new values supplied if (wppa_switch('watermark_on') && (wppa_switch('watermark_user') || current_user_can('wppa_settings'))) { // File if (isset($_POST['wppa-watermark-file'])) { // Sanitize input $watermark_file = $_POST['wppa-watermark-file']; if (stripos($watermark_file, '.png') !== false) { $watermark_file = sanitize_file_name($watermark_file); } else { if (!in_array($watermark_file, array('--- none ---', '---name---', '---filename---', '---description---', '---predef---'))) { $watermark_file = 'nil'; } } // Update setting update_option('wppa_watermark_file_' . $user, $watermark_file); } // Position if (isset($_POST['wppa-watermark-pos'])) { // Sanitize input $watermark_pos = $_POST['wppa-watermark-pos']; if (!in_array($watermark_pos, array('toplft', 'topcen', 'toprht', 'cenlft', 'cencen', 'cenrht', 'botlft', 'botcen', 'botrht'))) { $watermark_pos = 'nil'; } // Update setting update_option('wppa_watermark_pos_' . $user, $watermark_pos); } } // If from album admin set the last album if (isset($_REQUEST['wppa-set-album'])) { wppa_set_last_album(strval(intval($_REQUEST['wppa-set-album']))); } // Do the upload if requested // From BOX A if (isset($_POST['wppa-upload-multiple'])) { check_admin_referer('$wppa_nonce', WPPA_NONCE); wppa_upload_multiple(); if (isset($_POST['wppa-go-edit-multiple'])) { if (current_user_can('wppa_admin')) { wppa_ok_message(__('Connecting to edit album...', 'wp-photo-album-plus')); ?> <script type="text/javascript">document.location = '<?php echo wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit_id=' . $upload_album, 'js'); ?> ';</script> <?php } else { wppa_ok_message(__('Connecting to edit photos...', 'wp-photo-album-plus')); ?> <script type="text/javascript">document.location = '<?php echo wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_edit_photo', 'js'); ?> ';</script> <?php } } } // From BOX B if (isset($_POST['wppa-upload'])) { check_admin_referer('$wppa_nonce', WPPA_NONCE); wppa_upload_photos(); if (isset($_POST['wppa-go-edit-single'])) { if (current_user_can('wppa_admin')) { wppa_ok_message(__('Connecting to edit album...', 'wp-photo-album-plus')); ?> <script type="text/javascript">document.location = '<?php echo wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit_id=' . $upload_album, 'js'); ?> ';</script> <?php } else { wppa_ok_message(__('Connecting to edit photos...', 'wp-photo-album-plus')); ?> <script type="text/javascript">document.location = '<?php echo wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_edit_photo', 'js'); ?> ';</script> <?php } } } // From BOX C if (isset($_POST['wppa-upload-zip'])) { check_admin_referer('$wppa_nonce', WPPA_NONCE); $err = wppa_upload_zip(); if (isset($_POST['wppa-go-import']) && $err == '0') { wppa_ok_message(__('Connecting to your depot...', 'wp-photo-album-plus')); update_option('wppa_import_source_' . $user, WPPA_DEPOT_PATH); ?> <script type="text/javascript">document.location = '<?php echo wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_import_photos&zip=' . $target, 'js'); ?> ';</script> <?php } } // sanitize system again wppa_sanitize_files(); // Open the form echo '<div class="wrap">' . '<h2>' . __('Upload Photos', 'wp-photo-album-plus') . '</h2>'; // Get some req'd data $max_files = ini_get('max_file_uploads'); $max_files_txt = $max_files; if ($max_files < '1') { $max_files_txt = __('unknown', 'wp-photo-album-plus'); $max_files = '15'; } $max_size = ini_get('upload_max_filesize'); /* debug */ // $max_size = '2G'; /**/ $max_size_mbytes = substr($max_size, 0, strlen($max_size) - 1); if (substr($max_size, -1) == 'G') { // May upload gigabytes!! $max_size_mbytes *= 1024; } $max_time = ini_get('max_input_time'); if ($max_time < '1') { $max_time = __('unknown', 'wp-photo-album-plus'); } // check if albums exist before allowing upload if (!wppa_has_albums()) { $url = wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_admin_menu'); echo '<p>' . __('No albums exist. You must', 'wp-photo-album-plus') . ' <a href="' . $url . '" >' . __('create one', 'wp-photo-album-plus') . '</a> ' . __('before you can upload your photos.', 'wp-photo-album-plus') . '</p>' . '</div>'; return; } // Upload One only configured and not administrator or super user? if (wppa_switch('upload_one_only') && !wppa_user_is('administrator')) { // One only echo '<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px; width: 600px;">' . '<h3 style="margin-top:0px;">' . __('Upload a single photo', 'wp-photo-album-plus') . '</h3>' . '<form enctype="multipart/form-data" action="' . wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_upload_photos') . '" method="post">' . wp_nonce_field('$wppa_nonce', WPPA_NONCE) . '<input id="my_files" type="file" name="my_files[]" />' . '<p>' . '<label for="wppa-album">' . __('Album:', 'wp-photo-album-plus') . '</label>' . '<select name="wppa-album" id="wppa-album-s" >' . wppa_album_select_a(array('path' => wppa_switch('hier_albsel'), 'addpleaseselect' => true, 'checkowner' => true, 'checkupload' => true)) . '</select>' . '</p>'; if (wppa_switch('watermark_on') && (wppa_switch('watermark_user') || current_user_can('wppa_settings'))) { echo '<p>' . __('Apply watermark file:', 'wp-photo-album-plus') . '<select name="wppa-watermark-file" id="wppa-watermark-file" >' . wppa_watermark_file_select() . '</select>' . __('Position:', 'wp-photo-album-plus') . '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' . wppa_watermark_pos_select() . '</select>' . '</p>'; } echo '<input' . ' type="submit" class="button-primary"' . ' name="wppa-upload-multiple"' . ' value="' . __('Upload Photo', 'wp-photo-album-plus') . '"' . ' onclick="if ( document.getElementById( \'wppa-album-s\' ).value == 0 ) { alert( \'' . __('Please select an album', 'wp-photo-album-plus') . '\' ); return false; }"' . ' />' . '<input type="checkbox"' . ' id="wppa-go-edit-multiple"' . ' name="wppa-go-edit-multiple"' . ' style="display:none"' . ' checked="checked"' . ' />' . '</form>' . '</div>'; } else { // The information box echo '<div' . ' style="' . 'border:1px solid #ccc;' . 'padding:10px;' . 'margin-bottom:10px;' . 'width:600px;' . 'background-color:#fffbcc;' . 'border-color:#e6db55;' . '"' . ' >' . sprintf(__('<b>Notice:</b> your server allows you to upload <b>%s</b> files of maximum total <b>%s</b> bytes and allows <b>%s</b> seconds to complete.', 'wp-photo-album-plus'), $max_files_txt, $max_size, $max_time) . __('If your request exceeds these limitations, it will fail, probably without an errormessage.', 'wp-photo-album-plus') . __('Additionally your hosting provider may have set other limitations on uploading files.', 'wp-photo-album-plus') . '<br />' . wppa_check_memory_limit() . '</div>'; // Box A: Upload Multple photos echo '<div' . ' style="' . 'border:1px solid #ccc;' . 'padding:10px;' . 'margin-bottom:10px;' . 'width: 600px;' . '"' . ' >' . '<h3 style="margin-top:0px;">' . __('Box A:', 'wp-photo-album-plus') . ' ' . __('Multiple Photos in one selection', 'wp-photo-album-plus') . '</h3>' . sprintf(__('You can select up to %s photos in one selection and upload them.', 'wp-photo-album-plus'), $max_files_txt) . '<br />' . '<small style="color:blue" >' . __('You need a modern browser that supports HTML-5 to select multiple files', 'wp-photo-album-plus') . '</small>' . '<form' . ' enctype="multipart/form-data"' . ' action="' . wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_upload_photos') . '"' . ' method="post" >' . wp_nonce_field('$wppa_nonce', WPPA_NONCE, true, false) . '<input' . ' id="my_files"' . ' type="file"' . ' multiple="multiple"' . ' name="my_files[]"' . ' onchange="showit()"' . ' />' . '<div id="files_list2" >' . '<h3>' . __('Selected Files:', 'wp-photo-album-plus') . '</h3>' . '</div>' . '<script type="text/javascript">' . 'function showit() {' . 'var maxsize = parseInt( \'' . $max_size_mbytes . '\' ) * 1024 * 1024;' . 'var maxcount = parseInt( \'' . $max_files_txt . '\' );' . 'var totsize = 0;' . 'var files = document.getElementById( \'my_files\' ).files;' . 'var tekst = "<h3>' . __('Selected Files:', 'wp-photo-album-plus') . '</h3>";' . 'tekst += "<table><thead><tr>";' . 'tekst += "<td>' . __('Name', 'wp-photo-album-plus') . '</td>";' . 'tekst += "<td>' . __('Size', 'wp-photo-album-plus') . '</td>";' . 'tekst += "<td>' . __('Type', 'wp-photo-album-plus') . '</td>";' . 'tekst += "</tr></thead>";' . 'tekst += "<tbody>";' . 'tekst += "<tr><td><hr /></td><td><hr /></td><td><hr /></td></tr>";' . 'for ( var i=0;i<files.length;i++ ) {' . 'tekst += "<tr>";' . 'tekst += "<td>" + files[i].name + "</td>";' . 'tekst += "<td>" + files[i].size + "</td>";' . 'totsize += files[i].size;' . 'tekst += "<td>" + files[i].type + "</td>";' . 'tekst += "</tr>";' . '}' . 'tekst += "<tr><td><hr /></td><td><hr /></td><td><hr /></td></tr>";' . 'var style1 = "";' . 'var style2 = "";' . 'var style3 = "";' . 'var warn1 = "";' . 'var warn2 = "";' . 'var warn3 = "";' . 'if ( maxcount > 0 && files.length > maxcount ) {' . 'style1 = "color:red";' . 'warn1 = "' . __('Too many!', 'wp-photo-album-plus') . '";' . '}' . 'if ( maxsize > 0 && totsize > maxsize ) {' . 'style2 = "color:red";' . 'warn2 = "' . __('Too big!', 'wp-photo-album-plus') . '";' . '}' . 'if ( warn1 || warn2 ) {' . 'style3 = "color:green";' . 'warn3 = "' . __('Try again!', 'wp-photo-album-plus') . '";' . '}' . 'tekst += "<tr><td style="+style1+" >' . __('Total', 'wp-photo-album-plus') . ': "+files.length+" "+warn1+"</td><td style="+style2+" >"+totsize+" "+warn2+"</td><td style="+style3+" >"+warn3+"</td></tr>";' . 'tekst += "</tbody>";' . 'tekst += "</table>";' . 'jQuery( "#files_list2" ).html( tekst );' . '}' . '</script>' . '<p>' . '<label for="wppa-album">' . __('Album:', 'wp-photo-album-plus') . '</label>' . '<select name="wppa-album" id="wppa-album-s">' . wppa_album_select_a(array('path' => wppa_switch('hier_albsel'), 'addpleaseselect' => true, 'checkowner' => true, 'checkupload' => true)) . '</select>' . '</p>'; // Watermark? if (wppa_switch('watermark_on') && (wppa_switch('watermark_user') || current_user_can('wppa_settings'))) { echo '<p>' . __('Apply watermark file:', 'wp-photo-album-plus') . '<select name="wppa-watermark-file" id="wppa-watermark-file" >' . wppa_watermark_file_select() . '</select>' . __('Position:', 'wp-photo-album-plus') . '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' . wppa_watermark_pos_select() . '</select>' . '</p>'; } // Submit section echo '<input' . ' type="submit"' . ' class="button-primary"' . ' name="wppa-upload-multiple"' . ' value="' . __('Upload Multiple Photos', 'wp-photo-album-plus') . '"' . ' onclick="if ( document.getElementById( \'wppa-album-s\' ).value == 0 ) { alert( \'' . __('Please select an album', 'wp-photo-album-plus') . '\' ); return false; }"' . ' />' . ' ' . '<input' . ' type="checkbox"' . ' id="wppa-go-edit-multiple"' . ' name="wppa-go-edit-multiple"' . ' onchange="wppaCookieCheckbox( this, \'wppa-go-edit-multiple\' )"' . ' />' . '<script type="text/javascript" >' . 'if ( wppa_getCookie( \'wppa-go-edit-multiple\' ) == \'on\' ) document.getElementById( \'wppa-go-edit-multiple\' ).checked = \'checked\';' . '</script>'; if (current_user_can('wppa_admin')) { _e('After upload: Go to the <b>Edit Album</b> page.', 'wp-photo-album-plus'); } else { _e('After upload: Go to the <b>Edit Photos</b> page.', 'wp-photo-album-plus'); } echo '</form>' . '</div>'; // End BOX A // Box B: Single photos echo '<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px; width: 600px;" >' . '<h3 style="margin-top:0px;" >' . __('Box B:', 'wp-photo-album-plus') . ' ' . __('Single Photos in multiple selections', 'wp-photo-album-plus') . '</h3>' . sprintf(__('You can select up to %s photos one by one and upload them at once.', 'wp-photo-album-plus'), $max_files_txt) . '<form' . ' enctype="multipart/form-data"' . ' action="' . wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_upload_photos') . '"' . ' method="post" ' . ' >' . wp_nonce_field('$wppa_nonce', WPPA_NONCE, true, false) . '<input' . ' id="my_file_element"' . ' type="file"' . ' name="file_1"' . '/>' . '<div id="files_list">' . '<h3>' . __('Selected Files:', 'wp-photo-album-plus') . '</h3>' . '</div>' . '<p>' . '<label for="wppa-album">' . __('Album:', 'wp-photo-album-plus') . '</label>' . '<select name="wppa-album" id="wppa-album-m">' . wppa_album_select_a(array('path' => wppa_switch('hier_albsel'), 'addpleaseselect' => true, 'checkowner' => true, 'checkupload' => true)) . '</select>' . '</p>'; // Watermark? if (wppa_switch('watermark_on') && (wppa_switch('watermark_user') || current_user_can('wppa_settings'))) { echo '<p>' . __('Apply watermark file:', 'wp-photo-album-plus') . '<select name="wppa-watermark-file" id="wppa-watermark-file" >' . wppa_watermark_file_select() . '</select>' . __('Position:', 'wp-photo-album-plus') . '<select name="wppa-watermark-pos" id="wppa-watermark-pos" >' . wppa_watermark_pos_select() . '</select>' . '</p>'; } // Submit section echo '<input' . ' type="submit"' . ' class="button-primary"' . ' name="wppa-upload"' . ' value="' . __('Upload Single Photos', 'wp-photo-album-plus') . '"' . ' onclick="if ( document.getElementById( \'wppa-album-m\' ).value == 0 ) { alert( \'' . __('Please select an album', 'wp-photo-album-plus') . '\' ); return false; }"' . ' />' . ' ' . '<input' . ' type="checkbox"' . ' id="wppa-go-edit-single"' . ' name="wppa-go-edit-single"' . ' onchange="wppaCookieCheckbox( this, \'wppa-go-edit-single\' )" />' . '<script type="text/javascript" >' . 'if ( wppa_getCookie( \'wppa-go-edit-single\' ) == \'on\' ) document.getElementById( \'wppa-go-edit-single\' ).checked = \'checked\';' . '</script>'; if (current_user_can('wppa_admin')) { _e('After upload: Go to the <b>Edit Album</b> page.', 'wp-photo-album-plus'); } else { _e('After upload: Go to the <b>Edit Photos</b> page.', 'wp-photo-album-plus'); } echo '</form>' . '<script type="text/javascript">' . '<!-- Create an instance of the multiSelector class, pass it the output target and the max number of files -->' . 'var multi_selector = new MultiSelector( document.getElementById( \'files_list\' ), ' . $max_files . ');' . '<!-- Pass in the file element -->' . 'multi_selector.addElement( document.getElementById( \'my_file_element\' ) );' . '</script>' . '</div>'; // End Box B // Box C: Single zips, useless if user can not imort, or when php <50207: no unzip if (current_user_can('wppa_import')) { if (PHP_VERSION_ID >= 50207) { echo '<div style="border:1px solid #ccc; padding:10px; width: 600px;" >' . '<h3 style="margin-top:0px;" >' . __('Box C:', 'wp-photo-album-plus') . ' ' . __('Zipped Photos in one selection', 'wp-photo-album-plus') . '</h3>' . sprintf(__('You can upload one zipfile. It will be placed in your personal wppa-depot: <b>.../%s</b><br/>Once uploaded, use <b>Import Photos</b> to unzip the file and place the photos in any album.', 'wp-photo-album-plus'), WPPA_DEPOT) . '<form' . ' enctype="multipart/form-data"' . ' action="' . wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_upload_photos') . '"' . ' method="post"' . ' >' . wp_nonce_field('$wppa_nonce', WPPA_NONCE, true, false) . '<input' . ' id="my_zipfile_element"' . ' type="file"' . ' name="file_zip"' . ' />' . '<br/><br/>' . '<input' . ' type="submit"' . ' class="button-primary"' . ' name="wppa-upload-zip"' . ' value="' . __('Upload Zipped Photos', 'wp-photo-album-plus') . '"' . ' />' . ' ' . '<input' . ' type="checkbox"' . ' id="wppa-go-import"' . ' name="wppa-go-import"' . ' onchange="wppaCookieCheckbox( this, \'wppa-go-import\' )"' . ' />' . '<script type="text/javascript" >' . 'if ( wppa_getCookie( \'wppa-go-import\' ) == \'on\' ) document.getElementById( \'wppa-go-import\' ).checked = \'checked\';' . '</script>' . __('After upload: Go to the <b>Import Photos</b> page.', 'wp-photo-album-plus') . '</form>' . '</div>'; } else { echo '<div style="border:1px solid #ccc; padding:10px; width: 600px;">' . '<small>' . __('Ask your administrator to upgrade php to version 5.2.7 or later. This will enable you to upload zipped photos.', 'wp-photo-album-plus') . '</small>' . '</div>'; } } } echo '</div>'; }
function wppa_user_upload() { global $wpdb; static $done; wppa_dbg_msg('Usr_upl entered'); if ($done) { return; } // Already done $done = true; // Mark as done // Upload possible? $may_upload = wppa_switch('user_upload_on'); if (wppa_switch('user_upload_login')) { if (!is_user_logged_in()) { $may_upload = false; } // Must login } // Create album possible? $may_create = wppa_switch('user_create_on'); if (wppa_switch('user_create_login')) { if (!is_user_logged_in()) { $may_create = false; } // Must login } // Edit album possible? $may_edit = wppa_switch('user_album_edit_on'); // Do create if ($may_create) { if (wppa_get_post('wppa-fe-create')) { // Create album $nonce = wppa_get_post('nonce'); if (wppa_get_post('wppa-album-name')) { $albumname = trim(strip_tags(wppa_get_post('wppa-album-name'))); } if (!wppa_sanitize_file_name($albumname)) { $albumname = __('New Album', 'wp-photo-album-plus'); } $ok = wp_verify_nonce($nonce, 'wppa-album-check'); if (!$ok) { die('<b>' . __('ERROR: Illegal attempt to create an album.', 'wp-photo-album-plus') . '</b>'); } // Check captcha if (wppa_switch('user_create_captcha')) { $captkey = wppa_get_randseed('session'); if (!wppa_check_captcha($captkey)) { wppa_alert(__('Wrong captcha, please try again', 'wp-photo-album-plus')); return; } } $parent = strval(intval(wppa_get_post('wppa-album-parent'))); if (!wppa_user_is('administrator') && wppa_switch('default_parent_always')) { $parent = wppa_opt('default_parent'); } $album = wppa_create_album_entry(array('name' => $albumname, 'description' => strip_tags(wppa_get_post('wppa-album-desc')), 'a_parent' => $parent, 'owner' => wppa_switch('frontend_album_public') ? '--- public ---' : wppa_get_user())); if ($album) { if (wppa_switch('fe_alert')) { wppa_alert(sprintf(__('Album #%s created', 'wp-photo-album-plus'), $album)); } wppa_flush_treecounts($parent); wppa_create_pl_htaccess(); } else { wppa_alert(__('Could not create album', 'wp-photo-album-plus')); } } } // Do Upload if ($may_upload) { $blogged = false; if (wppa_get_post('wppa-upload-album')) { // Upload photo $nonce = wppa_get_post('nonce'); $ok = wp_verify_nonce($nonce, 'wppa-check'); if (!$ok) { die('<b>' . __('ERROR: Illegal attempt to upload a file.', 'wp-photo-album-plus') . '</b>'); } $alb = wppa_get_post('wppa-upload-album'); $alb = strval(intval($alb)); // Force numeric if (!wppa_album_exists($alb)) { $alert = sprintf(__('Album %s does not exist', 'wp-photo-album-plus'), $alb); wppa_alert($alert); return; } $uploaded_ids = array(); if (is_array($_FILES)) { $iret = true; $filecount = '1'; $done = '0'; $fail = '0'; foreach ($_FILES as $file) { if (!is_array($file['error'])) { $iret = wppa_do_frontend_file_upload($file, $alb); // this should no longer happen since the name is incl [] if ($iret) { $uploaded_ids[] = $iret; $done++; wppa_set_last_album($alb); } else { $fail++; } } else { $filecount = count($file['error']); for ($i = '0'; $i < $filecount; $i++) { if ($iret) { $f['error'] = $file['error'][$i]; $f['tmp_name'] = $file['tmp_name'][$i]; $f['name'] = $file['name'][$i]; $f['type'] = $file['type'][$i]; $f['size'] = $file['size'][$i]; $iret = wppa_do_frontend_file_upload($f, $alb); if ($iret) { $uploaded_ids[] = $iret; $done++; wppa_set_last_album($alb); } else { $fail++; } } } } } $points = '0'; $alert = ''; $reload = wppa_switch('home_after_upload') && $done ? 'home' : false; if ($done) { // SUCCESSFUL UPLOAD, Blog It? if (current_user_can('edit_posts') && isset($_POST['wppa-blogit'])) { $title = $_POST['wppa-post-title']; if (!$title) { $title = wppa_local_date(); } $pretxt = $_POST['wppa-blogit-pretext']; $posttxt = $_POST['wppa-blogit-posttext']; $status = wppa_switch('blog_it_moderate') ? 'pending' : 'publish'; $post_content = $pretxt; foreach ($uploaded_ids as $id) { $post_content .= str_replace('#id', $id, wppa_opt('blog_it_shortcode')); } $post_content .= $posttxt; $post = array('post_title' => $title, 'post_content' => $post_content, 'post_status' => $status); $post = sanitize_post($post, 'db'); $iret = wp_insert_post($post); $blogged = true; } // ADD POINTS $points = wppa_opt('cp_points_upload') * $done; $bret = wppa_add_credit_points($points, __('Photo upload', 'wp-photo-album-plus')); $alert .= sprintf(_n('%d photo successfully uploaded', '%d photos successfully uploaded', $done, 'wp-photo-album-plus'), $done); if ($bret) { $alert .= ' ' . sprintf(__('%s points added', 'wp-photo-album-plus'), $points); } if (wppa_switch('fe_alert')) { wppa_alert($alert, $reload); } else { wppa_alert('', $reload); } // Blogged? if ($blogged) { if (wppa_switch('fe_alert')) { if ($status == 'pending') { wppa_alert(__('Your post is awaiting moderation.', 'wp-photo-album-plus')); } } echo '<script type="text/javascript" >document.location.href=\'' . home_url() . '\';</script>'; wppa_exit(); } } if ($fail) { if (!$done) { $alert .= __('Upload failed', 'wp-photo-album-plus'); } else { $alert .= sprintf(_n('%d upload failed', '%d uploads failed', $fail, 'wp-photo-album-plus'), $fail); } wppa_alert($alert, $reload); } } } } // Do Edit if ($may_edit) { if (wppa_get_post('wppa-albumeditsubmit')) { // Get album id $alb = wppa_get_post('wppa-albumeditid'); if (!$alb || !wppa_album_exists($alb)) { die('Security check failure'); } // Valid request? if (!wp_verify_nonce(wppa_get_post('wppa-albumeditnonce'), 'wppa_nonce_' . $alb)) { die('Security check failure'); } // Name $name = wppa_get_post('wppa-albumeditname'); $name = trim(strip_tags($name)); if (!$name) { // Empty album name is not allowed $name = 'Album-#' . $alb; } // Description $description = wppa_get_post('wppa-albumeditdesc'); // Custom data $custom = wppa_get_album_item($alb, 'custom'); if ($custom) { $custom_data = unserialize($custom); } else { $custom_data = array('', '', '', '', '', '', '', '', '', ''); } $idx = '0'; while ($idx < '10') { if (isset($_POST['custom_' . $idx])) { $value = wppa_get_post('custom_' . $idx); $custom_data[$idx] = wppa_sanitize_custom_field($value); } $idx++; } $custom = serialize($custom_data); // Update wppa_update_album(array('id' => $alb, 'name' => $name, 'description' => $description, 'custom' => $custom, 'modified' => time())); wppa_index_update('album', $alb); wppa_create_pl_htaccess(); } } }
function wppa_can_create_top_album() { if (wppa_user_is('administrator')) { return true; } if (!wppa_can_create_album()) { return false; } if (wppa_switch('wppa_grant_an_album') && '0' != wppa_opt('wppa_grant_parent')) { return false; } return true; }
function wppa_make_tinymce_dialog() { global $wpdb; // Prepare albuminfo $albums = $wpdb->get_results("SELECT `id`, `name` FROM `" . WPPA_ALBUMS . "` ORDER BY `timestamp` DESC", ARRAY_A); if (wppa_switch('hier_albsel')) { $albums = wppa_add_paths($albums); $albums = wppa_array_sort($albums, 'name'); } // Prepare photoinfo $photos = $wpdb->get_results("SELECT `id`, `name`, `album`, `ext` FROM `" . WPPA_PHOTOS . "` ORDER BY `timestamp` DESC LIMIT 100", ARRAY_A); // Get Tags/cats $tags = wppa_get_taglist(); $cats = wppa_get_catlist(); // Pages suitable for landing $query = "SELECT ID, post_title, post_content, post_parent " . "FROM " . $wpdb->posts . " " . "WHERE post_type = 'page' AND post_status = 'publish' " . "ORDER BY post_title ASC"; $pages = $wpdb->get_results($query, ARRAY_A); if ($pages) { // Add parents optionally OR translate only if (wppa_switch('hier_pagesel')) { $pages = wppa_add_parents($pages); } else { foreach (array_keys($pages) as $index) { $pages[$index]['post_title'] = __(stripslashes($pages[$index]['post_title'])); } } // Sort alpahbetically $pages = wppa_array_sort($pages, 'post_title'); } $admins = array(); if (wppa_user_is('administrator')) { $users = get_users(array('role' => 'administrator')); } // Make the html $result = '<style>#TB_ajaxContent {box-sizing:border-box; width:100% !important;}</style>' . '<div id="wppagallery-form">' . '<style type="text/css">' . '#wppagallery-table tr, #wppagallery-table th, #wppagallery-table td {' . 'padding: 2px; 0;' . '}' . '</style>' . '<table id="wppagallery-table" class="form-table">' . '<tr >' . '<th><label for="wppagallery-top-type">' . __('Type of WPPA display:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-top-type" name="type" onchange="wppaGalleryEvaluate()">' . '<option value="" selected="selected" disabled="disabled" style="color:#700" >-- ' . __('Please select a display type', 'wp-photo-album-plus') . ' --</option>' . '<option value="galerytype" style="color:#070" >' . __('A gallery with covers and/or thumbnails', 'wp-photo-album-plus') . '</option>' . '<option value="slidestype" style="color:#070" >' . __('A slideshow', 'wp-photo-album-plus') . '</option>' . '<option value="singletype" style="color:#070" >' . __('A single image', 'wp-photo-album-plus') . '</option>' . '<option value="searchtype" style="color:#070" >' . __('A search/selection box', 'wp-photo-album-plus') . '</option>' . '<option value="misceltype" style="color:#070" >' . __('An other box type', 'wp-photo-album-plus') . '</option>' . '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-galery-type-tr" style="display:none;" >' . '<th><label for="wppagallery-galery-type">' . __('Type of gallery display:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-galery-type" name="type" onchange="wppaGalleryEvaluate()">' . '<option value="" selected="selected" disabled="disabled" style="color:#700" >-- ' . __('Please select a gallery type', 'wp-photo-album-plus') . ' --</option>' . '<option value="cover" style="color:#070" >' . __('The cover(s) of specific album(s)', 'wp-photo-album-plus') . '</option>' . '<option value="content" style="color:#070" >' . __('The content of specific album(s)', 'wp-photo-album-plus') . '</option>' . '<option value="covers" style="color:#070" >' . __('The covers of the subalbums of specific album(s)', 'wp-photo-album-plus') . '</option>' . '<option value="thumbs" style="color:#070" >' . __('The thumbnails of specific album(s)', 'wp-photo-album-plus') . '</option>' . '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-slides-type-tr" style="display:none;" >' . '<th><label for="wppagallery-slides-type">' . __('Type of slideshow:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-slides-type" name="type" onchange="wppaGalleryEvaluate()">' . '<option value="" selected="selected" disabled="disabled" style="color:#700" >-- ' . __('Please select a slideshow type', 'wp-photo-album-plus') . ' --</option>' . '<option value="slide" style="color:#070" >' . __('A fully featured slideshow', 'wp-photo-album-plus') . '</option>' . '<option value="slideonly" style="color:#070" >' . __('A slideshow without supporting boxes', 'wp-photo-album-plus') . '</option>' . '<option value="slideonlyf" style="color:#070" >' . __('A slideshow with a filmstrip only', 'wp-photo-album-plus') . '</option>' . '<option value="filmonly" style="color:#070" >' . __('A filmstrip only', 'wp-photo-album-plus') . '</option>' . '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-single-type-tr" style="display:none;" >' . '<th><label for="wppagallery-single-type">' . __('Type of single image:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-single-type" name="type" onchange="wppaGalleryEvaluate()">' . '<option value="" selected="selected" disabled="disabled" style="color:#700" >-- ' . __('Please select a single image type', 'wp-photo-album-plus') . ' --</option>' . '<option value="photo" style="color:#070" >' . __('A plain single photo', 'wp-photo-album-plus') . '</option>' . '<option value="mphoto" style="color:#070" >' . __('A single photo with caption', 'wp-photo-album-plus') . '</option>' . '<option value="xphoto" style="color:#070" >' . __('A single photo with extended caption', 'wp-photo-album-plus') . '</option>' . '<option value="slphoto" style="color:#070" >' . __('A single photo in the style of a slideshow', 'wp-photo-album-plus') . '</option>' . '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-search-type-tr" style="display:none;" >' . '<th><label for="wppagallery-search-type">' . __('Type of search:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-search-type" name="type" onchange="wppaGalleryEvaluate()">' . '<option value="" selected="selected" disabled="disabled" style="color:#700" >-- ' . __('Please select a search type', 'wp-photo-album-plus') . ' --</option>' . '<option value="search" style="color:#070" >' . __('A search box', 'wp-photo-album-plus') . '</option>' . '<option value="supersearch" style="color:#070" >' . __('A supersearch box', 'wp-photo-album-plus') . '</option>' . '<option value="tagcloud" style="color:#070" >' . __('A tagcloud box', 'wp-photo-album-plus') . '</option>' . '<option value="multitag" style="color:#070" >' . __('A multitag box', 'wp-photo-album-plus') . '</option>' . '<option value="superview" style="color:#070" >' . __('A superview box', 'wp-photo-album-plus') . '</option>' . '<option value="calendar" style="color:#070" >' . __('A calendar box', 'wp-photo-album-plus') . '</option>' . '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-miscel-type-tr" style="display:none;" >' . '<th><label for="wppagallery-miscel-type">' . __('Type miscellaneous:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-miscel-type" name="type" onchange="wppaGalleryEvaluate()">' . '<option value="" selected="selected" disabled="disabled" style="color:#700" >-- ' . __('Please select a miscellaneous display', 'wp-photo-album-plus') . ' --</option>' . '<option value="generic">' . __('A generic albums display', 'wp-photo-album-plus') . '</option>' . '<option value="upload">' . __('An upload box', 'wp-photo-album-plus') . '</option>' . '<option value="landing">' . __('A landing page shortcode', 'wp-photo-album-plus') . '</option>' . '<option value="stereo">' . __('A 3D stereo settings box', 'wp-photo-album-plus') . '</option>' . '<option value="choice">' . __('An admins choice box', 'wp-photo-album-plus') . '</option>' . '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-admins-tr" style="display:none;" >' . '<th><label for="wppagallery-admins">' . __('Users:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-admins" name="admins" style="color:#070;" multiple="multiple" onchange="wppaGalleryEvaluate()">' . '<option value="" selected="selected" style="color:#070;" >-- ' . __('All', 'wp-photo-album-plus') . ' --</option>'; foreach ($users as $user) { $result .= '<option value="' . $user->data->user_login . '" class="wppagallery-admin" style="color:#070;" >' . $user->data->user_login . '</option>'; } $users = get_option('wppa_super_users', array()); foreach ($users as $user) { $result .= '<option value="' . $user . '" class="wppagallery-admin" style="color:#070" >' . $user . '</option>'; } $result .= '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-album-type-tr" style="display:none;" >' . '<th><label for="wppagallery-album-type">' . __('Kind of selection:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-album-type" name="type" onchange="wppaGalleryEvaluate()">' . '<option value="" selected="selected" disabled="disabled" style="color:#700" >-- ' . __('Please select a type of selection to be used', 'wp-photo-album-plus') . ' --</option>' . '<option value="real">' . __('One or more wppa+ albums', 'wp-photo-album-plus') . '</option>' . '<option value="virtual">' . __('A special selection', 'wp-photo-album-plus') . '</option>' . '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-album-virt-tr" style="display:none;" >' . '<th><label for="wppagallery-album-virt">' . __('The selection to be used:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-album-virt" name="album" class="wppagallery-album" onchange="wppaGalleryEvaluate()">' . '<option value="" disabled="disabled" selected="selected" style="color:#700" >-- ' . __('Please select a virtual album', 'wp-photo-album-plus') . ' --</option>' . '<option value="#last" >' . __('The most recently modified album', 'wp-photo-album-plus') . '</option>' . '<option value="#topten" >' . __('The top rated photos', 'wp-photo-album-plus') . '</option>' . '<option value="#lasten" >' . __('The most recently uploaded photos', 'wp-photo-album-plus') . '</option>' . '<option value="#featen" >' . __('A random selection of featured photos', 'wp-photo-album-plus') . '</option>' . '<option value="#comten" >' . __('The most recently commented photos', 'wp-photo-album-plus') . '</option>' . '<option value="#tags" >' . __('Photos tagged with certain tags', 'wp-photo-album-plus') . '</option>' . '<option value="#cat" >' . __('Albums tagged with a certain category', 'wp-photo-album-plus') . '</option>' . '<option value="#owner" >' . __('Photos in albums owned by a certain user', 'wp-photo-album-plus') . '</option>' . '<option value="#upldr" >' . __('Photos uploaded by a certain user', 'wp-photo-album-plus') . '</option>' . '<option value="#all" >' . __('All photos in the system', 'wp-photo-album-plus') . '</option>' . '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-album-virt-cover-tr" style="display:none;" >' . '<th><label for="wppagallery-album-virt-cover">' . __('The selection to be used:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-album-virt-cover" name="album" class="wppagallery-album" onchange="wppaGalleryEvaluate()">' . '<option value="" disabled="disabled" selected="selected" style="color:#700" >-- ' . __('Please select a virtual album', 'wp-photo-album-plus') . ' --</option>' . '<option value="#last" >' . __('The most recently modified album', 'wp-photo-album-plus') . '</option>' . '<option value="#owner" >' . __('Albums owned by a certain user', 'wp-photo-album-plus') . '</option>' . '<option value="#cat" >' . __('Albums tagged with certain categories', 'wp-photo-album-plus') . '</option>' . '<option value="#all" >' . __('All albums in the system', 'wp-photo-album-plus') . '</option>' . '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-album-real-tr" style="display:none;" >' . '<th><label for="wppagallery-album-real">' . __('The Album(s) to be used:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-album-real" style="max-width:400px;" name="album" multiple="multiple" onchange="wppaGalleryEvaluate()">'; if ($albums) { // Please select $result .= '<option id="wppagallery-album-0" value="0" disabled="disabled" selected="selected" style="color:#700" >-- ' . __('Please select one or more albums', 'wp-photo-album-plus') . ' --</option>'; // All standard albums foreach ($albums as $album) { $id = $album['id']; $result .= '<option class="wppagallery-album-r" value="' . $id . '" >' . stripslashes(__($album['name'])) . ' (' . $id . ')</option>'; } } else { $result .= '<option value="0" >' . __('There are no albums yet', 'wp-photo-album-plus') . '</option>'; } $result .= '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-album-real-search-tr" style="display:none;" >' . '<th><label for="">' . __('Search album:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<input id="wppagallery-album-real-search" type="text" onkeyup="wppaGalleryEvaluate()" />' . '<br />' . '<small>' . __('Enter a (part of) the album name to limit the options in the selection box above.', 'wp-photo-album-plus') . ' ' . '</small>' . '</td>' . '</tr>' . '<tr id="wppagallery-album-realopt-tr" style="display:none;" >' . '<th><label for="wppagallery-album-realopt">' . __('The Album(s) to be used:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-album-realopt" style="max-width:400px;" name="album" multiple="multiple" onchange="wppaGalleryEvaluate()">'; if ($albums) { // Please select $result .= '<option id="wppagallery-album-0" class="wppagallery-album-ropt" value="0" selected="selected" style="color:#070" >-- ' . __('All albums', 'wp-photo-album-plus') . ' --</option>'; // All standard albums foreach ($albums as $album) { $id = $album['id']; $result .= '<option class="wppagallery-album-ropt" style="color:#070" value="' . $id . '" >' . stripslashes(__($album['name'])) . ' (' . $id . ')</option>'; } } else { $result .= '<option value="0" >' . __('There are no albums yet', 'wp-photo-album-plus') . '</option>'; } $result .= '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-owner-tr" style="display:none" >' . '<th><label for="wppagallery-owner">' . __('The album owner:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-owner" name="owner" class="wppagallery-owner" onchange="wppaGalleryEvaluate()">' . '<option value="" disabled="disabled" selected="selected" style="color:#700" >-- ' . __('Please select a user', 'wp-photo-album-plus') . ' --</option>' . '<option value="#me" >-- ' . __('The logged in visitor', 'wp-photo-album-plus') . ' --</option>'; $users = wppa_get_users(); if ($users) { foreach ($users as $user) { $result .= '<option value="' . $user['user_login'] . '" >' . $user['display_name'] . '</option>'; } } else { // Too many $result .= '<option value="xxx" >-- ' . __('Too many users, edit manually', 'wp-photo-album-plus') . ' --</option>'; } $result .= '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-owner-parent-tr" style="display:none;" >' . '<th><label for="wppagallery-owner-parent">' . __('Parent album:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-owner-parent" style="color:#070;max-width:400px;" name="parentalbum" multiple="multiple" onchange="wppaGalleryEvaluate()">'; if ($albums) { // Please select $result .= '<option value="" selected="selected" >-- ' . __('No parent specification', 'wp-photo-album-plus') . ' --</option>'; // Generic $result .= '<option value="0" >-- ' . __('The generic parent', 'wp-photo-album-plus') . ' --</option>'; // All standard albums foreach ($albums as $album) { $id = $album['id']; $result .= '<option class="wppagallery-album-p" value="' . $id . '" >' . stripslashes(__($album['name'])) . ' (' . $id . ')</option>'; } } else { $result .= '<option value="0" >' . __('There are no albums yet', 'wp-photo-album-plus') . '</option>'; } $result .= '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-album-parent-tr" style="display:none;" >' . '<th><label for="wppagallery-album-parent">' . __('Parent album:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-album-parent-parent" style="color:#070;max-width:400px;" name="parentalbum" onchange="wppaGalleryEvaluate()">'; if ($albums) { // Please select $result .= '<option id="wppagallery-album-0" value="0" selected="selected" style="color:#700" >-- ' . __('The generic parent', 'wp-photo-album-plus') . ' --</option>'; // All standard albums foreach ($albums as $album) { $id = $album['id']; $result .= '<option class="wppagallery-album" value="' . $id . '" >' . stripslashes(__($album['name'])) . ' (' . $id . ')</option>'; } } else { $result .= '<option value="0" >' . __('There are no albums yet', 'wp-photo-album-plus') . '</option>'; } $result .= '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-album-count-tr" style="display:none;" >' . '<th><label for="wppagallery-album-count">' . __('Max Albums:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<input id="wppagallery-album-count" type="text" style="color:#070;" value="1" onchange="wppaGalleryEvaluate()" />' . '</td>' . '</tr>' . '<tr id="wppagallery-photo-count-tr" style="display:none;" >' . '<th><label for="wppagallery-photo-count">' . __('Max Photos:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<input id="wppagallery-photo-count" type="text" style="color:#070;" value="1" onchange="wppaGalleryEvaluate()" />' . '</td>' . '</tr>' . '<tr id="wppagallery-albumcat-tr" style="display:none;" >' . '<th><label for="wppagallery-albumcat">' . __('The album cat(s):', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-albumcat" style="color:#700;" onchange="wppaGalleryEvaluate()" multiple="multiple" >' . '<option value="" disabled="disabled" selected="selected" style="color:#700" >' . __('--- please select category ---', 'wp-photo-album-plus') . '</option>'; if ($cats) { foreach (array_keys($cats) as $cat) { $result .= '<option class="wppagallery-albumcat" value="' . $cat . '" >' . $cat . '</option>'; } } $result .= '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-photo-tr" style="display:none;" >' . '<th><label for="wppagallery-photo" class="wppagallery-photo" >' . __('The Photo to be used:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-photo" name="photo" class="wppagallery-photo" onchange="wppaGalleryEvaluate()" >'; if ($photos) { // Please select $result .= '<option value="" disabled="disabled" selected="selected" style="color:#700" >-- ' . __('Please select a photo', 'wp-photo-album-plus') . ' --</option>'; $result .= '<option value="#potd" >-- ' . __('The photo of the day', 'wp-photo-album-plus') . ' --</option>'; // Most recent 100 photos foreach ($photos as $photo) { $name = stripslashes(__($photo['name'])); if (strlen($name) > '50') { $name = substr($name, '0', '50') . '...'; } if (get_option('wppa_file_system') == 'flat') { $result .= '<option value="' . wppa_fix_poster_ext($photo['id'] . '.' . $photo['ext'], $photo['id']) . '" >' . $name . ' (' . wppa_get_album_name($photo['album']) . ')' . '</option>'; } else { $result .= '<option value="' . wppa_fix_poster_ext(wppa_expand_id($photo['id']) . '.' . $photo['ext'], $photo['id']) . '" >' . $name . ' (' . wppa_get_album_name($photo['album']) . ')' . '</option>'; } } $result .= '<option value="#last" >-- ' . __('The most recently uploaded photo', 'wp-photo-album-plus') . ' --</option>' . '<option value="#potd" >-- ' . __('The photo of the day', 'wp-photo-album-plus') . ' --</option>'; } else { $result .= '<option value="0" >' . __('There are no photos yet', 'wp-photo-album-plus') . '</option>'; } $result .= '</select>' . '<br />' . '<small style="display:none;" class="wppagallery-photo" >' . __('Specify the photo to be used', 'wp-photo-album-plus') . '<br />' . __('You can select from a maximum of 100 most recently added photos', 'wp-photo-album-plus') . '<br />' . '</small>' . '</td>' . '</tr>' . '<tr id="wppagallery-photo-preview-tr" style="display:none;" >' . '<th><label for="wppagallery-photo-preview" >' . __('Preview image:', 'wp-photo-album-plus') . '</label></th>' . '<td id="wppagallery-photo-preview" style="text-align:center;" >' . '</td >' . '</tr>' . '<tr id="wppagallery-phototags-tr" style="display:none;" >' . '<th><label for="wppagallery-phototags">' . __('The photo tag(s):', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-phototags" style="color:#700;" multiple="multiple" onchange="wppaGalleryEvaluate()">' . '<option value="" disabled="disabled" selected="selected" style="color:#700" >' . __('--- please select tag(s) ---', 'wp-photo-album-plus') . '</option>'; if ($tags) { foreach (array_keys($tags) as $tag) { $result .= '<option class="wppagallery-phototags" value="' . $tag . '" >' . $tag . '</option>'; } } $result .= '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-tags-cats-tr" style="display:none;" >' . '<th><label>' . __('Or / And:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<input id="wppagallery-or" type="radio" name="andor" value="or" onchange="wppaGalleryEvaluate()"/>' . __('Meet any', 'wp-photo-album-plus') . ' ' . '<input id="wppagallery-and" type="radio" name="andor" value="and" onchange="wppaGalleryEvaluate()"/>' . __('Meet all', 'wp-photo-album-plus') . '</td>' . '</tr>' . '<tr id="wppagallery-search-tr" style="display:none;" >' . '<th><label>' . __('Additional features:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<input id="wppagallery-sub" type="checkbox" name="sub" onchange="wppaGalleryEvaluate()"/>' . __('Enable Subsearch', 'wp-photo-album-plus') . ' ' . '<input id="wppagallery-root" type="checkbox" name="root" onchange="wppaGalleryEvaluate()"/>' . __('Enable Rootsearch', 'wp-photo-album-plus') . '</td>' . '</tr>' . '<tr id="wppagallery-rootalbum-tr" style="display:none;" >' . '<th><label>' . __('Search root:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-rootalbum" style="color:#070" onchange="wppaGalleryEvaluate()" >' . '<option value="0" selected="selected" >' . __('--- default ---', 'wp-photo-album-plus') . '</option>'; if ($albums) { // All standard albums foreach ($albums as $album) { $id = $album['id']; $result .= '<option class="wppagallery-rootalbum" value="' . $id . '" >' . stripslashes(__($album['name'])) . ' (' . $id . ')</option>'; } } $result .= '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-landing-tr" style="display:none;" >' . '<th><label>' . __('Landing page:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-landing" style="color:#070" onchange="wppaGalleryEvaluate()" >' . '<option value="0" selected="selected" >' . __('--- default ---', 'wp-photo-album-plus') . '</option>'; if ($pages) { foreach ($pages as $page) { $dis = ''; if (strpos($page['post_content'], '[wppa') === false) { $dis = ' disabled="disabled"'; } $result .= '<option value="' . $page['ID'] . '"' . $dis . ' >' . __($page['post_title']) . '</option>'; } } $result .= '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-taglist-tr" style="display:none;" >' . '<th><label>' . __('Additional features:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<input id="wppagallery-alltags" type="checkbox" checked="checked" name="alltags" onchange="wppaGalleryEvaluate()"/>' . __('Enable all tags', 'wp-photo-album-plus') . ' ' . '<select id="wppagallery-seltags" style="color:#070; display:none;" name="seltags" multiple="multiple" onchange="wppaGalleryEvaluate()">'; if ($tags) { '<option value="" disabled="disabled" selected="selected" style="color:#700" >-- ' . __('Please select the tags to show', 'wp-photo-album-plus') . ' --</option>'; foreach (array_keys($tags) as $tag) { $result .= '<option class="wppagallery-taglist-tags" value="' . $tag . '"style="color:#700" >' . $tag . '</option>'; } } else { '<option value="" disabled="disabled" selected="selected" style="color:#700" >-- ' . __('There are no tags', 'wp-photo-album-plus') . ' --</option>'; } $result .= '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-album-super-tr" style="display:none;" >' . '<th><label for="wppagallery-album-super">' . __('Parent album:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-album-super-parent" style="color:#070;max-width:400px;" name="parentalbum" onchange="wppaGalleryEvaluate()">'; if ($albums) { // Please select $result .= '<option value="" selected="selected" style="color:#700" >-- ' . __('The generic parent', 'wp-photo-album-plus') . ' --</option>'; // All standard albums foreach ($albums as $album) { $id = $album['id']; $result .= '<option class="wppagallery-album" value="' . $id . '" >' . stripslashes(__($album['name'])) . ' (' . $id . ')</option>'; } } else { $result .= '<option value="0" >' . __('There are no albums yet', 'wp-photo-album-plus') . '</option>'; } $result .= '</select>' . '</td>' . '</tr>' . '<tr id="wppagallery-calendar-tr" style="display:none;" >' . '<th><label for="wppagallery-calendar">' . __('Calendar type:', 'wp-photo-album-plus') . '</lable></th>' . '<td>' . '<select id="wppagallery-calendar-type" style="color:#070;max-width:400px;" onchange="wppaGalleryEvaluate()" >' . '<option value="exifdtm" >' . __('By EXIF date', 'wp-photo-album-plus') . '</option>' . '<option value="timestamp" >' . __('By date of upload', 'wp-photo-album-plus') . '</option>' . '<option value="modified" >' . __('By date last modified', 'wp-photo-album-plus') . '</option>' . '</select>' . '<br />' . '<input type="checkbox" id="wppagallery-calendar-reverse" onchange="wppaGalleryEvaluate()" >' . __('Last date first', 'wp-photo-album-plus') . ' ' . '<input type="checkbox" id="wppagallery-calendar-allopen" onchange="wppaGalleryEvaluate()" >' . __('Initially display all', 'wppw', 'wp-photo-album-plus') . '</td>' . '</tr>' . '<tr>' . '<th><label for="wppagallery-size">' . __('The size of the display:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<input type="text" id="wppagallery-size" value="" style="color:#070;" onchange="wppaGalleryEvaluate();"/>' . '<br />' . '<small>' . __('Specify the horizontal size in pixels or <span style="color:blue" >auto</span>.', 'wp-photo-album-plus') . ' ' . __('A value less than <span style="color:blue" >100</span> will automaticly be interpreted as a <span style="color:blue" >percentage</span> of the available space.', 'wp-photo-album-plus') . __('For responsive with a fixed maximum, add the max to auto e.g. <span style="color:blue" >auto,550</span>', 'wp-photo-album-plus') . '<br />' . __('Leave this blank for default size', 'wp-photo-album-plus') . '</small>' . '</td>' . '</tr>' . '<tr>' . '<th><label for="wppagallery-align">' . __('Horizontal alignment:', 'wp-photo-album-plus') . '</label></th>' . '<td>' . '<select id="wppagallery-align" name="align" style="color:#070;" onchange="wppaGalleryEvaluate();">' . '<option value="none" >' . __('--- none ---', 'wp-photo-album-plus') . '</option>' . '<option value="left" >' . __('left', 'wp-photo-album-plus') . '</option>' . '<option value="center" >' . __('center', 'wp-photo-album-plus') . '</option>' . '<option value="right" >' . __('right', 'wp-photo-album-plus') . '</option>' . '</select>' . '<br />' . '<small>' . __('Specify the alignment to be used or --- none ---', 'wp-photo-album-plus') . '</small>' . '</td>' . '</tr>' . '</table>' . '<div id="wppagallery-shortcode-preview-container" >' . '<input type="text" id="wppagallery-shortcode-preview" style="background-color:#ddd; width:100%; height:26px;" value="[wppa]Any comment[/wppa]" />' . '</div>' . '<div><small>' . __('This is a preview of the shortcode that is being generated. You may edit the comment', 'wp-photo-album-plus') . '</small></div>' . '<p class="submit">' . '<input type="button" id="wppagallery-submit" class="button-primary" value="' . __('Insert Gallery', 'wp-photo-album-plus') . '" name="submit" /> ' . '<input type="button" id="wppagallery-submit-notok" class="button-secundary" value="' . __('insert Gallery', 'wp-photo-album-plus') . '" onclick="alert(\'' . esc_js(__('Please complete the shortcode specs', 'wp-photo-album-plus')) . '\')" /> ' . '</p>' . '</div>' . '<script type="text/javascript" >wppaGalleryEvaluate();</script>'; return $result; }
function wppa_ajax_callback() { global $wpdb; global $wppa_session; wppa('ajax', true); wppa('error', '0'); wppa('out', ''); $wppa_session['page']--; $wppa_session['ajax']++; wppa_save_session(); // ALTHOUGH IF WE ARE HERE AS FRONT END VISITOR, is_admin() is true. // So, $wppa_opt switches are 'yes' or 'no' and not true or false. // So, always use the function wppa_switch( $slug ) to test on a bool setting // Globally check query args to prevent php injection $wppa_args = array('album', 'photo', 'slide', 'cover', 'occur', 'woccur', 'searchstring', 'topten', 'lasten', 'comten', 'featen', 'single', 'photos-only', 'debug', 'relcount', 'upldr', 'owner', 'rootsearch'); foreach ($_REQUEST as $arg) { if (in_array(str_replace('wppa-', '', $arg), $wppa_args)) { if (strpos($arg, '<?') !== false) { die('Security check failure #91'); } if (strpos($arg, '?>') !== false) { die('Security check failure #92'); } } } wppa_vfy_arg('wppa-action', true); wppa_vfy_arg('photo-id'); wppa_vfy_arg('comment-id'); wppa_vfy_arg('moccur'); wppa_vfy_arg('comemail', true); wppa_vfy_arg('comname', true); wppa_vfy_arg('tag', true); $wppa_action = $_REQUEST['wppa-action']; switch ($wppa_action) { case 'getssiptclist': $tag = str_replace('H', '#', $_REQUEST['tag']); $mocc = $_REQUEST['moccur']; $oldvalue = ''; if (strpos($wppa_session['supersearch'], ',') !== false) { $ss_data = explode(',', $wppa_session['supersearch']); if (count($ss_data) == '4') { if ($ss_data['0'] == 'p') { if ($ss_data['1'] == 'i') { if ($ss_data['2'] == $_REQUEST['tag']) { $oldvalue = $ss_data['3']; } } } } } $iptcdata = $wpdb->get_results($wpdb->prepare("SELECT * FROM `" . WPPA_IPTC . "` WHERE `photo` > '0' AND `tag` = %s ORDER BY `description`", $tag), ARRAY_A); $last = ''; $any = false; if (is_array($iptcdata)) { foreach ($iptcdata as $item) { $desc = sanitize_text_field($item['description']); $desc = str_replace(array(chr(0), chr(1), chr(2), chr(3), chr(4), chr(5), chr(6), chr(7)), '', $desc); if ($desc != $last) { $sel = $oldvalue && $oldvalue == $desc ? 'selected="selected"' : ''; if ($sel) { echo 'selected:' . $oldvalue; } $ddesc = strlen($desc) > '32' ? substr($desc, 0, 30) . '...' : $desc; echo '<option' . ' value="' . esc_attr($desc) . '"' . ' class="wppa-iptclist-' . $mocc . '"' . ' ' . $sel . ' >' . $ddesc . '</option>'; $last = $desc; $any = true; } } } if (!$any) { $query = $wpdb->prepare("DELETE FROM `" . WPPA_IPTC . "` WHERE `photo` = '0' AND `tag` = %s", $tag); $wpdb->query($query); // wppa_log( 'dbg', $query ); } wppa_exit(); break; case 'getssexiflist': $tag = str_replace('H', '#', $_REQUEST['tag']); $mocc = $_REQUEST['moccur']; $oldvalue = ''; if (strpos($wppa_session['supersearch'], ',') !== false) { $ss_data = explode(',', $wppa_session['supersearch']); if (count($ss_data) == '4') { if ($ss_data['0'] == 'p') { if ($ss_data['1'] == 'e') { if ($ss_data['2'] == $_REQUEST['tag']) { $oldvalue = $ss_data['3']; } } } } } $exifdata = $wpdb->get_results($wpdb->prepare("SELECT * FROM `" . WPPA_EXIF . "` WHERE `photo` > '0' AND `tag` = %s ORDER BY `description`", $tag), ARRAY_A); $last = ''; $any = false; if (is_array($exifdata)) { foreach ($exifdata as $item) { $desc = sanitize_text_field($item['description']); $desc = str_replace(array(chr(0), chr(1), chr(2), chr(3), chr(4), chr(5), chr(6), chr(7)), '', $desc); if ($desc != $last) { $sel = $oldvalue && $oldvalue == $desc ? 'selected="selected"' : ''; $ddesc = strlen($desc) > '32' ? substr($desc, 0, 30) . '...' : $desc; echo '<option' . ' value="' . esc_attr($desc) . '"' . ' class="wppa-exiflist-' . $mocc . '"' . ' ' . $sel . ' >' . $ddesc . '</option>'; $last = $desc; $any = true; } } } if (!$any) { $query = $wpdb->prepare("DELETE FROM `" . WPPA_EXIF . "` WHERE `photo` = '0' AND `tag` = %s", $tag); $wpdb->query($query); // wppa_log( 'dbg', $query ); } wppa_exit(); break; case 'front-edit': if (!isset($_REQUEST['photo-id'])) { die('Missing required argument'); } $photo = $_REQUEST['photo-id']; $ok = false; if (current_user_can('wppa_admin')) { $ok = true; } if (wppa_get_user() == wppa_get_photo_owner($photo) && (current_user_can('wppa_upload') || is_user_logged_in() && wppa_switch('upload_edit'))) { $ok = true; } if (!$ok) { die('You do not have sufficient rights to do this'); } require_once 'wppa-photo-admin-autosave.php'; wppa('front_edit', true); echo ' <div style="padding-bottom:4px;height:24px;" > <span style="color:#777;" > <i>' . __('All modifications are instantly updated on the server. The <b style="color:#070" >Remark</b> field keeps you informed on the actions taken at the background.', 'wp-photo-album-plus') . '</i> </span> <input id="wppa-fe-exit" type="button" style="float:right;color:red;font-weight:bold;" onclick="window.opener.location.reload( true );window.close();" value="' . __('Exit & Refresh', 'wp-photo-album-plus') . '" /> <div id="wppa-fe-count" style="float:right;" ></div> </div><div style="clear:both;"></div>'; wppa_album_photos('', $photo); wppa_exit(); break; case 'do-comment': // Security check $mocc = $_REQUEST['moccur']; $nonce = $_REQUEST['wppa-nonce']; if (!wp_verify_nonce($nonce, 'wppa-nonce-' . $mocc)) { _e('Security check failure', 'wp-photo-album-plus'); wppa_exit(); } // Correct the fact that this is a non-admin operation, if it is only if (is_admin()) { require_once 'wppa-non-admin.php'; } wppa('mocc', $_REQUEST['moccur']); wppa('comment_photo', isset($_REQUEST['photo-id']) ? $_REQUEST['photo-id'] : '0'); wppa('comment_id', isset($_REQUEST['comment-edit']) ? $_REQUEST['comment-edit'] : '0'); $comment_allowed = !wppa_switch('comment_login') || is_user_logged_in(); if (wppa_switch('show_comments') && $comment_allowed) { // if ( wppa_switch( 'search_comments' ) ) wppa_index_remove( 'photo', $_REQUEST['photo-id'] ); wppa_do_comment($_REQUEST['photo-id']); // Process the comment if (wppa_switch('search_comments')) { wppa_index_update('photo', $_REQUEST['photo-id']); } } wppa('no_esc', true); echo wppa_comment_html($_REQUEST['photo-id'], $comment_allowed); // Retrieve the new commentbox content wppa_exit(); break; case 'import': require_once 'wppa-upload.php'; _wppa_page_import(); wppa_exit(); break; case 'approve': $iret = '0'; if (!current_user_can('wppa_moderate') && !current_user_can('wppa_comments')) { _e('You do not have the rights to moderate photos this way', 'wp-photo-album-plus'); wppa_exit(); } if (isset($_REQUEST['photo-id']) && current_user_can('wppa_moderate')) { $iret = $wpdb->query($wpdb->prepare("UPDATE `" . WPPA_PHOTOS . "` SET `status` = 'publish' WHERE `id` = %s", $_REQUEST['photo-id'])); wppa_flush_upldr_cache('photoid', $_REQUEST['photo-id']); $alb = $wpdb->get_var($wpdb->prepare("SELECT `album` FROM `" . WPPA_PHOTOS . "` WHERE `id` = %s", $_REQUEST['photo-id'])); wppa_clear_taglist(); wppa_flush_treecounts($alb); } if (isset($_REQUEST['comment-id'])) { $iret = $wpdb->query($wpdb->prepare("UPDATE `" . WPPA_COMMENTS . "` SET `status` = 'approved' WHERE `id` = %s", $_REQUEST['comment-id'])); } if ($iret) { echo 'OK'; } else { if (isset($_REQUEST['photo-id'])) { if (current_user_can('wppa_moderate')) { echo sprintf(__('Failed to update stutus of photo %s', 'wp-photo-album-plus'), $_REQUEST['photo-id']) . "\n" . __('Please refresh the page', 'wp-photo-album-plus'); } else { _e('Security check failure', 'wp-photo-album-plus'); } } if (isset($_REQUEST['comment-id'])) { echo sprintf(__('Failed to update stutus of comment %s', 'wp-photo-album-plus'), $_REQUEST['comment-id']) . "\n" . __('Please refresh the page', 'wp-photo-album-plus'); } } wppa_exit(); case 'remove': if (isset($_REQUEST['photo-id'])) { // Remove photo if (wppa_user_is('administrator') || current_user_can('wppa_moderate') || wppa_get_user() == wppa_get_photo_owner($_REQUEST['photo-id']) && wppa_switch('upload_edit')) { // Frontend delete? wppa_delete_photo($_REQUEST['photo-id']); echo 'OK||' . __('Photo removed', 'wp-photo-album-plus'); wppa_exit(); } } if (!current_user_can('wppa_moderate') && !current_user_can('wppa_comments')) { _e('You do not have the rights to moderate photos this way', 'wp-photo-album-plus'); wppa_exit(); } if (isset($_REQUEST['photo-id'])) { // Remove photo if (!current_user_can('wppa_moderate')) { _e('Security check failure', 'wp-photo-album-plus'); wppa_exit(); } wppa_delete_photo($_REQUEST['photo-id']); echo 'OK||' . __('Photo removed', 'wp-photo-album-plus'); wppa_exit(); } if (isset($_REQUEST['comment-id'])) { // Remove comment $iret = $wpdb->query($wpdb->prepare("DELETE FROM `" . WPPA_COMMENTS . "` WHERE `id`= %s", $_REQUEST['comment-id'])); if ($iret) { echo 'OK||' . __('Comment removed', 'wp-photo-album-plus'); } else { _e('Could not remove comment', 'wp-photo-album-plus'); } wppa_exit(); } _e('Unexpected error', 'wp-photo-album-plus'); wppa_exit(); case 'downloadalbum': // Feature enabled? if (!wppa_switch('allow_download_album')) { echo '||ER||' . __('This feature is not enabled on this website', 'wp-photo-album-plus'); wppa_exit(); } // Validate args $alb = $_REQUEST['album-id']; $status = "`status` <> 'pending' AND `status` <> 'scheduled'"; if (!is_user_logged_in()) { $status .= " AND `status` <> 'private'"; } $photos = $wpdb->get_results($wpdb->prepare("SELECT * FROM `" . WPPA_PHOTOS . "` WHERE `album` = %s AND ( ( " . $status . " ) OR owner = %s ) " . wppa_get_photo_order($alb), $alb, wppa_get_user()), ARRAY_A); if (!$photos) { echo '||ER||' . __('The album is empty', 'wp-photo-album-plus'); wppa_exit(); } // Remove obsolete files wppa_delete_obsolete_tempfiles(); // Open zipfile if (!class_exists('ZipArchive')) { echo '||ER||' . __('Unable to create zip archive', 'wp-photo-album-plus'); wppa_exit(); } $zipfilename = wppa_get_album_name($alb); $zipfilename = wppa_sanitize_file_name($zipfilename . '.zip'); // Remove illegal chars $zipfilepath = WPPA_UPLOAD_PATH . '/temp/' . $zipfilename; if (is_file($zipfilepath)) { // unlink( $zipfilepath ); // Debug } $wppa_zip = new ZipArchive(); $iret = $wppa_zip->open($zipfilepath, 1); if ($iret !== true) { echo '||ER||' . sprintf(__('Unable to create zip archive. code = %s', 'wp-photo-album-plus'), $iret); wppa_exit(); } // Add photos to zip $stop = false; foreach ($photos as $p) { if (wppa_is_time_up()) { wppa_log('obs', 'Time up during album to zip creation'); $stop = true; } else { $id = $p['id']; if (!wppa_is_multi($id)) { $source = wppa_switch('download_album_source') && is_file(wppa_get_source_path($id)) ? wppa_get_source_path($id) : wppa_get_photo_path($id); if (is_file($source)) { $dest = $p['filename'] ? wppa_sanitize_file_name($p['filename']) : wppa_sanitize_file_name(wppa_strip_ext($p['name']) . '.' . $p['ext']); $dest = wppa_fix_poster_ext($dest, $id); $iret = $wppa_zip->addFile($source, $dest); // To prevent too may files open, and to have at least a file when there are too many photos, close and re-open $wppa_zip->close(); $wppa_zip->open($zipfilepath); // wppa_log( 'dbg', 'Added ' . basename($source) . ' to ' . basename($zipfilepath)); } } } if ($stop) { break; } } // Close zip and return $zipcount = $wppa_zip->numFiles; $wppa_zip->close(); // A zip is created $desturl = WPPA_UPLOAD_URL . '/temp/' . $zipfilename; echo $desturl . '||OK||'; if ($zipcount != count($photos)) { echo sprintf(__('Only %s out of %s photos could be added to the zipfile', 'wp-photo-album-plus'), $zipcount, count($photos)); } wppa_exit(); break; case 'getalbumzipurl': $alb = $_REQUEST['album-id']; $zipfilename = wppa_get_album_name($alb); $zipfilename = wppa_sanitize_file_name($zipfilename . '.zip'); // Remove illegal chars $zipfilepath = WPPA_UPLOAD_PATH . '/temp/' . $zipfilename; $zipfileurl = WPPA_UPLOAD_URL . '/temp/' . $zipfilename; if (is_file($zipfilepath)) { echo $zipfileurl; } else { echo 'ER'; } wppa_exit(); break; case 'makeorigname': $photo = $_REQUEST['photo-id']; $from = $_REQUEST['from']; if ($from == 'fsname') { $type = wppa_opt('art_monkey_link'); } elseif ($from == 'popup') { $type = wppa_opt('art_monkey_popup_link'); } else { echo '||7||' . __('Unknown source of request', 'wp-photo-album-plus'); wppa_exit(); } $data = $wpdb->get_row($wpdb->prepare("SELECT * FROM `" . WPPA_PHOTOS . "` WHERE `id` = %s", $photo), ARRAY_A); if ($data) { // The photo is supposed to exist // Make the name if ($data['filename']) { $name = $data['filename']; } else { $name = __($data['name'], 'wp-photo-album-plus'); } $name = wppa_sanitize_file_name($name); // Remove illegal chars $name = preg_replace('/\\.[^.]*$/', '', $name); // Remove file extension if (strlen($name) == '0') { echo '||1||' . __('Empty filename', 'wp-photo-album-plus'); wppa_exit(); } // Make the file if (wppa_switch('artmonkey_use_source')) { if (is_file(wppa_get_source_path($photo))) { $source = wppa_get_source_path($photo); } else { $source = wppa_get_photo_path($photo); } } else { $source = wppa_get_photo_path($photo); } $source = wppa_fix_poster_ext($source, $photo); // Fix the extension for mm items. if ($data['ext'] == 'xxx') { $data['ext'] = wppa_get_ext($source); } $dest = WPPA_UPLOAD_PATH . '/temp/' . $name . '.' . $data['ext']; $zipfile = WPPA_UPLOAD_PATH . '/temp/' . $name . '.zip'; $tempdir = WPPA_UPLOAD_PATH . '/temp'; if (!is_dir($tempdir)) { @mkdir($tempdir); } if (!is_dir($tempdir)) { echo '||2||' . __('Unable to create tempdir', 'wp-photo-album-plus'); wppa_exit(); } // Remove obsolete files wppa_delete_obsolete_tempfiles(); // Make the files if ($type == 'file') { copy($source, $dest); $ext = $data['ext']; } elseif ($type == 'zip') { if (!class_exists('ZipArchive')) { echo '||8||' . __('Unable to create zip archive', 'wp-photo-album-plus'); wppa_exit(); } $ext = 'zip'; $wppa_zip = new ZipArchive(); $wppa_zip->open($zipfile, 1); $wppa_zip->addFile($source, basename($dest)); $wppa_zip->close(); } else { echo '||6||' . __('Unknown type', 'wp-photo-album-plus'); wppa_exit(); } $desturl = WPPA_UPLOAD_URL . '/temp/' . $name . '.' . $ext; echo '||0||' . $desturl; // No error: return url wppa_exit(); } else { echo '||9||' . __('The photo does no longer exist', 'wp-photo-album-plus'); wppa_exit(); } wppa_exit(); break; case 'tinymcedialog': $result = wppa_make_tinymce_dialog(); echo $result; wppa_exit(); break; case 'bumpviewcount': $nonce = $_REQUEST['wppa-nonce']; if (wp_verify_nonce($nonce, 'wppa-check')) { wppa_bump_viewcount('photo', $_REQUEST['wppa-photo']); } else { _e('Security check failure', 'wp-photo-album-plus'); } wppa_exit(); break; case 'rate': // Get commandline args $photo = $_REQUEST['wppa-rating-id']; $rating = $_REQUEST['wppa-rating']; $occur = $_REQUEST['wppa-occur']; $index = $_REQUEST['wppa-index']; $nonce = $_REQUEST['wppa-nonce']; // Make errortext $errtxt = __('An error occurred while processing you rating request.', 'wp-photo-album-plus'); $errtxt .= "\n" . __('Maybe you opened the page too long ago to recognize you.', 'wp-photo-album-plus'); $errtxt .= "\n" . __('You may refresh the page and try again.', 'wp-photo-album-plus'); $wartxt = __('Althoug an error occurred while processing your rating, your vote has been registered.', 'wp-photo-album-plus'); $wartxt .= "\n" . __('However, this may not be reflected in the current pageview', 'wp-photo-album-plus'); // Check on validity if (!wp_verify_nonce($nonce, 'wppa-check')) { echo '0||100||' . $errtxt; wppa_exit(); // Nonce check failed } if (wppa_opt('rating_max') == '1' && $rating != '1') { echo '0||106||' . $errtxt . ':' . $rating; wppa_exit(); // Value out of range } elseif (wppa_opt('rating_max') == '5' && !in_array($rating, array('-1', '1', '2', '3', '4', '5'))) { echo '0||106||' . $errtxt . ':' . $rating; wppa_exit(); // Value out of range } elseif (wppa_opt('rating_max') == '10' && !in_array($rating, array('-1', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'))) { echo '0||106||' . $errtxt . ':' . $rating; wppa_exit(); // Value out of range } // Get other data if (!$wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `id` = %s", $photo))) { echo '0||999||' . __('Photo has been removed.', 'wp-photo-album-plus'); wppa_exit(); } $user = wppa_get_user(); $mylast = $wpdb->get_row($wpdb->prepare('SELECT * FROM `' . WPPA_RATING . '` WHERE `photo` = %s AND `user` = %s ORDER BY `id` DESC LIMIT 1', $photo, $user), ARRAY_A); $myavgrat = '0'; // Init // Rate own photo? if (wppa_get_photo_item($photo, 'owner') == $user && !wppa_switch('allow_owner_votes')) { echo '0||900||' . __('Sorry, you can not rate your own photos', 'wp-photo-album-plus'); wppa_exit(); } // Already a pending one? $pending = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_RATING . "` WHERE `photo` = %s AND `user` = %s AND `status` = %s", $photo, $user, 'pending')); // Has user motivated his vote? $hascommented = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_COMMENTS . "` WHERE `photo` = %s AND `user` = %s", $photo, wppa_get_user('display'))); if ($pending) { if (!$hascommented) { echo '0||900||' . __('Please enter a comment.', 'wp-photo-album-plus'); wppa_exit(); } else { $wpdb->query($wpdb->prepare("UPDATE `" . WPPA_RATING . "` SET `status` = 'publish' WHERE `photo` = %s AND `user` = %s", $photo, $user)); } } if (wppa_switch('vote_needs_comment')) { $ratingstatus = $hascommented ? 'publish' : 'pending'; } else { $ratingstatus = 'publish'; } // When done, we have to echo $occur.'||'.$photo.'||'.$index.'||'.$myavgrat.'||'.$allavgrat.'||'.$discount.||.$hascommented.||.$message; // So we have to do: process rating and find new $myavgrat, $allavgrat and $discount ( $occur, $photo and $index are known ) // Case 0: Illegal second vote. Frontend takes care of this, but a hacker could enter an ajaxlink manually if ($mylast && (!(wppa_switch('rating_change') || wppa_switch('rating_multi')) || $mylast['value'] < '0' || $mylast['value'] > '0' && $rating == '-1')) { echo '0||109||' . __('Security check failure.', 'wp-photo-album-plus'); wppa_exit(); } // Case 1: value = -1 this is a legal dislike vote if ($rating == '-1') { // Add my dislike $iret = wppa_create_rating_entry(array('photo' => $photo, 'value' => $rating, 'user' => $user, 'status' => $ratingstatus)); if (!$iret) { echo '0||101||' . $errtxt; wppa_exit(); // Fail on storing vote } // Add points wppa_add_credit_points(wppa_opt('cp_points_rating'), __('Photo rated', 'wp-photo-album-plus'), $photo, $rating); wppa_dislike_check($photo); // Check for email to be sent every .. dislikes if (!is_file(wppa_get_thumb_path($photo))) { // Photo is removed echo $occur . '||' . $photo . '||' . $index . '||-1||-1|0||' . wppa_opt('dislike_delete'); wppa_exit(); } } elseif (!$mylast) { // Add my vote $iret = wppa_create_rating_entry(array('photo' => $photo, 'value' => $rating, 'user' => $user, 'status' => $ratingstatus)); if (!$iret) { echo '0||102||' . $errtxt; wppa_exit(); // Fail on storing vote } // Add points wppa_add_credit_points(wppa_opt('cp_points_rating'), __('Photo rated', 'wp-photo-album-plus'), $photo, $rating); } elseif (wppa_switch('rating_change')) { // Votechanging is allowed $iret = $wpdb->query($wpdb->prepare('UPDATE `' . WPPA_RATING . '` SET `value` = %s WHERE `photo` = %s AND `user` = %s LIMIT 1', $rating, $photo, $user)); if ($iret === false) { echo '0||103||' . $errtxt; wppa_exit(); // Fail on update } } elseif (wppa_switch('rating_multi')) { // Rating multi is allowed $iret = wppa_create_rating_entry(array('photo' => $photo, 'value' => $rating, 'user' => $user, 'status' => $ratingstatus)); if (!$iret) { echo '0||104||' . $errtxt; wppa_exit(); // Fail on storing vote } } else { // Should never get here.... echo '0||110||' . __('Unexpected error', 'wp-photo-album-plus'); wppa_exit(); } // Compute my avg rating $myrats = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . WPPA_RATING . '` WHERE `photo` = %s AND `user` = %s AND `status` = %s ', $photo, $user, 'publish'), ARRAY_A); if ($myrats) { $sum = 0; $cnt = 0; foreach ($myrats as $rat) { if ($rat['value'] == '-1') { $sum += wppa_opt('dislike_value'); } else { $sum += $rat['value']; } $cnt++; } $myavgrat = $sum / $cnt; $i = wppa_opt('rating_prec'); $j = $i + '1'; $myavgrat = sprintf('%' . $j . '.' . $i . 'f', $myavgrat); } else { $myavgrat = '0'; } // Compute new allavgrat $ratings = $wpdb->get_results($wpdb->prepare('SELECT * FROM ' . WPPA_RATING . ' WHERE `photo` = %s AND `status` = %s', $photo, 'publish'), ARRAY_A); if ($ratings) { $sum = 0; $cnt = 0; foreach ($ratings as $rat) { if ($rat['value'] == '-1') { $sum += wppa_opt('dislike_value'); } else { $sum += $rat['value']; } $cnt++; } $allavgrat = $sum / $cnt; if ($allavgrat == '10') { $allavgrat = '9.99999999'; } // For sort order reasons text field } else { $allavgrat = '0'; } // Store it in the photo info $iret = $wpdb->query($wpdb->prepare('UPDATE `' . WPPA_PHOTOS . '` SET `mean_rating` = %s WHERE `id` = %s', $allavgrat, $photo)); if ($iret === false) { echo '0||106||' . $wartxt; wppa_exit(); // Fail on save } // Compute rating_count and store in the photo info $ratcount = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_RATING . "` WHERE `photo` = %s", $photo)); if ($ratcount !== false) { $iret = $wpdb->query($wpdb->prepare("UPDATE `" . WPPA_PHOTOS . "` SET `rating_count` = %s WHERE `id` = %s", $ratcount, $photo)); if ($iret === false) { echo '0||107||' . $wartxt; wppa_exit(); // Fail on save } } // Format $allavgrat for output $allavgratcombi = $allavgrat . '|' . $ratcount; // Compute dsilike count $discount = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_RATING . "` WHERE `photo` = %s AND `value` = -1 AND `status` = %s", $photo, 'publish')); if ($discount === false) { echo '0||108||' . $wartxt; wppa_exit(); // Fail on save } // Test for possible medal wppa_test_for_medal($photo); // Success! wppa_clear_cache(); if (wppa_switch('vote_needs_comment') && !$hascommented) { $message = __("Please explain your vote in a comment.\nYour vote will be discarded if you don't.\n\nAfter completing your comment,\nyou can refresh the page to see\nyour vote became effective.", 'wp-photo-album-plus'); } else { $message = ''; } echo $occur . '||' . $photo . '||' . $index . '||' . $myavgrat . '||' . $allavgratcombi . '||' . $discount . '||' . $hascommented . '||' . $message; break; case 'render': $tim_1 = microtime(true); $nq_1 = get_num_queries(); // Correct the fact that this is a non-admin operation, if it is if (is_admin()) { require_once 'wppa-non-admin.php'; } wppa_load_theme(); // Register geo shortcode if google-maps-gpx-vieuwer is on board. GPX does it in wp_head(), what is not done in an ajax call // if ( function_exists( 'gmapv3' ) ) add_shortcode( 'map', 'gmapv3' ); // Get the post we are working for if (isset($_REQUEST['wppa-fromp'])) { $p = $_REQUEST['wppa-fromp']; if (wppa_is_int($p)) { $GLOBALS['post'] = get_post($p); } } // Render echo wppa_albums(); $tim_2 = microtime(true); $nq_2 = get_num_queries(); $mem = memory_get_peak_usage(true) / 1024 / 1024; $msg = sprintf('WPPA Ajax render: db queries: WP:%d, WPPA+: %d in %4.2f seconds, using %4.2f MB memory max', $nq_1, $nq_2 - $nq_1, $tim_2 - $tim_1, $mem); echo '<script type="text/javascript">wppaConsoleLog( \'' . $msg . '\', \'force\' )</script>'; break; case 'delete-photo': $photo = $_REQUEST['photo-id']; $nonce = $_REQUEST['wppa-nonce']; // Check validity if (!wp_verify_nonce($nonce, 'wppa_nonce_' . $photo)) { echo '||0||' . __('You do not have the rights to delete a photo', 'wp-photo-album-plus'); wppa_exit(); // Nonce check failed } if (!is_numeric($photo)) { echo '||0||' . __('Security check failure', 'wp-photo-album-plus'); wppa_exit(); // Nonce check failed } $album = $wpdb->get_var($wpdb->prepare('SELECT `album` FROM `' . WPPA_PHOTOS . '` WHERE `id` = %s', $photo)); wppa_delete_photo($photo); wppa_clear_cache(); echo '||1||<span style="color:red" >' . sprintf(__('Photo %s has been deleted', 'wp-photo-album-plus'), $photo) . '</span>'; echo '||'; $a = wppa_allow_uploads($album); if (!$a) { echo 'full'; } else { echo 'notfull||' . $a; } break; case 'update-album': $album = $_REQUEST['album-id']; $nonce = $_REQUEST['wppa-nonce']; $item = $_REQUEST['item']; $value = $_REQUEST['value']; $value = wppa_decode($value); // Check validity if (!wp_verify_nonce($nonce, 'wppa_nonce_' . $album)) { echo '||0||' . __('You do not have the rights to update album information', 'wp-photo-album-plus') . $nonce; wppa_exit(); // Nonce check failed } switch ($item) { case 'clear_ratings': $photos = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . WPPA_PHOTOS . '` WHERE `album` = %s', $album), ARRAY_A); if ($photos) { foreach ($photos as $photo) { $iret1 = $wpdb->query($wpdb->prepare('DELETE FROM `' . WPPA_RATING . '` WHERE `photo` = %s', $photo['id'])); $iret2 = $wpdb->query($wpdb->prepare('UPDATE `' . WPPA_PHOTOS . '` SET `mean_rating` = %s WHERE `id` = %s', '', $photo['id'])); } } if ($photos && $iret1 !== false && $iret2 !== false) { echo '||97||' . __('<b>Ratings cleared</b>', 'wp-photo-album-plus') . '||' . __('No ratings for this photo.', 'wp-photo-album-plus'); } elseif ($photos) { echo '||1||' . __('An error occurred while clearing ratings', 'wp-photo-album-plus'); } else { echo '||97||' . __('<b>No photos in this album</b>', 'wp-photo-album-plus') . '||' . __('No ratings for this photo.', 'wp-photo-album-plus'); } wppa_exit(); break; case 'set_deftags': // to be changed for large albums $photos = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . WPPA_PHOTOS . '` WHERE `album` = %s', $album), ARRAY_A); $deftag = $wpdb->get_var($wpdb->prepare('SELECT `default_tags` FROM `' . WPPA_ALBUMS . '` WHERE `id` = %s', $album)); if (is_array($photos)) { foreach ($photos as $photo) { $tags = wppa_sanitize_tags(wppa_filter_iptc(wppa_filter_exif($deftag, $photo['id']), $photo['id'])); $iret = $wpdb->query($wpdb->prepare('UPDATE `' . WPPA_PHOTOS . '` SET `tags` = %s WHERE `id` = %s', $tags, $photo['id'])); wppa_index_update('photo', $photo['id']); } } if ($photos && $iret !== false) { echo '||97||' . __('<b>Tags set to defaults</b> (reload)', 'wp-photo-album-plus'); } elseif ($photos) { echo '||1||' . __('An error occurred while setting tags', 'wp-photo-album-plus'); } else { echo '||97||' . __('<b>No photos in this album</b>', 'wp-photo-album-plus'); } wppa_clear_taglist(); wppa_exit(); break; case 'add_deftags': $photos = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . WPPA_PHOTOS . '` WHERE `album` = %s', $album), ARRAY_A); $deftag = $wpdb->get_var($wpdb->prepare('SELECT `default_tags` FROM `' . WPPA_ALBUMS . '` WHERE `id` = %s', $album)); if (is_array($photos)) { foreach ($photos as $photo) { $tags = wppa_sanitize_tags(wppa_filter_iptc(wppa_filter_exif($photo['tags'] . ',' . $deftag, $photo['id']), $photo['id'])); $iret = $wpdb->query($wpdb->prepare('UPDATE `' . WPPA_PHOTOS . '` SET `tags` = %s WHERE `id` = %s', $tags, $photo['id'])); wppa_index_update('photo', $photo['id']); } } if ($photos && $iret !== false) { echo '||97||' . __('<b>Tags added width defaults</b> (reload)', 'wp-photo-album-plus'); } elseif ($photos) { echo '||1||' . __('An error occurred while adding tags', 'wp-photo-album-plus'); } else { echo '||97||' . __('<b>No photos in this album</b>', 'wp-photo-album-plus'); } wppa_clear_taglist(); wppa_exit(); break; case 'name': $value = trim(strip_tags($value)); if (!wppa_sanitize_file_name($value)) { // Empty album name is not allowed $value = 'Album-#' . $album; echo '||5||' . sprintf(__('Album name may not be empty.<br />Reset to <b>%s</b>', 'wp-photo-album-plus'), $value); } $itemname = __('Name', 'wp-photo-album-plus'); break; case 'description': $itemname = __('Description', 'wp-photo-album-plus'); if (wppa_switch('check_balance')) { $value = str_replace(array('<br/>', '<br>'), '<br />', $value); if (balanceTags($value, true) != $value) { echo '||3||' . __('Unbalanced tags in album description!', 'wp-photo-album-plus'); wppa_exit(); } } $value = trim($value); break; case 'a_order': $itemname = __('Album order #', 'wp-photo-album-plus'); break; case 'main_photo': $itemname = __('Cover photo', 'wp-photo-album-plus'); break; case 'a_parent': $itemname = __('Parent album', 'wp-photo-album-plus'); wppa_flush_treecounts($album); // Myself and my parents wppa_flush_treecounts($value); // My new parent break; case 'p_order_by': $itemname = __('Photo order', 'wp-photo-album-plus'); break; case 'alt_thumbsize': $itemname = __('Use Alt thumbsize', 'wp-photo-album-plus'); break; case 'cover_type': $itemname = __('Cover Type', 'wp-photo-album-plus'); break; case 'cover_linktype': $itemname = __('Link type', 'wp-photo-album-plus'); break; case 'cover_linkpage': $itemname = __('Link to', 'wp-photo-album-plus'); break; case 'owner': $itemname = __('Owner', 'wp-photo-album-plus'); if ($value != '--- public ---' && !get_user_by('login', $value)) { echo '||4||' . sprintf(__('User %s does not exist', 'wp-photo-album-plus'), $value); wppa_exit(); } break; case 'upload_limit_count': wppa_ajax_check_range($value, false, '0', false, __('Upload limit count', 'wp-photo-album-plus')); if (wppa('error')) { wppa_exit(); } $oldval = $wpdb->get_var($wpdb->prepare('SELECT `upload_limit` FROM ' . WPPA_ALBUMS . ' WHERE `id` = %s', $album)); $temp = explode('/', $oldval); $value = $value . '/' . $temp[1]; $item = 'upload_limit'; $itemname = __('Upload limit count', 'wp-photo-album-plus'); break; case 'upload_limit_time': $oldval = $wpdb->get_var($wpdb->prepare('SELECT `upload_limit` FROM ' . WPPA_ALBUMS . ' WHERE `id` = %s', $album)); $temp = explode('/', $oldval); $value = $temp[0] . '/' . $value; $item = 'upload_limit'; $itemname = __('Upload limit time', 'wp-photo-album-plus'); break; case 'default_tags': $value = wppa_sanitize_tags($value, false, true); $itemname = __('Default tags', 'wp-photo-album-plus'); break; case 'cats': $value = wppa_sanitize_cats($value); wppa_clear_catlist(); $itemname = __('Categories', 'wp-photo-album-plus'); break; case 'suba_order_by': $itemname = __('Sub albums sort order', 'wp-photo-album-plus'); break; case 'year': case 'month': case 'day': case 'hour': case 'min': $itemname = __('Schedule date/time', 'wp-photo-album-plus'); $scheduledtm = $wpdb->get_var($wpdb->prepare("SELECT `scheduledtm` FROM`" . WPPA_ALBUMS . "` WHERE `id` = %s", $album)); if (!$scheduledtm) { $scheduledtm = wppa_get_default_scheduledtm(); } $temp = explode(',', $scheduledtm); if ($item == 'year') { $temp[0] = $value; } if ($item == 'month') { $temp[1] = $value; } if ($item == 'day') { $temp[2] = $value; } if ($item == 'hour') { $temp[3] = $value; } if ($item == 'min') { $temp[4] = $value; } $scheduledtm = implode(',', $temp); wppa_update_album(array('id' => $album, 'scheduledtm' => $scheduledtm)); echo '||0||' . sprintf(__('<b>%s</b> of album %s updated', 'wp-photo-album-plus'), $itemname, $album); wppa_exit(); break; case 'setallscheduled': $scheduledtm = $wpdb->get_var($wpdb->prepare("SELECT `scheduledtm` FROM `" . WPPA_ALBUMS . "` WHERE `id` = %s", $album)); if ($scheduledtm) { $iret = $wpdb->query($wpdb->prepare("UPDATE `" . WPPA_PHOTOS . "` SET `status` = 'scheduled', `scheduledtm` = %s WHERE `album` = %s", $scheduledtm, $album)); echo '||0||' . __('All photos set to scheduled per date', 'wp-photo-album-plus') . ' ( ' . $iret . ' ) ' . wppa_format_scheduledtm($scheduledtm); } wppa_exit(); break; default: $itemname = $item; } $query = $wpdb->prepare('UPDATE ' . WPPA_ALBUMS . ' SET `' . $item . '` = %s WHERE `id` = %s', $value, $album); $iret = $wpdb->query($query); if ($iret !== false) { if ($item == 'name' || $item == 'description' || $item == 'cats') { wppa_index_update('album', $album); } if ($item == 'name') { wppa_create_pl_htaccess(); } echo '||0||' . sprintf(__('<b>%s</b> of album %s updated', 'wp-photo-album-plus'), $itemname, $album); if ($item == 'upload_limit') { echo '||'; $a = wppa_allow_uploads($album); if (!$a) { echo 'full'; } else { echo 'notfull||' . $a; } } } else { echo '||2||' . sprintf(__('An error occurred while trying to update <b>%s</b> of album %s', 'wp-photo-album-plus'), $itemname, $album); echo '<br>' . __('Press CTRL+F5 and try again.', 'wp-photo-album-plus'); } wppa_clear_cache(); wppa_exit(); break; case 'update-comment-status': $photo = $_REQUEST['wppa-photo-id']; $nonce = $_REQUEST['wppa-nonce']; $comid = $_REQUEST['wppa-comment-id']; $comstat = $_REQUEST['wppa-comment-status']; // Check validity if (!wp_verify_nonce($nonce, 'wppa_nonce_' . $photo)) { echo '||0||' . __('You do not have the rights to update comment status', 'wp-photo-album-plus') . $nonce; wppa_exit(); // Nonce check failed } // if ( wppa_switch( 'search_comments' ) ) wppa_index_remove( 'photo', $photo ); $iret = $wpdb->query($wpdb->prepare('UPDATE `' . WPPA_COMMENTS . '` SET `status` = %s WHERE `id` = %s', $comstat, $comid)); if (wppa_switch('search_comments')) { wppa_index_update('photo', $photo); } if ($iret !== false) { echo '||0||' . sprintf(__('Status of comment #%s updated', 'wp-photo-album-plus'), $comid); } else { echo '||1||' . sprintf(__('Error updating status comment #%s', 'wp-photo-album-plus'), $comid); } wppa_exit(); break; case 'watermark-photo': $photo = $_REQUEST['photo-id']; $nonce = $_REQUEST['wppa-nonce']; // Check validity if (!wp_verify_nonce($nonce, 'wppa_nonce_' . $photo)) { echo '||1||' . __('You do not have the rights to change photos', 'wp-photo-album-plus'); wppa_exit(); // Nonce check failed } wppa_cache_thumb($photo); if (wppa_add_watermark($photo)) { if (wppa_switch('watermark_thumbs')) { wppa_create_thumbnail($photo); // create new thumb } echo '||0||' . __('Watermark applied', 'wp-photo-album-plus'); wppa_exit(); } else { echo '||1||' . __('An error occured while trying to apply a watermark', 'wp-photo-album-plus'); wppa_exit(); } case 'update-photo': $photo = $_REQUEST['photo-id']; $nonce = $_REQUEST['wppa-nonce']; $item = $_REQUEST['item']; $value = isset($_REQUEST['value']) ? $_REQUEST['value'] : ''; $value = wppa_decode($value); // Check validity if (!wp_verify_nonce($nonce, 'wppa_nonce_' . $photo)) { echo '||0||' . __('You do not have the rights to update photo information', 'wp-photo-album-plus'); wppa_exit(); // Nonce check failed } if (substr($item, 0, 20) == 'wppa_watermark_file_' || substr($item, 0, 19) == 'wppa_watermark_pos_') { wppa_update_option($item, $value); echo '||0||' . sprintf(__('%s updated to %s.', 'wp-photo-album-plus'), $item, $value); wppa_exit(); } switch ($item) { case 'exifdtm': $format = '0000:00:00 00:00:00'; $err = '0'; // Length ok? if (strlen($value) != 19) { $err = '1'; } // Check on digits, colons and space for ($i = 0; $i < 19; $i++) { $d = substr($value, $i, 1); $f = substr($format, $i, 1); switch ($f) { case '0': if (!in_array($d, array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'))) { $err = '2'; } break; case ':': case ' ': if ($d != $f) { $err = '3'; } break; } } // Check on values if format correct, report first error only if (!$err) { $temp = explode(':', str_replace(' ', ':', $value)); if ($temp['0'] < '1970') { $err = '11'; } // Before UNIX epoch if (!$err && $temp['0'] > date('Y')) { $err = '12'; } // Future if (!$err && $temp['1'] < '1') { $err = '13'; } // Before january if (!$err && $temp['1'] > '12') { $err = '14'; } // After december if (!$err && $temp['2'] < '1') { $err = '15'; } // Before first of month if (!$err && $temp['2'] > '31') { $err = '17'; } // After 31st ( forget about feb and months with 30 days ) if (!$err && $temp['3'] < '1') { $err = '18'; } // Before first hour if (!$err && $temp['3'] > '24') { $err = '19'; } // Hour > 24 if (!$err && $temp['4'] < '1') { $err = '20'; } // Min < 1 if (!$err && $temp['4'] > '59') { $err = '21'; } // Min > 59 if (!$err && $temp['5'] < '1') { $err = '22'; } // Sec < 1 if (!$err && $temp['5'] > '59') { $err = '23'; } // Sec > 59 } if ($err) { echo '||1||' . sprintf(__('Format error %s. Must be yyyy:mm:dd hh:mm:ss', 'wp-photo-album-plus'), $err); } else { wppa_update_photo(array('id' => $photo, 'exifdtm' => $value)); echo '||0||' . __('Exif date/time updated', 'wp-photo-album-plus'); } wppa_exit(); break; case 'lat': if (!is_numeric($value) || $value < '-90.0' || $value > '90.0') { echo '||1||' . __('Enter a value > -90 and < 90', 'wp-photo-album-plus'); wppa_exit(); } $photodata = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . WPPA_PHOTOS . ' WHERE `id` = %s', $photo), ARRAY_A); $geo = $photodata['location'] ? $photodata['location'] : '///'; $geo = explode('/', $geo); $geo = wppa_format_geo($value, $geo['3']); $iret = $wpdb->query($wpdb->prepare('UPDATE `' . WPPA_PHOTOS . '` SET `location` = %s WHERE `id` = %s', $geo, $photo)); if ($iret) { echo '||0||' . __('Lattitude updated', 'wp-photo-album-plus'); } else { echo '||1||' . __('Could not update lattitude', 'wp-photo-album-plus'); } wppa_exit(); break; case 'lon': if (!is_numeric($value) || $value < '-180.0' || $value > '180.0') { echo '||1||' . __('Enter a value > -180 and < 180', 'wp-photo-album-plus'); wppa_exit(); } $photodata = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . WPPA_PHOTOS . ' WHERE `id` = %s', $photo), ARRAY_A); $geo = $photodata['location'] ? $photodata['location'] : '///'; $geo = explode('/', $geo); $geo = wppa_format_geo($geo['2'], $value); $iret = $wpdb->query($wpdb->prepare('UPDATE `' . WPPA_PHOTOS . '` SET `location` = %s WHERE `id` = %s', $geo, $photo)); if ($iret) { echo '||0||' . __('Longitude updated', 'wp-photo-album-plus'); } else { echo '||1||' . __('Could not update longitude', 'wp-photo-album-plus'); } wppa_exit(); break; case 'remake': if (wppa_remake_files('', $photo)) { wppa_bump_photo_rev(); wppa_bump_thumb_rev(); echo '||0||' . __('Photo files remade', 'wp-photo-album-plus'); } else { echo '||2||' . __('Could not remake files', 'wp-photo-album-plus'); } wppa_exit(); break; case 'remakethumb': if (wppa_create_thumbnail($photo)) { echo '||0||' . __('Thumbnail remade', 'wp-photo-album-plus'); } else { echo '||0||' . __('Could not remake thumbnail', 'wp-photo-album-plus'); } wppa_exit(); break; case 'rotright': case 'rot180': case 'rotleft': switch ($item) { case 'rotleft': $angle = '90'; $dir = __('left', 'wp-photo-album-plus'); break; case 'rot180': $angle = '180'; $dir = __('180°', 'wp-photo-album-plus'); break; case 'rotright': $angle = '270'; $dir = __('right', 'wp-photo-album-plus'); break; } wppa('error', wppa_rotate($photo, $angle)); if (!wppa('error')) { wppa_update_modified($photo); wppa_bump_photo_rev(); wppa_bump_thumb_rev(); echo '||0||' . sprintf(__('Photo %s rotated %s', 'wp-photo-album-plus'), $photo, $dir); } else { echo '||' . wppa('error') . '||' . sprintf(__('An error occurred while trying to rotate photo %s', 'wp-photo-album-plus'), $photo); } wppa_exit(); break; case 'moveto': $photodata = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . WPPA_PHOTOS . ' WHERE `id` = %s', $photo), ARRAY_A); if (wppa_switch('void_dups')) { // Check for already exists $exists = wppa_file_is_in_album($photodata['filename'], $value); if ($exists) { // Already exists echo '||3||' . sprintf(__('A photo with filename %s already exists in album %s.', 'wp-photo-album-plus'), $photodata['filename'], $value); wppa_exit(); break; } } wppa_flush_treecounts($photodata['album']); // Current album wppa_flush_treecounts($value); // New album $iret = $wpdb->query($wpdb->prepare('UPDATE ' . WPPA_PHOTOS . ' SET `album` = %s WHERE `id` = %s', $value, $photo)); if ($iret !== false) { wppa_move_source($photodata['filename'], $photodata['album'], $value); echo '||99||' . sprintf(__('Photo %s has been moved to album %s (%s)', 'wp-photo-album-plus'), $photo, wppa_get_album_name($value), $value); } else { echo '||3||' . sprintf(__('An error occurred while trying to move photo %s', 'wp-photo-album-plus'), $photo); } wppa_exit(); break; case 'copyto': $photodata = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . WPPA_PHOTOS . ' WHERE `id` = %s', $photo), ARRAY_A); if (wppa_switch('void_dups')) { // Check for already exists $exists = wppa_file_is_in_album($photodata['filename'], $value); if ($exists) { // Already exists echo '||4||' . sprintf(__('A photo with filename %s already exists in album %s.', 'wp-photo-album-plus'), $photodata['filename'], $value); wppa_exit(); break; } } wppa('error', wppa_copy_photo($photo, $value)); wppa_flush_treecounts($value); // New album if (!wppa('error')) { echo '||0||' . sprintf(__('Photo %s copied to album %s (%s)', 'wp-photo-album-plus'), $photo, wppa_get_album_name($value), $value); } else { echo '||4||' . sprintf(__('An error occurred while trying to copy photo %s', 'wp-photo-album-plus'), $photo); echo '<br>' . __('Press CTRL+F5 and try again.', 'wp-photo-album-plus'); } wppa_exit(); break; case 'status': if (!current_user_can('wppa_moderate') && !current_user_can('wppa_admin')) { die('Security check failure #78'); } wppa_flush_treecounts(wppa_get_photo_item($photo, 'album')); // $wpdb->get_var( $wpdb->prepare( "SELECT `album` FROM `".WPPA_PHOTOS."` WHERE `id` = %s", $photo ) ) ); // $wpdb->get_var( $wpdb->prepare( "SELECT `album` FROM `".WPPA_PHOTOS."` WHERE `id` = %s", $photo ) ) ); case 'owner': case 'name': case 'description': case 'p_order': case 'linkurl': case 'linktitle': case 'linktarget': case 'tags': case 'alt': case 'videox': case 'videoy': switch ($item) { case 'name': $value = strip_tags($value); $itemname = __('Name', 'wp-photo-album-plus'); break; case 'description': $itemname = __('Description', 'wp-photo-album-plus'); if (wppa_switch('check_balance')) { $value = str_replace(array('<br/>', '<br>'), '<br />', $value); if (balanceTags($value, true) != $value) { echo '||3||' . __('Unbalanced tags in photo description!', 'wp-photo-album-plus'); wppa_exit(); } } break; case 'p_order': $itemname = __('Photo order #', 'wp-photo-album-plus'); break; case 'owner': $usr = get_user_by('login', $value); if (!$usr) { echo '||4||' . sprintf(__('User %s does not exists', 'wp-photo-album-plus'), $value); wppa_exit(); } $value = $usr->user_login; // Correct possible case mismatch wppa_flush_upldr_cache('photoid', $photo); // Current owner wppa_flush_upldr_cache('username', $value); // New owner $itemname = __('Owner', 'wp-photo-album-plus'); break; case 'linkurl': $itemname = __('Link url', 'wp-photo-album-plus'); break; case 'linktitle': $itemname = __('Link title', 'wp-photo-album-plus'); break; case 'linktarget': $itemname = __('Link target', 'wp-photo-album-plus'); break; case 'tags': $value = wppa_sanitize_tags($value, false, true); $value = wppa_sanitize_tags(wppa_filter_iptc(wppa_filter_exif($value, $photo), $photo)); wppa_clear_taglist(); $itemname = __('Photo Tags', 'wp-photo-album-plus'); break; case 'status': wppa_clear_taglist(); wppa_flush_upldr_cache('photoid', $photo); $itemname = __('Status', 'wp-photo-album-plus'); break; case 'alt': $itemname = __('HTML Alt', 'wp-photo-album-plus'); $value = strip_tags(stripslashes($value)); break; case 'videox': $itemname = __('Video width', 'wp-photo-album-plus'); if (!wppa_is_int($value) || $value < '0') { echo '||3||' . __('Please enter an integer value >= 0', 'wp-photo-album-plus'); wppa_exit(); } break; case 'videoy': $itemname = __('Video height', 'wp-photo-album-plus'); if (!wppa_is_int($value) || $value < '0') { echo '||3||' . __('Please enter an integer value >= 0', 'wp-photo-album-plus'); wppa_exit(); } break; default: $itemname = $item; } // if ( $item == 'name' || $item == 'description' || $item == 'tags' ) wppa_index_quick_remove( 'photo', $photo ); $iret = $wpdb->query($wpdb->prepare('UPDATE ' . WPPA_PHOTOS . ' SET `' . $item . '` = %s WHERE `id` = %s', $value, $photo)); if ($item == 'name' || $item == 'description' || $item == 'tags') { wppa_index_update('photo', $photo); } if ($item == 'status' && $value != 'scheduled') { wppa_update_photo(array('id' => $photo, 'scheduledtm' => '')); } if ($item == 'status') { wppa_flush_treecounts(wppa_get_photo_item($photo, 'album')); } if ($iret !== false) { wppa_update_modified($photo); if (wppa_is_video($photo)) { echo '||0||' . sprintf(__('<b>%s</b> of video %s updated', 'wp-photo-album-plus'), $itemname, $photo); } else { echo '||0||' . sprintf(__('<b>%s</b> of photo %s updated', 'wp-photo-album-plus'), $itemname, $photo); } } else { echo '||2||' . sprintf(__('An error occurred while trying to update <b>%s</b> of photo %s', 'wp-photo-album-plus'), $itemname, $photo); echo '<br>' . __('Press CTRL+F5 and try again.', 'wp-photo-album-plus'); wppa_exit(); } break; case 'year': case 'month': case 'day': case 'hour': case 'min': $itemname = __('Schedule date/time', 'wp-photo-album-plus'); $scheduledtm = $wpdb->get_var($wpdb->prepare("SELECT `scheduledtm` FROM`" . WPPA_PHOTOS . "` WHERE `id` = %s", $photo)); if (!$scheduledtm) { $scheduledtm = wppa_get_default_scheduledtm(); } $temp = explode(',', $scheduledtm); if ($item == 'year') { $temp[0] = $value; } if ($item == 'month') { $temp[1] = $value; } if ($item == 'day') { $temp[2] = $value; } if ($item == 'hour') { $temp[3] = $value; } if ($item == 'min') { $temp[4] = $value; } $scheduledtm = implode(',', $temp); wppa_update_photo(array('id' => $photo, 'scheduledtm' => $scheduledtm, 'status' => 'scheduled')); wppa_flush_treecounts($wpdb->get_var($wpdb->prepare("SELECT `album` FROM `" . WPPA_PHOTOS . "` WHERE `id` = %s", $photo))); wppa_flush_upldr_cache('photoid', $photo); if (wppa_is_video($photo)) { echo '||0||' . sprintf(__('<b>%s</b> of video %s updated', 'wp-photo-album-plus'), $itemname, $photo); } else { echo '||0||' . sprintf(__('<b>%s</b> of photo %s updated', 'wp-photo-album-plus'), $itemname, $photo); } break; case 'custom_0': case 'custom_1': case 'custom_2': case 'custom_3': case 'custom_4': case 'custom_5': case 'custom_6': case 'custom_7': case 'custom_8': case 'custom_9': $index = substr($item, -1); $custom = wppa_get_photo_item($photo, 'custom'); if ($custom) { $custom_data = unserialize($custom); } else { $custom_data = array('', '', '', '', '', '', '', '', '', ''); } $custom_data[$index] = strip_tags($value); $custom = serialize($custom_data); wppa_update_photo(array('id' => $photo, 'custom' => $custom, 'modified' => time())); wppa_index_update('photo', $photo); echo '||0||' . sprintf(__('<b>Custom field %s</b> of photo %s updated', 'wp-photo-album-plus'), wppa_opt('custom_caption_' . $index), $photo); break; case 'file': // Check on upload error if ($_FILES['photo']['error']) { echo '||' . $_FILES['photo']['error'] . '||' . __('<b>Error during upload.</b>', 'wp-photo-album-plus'); wppa_exit(); } // Save new source wppa_save_source($_FILES['photo']['tmp_name'], wppa_get_photo_item($photo, 'filename'), wppa_get_photo_item($photo, 'album')); // Make the files $bret = wppa_make_the_photo_files($_FILES['photo']['tmp_name'], $photo, strtolower(wppa_get_ext($_FILES['photo']['name']))); if ($bret) { // Update timestamps and sizes $alb = wppa_get_photo_item($photo, 'album'); wppa_update_album(array('id' => $alb, 'modified' => time())); wppa_update_photo(array('id' => $photo, 'modified' => time(), 'thumbx' => '0', 'thumby' => '0', 'photox' => '0', 'photoy' => '0')); // Report success echo '||0||' . __('Photo files updated.', 'wp-photo-album-plus'); } else { // Report fail echo '||1||' . __('Could not update files.', 'wp-photo-album-plus'); } wppa_exit(); break; case 'stereo': $t = microtime(true); wppa_update_photo(array('id' => $photo, 'stereo' => $value)); wppa_create_stereo_images($photo); wppa_create_thumbnail($photo); $t = microtime(true) - $t; echo '||0||' . sprintf(__('Stereo mode updated in %d milliseconds', 'wp-photo-album-plus'), floor($t * 1000)); wppa_exit(); break; default: echo '||98||This update action is not implemented yet( ' . $item . ' )'; wppa_exit(); } wppa_clear_cache(); break; // The wppa-settings page calls ajax with $wppa_action == 'update-option'; // The wppa-settings page calls ajax with $wppa_action == 'update-option'; case 'update-option': // Verify that we are legally here $nonce = $_REQUEST['wppa-nonce']; if (!wp_verify_nonce($nonce, 'wppa-nonce')) { echo '||1||' . __('You do not have the rights to update settings', 'wp-photo-album-plus'); wppa_exit(); // Nonce check failed } // Initialize $old_minisize = wppa_get_minisize(); // Remember for later, maybe we do something that requires regen $option = $_REQUEST['wppa-option']; // The option to be processed $value = isset($_REQUEST['value']) ? wppa_decode($_REQUEST['value']) : ''; // The new value, may also contain & # and + $value = stripslashes($value); $value = trim($value); // Remaove surrounding spaces $alert = ''; // Init the return string data wppa('error', '0'); // $title = ''; // // If it is a font family, change all double quotes into single quotes as this destroys much more than you would like if (strpos($option, 'wppa_fontfamily_') !== false) { $value = str_replace('"', "'", $value); } $option = wppa_decode($option); // Dispatch on option if (substr($option, 0, 16) == 'wppa_iptc_label_') { $tag = substr($option, 16); $q = $wpdb->prepare("UPDATE `" . WPPA_IPTC . "` SET `description`=%s WHERE `tag`=%s AND `photo`='0'", $value, $tag); $bret = $wpdb->query($q); // Produce the response text if ($bret) { $output = '||0||' . $tag . ' updated to ' . $value . '||'; } else { $output = '||1||Failed to update ' . $tag . '||'; } echo $output; wppa_exit(); } elseif (substr($option, 0, 17) == 'wppa_iptc_status_') { $tag = substr($option, 17); $q = $wpdb->prepare("UPDATE `" . WPPA_IPTC . "` SET `status`=%s WHERE `tag`=%s AND `photo`='0'", $value, $tag); $bret = $wpdb->query($q); // Produce the response text if ($bret) { $output = '||0||' . $tag . ' updated to ' . $value . '||'; } else { $output = '||1||Failed to update ' . $tag . '||'; } echo $output; wppa_exit(); } elseif (substr($option, 0, 16) == 'wppa_exif_label_') { $tag = substr($option, 16); $q = $wpdb->prepare("UPDATE `" . WPPA_EXIF . "` SET `description`=%s WHERE `tag`=%s AND `photo`='0'", $value, $tag); $bret = $wpdb->query($q); // Produce the response text if ($bret) { $output = '||0||' . $tag . ' updated to ' . $value . '||'; } else { $output = '||1||Failed to update ' . $tag . '||'; } echo $output; wppa_exit(); } elseif (substr($option, 0, 17) == 'wppa_exif_status_') { $tag = substr($option, 17); $q = $wpdb->prepare("UPDATE `" . WPPA_EXIF . "` SET `status`=%s WHERE `tag`=%s AND `photo`='0'", $value, $tag); $bret = $wpdb->query($q); // Produce the response text if ($bret) { $output = '||0||' . $tag . ' updated to ' . $value . '||'; } else { $output = '||1||Failed to update ' . $tag . '||'; } echo $output; wppa_exit(); } elseif (substr($option, 0, 5) == 'caps-') { // Is capability setting global $wp_roles; //$R = new WP_Roles; $setting = explode('-', $option); if ($value == 'yes') { $wp_roles->add_cap($setting[2], $setting[1]); echo '||0||' . __('Capability granted', 'wp-photo-album-plus') . '||'; wppa_exit(); } elseif ($value == 'no') { $wp_roles->remove_cap($setting[2], $setting[1]); echo '||0||' . __('Capability withdrawn', 'wp-photo-album-plus') . '||'; wppa_exit(); } else { echo '||1||Invalid value: ' . $value . '||'; wppa_exit(); } } else { switch ($option) { case 'wppa_colwidth': // ?? fixed low high title wppa_ajax_check_range($value, 'auto', '100', false, __('Column width.', 'wp-photo-album-plus')); break; case 'wppa_initial_colwidth': wppa_ajax_check_range($value, false, '100', false, __('Initial width.', 'wp-photo-album-plus')); break; case 'wppa_fullsize': wppa_ajax_check_range($value, false, '100', false, __('Full size.', 'wp-photo-album-plus')); break; case 'wppa_maxheight': wppa_ajax_check_range($value, false, '100', false, __('Max height.', 'wp-photo-album-plus')); break; case 'wppa_thumbsize': wppa_ajax_check_range($value, false, '50', false, __('Thumbnail size.', 'wp-photo-album-plus')); break; case 'wppa_tf_width': wppa_ajax_check_range($value, false, '50', false, __('Thumbnail frame width', 'wp-photo-album-plus')); break; case 'wppa_tf_height': wppa_ajax_check_range($value, false, '50', false, __('Thumbnail frame height', 'wp-photo-album-plus')); break; case 'wppa_tn_margin': wppa_ajax_check_range($value, false, '0', false, __('Thumbnail Spacing', 'wp-photo-album-plus')); break; case 'wppa_min_thumbs': wppa_ajax_check_range($value, false, '0', false, __('Photocount treshold.', 'wp-photo-album-plus')); break; case 'wppa_thumb_page_size': wppa_ajax_check_range($value, false, '0', false, __('Thumb page size.', 'wp-photo-album-plus')); break; case 'wppa_smallsize': wppa_ajax_check_range($value, false, '50', false, __('Cover photo size.', 'wp-photo-album-plus')); break; case 'wppa_album_page_size': wppa_ajax_check_range($value, false, '0', false, __('Album page size.', 'wp-photo-album-plus')); break; case 'wppa_topten_count': wppa_ajax_check_range($value, false, '2', false, __('Number of TopTen photos', 'wp-photo-album-plus'), '40'); break; case 'wppa_topten_size': wppa_ajax_check_range($value, false, '32', false, __('Widget image thumbnail size', 'wp-photo-album-plus'), wppa_get_minisize()); break; case 'wppa_max_cover_width': wppa_ajax_check_range($value, false, '150', false, __('Max Cover width', 'wp-photo-album-plus')); break; case 'wppa_text_frame_height': wppa_ajax_check_range($value, false, '0', false, __('Minimal description height', 'wp-photo-album-plus')); break; case 'wppa_cover_minheight': wppa_ajax_check_range($value, false, '0', false, __('Minimal cover height', 'wp-photo-album-plus')); break; case 'wppa_head_and_text_frame_height': wppa_ajax_check_range($value, false, '0', false, __('Minimal text frame height', 'wp-photo-album-plus')); break; case 'wppa_bwidth': wppa_ajax_check_range($value, '', '0', false, __('Border width', 'wp-photo-album-plus')); break; case 'wppa_bradius': wppa_ajax_check_range($value, '', '0', false, __('Border radius', 'wp-photo-album-plus')); break; case 'wppa_box_spacing': wppa_ajax_check_range($value, '', '-20', '100', __('Box spacing', 'wp-photo-album-plus')); break; case 'wppa_popupsize': $floor = wppa_opt('thumbsize'); $temp = wppa_opt('smallsize'); if ($temp > $floor) { $floor = $temp; } wppa_ajax_check_range($value, false, $floor, wppa_opt('fullsize'), __('Popup size', 'wp-photo-album-plus')); break; case 'wppa_fullimage_border_width': wppa_ajax_check_range($value, '', '0', false, __('Fullsize border width', 'wp-photo-album-plus')); break; case 'wppa_lightbox_bordersize': wppa_ajax_check_range($value, false, '0', false, __('Lightbox Bordersize', 'wp-photo-album-plus')); break; case 'wppa_ovl_border_width': wppa_ajax_check_range($value, false, '0', '16', __('Lightbox Borderwidth', 'wp-photo-album-plus')); break; case 'wppa_ovl_border_radius': wppa_ajax_check_range($value, false, '0', '16', __('Lightbox Borderradius', 'wp-photo-album-plus')); break; case 'wppa_comment_count': wppa_ajax_check_range($value, false, '2', '40', __('Number of Comment widget entries', 'wp-photo-album-plus')); break; case 'wppa_comment_size': wppa_ajax_check_range($value, false, '32', wppa_get_minisize(), __('Comment Widget image thumbnail size', 'wp-photo-album-plus'), wppa_get_minisize()); break; case 'wppa_thumb_opacity': wppa_ajax_check_range($value, false, '0', '100', __('Opacity.', 'wp-photo-album-plus')); break; case 'wppa_cover_opacity': wppa_ajax_check_range($value, false, '0', '100', __('Opacity.', 'wp-photo-album-plus')); break; case 'wppa_star_opacity': wppa_ajax_check_range($value, false, '0', '50', __('Opacity.', 'wp-photo-album-plus')); break; // case 'wppa_filter_priority': // wppa_ajax_check_range( $value, false, wppa_opt( 'shortcode_priority' ), false, __( 'Filter priority' ,'wp-photo-album-plus' ) ); // break; // case 'wppa_shortcode_priority': // wppa_ajax_check_range( $value, false, '0', wppa_opt( 'filter_priority' ) - '1', __( 'Shortcode_priority', 'wp-photo-album-plus' ) ); // break; // case 'wppa_filter_priority': // wppa_ajax_check_range( $value, false, wppa_opt( 'shortcode_priority' ), false, __( 'Filter priority' ,'wp-photo-album-plus' ) ); // break; // case 'wppa_shortcode_priority': // wppa_ajax_check_range( $value, false, '0', wppa_opt( 'filter_priority' ) - '1', __( 'Shortcode_priority', 'wp-photo-album-plus' ) ); // break; case 'wppa_gravatar_size': wppa_ajax_check_range($value, false, '10', '256', __('Avatar size', 'wp-photo-album-plus')); break; case 'wppa_watermark_opacity': wppa_ajax_check_range($value, false, '0', '100', __('Watermark opacity', 'wp-photo-album-plus')); break; case 'wppa_watermark_opacity_text': wppa_ajax_check_range($value, false, '0', '100', __('Watermark opacity', 'wp-photo-album-plus')); break; case 'wppa_ovl_txt_lines': wppa_ajax_check_range($value, 'auto', '0', '24', __('Number of text lines', 'wp-photo-album-plus')); break; case 'wppa_ovl_opacity': wppa_ajax_check_range($value, false, '0', '100', __('Overlay opacity', 'wp-photo-album-plus')); break; case 'wppa_upload_limit_count': wppa_ajax_check_range($value, false, '0', false, __('Upload limit', 'wp-photo-album-plus')); break; case 'wppa_dislike_mail_every': wppa_ajax_check_range($value, false, '0', false, __('Notify inappropriate', 'wp-photo-album-plus')); break; case 'wppa_dislike_set_pending': wppa_ajax_check_range($value, false, '0', false, __('Dislike pending', 'wp-photo-album-plus')); break; case 'wppa_dislike_delete': wppa_ajax_check_range($value, false, '0', false, __('Dislike delete', 'wp-photo-album-plus')); break; case 'wppa_max_execution_time': wppa_ajax_check_range($value, false, '0', '900', __('Max execution time', 'wp-photo-album-plus')); break; case 'wppa_cp_points_comment': case 'wppa_cp_points_rating': case 'wppa_cp_points_upload': wppa_ajax_check_range($value, false, '0', false, __('Cube Points points', 'wp-photo-album-plus')); break; case 'wppa_jpeg_quality': wppa_ajax_check_range($value, false, '20', '100', __('JPG Image quality', 'wp-photo-album-plus')); if (wppa_cdn('admin') == 'cloudinary' && !wppa('out')) { wppa_delete_derived_from_cloudinary(); } break; case 'wppa_imgfact_count': wppa_ajax_check_range($value, false, '1', '24', __('Number of coverphotos', 'wp-photo-album-plus')); break; case 'wppa_dislike_value': wppa_ajax_check_range($value, false, '-10', '0', __('Dislike value', 'wp-photo-album-plus')); break; case 'wppa_slideshow_pagesize': wppa_ajax_check_range($value, false, '0', false, __('Slideshow pagesize', 'wp-photo-album-plus')); break; case 'wppa_pagelinks_max': wppa_ajax_check_range($value, false, '0', false, __('Max Pagelinks', 'wp-photo-album-plus')); break; case 'wppa_start_pause_symbol_size': wppa_ajax_check_range($value, false, '0', false, __('Start/pause symbol size', 'wp-photo-album-plus')); break; case 'wppa_start_pause_symbol_bradius': wppa_ajax_check_range($value, false, '0', false, __('Start/pause symbol border radius', 'wp-photo-album-plus')); break; case 'wppa_stop_symbol_size': wppa_ajax_check_range($value, false, '0', false, __('Stop symbol size', 'wp-photo-album-plus')); break; case 'wppa_stop_symbol_bradius': wppa_ajax_check_range($value, false, '0', false, __('Stop symbol border radius', 'wp-photo-album-plus')); break; case 'wppa_rating_clear': $iret1 = $wpdb->query('TRUNCATE TABLE ' . WPPA_RATING); $iret2 = $wpdb->query('UPDATE ' . WPPA_PHOTOS . ' SET mean_rating="0", rating_count="0" WHERE id > -1'); if ($iret1 !== false && $iret2 !== false) { delete_option('wppa_' . WPPA_RATING . '_lastkey'); $title = __('Ratings cleared', 'wp-photo-album-plus'); } else { $title = __('Could not clear ratings', 'wp-photo-album-plus'); $alert = $title; wppa('error', '1'); } break; case 'wppa_viewcount_clear': $iret = $wpdb->query("UPDATE `" . WPPA_PHOTOS . "` SET `views` = '0'") && $wpdb->query("UPDATE `" . WPPA_ALBUMS . "` SET `views` = '0'"); if ($iret !== false) { $title = __('Viewcounts cleared', 'wp-photo-album-plus'); } else { $title = __('Could not clear viewcounts', 'wp-photo-album-plus'); $alert = $title; wppa('error', '1'); } break; case 'wppa_iptc_clear': $iret = $wpdb->query('TRUNCATE TABLE ' . WPPA_IPTC); if ($iret !== false) { delete_option('wppa_' . WPPA_IPTC . '_lastkey'); $title = __('IPTC data cleared', 'wp-photo-album-plus'); $alert = __('Refresh this page to clear table X', 'wp-photo-album-plus'); update_option('wppa_index_need_remake', 'yes'); } else { $title = __('Could not clear IPTC data', 'wp-photo-album-plus'); $alert = $title; wppa('error', '1'); } break; case 'wppa_exif_clear': $iret = $wpdb->query('TRUNCATE TABLE ' . WPPA_EXIF); if ($iret !== false) { delete_option('wppa_' . WPPA_EXIF . '_lastkey'); $title = __('EXIF data cleared', 'wp-photo-album-plus'); $alert = __('Refresh this page to clear table XI', 'wp-photo-album-plus'); update_option('wppa_index_need_remake', 'yes'); } else { $title = __('Could not clear EXIF data', 'wp-photo-album-plus'); $alert = $title; wppa('error', '1'); } break; case 'wppa_recup': $result = wppa_recuperate_iptc_exif(); echo '||0||' . __('Recuperation performed', 'wp-photo-album-plus') . '||' . $result; wppa_exit(); break; case 'wppa_bgcolor_thumbnail': $value = trim(strtolower($value)); if (strlen($value) != '7' || substr($value, 0, 1) != '#') { wppa('error', '1'); } else { for ($i = 1; $i < 7; $i++) { if (!in_array(substr($value, $i, 1), array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'))) { wppa('error', '1'); } } } if (!wppa('error')) { $old_minisize--; } else { $alert = __('Illegal format. Please enter a 6 digit hexadecimal color value. Example: #77bbff', 'wp-photo-album-plus'); } break; case 'wppa_thumb_aspect': $old_minisize--; // Trigger regen message break; case 'wppa_rating_max': if ($value == '5' && wppa_opt('rating_max') == '10') { $rats = $wpdb->get_results('SELECT `id`, `value` FROM `' . WPPA_RATING . '`', ARRAY_A); if ($rats) { foreach ($rats as $rat) { $wpdb->query($wpdb->prepare('UPDATE `' . WPPA_RATING . '` SET `value` = %s WHERE `id` = %s', $rat['value'] / 2, $rat['id'])); } } } if ($value == '10' && wppa_opt('rating_max') == '5') { $rats = $wpdb->get_results('SELECT `id`, `value` FROM `' . WPPA_RATING . '`', ARRAY_A); if ($rats) { foreach ($rats as $rat) { $wpdb->query($wpdb->prepare('UPDATE `' . WPPA_RATING . '` SET `value` = %s WHERE `id` = %s', $rat['value'] * 2, $rat['id'])); } } } update_option('wppa_rerate_status', 'Required'); $alert .= __('You just changed a setting that requires the recalculation of ratings.', 'wp-photo-album-plus'); $alert .= ' ' . __('Please run the appropriate action in Table VIII.', 'wp-photo-album-plus'); wppa_update_option($option, $value); wppa('error', '0'); break; case 'wppa_newphoto_description': if (wppa_switch('check_balance') && balanceTags($value, true) != $value) { $alert = __('Unbalanced tags in photo description!', 'wp-photo-album-plus'); wppa('error', '1'); } else { wppa_update_option($option, $value); wppa('error', '0'); $alert = ''; wppa_index_compute_skips(); } break; case 'wppa_keep_source': $dir = wppa_opt('source_dir'); if (!is_dir($dir)) { @mkdir($dir); } if (!is_dir($dir) || !is_writable($dir)) { wppa('error', '1'); $alert = sprintf(__('Unable to create or write to %s', 'wp-photo-album-plus'), $dir); } break; case 'wppa_source_dir': $olddir = wppa_opt('source_dir'); $value = rtrim($value, '/'); if (strpos($value . '/', WPPA_UPLOAD_PATH . '/') !== false) { wppa('error', '1'); $alert = sprintf(__('Source can not be inside the wppa folder.', 'wp-photo-album-plus')); } else { $dir = $value; if (!is_dir($dir)) { @mkdir($dir); } if (!is_dir($dir) || !is_writable($dir)) { wppa('error', '1'); $alert = sprintf(__('Unable to create or write to %s', 'wp-photo-album-plus'), $dir); } else { @rmdir($olddir); // try to remove when empty } } break; case 'wppa_newpag_content': if (strpos($value, 'w#album') === false) { $alert = __('The content must contain w#album', 'wp-photo-album-plus'); wppa('error', '1'); } break; case 'wppa_gpx_shortcode': if (strpos($value, 'w#lat') === false || strpos($value, 'w#lon') === false) { $alert = __('The content must contain w#lat and w#lon', 'wp-photo-album-plus'); wppa('error', '1'); } break; case 'wppa_i_responsive': if ($value == 'yes') { wppa_update_option('wppa_colwidth', 'auto'); } if ($value == 'no') { wppa_update_option('wppa_colwidth', '640'); } break; case 'wppa_i_downsize': if ($value == 'yes') { wppa_update_option('wppa_resize_on_upload', 'yes'); if (wppa_opt('resize_to') == '0') { wppa_update_option('wppa_resize_to', '1024x768'); } } if ($value == 'no') { wppa_update_option('wppa_resize_on_upload', 'no'); } break; case 'wppa_i_source': if ($value == 'yes') { wppa_update_option('wppa_keep_source_admin', 'yes'); wppa_update_option('wppa_keep_source_frontend', 'yes'); } if ($value == 'no') { wppa_update_option('wppa_keep_source_admin', 'no'); wppa_update_option('wppa_keep_source_frontend', 'no'); } break; case 'wppa_i_userupload': if ($value == 'yes') { wppa_update_option('wppa_user_upload_on', 'yes'); wppa_update_option('wppa_user_upload_login', 'yes'); wppa_update_option('wppa_owner_only', 'yes'); wppa_update_option('wppa_upload_moderate', 'yes'); wppa_update_option('wppa_upload_edit', 'yes'); wppa_update_option('wppa_upload_notify', 'yes'); wppa_update_option('wppa_grant_an_album', 'yes'); $grantparent = wppa_opt('grant_parent'); if (!wppa_album_exists($grantparent)) { $id = wppa_create_album_entry(array('name' => __('Members', 'wp-photo-album-plus'), 'description' => __('Parent of the member albums', 'wp-photo-album-plus'), 'a_parent' => '-1', 'upload_limit' => '0/0')); if ($id) { wppa_index_add('album', $id); wppa_update_option('wppa_grant_parent', $id); } $my_post = array('post_title' => __('Members', 'wp-photo-album-plus'), 'post_content' => '[wppa type="content" album="' . $id . '"][/wppa]', 'post_status' => 'publish', 'post_type' => 'page'); $pagid = wp_insert_post($my_post); } wppa_update_option('wppa_alt_is_restricted', 'yes'); wppa_update_option('wppa_link_is_restricted', 'yes'); wppa_update_option('wppa_covertype_is_restricted', 'yes'); wppa_update_option('wppa_porder_restricted', 'yes'); } if ($value == 'no') { wppa_update_option('wppa_user_upload_on', 'no'); } break; case 'wppa_i_rating': if ($value == 'yes') { wppa_update_option('wppa_rating_on', 'yes'); } if ($value == 'no') { wppa_update_option('wppa_rating_on', 'no'); } break; case 'wppa_i_comment': if ($value == 'yes') { wppa_update_option('wppa_show_comments', 'yes'); wppa_update_option('wppa_comment_moderation', 'all'); wppa_update_option('wppa_comment_notify', 'admin'); } if ($value == 'no') { wppa_update_option('wppa_show_comments', 'no'); } break; case 'wppa_i_share': if ($value == 'yes') { wppa_update_option('wppa_share_on', 'yes'); } if ($value == 'no') { wppa_update_option('wppa_share_on', 'no'); } break; case 'wppa_i_iptc': if ($value == 'yes') { wppa_update_option('wppa_show_iptc', 'yes'); wppa_update_option('wppa_save_iptc', 'yes'); } if ($value == 'no') { wppa_update_option('wppa_show_iptc', 'no'); wppa_update_option('wppa_save_iptc', 'no'); } break; case 'wppa_i_exif': if ($value == 'yes') { wppa_update_option('wppa_show_exif', 'yes'); wppa_update_option('wppa_save_exif', 'yes'); } if ($value == 'no') { wppa_update_option('wppa_show_exif', 'no'); wppa_update_option('wppa_save_exif', 'no'); } break; case 'wppa_i_gpx': if ($value == 'yes') { $custom_content = wppa_opt('custom_content'); if (strpos($custom_content, 'w#location') === false) { $custom_content = $custom_content . ' w#location'; wppa_update_option('wppa_custom_content', $custom_content); } if (!wppa_switch('custom_on')) { wppa_update_option('wppa_custom_on', 'yes'); } if (wppa_opt('gpx_implementation') == 'none') { wppa_update_option('wppa_gpx_implementation', 'wppa-plus-embedded'); } } break; case 'wppa_i_fotomoto': if ($value == 'yes') { $custom_content = wppa_opt('custom_content'); if (strpos($custom_content, 'w#fotomoto') === false) { $custom_content = 'w#fotomoto ' . $custom_content; wppa_update_option('wppa_custom_content', $custom_content); } if (!wppa_switch('custom_on')) { wppa_update_option('wppa_custom_on', 'yes'); } wppa_update_option('wppa_fotomoto_on', 'yes'); wppa_update_option('wppa_custom_on', 'yes'); } break; case 'wppa_i_video': if ($value == 'yes') { wppa_update_option('wppa_enable_video', 'yes'); } else { wppa_update_option('wppa_enable_video', 'no'); } break; case 'wppa_i_audio': if ($value == 'yes') { wppa_update_option('wppa_enable_audio', 'yes'); } else { wppa_update_option('wppa_enable_audio', 'no'); } break; case 'wppa_i_done': $value = 'done'; break; case 'wppa_search_tags': case 'wppa_search_cats': case 'wppa_search_comments': update_option('wppa_index_need_remake', 'yes'); break; case 'wppa_blacklist_user': // Does user exist? $value = trim($value); $user = get_user_by('login', $value); // seems to be case insensitive if ($user && $user->user_login === $value) { $wpdb->query($wpdb->prepare("UPDATE `" . WPPA_PHOTOS . "` SET `status` = 'pending' WHERE `owner` = %s", $value)); $black_listed_users = get_option('wppa_black_listed_users', array()); if (!in_array($value, $black_listed_users)) { $black_listed_users[] = $value; update_option('wppa_black_listed_users', $black_listed_users); } $alert = esc_js(sprintf(__('User %s has been blacklisted.', 'wp-photo-album-plus'), $value)); } else { $alert = esc_js(sprintf(__('User %s does not exist.', 'wp-photo-album-plus'), $value)); } $value = ''; break; case 'wppa_un_blacklist_user': $wpdb->query($wpdb->prepare("UPDATE `" . WPPA_PHOTOS . "` SET `status` = 'publish' WHERE `owner` = %s", $value)); $black_listed_users = get_option('wppa_black_listed_users', array()); if (in_array($value, $black_listed_users)) { foreach (array_keys($black_listed_users) as $usr) { if ($black_listed_users[$usr] == $value) { unset($black_listed_users[$usr]); } } update_option('wppa_black_listed_users', $black_listed_users); } $value = '0'; break; case 'wppa_fotomoto_on': if ($value == 'yes') { $custom_content = wppa_opt('custom_content'); if (strpos($custom_content, 'w#fotomoto') === false) { $custom_content = 'w#fotomoto ' . $custom_content; wppa_update_option('wppa_custom_content', $custom_content); $alert = __('The content of the Custom box has been changed to display the Fotomoto toolbar.', 'wp-photo-album-plus') . ' '; } if (!wppa_switch('custom_on')) { wppa_update_option('wppa_custom_on', 'yes'); $alert .= __('The display of the custom box has been enabled', 'wp-photo-album-plus'); } } break; case 'wppa_gpx_implementation': if ($value != 'none') { $custom_content = wppa_opt('custom_content'); if (strpos($custom_content, 'w#location') === false) { $custom_content = $custom_content . ' w#location'; wppa_update_option('wppa_custom_content', $custom_content); $alert = __('The content of the Custom box has been changed to display maps.', 'wp-photo-album-plus') . ' '; } if (!wppa_switch('custom_on')) { wppa_update_option('wppa_custom_on', 'yes'); $alert .= __('The display of the custom box has been enabled', 'wp-photo-album-plus'); } } break; case 'wppa_regen_thumbs_skip_one': $last = get_option('wppa_regen_thumbs_last', '0'); $skip = $last + '1'; update_option('wppa_regen_thumbs_last', $skip); break; case 'wppa_remake_skip_one': $last = get_option('wppa_remake_last', '0'); $skip = $last + '1'; update_option('wppa_remake_last', $skip); break; case 'wppa_errorlog_purge': @unlink(WPPA_CONTENT_PATH . '/wppa-depot/admin/error.log'); break; case 'wppa_pl_dirname': $value = wppa_sanitize_file_name($value); $value = trim($value, ' /'); if (!$value) { wppa('error', '714'); wppa_out(__('This value can not be empty', 'wp-photo-album-plus')); } else { wppa_create_pl_htaccess($value); } break; case 'wppa_new_tag_value': $value = wppa_sanitize_tags($value, false, true); break; case 'wppa_up_tagselbox_content_1': case 'wppa_up_tagselbox_content_2': case 'wppa_up_tagselbox_content_3': $value = wppa_sanitize_tags($value); break; case 'wppa_wppa_set_shortcodes': $value = str_replace(' ', '', $value); break; case 'wppa_enable_video': // if off: set all statusses of videos to pending break; default: wppa('error', '0'); $alert = ''; } } if (wppa('error')) { if (!$title) { $title = sprintf(__('Failed to set %s to %s', 'wp-photo-album-plus'), $option, $value); } if (!$alert) { $alert .= wppa('out'); } } else { wppa_update_option($option, $value); if (!$title) { $title = sprintf(__('Setting %s updated to %s', 'wp-photo-album-plus'), $option, $value); } } // Save possible error $error = wppa('error'); // Something to do after changing the setting? wppa_initialize_runtime(true); // force reload new values // .htaccess wppa_create_wppa_htaccess(); // Thumbsize $new_minisize = wppa_get_minisize(); if ($old_minisize != $new_minisize) { update_option('wppa_regen_thumbs_status', 'Required'); $alert .= __('You just changed a setting that requires the regeneration of thumbnails.', 'wp-photo-album-plus'); $alert .= ' ' . __('Please run the appropriate action in Table VIII.', 'wp-photo-album-plus'); } // Produce the response text $output = '||' . $error . '||' . esc_attr($title) . '||' . esc_js($alert); echo $output; wppa_clear_cache(); wppa_exit(); break; // End update-option // End update-option case 'maintenance': $slug = $_POST['slug']; $nonce = $_REQUEST['wppa-nonce']; if (!wp_verify_nonce($nonce, 'wppa-nonce')) { echo 'Security check failure||' . $slug . '||Error||0'; wppa_exit(); } echo wppa_do_maintenance_proc($slug); wppa_exit(); break; case 'maintenancepopup': $slug = $_POST['slug']; $nonce = $_REQUEST['wppa-nonce']; if (!wp_verify_nonce($nonce, 'wppa-nonce')) { echo 'Security check failure||' . $slug . '||Error||0'; wppa_exit(); } echo wppa_do_maintenance_popup($slug); wppa_exit(); break; case 'do-fe-upload': if (is_admin()) { require_once 'wppa-non-admin.php'; } wppa_user_upload(); echo wppa('out'); wppa_exit(); break; case 'sanitizetags': $tags = isset($_GET['tags']) ? $_GET['tags'] : ''; $album = isset($_GET['album']) ? $_GET['album'] : '0'; $deftags = $album ? wppa_get_album_item($album, 'default_tags') : ''; $tags = $deftags ? $tags . ',' . $deftags : $tags; echo wppa_sanitize_tags($tags, false, true); wppa_exit(); break; case 'destroyalbum': $album = isset($_GET['album']) ? $_GET['album'] : '0'; if (!$album) { _e('Missing album id', 'wp-photo-album-plus'); wppa_exit(); } $nonce = isset($_GET['nonce']) ? $_GET['nonce'] : ''; if (!$nonce || !wp_verify_nonce($nonce, 'wppa_nonce_' . $album)) { echo 'Security check failure #798'; wppa_exit(); } // May I? $imay = true; if (!wppa_switch('user_destroy_on')) { $may = false; } if (wppa_switch('user_create_login')) { if (!is_user_logged_in()) { $may = false; } // Must login } if (!wppa_have_access($album)) { $may = false; // No album access } if (wppa_is_user_blacklisted()) { $may = false; } if (!$imay) { _e('You do not have the rights to delete this album', 'wp-photo-album-plus'); wppa_exit(); } // I may require_once 'wppa-album-admin-autosave.php'; wppa_del_album($album, ''); wppa_exit(); break; default: // Unimplemented $wppa-action die('-1'); } wppa_exit(); }
function wppa_album_select_a($args) { global $wpdb; $args = wp_parse_args($args, array('exclude' => '', 'selected' => '', 'disabled' => '', 'addpleaseselect' => false, 'addnone' => false, 'addall' => false, 'addgeneric' => false, 'addblank' => false, 'addselected' => false, 'addseparate' => false, 'addselbox' => false, 'addowner' => false, 'disableancestors' => false, 'checkaccess' => false, 'checkowner' => false, 'checkupload' => false, 'addmultiple' => false, 'addnumbers' => false, 'path' => false, 'root' => false, 'content' => false, 'sort' => true, 'checkarray' => false, 'array' => array(), 'optionclass' => '')); // Provide default selection if no selected given if ($args['selected'] === '') { $args['selected'] = wppa_get_last_album(); } // See if selection is valid if ($args['selected'] == $args['exclude'] || $args['checkupload'] && !wppa_allow_uploads($args['selected']) || $args['disableancestors'] && wppa_is_ancestor($args['exclude'], $args['selected'])) { $args['selected'] = '0'; } // Get roughly the albums that might be in the selection if ($args['checkarray'] && !empty($args['array'])) { $albums = $wpdb->get_results("SELECT `id`, `name` " . "FROM `" . WPPA_ALBUMS . "` " . "WHERE `id` IN (" . implode(',', $args['array']) . ") " . ($args['checkowner'] && wppa_switch('upload_owner_only') && !wppa_user_is('administrator') ? "AND `owner` IN ( '--- public ---', '" . wppa_get_user() . "' ) " : "") . wppa_get_album_order($args['root']), ARRAY_A); } else { $albums = $wpdb->get_results("SELECT `id`, `name` " . "FROM `" . WPPA_ALBUMS . "` " . ($args['checkowner'] && wppa_switch('upload_owner_only') && !wppa_user_is('administrator') ? "WHERE `owner` IN ( '--- public ---', '" . wppa_get_user() . "' ) " : "") . wppa_get_album_order($args['root']), ARRAY_A); } /* Can not add to cache because only "SELECT * " can be added // Add to secondary cache if ( $albums ) { wppa_cache_album( 'add', $albums ); } */ if ($albums) { // Filter for root if ($args['root']) { $root = $args['root']; switch ($root) { // case '0': all, will be skipped as it returns false in 'if ( $args['root'] )' case '-2': // Generic only foreach (array_keys($albums) as $albidx) { if (wppa_is_separate($albums[$albidx]['id'])) { unset($albums[$albidx]); } } break; case '-1': // Separate only foreach (array_keys($albums) as $albidx) { if (!wppa_is_separate($albums[$albidx]['id'])) { unset($albums[$albidx]); } } break; default: foreach (array_keys($albums) as $albidx) { if (!wppa_is_ancestor($root, $albums[$albidx]['id'])) { unset($albums[$albidx]); } } break; } } // Filter for must have content if ($args['content']) { foreach (array_keys($albums) as $albidx) { if (wppa_get_photo_count($albums[$albidx]['id']) <= wppa_get_mincount()) { unset($albums[$albidx]); } } } // Add paths if ($args['path']) { $albums = wppa_add_paths($albums); } else { foreach (array_keys($albums) as $index) { $albums[$index]['name'] = __(stripslashes($albums[$index]['name'])); } } // Sort if ($args['sort']) { $albums = wppa_array_sort($albums, 'name'); } } // Output $result = ''; $selected = $args['selected'] == '0' ? ' selected="selected"' : ''; if ($args['addpleaseselect']) { $result .= '<option value="0" disabled="disabled" ' . $selected . ' >' . __('- select an album -', 'wp-photo-album-plus') . '</option>'; } $selected = $args['selected'] == '0' ? ' selected="selected"' : ''; if ($args['addnone']) { $result .= '<option value="0"' . $selected . ' >' . __('--- none ---', 'wp-photo-album-plus') . '</option>'; } $selected = $args['selected'] == '0' ? ' selected="selected"' : ''; if ($args['addall']) { $result .= '<option value="0"' . $selected . ' >' . __('--- all ---', 'wp-photo-album-plus') . '</option>'; } $selected = $args['selected'] == '-2' ? ' selected="selected"' : ''; if ($args['addall']) { $result .= '<option value="-2"' . $selected . ' >' . __('--- generic ---', 'wp-photo-album-plus') . '</option>'; } $selected = $args['selected'] == '-3' ? ' selected="selected"' : ''; if ($args['addowner']) { $result .= '<option value="-3"' . $selected . ' >' . __('--- owner/public ---', 'wp-photo-album-plus') . '</option>'; } $selected = $args['selected'] == '0' ? ' selected="selected"' : ''; if ($args['addblank']) { $result .= '<option value="0"' . $selected . ' >' . '</option>'; } $selected = $args['selected'] == '-99' ? ' selected="selected"' : ''; if ($args['addmultiple']) { $result .= '<option value="-99"' . $selected . ' >' . __('--- multiple see below ---', 'wp-photo-album-plus') . '</option>'; } $selected = $args['selected'] == '0' ? ' selected="selected"' : ''; if ($args['addselbox']) { $result .= '<option value="0"' . $selected . ' >' . __('--- a selection box ---', 'wp-photo-album-plus') . '</option>'; } // In case multiple if (strpos($args['selected'], ',') !== false) { $selarr = explode(',', $args['selected']); } else { $selarr = array($args['selected']); } if ($albums) { foreach ($albums as $album) { if ($args['disabled'] == $album['id'] || $args['exclude'] == $album['id'] || $args['checkupload'] && !wppa_allow_uploads($album['id']) || $args['disableancestors'] && wppa_is_ancestor($args['exclude'], $album['id'])) { $disabled = ' disabled="disabled"'; } else { $disabled = ''; } if (in_array($album['id'], $selarr, true) && !$disabled) { $selected = ' selected="selected"'; } else { $selected = ''; } $ok = true; // Assume this will be in the list if ($args['checkaccess'] && !wppa_have_access($album['id'])) { $ok = false; } /* This is in the query now if ( $args['checkowner'] && wppa_switch( 'upload_owner_only' ) ) { // Need to check if ( $album['owner'] != wppa_get_user() && $album['owner'] != '--- public ---' ) { // Not 'mine' if ( ! wppa_user_is( 'administrator' ) ) { // No admin $ok = false; } } } */ /* This is in the query now if ( $args['checkarray'] ) { if ( ! in_array( $album['id'], $args['array'] ) ) { $ok = false; } } */ if ($selected && $args['addselected']) { $ok = true; } if ($ok) { if ($args['addnumbers']) { $number = ' ( ' . $album['id'] . ' )'; } else { $number = ''; } $result .= '<option class="' . $args['optionclass'] . '" value="' . $album['id'] . '" ' . $selected . $disabled . '>' . $album['name'] . $number . '</option>'; } } } $selected = $args['selected'] == '-1' ? ' selected="selected"' : ''; if ($args['addseparate']) { $result .= '<option value="-1"' . $selected . '>' . __('--- separate ---', 'wp-photo-album-plus') . '</option>'; } return $result; }
function _wppa_page_options() { global $wpdb; global $wppa; global $wppa_opt; global $blog_id; global $wppa_status; global $options_error; global $wppa_api_version; global $wp_roles; global $wppa_table; global $wppa_subtable; global $wppa_revno; global $no_default; global $wppa_tags; global $wp_version; // Test area // End test area // Initialize wppa_initialize_runtime(true); $options_error = false; // If watermark all is going to be run, make sure the current user has no private overrule settings delete_option('wppa_watermark_file_' . wppa_get_user()); delete_option('wppa_watermark_pos_' . wppa_get_user()); // Things that wppa-admin-scripts.js needs to know echo '<script type="text/javascript">' . "\n"; echo '/* <![CDATA[ */' . "\n"; echo "\t" . 'wppaImageDirectory = "' . wppa_get_imgdir() . '";' . "\n"; echo "\t" . 'wppaAjaxUrl = "' . admin_url('admin-ajax.php') . '";' . "\n"; echo "\t" . 'wppaCloseText = "' . __('Close!', 'wp-photo-album-plus') . '";' . "\n"; echo "/* ]]> */\n"; echo "</script>\n"; $key = ''; // Someone hit a submit button or the like? if (isset($_REQUEST['wppa_settings_submit'])) { // Yep! check_admin_referer('wppa-nonce', 'wppa-nonce'); $key = $_REQUEST['wppa-key']; $sub = isset($_REQUEST['wppa-sub']) ? $_REQUEST['wppa-sub'] : ''; // Switch on action key switch ($key) { // Must be here case 'wppa_moveup': if (wppa_switch('split_namedesc')) { $sequence = wppa_opt('slide_order_split'); $indices = explode(',', $sequence); $temp = $indices[$sub]; $indices[$sub] = $indices[$sub - '1']; $indices[$sub - '1'] = $temp; wppa_update_option('wppa_slide_order_split', implode(',', $indices)); } else { $sequence = wppa_opt('slide_order'); $indices = explode(',', $sequence); $temp = $indices[$sub]; $indices[$sub] = $indices[$sub - '1']; $indices[$sub - '1'] = $temp; wppa_update_option('wppa_slide_order', implode(',', $indices)); } break; // Should better be here // Should better be here case 'wppa_setup': wppa_setup(true); // Message on success or fail is in the routine break; // Must be here // Must be here case 'wppa_backup': wppa_backup_settings(); // Message on success or fail is in the routine break; // Must be here // Must be here case 'wppa_load_skin': $fname = wppa_opt('skinfile'); if ($fname == 'restore') { if (wppa_restore_settings(WPPA_DEPOT_PATH . '/settings.bak', 'backup')) { wppa_ok_message(__('Saved settings restored', 'wp-photo-album-plus')); } else { wppa_error_message(__('Unable to restore saved settings', 'wp-photo-album-plus')); $options_error = true; } } elseif ($fname == 'default' || $fname == '') { if (wppa_set_defaults(true)) { wppa_ok_message(__('Reset to default settings', 'wp-photo-album-plus')); } else { wppa_error_message(__('Unable to set defaults', 'wp-photo-album-plus')); $options_error = true; } } elseif (wppa_restore_settings($fname, 'skin')) { wppa_ok_message(sprintf(__('Skinfile %s loaded', 'wp-photo-album-plus'), basename($fname))); } else { // Error printed by wppa_restore_settings() } break; // Must be here // Must be here case 'wppa_watermark_upload': if (isset($_FILES['file_1']) && $_FILES['file_1']['error'] != 4) { // Expected a fileupload for a watermark $file = $_FILES['file_1']; if ($file['error']) { wppa_error_message(sprintf(__('Upload error %s', 'wp-photo-album-plus'), $file['error'])); } else { $imgsize = getimagesize($file['tmp_name']); if (!is_array($imgsize) || !isset($imgsize[2]) || $imgsize[2] != 3) { wppa_error_message(sprintf(__('Uploaded file %s is not a .png file', 'wp-photo-album-plus'), $file['name']) . ' (Type=' . $file['type'] . ').'); } else { copy($file['tmp_name'], WPPA_UPLOAD_PATH . '/watermarks/' . basename($file['name'])); wppa_alert(sprintf(__('Upload of %s done', 'wp-photo-album-plus'), basename($file['name']))); } } } else { wppa_error_message(__('No file selected or error on upload', 'wp-photo-album-plus')); } break; case 'wppa_watermark_font_upload': if (isset($_FILES['file_2']) && $_FILES['file_2']['error'] != 4) { // Expected a fileupload for a watermark font file $file = $_FILES['file_2']; if ($file['error']) { wppa_error_message(sprintf(__('Upload error %s', 'wp-photo-album-plus'), $file['error'])); } else { if (substr($file['name'], -4) != '.ttf') { wppa_error_message(sprintf(__('Uploaded file %s is not a .ttf file', 'wp-photo-album-plus'), $file['name']) . ' (Type=' . $file['type'] . ').'); } else { copy($file['tmp_name'], WPPA_UPLOAD_PATH . '/fonts/' . basename($file['name'])); wppa_alert(sprintf(__('Upload of %s done', 'wp-photo-album-plus'), basename($file['name']))); } } } else { wppa_error_message(__('No file selected or error on upload', 'wp-photo-album-plus')); } break; case 'wppa_audiostub_upload': if (isset($_FILES['file_3']) && $_FILES['file_3']['error'] != 4) { // Expected a fileupload $file = $_FILES['file_3']; if ($file['error']) { wppa_error_message(sprintf(__('Upload error %s', 'wp-photo-album-plus'), $file['error'])); } else { $imgsize = getimagesize($file['tmp_name']); if (!is_array($imgsize) || !isset($imgsize[2]) || $imgsize[2] < 1 || $imgsize[2] > 3) { wppa_error_message(sprintf(__('Uploaded file %s is not a valid image file', 'wp-photo-album-plus'), $file['name']) . ' (Type=' . $file['type'] . ').'); } else { switch ($imgsize[2]) { case '1': $ext = '.gif'; break; case '2': $ext = '.jpg'; break; case '3': $ext = '.png'; break; } copy($file['tmp_name'], WPPA_UPLOAD_PATH . '/audiostub' . $ext); wppa_update_option('wppa_audiostub', 'audiostub' . $ext); // Thumbx, thumby, phtox and photoy must be cleared for the new stub $wpdb->query("UPDATE `" . WPPA_PHOTOS . "` SET `thumbx` = 0, `thumby` = 0, `photox` = 0, `photoy` = 0 WHERE `ext` = 'xxx'"); wppa_alert(sprintf(__('Upload of %s done', 'wp-photo-album-plus'), basename($file['name']))); } } } else { wppa_error_message(__('No file selected or error on upload', 'wp-photo-album-plus')); } break; case 'wppa_delete_all_from_cloudinary': $bret = wppa_delete_all_from_cloudinary(); if ($bret) { wppa_ok_message('Done! wppa_delete_all_from_cloudinary'); } else { sleep(5); wppa_ok_message('Not yet Done! wppa_delete_all_from_cloudinary' . '<br />Trying to continue...'); echo '<script type="text/javascript">' . 'document.location=' . 'document.location+"&' . 'wppa_settings_submit=Doit&' . 'wppa-nonce=' . $_REQUEST['wppa-nonce'] . '&' . 'wppa-key=' . $key . '&' . '_wp_http_referer=' . $_REQUEST['_wp_http_referer'] . '"' . '</script>'; } break; case 'wppa_delete_derived_from_cloudinary': $bret = wppa_delete_derived_from_cloudinary(); if ($bret) { wppa_ok_message('Done! wppa_delete_derived_from_cloudinary'); } else { sleep(5); wppa_ok_message('Not yet Done! wppa_delete_derived_from_cloudinary' . '<br />Trying to continue...'); echo '<script type="text/javascript">' . 'document.location=' . 'document.location+"&' . 'wppa_settings_submit=Doit&' . 'wppa-nonce=' . $_REQUEST['wppa-nonce'] . '&' . 'wppa-key=' . $key . '&' . '_wp_http_referer=' . $_REQUEST['_wp_http_referer'] . '"' . '</script>'; } break; default: wppa_error_message('Unimplemnted action key: ' . $key); } // Make sure we are uptodate wppa_initialize_runtime(true); } // wppa-settings-submit // Fix invalid ratings $iret = $wpdb->query("DELETE FROM `" . WPPA_RATING . "` WHERE `value` = 0"); if ($iret) { wppa_update_message(sprintf(__('%s invalid ratings removed. Please run Table VIII-A5: Rerate to fix the averages.', 'wp-photo-album-plus'), $iret)); } // Fix invalid source path wppa_fix_source_path(); // Check database wppa_check_database(true); // Cleanup obsolete settings if ($wpdb->get_var("SELECT COUNT(*) FROM `" . $wpdb->prefix . 'options' . "` WHERE `option_name` LIKE 'wppa_last_album_used-%'") > 100) { $iret = $wpdb->query("DELETE FROM `" . $wpdb->prefix . 'options' . "` WHERE `option_name` LIKE 'wppa_last_album_used-%'"); wppa_update_message(sprintf(__('%s last album used settings removed.', 'wp-photo-album-plus'), $iret)); } ?> <div class="wrap"> <?php wppa_admin_spinner(); ?> <?php $iconurl = WPPA_URL . '/img/settings32.png'; ?> <img id="icon-album" src="<?php echo $iconurl; ?> " /> <h1 style="display:inline" ><?php _e('WP Photo Album Plus Settings', 'wp-photo-album-plus'); ?> <span style="color:blue;"><?php _e('Auto Save', 'wp-photo-album-plus'); ?> </span></h1> <?php _e('Database revision:', 'wp-photo-album-plus'); ?> <?php echo get_option('wppa_revision', '100'); ?> . <?php _e('WP Charset:', 'wp-photo-album-plus'); ?> <?php echo get_bloginfo('charset'); ?> . <?php echo 'Current PHP version: ' . phpversion(); ?> . <?php echo 'WPPA+ API Version: ' . $wppa_api_version; ?> . <br /><?php if (is_multisite()) { if (WPPA_MULTISITE_GLOBAL) { _e('Multisite in singlesite mode.', 'wp-photo-album-plus'); } else { _e('Multisite enabled.', 'wp-photo-album-plus'); echo ' '; _e('Blogid =', 'wp-photo-album-plus'); echo ' ' . $blog_id; } } // Blacklist $blacklist_plugins = array('wp-fluid-images/plugin.php', 'performance-optimization-order-styles-and-javascript/order-styles-js.php', 'wp-ultra-simple-paypal-shopping-cart/wp_ultra_simple_shopping_cart.php', 'cachify/cachify.php', 'wp-deferred-javascripts/wp-deferred-javascripts.php', 'frndzk-photo-lightbox-gallery/frndzk_photo_gallery.php'); $plugins = get_option('active_plugins'); $matches = array_intersect($blacklist_plugins, $plugins); foreach ($matches as $bad) { wppa_error_message(__('Please de-activate plugin <i style="font-size:14px;">', 'wp-photo-album-plus') . substr($bad, 0, strpos($bad, '/')) . __('. </i>This plugin will cause wppa+ to function not properly.', 'wp-photo-album-plus')); } // Graylist $graylist_plugins = array('shortcodes-ultimate/shortcodes-ultimate.php', 'tablepress/tablepress.php'); $matches = array_intersect($graylist_plugins, $plugins); foreach ($matches as $bad) { wppa_warning_message(__('Please note that plugin <i style="font-size:14px;">', 'wp-photo-album-plus') . substr($bad, 0, strpos($bad, '/')) . __('</i> can cause wppa+ to function not properly if it is misconfigured.', 'wp-photo-album-plus')); } // Check for trivial requirements if (!function_exists('wppa_imagecreatefromjpeg')) { wppa_error_message(__('There is a serious misconfiguration in your servers PHP config. Function wppa_imagecreatefromjpeg() does not exist. You will encounter problems when uploading photos and not be able to generate thumbnail images. Ask your hosting provider to add GD support with a minimal version 1.8.', 'wp-photo-album-plus')); } // Check for pending actions // if ( wppa_switch( 'indexed_search' ) ) { if (get_option('wppa_remake_index_albums_status') && get_option('wppa_remake_index_albums_user', wppa_get_user()) == wppa_get_user()) { wppa_warning_message(__('Rebuilding the Album index needs completion. See Table VIII', 'wp-photo-album-plus')); } if (get_option('wppa_remake_index_photos_status') && get_option('wppa_remake_index_photos_user', wppa_get_user()) == wppa_get_user()) { wppa_warning_message(__('Rebuilding the Photo index needs completion. See Table VIII', 'wp-photo-album-plus')); } // } if (get_option('wppa_remove_empty_albums_status') && get_option('wppa_remove_empty_albums_user', wppa_get_user()) == wppa_get_user()) { wppa_warning_message(__('Remove empty albums needs completion. See Table VIII', 'wp-photo-album-plus')); } if (get_option('wppa_apply_new_photodesc_all_status') && get_option('wppa_apply_new_photodesc_all_user', wppa_get_user()) == wppa_get_user()) { wppa_warning_message(__('Applying new photo description needs completion. See Table VIII', 'wp-photo-album-plus')); } if (get_option('wppa_append_to_photodesc_status') && get_option('wppa_append_to_photodesc_user', wppa_get_user()) == wppa_get_user()) { wppa_warning_message(__('Appending to photo description needs completion. See Table VIII', 'wp-photo-album-plus')); } if (get_option('wppa_remove_from_photodesc_status') && get_option('wppa_remove_from_photodesc_user', wppa_get_user()) == wppa_get_user()) { wppa_warning_message(__('Removing from photo description needs completion. See Table VIII', 'wp-photo-album-plus')); } if (get_option('wppa_remove_file_extensions_status') && get_option('wppa_remove_file_extensions_user', wppa_get_user()) == wppa_get_user()) { wppa_warning_message(__('Removing file extensions needs completion. See Table VIII', 'wp-photo-album-plus')); } if (get_option('wppa_regen_thumbs_status') && get_option('wppa_regen_thumbs_user', wppa_get_user()) == wppa_get_user()) { wppa_warning_message(__('Regenerating the Thumbnails needs completion. See Table VIII', 'wp-photo-album-plus')); } if (get_option('wppa_rerate_status') && get_option('wppa_rerate_user', wppa_get_user()) == wppa_get_user()) { wppa_warning_message(__('Rerating needs completion. See Table VIII', 'wp-photo-album-plus')); } // Check for inconsistencies if (wppa_opt('thumbtype') == 'default' && (wppa_opt('tf_width') < wppa_opt('thumbsize') || wppa_opt('tf_width_alt') < wppa_opt('thumbsize_alt') || wppa_opt('tf_height') < wppa_opt('thumbsize') || wppa_opt('tf_height_alt') < wppa_opt('thumbsize_alt'))) { wppa_warning_message(__('A thumbframe width or height should not be smaller than a thumbnail size. Please correct the corresponding setting(s) in Table I-C', 'wp-photo-album-plus')); } ?> <!--<br /><a href="javascript:window.print();"><?php //_e('Print settings') ?> </a><br />--> <a style="cursor:pointer;" id="wppa-legon" onclick="jQuery('#wppa-legenda').css('display', ''); jQuery('#wppa-legon').css('display', 'none'); return false;" ><?php _e('Show legenda', 'wp-photo-album-plus'); ?> </a> <div id="wppa-legenda" class="updated" style="line-height:20px; display:none" > <div style="float:left"><?php _e('Legenda:', 'wp-photo-album-plus'); ?> </div><br /> <?php echo wppa_doit_button(__('Button', 'wp-photo-album-plus')); ?> <div style="float:left"> : <?php _e('action that causes page reload.', 'wp-photo-album-plus'); ?> </div> <br /> <input type="button" onclick="if ( confirm('<?php _e('Are you sure?', 'wp-photo-album-plus'); ?> ') ) return true; else return false;" class="button-secundary" style="float:left; border-radius:3px; font-size: 12px; height: 18px; margin: 0 4px; padding: 0px;" value="<?php _e('Button', 'wp-photo-album-plus'); ?> " /> <div style="float:left"> : <?php _e('action that does not cause page reload.', 'wp-photo-album-plus'); ?> </div> <br /> <img src="<?php echo wppa_get_imgdir(); ?> star.ico" title="<?php _e('Setting unmodified', 'wp-photo-album-plus'); ?> " style="padding-left:4px; float:left; height:16px; width:16px;" /><div style="float:left"> : <?php _e('Setting unmodified', 'wp-photo-album-plus'); ?> </div> <br /> <img src="<?php echo wppa_get_imgdir(); ?> spinner.gif" title="<?php _e('Update in progress', 'wp-photo-album-plus'); ?> " style="padding-left:4px; float:left; height:16px; width:16px;" /><div style="float:left"> : <?php _e('Update in progress', 'wp-photo-album-plus'); ?> </div> <br /> <img src="<?php echo wppa_get_imgdir(); ?> tick.png" title="<?php _e('Setting updated', 'wp-photo-album-plus'); ?> " style="padding-left:4px; float:left; height:16px; width:16px;" /><div style="float:left"> : <?php _e('Setting updated', 'wp-photo-album-plus'); ?> </div> <br /> <img src="<?php echo wppa_get_imgdir(); ?> cross.png" title="<?php _e('Update failed', 'wp-photo-album-plus'); ?> " style="padding-left:4px; float:left; height:16px; width:16px;" /><div style="float:left"> : <?php _e('Update failed', 'wp-photo-album-plus'); ?> </div> <br /> <a style="cursor:pointer;" onclick="jQuery('#wppa-legenda').css('display', 'none'); jQuery('#wppa-legon').css('display', ''); return false;" ><?php _e('Hide this', 'wp-photo-album-plus'); ?> </a> </div> <?php // Quick open selections $wppa_tags = array('-' => '', 'system' => __('System', 'wp-photo-album-plus'), 'access' => __('Access', 'wp-photo-album-plus'), 'album' => __('Albums', 'wp-photo-album-plus'), 'audio' => __('Audio', 'wp-photo-album-plus'), 'comment' => __('Comments', 'wp-photo-album-plus'), 'count' => __('Counts', 'wp-photo-album-plus'), 'cover' => __('Covers', 'wp-photo-album-plus'), 'layout' => __('Layout', 'wp-photo-album-plus'), 'lightbox' => __('Lightbox', 'wp-photo-album-plus'), 'link' => __('Links', 'wp-photo-album-plus'), 'meta' => __('Metadata', 'wp-photo-album-plus'), 'navi' => __('Navigation', 'wp-photo-album-plus'), 'page' => __('Page', 'wp-photo-album-plus'), 'rating' => __('Rating', 'wp-photo-album-plus'), 'search' => __('Search', 'wp-photo-album-plus'), 'size' => __('Sizes', 'wp-photo-album-plus'), 'slide' => __('Slideshows', 'wp-photo-album-plus'), 'sm' => __('Social Media', 'wp-photo-album-plus'), 'thumb' => __('Thumbnails', 'wp-photo-album-plus'), 'upload' => __('Uploads', 'wp-photo-album-plus'), 'widget' => __('Widgets', 'wp-photo-album-plus'), 'water' => __('Watermark', 'wp-photo-album-plus'), 'video' => __('Video', 'wp-photo-album-plus')); asort($wppa_tags); ?> <p> <?php _e('Click on the banner of a (sub)table to open/close it, or', 'wp-photo-album-plus'); ?> <br /> <?php _e('Show settings related to:', 'wp-photo-album-plus'); ?> <select id="wppa-quick-selbox-1" onchange="wppaQuickSel()"> <?php foreach (array_keys($wppa_tags) as $key) { ?> <option value="<?php echo $key; ?> "><?php echo $wppa_tags[$key]; ?> </option> <?php } ?> </select> <?php _e('and ( optionally ) to:', 'wp-photo-album-plus'); ?> <select id="wppa-quick-selbox-2" onchange="wppaQuickSel()"> <?php foreach (array_keys($wppa_tags) as $key) { ?> <option value="<?php echo $key; ?> "><?php echo $wppa_tags[$key]; ?> </option> <?php } ?> </select> </p> <div id="wppa-modal-container" ></div> <form enctype="multipart/form-data" action="<?php echo wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_options'); ?> " method="post"> <?php wp_nonce_field('wppa-nonce', 'wppa-nonce'); ?> <input type="hidden" name="wppa-key" id="wppa-key" value="" /> <input type="hidden" name="wppa-sub" id="wppa-sub" value="" /> <?php if (get_option('wppa_i_done') == 'done') { ?> <a class="-wppa-quick" onclick="jQuery('.wppa-quick').css('display','inline');jQuery('.-wppa-quick').css('display','none')" ><?php _e('Quick setup', 'wp-photo-album-plus'); ?> </a> <?php } else { ?> <input type="button" id="wppa-quick" style="background-color:yellow;" class="-wppa-quick" onclick="jQuery('.wppa-quick').css('display','inline');jQuery('.-wppa-quick').css('display','none')" value="<?php _e('Do a quick initial setup', 'wp-photo-album-plus'); ?> " /> <input type="button" style="display:none;" class="wppa-quick" onclick="jQuery('.-wppa-quick').css('display','inline');jQuery('.wppa-quick').css('display','none')" value="<?php _e('Close quick setup', 'wp-photo-album-plus'); ?> " /> <?php } ?> <?php if (get_option('wppa_prevrev') == '100' && get_option('wppa_i_done') != 'done') { ?> <script type="text/javascript" > var wppaButtonColor = '#7F7'; function wppaBlinkButton() { if ( wppaButtonColor == '#7F7' ) { wppaButtonColor = '#F77'; } else if ( wppaButtonColor == '#F77' ) { wppaButtonColor = '#FF7'; } else if ( wppaButtonColor == '#FF7') { wppaButtonColor = '#7F7'; } jQuery( '#wppa-quick' ).css( 'background-color', wppaButtonColor ); if ( wppaButtonColor == '#7F7' ) { setTimeout( 'wppaBlinkButton()', 1500 ); } else { setTimeout( 'wppaBlinkButton()', 500 ); } } wppaBlinkButton(); </script> <?php } ?> <?php // Linkpages $options_page = false; $options_page_post = false; $values_page = false; $values_page_post = false; // First $options_page_post[] = __('--- The same post or page ---', 'wp-photo-album-plus'); $values_page_post[] = '0'; $options_page[] = __('--- Please select a page ---', 'wp-photo-album-plus'); $values_page[] = '0'; // Pages if any $query = "SELECT ID, post_title, post_content, post_parent FROM " . $wpdb->posts . " WHERE post_type = 'page' AND post_status = 'publish' ORDER BY post_title ASC"; $pages = $wpdb->get_results($query, ARRAY_A); if ($pages) { if (wppa_switch('hier_pagesel')) { $pages = wppa_add_parents($pages); } else { // Just translate foreach (array_keys($pages) as $index) { $pages[$index]['post_title'] = __(stripslashes($pages[$index]['post_title']), 'wp-photo-album-plus'); } } $pages = wppa_array_sort($pages, 'post_title'); foreach ($pages as $page) { if (strpos($page['post_content'], '%%wppa%%') !== false || strpos($page['post_content'], '[wppa') !== false) { $options_page[] = __($page['post_title'], 'wp-photo-album-plus'); $options_page_post[] = __($page['post_title'], 'wp-photo-album-plus'); $values_page[] = $page['ID']; $values_page_post[] = $page['ID']; } else { $options_page[] = '|' . __($page['post_title'], 'wp-photo-album-plus') . '|'; $options_page_post[] = '|' . __($page['post_title'], 'wp-photo-album-plus') . '|'; $values_page[] = $page['ID']; $values_page_post[] = $page['ID']; } } } else { $options_page[] = __('--- No page to link to (yet) ---', 'wp-photo-album-plus'); $values_page[] = '0'; } $options_page_auto = $options_page; $options_page_auto[0] = __('--- Will be auto created ---', 'wp-photo-album-plus'); ?> <div class="wppa-quick" style="display:none;" > <?php // Table 0: Quick Setup ?> <?php wppa_settings_box_header('0', __('Table O:', 'wp-photo-album-plus') . ' ' . __('Quick Setup:', 'wp-photo-album-plus') . ' ' . __('This table enables you to quickly do an inital setup.', 'wp-photo-album-plus')); ?> <div id="wppa_table_0" style=" margin:0; padding:0; " class="inside" > <table class="widefat wppa-table wppa-setting-table"> <thead style="font-weight: bold; " class="wppa_table_1"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Setting', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </thead> <tbody class="wppa_table_0"> <?php $no_default = true; $wppa_table = '0'; $clas = ''; $tags = ''; wppa_setting_subheader('', '1', __('To quickly setup WPPA+ please answer the following questions. You can alway change any setting later. <a>Click on me!</a>', 'wp-photo-album-plus')); $name = __('Is your theme <i>responsive</i>?', 'wp-photo-album-plus'); $desc = __('Responsive themes have a layout that varies with the size of the browser window.', 'wp-photo-album-plus'); $help = esc_js(__('WPPA+ needs to know this to automaticly adept the width of the display to the available width on the page.', 'wp-photo-album-plus')); $slug = 'wppa_i_responsive'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Do you want to downsize photos during upload?', 'wp-photo-album-plus'); $desc = __('Downsizing photos make them load faster to the visitor, without loosing display quality', 'wp-photo-album-plus'); $help = esc_js(__('If you answer yes, the photos will be downsized to max 1024 x 768 pixels. You can change this later, if you like', 'wp-photo-album-plus')); $slug = 'wppa_i_downsize'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Do you want to save the original photofiles?', 'wp-photo-album-plus'); $desc = __('This will require considerable disk space on the server.', 'wp-photo-album-plus'); $help = esc_js(__('If you answer yes, you will be able to remove watermarks you applied with wppa+ in a later stage, redo downsizing to a larger size afterwards, and supply fullsize images for download.', 'wp-photo-album-plus')); $slug = 'wppa_i_source'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('May visitors upload photos?', 'wp-photo-album-plus'); $desc = __('It is safe to do so, but i will have to do some settings to keep it safe!', 'wp-photo-album-plus'); $help = esc_js(__('If you answer yes, i will assume you want to enable logged in users to upload photos at the front-end of the website and allow them to edit their photos name and descriptions.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('The photos will be hold for moderation, the admin will get notified by email.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Each user will get his own album to upload to. These settings can be changed later.', 'wp-photo-album-plus')); $slug = 'wppa_i_userupload'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Do you want the rating system active?', 'wp-photo-album-plus'); $desc = __('Enable the rating system and show the votes in the slideshow.', 'wp-photo-album-plus'); $help = esc_js(__('You can configure the details of the rating system later', 'wp-photo-album-plus')); $slug = 'wppa_i_rating'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Do you want the comment system active?', 'wp-photo-album-plus'); $desc = __('Enable the comment system and show the comments in the slideshow.', 'wp-photo-album-plus'); $help = esc_js(__('You can configure the details of the comment system later', 'wp-photo-album-plus')); $slug = 'wppa_i_comment'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Do you want the social media share buttons displayed?', 'wp-photo-album-plus'); $desc = __('Display the social media buttons in the slideshow', 'wp-photo-album-plus'); $help = esc_js(__('These buttons share the specific photo rather than the page where it is displayed on', 'wp-photo-album-plus')); $slug = 'wppa_i_share'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Are you going to use IPTC data?', 'wp-photo-album-plus'); $desc = __('IPTC data is information you may have added in a photo manipulation program.', 'wp-photo-album-plus'); $help = esc_js(__('The information can be displayed in slideshows and in photo descriptions.', 'wp-photo-album-plus')); $slug = 'wppa_i_iptc'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Are you going to use EXIF data?', 'wp-photo-album-plus'); $desc = __('EXIF data is information from the camera like model no, focal distance and aperture used.', 'wp-photo-album-plus'); $help = esc_js(__('The information can be displayed in slideshows and in photo descriptions.', 'wp-photo-album-plus')); $slug = 'wppa_i_exif'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Are you going to use GPX data?', 'wp-photo-album-plus'); $desc = __('Some cameras and mobile devices save the geographic location where the photo is taken.', 'wp-photo-album-plus'); $help = esc_js(__('A Google map can be displayed in slideshows.', 'wp-photo-album-plus')); $slug = 'wppa_i_gpx'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Are you going to use Fotomoto?', 'wp-photo-album-plus'); $desc = __('<a href="http://www.fotomoto.com/" target="_blank" >Fotomoto</a> is an on-line print service.', 'wp-photo-album-plus'); $help = esc_js(__('If you answer Yes, you will have to open an account on Fotomoto.', 'wp-photo-album-plus')); $slug = 'wppa_i_fotomoto'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Are you going to add videofiles?', 'wp-photo-album-plus'); $desc = __('You can mix videos and photos in any album.', 'wp-photo-album-plus'); $help = esc_js(__('You can configure the details later', 'wp-photo-album-plus')); $slug = 'wppa_i_video'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Are you going to add audiofiles?', 'wp-photo-album-plus'); $desc = __('You can add audio to photos in any album.', 'wp-photo-album-plus'); $help = esc_js(__('You can configure the details later', 'wp-photo-album-plus')); $slug = 'wppa_i_audio'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Are you going to upload 3D stereo photos?', 'wp-photo-album-plus'); $desc = __('You can add l-r and r-l stereo photo pairs.', 'wp-photo-album-plus'); $help = esc_js(__('You can configure the details later', 'wp-photo-album-plus')); $slug = 'wppa_i_stereo'; $opts = array('', __('yes', 'wp-photo-album-plus'), __('no', 'wp-photo-album-plus')); $vals = array('', 'yes', 'no'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Done?', 'wp-photo-album-plus'); $desc = __('If you are ready answering these questions, select <b>yes</b>', 'wp-photo-album-plus'); $help = esc_js(__('You can change any setting later, and be more specific and add a lot of settings. For now it is enough, go create albums and upload photos!', 'wp-photo-album-plus')); $slug = 'wppa_i_done'; $opts = array('', __('yes', 'wp-photo-album-plus')); $vals = array('', 'yes'); $closetext = esc_js(__('Thank you!. The most important settings are done now. You can refine your settings, the behaviour and appearance of WPPA+ in the Tables below.', 'wp-photo-album-plus')); $postaction = 'alert(\'' . $closetext . '\');setTimeout(\'document.location.reload(true)\', 1000)'; $html = wppa_select($slug, $opts, $vals, '', '', false, $postaction); wppa_setting($slug, '99', $name, $desc, $html, $help, $clas, $tags); $no_default = false; ?> </tbody> <tfoot style="font-weight: bold;" class="wppa_table_1"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Setting', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </tfoot> </table> </div> </div> <?php // Table 1: Sizes ?> <?php wppa_settings_box_header('1', __('Table I:', 'wp-photo-album-plus') . ' ' . __('Sizes:', 'wp-photo-album-plus') . ' ' . __('This table describes all the sizes and size options (except fontsizes) for the generation and display of the WPPA+ elements.', 'wp-photo-album-plus')); ?> <div id="wppa_table_1" style="display:none" > <table class="widefat wppa-table wppa-setting-table"> <thead style="font-weight: bold; " class="wppa_table_1"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Setting', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </thead> <tbody class="wppa_table_1"> <?php $wppa_table = 'I'; wppa_setting_subheader('A', '1', __('WPPA+ global system related size settings', 'wp-photo-album-plus')); $name = __('Column Width', 'wp-photo-album-plus'); $desc = __('The width of the main column in your theme\'s display area.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the width of the main column in your theme\'s display area.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('You should set this value correctly to make sure the fullsize images are properly aligned horizontally.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('You may enter \'auto\' for use in themes that have a floating content column.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('The use of \'auto\' is required for responsive themes.', 'wp-photo-album-plus')); $slug = 'wppa_colwidth'; $onchange = 'wppaCheckFullHalign()'; $html = wppa_input($slug, '40px', '', __('pixels wide', 'wp-photo-album-plus'), $onchange); $clas = ''; $tags = 'size,system'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Initial Width', 'wp-photo-album-plus'); $desc = __('The most often displayed colun width in responsive theme', 'wp-photo-album-plus'); $help = esc_js(__('Change this value only if your responsive theme shows initially a wrong column width.', 'wp-photo-album-plus')); $slug = 'wppa_initial_colwidth'; $html = wppa_input($slug, '40px', '', __('pixels wide', 'wp-photo-album-plus')); $clas = 'wppa_init_resp_width'; $tags = 'size,system'; wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Resize on Upload', 'wp-photo-album-plus'); $desc = __('Indicate if the photos should be resized during upload.', 'wp-photo-album-plus'); $help = esc_js(__('If you check this item, the size of the photos will be reduced to the dimension specified in the next item during the upload/import process.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('The photos will never be stretched during upload if they are smaller.', 'wp-photo-album-plus')); $slug = 'wppa_resize_on_upload'; $onchange = 'wppaCheckResize()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'size,upload'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Resize to', 'wp-photo-album-plus'); $desc = __('Resize photos to fit within a given area.', 'wp-photo-album-plus'); $help = esc_js(__('Specify the screensize for the unscaled photos.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('The use of a non-default value is particularly usefull when you make use of lightbox functionality.', 'wp-photo-album-plus')); $slug = 'wppa_resize_to'; $px = __('pixels', 'wp-photo-album-plus'); $options = array(__('Fit within rectangle as set in Table I-B1,2', 'wp-photo-album-plus'), '640 x 480 ' . $px, '800 x 600 ' . $px, '1024 x 768 ' . $px, '1200 x 900 ' . $px, '1280 x 960 ' . $px, '1366 x 768 ' . $px, '1920 x 1080 ' . $px); $values = array('0', '640x480', '800x600', '1024x768', '1200x900', '1280x960', '1366x768', '1920x1080'); $html = wppa_select($slug, $options, $values); $clas = 're_up'; $tags = 'size,upload'; wppa_setting('', '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Photocount threshold', 'wp-photo-album-plus'); $desc = __('Number of photos in an album must exceed.', 'wp-photo-album-plus'); $help = esc_js(__('Photos do not show up in the album unless there are more than this number of photos in the album. This allows you to have cover photos on an album that contains only sub albums without seeing them in the list of sub albums. Usually set to 0 (always show) or 1 (for one cover photo).', 'wp-photo-album-plus')); $slug = 'wppa_min_thumbs'; $html = wppa_input($slug, '40px', '', __('photos', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,system'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Border thickness', 'wp-photo-album-plus'); $desc = __('Thickness of wppa+ box borders.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the thickness for the border of the WPPA+ boxes. A number of 0 means: no border.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('WPPA+ boxes are: the navigation bars and the filmstrip.', 'wp-photo-album-plus')); $slug = 'wppa_bwidth'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,layout'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Border radius', 'wp-photo-album-plus'); $desc = __('Radius of wppa+ box borders.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the corner radius for the border of the WPPA+ boxes. A number of 0 means: no rounded corners.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('WPPA+ boxes are: the navigation bars and the filmstrip.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Note that rounded corners are only supported by modern browsers.', 'wp-photo-album-plus')); $slug = 'wppa_bradius'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,layout'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Box spacing', 'wp-photo-album-plus'); $desc = __('Distance between wppa+ boxes.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_box_spacing'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,layout'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Related count', 'wp-photo-album-plus'); $desc = __('The default maximum number of related photos to find.', 'wp-photo-album-plus'); $help = esc_js(__('When using shortcodes like [wppa type="album" album="#related,desc,23"][/wppa], the maximum number is 23. Omitting the number gives the maximum of this setting.', 'wp-photo-album-plus')); $slug = 'wppa_related_count'; $html = wppa_input($slug, '40px', '', __('photos', 'wp-photo-album-plus')); $clas = ''; $tags = 'count'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Max Pagelinks', 'wp-photo-album-plus'); $desc = __('The maximum number of pagelinks to be displayed.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_pagelinks_max'; $html = wppa_input($slug, '40px', '', __('pages', 'wp-photo-album-plus')); $clas = ''; $tags = 'count'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Max file name length', 'wp-photo-album-plus'); $desc = __('The max length of a photo file name excluding the extension.', 'wp-photo-album-plus'); $help = esc_js(__('A setting of 0 means: unlimited.', 'wp-photo-album-plus')); $slug = 'wppa_max_filename_length'; $html = wppa_input($slug, '40px', '', __('chars', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,system'; wppa_setting($slug, '10.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Max photo name length', 'wp-photo-album-plus'); $desc = __('The max length of a photo name.', 'wp-photo-album-plus'); $help = esc_js(__('A setting of 0 means: unlimited.', 'wp-photo-album-plus')); $slug = 'wppa_max_photoname_length'; $html = wppa_input($slug, '40px', '', __('chars', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,system'; wppa_setting($slug, '10.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Sticky header size', 'wp-photo-album-plus'); $desc = __('The height of your sticky header.', 'wp-photo-album-plus'); $help = esc_js(__('If your theme has a sticky header, enter its height here.', 'wp-photo-album-plus')); $slug = 'wppa_sticky_header_size'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,system'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('B', '1', __('Slideshow related size settings', 'wp-photo-album-plus')); $name = __('Maximum Width', 'wp-photo-album-plus'); $desc = __('The maximum width photos will be displayed in slideshows.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the largest size in pixels as how you want your photos to be displayed.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('This is usually the same as the Column Width (Table I-A1), but it may differ.', 'wp-photo-album-plus')); $slug = 'wppa_fullsize'; $onchange = 'wppaCheckFullHalign()'; $html = wppa_input($slug, '40px', '', __('pixels wide', 'wp-photo-album-plus'), $onchange); $clas = ''; $tags = 'size,slide'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Maximum Height', 'wp-photo-album-plus'); $desc = __('The maximum height photos will be displayed in slideshows.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the largest size in pixels as how you want your photos to be displayed.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('This setting defines the height of the space reserved for photos in slideshows.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('If you change the width of a display by the size=".." shortcode attribute, this value changes proportionally to match the aspect ratio as defined by this and the previous setting.', 'wp-photo-album-plus')); $slug = 'wppa_maxheight'; $html = wppa_input($slug, '40px', '', __('pixels high', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,slide'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Stretch to fit', 'wp-photo-album-plus'); $desc = __('Stretch photos that are too small.', 'wp-photo-album-plus'); $help = esc_js(__('Images will be stretched to the Maximum Size at display time if they are smaller. Leaving unchecked is recommended. It is better to upload photos that fit well the sizes you use!', 'wp-photo-album-plus')); $slug = 'wppa_enlarge'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'size,system'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Slideshow borderwidth', 'wp-photo-album-plus'); $desc = __('The width of the border around slideshow images.', 'wp-photo-album-plus'); $help = esc_js(__('The border is made by the image background being larger than the image itsself (padding).', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Additionally there may be a one pixel outline of a different color. See Table III-A2.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('The number you enter here is exclusive the one pixel outline.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If you leave this entry empty, there will be no outline either.', 'wp-photo-album-plus')); $slug = 'wppa_fullimage_border_width'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,slide,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Numbar Max', 'wp-photo-album-plus'); $desc = __('Maximum numbers to display.', 'wp-photo-album-plus'); $help = esc_js(__('In order to attemt to fit on one line, the numbers will be replaced by dots - except the current - when there are more than this number of photos in a slideshow.', 'wp-photo-album-plus')); $slug = 'wppa_numbar_max'; $html = wppa_input($slug, '40px', '', __('numbers', 'wp-photo-album-plus')); $clas = 'wppa_numbar'; $tags = 'count,slide,navi'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Share button size', 'wp-photo-album-plus'); $desc = __('The size of the social media icons in the Share box', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_share_size'; $opts = array('16 x 16', '20 x 20', '32 x 32'); $vals = array('16', '20', '32'); $html = wppa_select($slug, $opts, $vals); $clas = 'wppa_share'; $tags = 'size,sm,slide'; wppa_setting($slug, '6', $name, $desc, $html . __('pixels', 'wp-photo-album-plus'), $help, $clas, $tags); $name = __('Mini Treshold', 'wp-photo-album-plus'); $desc = __('Show mini text at slideshow smaller then.', 'wp-photo-album-plus'); $help = esc_js(__('Display Next and Prev. as opposed to Next photo and Previous photo when the cotainer is smaller than this size.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Special use in responsive themes.', 'wp-photo-album-plus')); $slug = 'wppa_mini_treshold'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,slide,layout'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Slideshow pagesize', 'wp-photo-album-plus'); $desc = __('The maximum number of slides in a certain view. 0 means no pagination', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_slideshow_pagesize'; $html = wppa_input($slug, '40px', '', __('slides', 'wp-photo-album-plus')); $clas = ''; $tags = 'count,page,slide'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Filmstrip Thumbnail Size', 'wp-photo-album-plus'); $desc = __('The size of the filmstrip images.', 'wp-photo-album-plus'); $help = esc_js(__('This size applies to the width or height, whichever is the largest.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Changing the thumbnail size may result in all thumbnails being regenerated. this may take a while.', 'wp-photo-album-plus')); $slug = 'wppa_film_thumbsize'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,slide,layout'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Slideonly max', 'wp-photo-album-plus'); $desc = __('The max number of slides in a slideonly display', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_slideonly_max'; $html = wppa_input($slug, '40px', '', __('slides', 'wp-photo-album-plus')); $clas = ''; $tags = 'count,slide'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('C', '1', __('Thumbnail photos related size settings', 'wp-photo-album-plus')); $name = __('Thumbnail Size', 'wp-photo-album-plus'); $desc = __('The size of the thumbnail images.', 'wp-photo-album-plus'); $help = esc_js(__('This size applies to the width or height, whichever is the largest.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Changing the thumbnail size may result in all thumbnails being regenerated. this may take a while.', 'wp-photo-album-plus')); $slug = 'wppa_thumbsize'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = 'tt_normal tt_masonry'; $tags = 'size,thumb'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail Size Alt', 'wp-photo-album-plus'); $desc = __('The alternative size of the thumbnail images.', 'wp-photo-album-plus'); $help = esc_js(__('This size applies to the width or height, whichever is the largest.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Changing the thumbnail size may result in all thumbnails being regenerated. this may take a while.', 'wp-photo-album-plus')); $slug = 'wppa_thumbsize_alt'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = 'tt_normal tt_masonry'; $tags = 'size,thumb'; wppa_setting($slug, '1a', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail Aspect', 'wp-photo-album-plus'); $desc = __('Aspect ration of thumbnail image', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_thumb_aspect'; $options = array(__('--- same as fullsize ---', 'wp-photo-album-plus'), __('--- square clipped ---', 'wp-photo-album-plus'), __('4:5 landscape clipped', 'wp-photo-album-plus'), __('3:4 landscape clipped', 'wp-photo-album-plus'), __('2:3 landscape clipped', 'wp-photo-album-plus'), __('9:16 landscape clipped', 'wp-photo-album-plus'), __('1:2 landscape clipped', 'wp-photo-album-plus'), __('--- square padded ---', 'wp-photo-album-plus'), __('4:5 landscape padded', 'wp-photo-album-plus'), __('3:4 landscape padded', 'wp-photo-album-plus'), __('2:3 landscape padded', 'wp-photo-album-plus'), __('9:16 landscape padded', 'wp-photo-album-plus'), __('1:2 landscape padded', 'wp-photo-album-plus')); $values = array('0:0:none', '1:1:clip', '4:5:clip', '3:4:clip', '2:3:clip', '9:16:clip', '1:2:clip', '1:1:padd', '4:5:padd', '3:4:padd', '2:3:padd', '9:16:padd', '1:2:padd'); $html = wppa_select($slug, $options, $values); $clas = 'tt_normal tt_masonry'; $tags = 'size,thumb,layout'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbframe width', 'wp-photo-album-plus'); $desc = __('The width of the thumbnail frame.', 'wp-photo-album-plus'); $help = esc_js(__('Set the width of the thumbnail frame.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Set width, height and spacing for the thumbnail frames.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('These sizes should be large enough for a thumbnail image and - optionally - the text under it.', 'wp-photo-album-plus')); $slug = 'wppa_tf_width'; $html = wppa_input($slug, '40px', '', __('pixels wide', 'wp-photo-album-plus')); $clas = 'tt_normal'; $tags = 'size,thumb,layout'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbframe width Alt', 'wp-photo-album-plus'); $desc = __('The width of the alternative thumbnail frame.', 'wp-photo-album-plus'); $help = esc_js(__('Set the width of the thumbnail frame.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Set width, height and spacing for the thumbnail frames.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('These sizes should be large enough for a thumbnail image and - optionally - the text under it.', 'wp-photo-album-plus')); $slug = 'wppa_tf_width_alt'; $html = wppa_input($slug, '40px', '', __('pixels wide', 'wp-photo-album-plus')); $clas = 'tt_normal'; $tags = 'size,thumb,layout'; wppa_setting($slug, '3a', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbframe height', 'wp-photo-album-plus'); $desc = __('The height of the thumbnail frame.', 'wp-photo-album-plus'); $help = esc_js(__('Set the height of the thumbnail frame.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Set width, height and spacing for the thumbnail frames.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('These sizes should be large enough for a thumbnail image and - optionally - the text under it.', 'wp-photo-album-plus')); $slug = 'wppa_tf_height'; $html = wppa_input($slug, '40px', '', __('pixels high', 'wp-photo-album-plus')); $clas = 'tt_normal'; $tags = 'size,thumb,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbframe height Alt', 'wp-photo-album-plus'); $desc = __('The height of the alternative thumbnail frame.', 'wp-photo-album-plus'); $help = esc_js(__('Set the height of the thumbnail frame.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Set width, height and spacing for the thumbnail frames.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('These sizes should be large enough for a thumbnail image and - optionally - the text under it.', 'wp-photo-album-plus')); $slug = 'wppa_tf_height_alt'; $html = wppa_input($slug, '40px', '', __('pixels high', 'wp-photo-album-plus')); $clas = 'tt_normal'; $tags = 'size,thumb,layout'; wppa_setting($slug, '4a', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail spacing', 'wp-photo-album-plus'); $desc = __('The spacing between adjacent thumbnail frames.', 'wp-photo-album-plus'); $help = esc_js(__('Set the minimal spacing between the adjacent thumbnail frames', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Set width, height and spacing for the thumbnail frames.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('These sizes should be large enough for a thumbnail image and - optionally - the text under it.', 'wp-photo-album-plus')); $slug = 'wppa_tn_margin'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = 'tt_normal tt_masonry'; $tags = 'size,thumb,layout'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Auto spacing', 'wp-photo-album-plus'); $desc = __('Space the thumbnail frames automatic.', 'wp-photo-album-plus'); $help = esc_js(__('If you check this box, the thumbnail images will be evenly distributed over the available width.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('In this case, the thumbnail spacing value (setting I-9) will be regarded as a minimum value.', 'wp-photo-album-plus')); $slug = 'wppa_thumb_auto'; $html = wppa_checkbox($slug); $clas = 'tt_normal'; $tags = 'size,layout,thumb'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Page size', 'wp-photo-album-plus'); $desc = __('Max number of thumbnails per page.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the maximum number of thumbnail images per page. A value of 0 indicates no pagination.', 'wp-photo-album-plus')); $slug = 'wppa_thumb_page_size'; $html = wppa_input($slug, '40px', '', __('thumbnails', 'wp-photo-album-plus')); $clas = 'tt_always'; $tags = 'count,thumb,page'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Popup size', 'wp-photo-album-plus'); $desc = __('The size of the thumbnail popup images.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the size of the popup images. This size should be larger than the thumbnail size.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('This size should also be at least the cover image size.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Changing the popup size may result in all thumbnails being regenerated. this may take a while.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Although this setting has only visual effect if "Thumb popup" (Table IV-C8) is checked,', 'wp-photo-album-plus')); $help .= ' ' . esc_js(__('the value must be right as it is the physical size of the thumbnail and coverphoto images.', 'wp-photo-album-plus')); $slug = 'wppa_popupsize'; $clas = 'tt_normal tt_masonry'; $tags = 'size,thumb'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Use thumbs if fit', 'wp-photo-album-plus'); $desc = __('Use the thumbnail image files if they are large enough.', 'wp-photo-album-plus'); $help = esc_js(__('This setting speeds up page loading for small photos.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Do NOT use this when your thumbnails have a forced aspect ratio (when Table I-C2 is set to anything different from --- same as fullsize ---)', 'wp-photo-album-plus')); $slug = 'wppa_use_thumbs_if_fit'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'thumb,system'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('D', '1', __('Album cover related size settings', 'wp-photo-album-plus')); $name = __('Max Cover width', 'wp-photo-album-plus'); $desc = __('Maximum width for a album cover display.', 'wp-photo-album-plus'); $help = esc_js(__('Display covers in 2 or more columns if the display area is wider than the given width.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('This also applies for \'thumbnails as covers\', and will NOT apply to single items.', 'wp-photo-album-plus')); $slug = 'wppa_max_cover_width'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'cover,album,layout,size'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Min Cover height', 'wp-photo-album-plus'); $desc = __('Minimal height of an album cover.', 'wp-photo-album-plus'); $help = esc_js(__('If you use this setting to make the albums the same height and you are not satisfied about the lay-out, try increasing the value in the next setting', 'wp-photo-album-plus')); $slug = 'wppa_cover_minheight'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'cover,album,layout,size'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Min Text frame height', 'wp-photo-album-plus'); $desc = __('The minimal cover text frame height incl header.', 'wp-photo-album-plus'); $help = esc_js(__('The height starting with the album title up to and including the view- and the slideshow- links.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('This setting enables you to give the album covers the same height while the title does not need to fit on one line.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('This is the recommended setting to line-up your covers!', 'wp-photo-album-plus')); $slug = 'wppa_head_and_text_frame_height'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'cover,album,size,layout'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Min Description height', 'wp-photo-album-plus'); $desc = __('The minimal height of the album description text frame.', 'wp-photo-album-plus'); $help = esc_js(__('The minimal height of the description field in an album cover display.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('This setting enables you to give the album covers the same height provided that the cover images are equally sized and the titles fit on one line.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('To force the coverphotos have equal heights, tick the box in Table I-D7.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('You may need this setting if changing the previous setting is not sufficient to line-up the covers.', 'wp-photo-album-plus')); $slug = 'wppa_text_frame_height'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'cover,album,size,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Coverphoto size', 'wp-photo-album-plus'); $desc = __('The size of the coverphoto.', 'wp-photo-album-plus'); $help = esc_js(__('This size applies to the width or height, whichever is the largest.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Changing the coverphoto size may result in all thumbnails being regenerated. this may take a while.', 'wp-photo-album-plus')); $slug = 'wppa_smallsize'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'cover,album,thumb,size'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Coverphoto size multi', 'wp-photo-album-plus'); $desc = __('The size of coverphotos if more than one.', 'wp-photo-album-plus'); $help = esc_js(__('This size applies to the width or height, whichever is the largest.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Changing the coverphoto size may result in all thumbnails being regenerated. this may take a while.', 'wp-photo-album-plus')); $slug = 'wppa_smallsize_multi'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'cover,album,thumb,size'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Size is height', 'wp-photo-album-plus'); $desc = __('The size of the coverphoto is the height of it.', 'wp-photo-album-plus'); $help = esc_js(__('If set: the previous setting is the height, if unset: the largest of width and height.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('This setting applies for coverphoto position top or bottom only (Table IV-D3).', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('This makes it easyer to make the covers of equal height.', 'wp-photo-album-plus')); $slug = 'wppa_coversize_is_height'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'cover,album,thumb,size'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Page size', 'wp-photo-album-plus'); $desc = __('Max number of covers per page.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the maximum number of album covers per page. A value of 0 indicates no pagination.', 'wp-photo-album-plus')); $slug = 'wppa_album_page_size'; $html = wppa_input($slug, '40px', '', __('covers', 'wp-photo-album-plus')); $clas = ''; $tags = 'cover,album,count'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('E', '1', __('Rating and comment related size settings', 'wp-photo-album-plus')); $name = __('Rating size', 'wp-photo-album-plus'); $desc = __('Select the number of voting stars.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_rating_max'; $options = array(__('Standard: 5 stars', 'wp-photo-album-plus'), __('Extended: 10 stars', 'wp-photo-album-plus'), __('One button vote', 'wp-photo-album-plus')); $values = array('5', '10', '1'); $html = wppa_select($slug, $options, $values); $clas = 'wppa_rating_'; $tags = 'count,rating,layout'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Display precision', 'wp-photo-album-plus'); $desc = __('Select the desired rating display precision.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_rating_prec'; $options = array('1 ' . __('decimal places', 'wp-photo-album-plus'), '2 ' . __('decimal places', 'wp-photo-album-plus'), '3 ' . __('decimal places', 'wp-photo-album-plus'), '4 ' . __('decimal places', 'wp-photo-album-plus')); $values = array('1', '2', '3', '4'); $html = wppa_select($slug, $options, $values); $clas = 'wppa_rating_'; $tags = 'rating,layout'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Avatar size', 'wp-photo-album-plus'); $desc = __('Size of Avatar images.', 'wp-photo-album-plus'); $help = esc_js(__('The size of the square avatar; must be > 0 and < 256', 'wp-photo-album-plus')); $slug = 'wppa_gravatar_size'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'comment,size,layout'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Rating space', 'wp-photo-album-plus'); $desc = __('Space between avg and my rating stars', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ratspacing'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'rating,layout,size'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('F', '1', __('Widget related size settings', 'wp-photo-album-plus')); $name = __('Widget width', 'wp-photo-album-plus'); $desc = __('The useable width within widgets.', 'wp-photo-album-plus'); $help = esc_js(__('Widget width for photo of the day, general purpose (default), slideshow (default) and upload widgets.', 'wp-photo-album-plus')); $slug = 'wppa_widget_width'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,widget'; wppa_setting($slug, '0', $name, $desc, $html, $help, $clas, $tags); $name = __('TopTen count', 'wp-photo-album-plus'); $desc = __('Number of photos in TopTen widget.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the maximum number of rated photos in the TopTen widget.', 'wp-photo-album-plus')); $slug = 'wppa_topten_count'; $html = wppa_input($slug, '40px', '', __('photos', 'wp-photo-album-plus')); $clas = 'wppa_rating'; $tags = 'count,widget'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('TopTen size', 'wp-photo-album-plus'); $desc = __('Size of thumbnails in TopTen widget.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the size for the mini photos in the TopTen widget.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('The size applies to the width or height, whatever is the largest.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Recommended values: 86 for a two column and 56 for a three column display.', 'wp-photo-album-plus')); $slug = 'wppa_topten_size'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = 'wppa_rating'; $tags = 'size,widget'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Comment count', 'wp-photo-album-plus'); $desc = __('Number of entries in Comment widget.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the maximum number of entries in the Comment widget.', 'wp-photo-album-plus')); $slug = 'wppa_comten_count'; $html = wppa_input($slug, '40px', '', __('entries', 'wp-photo-album-plus')); $clas = ''; $tags = 'count,widget'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Comment size', 'wp-photo-album-plus'); $desc = __('Size of thumbnails in Comment widget.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the size for the mini photos in the Comment widget.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('The size applies to the width or height, whatever is the largest.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Recommended values: 86 for a two column and 56 for a three column display.', 'wp-photo-album-plus')); $slug = 'wppa_comten_size'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,widget'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail count', 'wp-photo-album-plus'); $desc = __('Number of photos in Thumbnail widget.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the maximum number of rated photos in the Thumbnail widget.', 'wp-photo-album-plus')); $slug = 'wppa_thumbnail_widget_count'; $html = wppa_input($slug, '40px', '', __('photos', 'wp-photo-album-plus')); $clas = ''; $tags = 'count,widget'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail widget size', 'wp-photo-album-plus'); $desc = __('Size of thumbnails in Thumbnail widget.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the size for the mini photos in the Thumbnail widget.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('The size applies to the width or height, whatever is the largest.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Recommended values: 86 for a two column and 56 for a three column display.', 'wp-photo-album-plus')); $slug = 'wppa_thumbnail_widget_size'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,widget'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('LasTen count', 'wp-photo-album-plus'); $desc = __('Number of photos in Last Ten widget.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the maximum number of photos in the LasTen widget.', 'wp-photo-album-plus')); $slug = 'wppa_lasten_count'; $html = wppa_input($slug, '40px', '', __('photos', 'wp-photo-album-plus')); $clas = ''; $tags = 'count,widget'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('LasTen size', 'wp-photo-album-plus'); $desc = __('Size of thumbnails in Last Ten widget.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the size for the mini photos in the LasTen widget.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('The size applies to the width or height, whatever is the largest.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Recommended values: 86 for a two column and 56 for a three column display.', 'wp-photo-album-plus')); $slug = 'wppa_lasten_size'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,widget'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Album widget count', 'wp-photo-album-plus'); $desc = __('Number of albums in Album widget.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the maximum number of thumbnail photos of albums in the Album widget.', 'wp-photo-album-plus')); $slug = 'wppa_album_widget_count'; $html = wppa_input($slug, '40px', '', __('albums', 'wp-photo-album-plus')); $clas = ''; $tags = 'count,widget'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Album widget size', 'wp-photo-album-plus'); $desc = __('Size of thumbnails in Album widget.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the size for the mini photos in the Album widget.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('The size applies to the width or height, whatever is the largest.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Recommended values: 86 for a two column and 56 for a three column display.', 'wp-photo-album-plus')); $slug = 'wppa_album_widget_size'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,widget'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('FeaTen count', 'wp-photo-album-plus'); $desc = __('Number of photos in Featured Ten widget.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the maximum number of photos in the FeaTen widget.', 'wp-photo-album-plus')); $slug = 'wppa_featen_count'; $html = wppa_input($slug, '40px', '', __('photos', 'wp-photo-album-plus')); $clas = ''; $tags = 'count,widget'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('FeaTen size', 'wp-photo-album-plus'); $desc = __('Size of thumbnails in Featured Ten widget.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the size for the mini photos in the FeaTen widget.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('The size applies to the width or height, whatever is the largest.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Recommended values: 86 for a two column and 56 for a three column display.', 'wp-photo-album-plus')); $slug = 'wppa_featen_size'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,widget'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Tagcloud min size', 'wp-photo-album-plus'); $desc = __('Minimal fontsize in tagclouds', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_tagcloud_min'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'layout,size,widget'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Tagcloud max size', 'wp-photo-album-plus'); $desc = __('Maximal fontsize in tagclouds', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_tagcloud_max'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'layout,size,widget'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('G', '1', __('Lightbox related size settings. These settings have effect only when Table IX-J3 is set to wppa', 'wp-photo-album-plus')); $name = __('Number of text lines', 'wp-photo-album-plus'); $desc = __('Number of lines on the lightbox description area, exclusive the n/m line.', 'wp-photo-album-plus'); $help = esc_js(__('Enter a number in the range from 0 to 24 or auto', 'wp-photo-album-plus')); $slug = 'wppa_ovl_txt_lines'; $html = wppa_input($slug, '40px', '', __('lines', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,lightbox,layout'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Magnifier cursor size', 'wp-photo-album-plus'); $desc = __('Select the size of the magnifier cursor.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_magnifier'; $options = array(__('small', 'wppa', 'wp-photo-album-plus'), __('medium', 'wp-photo-album-plus'), __('large', 'wp-photo-album-plus'), __('--- none ---', 'wp-photo-album-plus')); $values = array('magnifier-small.png', 'magnifier-medium.png', 'magnifier-large.png', ''); $onchange = 'jQuery(\'#wppa-cursor\').attr(\'alt\', \'Pointer\');document.getElementById(\'wppa-cursor\').src=wppaImageDirectory+document.getElementById(\'magnifier\').value'; $html = wppa_select($slug, $options, $values, $onchange) . ' <img id="wppa-cursor" src="' . wppa_get_imgdir() . wppa_opt(substr($slug, 5)) . '" />'; $clas = ''; $tags = 'lightbox,size,layout'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); echo '<script>' . $onchange . '</script>'; $name = __('Border width', 'wp-photo-album-plus'); $desc = __('Border width for lightbox display.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_border_width'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,lightbox,layout'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Border radius', 'wp-photo-album-plus'); $desc = __('Border radius for lightbox display.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_border_radius'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'size,lightbox,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('H', '1', __('Video related size settings', 'wp-photo-album-plus')); $name = __('Default width', 'wp-photo-album-plus'); $desc = __('The width of most videos', 'wp-photo-album-plus'); $help = esc_js('This setting can be overruled for individual videos on the photo admin pages.'); $slug = 'wppa_video_width'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = 'wppa-video'; $tags = 'size,video'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Default height', 'wp-photo-album-plus'); $desc = __('The height of most videos', 'wp-photo-album-plus'); $help = esc_js('This setting can be overruled for individual videos on the photo admin pages.'); $slug = 'wppa_video_height'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = 'wppa-video'; $tags = 'size,video'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); ?> </tbody> <tfoot style="font-weight: bold;" class="wppa_table_1"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Setting', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </tfoot> </table> </div> <?php // Table 2: Visibility ?> <?php wppa_settings_box_header('2', __('Table II:', 'wp-photo-album-plus') . ' ' . __('Visibility:', 'wp-photo-album-plus') . ' ' . __('This table describes the visibility of certain wppa+ elements.', 'wp-photo-album-plus')); ?> <div id="wppa_table_2" style="display:none" > <table class="widefat wppa-table wppa-setting-table"> <thead style="font-weight: bold; " class="wppa_table_2"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Setting', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </thead> <tbody class="wppa_table_2"> <?php $wppa_table = 'II'; wppa_setting_subheader('A', '1', __('Breadcrumb related visibility settings', 'wp-photo-album-plus')); $name = __('Breadcrumb on posts', 'wp-photo-album-plus'); $desc = __('Show breadcrumb navigation bars.', 'wp-photo-album-plus'); $help = esc_js(__('Indicate whether a breadcrumb navigation should be displayed', 'wp-photo-album-plus')); $slug = 'wppa_show_bread_posts'; $onchange = 'wppaCheckBreadcrumb()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'navi,page'; wppa_setting($slug, '1a', $name, $desc, $html, $help, $clas, $tags); $name = __('Breadcrumb on pages', 'wp-photo-album-plus'); $desc = __('Show breadcrumb navigation bars.', 'wp-photo-album-plus'); $help = esc_js(__('Indicate whether a breadcrumb navigation should be displayed', 'wp-photo-album-plus')); $slug = 'wppa_show_bread_pages'; $onchange = 'wppaCheckBreadcrumb()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'navi,page'; wppa_setting($slug, '1b', $name, $desc, $html, $help, $clas, $tags); $name = __('Breadcrumb on search results', 'wp-photo-album-plus'); $desc = __('Show breadcrumb navigation bars on the search results page.', 'wp-photo-album-plus'); $help = esc_js(__('Indicate whether a breadcrumb navigation should be displayed above the search results.', 'wp-photo-album-plus')); $slug = 'wppa_bc_on_search'; $html = wppa_checkbox($slug); $clas = 'wppa_bc'; $tags = 'navi,page,search'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Breadcrumb on topten displays', 'wp-photo-album-plus'); $desc = __('Show breadcrumb navigation bars on topten displays.', 'wp-photo-album-plus'); $help = esc_js(__('Indicate whether a breadcrumb navigation should be displayed above the topten displays.', 'wp-photo-album-plus')); $slug = 'wppa_bc_on_topten'; $html = wppa_checkbox($slug); $clas = 'wppa_bc'; $tags = 'navi,page'; wppa_setting($slug, '3.0', $name, $desc, $html, $help, $clas, $tags); $name = __('Breadcrumb on last ten displays', 'wp-photo-album-plus'); $desc = __('Show breadcrumb navigation bars on last ten displays.', 'wp-photo-album-plus'); $help = esc_js(__('Indicate whether a breadcrumb navigation should be displayed above the last ten displays.', 'wp-photo-album-plus')); $slug = 'wppa_bc_on_lasten'; $html = wppa_checkbox($slug); $clas = 'wppa_bc'; $tags = 'navi,page'; wppa_setting($slug, '3.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Breadcrumb on comment ten displays', 'wp-photo-album-plus'); $desc = __('Show breadcrumb navigation bars on comment ten displays.', 'wp-photo-album-plus'); $help = esc_js(__('Indicate whether a breadcrumb navigation should be displayed above the comment ten displays.', 'wp-photo-album-plus')); $slug = 'wppa_bc_on_comten'; $html = wppa_checkbox($slug); $clas = 'wppa_bc'; $tags = 'navi,page,comment'; wppa_setting($slug, '3.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Breadcrumb on tag result displays', 'wp-photo-album-plus'); $desc = __('Show breadcrumb navigation bars on tag result displays.', 'wp-photo-album-plus'); $help = esc_js(__('Indicate whether a breadcrumb navigation should be displayed above the tag result displays.', 'wp-photo-album-plus')); $slug = 'wppa_bc_on_tag'; $html = wppa_checkbox($slug); $clas = 'wppa_bc'; $tags = 'navi,page'; wppa_setting($slug, '3.3', $name, $desc, $html, $help, $clas, $tags); $name = __('Breadcrumb on featured ten displays', 'wp-photo-album-plus'); $desc = __('Show breadcrumb navigation bars on featured ten displays.', 'wp-photo-album-plus'); $help = esc_js(__('Indicate whether a breadcrumb navigation should be displayed above the featured ten displays.', 'wp-photo-album-plus')); $slug = 'wppa_bc_on_featen'; $html = wppa_checkbox($slug); $clas = 'wppa_bc'; $tags = 'navi,page'; wppa_setting($slug, '3.4', $name, $desc, $html, $help, $clas, $tags); $name = __('Breadcrumb on related photos displays', 'wp-photo-album-plus'); $desc = __('Show breadcrumb navigation bars on related photos displays.', 'wp-photo-album-plus'); $help = esc_js(__('Indicate whether a breadcrumb navigation should be displayed above the related photos displays.', 'wp-photo-album-plus')); $slug = 'wppa_bc_on_related'; $html = wppa_checkbox($slug); $clas = 'wppa_bc'; $tags = 'navi,page'; wppa_setting($slug, '3.5', $name, $desc, $html, $help, $clas, $tags); $name = __('Home', 'wp-photo-album-plus'); $desc = __('Show "Home" in breadcrumb.', 'wp-photo-album-plus'); $help = esc_js(__('Indicate whether the breadcrumb navigation should start with a "Home"-link', 'wp-photo-album-plus')); $slug = 'wppa_show_home'; $html = wppa_checkbox($slug); $clas = 'wppa_bc'; $tags = 'navi,layout'; wppa_setting($slug, '4.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Home text', 'wp-photo-album-plus'); $desc = __('The text to use as "Home"', 'wp-photo-album-plus'); $help = ' '; $slug = 'wppa_home_text'; $html = wppa_input($slug, '100px;'); $clas = 'wppa_bc'; $tags = 'navi,layout'; wppa_setting($slug, '4.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Page', 'wp-photo-album-plus'); $desc = __('Show the page(s) in breadcrumb.', 'wp-photo-album-plus'); $help = esc_js(__('Indicate whether the breadcrumb navigation should show the page(hierarchy)', 'wp-photo-album-plus')); $slug = 'wppa_show_page'; $html = wppa_checkbox($slug); $clas = 'wppa_bc'; $tags = 'navi,layout'; wppa_setting($slug, '4.3', $name, $desc, $html, $help, $clas, $tags); $name = __('Separator', 'wp-photo-album-plus'); $desc = __('Breadcrumb separator symbol.', 'wp-photo-album-plus'); $help = esc_js(__('Select the desired breadcrumb separator element.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('A text string may contain valid html.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('An image will be scaled automatically if you set the navigation font size.', 'wp-photo-album-plus')); $slug = 'wppa_bc_separator'; $options = array('&raquo', '&rsaquo', '&gt', '&bull', __('Text (html):', 'wp-photo-album-plus'), __('Image (url):', 'wp-photo-album-plus')); $values = array('raquo', 'rsaquo', 'gt', 'bull', 'txt', 'url'); $onchange = 'wppaCheckBreadcrumb()'; $html = wppa_select($slug, $options, $values, $onchange); $clas = 'wppa_bc'; $tags = 'navi,layout'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Html', 'wp-photo-album-plus'); $desc = __('Breadcrumb separator text.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the HTML code that produces the separator symbol you want.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('It may be as simple as \'-\' (without the quotes) or as complex as a tag like <div>..</div>.', 'wp-photo-album-plus')); $slug = 'wppa_bc_txt'; $html = wppa_input($slug, '90%', '300px'); $clas = $slug; $tags = 'navi,layout'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Image Url', 'wp-photo-album-plus'); $desc = __('Full url to separator image.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the full url to the image you want to use for the separator symbol.', 'wp-photo-album-plus')); $slug = 'wppa_bc_url'; $html = wppa_input($slug, '90%', '300px'); $clas = $slug; $tags = 'navi,layout'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Pagelink position', 'wp-photo-album-plus'); $desc = __('The location for the pagelinks bar.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_pagelink_pos'; $options = array(__('Top', 'wp-photo-album-plus'), __('Bottom', 'wp-photo-album-plus'), __('Both', 'wp-photo-album-plus')); $values = array('top', 'bottom', 'both'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'navi,layout'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumblink on slideshow', 'wp-photo-album-plus'); $desc = __('Show a thumb link on slideshow bc.', 'wp-photo-album-plus'); $help = esc_js(__('Show a link to thumbnail display on an breadcrumb above a slideshow', 'wp-photo-album-plus')); $slug = 'wppa_bc_slide_thumblink'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'navi,layout'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('B', '1', __('Slideshow related visibility settings', 'wp-photo-album-plus')); $name = __('Start/stop', 'wp-photo-album-plus'); $desc = __('Show the Start/Stop slideshow bar.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: display the start/stop slideshow navigation bar above the full-size images and slideshow', 'wp-photo-album-plus')); $slug = 'wppa_show_startstop_navigation'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,navi'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Browse bar', 'wp-photo-album-plus'); $desc = __('Show Browse photos bar.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: display the preveous/next navigation bar under the full-size images and slideshow', 'wp-photo-album-plus')); $slug = 'wppa_show_browse_navigation'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,navi'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Filmstrip', 'wp-photo-album-plus'); $desc = __('Show Filmstrip navigation bar.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: display the filmstrip navigation bar under the full_size images and slideshow', 'wp-photo-album-plus')); $slug = 'wppa_filmstrip'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,navi,thumb'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Film seam', 'wp-photo-album-plus'); $desc = __('Show seam between end and start of film.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: display the wrap-around point in the filmstrip', 'wp-photo-album-plus')); $slug = 'wppa_film_show_glue'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,navi,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Photo name', 'wp-photo-album-plus'); $desc = __('Display photo name.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: display the name of the photo under the slideshow image.', 'wp-photo-album-plus')); $slug = 'wppa_show_full_name'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,meta,layout'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Add (Owner)', 'wp-photo-album-plus'); $desc = __('Add the uploaders display name in parenthesis to the name.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_show_full_owner'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,meta,layout'; wppa_setting($slug, '5.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Photo desc', 'wp-photo-album-plus'); $desc = __('Display Photo description.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: display the description of the photo under the slideshow image.', 'wp-photo-album-plus')); $slug = 'wppa_show_full_desc'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,meta,layout'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Hide when empty', 'wp-photo-album-plus'); $desc = __('Hide the descriptionbox when empty.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_hide_when_empty'; $html = wppa_checkbox($slug); $clas = 'hide_empty'; $tags = 'slide,meta,layout'; wppa_setting($slug, '6.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Rating system', 'wp-photo-album-plus'); $desc = __('Enable the rating system.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the photo rating system will be enabled.', 'wp-photo-album-plus')); $slug = 'wppa_rating_on'; $onchange = 'wppaCheckRating()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'slide,rating'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Comments system', 'wp-photo-album-plus'); $desc = __('Enable the comments system.', 'wp-photo-album-plus'); $help = esc_js(__('Display the comments box under the fullsize images and let users enter their comments on individual photos.', 'wp-photo-album-plus')); $slug = 'wppa_show_comments'; $onchange = 'wppaCheckComments()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'slide,comment'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Comment Avatar default', 'wp-photo-album-plus'); $desc = __('Show Avatars with the comments if not --- none ---', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_comment_gravatar'; $onchange = 'wppaCheckGravatar()'; $options = array(__('--- none ---', 'wp-photo-album-plus'), __('mystery man', 'wp-photo-album-plus'), __('identicon', 'wp-photo-album-plus'), __('monsterid', 'wp-photo-album-plus'), __('wavatar', 'wp-photo-album-plus'), __('retro', 'wp-photo-album-plus'), __('--- url ---', 'wp-photo-album-plus')); $values = array('none', 'mm', 'identicon', 'monsterid', 'wavatar', 'retro', 'url'); $html = wppa_select($slug, $options, $values, $onchange); $clas = 'wppa_comment_'; $tags = 'slide,comment,layout'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Comment Avatar url', 'wp-photo-album-plus'); $desc = __('Comment Avatar default url.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_comment_gravatar_url'; $html = wppa_input($slug, '90%', '300px'); $clas = 'wppa_grav'; $tags = 'slide,comment,layout'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Big Browse Buttons', 'wp-photo-album-plus'); $desc = __('Enable invisible browsing buttons.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the fullsize image is covered by two invisible areas that act as browse buttons.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Make sure the Full height (Table I-B2) is properly configured to prevent these areas to overlap unwanted space.', 'wp-photo-album-plus')); $slug = 'wppa_show_bbb'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,navi'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Ugly Browse Buttons', 'wp-photo-album-plus'); $desc = __('Enable the ugly browsing buttons.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the fullsize image is covered by two browse buttons.', 'wp-photo-album-plus')); $slug = 'wppa_show_ubb'; // $slug2 = 'wppa_ubb_color'; $html = wppa_checkbox($slug); // $opts = array( __('Black', 'wp-photo-album-plus'), __('Light gray', 'wp-photo-album-plus') ); // $vals = array( '', 'c'); // $html2 = wppa_select($slug2, $opts, $vals); $clas = ''; $tags = 'slide,navi'; wppa_setting($slug, '13.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Start/stop icons', 'wp-photo-album-plus'); $desc = __('Show start and stop icons at the center of the slide', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_show_start_stop_icons'; // $slug2 = 'wppa_start_stop_icons_type'; $html = wppa_checkbox($slug); // $opts = array( __('Black square', 'wp-photo-album-plus'), __('Blue square', 'wp-photo-album-plus'), __('Black round', 'wp-photo-album-plus') ); // $vals = array( '.jpg', 'b.jpg', 'r.png' ); // $html2 = wppa_select($slug2, $opts, $vals); $clas = ''; $tags = 'slide,navi'; wppa_setting($slug, '13.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Show custom box', 'wp-photo-album-plus'); $desc = __('Display the custom box in the slideshow', 'wp-photo-album-plus'); $help = esc_js(__('You can fill the custom box with any html you like. It will not be checked, so it is your own responsability to close tags properly.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('The position of the box can be defined in Table IX-E.', 'wp-photo-album-plus')); $slug = 'wppa_custom_on'; $onchange = 'wppaCheckCustom()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'slide,layout'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Custom content', 'wp-photo-album-plus'); $desc = __('The content (html) of the custom box.', 'wp-photo-album-plus'); $help = esc_js(__('You can fill the custom box with any html you like. It will not be checked, so it is your own responsability to close tags properly.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('The position of the box can be defined in Table IX-E.', 'wp-photo-album-plus')); $slug = 'wppa_custom_content'; $html = wppa_textarea($slug, $name); $clas = 'wppa_custom_'; $tags = 'slide,layout'; wppa_setting(false, '15', $name, $desc, $html, $help, $clas, $tags); $name = __('Slideshow/Number bar', 'wp-photo-album-plus'); $desc = __('Display the Slideshow / Number bar.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: display the number boxes on slideshow', 'wp-photo-album-plus')); $slug = 'wppa_show_slideshownumbar'; $onchange = 'wppaCheckNumbar()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'slide,navi'; wppa_setting($slug, '16', $name, $desc, $html, $help, $clas, $tags); $name = __('IPTC system', 'wp-photo-album-plus'); $desc = __('Enable the iptc system.', 'wp-photo-album-plus'); $help = esc_js(__('Display the iptc box under the fullsize images.', 'wp-photo-album-plus')); $slug = 'wppa_show_iptc'; $onchange = ''; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,meta,layout'; wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags); $name = __('IPTC open', 'wp-photo-album-plus'); $desc = __('Display the iptc box initially opened.', 'wp-photo-album-plus'); $help = esc_js(__('Display the iptc box under the fullsize images initially open.', 'wp-photo-album-plus')); $slug = 'wppa_show_iptc_open'; $onchange = ''; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,meta,layout'; wppa_setting($slug, '17.1', $name, $desc, $html, $help, $clas, $tags); $name = __('EXIF system', 'wp-photo-album-plus'); $desc = __('Enable the exif system.', 'wp-photo-album-plus'); $help = esc_js(__('Display the exif box under the fullsize images.', 'wp-photo-album-plus')); $slug = 'wppa_show_exif'; $onchange = ''; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,meta,layout'; wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags); $name = __('EXIF open', 'wp-photo-album-plus'); $desc = __('Display the exif box initially opened.', 'wp-photo-album-plus'); $help = esc_js(__('Display the exif box under the fullsize images initially open.', 'wp-photo-album-plus')); $slug = 'wppa_show_exif_open'; $onchange = ''; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,meta,layout'; wppa_setting($slug, '18.1', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('C', '1', __('Social media share box related visibility settings', 'wp-photo-album-plus')); $name = __('Show Share Box', 'wp-photo-album-plus'); $desc = __('Display the share social media buttons box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_share_on'; $onchange = 'wppaCheckShares()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'slide,sm,layout'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Hide when running', 'wp-photo-album-plus'); $desc = __('Hide the SM box when slideshow runs.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_share_hide_when_running'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'slide,sm,layout'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Share Box Widget', 'wp-photo-album-plus'); $desc = __('Display the share social media buttons box in widgets.', 'wp-photo-album-plus'); $help = __('This setting applies to normal slideshows in widgets, not to the slideshowwidget as that is a slideonly display.', 'wp-photo-album-plus'); $slug = 'wppa_share_on_widget'; $onchange = 'wppaCheckShares()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'widget,sm,layout'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Share Buttons Thumbs', 'wp-photo-album-plus'); $desc = __('Display the share social media buttons under thumbnails.', 'wp-photo-album-plus'); $help = ''; // __('This setting applies to normal slideshows in widgets, not to the slideshowwidget as that is a slideonly display.'); $slug = 'wppa_share_on_thumbs'; $onchange = 'wppaCheckShares()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'thumb,sm,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Share Buttons Lightbox', 'wp-photo-album-plus'); $desc = __('Display the share social media buttons on lightbox displays.', 'wp-photo-album-plus'); $help = ''; // __('This setting applies to normal slideshows in widgets, not to the slideshowwidget as that is a slideonly display.'); $slug = 'wppa_share_on_lightbox'; $onchange = 'wppaCheckShares()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'lightbox,sm,layout'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Share Buttons Mphoto', 'wp-photo-album-plus'); $desc = __('Display the share social media buttons on mphoto displays.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_share_on_mphoto'; $onchange = 'wppaCheckShares()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'sm,layout'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Void pages share', 'wp-photo-album-plus'); $desc = __('Do not show share on these pages', 'wp-photo-album-plus'); $help = esc_js(__('Use this for pages that require the user is logged in', 'wp-photo-album-plus')); $slug = 'wppa_sm_void_pages'; $onchange = 'wppaCheckShares()'; $options = $options_page_post; $options[0] = __('--- Select one or more pages ---', 'wp-photo-album-plus'); $options[] = __('--- none ---', 'wp-photo-album-plus'); $values = $values_page_post; $values[] = '0'; $html = wppa_select_m($slug, $options, $values, '', '', true); $clas = ''; $tags = 'sm,layout'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Show QR Code', 'wp-photo-album-plus'); $desc = __('Display the QR code in the share box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_share_qr'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_share'; $tags = 'slide,sm,layout'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Twitter button', 'wp-photo-album-plus'); $desc = __('Display the Twitter button in the share box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_share_twitter'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_share'; $tags = 'slide,sm,layout'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('The creator\'s Twitter account', 'wp-photo-album-plus'); $desc = __('The Twitter @username a twitter card should be attributed to.', 'wp-photo-album-plus'); $help = esc_js(__('If you want to share the image directly - by a so called twitter card - you must enter your twitter account name here', 'wp-photo-album-plus')); $slug = 'wppa_twitter_account'; $html = wppa_input($slug, '150px'); $clas = 'wppa_share'; $tags = 'slide,sm,layout'; wppa_setting($slug, '13.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Google+ button', 'wp-photo-album-plus'); $desc = __('Display the Google+ button in the share box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_share_google'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_share'; $tags = 'slide,sm,layout'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Pinterest button', 'wp-photo-album-plus'); $desc = __('Display the Pintrest button in the share box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_share_pinterest'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_share'; $tags = 'slide,sm,layout'; wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags); $name = __('Show LinkedIn button', 'wp-photo-album-plus'); $desc = __('Display the LinkedIn button in the share box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_share_linkedin'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_share'; $tags = 'slide,sm,layout'; wppa_setting($slug, '16', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Facebook share button', 'wp-photo-album-plus'); $desc = __('Display the Facebook button in the share box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_share_facebook'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_share'; $tags = 'slide,sm,layout'; wppa_setting($slug, '17.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Facebook like button', 'wp-photo-album-plus'); $desc = __('Display the Facebook button in the share box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_facebook_like'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_share'; $tags = 'slide,sm,layout'; wppa_setting($slug, '17.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Display type', 'wp-photo-album-plus'); $desc = __('Select the Facebook button display type.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_fb_display'; $opts = array(__('Standard', 'wp-photo-album-plus'), __('Button', 'wp-photo-album-plus'), __('Button with counter', 'wp-photo-album-plus'), __('Box with counter', 'wp-photo-album-plus')); $vals = array('standard', 'button', 'button_count', 'box_count'); $html = wppa_select($slug, $opts, $vals); $clas = 'wppa_share'; $tags = 'slide,sm,layout'; wppa_setting($slug, '17.3', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Facebook comment box', 'wp-photo-album-plus'); $desc = __('Display the Facebook comment dialog box in the share box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_facebook_comments'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_share'; $tags = 'slide,sm,layout'; wppa_setting($slug, '17.4', $name, $desc, $html, $help, $clas, $tags); $name = __('Facebook User Id', 'wp-photo-album-plus'); $desc = __('Enter your facebook user id to be able to moderate comments and sends', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_facebook_admin_id'; $html = wppa_input($slug, '200px'); $clas = 'wppa_share'; $tags = 'system,sm'; wppa_setting($slug, '17.7', $name, $desc, $html, $help, $clas, $tags); $name = __('Facebook App Id', 'wp-photo-album-plus'); $desc = __('Enter your facebook app id to be able to moderate comments and sends', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_facebook_app_id'; $html = wppa_input($slug, '200px'); $clas = 'wppa_share'; $tags = 'system,sm'; wppa_setting($slug, '17.8', $name, $desc, $html, $help, $clas, $tags); $name = __('Facebook js SDK', 'wp-photo-album-plus'); $desc = __('Load Facebook js SDK', 'wp-photo-album-plus'); $help = esc_js(__('Uncheck this box only when there is a conflict with an other plugin that also loads the Facebook js SDK.', 'wp-photo-album-plus')); $slug = 'wppa_load_facebook_sdk'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_share'; $tags = 'system,sm'; wppa_setting($slug, '17.9', $name, $desc, $html, $help, $clas, $tags); $name = __('Share single image', 'wp-photo-album-plus'); $desc = __('Share a link to a single image, not the slideshow.', 'wp-photo-album-plus'); $help = esc_js(__('The sharelink points to a page with a single image rather than to the page with the photo in the slideshow.', 'wp-photo-album-plus')); $slug = 'wppa_share_single_image'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_share'; $tags = 'system,sm'; wppa_setting($slug, '99', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('D', '1', __('Thumbnail display related visibility settings', 'wp-photo-album-plus')); $name = __('Thumbnail name', 'wp-photo-album-plus'); $desc = __('Display Thumbnail name.', 'wp-photo-album-plus'); $help = esc_js(__('Display photo name under thumbnail images.', 'wp-photo-album-plus')); $slug = 'wppa_thumb_text_name'; $html = wppa_checkbox($slug); $clas = 'tt_normal'; $tags = 'thumb,meta,layout'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Add (Owner)', 'wp-photo-album-plus'); $desc = __('Add the uploaders display name in parenthesis to the name.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_thumb_text_owner'; $html = wppa_checkbox($slug); $clas = 'tt_normal'; $tags = 'thumb,meta,layout'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail desc', 'wp-photo-album-plus'); $desc = __('Display Thumbnail description.', 'wp-photo-album-plus'); $help = esc_js(__('Display description of the photo under thumbnail images.', 'wp-photo-album-plus')); $slug = 'wppa_thumb_text_desc'; $html = wppa_checkbox($slug); $clas = 'tt_normal'; $tags = 'thumb,meta,layout'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail rating', 'wp-photo-album-plus'); $desc = __('Display Thumbnail Rating.', 'wp-photo-album-plus'); $help = esc_js(__('Display the rating of the photo under the thumbnail image.', 'wp-photo-album-plus')); $slug = 'wppa_thumb_text_rating'; $html = '<span class="wppa_rating">' . wppa_checkbox($slug) . '</span>'; $clas = 'wppa_rating_ tt_normal'; $tags = 'thumb,layout,rating'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail comcount', 'wp-photo-album-plus'); $desc = __('Display Thumbnail Comment count.', 'wp-photo-album-plus'); $help = esc_js(__('Display the number of comments to the photo under the thumbnail image.', 'wp-photo-album-plus')); $slug = 'wppa_thumb_text_comcount'; $html = wppa_checkbox($slug); $clas = 'tt_normal'; $tags = 'thumb,layout,comment'; wppa_setting($slug, '4.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail viewcount', 'wp-photo-album-plus'); $desc = __('Display the number of views.', 'wp-photo-album-plus'); $help = esc_js(__('Display the number of views under the thumbnail image.', 'wp-photo-album-plus')); $slug = 'wppa_thumb_text_viewcount'; $html = wppa_checkbox($slug); $clas = 'tt_normal'; $tags = 'thumb,layout,meta'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail virt album', 'wp-photo-album-plus'); $desc = __('Display the real album name on virtual album display.', 'wp-photo-album-plus'); $help = esc_js(__('Display the album name of the photo in parenthesis under the thumbnail on virtual album displays like search results etc.', 'wp-photo-album-plus')); $slug = 'wppa_thumb_text_virt_album'; $html = wppa_checkbox($slug); $clas = 'tt_normal'; $tags = 'thumb,layout,meta'; wppa_setting($slug, '5.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail video', 'wp-photo-album-plus'); $desc = __('Show video controls on thumbnail displays.', 'wp-photo-album-plus'); $help = __('Works on default thumbnail type only. You can play the video only when the link is set to no link at all.', 'wp-photo-album-plus'); $slug = 'wppa_thumb_video'; $html = wppa_checkbox($slug); $clas = 'tt_normal'; $tags = 'thumb,layout,video'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail audio', 'wp-photo-album-plus'); $desc = __('Show audio controls on thumbnail displays.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_thumb_audio'; $html = wppa_checkbox($slug); $clas = 'tt_normal'; $tags = 'thumb,layout,audio'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Popup name', 'wp-photo-album-plus'); $desc = __('Display Thumbnail name on popup.', 'wp-photo-album-plus'); $help = esc_js(__('Display photo name under thumbnail images on the popup.', 'wp-photo-album-plus')); $slug = 'wppa_popup_text_name'; $html = wppa_checkbox($slug); $clas = 'tt_normal tt_masonry wppa_popup'; $tags = 'thumb,layout,meta'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Popup (owner)', 'wp-photo-album-plus'); $desc = __('Display owner on popup.', 'wp-photo-album-plus'); $help = esc_js(__('Display photo owner under thumbnail images on the popup.', 'wp-photo-album-plus')); $slug = 'wppa_popup_text_owner'; $html = wppa_checkbox($slug); $clas = 'tt_normal tt_masonry wppa_popup'; $tags = 'thumb,meta,layout'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Popup desc', 'wp-photo-album-plus'); $desc = __('Display Thumbnail description on popup.', 'wp-photo-album-plus'); $help = esc_js(__('Display description of the photo under thumbnail images on the popup.', 'wp-photo-album-plus')); $slug = 'wppa_popup_text_desc'; $html = wppa_checkbox($slug); $clas = 'tt_normal tt_masonry wppa_popup'; $tags = 'thumb,meta,layout'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Popup desc no links', 'wp-photo-album-plus'); $desc = __('Strip html anchor tags from descriptions on popups', 'wp-photo-album-plus'); $help = esc_js(__('Use this option to prevent the display of links that cannot be activated.', 'wp-photo-album-plus')); $slug = 'wppa_popup_text_desc_strip'; $html = wppa_checkbox($slug); $clas = 'tt_normal tt_masonry wppa_popup'; $tags = 'thumb,meta,layout'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Popup rating', 'wp-photo-album-plus'); $desc = __('Display Thumbnail Rating on popup.', 'wp-photo-album-plus'); $help = esc_js(__('Display the rating of the photo under the thumbnail image on the popup.', 'wp-photo-album-plus')); $slug = 'wppa_popup_text_rating'; $html = '<span class="wppa_rating">' . wppa_checkbox($slug) . '</span>'; $clas = 'wppa_rating_ tt_normal tt_masonry wppa_popup'; $tags = 'thumb,rating,layout'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Popup comcount', 'wp-photo-album-plus'); $desc = __('Display Thumbnail Comment count on popup.', 'wp-photo-album-plus'); $help = esc_js(__('Display the number of comments of the photo under the thumbnail image on the popup.', 'wp-photo-album-plus')); $slug = 'wppa_popup_text_ncomments'; $html = wppa_checkbox($slug); $clas = 'tt_normal tt_masonry wppa_popup'; $tags = 'thumb,comment,layout'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Show rating count', 'wp-photo-album-plus'); $desc = __('Display the number of votes along with average ratings.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the number of votes is displayed along with average rating displays on thumbnail and popup displays.', 'wp-photo-album-plus')); $slug = 'wppa_show_rating_count'; $html = wppa_checkbox($slug); $clas = 'wppa_rating_ tt_normal tt_masonry'; $tags = 'thumb,rating,layout'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Show name on thumb area', 'wp-photo-album-plus'); $desc = __('Select if and where to display the album name on the thumbnail display.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_albname_on_thumbarea'; $options = array(__('None', 'wp-photo-album-plus'), __('At the top', 'wp-photo-album-plus'), __('At the bottom', 'wp-photo-album-plus')); $values = array('none', 'top', 'bottom'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'album,meta,layout'; wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags); $name = __('Show desc on thumb area', 'wp-photo-album-plus'); $desc = __('Select if and where to display the album description on the thumbnail display.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_albdesc_on_thumbarea'; $options = array(__('None', 'wp-photo-album-plus'), __('At the top', 'wp-photo-album-plus'), __('At the bottom', 'wp-photo-album-plus')); $values = array('none', 'top', 'bottom'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'album,meta,layout'; wppa_setting($slug, '16', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Edit/Delete links', 'wp-photo-album-plus'); $desc = __('Show these links under default thumbnails for owner and admin.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_edit_thumb'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'thumb'; wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags); $name = __('Show empty thumbnail area', 'wp-photo-album-plus'); $desc = __('Display thumbnail areas with upload link only for empty albums.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_show_empty_thumblist'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'thumb'; wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags); $name = __('Upload/create link on thumbnail area', 'wp-photo-album-plus'); $desc = __('Select the location of the upload and crete links.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_upload_link_thumbs'; $opts = array(__('None', 'wp-photo-album-plus'), __('At the top', 'wp-photo-album-plus'), __('At the bottom', 'wp-photo-album-plus')); $vals = array('none', 'top', 'bottom'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'thumb,meta,layout,upload'; wppa_setting($slug, '19', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('E', '1', __('Album cover related visibility settings', 'wp-photo-album-plus')); $name = __('Covertext', 'wp-photo-album-plus'); $desc = __('Show the text on the album cover.', 'wp-photo-album-plus'); $help = esc_js(__('Display the album decription on the album cover', 'wp-photo-album-plus')); $slug = 'wppa_show_cover_text'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'cover,album,meta,layout'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Slideshow', 'wp-photo-album-plus'); $desc = __('Enable the slideshow.', 'wp-photo-album-plus'); $help = esc_js(__('If you do not want slideshows: uncheck this box. Browsing full size images will remain possible.', 'wp-photo-album-plus')); $slug = 'wppa_enable_slideshow'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'cover,album,navi,slide,layout'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Slideshow/Browse', 'wp-photo-album-plus'); $desc = __('Display the Slideshow / Browse photos link on album covers', 'wp-photo-album-plus'); $help = esc_js(__('This setting causes the Slideshow link to be displayed on the album cover.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If slideshows are disabled in item 2 in this table, you will see a browse link to fullsize images.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If you do not want the browse link either, uncheck this item.', 'wp-photo-album-plus')); $slug = 'wppa_show_slideshowbrowselink'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'cover,album,navi,slide,layout'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('View ...', 'wp-photo-album-plus'); $desc = __('Display the View xx albums and yy photos link on album covers', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_show_viewlink'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'cover,navi,album,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Treecount', 'wp-photo-album-plus'); $desc = __('Disaplay the total number of (sub)albums and photos in subalbums', 'wp-photo-album-plus'); $help = esc_js(__('Displays the total number of sub albums and photos in the entire album tree in parenthesis if the numbers differ from the direct content of the album.', 'wp-photo-album-plus')); $slug = 'wppa_show_treecount'; $opts = array(__('none', 'wp-photo-album-plus'), __('detailed', 'wp-photo-album-plus'), __('totals only', 'wp-photo-album-plus')); $vals = array('-none-', 'detail', 'total'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'cover,album,layout'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Show categories', 'wp-photo-album-plus'); $desc = __('Display the album categories on the covers.', 'wp-photo-album-plus'); $slug = 'wppa_show_cats'; $help = ''; $html = wppa_checkbox($slug); $clas = ''; $tags = 'cover,meta,album,layout'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Skip empty albums', 'wp-photo-album-plus'); $desc = __('Do not show empty albums, except for admin and owner.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_skip_empty_albums'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'cover,album,layout'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Count on title', 'wp-photo-album-plus'); $desc = __('Show photocount along with album title. ', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_count_on_title'; $opts = array(__('none', 'wp-photo-album-plus'), __('top album only', 'wp-photo-album-plus'), __('total tree', 'wp-photo-album-plus')); $vals = array('-none-', 'self', 'total'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'cover,album,layout'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('F', '1', __('Widget related visibility settings', 'wp-photo-album-plus')); $name = __('Big Browse Buttons in widget', 'wp-photo-album-plus'); $desc = __('Enable invisible browsing buttons in widget slideshows.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the fullsize image is covered by two invisible areas that act as browse buttons.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Make sure the Full height (Table I-B2) is properly configured to prevent these areas to overlap unwanted space.', 'wp-photo-album-plus')); $slug = 'wppa_show_bbb_widget'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'widget,slide,layout,navi'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Ugly Browse Buttons in widget', 'wp-photo-album-plus'); $desc = __('Enable ugly browsing buttons in widget slideshows.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the fullsize image is covered by browse buttons.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Make sure the Full height (Table I-B2) is properly configured to prevent these areas to overlap unwanted space.', 'wp-photo-album-plus')); $slug = 'wppa_show_ubb_widget'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'widget,slide,layout,navi'; wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Album widget tooltip', 'wp-photo-album-plus'); $desc = __('Show the album description on hoovering thumbnail in album widget', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_show_albwidget_tooltip'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'widget,album,layout,meta'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('G', '1', __('Lightbox related settings. These settings have effect only when Table IX-J3 is set to wppa', 'wp-photo-album-plus')); /* $name = __('Overlay Close label text', 'wp-photo-album-plus'); $desc = __('The text label for the cross exit symbol.', 'wp-photo-album-plus'); $help = __('This text may be multilingual according to the qTranslate short tags specs.', 'wp-photo-album-plus'); $slug = 'wppa_ovl_close_txt'; $html = wppa_input($slug, '200px'); $clas = ''; $tags = 'lightbox,layout'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); */ $name = __('Overlay theme color', 'wp-photo-album-plus'); $desc = __('The color of the image border and text background.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_theme'; $options = array(__('Black', 'wp-photo-album-plus'), __('White', 'wp-photo-album-plus')); $values = array('black', 'white'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'lightbox,layout'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay background color', 'wp-photo-album-plus'); $desc = __('The color of the outer background.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_bgcolor'; $options = array(__('Black', 'wp-photo-album-plus'), __('White', 'wp-photo-album-plus')); $values = array('black', 'white'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'lightbox,layout'; wppa_setting($slug, '2.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay slide name', 'wp-photo-album-plus'); $desc = __('Show name if from slide.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the photos name on a lightbox display when initiated from a slide.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('This setting also applies to film thumbnails if Table VI-11 is set to lightbox overlay.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_slide_name'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,slide,meta,layout'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay slide desc', 'wp-photo-album-plus'); $desc = __('Show description if from slide.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the photos description on a lightbox display when initiated from a slide.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('This setting also applies to film thumbnails if Table VI-11 is set to lightbox overlay.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_slide_desc'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,slide,meta,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay thumb name', 'wp-photo-album-plus'); $desc = __('Show the photos name if from thumb.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the name on a lightbox display when initiated from a standard thumbnail or a widget thumbnail.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('This setting applies to standard thumbnails, thumbnail-, comment-, topten- and lasten-widget.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_thumb_name'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,thumb,meta,layout'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay thumb desc', 'wp-photo-album-plus'); $desc = __('Show description if from thumb.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the photos description on a lightbox display when initiated from a standard thumbnail or a widget thumbnail.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('This setting applies to standard thumbnails, thumbnail-, comment-, topten- and lasten-widget.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_thumb_desc'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,thumb,meta,layout'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay potd name', 'wp-photo-album-plus'); $desc = __('Show the photos name if from photo of the day.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the name on a lightbox display when initiated from the photo of the day.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_potd_name'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,widget,meta,layout'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay potd desc', 'wp-photo-album-plus'); $desc = __('Show description if from from photo of the day.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the photos description on a lightbox display when initiated from the photo of the day.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_potd_desc'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,widget,meta,layout'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay sphoto name', 'wp-photo-album-plus'); $desc = __('Show the photos name if from a single photo.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the name on a lightbox display when initiated from a single photo.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_sphoto_name'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,meta,layout'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay sphoto desc', 'wp-photo-album-plus'); $desc = __('Show description if from from a single photo.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the photos description on a lightbox display when initiated from a single photo.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_sphoto_desc'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,meta,layout'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay mphoto name', 'wp-photo-album-plus'); $desc = __('Show the photos name if from a single media style photo.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the name on a lightbox display when initiated from a single media style photo.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_mphoto_name'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,meta,layout'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay mphoto desc', 'wp-photo-album-plus'); $desc = __('Show description if from from a media style photo.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the photos description on a lightbox display when initiated from a single media style photo.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_mphoto_desc'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,meta,layout'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay albumwidget name', 'wp-photo-album-plus'); $desc = __('Show the photos name if from the album widget.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the name on a lightbox display when initiated from the album widget.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_alw_name'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,meta,widget,layout'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay albumwidget desc', 'wp-photo-album-plus'); $desc = __('Show description if from from the album widget.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the photos description on a lightbox display when initiated from the album widget.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_alw_desc'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,meta,widget,layout'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay coverphoto name', 'wp-photo-album-plus'); $desc = __('Show the photos name if from the album cover.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the name on a lightbox display when initiated from the album coverphoto.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_cover_name'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,meta,cover,album,layout'; wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay coverphoto desc', 'wp-photo-album-plus'); $desc = __('Show description if from from the album cover.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the photos description on a lightbox display when initiated from the album coverphoto.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_cover_desc'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,meta,cover,album,layout'; wppa_setting($slug, '16', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay add owner', 'wp-photo-album-plus'); $desc = __('Add the owner to the photo name on lightbox displays.', 'wp-photo-album-plus'); $help = esc_js(__('This setting is independant of the show name switches and is a global setting.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_add_owner'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,meta,layout'; wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay show start/stop', 'wp-photo-album-plus'); $desc = __('Show Start and Stop for running slideshow on lightbox.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_show_startstop'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,layout'; wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay show legenda', 'wp-photo-album-plus'); $desc = __('Show "Press f for fullsize" etc. on lightbox.', 'wp-photo-album-plus'); $help = esc_js(__('Independant of this setting, it will not show up on mobile devices.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_show_legenda'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,layout'; wppa_setting($slug, '19', $name, $desc, $html, $help, $clas, $tags); $name = __('Show fullscreen icons', 'wp-photo-album-plus'); $desc = __('Shows fullscreen and back to normal icon buttons on upper right corner', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_fs_icons'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,layout'; wppa_setting($slug, '20', $name, $desc, $html, $help, $clas, $tags); $name = __('Show rating', 'wp-photo-album-plus'); $desc = __('Shows and enables rating on lightbox.', 'wp-photo-album-plus'); $help = esc_js(__('This works for 5 and 10 stars only, not for single votes or numerical display', 'wp-photo-album-plus')); $slug = 'wppa_ovl_rating'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,layout,rating'; wppa_setting($slug, '21', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay show counter', 'wp-photo-album-plus'); $desc = __('Show the x/y counter below the image.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_show_counter'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,layout'; wppa_setting($slug, '90', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Zoom in', 'wp-photo-album-plus'); $desc = __('Display tooltip "Zoom in" along with the magnifier cursor.', 'wp-photo-album-plus'); $help = esc_js(__('If you select ---none--- in Table I-G2 for magnifier size, the tooltop contains the photo name.', 'wp-photo-album-plus')); $slug = 'wppa_show_zoomin'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,meta,layout'; wppa_setting($slug, '91', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('H', '1', __('Frontend upload configuration settings', 'wp-photo-album-plus')); $name = __('User upload Photos', 'wp-photo-album-plus'); $desc = __('Enable frontend upload.', 'wp-photo-album-plus'); $help = esc_js(__('If you check this item, frontend upload will be enabled according to the rules set in the following items of this table.', 'wp-photo-album-plus')); $slug = 'wppa_user_upload_on'; $onchange = 'wppaFollow(\'user_upload_on\',\'wppa_feup\');'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'access,upload'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('User upload Video', 'wp-photo-album-plus'); $desc = __('Enable frontend upload of video.', 'wp-photo-album-plus'); $help = esc_js(__('Requires Table II-H1 to be ticked.', 'wp-photo-album-plus')); $slug = 'wppa_user_upload_video_on'; $onchange = ''; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'access,upload,video'; wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags); $name = __('User upload Audio', 'wp-photo-album-plus'); $desc = __('Enable frontend upload of audio.', 'wp-photo-album-plus'); $help = esc_js(__('Requires Table II-H1 to be ticked.', 'wp-photo-album-plus')); $slug = 'wppa_user_upload_audio_on'; $onchange = ''; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'access,upload,audio'; wppa_setting($slug, '1.2', $name, $desc, $html, $help, $clas, $tags); $name = __('User upload Photos login', 'wp-photo-album-plus'); $desc = __('Frontend upload requires the user is logged in.', 'wp-photo-album-plus'); $help = esc_js(__('If you uncheck this box, make sure you check the item Owners only in Table VII-D1.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Also: set the owner to ---public--- of the albums that are allowed to be uploaded to.', 'wp-photo-album-plus')); $slug = 'wppa_user_upload_login'; $html = wppa_checkbox($slug); $clas = 'wppa_feup'; $tags = 'access,upload'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('User upload Ajax', 'wp-photo-album-plus'); $desc = __('Shows the upload progression bar.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ajax_upload'; $html = wppa_checkbox($slug); $clas = 'wppa_feup'; $tags = 'system,upload'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Show Copyright', 'wp-photo-album-plus'); $desc = __('Show a copyright warning on frontend upload locations.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_copyright_on'; $onchange = 'wppaFollow(\'copyright_on\',\'wppa_up_wm\')'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_feup'; $tags = 'upload,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Copyright notice', 'wp-photo-album-plus'); $desc = __('The message to be displayed.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_copyright_notice'; $html = wppa_textarea($slug, $name); $clas = 'wppa_feup wppa_up_wm'; $tags = 'upload,layout'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('User Watermark', 'wp-photo-album-plus'); $desc = __('Uploading users may select watermark settings', 'wp-photo-album-plus'); $help = esc_js(__('If checked, anyone who can upload and/or import photos can overrule the default watermark settings.', 'wp-photo-album-plus')); $slug = 'wppa_watermark_user'; $html = wppa_checkbox($slug); $clas = 'wppa_watermark wppa_feup'; $tags = 'water,upload'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('User name', 'wp-photo-album-plus'); $desc = __('Uploading users may overrule the default name.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the default photo name as defined in Table IX-D13 may be overruled by the user.', 'wp-photo-album-plus')); $slug = 'wppa_name_user'; $html = wppa_checkbox($slug); $clas = 'wppa_feup'; $tags = 'upload'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Apply Newphoto desc user', 'wp-photo-album-plus'); $desc = __('Give each new frontend uploaded photo a standard description.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, each new photo will get the description (template) as specified in Table IX-D5.', 'wp-photo-album-plus')); $slug = 'wppa_apply_newphoto_desc_user'; $html = wppa_checkbox($slug); $clas = 'wppa_feup'; $tags = 'upload'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('User desc', 'wp-photo-album-plus'); $desc = __('Uploading users may overrule the default description.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_desc_user'; $html = wppa_checkbox($slug); $clas = 'wppa_feup'; $tags = 'upload'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('User upload custom', 'wp-photo-album-plus'); $desc = __('Frontend upload can fill in custom data fields.', 'wp-photo-album-plus'); $help = esc_js('Custom datafields can be defined in Table II-J10'); $slug = 'wppa_fe_custom_fields'; $html = wppa_checkbox($slug); $clas = 'wppa_feup custfields'; $tags = 'upload'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('User upload tags', 'wp-photo-album-plus'); $desc = __('Frontend upload can add tags.', 'wp-photo-album-plus'); $help = esc_js(__('You can configure the details of tag addition in Table IX-D18.x', 'wp-photo-album-plus')); $slug = 'wppa_fe_upload_tags'; $onchange = 'wppaFollow(\'fe_upload_tags\', \'wppa_up_tags\');'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_feup'; $tags = 'upload'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Tag selection box', 'wp-photo-album-plus') . ' 1'; $desc = __('Front-end upload tags selecion box.', 'wp-photo-album-plus'); $help = ''; $slug1 = 'wppa_up_tagselbox_on_1'; $slug2 = 'wppa_up_tagselbox_multi_1'; $html = '<span style="float:left" >' . __('On:', 'wp-photo-album-plus') . '</span>' . wppa_checkbox($slug1) . '<span style="float:left" >' . __('Multi:', 'wp-photo-album-plus') . '</span>' . wppa_checkbox($slug2); $clas = 'wppa_feup wppa_up_tags'; $tags = 'upload'; wppa_setting($slug, '11.1ab', $name, $desc, $html, $help, $clas, $tags); $name = __('Caption box', 'wp-photo-album-plus') . ' 1'; $desc = __('The title of the tag selection box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_up_tagselbox_title_1'; $html = wppa_edit($slug, get_option($slug), '300px'); $clas = 'wppa_feup wppa_up_tags'; $tags = 'upload'; wppa_setting($slug, '11.1c', $name, $desc, $html, $help, $clas, $tags); $name = __('Tags box', 'wp-photo-album-plus') . ' 1'; $desc = __('The tags in the selection box.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the tags you want to appear in the selection box. Empty means: all existing tags', 'wp-photo-album-plus')); $slug = 'wppa_up_tagselbox_content_1'; $html = wppa_edit($slug, get_option($slug), '300px'); $clas = 'wppa_feup wppa_up_tags'; $tags = 'upload'; wppa_setting($slug, '11.1d', $name, $desc, $html, $help, $clas, $tags); $name = __('Tag selection box', 'wp-photo-album-plus') . ' 2'; $desc = __('Front-end upload tags selecion box.', 'wp-photo-album-plus'); $help = ''; $slug1 = 'wppa_up_tagselbox_on_2'; $slug2 = 'wppa_up_tagselbox_multi_2'; $html = '<span style="float:left" >' . __('On:', 'wp-photo-album-plus') . '</span>' . wppa_checkbox($slug1) . '<span style="float:left" >' . __('Multi:', 'wp-photo-album-plus') . '</span>' . wppa_checkbox($slug2); $clas = 'wppa_feup wppa_up_tags'; $tags = 'upload'; wppa_setting($slug, '11.2ab', $name, $desc, $html, $help, $clas, $tags); $name = __('Caption box', 'wp-photo-album-plus') . ' 2'; $desc = __('The title of the tag selection box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_up_tagselbox_title_2'; $html = wppa_edit($slug, get_option($slug), '300px'); $clas = 'wppa_feup wppa_up_tags'; $tags = 'upload'; wppa_setting($slug, '11.2c', $name, $desc, $html, $help, $clas, $tags); $name = __('Tags box', 'wp-photo-album-plus') . ' 2'; $desc = __('The tags in the selection box.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the tags you want to appear in the selection box. Empty means: all existing tags', 'wp-photo-album-plus')); $slug = 'wppa_up_tagselbox_content_2'; $html = wppa_edit($slug, get_option($slug), '300px'); $clas = 'wppa_feup wppa_up_tags'; $tags = 'upload'; wppa_setting($slug, '11.2d', $name, $desc, $html, $help, $clas, $tags); $name = __('Tag selection box', 'wp-photo-album-plus') . ' 3'; $desc = __('Front-end upload tags selecion box.', 'wp-photo-album-plus'); $help = ''; $slug1 = 'wppa_up_tagselbox_on_3'; $slug2 = 'wppa_up_tagselbox_multi_3'; $html = '<span style="float:left" >' . __('On:', 'wp-photo-album-plus') . '</span>' . wppa_checkbox($slug1) . '<span style="float:left" >' . __('Multi:', 'wp-photo-album-plus') . '</span>' . wppa_checkbox($slug2); $clas = 'wppa_feup wppa_up_tags'; $tags = 'upload'; wppa_setting($slug, '11.3ab', $name, $desc, $html, $help, $clas, $tags); $name = __('Caption box', 'wp-photo-album-plus') . ' 3'; $desc = __('The title of the tag selection box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_up_tagselbox_title_3'; $html = wppa_edit($slug, get_option($slug), '300px'); $clas = 'wppa_feup wppa_up_tags'; $tags = 'upload'; wppa_setting($slug, '11.3c', $name, $desc, $html, $help, $clas, $tags); $name = __('Tags box', 'wp-photo-album-plus') . ' 3'; $desc = __('The tags in the selection box.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the tags you want to appear in the selection box. Empty means: all existing tags', 'wp-photo-album-plus')); $slug = 'wppa_up_tagselbox_content_3'; $html = wppa_edit($slug, get_option($slug), '300px'); $clas = 'wppa_feup wppa_up_tags'; $tags = 'upload'; wppa_setting($slug, '11.3d', $name, $desc, $html, $help, $clas, $tags); $name = __('New tags', 'wp-photo-album-plus'); $desc = __('Input field for any user defined tags.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_up_tag_input_on'; $html = wppa_checkbox($slug); $clas = 'wppa_feup wppa_up_tags'; $tags = 'upload'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('New tags caption', 'wp-photo-album-plus'); $desc = __('The caption above the tags input field.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_up_tag_input_title'; $html = wppa_edit($slug, get_option($slug), '300px'); $clas = 'wppa_feup wppa_up_tags'; $tags = 'upload'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Preview tags', 'wp-photo-album-plus'); $desc = __('Show a preview of all tags that will be added to the photo info.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_up_tag_preview'; $html = wppa_checkbox($slug); $clas = 'wppa_feup wppa_up_tags'; $tags = 'upload'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Camera connect', 'wp-photo-album-plus'); $desc = __('Connect frontend upload to camara on mobile devices with camera', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_camera_connect'; $html = wppa_checkbox($slug); $clas = 'wppa_feup'; $tags = 'upload'; wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags); $name = __('Blog It!', 'wp-photo-album-plus'); $desc = __('Enable blogging photos.', 'wp-photo-album-plus'); $help = esc_js(__('Users need the capability edit_posts to directly blog photos.', 'wp-photo-album-plus')); $slug = 'wppa_blog_it'; $html = wppa_checkbox($slug); $clas = 'wppa_feup'; $tags = 'upload'; wppa_setting($slug, '16', $name, $desc, $html, $help, $clas, $tags); $name = __('Blog It need moderation', 'wp-photo-album-plus'); $desc = __('Posts with blogged photos need moderation.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_blog_it_moderate'; $html = wppa_checkbox($slug); $clas = 'wppa_feup'; $tags = 'upload'; wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags); $name = __('Blog It shortcode', 'wp-photo-album-plus'); $desc = __('Shortcode to be used on the blog post', 'wp-photo-album-plus'); $help = esc_js(__('Make sure it contains photo="#id"', 'wp-photo-album-plus')); $slug = 'wppa_blog_it_shortcode'; $html = wppa_input($slug, '85%'); $clas = 'wppa_feup'; $tags = 'upload'; wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('J', '1', __('Miscellaneous visibility settings', 'wp-photo-album-plus')); $name = __('Frontend ending label', 'wp-photo-album-plus'); $desc = __('Frontend upload / create / edit dialog closing label text.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_close_text'; $opts = array(__('Abort', 'wp-photo-album-plus'), __('Cancel', 'wp-photo-album-plus'), __('Close', 'wp-photo-album-plus'), __('Exit', 'wp-photo-album-plus'), __('Quit', 'wp-photo-album-plus')); $vals = array('Abort', 'Cancel', 'Close', 'Exit', 'Quit'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'layout'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Widget thumbs fontsize', 'wp-photo-album-plus'); $desc = __('Font size for thumbnail subtext in widgets.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_fontsize_widget_thumb'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'thumb,widget,size,layout'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Arrow color', 'wp-photo-album-plus'); $desc = __('Left/right browsing arrow color.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the color of the filmstrip navigation arrows.', 'wp-photo-album-plus')); $slug = 'wppa_arrow_color'; $html = wppa_input($slug, '70px', '', ''); $clas = ''; $tags = 'slide,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Owner on new line', 'wp-photo-album-plus'); $desc = __('Place the (owner) text on a new line.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_owner_on_new_line'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'layout,meta'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Custom datafields albums', 'wp-photo-album-plus'); $desc = __('Define up to 10 custom data fields for albums.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_album_custom_fields'; $onch = 'wppaCheckCheck(\'album_custom_fields\', \'albumcustfields\' )'; $html = wppa_checkbox($slug, $onch); $clas = ''; $tags = 'meta'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); for ($i = '0'; $i < '10'; $i++) { $name = sprintf(__('Name, vis, edit %s', 'wp-photo-album-plus'), $i); $desc = sprintf(__('The caption for field %s, visibility and editability at frontend.', 'wp-photo-album-plus'), $i); $help = esc_js(sprintf(__('If you check the first box, the value of this field is displayable in photo descriptions at the frontend with keyword w#c%s', 'wp-photo-album-plus'), $i)); $help .= '\\n' . esc_js(__('If you check the second box, the value of this field is editable at the frontend new style dialog.', 'wp-photo-album-plus')); $slug1 = 'wppa_album_custom_caption_' . $i; $html1 = wppa_input($slug1, '300px'); $slug2 = 'wppa_album_custom_visible_' . $i; $html2 = wppa_checkbox($slug2); $slug3 = 'wppa_album_custom_edit_' . $i; $html3 = wppa_checkbox($slug3); $clas = 'albumcustfields'; $tags = 'meta'; wppa_setting(array($slug1, $slug2, $slug3), '9.' . $i . 'a,b,c', $name, $desc, $html1 . $html2 . $html3, $help, $clas, $tags); } $name = __('Custom datafields photos', 'wp-photo-album-plus'); $desc = __('Define up to 10 custom data fields for photos.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_custom_fields'; $onch = 'wppaCheckCheck(\'custom_fields\', \'custfields\' )'; $html = wppa_checkbox($slug, $onch); $clas = ''; $tags = 'meta'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); for ($i = '0'; $i < '10'; $i++) { $name = sprintf(__('Name, vis, edit %s', 'wp-photo-album-plus'), $i); $desc = sprintf(__('The caption for field %s, visibility and editability at frontend.', 'wp-photo-album-plus'), $i); $help = esc_js(sprintf(__('If you check the first box, the value of this field is displayable in photo descriptions at the frontend with keyword w#c%s', 'wp-photo-album-plus'), $i)); $help .= '\\n' . esc_js(__('If you check the second box, the value of this field is editable at the frontend new style dialog.', 'wp-photo-album-plus')); $slug1 = 'wppa_custom_caption_' . $i; $html1 = wppa_input($slug1, '300px'); $slug2 = 'wppa_custom_visible_' . $i; $html2 = wppa_checkbox($slug2); $slug3 = 'wppa_custom_edit_' . $i; $html3 = wppa_checkbox($slug3); $clas = 'custfields'; $tags = 'meta'; wppa_setting(array($slug1, $slug2, $slug3), '10.' . $i . 'a,b,c', $name, $desc, $html1 . $html2 . $html3, $help, $clas, $tags); } $name = __('Navigation symbols style', 'wp-photo-album-plus'); $desc = __('The corner rounding size of navigation icons.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_icon_corner_style'; $opts = array(__('none', 'wp-photo-album-plus'), __('light', 'wp-photo-album-plus'), __('medium', 'wp-photo-album-plus'), __('heavy', 'wp-photo-album-plus')); $vals = array('none', 'light', 'medium', 'heavy'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'layout'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); ?> </tbody> <tfoot style="font-weight: bold;" class="wppa_table_2"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Setting', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </tfoot> </table> </div> <?php // Table 3: Backgrounds ?> <?php wppa_settings_box_header('3', __('Table III:', 'wp-photo-album-plus') . ' ' . __('Backgrounds:', 'wp-photo-album-plus') . ' ' . __('This table describes the backgrounds of wppa+ elements.', 'wp-photo-album-plus')); ?> <div id="wppa_table_3" style="display:none" > <table class="widefat wppa-table wppa-setting-table"> <thead style="font-weight: bold; " class="wppa_table_3"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Background color', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Sample', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Border color', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Sample', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </thead> <tbody class="wppa_table_3"> <?php $wppa_table = 'III'; wppa_setting_subheader('A', '4', __('Slideshow elements backgrounds', 'wp-photo-album-plus')); $name = __('Nav', 'wp-photo-album-plus'); $desc = __('Navigation bars.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for navigation backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_nav'; $slug2 = 'wppa_bcolor_nav'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'slide,layout'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('SlideImg', 'wp-photo-album-plus'); $desc = __('Fullsize Slideshow Photos.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for fullsize photo backgrounds and borders.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('The colors may be equal or "transparent"', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('For more information about slideshow image borders see the help on Table I-B4', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_fullimg'; $slug2 = 'wppa_bcolor_fullimg'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'slide,layout'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Numbar', 'wp-photo-album-plus'); $desc = __('Number bar box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for numbar box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_numbar'; $slug2 = 'wppa_bcolor_numbar'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = 'wppa_numbar'; $tags = 'slide,layout'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Numbar active', 'wp-photo-album-plus'); $desc = __('Number bar active box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for numbar active box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_numbar_active'; $slug2 = 'wppa_bcolor_numbar_active'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = 'wppa_numbar'; $tags = 'slide,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Name/desc', 'wp-photo-album-plus'); $desc = __('Name and Description bars.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for name and description box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_namedesc'; $slug2 = 'wppa_bcolor_namedesc'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'slide,meta,layout'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Comments', 'wp-photo-album-plus'); $desc = __('Comment input and display areas.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for comment box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_com'; $slug2 = 'wppa_bcolor_com'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $clas = 'wppa_comment_'; $tags = 'slide,comment,layout'; $html = array($html1, $html2); wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Custom', 'wp-photo-album-plus'); $desc = __('Custom box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for custom box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_cus'; $slug2 = 'wppa_bcolor_cus'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'slide,layout'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('IPTC', 'wp-photo-album-plus'); $desc = __('IPTC display box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for iptc box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_iptc'; $slug2 = 'wppa_bcolor_iptc'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'slide,meta,layout'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('EXIF', 'wp-photo-album-plus'); $desc = __('EXIF display box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for exif box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_exif'; $slug2 = 'wppa_bcolor_exif'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'slide,meta,layout'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Share', 'wp-photo-album-plus'); $desc = __('Share box display background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for share box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_share'; $slug2 = 'wppa_bcolor_share'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'slide,layout'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('B', '4', __('Other backgrounds', 'wp-photo-album-plus')); $name = __('Even', 'wp-photo-album-plus'); $desc = __('Even background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for even numbered backgrounds and borders of album covers and thumbnail displays \'As covers\'.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_even'; $slug2 = 'wppa_bcolor_even'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout,album,cover,thumb'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Odd', 'wp-photo-album-plus'); $desc = __('Odd background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for odd numbered backgrounds and borders of album covers and thumbnail displays \'As covers\'.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_alt'; $slug2 = 'wppa_bcolor_alt'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout,album,cover,thumb'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail padding', 'wp-photo-album-plus'); $desc = __('Thumbnail padding color if thumbnail aspect is a padded setting.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS color hexadecimal like #000000 for black or #ffffff for white for the padded thumbnails.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_thumbnail'; $slug2 = ''; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = '</td><td>'; //wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout,thumb'; wppa_setting($slug, '3.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Img', 'wp-photo-album-plus'); $desc = __('Cover Photos and popups.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for Cover photo and popup backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_img'; $slug2 = 'wppa_bcolor_img'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout,cover,album'; wppa_setting($slug, '3.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Upload', 'wp-photo-album-plus'); $desc = __('Upload box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for upload box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_upload'; $slug2 = 'wppa_bcolor_upload'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout,upload'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Multitag', 'wp-photo-album-plus'); $desc = __('Multitag box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for multitag box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_multitag'; $slug2 = 'wppa_bcolor_multitag'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout,search'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Tagcloud', 'wp-photo-album-plus'); $desc = __('Tagcloud box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for tagcloud box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_tagcloud'; $slug2 = 'wppa_bcolor_tagcloud'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout,search'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Superview', 'wp-photo-album-plus'); $desc = __('Superview box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for superview box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_superview'; $slug2 = 'wppa_bcolor_superview'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout,search'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Search', 'wp-photo-album-plus'); $desc = __('Search box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for search box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_search'; $slug2 = 'wppa_bcolor_search'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout,search'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('BestOf', 'wp-photo-album-plus'); $desc = __('BestOf box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for bestof box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_bestof'; $slug2 = 'wppa_bcolor_bestof'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout,search'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Calendar', 'wp-photo-album-plus'); $desc = __('Calendar box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for calendar box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_calendar'; $slug2 = 'wppa_bcolor_calendar'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Stereo', 'wp-photo-album-plus'); $desc = __('Stereo mode selection box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for stereo mode selection box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_stereo'; $slug2 = 'wppa_bcolor_stereo'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Admins choice', 'wp-photo-album-plus'); $desc = __('Admins choice box background.', 'wp-photo-album-plus'); $help = esc_js(__('Enter valid CSS colors for admins choice box backgrounds and borders.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_adminschoice'; $slug2 = 'wppa_bcolor_adminschoice'; $slug = array($slug1, $slug2); $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Modal render box', 'wp-photo-album-plus'); $desc = __('The background for the Ajax modal rendering box.', 'wp-photo-album-plus'); $help = esc_js(__('Recommended color: your theme background color.', 'wp-photo-album-plus')); $slug1 = 'wppa_bgcolor_modal'; $slug2 = 'wppa_bcolor_modal'; $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = '</td><td>'; // wppa_input($slug2, '100px', '', '', "checkColor('".$slug2."')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Navigation symbols', 'wp-photo-album-plus'); $desc = __('Navigation symbol background and fill colors.', 'wp-photo-album-plus'); $help = ''; $slug1 = 'wppa_svg_bg_color'; $slug2 = 'wppa_svg_color'; $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Navigation symbols Lightbox', 'wp-photo-album-plus'); $desc = __('Navigation symbol background and fill colors Lightbox.', 'wp-photo-album-plus'); $help = ''; $slug1 = 'wppa_ovl_svg_bg_color'; $slug2 = 'wppa_ovl_svg_color'; $html1 = wppa_input($slug1, '100px', '', '', "checkColor('" . $slug1 . "')") . '</td><td>' . wppa_color_box($slug1); $html2 = wppa_input($slug2, '100px', '', '', "checkColor('" . $slug2 . "')") . '</td><td>' . wppa_color_box($slug2); $html = array($html1, $html2); $clas = ''; $tags = 'layout'; wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags); ?> </tbody> <tfoot style="font-weight: bold;" class="wppa_table_3"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Background color', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Sample', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Border color', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Sample', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </tfoot> </table> </div> <?php // Table 4: Behaviour ?> <?php wppa_settings_box_header('4', __('Table IV:', 'wp-photo-album-plus') . ' ' . __('Behaviour:', 'wp-photo-album-plus') . ' ' . __('This table describes the dynamic behaviour of certain wppa+ elements.', 'wp-photo-album-plus')); ?> <div id="wppa_table_4" style="display:none" > <table class="widefat wppa-table wppa-setting-table"> <thead style="font-weight: bold; " class="wppa_table_4"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Setting', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </thead> <tbody class="wppa_table_4"> <?php $wppa_table = 'IV'; wppa_setting_subheader('A', '1', __('System related settings', 'wp-photo-album-plus')); $name = __('Use Ajax', 'wp-photo-album-plus'); $desc = __('Use Ajax as much as is possible and implemented.', 'wp-photo-album-plus'); $help = esc_js(__('If this box is ticked, page content updates from within wppa+ displays will be Ajax based as much as possible.', 'wp-photo-album-plus')); $slug = 'wppa_allow_ajax'; $onchange = 'wppaCheckAjax()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'system'; wppa_setting($slug, '1.0', $name, $desc, $html, $help, $clas, $tags); $name = __('Ajax NON Admin', 'wp-photo-album-plus'); $desc = __('Frontend ajax use no admin files.', 'wp-photo-album-plus'); $help = esc_js(__('If you want to password protect wp-admin, check this box.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('In rare cases changing page content does not work when this box is checked. Verify the functionality!', 'wp-photo-album-plus')); $slug = 'wppa_ajax_non_admin'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Modal boxes', 'wp-photo-album-plus'); $desc = __('Place Ajax rendered content in modal boxes', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ajax_render_modal'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '1.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Photo names in urls', 'wp-photo-album-plus'); $desc = __('Display photo names in urls.', 'wp-photo-album-plus'); $help = esc_js(__('Urls to wppa+ displays will contain photonames in stead of numbers.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('It is your responsability to avoid duplicate names of photos in the same album.', 'wp-photo-album-plus')); $slug = 'wppa_use_photo_names_in_urls'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'link,system,meta'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Album names in urls', 'wp-photo-album-plus'); $desc = __('Display album names in urls.', 'wp-photo-album-plus'); $help = esc_js(__('Urls to wppa+ displays will contain albumnames in stead of numbers.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('It is your responsability to avoid duplicate names of albums in the system.', 'wp-photo-album-plus')); $slug = 'wppa_use_album_names_in_urls'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'link,system,meta'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Use short query args', 'wp-photo-album-plus'); $desc = __('Use &album=... &photo=...', 'wp-photo-album-plus'); $help = esc_js(__('Urls to wppa+ displays will contain &album=... &photo=... in stead of &wppa-album=... &wppa-photo=...', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Use this setting only when there are no conflicts with other plugins that may interprete arguments like &album= etc.', 'wp-photo-album-plus')); $slug = 'wppa_use_short_qargs'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'link,system'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Enable pretty links', 'wp-photo-album-plus'); $desc = __('Enable the generation and understanding of pretty links.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, links to social media and the qr code will have "/token1/token2/" etc in stead of "&arg1=..&arg2=.." etc.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('These types of links will be interpreted and cause a redirection on entering.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('It is recommended to check this box. It shortens links dramatically and simplifies qr codes.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('However, you may encounter conflicts with themes and/or other plugins, so test it troughly!', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Table IV-A2 (Photo names in urls) must be UNchecked for this setting to work!', 'wp-photo-album-plus')); $slug = 'wppa_use_pretty_links'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'link,system'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Enable encrypted links', 'wp-photo-album-plus'); $desc = __('Encrypt album and photo ids in links.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_use_encrypted_links'; $onch = 'alert(\'' . __('The page will be reloaded.', 'wp-photo-album-plus') . '\');wppaRefreshAfter();'; $html = wppa_checkbox($slug, $onch); $clas = ''; $tags = 'link,system'; wppa_setting($slug, '6.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Refuse unencrypted', 'wp-photo-album-plus'); $desc = __('When encrypted is enabled, refuse unencrypted urls.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_refuse_unencrypted'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'link,system'; wppa_setting($slug, '6.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Update addressline', 'wp-photo-album-plus'); $desc = __('Update the addressline after an ajax action or next slide.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, refreshing the page will show the current content and the browsers back and forth arrows will browse the history on the page.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('If unchecked, refreshing the page will re-display the content of the original page.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('This will only work on browsers that support history.pushState() and therefor NOT in IE', 'wp-photo-album-plus')); $warning = esc_js(__('Switching this off will affect the browsers behaviour.', 'wp-photo-album-plus')); $slug = 'wppa_update_addressline'; $html = wppa_checkbox_warn_off($slug, '', '', $warning); $clas = ''; $tags = 'link,system'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Render shortcode always', 'wp-photo-album-plus'); $desc = __('This will skip the check on proper initialisation.', 'wp-photo-album-plus'); $help = esc_js(__('This setting is required for certain themes like Gantry to prevent the display of wppa placeholders like [WPPA+ Photo display].', 'wp-photo-album-plus')); $slug = 'wppa_render_shortcode_always'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Track viewcounts', 'wp-photo-album-plus'); $desc = __('Register number of views of albums and photos.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_track_viewcounts'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,meta'; wppa_setting($slug, '9.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Track clickcounts', 'wp-photo-album-plus'); $desc = __('Register number of clicks on photos that link to an url.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_track_clickcounts'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,meta'; wppa_setting($slug, '9.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Auto page', 'wp-photo-album-plus'); $desc = __('Create a wp page for every fullsize image.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_auto_page'; $onchange = 'wppaCheckAutoPage()'; $warn = esc_js(__('Please reload this page after changing!', 'wp-photo-album-plus')); $html = wppa_checkbox_warn($slug, $onchange, '', $warn); $clas = ''; $tags = 'page,system'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Auto page display', 'wp-photo-album-plus'); $desc = __('The type of display on the autopage pages.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_auto_page_type'; $opts = array(__('Single photo', 'wp-photo-album-plus'), __('Media type photo', 'wp-photo-album-plus'), __('In the style of a slideshow', 'wp-photo-album-plus')); $vals = array('photo', 'mphoto', 'slphoto'); $html = wppa_select($slug, $opts, $vals); $clas = 'autopage'; $tags = 'page,system,layout'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Auto page links', 'wp-photo-album-plus'); $desc = __('The location for the pagelinks.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_auto_page_links'; $opts = array(__('none', 'wp-photo-album-plus'), __('At the top', 'wp-photo-album-plus'), __('At the bottom', 'wp-photo-album-plus'), __('At top and bottom', 'wp-photo-album-plus')); $vals = array('none', 'top', 'bottom', 'both'); $html = wppa_select($slug, $opts, $vals); $clas = 'autopage'; $tags = 'page,system,layout'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Defer javascript', 'wp-photo-album-plus'); $desc = __('Put javascript near the end of the page.', 'wp-photo-album-plus'); $help = esc_js(__('If checkd: May fix layout problems and broken slideshows. May speed up or slow down page appearing.', 'wp-photo-album-plus')); $slug = 'wppa_defer_javascript'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Inline styles', 'wp-photo-album-plus'); $desc = __('Set style specifications inline.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: May fix layout problems, but slows down page appearing.', 'wp-photo-album-plus')); $slug = 'wppa_inline_css'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,layout'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Custom style', 'wp-photo-album-plus'); $desc = __('Enter custom style specs here.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_custom_style'; $html = wppa_textarea($slug, $name); $clas = ''; $tags = 'system,layout'; wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags); $name = __('Use customized style file', 'wp-photo-album-plus'); $desc = __('This feature is highly discouraged.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_use_custom_style_file'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,layout'; wppa_setting($slug, '16', $name, $desc, $html, $help, $clas, $tags); $name = __('Use customized theme file', 'wp-photo-album-plus'); $desc = __('This feature is highly discouraged.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_use_custom_theme_file'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,layout'; wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags); $name = __('Enable photo html access', 'wp-photo-album-plus'); $desc = __('Creates .htaccess files in .../uploads/wppa/ and .../uploads/wppa/thumbs/', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_cre_uploads_htaccess'; $opts = array(__('create \'all access\' .htaccess files', 'wp-photo-album-plus'), __('remove .htaccess files', 'wp-photo-album-plus'), __('create \'no hotlinking\' .htaccess files', 'wp-photo-album-plus'), __('do not change existing .htaccess file(s)', 'wp-photo-album-plus')); $vals = array('grant', 'remove', 'nohot', 'custom'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'system,access'; wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags); $name = __('Lazy or HTML comp', 'wp-photo-album-plus'); $desc = __('Tick this box when you use lazy load or html compression.', 'wp-photo-album-plus'); $help = esc_js(__('If the filmstrip images do not show up and you have a lazy load or html optimizing plugin active: Check this box', 'wp-photo-album-plus')); $slug = 'wppa_lazy_or_htmlcomp'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,layout'; wppa_setting($slug, '19', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbs first', 'wp-photo-album-plus'); $desc = __('When displaying album content: thumbnails before subalbums.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_thumbs_first'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,layout'; wppa_setting($slug, '20', $name, $desc, $html, $help, $clas, $tags); $name = __('Login links', 'wp-photo-album-plus'); $desc = __('You must login to... links to login page.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_login_links'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '21', $name, $desc, $html, $help, $clas, $tags); $name = __('Enable Video', 'wp-photo-album-plus'); $desc = __('Enables video support.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_enable_video'; $onchange = 'wppaCheckCheck( \'' . $slug . '\', \'wppa-video\' )'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'system'; wppa_setting($slug, '22', $name, $desc, $html, $help, $clas, $tags); $name = __('Enable Audio', 'wp-photo-album-plus'); $desc = __('Enables audio support.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_enable_audio'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,audio'; wppa_setting($slug, '23', $name, $desc, $html, $help, $clas, $tags); $name = __('Enable 3D Stereo', 'wp-photo-album-plus'); $desc = __('Enables 3D stereo photo support.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_enable_stereo'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,audio'; wppa_setting($slug, '24', $name, $desc, $html, $help, $clas, $tags); $name = __('Relative urls', 'wp-photo-album-plus'); $desc = __('Use relative urls only.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_relative_urls'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '25', $name, $desc, $html, $help, $clas, $tags); $name = __('Capitalize tags and cats', 'wp-photo-album-plus'); $desc = __('Format tags and cats to start with one capital character', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_capitalize_tags'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,meta'; wppa_setting($slug, '26', $name, $desc, $html, $help, $clas, $tags); $name = __('Enable Admins Choice', 'wp-photo-album-plus'); $desc = __('Enable the creation of zipfiles with selected photos.', 'wp-photo-album-plus'); $help = esc_js(__('Activate the Admins Choice widget to make the zipfiles downloadable.', 'wp-photo-album-plus')); $slug = 'wppa_enable_admins_choice'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '27', $name, $desc, $html, $help, $clas, $tags); $name = __('Make owner like photoname', 'wp-photo-album-plus'); $desc = __('Change the owner to the user who\'s display name equals photoname.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_owner_to_name'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '28', $name, $desc, $html, $help, $clas, $tags); $name = __('JS and CSS when needed', 'wp-photo-album-plus'); $desc = __('Loads .js and .css files only when they are used on the page.', 'wp-photo-album-plus'); $help = esc_js(__('This is a self learning system. The first time a page is loaded that requires wppa .css or .js files, the page will reload.', 'wp-photo-album-plus')); $slug = 'wppa_js_css_optional'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '29', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('B', '1', __('Slideshow related settings', 'wp-photo-album-plus')); $name = __('V align', 'wp-photo-album-plus'); $desc = __('Vertical alignment of slideshow images.', 'wp-photo-album-plus'); $help = esc_js(__('Specify the vertical alignment of slideshow images.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('If you select --- none ---, the photos will not be centered horizontally either.', 'wp-photo-album-plus')); $slug = 'wppa_fullvalign'; $options = array(__('--- none ---', 'wp-photo-album-plus'), __('top', 'wp-photo-album-plus'), __('center', 'wp-photo-album-plus'), __('bottom', 'wp-photo-album-plus'), __('fit', 'wp-photo-album-plus')); $values = array('default', 'top', 'center', 'bottom', 'fit'); $onchange = 'wppaCheckFullHalign()'; $html = wppa_select($slug, $options, $values, $onchange); $clas = ''; $tags = 'slide,layout'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('H align', 'wp-photo-album-plus'); $desc = __('Horizontal alignment of slideshow images.', 'wp-photo-album-plus'); $help = esc_js(__('Specify the horizontal alignment of slideshow images. If you specify --- none --- , no horizontal alignment will take place.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('This setting is only usefull when the Column Width differs from the Maximum Width.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('(Settings I-A1 and I-B1)', 'wp-photo-album-plus')); $slug = 'wppa_fullhalign'; $options = array(__('--- none ---', 'wp-photo-album-plus'), __('left', 'wp-photo-album-plus'), __('center', 'wp-photo-album-plus'), __('right', 'wp-photo-album-plus')); $values = array('default', 'left', 'center', 'right'); $html = wppa_select($slug, $options, $values); $clas = 'wppa_ha'; $tags = 'slide,layout'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Start', 'wp-photo-album-plus'); $desc = __('Start slideshow running.', 'wp-photo-album-plus'); $help = esc_js(__('If you select "running", the slideshow will start running immediately, if you select "still at first photo", the first photo will be displayed in browse mode.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If you select "still at first norated", the first photo that the visitor did not gave a rating will be displayed in browse mode.', 'wp-photo-album-plus')); $slug = 'wppa_start_slide'; $options = array(__('running', 'wp-photo-album-plus'), __('still at first photo', 'wp-photo-album-plus'), __('still at first norated', 'wp-photo-album-plus')); $values = array('run', 'still', 'norate'); $html = wppa_select($slug, $options, $values); $clas = 'wppa_ss'; $tags = 'slide'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Start slideonly', 'wp-photo-album-plus'); $desc = __('Start slideonly slideshow running.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_start_slideonly'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide'; wppa_setting($slug, '3.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Video autostart', 'wp-photo-album-plus'); $desc = __('Autoplay videos in slideshows.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_start_slide_video'; $onchange = 'wppaCheckSlideVideoControls()'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa-video'; $tags = 'slide,video'; wppa_setting($slug, '3.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Audio autostart', 'wp-photo-album-plus'); $desc = __('Autoplay audios in slideshows.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_start_slide_audio'; $html = wppa_checkbox($slug); $clas = 'wppa-audio'; $tags = 'slide,audio'; wppa_setting($slug, '3.3', $name, $desc, $html, $help, $clas, $tags); $name = __('Animation type', 'wp-photo-album-plus'); $desc = __('The way successive slides appear.', 'wp-photo-album-plus'); $help = esc_js(__('Select the way the old slide is to be replaced by the new one in the slideshow/browse fullsize display.', 'wp-photo-album-plus')); $slug = 'wppa_animation_type'; $options = array(__('Fade out and in simultaneous', 'wp-photo-album-plus'), __('Fade in after fade out', 'wp-photo-album-plus'), __('Shift adjacent', 'wp-photo-album-plus'), __('Stack on', 'wp-photo-album-plus'), __('Stack off', 'wp-photo-album-plus'), __('Turn over', 'wp-photo-album-plus')); $values = array('fadeover', 'fadeafter', 'swipe', 'stackon', 'stackoff', 'turnover'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'slide'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Timeout', 'wp-photo-album-plus'); $desc = __('Slideshow timeout.', 'wp-photo-album-plus'); $help = esc_js(__('Select the time a single slide will be visible when the slideshow is started.', 'wp-photo-album-plus')); $slug = 'wppa_slideshow_timeout'; $options = array('1 s.', '1.5 s.', '2.5 s.', '4 s.', '6 s.', '8 s.', '10 s.', '12 s.', '15 s.'); $values = array('1000', '1500', '2500', '4000', '6000', '8000', '10000', '12000', '15000'); $html = wppa_select($slug, $options, $values); $clas = 'wppa_ss'; $tags = 'slide'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Speed', 'wp-photo-album-plus'); $desc = __('Slideshow animation speed.', 'wp-photo-album-plus'); $help = esc_js(__('Specify the animation speed to be used in slideshows.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('This is the time it takes a photo to fade in or out.', 'wp-photo-album-plus')); $slug = 'wppa_animation_speed'; $options = array(__('--- off ---', 'wp-photo-album-plus'), __('very fast (200 ms.)', 'wp-photo-album-plus'), __('fast (400 ms.)', 'wp-photo-album-plus'), __('normal (800 ms.)', 'wp-photo-album-plus'), __('slow (1.2 s.)', 'wp-photo-album-plus'), __('very slow (2 s.)', 'wp-photo-album-plus'), __('extremely slow (4 s.)', 'wp-photo-album-plus')); $values = array('10', '200', '400', '800', '1200', '2000', '4000'); $html = wppa_select($slug, $options, $values); $clas = 'wppa_ss'; $tags = 'slide'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Slide hover pause', 'wp-photo-album-plus'); $desc = __('Running Slideshow suspends during mouse hover.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_slide_pause'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Slideshow wrap around', 'wp-photo-album-plus'); $desc = __('The slideshow wraps around the start and end', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_slide_wrap'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Full desc align', 'wp-photo-album-plus'); $desc = __('The alignment of the descriptions under fullsize images and slideshows.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_fulldesc_align'; $options = array(__('Left', 'wp-photo-album-plus'), __('Center', 'wp-photo-album-plus'), __('Right', 'wp-photo-album-plus')); $values = array('left', 'center', 'right'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'slide,layout,meta'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Remove redundant space', 'wp-photo-album-plus'); $desc = __('Removes unwanted <p> and <br> tags in fullsize descriptions.', 'wp-photo-album-plus'); $help = __('This setting has only effect when Table IX-A7 (foreign shortcodes) is checked.', 'wp-photo-album-plus'); $slug = 'wppa_clean_pbr'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,layout,meta'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Run nl2br or wpautop on description', 'wp-photo-album-plus'); $desc = __('Adds <br> or <p> and <br> tags in fullsize descriptions.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_wpautop_on_desc'; $opts = array(__('--- none ---', 'wp-photo-album-plus'), __('Linebreaks only', 'wp-photo-album-plus'), __('Linebreaks and paragraphs', 'wp-photo-album-plus')); $vals = array('nil', 'nl2br', 'wpautop'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'slide,layout,meta'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Auto open comments', 'wp-photo-album-plus'); $desc = __('Automatic opens comments box when slideshow does not run.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_auto_open_comments'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,comment,layout'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Film hover goto', 'wp-photo-album-plus'); $desc = __('Go to slide when hovering filmstrip thumbnail.', 'wp-photo-album-plus'); $help = __('Do not use this setting when slides have different aspect ratios!', 'wp-photo-album-plus'); $slug = 'wppa_film_hover_goto'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,layout'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Slide swipe', 'wp-photo-album-plus'); $desc = __('Enable touch events swipe left-right on slides on touch screens.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_slide_swipe'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,system'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Slide page Ajax', 'wp-photo-album-plus'); $desc = __('Pagelinks slideshow use Ajax', 'wp-photo-album-plus'); $help = __('On some systems you need to disable ajax here.', 'wp-photo-album-plus'); $slug = 'wppa_slideshow_page_allow_ajax'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'slide,system'; wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('C', '1', __('Thumbnail related settings', 'wp-photo-album-plus')); $name = __('Photo order', 'wp-photo-album-plus'); $desc = __('Photo ordering sequence method.', 'wp-photo-album-plus'); $help = esc_js(__('Specify the way the photos should be ordered. This is the default setting. You can overrule the default sorting order on a per album basis.', 'wp-photo-album-plus')); $slug = 'wppa_list_photos_by'; $options = array(__('--- none ---', 'wp-photo-album-plus'), __('Order #', 'wp-photo-album-plus'), __('Name', 'wp-photo-album-plus'), __('Random', 'wp-photo-album-plus'), __('Rating mean value', 'wp-photo-album-plus'), __('Number of votes', 'wp-photo-album-plus'), __('Timestamp', 'wp-photo-album-plus'), __('EXIF Date', 'wp-photo-album-plus'), __('Order # desc', 'wp-photo-album-plus'), __('Name desc', 'wp-photo-album-plus'), __('Rating mean value desc', 'wp-photo-album-plus'), __('Number of votes desc', 'wp-photo-album-plus'), __('Timestamp desc', 'wp-photo-album-plus'), __('EXIF Date desc', 'wp-photo-album-plus')); $values = array('0', '1', '2', '3', '4', '6', '5', '7', '-1', '-2', '-4', '-6', '-5', '-7'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'thumb,system'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail type', 'wp-photo-album-plus'); $desc = __('The way the thumbnail images are displayed.', 'wp-photo-album-plus'); $help = esc_js(__('You may select an altenative display method for thumbnails. Note that some of the thumbnail settings do not apply to all available display methods.', 'wp-photo-album-plus')); $slug = 'wppa_thumbtype'; $options = array(__('--- default ---', 'wp-photo-album-plus'), __('like album covers', 'wp-photo-album-plus'), __('like album covers mcr', 'wp-photo-album-plus'), __('masonry style columns', 'wp-photo-album-plus'), __('masonry style rows', 'wp-photo-album-plus')); $values = array('default', 'ascovers', 'ascovers-mcr', 'masonry-v', 'masonry-h'); $onchange = 'wppaCheckThumbType()'; $html = wppa_select($slug, $options, $values, $onchange); $clas = ''; $tags = 'thumb,layout'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Placement', 'wp-photo-album-plus'); $desc = __('Thumbnail image left or right.', 'wp-photo-album-plus'); $help = esc_js(__('Indicate the placement position of the thumbnailphoto you wish.', 'wp-photo-album-plus')); $slug = 'wppa_thumbphoto_left'; $options = array(__('Left', 'wp-photo-album-plus'), __('Right', 'wp-photo-album-plus')); $values = array('yes', 'no'); $html = wppa_select($slug, $options, $values); $clas = 'tt_ascovers'; $tags = 'thumb,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Vertical alignment', 'wp-photo-album-plus'); $desc = __('Vertical alignment of thumbnails.', 'wp-photo-album-plus'); $help = esc_js(__('Specify the vertical alignment of thumbnail images. Use this setting when albums contain both portrait and landscape photos.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('It is NOT recommended to use the value --- default ---; it will affect the horizontal alignment also and is meant to be used with custom css.', 'wp-photo-album-plus')); $slug = 'wppa_valign'; $options = array(__('--- default ---', 'wp-photo-album-plus'), __('top', 'wp-photo-album-plus'), __('center', 'wp-photo-album-plus'), __('bottom', 'wp-photo-album-plus')); $values = array('default', 'top', 'center', 'bottom'); $html = wppa_select($slug, $options, $values); $clas = 'tt_normal'; $tags = 'thumb,layout'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumb mouseover', 'wp-photo-album-plus'); $desc = __('Apply thumbnail mouseover effect.', 'wp-photo-album-plus'); $help = esc_js(__('Check this box to use mouseover effect on thumbnail images.', 'wp-photo-album-plus')); $slug = 'wppa_use_thumb_opacity'; $onchange = 'wppaCheckUseThumbOpacity()'; $html = wppa_checkbox($slug, $onchange); $clas = 'tt_normal tt_masonry'; $tags = 'thumb'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumb opacity', 'wp-photo-album-plus'); $desc = __('Initial opacity value.', 'wp-photo-album-plus'); $help = esc_js(__('Enter percentage of opacity. 100% is opaque, 0% is transparant', 'wp-photo-album-plus')); $slug = 'wppa_thumb_opacity'; $html = '<span class="thumb_opacity_html">' . wppa_input($slug, '50px', '', __('%', 'wp-photo-album-plus')) . '</span>'; $clas = 'tt_normal tt_masonry'; $tags = 'thumb'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumb popup', 'wp-photo-album-plus'); $desc = __('Use popup effect on thumbnail images.', 'wp-photo-album-plus'); $help = esc_js(__('Thumbnails pop-up to a larger image when hovered.', 'wp-photo-album-plus')); $slug = 'wppa_use_thumb_popup'; $onchange = 'wppaCheckPopup()'; $html = wppa_checkbox($slug, $onchange) . wppa_htmlerr('popup-lightbox'); $clas = 'tt_normal tt_masonry'; $tags = 'thumb'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Align subtext', 'wp-photo-album-plus'); $desc = __('Set thumbnail subtext on equal height.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_align_thumbtext'; $html = wppa_checkbox($slug); $clas = 'tt_normal'; $tags = 'thumb,layout'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('D', '1', __('Album and covers related settings', 'wp-photo-album-plus')); $name = __('Album order', 'wp-photo-album-plus'); $desc = __('Album ordering sequence method.', 'wp-photo-album-plus'); $help = esc_js(__('Specify the way the albums should be ordered.', 'wp-photo-album-plus')); $slug = 'wppa_list_albums_by'; $options = array(__('--- none ---', 'wp-photo-album-plus'), __('Order #', 'wp-photo-album-plus'), __('Name', 'wp-photo-album-plus'), __('Random', 'wp-photo-album-plus'), __('Timestamp', 'wp-photo-album-plus'), __('Order # desc', 'wp-photo-album-plus'), __('Name desc', 'wp-photo-album-plus'), __('Timestamp desc', 'wp-photo-album-plus')); $values = array('0', '1', '2', '3', '5', '-1', '-2', '-5'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'album,system'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Default coverphoto selection', 'wp-photo-album-plus'); $desc = __('Default select cover photo method.', 'wp-photo-album-plus'); $help = esc_js(__('This is the initial value on album creation only. It can be overruled on the edit album page.', 'wp-photo-album-plus')); $opts = array(__('Random from album', 'wp-photo-album-plus'), __('Random featured from album', 'wp-photo-album-plus'), __('Most recently added to album', 'wp-photo-album-plus'), __('Random from album or any sub album', 'wp-photo-album-plus')); $vals = array('0', '-1', '-2', '-3'); $slug = 'wppa_main_photo'; $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'album,cover'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Placement', 'wp-photo-album-plus'); $desc = __('Cover image position.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the position that you want to be used for the default album cover selected in Table IV-D6.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('For covertype Image Factory: left will be treated as top and right will be treted as bottom.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('For covertype Long Descriptions: top will be treated as left and bottom will be treted as right.', 'wp-photo-album-plus')); $slug = 'wppa_coverphoto_pos'; $options = array(__('Left', 'wp-photo-album-plus'), __('Right', 'wp-photo-album-plus'), __('Top', 'wp-photo-album-plus'), __('Bottom', 'wp-photo-album-plus')); $values = array('left', 'right', 'top', 'bottom'); $onchange = 'wppaCheckCoverType()'; $html = wppa_select($slug, $options, $values, $onchange); $clas = ''; $tags = 'album,cover,layout'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Cover mouseover', 'wp-photo-album-plus'); $desc = __('Apply coverphoto mouseover effect.', 'wp-photo-album-plus'); $help = esc_js(__('Check this box to use mouseover effect on cover images.', 'wp-photo-album-plus')); $slug = 'wppa_use_cover_opacity'; $onchange = 'wppaCheckUseCoverOpacity()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'cover,thumb'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Cover opacity', 'wp-photo-album-plus'); $desc = __('Initial opacity value.', 'wp-photo-album-plus'); $help = esc_js(__('Enter percentage of opacity. 100% is opaque, 0% is transparant', 'wp-photo-album-plus')); $slug = 'wppa_cover_opacity'; $html = '<span class="cover_opacity_html">' . wppa_input($slug, '50px', '', __('%', 'wp-photo-album-plus')) . '</span>'; $clas = ''; $tags = 'cover,thumb'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Cover type', 'wp-photo-album-plus'); $desc = __('Select the default cover type.', 'wp-photo-album-plus'); $help = esc_js(__('Types with the addition mcr are suitable for Multi Column in a Responsive theme', 'wp-photo-album-plus')); $slug = 'wppa_cover_type'; $options = array(__('Standard', 'wp-photo-album-plus'), __('Long Descriptions', 'wp-photo-album-plus'), __('Image Factory', 'wp-photo-album-plus'), __('Standard mcr', 'wp-photo-album-plus'), __('Long Descriptions mcr', 'wp-photo-album-plus'), __('Image Factory mcr', 'wp-photo-album-plus')); $values = array('default', 'longdesc', 'imagefactory', 'default-mcr', 'longdesc-mcr', 'imagefactory-mcr'); $onchange = 'wppaCheckCoverType()'; $html = wppa_select($slug, $options, $values, $onchange); $clas = ''; $tags = 'cover,layout'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Number of coverphotos', 'wp-photo-album-plus'); $desc = __('The umber of coverphotos. Must be > 1 and < 25.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_imgfact_count'; $html = wppa_input($slug, '50px', '', __('photos', 'wp-photo-album-plus')); $clas = 'wppa_imgfact_'; $tags = 'cover,layout'; wppa_setting($slug, '6.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Cats include subs', 'wp-photo-album-plus'); $desc = __('Child albums are included in Category based shortcodes.', 'wp-photo-album-plus'); $help = esc_js(__('When you use album="#cat,...", in a shortcode, the child albums will be included.', 'wp-photo-album-plus')); $slug = 'wppa_cats_inherit'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'album,cover,meta'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Run nl2br or wpautop on description', 'wp-photo-album-plus'); $desc = __('Adds <br> or <p> and <br> tags in album descriptions.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_wpautop_on_album_desc'; $opts = array(__('--- none ---', 'wp-photo-album-plus'), __('Linebreaks only', 'wp-photo-album-plus'), __('Linebreaks and paragraphs', 'wp-photo-album-plus')); $vals = array('nil', 'nl2br', 'wpautop'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'slide,layout,meta'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('E', '1', __('Rating related settings', 'wp-photo-album-plus')); $name = __('Rating login', 'wp-photo-album-plus'); $desc = __('Users must login to rate photos.', 'wp-photo-album-plus'); $help = esc_js(__('If users want to vote for a photo (rating 1..5 stars) the must login first. The avarage rating will always be displayed as long as the rating system is enabled.', 'wp-photo-album-plus')); $slug = 'wppa_rating_login'; $html = wppa_checkbox($slug); $clas = 'wppa_rating_'; $tags = 'rating,access'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Rating change', 'wp-photo-album-plus'); $desc = __('Users may change their ratings.', 'wp-photo-album-plus'); $help = esc_js(__('Users may change their ratings.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If "One button vote" is selected in Table I-E1, this setting has no meaning', 'wp-photo-album-plus')); $slug = 'wppa_rating_change'; $html = wppa_checkbox($slug); $clas = 'wppa_rating_'; $tags = 'rating'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); if (wppa_opt('rating_display_type') != 'likes') { $name = __('Rating multi', 'wp-photo-album-plus'); $desc = __('Users may give multiple votes.', 'wp-photo-album-plus'); $help = esc_js(__('Users may give multiple votes. (This has no effect when users may change their votes.)', 'wp-photo-album-plus')); $slug = 'wppa_rating_multi'; $html = wppa_checkbox($slug); $clas = 'wppa_rating_'; $tags = 'rating'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); } if (wppa_opt('rating_display_type') != 'likes') { $name = __('Rating daily', 'wp-photo-album-plus'); $desc = __('Users may rate only once per period', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_rating_dayly'; $opts = array(__('--- off ---', 'wp-photo-album-plus'), __('Week', 'wp-photo-album-plus'), __('Day', 'wp-photo-album-plus'), __('Hour', 'wp-photo-album-plus')); $vals = array(0, 7 * 24 * 60 * 60, 24 * 60 * 60, 60 * 60); $html = wppa_select($slug, $opts, $vals); $clas = 'wppa_rating_'; $tags = 'rating'; wppa_setting($slug, '3.0', $name, $desc, $html, $help, $clas, $tags); } $name = __('Rate own photos', 'wp-photo-album-plus'); $desc = __('It is allowed to rate photos by the uploader himself.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_allow_owner_votes'; $html = wppa_checkbox($slug); $clas = 'wppa_rating_'; $tags = 'rating'; wppa_setting($slug, '3.1', $name, $desc, $html, $help, $clas, $tags); if (wppa_opt('rating_display_type') != 'likes') { $name = __('Rating requires comment', 'wp-photo-album-plus'); $desc = __('Users must clarify their vote in a comment.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_vote_needs_comment'; $html = wppa_checkbox($slug); $clas = 'wppa_rating_'; $tags = 'rating'; wppa_setting($slug, '3.2', $name, $desc, $html, $help, $clas, $tags); } $name = __('Dislike value', 'wp-photo-album-plus'); $desc = __('This value counts dislike rating.', 'wp-photo-album-plus'); $help = esc_js(__('This value will be used for a dislike rating on calculation of avarage ratings.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If "One button vote" is selected in Table I-E1, this setting has no meaning', 'wp-photo-album-plus')); $slug = 'wppa_dislike_value'; $html = wppa_input($slug, '50px', '', __('points', 'wp-photo-album-plus')); $clas = 'wppa_rating_'; $tags = 'rating'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Next after vote', 'wp-photo-album-plus'); $desc = __('Goto next slide after voting', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the visitor goes straight to the slide following the slide he voted. This will speed up mass voting.', 'wp-photo-album-plus')); $slug = 'wppa_next_on_callback'; $html = wppa_checkbox($slug); $clas = 'wppa_rating_'; $tags = 'rating'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Star off opacity', 'wp-photo-album-plus'); $desc = __('Rating star off state opacity value.', 'wp-photo-album-plus'); $help = esc_js(__('Enter percentage of opacity. 100% is opaque, 0% is transparant', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If "One button vote" is selected in Table I-E1, this setting has no meaning', 'wp-photo-album-plus')); $slug = 'wppa_star_opacity'; $html = wppa_input($slug, '50px', '', __('%', 'wp-photo-album-plus')); $clas = 'wppa_rating_'; $tags = 'rating'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Notify inappropriate', 'wp-photo-album-plus'); $desc = __('Notify admin every x times.', 'wp-photo-album-plus'); $help = esc_js(__('If this number is positive, there will be a thumb down icon in the rating bar.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Cicking the icon indicates a user wants to report that an image is inappropiate.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Admin will be notified by email after every x reports.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('A value of 0 disables this feature.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If "One button vote" is selected in Table I-E1, this setting has no meaning', 'wp-photo-album-plus')); $slug = 'wppa_dislike_mail_every'; $html = wppa_input($slug, '40px', '', __('reports', 'wp-photo-album-plus')); $clas = 'wppa_rating_'; $tags = 'rating'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Pending after', 'wp-photo-album-plus'); $desc = __('Set status to pending after xx dislike votes.', 'wp-photo-album-plus'); $help = esc_js(__('A value of 0 disables this feature.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If "One button vote" is selected in Table I-E1, this setting has no meaning', 'wp-photo-album-plus')); $slug = 'wppa_dislike_set_pending'; $html = wppa_input($slug, '40px', '', __('reports', 'wp-photo-album-plus')); $clas = 'wppa_rating_'; $tags = 'rating'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Delete after', 'wp-photo-album-plus'); $desc = __('Deete photo after xx dislike votes.', 'wp-photo-album-plus'); $help = esc_js(__('A value of 0 disables this feature.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If "One button vote" is selected in Table I-E1, this setting has no meaning', 'wp-photo-album-plus')); $slug = 'wppa_dislike_delete'; $html = wppa_input($slug, '40px', '', __('reports', 'wp-photo-album-plus')); $clas = 'wppa_rating_'; $tags = 'rating'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Show dislike count', 'wp-photo-album-plus'); $desc = __('Show the number of dislikes in the rating bar.', 'wp-photo-album-plus'); $help = esc_js(__('Displayes the total number of dislike votes for the current photo.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If "One button vote" is selected in Table I-E1, this setting has no meaning', 'wp-photo-album-plus')); $slug = 'wppa_dislike_show_count'; $html = wppa_checkbox($slug, $onchange); $clas = 'wppa_rating_'; $tags = 'rating,layout'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Rating display type', 'wp-photo-album-plus'); $desc = __('Specify the type of the rating display.', 'wp-photo-album-plus'); $help = esc_js(__('If you select "Likes" you must also select "One button vote" in Table I-E1', 'wp-photo-album-plus')); $slug = 'wppa_rating_display_type'; $opts = array(__('Graphic', 'wp-photo-album-plus'), __('Numeric', 'wp-photo-album-plus'), __('Likes', 'wp-photo-album-plus')); $vals = array('graphic', 'numeric', 'likes'); $postaction = 'setTimeout(\'document.location.reload(true)\', 2000)'; $html = wppa_select($slug, $opts, $vals, '', '', false, $postaction); $clas = 'wppa_rating_'; $tags = 'rating,layout'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Show average rating', 'wp-photo-album-plus'); $desc = __('Display the avarage rating and/or vote count on the rating bar', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the average rating as well as the current users rating is displayed in max 5 or 10 stars.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If unchecked, only the current users rating is displayed (if any).', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If "One button vote" is selected in Table I-E1, this box checked will display the vote count.', 'wp-photo-album-plus')); $slug = 'wppa_show_avg_rating'; $html = wppa_checkbox($slug); $clas = 'wppa_rating_'; $tags = 'rating,layout'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Single vote button text', 'wp-photo-album-plus'); $desc = __('The text on the voting button.', 'wp-photo-album-plus'); $help = __('This text may contain qTranslate compatible language tags.', 'wp-photo-album-plus'); $slug = 'wppa_vote_button_text'; $html = wppa_input($slug, '100'); $clas = 'wppa_rating_'; $tags = 'rating,layout'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Single vote button text voted', 'wp-photo-album-plus'); $desc = __('The text on the voting button when voted.', 'wp-photo-album-plus'); $help = __('This text may contain qTranslate compatible language tags.', 'wp-photo-album-plus'); $slug = 'wppa_voted_button_text'; $html = wppa_input($slug, '100'); $clas = 'wppa_rating_'; $tags = 'rating,layout'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Single vote button thumbnail', 'wp-photo-album-plus'); $desc = __('Display single vote button below thumbnails.', 'wp-photo-album-plus'); $help = esc_js(__('This works only in single vote mode: Table I-E1 set to "one button vote"', 'wp-photo-album-plus')); $slug = 'wppa_vote_thumb'; $html = wppa_checkbox($slug); $clas = 'wppa_rating_'; $tags = 'rating,layout'; wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags); $name = __('Medal bronze when', 'wp-photo-album-plus'); $desc = __('Photo gets medal bronze when number of top-scores ( 5 or 10 ).', 'wp-photo-album-plus'); $help = esc_js(__('When the photo has this number of topscores ( 5 or 10 stars ), it will get a bronze medal. A value of 0 indicates that you do not want this feature.', 'wp-photo-album-plus')); $slug = 'wppa_medal_bronze_when'; $html = wppa_input($slug, '50px', '', __('Topscores', 'wp-photo-album-plus')); $clas = 'wppa_rating_'; $tags = 'rating,layout'; wppa_setting($slug, '16.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Medal silver when', 'wp-photo-album-plus'); $desc = __('Photo gets medal silver when number of top-scores ( 5 or 10 ).', 'wp-photo-album-plus'); $help = esc_js(__('When the photo has this number of topscores ( 5 or 10 stars ), it will get a silver medal. A value of 0 indicates that you do not want this feature.', 'wp-photo-album-plus')); $slug = 'wppa_medal_silver_when'; $html = wppa_input($slug, '50px', '', __('Topscores', 'wp-photo-album-plus')); $clas = 'wppa_rating_'; $tags = 'rating,layout'; wppa_setting($slug, '16.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Medal gold when', 'wp-photo-album-plus'); $desc = __('Photo gets medal bronze when number of top-scores ( 5 or 10 ).', 'wp-photo-album-plus'); $help = esc_js(__('When the photo has this number of topscores ( 5 or 10 stars ), it will get a bronze medal. A value of 0 indicates that you do not want this feature.', 'wp-photo-album-plus')); $slug = 'wppa_medal_gold_when'; $html = wppa_input($slug, '50px', '', __('Topscores', 'wp-photo-album-plus')); $clas = 'wppa_rating_'; $tags = 'rating,layout'; wppa_setting($slug, '16.3', $name, $desc, $html, $help, $clas, $tags); $name = __('Medal tag color', 'wp-photo-album-plus'); $desc = __('The color of the tag on the medal.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_medal_color'; $opts = array(__('Red', 'wp-photo-album-plus'), __('Green', 'wp-photo-album-plus'), __('Blue', 'wp-photo-album-plus')); $vals = array('1', '2', '3'); $html = wppa_select($slug, $opts, $vals); $clas = 'wppa_rating_'; $tags = 'rating,layout'; wppa_setting($slug, '16.4', $name, $desc, $html, $help, $clas, $tags); $name = __('Medal position', 'wp-photo-album-plus'); $desc = __('The position of the medal on the image.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_medal_position'; $opts = array(__('Top left', 'wp-photo-album-plus'), __('Top right', 'wp-photo-album-plus'), __('Bottom left', 'wp-photo-album-plus'), __('Bottom right', 'wp-photo-album-plus')); $vals = array('topleft', 'topright', 'botleft', 'botright'); $html = wppa_select($slug, $opts, $vals); $clas = 'wppa_rating_'; $tags = 'rating,layout'; wppa_setting($slug, '16.5', $name, $desc, $html, $help, $clas, $tags); $name = __('Top criterium', 'wp-photo-album-plus'); $desc = __('The top sort item used for topten results from shortcodes.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_topten_sortby'; $opts = array(__('Mean raiting', 'wp-photo-album-plus'), __('Rating count', 'wp-photo-album-plus'), __('Viewcount', 'wp-photo-album-plus')); $vals = array('mean_rating', 'rating_count', 'views'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'rating,layout'; wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('F', '1', __('Comments related settings', 'wp-photo-album-plus'), 'wppa_comment_'); $name = __('Commenting login', 'wp-photo-album-plus'); $desc = __('Users must be logged in to comment on photos.', 'wp-photo-album-plus'); $help = esc_js(__('Check this box if you want users to be logged in to be able to enter comments on individual photos.', 'wp-photo-album-plus')); $slug = 'wppa_comment_login'; $html = wppa_checkbox($slug); $clas = 'wppa_comment_'; $tags = 'comment,access'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Comments view login', 'wp-photo-album-plus'); $desc = __('Users must be logged in to see comments on photos.', 'wp-photo-album-plus'); $help = esc_js(__('Check this box if you want users to be logged in to be able to see existing comments on individual photos.', 'wp-photo-album-plus')); $slug = 'wppa_comment_view_login'; $html = wppa_checkbox($slug); $clas = 'wppa_comment_'; $tags = 'comment,access'; wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Last comment first', 'wp-photo-album-plus'); $desc = __('Display the newest comment on top.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: Display the newest comment on top.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If unchecked, the comments are listed in the ordere they were entered.', 'wp-photo-album-plus')); $slug = 'wppa_comments_desc'; $html = wppa_checkbox($slug); $clas = 'wppa_comment_'; $tags = 'comment,layout'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Comment moderation', 'wp-photo-album-plus'); $desc = __('Comments from what users need approval.', 'wp-photo-album-plus'); $help = esc_js(__('Select the desired users of which the comments need approval.', 'wp-photo-album-plus')); $slug = 'wppa_comment_moderation'; $options = array(__('All users', 'wp-photo-album-plus'), __('Logged out users', 'wp-photo-album-plus'), __('No users', 'wp-photo-album-plus')); $values = array('all', 'logout', 'none'); $html = wppa_select($slug, $options, $values); $clas = 'wppa_comment_'; $tags = 'comment,access'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Comment email required', 'wp-photo-album-plus'); $desc = __('Commenting users must enter their email addresses.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_comment_email_required'; $opts = array(__('None', 'wp-photo-album-plus'), __('Optional', 'wp-photo-album-plus'), __('Required', 'wp-photo-album-plus')); $vals = array('none', 'optional', 'required'); $html = wppa_select($slug, $opts, $vals); $clas = 'wppa_comment_'; $tags = 'comment'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Comment notify', 'wp-photo-album-plus'); $desc = __('Select who must receive an e-mail notification of a new comment.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_comment_notify'; $options = array(__('--- None ---', 'wp-photo-album-plus'), __('--- Admin ---', 'wp-photo-album-plus'), __('--- Album owner ---', 'wp-photo-album-plus'), __('--- Admin & Owner ---', 'wp-photo-album-plus'), __('--- Uploader ---', 'wp-photo-album-plus'), __('--- Up & admin ---', 'wp-photo-album-plus'), __('--- Up & Owner ---', 'wp-photo-album-plus')); $values = array('none', 'admin', 'owner', 'both', 'upload', 'upadmin', 'upowner'); $usercount = wppa_get_user_count(); if ($usercount <= wppa_opt('max_users')) { $users = wppa_get_users(); foreach ($users as $usr) { $options[] = $usr['display_name']; $values[] = $usr['ID']; } } $html = wppa_select($slug, $options, $values); $clas = 'wppa_comment_'; $tags = 'comment'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Comment notify previous', 'wp-photo-album-plus'); $desc = __('Notify users who has commented this photo earlier.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_com_notify_previous'; $html = wppa_checkbox($slug); $clas = 'wppa_comment_'; $tags = 'comment'; wppa_setting($slug, '5.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Comment notify approved', 'wp-photo-album-plus'); $desc = __('Notify photo owner of approved comment.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_com_notify_approved'; $html = wppa_checkbox($slug); $clas = 'wppa_comment_'; $tags = 'comment'; wppa_setting($slug, '5.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Com ntfy appr email content', 'wp-photo-album-plus'); $desc = __('The content of the email.', 'wp-photo-album-plus'); $help = esc_js(__('If you leave this blank, the default content will be used', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('The content may contain html.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('You may use the following keywords: w#comment for the comment content, w#user for the commenters name and the standard photo description keywords w#name, w#filename, w#owner, w#id, w#tags, w#timestamp, w#modified, w#views, w#amx, w#amy, w#amfs, w#url, w#hrurl, w#tnurl, w#cc0..w#cc9, w#cd0..w#cd9.', 'wp-photo-album-plus')); $slug = 'wppa_com_notify_approved_text'; $html = wppa_textarea($slug, $name); $clas = 'wppa_comment_'; $tags = 'comment'; wppa_setting($slug, '5.3', $name, $desc, $html, $help, $clas, $tags); $name = __('Com ntfy appr email subject', 'wp-photo-album-plus'); $desc = __('The subject of the email.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_com_notify_approved_subj'; $html = wppa_input($slug, '300px;'); $clas = 'wppa_comment_'; $tags = 'comment'; wppa_setting($slug, '5.4', $name, $desc, $html, $help, $clas, $tags); $name = __('Comment ntfy added', 'wp-photo-album-plus'); $desc = __('Show "Comment added" after successfull adding a comment.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_comment_notify_added'; $html = wppa_checkbox($slug); $clas = 'wppa_comment_'; $tags = 'comment'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('ComTen alt display', 'wp-photo-album-plus'); $desc = __('Display comments at comten thumbnails.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_comten_alt_display'; $html = wppa_checkbox($slug); $clas = 'wppa_comment_'; $tags = 'comment,layout'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Comten Thumbnail width', 'wp-photo-album-plus'); $desc = __('The width of the thumbnail in the alt comment display.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_comten_alt_thumbsize'; $html = wppa_input($slug, '50px', '', __('Pixels', 'wp-photo-album-plus')); $clas = 'wppa_comment_'; $tags = 'comment,layout'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Show smiley picker', 'wp-photo-album-plus'); $desc = __('Display a clickable row of smileys.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_comment_smiley_picker'; $html = wppa_checkbox($slug); $clas = 'wppa_comment_'; $tags = 'comment,layout'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Show commenter email', 'wp-photo-album-plus'); $desc = __('Show the commenter\'s email in the notify emails.', 'wp-photo-album-plus'); $help = esc_js(__('Shows the email address of the commenter in all notify emails.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('If switched off, admin will still receive the senders email in the notification mail', 'wp-photo-album-plus')); $slug = 'wppa_mail_upl_email'; $html = wppa_checkbox($slug); $clas = 'wppa_comment_'; $tags = 'comment,layout'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('G', '1', __('Lightbox related settings. These settings have effect only when Table IX-J3 is set to wppa', 'wp-photo-album-plus')); $name = __('Overlay opacity', 'wp-photo-album-plus'); $desc = __('The opacity of the lightbox overlay background.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_opacity'; $html = wppa_input($slug, '50px', '', __('%', 'wp-photo-album-plus')); $clas = ''; $tags = 'lightbox'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Click on background', 'wp-photo-album-plus'); $desc = __('Select the action to be taken on click on background.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_onclick'; $options = array(__('Nothing', 'wp-photo-album-plus'), __('Exit (close)', 'wp-photo-album-plus'), __('Browse (left/right)', 'wp-photo-album-plus')); $values = array('none', 'close', 'browse'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'lightbox'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay animation speed', 'wp-photo-album-plus'); $desc = __('The fade-in time of the lightbox images', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_anim'; $options = array(__('--- off ---', 'wp-photo-album-plus'), __('very fast (100 ms.)', 'wp-photo-album-plus'), __('fast (200 ms.)', 'wp-photo-album-plus'), __('normal (300 ms.)', 'wp-photo-album-plus'), __('slow (500 ms.)', 'wp-photo-album-plus'), __('very slow (1 s.)', 'wp-photo-album-plus'), __('extremely slow (2 s.)', 'wp-photo-album-plus')); $values = array('0', '100', '200', '300', '500', '1000', '2000'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'lightbox'; wppa_setting($slug, '3.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Overlay slideshow speed', 'wp-photo-album-plus'); $desc = __('The time the lightbox images stay', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_slide'; $options = array(__('fast (3 s.)', 'wp-photo-album-plus'), __('normal (5 s.)', 'wp-photo-album-plus'), __('slow (8 s.)', 'wp-photo-album-plus'), __('very slow (13 s.)', 'wp-photo-album-plus'), __('extremely slow (20 s.)', 'wp-photo-album-plus')); $values = array('3000', '5000', '8000', '13000', '20000'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'lightbox'; wppa_setting($slug, '3.2', $name, $desc, $html, $help, $clas, $tags); /* $name = __('Overlay at top in Chrome', 'wp-photo-album-plus'); $desc = __('Place the overlay (lightbox) image at the top of the page in Chrome browsers.', 'wp-photo-album-plus'); $help = esc_js(__('This is required for certain mobile devices.', 'wp-photo-album-plus')); $slug = 'wppa_ovl_chrome_at_top'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,layout'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); */ $name = __('WPPA+ Lightbox global', 'wp-photo-album-plus'); $desc = __('Use the wppa+ lightbox also for non-wppa images.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_lightbox_global'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('WPPA+ Lightbox global is a set', 'wp-photo-album-plus'); $desc = __('Treat the other images as a set.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, you can scroll through the images in the lightbox view. Requires item 5 to be checked.', 'wp-photo-album-plus')); $slug = 'wppa_lightbox_global_set'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox'; wppa_setting($slug, '5.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Use hires files', 'wp-photo-album-plus'); $desc = __('Use the highest resolution available for lightbox.', 'wp-photo-album-plus'); $help = esc_js(__('Ticking this box is recommended for lightbox fullscreen modes.', 'wp-photo-album-plus')); $slug = 'wppa_lb_hres'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Video autostart', 'wp-photo-album-plus'); $desc = __('Videos on lightbox start automaticly.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_video_start'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,video'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Audio autostart', 'wp-photo-album-plus'); $desc = __('Audio on lightbox start automaticly.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_audio_start'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'lightbox,audio'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Lightbox start mode', 'wp-photo-album-plus'); $desc = __('The mode lightbox starts in.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_mode_initial'; $opts = array(__('Normal', 'wp-photo-album-plus'), __('Padded', 'wp-photo-album-plus'), __('Stretched', 'wp-photo-album-plus'), __('Clipped', 'wp-photo-album-plus'), __('Real size', 'wp-photo-album-plus')); $vals = array('normal', 'padded', 'stretched', 'clipped', 'realsize'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'lightbox,layout'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Lightbox start mode mobile', 'wp-photo-album-plus'); $desc = __('The mode lightbox starts in on mobile devices.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ovl_mode_initial_mob'; $opts = array(__('Normal', 'wp-photo-album-plus'), __('Padded', 'wp-photo-album-plus'), __('Stretched', 'wp-photo-album-plus'), __('Clipped', 'wp-photo-album-plus'), __('Real size', 'wp-photo-album-plus')); $vals = array('normal', 'padded', 'stretched', 'clipped', 'realsize'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'lightbox,layout'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); ?> </tbody> <tfoot style="font-weight: bold;" class="wppa_table_4"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Setting', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </tfoot> </table> </div> <?php // Table 5: Fonts ?> <?php wppa_settings_box_header('5', __('Table V:', 'wp-photo-album-plus') . ' ' . __('Fonts:', 'wp-photo-album-plus') . ' ' . __('This table describes the Fonts used for the wppa+ elements.', 'wp-photo-album-plus')); ?> <div id="wppa_table_5" style="display:none" > <table class="widefat wppa-table wppa-setting-table"> <thead style="font-weight: bold; " class="wppa_table_5"> <tr> <td scope="col" ><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Font family', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Font size', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Font color', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Font weight', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </thead> <tbody class="wppa_table_5"> <?php $wppa_table = 'V'; $wppa_subtable = 'Z'; // No subtables $options = array(__('normal', 'wp-photo-album-plus'), __('bold', 'wp-photo-album-plus'), __('bolder', 'wp-photo-album-plus'), __('lighter', 'wp-photo-album-plus'), '100', '200', '300', '400', '500', '600', '700', '800', '900'); $values = array('normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '700', '800', '900'); $name = __('Album titles', 'wp-photo-album-plus'); $desc = __('Font used for Album titles.', 'wp-photo-album-plus'); $help = esc_js(__('Enter font name, size, color and weight for album cover titles.', 'wp-photo-album-plus')); $slug1 = 'wppa_fontfamily_title'; $slug2 = 'wppa_fontsize_title'; $slug3 = 'wppa_fontcolor_title'; $slug4 = 'wppa_fontweight_title'; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = wppa_input($slug1, '90%', '200px', ''); $html2 = wppa_input($slug2, '40px', '', __('pixels', 'wp-photo-album-plus')); $html3 = wppa_input($slug3, '70px', '', ''); $html4 = wppa_select($slug4, $options, $values); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'layout,album'; wppa_setting($slug, '1a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Slideshow desc', 'wp-photo-album-plus'); $desc = __('Font for slideshow photo descriptions.', 'wp-photo-album-plus'); $help = esc_js(__('Enter font name, size, color and weight for slideshow photo descriptions.', 'wp-photo-album-plus')); $slug1 = 'wppa_fontfamily_fulldesc'; $slug2 = 'wppa_fontsize_fulldesc'; $slug3 = 'wppa_fontcolor_fulldesc'; $slug4 = 'wppa_fontweight_fulldesc'; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = wppa_input($slug1, '90%', '200px', ''); $html2 = wppa_input($slug2, '40px', '', __('pixels', 'wp-photo-album-plus')); $html3 = wppa_input($slug3, '70px', '', ''); $html4 = wppa_select($slug4, $options, $values); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'layout,slide'; wppa_setting($slug, '2a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Slideshow name', 'wp-photo-album-plus'); $desc = __('Font for slideshow photo names.', 'wp-photo-album-plus'); $help = esc_js(__('Enter font name, size, color and weight for slideshow photo names.', 'wp-photo-album-plus')); $slug1 = 'wppa_fontfamily_fulltitle'; $slug2 = 'wppa_fontsize_fulltitle'; $slug3 = 'wppa_fontcolor_fulltitle'; $slug4 = 'wppa_fontweight_fulltitle'; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = wppa_input($slug1, '90%', '200px', ''); $html2 = wppa_input($slug2, '40px', '', __('pixels', 'wp-photo-album-plus')); $html3 = wppa_input($slug3, '70px', '', ''); $html4 = wppa_select($slug4, $options, $values); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'layout,slide,meta'; wppa_setting($slug, '3a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Navigations', 'wp-photo-album-plus'); $desc = __('Font for navigations.', 'wp-photo-album-plus'); $help = esc_js(__('Enter font name, size, color and weight for navigation items.', 'wp-photo-album-plus')); $slug1 = 'wppa_fontfamily_nav'; $slug2 = 'wppa_fontsize_nav'; $slug3 = 'wppa_fontcolor_nav'; $slug4 = 'wppa_fontweight_nav'; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = wppa_input($slug1, '90%', '200px', ''); $html2 = wppa_input($slug2, '40px', '', __('pixels', 'wp-photo-album-plus')); $html3 = wppa_input($slug3, '70px', '', ''); $html4 = wppa_select($slug4, $options, $values); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'layout,navi'; wppa_setting($slug, '4a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnails', 'wp-photo-album-plus'); $desc = __('Font for text under thumbnails.', 'wp-photo-album-plus'); $help = esc_js(__('Enter font name, size, color and weight for text under thumbnail images.', 'wp-photo-album-plus')); $slug1 = 'wppa_fontfamily_thumb'; $slug2 = 'wppa_fontsize_thumb'; $slug3 = 'wppa_fontcolor_thumb'; $slug4 = 'wppa_fontweight_thumb'; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = wppa_input($slug1, '90%', '200px', ''); $html2 = wppa_input($slug2, '40px', '', __('pixels', 'wp-photo-album-plus')); $html3 = wppa_input($slug3, '70px', '', ''); $html4 = wppa_select($slug4, $options, $values); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'layout,thumb'; wppa_setting($slug, '5a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Other', 'wp-photo-album-plus'); $desc = __('General font in wppa boxes.', 'wp-photo-album-plus'); $help = esc_js(__('Enter font name, size, color and weight for all other items.', 'wp-photo-album-plus')); $slug1 = 'wppa_fontfamily_box'; $slug2 = 'wppa_fontsize_box'; $slug3 = 'wppa_fontcolor_box'; $slug4 = 'wppa_fontweight_box'; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = wppa_input($slug1, '90%', '200px', ''); $html2 = wppa_input($slug2, '40px', '', __('pixels', 'wp-photo-album-plus')); $html3 = wppa_input($slug3, '70px', '', ''); $html4 = wppa_select($slug4, $options, $values); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'layout'; wppa_setting($slug, '6a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Numbar', 'wp-photo-album-plus'); $desc = __('Font in wppa number bars.', 'wp-photo-album-plus'); $help = esc_js(__('Enter font name, size, color and weight for numberbar navigation.', 'wp-photo-album-plus')); $slug1 = 'wppa_fontfamily_numbar'; $slug2 = 'wppa_fontsize_numbar'; $slug3 = 'wppa_fontcolor_numbar'; $slug4 = 'wppa_fontweight_numbar'; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = wppa_input($slug1, '90%', '200px', ''); $html2 = wppa_input($slug2, '40px', '', __('pixels', 'wp-photo-album-plus')); $html3 = wppa_input($slug3, '70px', '', ''); $html4 = wppa_select($slug4, $options, $values); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'layout,slide'; wppa_setting($slug, '7a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Numbar Active', 'wp-photo-album-plus'); $desc = __('Font in wppa number bars, active item.', 'wp-photo-album-plus'); $help = esc_js(__('Enter font name, size, color and weight for numberbar navigation.', 'wp-photo-album-plus')); $slug1 = 'wppa_fontfamily_numbar_active'; $slug2 = 'wppa_fontsize_numbar_active'; $slug3 = 'wppa_fontcolor_numbar_active'; $slug4 = 'wppa_fontweight_numbar_active'; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = wppa_input($slug1, '90%', '200px', ''); $html2 = wppa_input($slug2, '40px', '', __('pixels', 'wp-photo-album-plus')); $html3 = wppa_input($slug3, '70px', '', ''); $html4 = wppa_select($slug4, $options, $values); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'layout,slide'; wppa_setting($slug, '8a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Lightbox', 'wp-photo-album-plus'); $desc = __('Font in wppa lightbox overlays.', 'wp-photo-album-plus'); $help = esc_js(__('Enter font name, size, color and weight for wppa lightbox overlays.', 'wp-photo-album-plus')); $slug1 = 'wppa_fontfamily_lightbox'; $slug2 = 'wppa_fontsize_lightbox'; $slug3 = 'wppa_fontcolor_lightbox'; $slug4 = 'wppa_fontweight_lightbox'; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = wppa_input($slug1, '90%', '200px', ''); $html2 = wppa_input($slug2, '40px', '', __('pixels', 'wp-photo-album-plus')); $html3 = wppa_input($slug3, '70px', '', ''); $html4 = wppa_select($slug4, $options, $values); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'layout,lightbox'; wppa_setting($slug, '9a,b,c,d', $name, $desc, $html, $help, $clas, $tags); ?> </tbody> <tfoot style="font-weight: bold;" class="wppa_table_5"> <tr> <td scope="col" ><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Font family', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Font size', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Font color', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Font weight', 'wp-photo-album-plus'); ?> </td> <td scope="col" ><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </tfoot> </table> </div> <?php // Table 6: Links ?> <?php wppa_settings_box_header('6', __('Table VI:', 'wp-photo-album-plus') . ' ' . __('Links:', 'wp-photo-album-plus') . ' ' . __('This table defines the link types and pages.', 'wp-photo-album-plus')); ?> <div id="wppa_table_6" style="display:none" > <table class="widefat wppa-table wppa-setting-table"> <thead style="font-weight: bold; " class="wppa_table_6"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Link type', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Link page', 'wp-photo-album-plus'); ?> </td> <td><?php _e('New tab', 'wp-photo-album-plus'); ?> </td> <th scope="col" title="<?php _e('Photo specific link overrules', 'wp-photo-album-plus'); ?> " style="cursor: default"><?php _e('PSO', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </thead> <tbody class="wppa_table_6"> <?php $wppa_table = 'VI'; $wppa_subtable = 'Z'; /* // Linktypes $options_linktype = array( __('no link at all.'), __('the plain photo (file).'), __('the full size photo in a slideshow.'), __('the fullsize photo on its own.'), __('the single photo in the style of a slideshow.'), __('the fs photo with download and print buttons.'), __('a plain page without a querystring.'), __('lightbox.') ); $values_linktype = array( 'none', 'file', 'photo', 'single', 'slphoto', 'fullpopup', 'plainpage', 'lightbox' ); $options_linktype_album = array( __('no link at all.'), __('the plain photo (file).'), __('the content of the album.'), __('the full size photo in a slideshow.'), __('the fullsize photo on its own.'), __('lightbox.') ); $values_linktype_album = array('none', 'file', 'album', 'photo', 'single', 'lightbox'); */ wppa_setting_subheader('A', '4', __('Links from images in WPPA+ Widgets', 'wp-photo-album-plus')); $name = __('PotdWidget', 'wp-photo-album-plus'); $desc = __('Photo Of The Day widget link.', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link the photo of the day points to.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If you select \'defined on widget admin page\' you can manually enter a link and title on the Photo of the day Widget Admin page.', 'wp-photo-album-plus')); $slug1 = 'wppa_potd_linktype'; $slug2 = 'wppa_potd_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_potd_blank'; $slug4 = 'wppa_potdwidget_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckPotdLink();'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('defined on widget admin page.', 'wp-photo-album-plus'), __('the content of the album.', 'wp-photo-album-plus'), __('the full size photo in a slideshow.', 'wp-photo-album-plus'), __('the fullsize photo on its own.', 'wp-photo-album-plus'), __('a plain page without a querystring.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus')); $vals = array('none', 'file', 'custom', 'album', 'photo', 'single', 'plainpage', 'lightbox'); $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_potdlp'; $html2 = wppa_select($slug2, $options_page_auto, $values_page, '', $clas); $clas = 'wppa_potdlb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $htmlerr = wppa_htmlerr('widget'); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'widget,link,thumb'; wppa_setting($slug, '1a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('SlideWidget', 'wp-photo-album-plus'); $desc = __('Slideshow widget photo link.', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link the slideshow photos point to.', 'wp-photo-album-plus')); $slug1 = 'wppa_slideonly_widget_linktype'; $slug2 = 'wppa_slideonly_widget_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_sswidget_blank'; $slug4 = 'wppa_sswidget_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckSlideOnlyLink();'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('defined at widget activation.', 'wp-photo-album-plus'), __('the content of the album.', 'wp-photo-album-plus'), __('the full size photo in a slideshow.', 'wp-photo-album-plus'), __('the fullsize photo on its own.', 'wp-photo-album-plus'), __('a plain page without a querystring.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus')); $vals = array('none', 'file', 'widget', 'album', 'photo', 'single', 'plainpage', 'lightbox'); $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_solp'; $onchange = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = 'wppa_solb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'widget,link,slide'; wppa_setting($slug, '2a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Album widget', 'wp-photo-album-plus'); $desc = __('Album widget thumbnail link', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link the album widget photos point to.', 'wp-photo-album-plus')); $slug1 = 'wppa_album_widget_linktype'; $slug2 = 'wppa_album_widget_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_album_widget_blank'; // $slug4 = 'wppa_album_widget_overrule'; // useless $slug = array($slug1, $slug2, $slug3); $onchange = 'wppaCheckAlbumWidgetLink();'; $opts = array(__('subalbums and thumbnails.', 'wp-photo-album-plus'), __('slideshow.', 'wp-photo-album-plus'), __('a plain page without a querystring.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus')); $vals = array('content', 'slide', 'plainpage', 'lightbox'); $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_awlp'; $onchange = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = 'wppa_awlb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = ''; // wppa_checkbox($slug4); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'widget,link,album'; wppa_setting($slug, '3a,b,c', $name, $desc, $html, $help, $clas, $tags); $name = __('ThumbnailWidget', 'wp-photo-album-plus'); $desc = __('Thumbnail widget photo link.', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link the thumbnail photos point to.', 'wp-photo-album-plus')); $slug1 = 'wppa_thumbnail_widget_linktype'; $slug2 = 'wppa_thumbnail_widget_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_thumbnail_widget_blank'; $slug4 = 'wppa_thumbnail_widget_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckThumbnailWLink();'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('the full size photo in a slideshow.', 'wp-photo-album-plus'), __('the fullsize photo on its own.', 'wp-photo-album-plus'), __('the single photo in the style of a slideshow.', 'wp-photo-album-plus'), __('the fs photo with download and print buttons.', 'wp-photo-album-plus'), __('a plain page without a querystring.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus')); $vals = array('none', 'file', 'photo', 'single', 'slphoto', 'fullpopup', 'plainpage', 'lightbox'); $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_tnlp'; $onchange = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = 'wppa_tnlb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'widget,link,thumb'; wppa_setting($slug, '4a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('TopTenWidget', 'wp-photo-album-plus'); $desc = __('TopTen widget photo link.', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link the top ten photos point to.', 'wp-photo-album-plus')); $slug1 = 'wppa_topten_widget_linktype'; $slug2 = 'wppa_topten_widget_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_topten_blank'; $slug4 = 'wppa_topten_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckTopTenLink();'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('the content of the virtual topten album.', 'wp-photo-album-plus'), __('the content of the thumbnails album.', 'wp-photo-album-plus'), __('the full size photo in a slideshow.', 'wp-photo-album-plus'), __('the thumbnails album in a slideshow.', 'wp-photo-album-plus'), __('the fullsize photo on its own.', 'wp-photo-album-plus'), __('the single photo in the style of a slideshow.', 'wp-photo-album-plus'), __('the fs photo with download and print buttons.', 'wp-photo-album-plus'), __('a plain page without a querystring.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus')); $vals = array('none', 'file', 'album', 'thumbalbum', 'photo', 'slidealbum', 'single', 'slphoto', 'fullpopup', 'plainpage', 'lightbox'); $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_ttlp'; $onchange = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = 'wppa_ttlb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $html = array($html1, $html2, $html3, $html4); $clas = 'wppa_rating'; $clas = ''; $tags = 'widget,link,thumb,rating'; wppa_setting($slug, '5a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('LasTenWidget', 'wp-photo-album-plus'); $desc = __('Last Ten widget photo link.', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link the last ten photos point to.', 'wp-photo-album-plus')); $slug1 = 'wppa_lasten_widget_linktype'; $slug2 = 'wppa_lasten_widget_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_lasten_blank'; $slug4 = 'wppa_lasten_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckLasTenLink();'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('the content of the virtual lasten album.', 'wp-photo-album-plus'), __('the content of the thumbnails album.', 'wp-photo-album-plus'), __('the full size photo in a slideshow.', 'wp-photo-album-plus'), __('the thumbnails album in a slideshow.', 'wp-photo-album-plus'), __('the fullsize photo on its own.', 'wp-photo-album-plus'), __('the single photo in the style of a slideshow.', 'wp-photo-album-plus'), __('the fs photo with download and print buttons.', 'wp-photo-album-plus'), __('a plain page without a querystring.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus')); $vals = array('none', 'file', 'album', 'thumbalbum', 'photo', 'slidealbum', 'single', 'slphoto', 'fullpopup', 'plainpage', 'lightbox'); $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_ltlp'; $onchange = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = 'wppa_ltlb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'widget,link,thumb'; wppa_setting($slug, '6a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('CommentWidget', 'wp-photo-album-plus'); $desc = __('Comment widget photo link.', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link the comment widget photos point to.', 'wp-photo-album-plus')); $slug1 = 'wppa_comment_widget_linktype'; $slug2 = 'wppa_comment_widget_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_comment_blank'; $slug4 = 'wppa_comment_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckCommentLink();'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('the content of the virtual comten album.', 'wp-photo-album-plus'), __('the content of the thumbnails album.', 'wp-photo-album-plus'), __('the full size photo in a slideshow.', 'wp-photo-album-plus'), __('the thumbnails album in a slideshow.', 'wp-photo-album-plus'), __('the fullsize photo on its own.', 'wp-photo-album-plus'), __('the single photo in the style of a slideshow.', 'wp-photo-album-plus'), __('the fs photo with download and print buttons.', 'wp-photo-album-plus'), __('a plain page without a querystring.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus')); $vals = array('none', 'file', 'album', 'thumbalbum', 'photo', 'slidealbum', 'single', 'slphoto', 'fullpopup', 'plainpage', 'lightbox'); $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_cmlp'; $onchange = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = 'wppa_cmlb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'widget,link,thumb,comment'; wppa_setting($slug, '7a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('FeaTenWidget', 'wp-photo-album-plus'); $desc = __('FeaTen widget photo link.', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link the featured ten photos point to.', 'wp-photo-album-plus')); $slug1 = 'wppa_featen_widget_linktype'; $slug2 = 'wppa_featen_widget_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_featen_blank'; $slug4 = 'wppa_featen_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckFeaTenLink();'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('the content of the virtual featen album.', 'wp-photo-album-plus'), __('the content of the thumbnails album.', 'wp-photo-album-plus'), __('the full size photo in a slideshow.', 'wp-photo-album-plus'), __('the thumbnails album in a slideshow.', 'wp-photo-album-plus'), __('the fullsize photo on its own.', 'wp-photo-album-plus'), __('the single photo in the style of a slideshow.', 'wp-photo-album-plus'), __('the fs photo with download and print buttons.', 'wp-photo-album-plus'), __('a plain page without a querystring.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus')); $vals = array('none', 'file', 'album', 'thumbalbum', 'photo', 'slidealbum', 'single', 'slphoto', 'fullpopup', 'plainpage', 'lightbox'); $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_ftlp'; $onchange = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = 'wppa_ftlb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'widget,link,thumb'; wppa_setting($slug, '8a,b,c,d', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('B', '4', __('Links from other WPPA+ images', 'wp-photo-album-plus')); $name = __('Cover Image', 'wp-photo-album-plus'); $desc = __('The link from the cover image of an album.', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link the coverphoto points to.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('The link from the album title can be configured on the Edit Album page.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('This link will be used for the photo also if you select: same as title.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If you specify New Tab on this line, all links from the cover will open a new tab,', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('except when Ajax is activated on Table IV-A1.', 'wp-photo-album-plus')); $slug1 = 'wppa_coverimg_linktype'; $slug2 = 'wppa_coverimg_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_coverimg_blank'; $slug4 = 'wppa_coverimg_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckCoverImg()'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('same as title.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus'), __('a slideshow starting at the photo', 'wp-photo-album-plus')); $vals = array('none', 'file', 'same', 'lightbox', 'slideshowstartatimage'); $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = ''; $html2 = ''; $clas = 'wppa_covimgbl'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'link,cover'; wppa_setting($slug, '1a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Thumbnail', 'wp-photo-album-plus'); $desc = __('Thumbnail link.', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link you want, or no link at all.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('If you select the fullsize photo on its own, it will be stretched to fit, regardless of that setting.', 'wp-photo-album-plus')); /* oneofone is treated as portrait only */ $help .= '\\n' . esc_js(__('Note that a page must have at least [wppa][/wppa] in its content to show up the photo(s).', 'wp-photo-album-plus')); $slug1 = 'wppa_thumb_linktype'; $slug2 = 'wppa_thumb_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_thumb_blank'; $slug4 = 'wppa_thumb_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckThumbLink()'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('the full size photo in a slideshow.', 'wp-photo-album-plus'), __('the thumbnails album in a slideshow.', 'wp-photo-album-plus'), __('the fullsize photo on its own.', 'wp-photo-album-plus'), __('the single photo in the style of a slideshow.', 'wp-photo-album-plus'), __('the fs photo with download and print buttons.', 'wp-photo-album-plus'), __('a plain page without a querystring.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus')); $vals = array('none', 'file', 'photo', 'slidealbum', 'single', 'slphoto', 'fullpopup', 'plainpage', 'lightbox'); if (wppa_switch('auto_page')) { $opts[] = __('Auto Page', 'wp-photo-album-plus'); $vals[] = 'autopage'; } $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_tlp'; $html2 = wppa_select($slug2, $options_page_post, $values_page_post, '', $clas); $clas = 'wppa_tlb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $htmlerr = wppa_htmlerr('popup-lightbox'); $html = array($html1, $htmlerr . $html2, $html3, $html4); $clas = 'tt_always'; $clas = ''; $tags = 'link,thumb'; wppa_setting($slug, '2a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Sphoto', 'wp-photo-album-plus'); $desc = __('Single photo link.', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link you want, or no link at all.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('If you select the fullsize photo on its own, it will be stretched to fit, regardless of that setting.', 'wp-photo-album-plus')); /* oneofone is treated as portrait only */ $help .= '\\n' . esc_js(__('Note that a page must have at least [wppa][/wppa] in its content to show up the photo(s).', 'wp-photo-album-plus')); $slug1 = 'wppa_sphoto_linktype'; $slug2 = 'wppa_sphoto_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_sphoto_blank'; $slug4 = 'wppa_sphoto_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckSphotoLink(); wppaCheckLinkPageErr(\'sphoto\');'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('the content of the album.', 'wp-photo-album-plus'), __('the full size photo in a slideshow.', 'wp-photo-album-plus'), __('the fullsize photo on its own.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus')); $vals = array('none', 'file', 'album', 'photo', 'single', 'lightbox'); $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_slp'; $onchange = 'wppaCheckLinkPageErr(\'sphoto\');'; $html2 = wppa_select($slug2, $options_page, $values_page, $onchange, $clas, true); $clas = 'wppa_slb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $htmlerr = wppa_htmlerr('sphoto'); $html = array($html1, $htmlerr . $html2, $html3, $html4); $clas = ''; $tags = 'link'; wppa_setting($slug, '3a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Mphoto', 'wp-photo-album-plus'); $desc = __('Media-like photo link.', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link you want, or no link at all.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('If you select the fullsize photo on its own, it will be stretched to fit, regardless of that setting.', 'wp-photo-album-plus')); /* oneofone is treated as portrait only */ $help .= '\\n' . esc_js(__('Note that a page must have at least [wppa][/wppa] in its content to show up the photo(s).', 'wp-photo-album-plus')); $slug1 = 'wppa_mphoto_linktype'; $slug2 = 'wppa_mphoto_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_mphoto_blank'; $slug4 = 'wppa_mphoto_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckMphotoLink(); wppaCheckLinkPageErr(\'mphoto\');'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('the content of the album.', 'wp-photo-album-plus'), __('the full size photo in a slideshow.', 'wp-photo-album-plus'), __('the fullsize photo on its own.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus')); $vals = array('none', 'file', 'album', 'photo', 'single', 'lightbox'); $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_mlp'; $onchange = 'wppaCheckLinkPageErr(\'mphoto\');'; $html2 = wppa_select($slug2, $options_page, $values_page, $onchange, $clas, true); $clas = 'wppa_mlb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $htmlerr = wppa_htmlerr('mphoto'); $html = array($html1, $htmlerr . $html2, $html3, $html4); $clas = ''; $tags = 'link'; wppa_setting($slug, '4a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Xphoto', 'wp-photo-album-plus'); $desc = __('Extended Media-like photo link.', 'wp-photo-album-plus'); $help = esc_js(__('Select the type of link you want, or no link at all.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('If you select the fullsize photo on its own, it will be stretched to fit, regardless of that setting.', 'wp-photo-album-plus')); /* oneofone is treated as portrait only */ $help .= '\\n' . esc_js(__('Note that a page must have at least [wppa][/wppa] in its content to show up the photo(s).', 'wp-photo-album-plus')); $slug1 = 'wppa_xphoto_linktype'; $slug2 = 'wppa_xphoto_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_xphoto_blank'; $slug4 = 'wppa_xphoto_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckXphotoLink(); wppaCheckLinkPageErr(\'xphoto\');'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('the content of the album.', 'wp-photo-album-plus'), __('the full size photo in a slideshow.', 'wp-photo-album-plus'), __('the fullsize photo on its own.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus')); $vals = array('none', 'file', 'album', 'photo', 'single', 'lightbox'); $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_xlp'; $onchange = 'wppaCheckLinkPageErr(\'xphoto\');'; $html2 = wppa_select($slug2, $options_page, $values_page, $onchange, $clas, true); $clas = 'wppa_xlb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $htmlerr = wppa_htmlerr('xphoto'); $html = array($html1, $htmlerr . $html2, $html3, $html4); $clas = ''; $tags = 'link'; wppa_setting($slug, '4.1a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Slideshow', 'wp-photo-album-plus'); $desc = __('Slideshow fullsize link', 'wp-photo-album-plus'); $help = esc_js(__('You can overrule lightbox but not big browse buttons with the photo specifc link.', 'wp-photo-album-plus')); $help .= '\\n\\n* ' . esc_js(__('fullsize slideshow can only be set by the WPPA_SET shortcode.', 'wp-photo-album-plus')); $slug1 = 'wppa_slideshow_linktype'; $slug2 = 'wppa_slideshow_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_slideshow_blank'; $slug4 = 'wppa_slideshow_overrule'; $slug = array($slug1, $slug2, $slug3, $slug4); $onchange = 'wppaCheckSlidePhotoLink();'; $opts = array(__('no link at all.', 'wp-photo-album-plus'), __('the plain photo (file).', 'wp-photo-album-plus'), __('the fullsize photo on its own.', 'wp-photo-album-plus'), __('lightbox.', 'wp-photo-album-plus'), __('lightbox single photos.', 'wp-photo-album-plus'), __('the fs photo with download and print buttons.', 'wp-photo-album-plus'), __('the thumbnails.', 'wp-photo-album-plus'), __('fullsize slideshow', 'wp-photo-album-plus') . '*|'); $vals = array('none', 'file', 'single', 'lightbox', 'lightboxsingle', 'fullpopup', 'thumbs', 'slide'); $onchange = 'wppaCheckSlidePhotoLink();wppaCheckSlideVideoControls()'; $html1 = wppa_select($slug1, $opts, $vals, $onchange); $clas = 'wppa_sslp'; $html2 = wppa_select($slug2, $options_page_post, $values_page_post, $onchange, $clas); $clas = 'wppa_sslb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = wppa_checkbox($slug4); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'link,slide'; wppa_setting($slug, '5a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Film linktype', 'wp-photo-album-plus'); $desc = __('Direct access goto image in:', 'wp-photo-album-plus'); $help = esc_js(__('Select the action to be taken when the user clicks on a filmstrip image.', 'wp-photo-album-plus')); $slug1 = 'wppa_film_linktype'; $slug3 = 'wppa_film_blank'; $slug4 = 'wppa_film_overrule'; $opts = array(__('slideshow window', 'wp-photo-album-plus'), __('lightbox overlay', 'wp-photo-album-plus')); $vals = array('slideshow', 'lightbox'); $html1 = wppa_select($slug1, $opts, $vals); $html2 = ''; $html3 = wppa_checkbox($slug3); $html4 = wppa_checkbox($slug4); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'link,slide'; wppa_setting($slug, '6a,,c,d', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('C', '4', __('Other links', 'wp-photo-album-plus')); $name = __('Download Link (aka Art Monkey link)', 'wp-photo-album-plus'); $desc = __('Makes the photo name a download button.', 'wp-photo-album-plus'); $help = esc_js(__('Link Photo name in slideshow to file or zip with photoname as filename.', 'wp-photo-album-plus')); $slug = 'wppa_art_monkey_link'; $opts = array(__('--- none ---', 'wp-photo-album-plus'), __('image file', 'wp-photo-album-plus'), __('zipped image', 'wp-photo-album-plus')); $vals = array('none', 'file', 'zip'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'link'; wppa_setting($slug, '1', $name, $desc, $html . '</td><td></td><td></td><td>', $help, $clas, $tags); $name = __('Art Monkey Source', 'wp-photo-album-plus'); $desc = __('Use Source file for art monkey link if available.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_artmonkey_use_source'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'link'; wppa_setting($slug, '1.1', $name, $desc, $html . '</td><td></td><td></td><td>', $help, $clas, $tags); $name = __('Art Monkey Display', 'wp-photo-album-plus'); $desc = __('Select button or link ( text ).', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_art_monkey_display'; $opts = array(__('Button', 'wp-photo-album-plus'), __('Textlink', 'wp-photo-album-plus')); $vals = array('button', 'text'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'link,layout'; wppa_setting($slug, '1.2', $name, $desc, $html . '</td><td></td><td></td><td>', $help, $clas, $tags); $name = __('Popup Download Link', 'wp-photo-album-plus'); $desc = __('Configure the download link on fullsize popups.', 'wp-photo-album-plus'); $help = esc_js(__('Link fullsize popup download button to either image or zip file.', 'wp-photo-album-plus')); $slug = 'wppa_art_monkey_popup_link'; $opts = array(__('image file', 'wp-photo-album-plus'), __('zipped image', 'wp-photo-album-plus')); $vals = array('file', 'zip'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'link,layout'; wppa_setting($slug, '1.3', $name, $desc, $html . '</td><td></td><td></td><td>', $help, $clas, $tags); $name = __('Download link on lightbox', 'wp-photo-album-plus'); $desc = __('Art monkey link on lightbox photo names.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_art_monkey_on_lightbox'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'link,layout'; wppa_setting($slug, '1.4', $name, $desc, $html . '</td><td></td><td></td><td>', $help, $clas, $tags); $name = __('Album download link', 'wp-photo-album-plus'); $desc = __('Place an album download link on the album covers', 'wp-photo-album-plus'); $help = esc_js(__('Creates a download zipfile containing the photos of the album', 'wp-photo-album-plus')); $slug = 'wppa_allow_download_album'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'link,layout,cover,album'; wppa_setting($slug, '2', $name, $desc, $html . '</td><td></td><td></td><td>', $help, $clas, $tags); $name = __('Album download Source', 'wp-photo-album-plus'); $desc = __('Use Source file for album download link if available.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_download_album_source'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'link'; wppa_setting($slug, '2.1', $name, $desc, $html . '</td><td></td><td></td><td>', $help, $clas, $tags); $name = __('Tagcloud Link', 'wp-photo-album-plus'); $desc = __('Configure the link from the tags in the tag cloud.', 'wp-photo-album-plus'); $help = esc_js(__('Link the tag words to ether the thumbnails or the slideshow.', 'wp-photo-album-plus')); $slug1 = 'wppa_tagcloud_linktype'; $slug2 = 'wppa_tagcloud_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_tagcloud_blank'; $slug4 = 'wppa_tagcloud_linkpage_oc'; $slug = array($slug1, $slug2, $slug3, $slug4); $opts1 = array(__('thumbnails', 'wp-photo-album-plus'), __('slideshow', 'wp-photo-album-plus')); $vals1 = array('album', 'slide'); $opts4 = array('1', '2', '3', '4', '5'); $vals4 = array('1', '2', '3', '4', '5'); $onchange = 'wppaCheckTagLink();'; $html1 = wppa_select($slug1, $opts1, $vals1, $onchange); $clas = 'wppa_tglp'; $onchange = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = 'wppa_tglb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = '<div style="font-size:9px;foat:left;" class="' . $clas . '" >' . __('Occur', 'wp-photo-album-plus') . '</div>' . wppa_select($slug4, $opts4, $vals4, '', $clas); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'link'; wppa_setting($slug, '3a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Multitag Link', 'wp-photo-album-plus'); $desc = __('Configure the link from the multitag selection.', 'wp-photo-album-plus'); $help = esc_js(__('Link to ether the thumbnails or the slideshow.', 'wp-photo-album-plus')); $slug1 = 'wppa_multitag_linktype'; $slug2 = 'wppa_multitag_linkpage'; wppa_verify_page($slug2); $slug3 = 'wppa_multitag_blank'; $slug4 = 'wppa_multitag_linkpage_oc'; $slug = array($slug1, $slug2, $slug3, $slug4); $opts1 = array(__('thumbnails', 'wp-photo-album-plus'), __('slideshow', 'wp-photo-album-plus')); $vals1 = array('album', 'slide'); $opts4 = array('1', '2', '3', '4', '5'); $vals4 = array('1', '2', '3', '4', '5'); $onchange = 'wppaCheckMTagLink();'; $html1 = wppa_select($slug1, $opts1, $vals1, $onchange); $clas = 'wppa_tglp'; $onchange = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = 'wppa_tglb'; $html3 = wppa_checkbox($slug3, '', $clas); $html4 = '<div style="font-size:9px;foat:left;" class="' . $clas . '" >' . __('Occur', 'wp-photo-album-plus') . '</div>' . wppa_select($slug4, $opts4, $vals4, '', $clas); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'link'; wppa_setting($slug, '4a,b,c,d', $name, $desc, $html, $help, $clas, $tags); $name = __('Super View Landing', 'wp-photo-album-plus'); $desc = __('The landing page for the Super View widget.', 'wp-photo-album-plus'); $help = ''; $slug1 = ''; $slug2 = 'wppa_super_view_linkpage'; wppa_verify_page($slug2); $slug3 = ''; $slug4 = ''; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = __('Defined by the visitor', 'wp-photo-album-plus'); $clas = ''; $onchange = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = ''; $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'link'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Uploader Landing', 'wp-photo-album-plus'); $desc = __('Select the landing page for the Uploader Widget', 'wp-photo-album-plus'); $help = ''; $slug1 = ''; $slug2 = 'wppa_upldr_widget_linkpage'; wppa_verify_page($slug2); $slug3 = ''; $slug4 = ''; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = ''; $clas = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = ''; $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'link'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Bestof Landing', 'wp-photo-album-plus'); $desc = __('Select the landing page for the BestOf Widget / Box', 'wp-photo-album-plus'); $help = ''; $slug1 = ''; $slug2 = 'wppa_bestof_widget_linkpage'; wppa_verify_page($slug2); $slug3 = ''; $slug4 = ''; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = ''; $clas = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = ''; $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'link'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Album navigator Link', 'wp-photo-album-plus'); $desc = __('Select link type and page for the Album navigator Widget', 'wp-photo-album-plus'); $help = ''; $slug1 = 'wppa_album_navigator_widget_linktype'; $slug2 = 'wppa_album_navigator_widget_linkpage'; wppa_verify_page($slug2); $slug3 = ''; $slug4 = ''; $slug = array($slug1, $slug2, $slug3, $slug4); $opts = array(__('thumbnails', 'wp-photo-album-plus'), __('slideshow', 'wp-photo-album-plus')); $vals = array('thumbs', 'slide'); $html1 = wppa_select($slug1, $opts, $vals); $clas = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = ''; $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'link'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Supersearch Landing', 'wp-photo-album-plus'); $desc = __('Select the landing page for the Supersearch Box', 'wp-photo-album-plus'); $help = ''; $slug1 = ''; $slug2 = 'wppa_supersearch_linkpage'; wppa_verify_page($slug2); $slug3 = ''; $slug4 = ''; $slug = array($slug1, $slug2, $slug3, $slug4); $html1 = ''; $clas = ''; $html2 = wppa_select($slug2, $options_page_auto, $values_page, $onchange, $clas); $clas = ''; $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'link'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('SM widget return', 'wp-photo-album-plus'); $desc = __('Select the return link for social media from widgets', 'wp-photo-album-plus'); $help = esc_js(__('If you select Landing page, and it wont work, it may be required to set the Occur to the sequence number of the landing shortcode on the page.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Normally it is 1, but you can try 2 etc. Always create a new shared link to test a setting.', 'wp-photo-album-plus')); $slug1 = 'wppa_widget_sm_linktype'; $slug2 = 'wppa_widget_sm_linkpage'; wppa_verify_page($slug2); $slug3 = ''; $slug4 = 'wppa_widget_sm_linkpage_oc'; $slug = array($slug1, $slug2, $slug3, $slug4); $opts = array(__('Home page', 'wp-photo-album-plus'), __('Landing page', 'wp-photo-album-plus')); $vals = array('home', 'landing'); $onchange = 'wppaCheckSmWidgetLink();'; $clas = 'wppa_smrt'; $html1 = wppa_select($slug1, $opts, $vals, $onchange, $clas); $clas = 'wppa_smrp'; $html2 = wppa_select($slug2, $options_page_auto, $values_page, '', $clas); $html3 = '<div style="font-size:9px;foat:left;" class="' . $clas . '" >' . __('Occur', 'wp-photo-album-plus') . '</div>'; $html4 = wppa_select($slug4, array('1', '2', '3', '4', '5'), array('1', '2', '3', '4', '5'), '', $clas); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'link'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Album cover subalbums link', 'wp-photo-album-plus'); $desc = __('Select the linktype and display type for sub-albums on parent album covers.', 'wp-photo-album-plus'); $help = ''; $slug1 = 'wppa_cover_sublinks'; $slug2 = 'wppa_cover_sublinks_display'; $slug3 = ''; $slug4 = ''; $slug = array($slug1, $slug2, $slug3, $slug4); $opts = array(__('No link at all', 'wp-photo-album-plus'), __('Thumbnails and covers', 'wp-photo-album-plus'), __('Slideshow or covers', 'wp-photo-album-plus')); $vals = array('none', 'content', 'slide'); $clas = ''; $html1 = wppa_select($slug1, $opts, $vals, $onchange, $clas); $opts = array(__('No display at all', 'wp-photo-album-plus'), __('A list with sub(sub) albums', 'wp-photo-album-plus'), __('A list of children only', 'wp-photo-album-plus'), __('An enumeration of names', 'wp-photo-album-plus'), __('Micro thumbnails', 'wp-photo-album-plus')); $vals = array('none', 'recursivelist', 'list', 'enum', 'microthumbs'); $html2 = wppa_select($slug2, $opts, $vals, $onchange, $clas); $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'link'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); ?> </tbody> <tfoot style="font-weight: bold;" class="wppa_table_6"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Link type', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Link page', 'wp-photo-album-plus'); ?> </td> <td><?php _e('New tab', 'wp-photo-album-plus'); ?> </td> <th scope="col" title="<?php _e('Photo specific link overrules', 'wp-photo-album-plus'); ?> " style="cursor: default"><?php _e('PSO', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </tfoot> </table> </div> <?php // Table 7: Security ?> <?php wppa_settings_box_header('7', __('Table VII:', 'wp-photo-album-plus') . ' ' . __('Permissions and Restrictions:', 'wp-photo-album-plus') . ' ' . __('This table describes the access settings for admin and front-end activities.', 'wp-photo-album-plus')); ?> <div id="wppa_table_7" style="display:none" > <table class="widefat wppa-table wppa-setting-table" style="padding-bottom:0; margin-bottom:0;" > <thead style="font-weight: bold; " class="wppa_table_7"> <tr> <?php $wppacaps = array('wppa_admin', 'wppa_upload', 'wppa_import', 'wppa_moderate', 'wppa_export', 'wppa_settings', 'wppa_potd', 'wppa_comments', 'wppa_help'); $wppanames = array(__('Album Admin', 'wp-photo-album-plus'), __('Upload Photos', 'wp-photo-album-plus'), __('Import Photos', 'wp-photo-album-plus'), __('Moderate P+C', 'wp-photo-album-plus'), __('Export Photos', 'wp-photo-album-plus'), __('Settings', 'wp-photo-album-plus'), __('Photo of the day', 'wp-photo-album-plus'), __('Comment Admin', 'wp-photo-album-plus'), __('Help & Info', 'wp-photo-album-plus')); echo '<td>' . __('Role', 'wp-photo-album-plus') . '</td>'; for ($i = 0; $i < count($wppacaps); $i++) { echo '<td style="width:11%;">' . $wppanames[$i] . '</td>'; } ?> </tr> </thead> <tbody class="wppa_table_7"> <?php $wppa_table = 'VII'; wppa_setting_subheader('A', '6', __('Admin settings per user role. Enabling these settings will overrule the front-end settings for the specific user role', 'wp-photo-album-plus')); $tags = 'access,system'; $roles = $wp_roles->roles; foreach (array_keys($roles) as $key) { $role = $roles[$key]; echo '<tr class="wppa-VII-A wppa-none ' . wppa_tags_to_clas($tags) . '" ><td>' . $role['name'] . '</td>'; $caps = $role['capabilities']; for ($i = 0; $i < count($wppacaps); $i++) { if (isset($caps[$wppacaps[$i]])) { $yn = $caps[$wppacaps[$i]] ? true : false; } else { $yn = false; } $enabled = $key != 'administrator'; echo '<td>' . wppa_checkbox_e('caps-' . $wppacaps[$i] . '-' . $key, $yn, '', '', $enabled) . '</td>'; } echo '</tr>'; } ?> </tbody> </table> <table class="widefat wppa-table wppa-setting-table" style="margin-top:-2px;padding-top:0;" > <tbody class="wppa_table_7"> <?php wppa_setting_subheader('B', '2', __('Frontend create Albums and upload Photos enabling and limiting settings', 'wp-photo-album-plus')); $name = __('User create Albums', 'wp-photo-album-plus'); $desc = __('Enable frontend album creation.', 'wp-photo-album-plus'); $help = esc_js(__('If you check this item, frontend album creation will be enabled.', 'wp-photo-album-plus')); $slug = 'wppa_user_create_on'; $onchange = ''; //wppaCheckUserUpload()'; $html1 = wppa_checkbox($slug, $onchange); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,album'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('User edit album', 'wp-photo-album-plus'); $desc = __('Enable frontend edit album name and description.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_user_album_edit_on'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,album'; wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags); $name = __('User delete Albums', 'wp-photo-album-plus'); $desc = __('Enable frontend album deletion', 'wp-photo-album-plus'); $help = esc_js(__('If you check this item, frontend album deletion will be enabled.', 'wp-photo-album-plus')); $slug = 'wppa_user_destroy_on'; $onchange = ''; $html1 = wppa_checkbox($slug, $onchange); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,album'; wppa_setting($slug, '1.2', $name, $desc, $html, $help, $clas, $tags); $name = __('User create Albums login', 'wp-photo-album-plus'); $desc = __('Frontend album creation requires the user is logged in.', 'wp-photo-album-plus'); $help = ''; //esc_js(__('If you uncheck this box, make sure you check the item Owners only in the next sub-table.')); // $help .= '\n'.esc_js(__('Set the owner to ---public--- of the albums that are allowed to be uploaded to.')); $slug = 'wppa_user_create_login'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,album'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('User create Albums Captcha', 'wp-photo-album-plus'); $desc = __('Uer must answer security question.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_user_create_captcha'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,album'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); // User upload limits $options = array(__('for ever', 'wp-photo-album-plus'), __('per hour', 'wp-photo-album-plus'), __('per day', 'wp-photo-album-plus'), __('per week', 'wp-photo-album-plus'), __('per month', 'wp-photo-album-plus'), __('per year', 'wp-photo-album-plus')); // 364 days $values = array('0', '3600', '86400', '604800', '2592000', '31449600'); $roles = $wp_roles->roles; $roles['loggedout'] = ''; unset($roles['administrator']); foreach (array_keys($roles) as $role) { if (get_option('wppa_' . $role . '_upload_limit_count', 'nil') == 'nil') { update_option('wppa_' . $role . '_upload_limit_count', '0'); } if (get_option('wppa_' . $role . '_upload_limit_time', 'nil') == 'nil') { update_option('wppa_' . $role . '_upload_limit_time', '0'); } $name = sprintf(__('Upload limit %s', 'wp-photo-album-plus'), $role); if ($role == 'loggedout') { $desc = __('Limit upload capacity for logged out users.', 'wp-photo-album-plus'); } else { $desc = sprintf(__('Limit upload capacity for the user role %s.', 'wp-photo-album-plus'), $role); } if ($role == 'loggedout') { $help = esc_js(__('This setting has only effect when Table VII-B2 is unchecked.', 'wp-photo-album-plus')); } else { $help = esc_js(__('This limitation only applies to frontend uploads when the same userrole does not have the Upload checkbox checked in Table VII-A.', 'wp-photo-album-plus')); } $help .= '\\n' . esc_js(__('A value of 0 means: no limit.', 'wp-photo-album-plus')); $slug1 = 'wppa_' . $role . '_upload_limit_count'; $html1 = wppa_input($slug1, '50px', '', __('photos', 'wp-photo-album-plus')); $slug2 = 'wppa_' . $role . '_upload_limit_time'; $html2 = wppa_select($slug2, $options, $values); $html = array($html1, $html2); $clas = ''; $tags = 'access,upload'; wppa_setting(false, '5.' . $role, $name, $desc, $html, $help, $clas, $tags); } foreach (array_keys($roles) as $role) { if (get_option('wppa_' . $role . '_album_limit_count', 'nil') == 'nil') { update_option('wppa_' . $role . '_album_limit_count', '0'); } $name = sprintf(__('Album limit %s', 'wp-photo-album-plus'), $role); $desc = sprintf(__('Limit number of albums for the user role %s.', 'wp-photo-album-plus'), $role); $help = esc_js(__('This limitation only applies to frontend create albums when the same userrole does not have the Album admin checkbox checked in Table VII-A.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('A value of 0 means: no limit.', 'wp-photo-album-plus')); $slug1 = 'wppa_' . $role . '_album_limit_count'; $html1 = wppa_input($slug1, '50px', '', __('albums', 'wp-photo-album-plus')); $slug2 = ''; $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,album'; wppa_setting(false, '5a.' . $role, $name, $desc, $html, $help, $clas, $tags); } $name = __('Upload one only', 'wp-photo-album-plus'); $desc = __('Non admin users can upload only one photo at a time.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_upload_one_only'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,upload'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Upload moderation', 'wp-photo-album-plus'); $desc = __('Uploaded photos need moderation.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, photos uploaded by users who do not have photo album admin access rights need moderation.', 'wp-photo-album-plus')); $help .= esc_js(__('Users who have photo album admin access rights can change the photo status to publish or featured.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('You can set the album admin access rights in Table VII-A.', 'wp-photo-album-plus')); $slug = 'wppa_upload_moderate'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'upload'; wppa_setting($slug, '7.0', $name, $desc, $html, $help, $clas, $tags); $name = __('FE Upload private', 'wp-photo-album-plus'); $desc = __('Front-end uploaded photos status is set to private.', 'wp-photo-album-plus'); $help = esc_js(__('This setting overrules VI-B7.0.', 'wp-photo-album-plus')); $slug = 'wppa_fe_upload_private'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'upload'; wppa_setting($slug, '7.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Upload notify', 'wp-photo-album-plus'); $desc = __('Notify admin at frontend upload.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, admin will receive a notification by email.', 'wp-photo-album-plus')); $slug = 'wppa_upload_notify'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'upload'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Upload backend notify', 'wp-photo-album-plus'); $desc = __('Notify admin at backend upload.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, admin will receive a notification by email.', 'wp-photo-album-plus')); $slug = 'wppa_upload_backend_notify'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'upload'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Max size in pixels', 'wp-photo-album-plus'); $desc = __('Max size for height and width for front-end uploads.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the maximum size. 0 is unlimited', 'wppa', 'wp-photo-album-plus')); $slug = 'wppa_upload_fronend_maxsize'; $html1 = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'upload'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Home after Upload', 'wp-photo-album-plus'); $desc = __('After successfull front-end upload, go to the home page.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_home_after_upload'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'upload'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Fe alert', 'wp-photo-album-plus'); $desc = __('Show alertbox on successful front-end upload/create.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_fe_alert'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'upload'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Max fe upload albums', 'wp-photo-album-plus'); $desc = __('Max number of albums in frontend upload selection box.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_fe_upload_max_albums'; $opts = array('0', '10', '20', '50', '100', '200', '500', '1000'); $vals = $opts; $html1 = wppa_select($slug, $opts, $vals); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'upload'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('C', '2', __('Admin Functionality restrictions for non administrators', 'wp-photo-album-plus')); $name = __('Alt thumb is restricted', 'wp-photo-album-plus'); $desc = __('Using <b>alt thumbsize</b> is a restricted action.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: alt thumbsize can not be set in album admin by users not having admin rights.', 'wp-photo-album-plus')); $slug = 'wppa_alt_is_restricted'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,thumb'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Link is restricted', 'wp-photo-album-plus'); $desc = __('Using <b>Link to</b> is a restricted action.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: Link to: can not be set in album admin by users not having admin rights.', 'wp-photo-album-plus')); $slug = 'wppa_link_is_restricted'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,link'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('CoverType is restricted', 'wp-photo-album-plus'); $desc = __('Changing <b>Cover Type</b> is a restricted action.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: Cover Type: can not be set in album admin by users not having admin rights.', 'wp-photo-album-plus')); $slug = 'wppa_covertype_is_restricted'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,cover'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Photo order# is restricted', 'wp-photo-album-plus'); $desc = __('Changing <b>Photo sort order #</b> is a restricted action.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: Photo sort order #: can not be set in photo admin by users not having admin rights.', 'wp-photo-album-plus')); $slug = 'wppa_porder_restricted'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Change source restricted', 'wp-photo-album-plus'); $desc = __('Changing the import source dir requires admin rights.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the imput source for importing photos and albums is restricted to user role administrator.', 'wp-photo-album-plus')); $slug = 'wppa_chgsrc_is_restricted'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Extended status restricted', 'wp-photo-album-plus'); $desc = __('Setting status other than pending or publish requires admin rights.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_ext_status_restricted'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Photo description restricted', 'wp-photo-album-plus'); $desc = __('Edit photo description requires admin rights.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_desc_is_restricted'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Update photofiles restricted', 'wp-photo-album-plus'); $desc = __('Re-upload files requires admin rights', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_reup_is_restricted'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('D', '2', __('Miscellaneous limiting settings', 'wp-photo-album-plus')); $name = __('Owners only', 'wp-photo-album-plus'); $desc = __('Limit edit album access to the album owners only.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, non-admin users can edit their own albums only.', 'wp-photo-album-plus')); $slug = 'wppa_owner_only'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system'; wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Upload Owners only', 'wp-photo-album-plus'); $desc = __('Limit uploads to the album owners only.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, users can upload to their own own albums and --- public --- only.', 'wp-photo-album-plus')); $slug = 'wppa_upload_owner_only'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system,upload'; wppa_setting($slug, '1.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Frontend Edit', 'wp-photo-album-plus'); $desc = __('Allow the uploader to edit the photo info', 'wp-photo-album-plus'); $help = esc_js(__('If selected, any logged in user who meets the criteria has the capability to edit the photo information.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Note: This may be AFTER moderation!!', 'wp-photo-album-plus')); $slug = 'wppa_upload_edit'; $opts = array(__('--- none ---', 'wp-photo-album-plus'), __('Classic', 'wp-photo-album-plus'), __('New style', 'wp-photo-album-plus')); $vals = array('none', 'classic', 'new'); $html1 = wppa_select($slug, $opts, $vals); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system,upload'; wppa_setting($slug, '2.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Fe Edit users', 'wp-photo-album-plus'); $desc = __('The criteria the user must meet to edit photo info', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_upload_edit_users'; $opts = array(__('Admin and superuser', 'wp-photo-album-plus'), __('Owner, admin and superuser', 'wp-photo-album-plus')); $vals = array('admin', 'owner'); //array( 'owner','equalname' ); $html1 = wppa_select($slug, $opts, $vals); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system,upload'; wppa_setting($slug, '2.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Fe Edit Theme CSS', 'wp-photo-album-plus'); $desc = __('The front-end edit photo dialog uses the theme CSS.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_upload_edit_theme_css'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'layout,system,upload'; wppa_setting($slug, '2.3', $name, $desc, $html, $help, $clas, $tags); $name = __('Fe Edit New Items', 'wp-photo-album-plus'); $desc = __('The items that are fe editable', 'wp-photo-album-plus'); $help = esc_js(__('See also Table II-J10!', 'wp-photo-album-plus')); $slug1 = 'wppa_fe_edit_name'; $slug2 = 'wppa_fe_edit_desc'; $slug3 = 'wppa_fe_edit_tags'; $html1 = ' <span style="float:left" >' . __('Name', 'wp-photo-album-plus') . ':</span>' . wppa_checkbox($slug1); $html2 = ' <span style="float:left" >' . __('Description', 'wp-photo-album-plus') . ':</span>' . wppa_checkbox($slug2); $html3 = ' <span style="float:left" >' . __('Tags', 'wp-photo-album-plus') . ':</span>' . wppa_checkbox($slug3); $html9 = ''; $html = array($html1 . $html2 . $html3, $html9); $clas = ''; $tags = 'upload'; wppa_setting($slug1, '2.4', $name, $desc, $html, $help, $clas, $tags); $name = __('Fe Edit Button text', 'wp-photo-album-plus'); $desc = __('The text on the Edit button.', 'wp-photo-album-plus'); $hep = ''; $slug = 'wppa_fe_edit_button'; $html1 = wppa_edit($slug, get_option($slug), '300px'); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'layout,system,upload'; wppa_setting($slug1, '2.5', $name, $desc, $html, $help, $clas, $tags); $name = __('Fe Edit Dialog caption', 'wp-photo-album-plus'); $desc = __('The text on the header of the popup.', 'wp-photo-album-plus'); $hep = ''; $slug = 'wppa_fe_edit_caption'; $html1 = wppa_edit($slug, get_option($slug), '300px'); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'layout,system,upload'; wppa_setting($slug1, '2.6', $name, $desc, $html, $help, $clas, $tags); $name = __('Frontend Delete', 'wp-photo-album-plus'); $desc = __('Allow the uploader to delete the photo', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_upload_delete'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system,upload'; wppa_setting($slug, '2.7', $name, $desc, $html, $help, $clas, $tags); $name = __('Uploader Moderate Comment', 'wp-photo-album-plus'); $desc = __('The owner of the photo can moderate the photos comments.', 'wp-photo-album-plus'); $help = esc_js(__('This setting requires "Uploader edit" to be enabled also.', 'wp-photo-album-plus')); $slug = 'wppa_owner_moderate_comment'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system,upload,comment'; wppa_setting($slug, '2.9', $name, $desc, $html, $help, $clas, $tags); $name = __('Upload memory check frontend', 'wp-photo-album-plus'); $desc = __('Disable uploading photos that are too large.', 'wp-photo-album-plus'); $help = esc_js(__('To prevent out of memory crashes during upload and possible database inconsistencies, uploads can be prevented if the photos are too big.', 'wp-photo-album-plus')); $slug = 'wppa_memcheck_frontend'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system,upload'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Upload memory check admin', 'wp-photo-album-plus'); $desc = __('Disable uploading photos that are too large.', 'wp-photo-album-plus'); $help = esc_js(__('To prevent out of memory crashes during upload and possible database inconsistencies, uploads can be prevented if the photos are too big.', 'wp-photo-album-plus')); $slug = 'wppa_memcheck_admin'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system,upload'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Comment captcha', 'wp-photo-album-plus'); $desc = __('Use a simple calculate captcha on comments form.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_comment_captcha'; $opts = array(__('All users', 'wp-photo-album-plus'), __('Logged out users', 'wp-photo-album-plus'), __('No users', 'wp-photo-album-plus')); $vals = array('all', 'logout', 'none'); $html1 = wppa_select($slug, $opts, $vals); $clas = 'wppa_comment_'; $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system,comment'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Spam lifetime', 'wp-photo-album-plus'); $desc = __('Delete spam comments when older than.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_spam_maxage'; $options = array(__('--- off ---', 'wp-photo-album-plus'), sprintf(_n('%d minute', '%d minutes', '10', 'wp-photo-album-plus'), '10'), sprintf(_n('%d minute', '%d minutes', '30', 'wp-photo-album-plus'), '30'), sprintf(_n('%d hour', '%d hours', '1', 'wp-photo-album-plus'), '1'), sprintf(_n('%d day', '%d days', '1', 'wp-photo-album-plus'), '1'), sprintf(_n('%d week', '%d weeks', '1', 'wp-photo-album-plus'), '1')); $values = array('none', '600', '1800', '3600', '86400', '604800'); $html1 = wppa_select($slug, $options, $values); $clas = 'wppa_comment_'; $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system,comment'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Avoid duplicates', 'wp-photo-album-plus'); $desc = __('Prevent the creation of duplicate photos.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: uploading, importing, copying or moving photos to other albums will be prevented when the desitation album already contains a photo with the same filename.', 'wp-photo-album-plus')); $slug = 'wppa_void_dups'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'system,upload'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Blacklist user', 'wp-photo-album-plus'); $desc = __('Set the status of all the users photos to \'pending\'.', 'wp-photo-album-plus'); $help = esc_js(__('Set the status of all the users photos to \'pending\'.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Also inhibits further uploads.', 'wp-photo-album-plus')); $slug = 'wppa_blacklist_user'; // $users = wppa_get_users(); // Already known $blacklist = get_option('wppa_black_listed_users', array()); if (wppa_get_user_count() <= wppa_opt('max_users')) { $options = array(__('--- select a user to blacklist ---', 'wp-photo-album-plus')); $values = array('0'); foreach ($users as $usr) { if (!wppa_user_is('administrator', $usr['ID'])) { // an administrator can not be blacklisted if (!in_array($usr['user_login'], $blacklist)) { // skip already on blacklist $options[] = $usr['display_name'] . ' (' . $usr['user_login'] . ')'; $values[] = $usr['user_login']; } } } $onchange = 'alert(\'' . __('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus') . '\');wppaRefreshAfter();'; $html1 = wppa_select($slug, $options, $values, $onchange); $html2 = ''; } else { // over 1000 users $onchange = 'alert(\'' . __('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus') . '\');wppaRefreshAfter();'; $html1 = __('User login name <b>( case sensitive! )</b>:', 'wp-photo-album-plus'); $html2 = wppa_input($slug, '150px', '', '', $onchange); } $html = array($html1, $html2); $clas = ''; $tags = 'access,system'; wppa_setting(false, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Unblacklist user', 'wp-photo-album-plus'); $desc = __('Set the status of all the users photos to \'publish\'.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_un_blacklist_user'; $blacklist = get_option('wppa_black_listed_users', array()); $options = array(__('--- select a user to unblacklist ---', 'wp-photo-album-plus')); $values = array('0'); foreach ($blacklist as $usr) { $u = get_user_by('login', $usr); $options[] = $u->display_name . ' (' . $u->user_login . ')'; $values[] = $u->user_login; } $onchange = 'alert(\'' . __('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus') . '\');wppaRefreshAfter();'; $html1 = wppa_select($slug, $options, $values, $onchange); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system'; wppa_setting(false, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Photo owner change', 'wp-photo-album-plus'); $desc = __('Administrators can change photo owner', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_photo_owner_change'; $html1 = wppa_checkbox($slug); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Super user', 'wp-photo-album-plus'); $desc = __('Give these users all rights in wppa.', 'wp-photo-album-plus'); $help = esc_js(__('This gives the user all the administrator privileges within wppa.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Make sure the user also has a role that has all the boxes ticked in Table VII-A', 'wp-photo-album-plus')); $slug = 'wppa_superuser_user'; // $users = wppa_get_users(); // Already known $superlist = get_option('wppa_super_users', array()); if (wppa_get_user_count() <= wppa_opt('max_users')) { $options = array(__('--- select a user to make superuser ---', 'wp-photo-album-plus')); $values = array('0'); foreach ($users as $usr) { if (!wppa_user_is('administrator', $usr['ID'])) { // an administrator can not be made superuser if (!in_array($usr['user_login'], $superlist)) { // skip already on superlist $options[] = $usr['display_name'] . ' (' . $usr['user_login'] . ')'; $values[] = $usr['user_login']; } } } $onchange = 'alert(\'' . __('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus') . '\');wppaRefreshAfter();'; $html1 = wppa_select($slug, $options, $values, $onchange); $html2 = ''; } else { // over 1000 users $onchange = 'alert(\'' . __('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus') . '\');wppaRefreshAfter();'; $html1 = __('User login name <b>( case sensitive! )</b>:', 'wp-photo-album-plus'); $html2 = wppa_input($slug, '150px', '', '', $onchange); } $html = array($html1, $html2); $clas = ''; $tags = 'access,system'; wppa_setting(false, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Unsuper user', 'wp-photo-album-plus'); $desc = __('Remove user from super user list.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_un_superuser_user'; $superlist = get_option('wppa_super_users', array()); $options = array(__('--- select a user to unmake superuser ---', 'wp-photo-album-plus')); $values = array('0'); foreach ($superlist as $usr) { $u = get_user_by('login', $usr); $options[] = $u->display_name . ' (' . $u->user_login . ')'; $values[] = $u->user_login; } $onchange = 'alert(\'' . __('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus') . '\');wppaRefreshAfter();'; $html1 = wppa_select($slug, $options, $values, $onchange); $html2 = ''; $html = array($html1, $html2); $clas = ''; $tags = 'access,system'; wppa_setting(false, '12', $name, $desc, $html, $help, $clas, $tags); ?> </tbody> <tfoot style="font-weight: bold;" class="wppa_table_7"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Setting', 'wp-photo-album-plus'); ?> </td> <td></td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </tfoot> </table> </div> <?php // Table 8: Actions ?> <?php wppa_settings_box_header('8', __('Table VIII:', 'wp-photo-album-plus') . ' ' . __('Actions:', 'wp-photo-album-plus') . ' ' . __('This table lists all actions that can be taken to the wppa+ system', 'wp-photo-album-plus')); ?> <div id="wppa_table_8" style="display:none" > <table class="widefat wppa-table wppa-setting-table"> <thead style="font-weight: bold; " class="wppa_table_8"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Specification', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Do it!', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Status', 'wp-photo-album-plus'); ?> </td> <td><?php _e('To Go', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </thead> <tbody class="wppa_table_8"> <?php $wppa_table = 'VIII'; wppa_setting_subheader('A', '4', __('Harmless and reverseable actions', 'wp-photo-album-plus')); $name = __('Ignore concurrency', 'wp-photo-album-plus'); $desc = __('Ignore the prevention of concurrent actions.', 'wp-photo-album-plus'); $help = esc_js(__('This setting is meant to recover from deadlock situations only. Use with care!', 'wp-photo-album-plus')); $slug = 'wppa_maint_ignore_concurrency_error'; $html1 = wppa_checkbox($slug); $html2 = ''; $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '0', $name, $desc, $html, $help, $clas, $tags); $name = __('Setup', 'wp-photo-album-plus'); $desc = __('Re-initialize plugin.', 'wp-photo-album-plus'); $help = esc_js(__('Re-initilizes the plugin, (re)creates database tables and sets up default settings and directories if required.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('This action may be required to setup blogs in a multiblog (network) site as well as in rare cases to correct initilization errors.', 'wp-photo-album-plus')); $slug = 'wppa_setup'; $html1 = ''; $html2 = wppa_doit_button('', $slug); $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Backup settings', 'wp-photo-album-plus'); $desc = __('Save all settings into a backup file.', 'wp-photo-album-plus'); $help = esc_js(__('Saves all the settings into a backup file', 'wp-photo-album-plus')); $slug = 'wppa_backup'; $html1 = ''; $html2 = wppa_doit_button('', $slug); $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Load settings', 'wp-photo-album-plus'); $desc = __('Restore all settings from defaults, a backup or skin file.', 'wp-photo-album-plus'); $help = esc_js(__('Restores all the settings from the factory supplied defaults, the backup you created or from a skin file.', 'wp-photo-album-plus')); $slug1 = 'wppa_skinfile'; $slug2 = 'wppa_load_skin'; $files = glob(WPPA_PATH . '/theme/*.skin'); $options = false; $values = false; $options[] = __('--- set to defaults ---', 'wp-photo-album-plus'); $values[] = 'default'; if (is_file(WPPA_DEPOT_PATH . '/settings.bak')) { $options[] = __('--- restore backup ---', 'wp-photo-album-plus'); $values[] = 'restore'; } if (count($files)) { foreach ($files as $file) { $fname = basename($file); $ext = strrchr($fname, '.'); if ($ext == '.skin') { $options[] = $fname; $values[] = $file; } } } $html1 = wppa_select($slug1, $options, $values); $html2 = wppa_doit_button('', $slug2); $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Regenerate', 'wp-photo-album-plus'); $desc = __('Regenerate all thumbnails.', 'wp-photo-album-plus'); $help = esc_js(__('Regenerate all thumbnails.', 'wp-photo-album-plus')); $slug1 = 'wppa_regen_thumbs_skip_one'; $slug2 = 'wppa_regen_thumbs'; $html1 = wppa_cronjob_button($slug2) . wppa_ajax_button(__('Skip one', 'wp-photo-album-plus'), 'regen_thumbs_skip_one', '0', true); $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,thumb'; wppa_setting(false, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Rerate', 'wp-photo-album-plus'); $desc = __('Recalculate ratings.', 'wp-photo-album-plus'); $help = esc_js(__('This function will recalculate all mean photo ratings from the ratings table.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('You may need this function after the re-import of previously exported photos', 'wp-photo-album-plus')); $slug2 = 'wppa_rerate'; $html1 = wppa_cronjob_button($slug2); $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,rating'; wppa_setting(false, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Lost and found', 'wp-photo-album-plus'); $desc = __('Find "lost" photos.', 'wp-photo-album-plus'); $help = esc_js(__('This function will attempt to find lost photos.', 'wp-photo-album-plus')); $slug2 = 'wppa_cleanup'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Recuperate', 'wp-photo-album-plus'); $desc = 'Recuperate IPTC and EXIF data from photos in WPPA+.'; $help = esc_js(__('This action will attempt to find and register IPTC and EXIF data from photos in the WPPA+ system.', 'wp-photo-album-plus')); $slug2 = 'wppa_recup'; $html1 = wppa_cronjob_button($slug2); $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Remake Index Albums', 'wp-photo-album-plus'); $desc = __('Remakes the index database table for albums.', 'wp-photo-album-plus'); $help = ''; $slug2 = 'wppa_remake_index_albums'; $html1 = wppa_cronjob_button($slug2); $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,search'; wppa_setting(false, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Remake Index Photos', 'wp-photo-album-plus'); $desc = __('Remakes the index database table for photos.', 'wp-photo-album-plus'); $help = ''; $slug2 = 'wppa_remake_index_photos'; $html1 = wppa_cronjob_button($slug2); $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,search'; wppa_setting(false, '9', $name, $desc, $html, $help, $clas, $tags); $fs = get_option('wppa_file_system'); if (!$fs) { // Fix for wp delete_option bug $fs = 'flat'; wppa_update_option('wppa_file_system', 'flat'); } if ($fs == 'flat' || $fs == 'to-tree') { $name = __('Convert to tree', 'wp-photo-album-plus'); $desc = __('Convert filesystem to tree structure.', 'wp-photo-album-plus'); } if ($fs == 'tree' || $fs == 'to-flat') { $name = __('Convert to flat', 'wp-photo-album-plus'); $desc = __('Convert filesystem to flat structure.', 'wp-photo-album-plus'); } $help = esc_js(__('If you want to go back to a wppa+ version prior to 5.0.16, you MUST convert to flat first.', 'wp-photo-album-plus')); $slug2 = 'wppa_file_system'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Remake', 'wp-photo-album-plus'); $desc = __('Remake the photofiles from photo sourcefiles.', 'wp-photo-album-plus'); $help = esc_js(__('This action will remake the fullsize images, thumbnail images, and will refresh the iptc and exif data for all photos where the source is found in the corresponding album sub-directory of the source directory.', 'wp-photo-album-plus')); $slug1 = 'wppa_remake_skip_one'; $slug2 = 'wppa_remake'; $html1 = wppa_cronjob_button($slug2) . wppa_ajax_button(__('Skip one', 'wp-photo-album-plus'), 'remake_skip_one', '0', true); $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Orientation only', 'wp-photo-album-plus'); $desc = __('Remake non standard orientated photos only.', 'wp-photo-album-plus'); $help = ''; $slug1 = ''; $slug2 = 'wppa_remake_orientation_only'; $html1 = ''; $html2 = wppa_checkbox($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '11a', $name, $desc, $html, $help, $clas, $tags); $name = __('Missing only', 'wp-photo-album-plus'); $desc = __('Remake missing photofiles only.', 'wp-photo-album-plus'); $help = ''; $slug1 = ''; $slug2 = 'wppa_remake_missing_only'; $html1 = ''; $html2 = wppa_checkbox($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '11b', $name, $desc, $html, $help, $clas, $tags); $name = __('Recalc sizes', 'wp-photo-album-plus'); $desc = __('Recalculate photosizes and save to db.', 'wp-photo-album-plus'); $help = ''; $slug2 = 'wppa_comp_sizes'; $html1 = wppa_cronjob_button($slug2); $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Renew album crypt', 'wp-photo-album-plus'); $desc = __('Renew album encrcryption codes.', 'wp-photo-album-plus'); $help = ''; $slug2 = 'wppa_crypt_albums'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Renew photo crypt', 'wp-photo-album-plus'); $desc = __('Renew photo encrcryption codes.', 'wp-photo-album-plus'); $help = ''; $slug2 = 'wppa_crypt_photos'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Create orietation sources', 'wp-photo-album-plus'); $desc = __('Creates correctly oriented pseudo source file.', 'wp-photo-album-plus'); $help = ''; $slug1 = 'wppa_create_o1_files_skip_one'; $slug2 = 'wppa_create_o1_files'; $html1 = wppa_ajax_button(__('Skip one', 'wp-photo-album-plus'), 'create_o1_files_skip_one', '0', true); $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '15', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('B', '4', __('Clearing and other irreverseable actions', 'wp-photo-album-plus')); $name = __('Clear ratings', 'wp-photo-album-plus'); $desc = __('Reset all ratings.', 'wp-photo-album-plus'); $help = esc_js(__('WARNING: If checked, this will clear all ratings in the system!', 'wp-photo-album-plus')); $slug = 'wppa_rating_clear'; $html1 = ''; $html2 = wppa_ajax_button('', 'rating_clear'); $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,rating'; wppa_setting(false, '1.0', $name, $desc, $html, $help, $clas, $tags); $name = __('Clear viewcounts', 'wp-photo-album-plus'); $desc = __('Reset all viewcounts.', 'wp-photo-album-plus'); $help = esc_js(__('WARNING: If checked, this will clear all viewcounts in the system!', 'wp-photo-album-plus')); $slug = 'wppa_viewcount_clear'; $html1 = ''; $html2 = wppa_ajax_button('', 'viewcount_clear'); $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '1.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Reset IPTC', 'wp-photo-album-plus'); $desc = __('Clear all IPTC data.', 'wp-photo-album-plus'); $help = esc_js(__('WARNING: If checked, this will clear all IPTC data in the system!', 'wp-photo-album-plus')); $slug = 'wppa_iptc_clear'; $html1 = ''; $html2 = wppa_ajax_button('', 'iptc_clear'); $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Reset EXIF', 'wp-photo-album-plus'); $desc = __('Clear all EXIF data.', 'wp-photo-album-plus'); $help = esc_js(__('WARNING: If checked, this will clear all EXIF data in the system!', 'wp-photo-album-plus')); $slug = 'wppa_exif_clear'; $html1 = ''; $html2 = wppa_ajax_button('', 'exif_clear'); $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Apply New Photodesc', 'wp-photo-album-plus'); $desc = __('Apply New photo description on all photos in the system.', 'wp-photo-album-plus'); $help = esc_js('Puts the content of Table IX-D5 in all photo descriptions.'); $slug2 = 'wppa_apply_new_photodesc_all'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Append to photodesc', 'wp-photo-album-plus'); $desc = __('Append this text to all photo descriptions.', 'wp-photo-album-plus'); $help = esc_js('Appends a space character and the given text to the description of all photos.'); $help .= '\\n\\n' . esc_js('First edit the text to append, click outside the edit window and wait for the green checkmark to appear. Then click the Start! button.'); $slug1 = 'wppa_append_text'; $slug2 = 'wppa_append_to_photodesc'; $html1 = wppa_input($slug1, '200px'); $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Remove from photodesc', 'wp-photo-album-plus'); $desc = __('Remove this text from all photo descriptions.', 'wp-photo-album-plus'); $help = esc_js('Removes all occurrencies of the given text from the description of all photos.'); $help .= '\\n\\n' . esc_js('First edit the text to remove, click outside the edit window and wait for the green checkmark to appear. Then click the Start! button.'); $slug1 = 'wppa_remove_text'; $slug2 = 'wppa_remove_from_photodesc'; $html1 = wppa_input($slug1, '200px'); $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Remove empty albums', 'wp-photo-album-plus'); $desc = __('Removes albums that are not used.', 'wp-photo-album-plus'); $help = esc_js('Removes all albums that have no photos and no sub albums in it.'); $slug2 = 'wppa_remove_empty_albums'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,album'; wppa_setting(false, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Remove file-ext', 'wp-photo-album-plus'); $desc = __('Remove possible file extension from photo name.', 'wp-photo-album-plus'); $help = esc_js(__('This may be required for old photos, uploaded when the option in Table IX-D3 was not yet available/selected.', 'wp-photo-album-plus')); $slug2 = 'wppa_remove_file_extensions'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Re-add file-ext', 'wp-photo-album-plus'); $desc = __('Revert the <i>Remove file-ext</i> action.', 'wp-photo-album-plus'); $help = ''; $slug2 = 'wppa_readd_file_extensions'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '8.1', $name, $desc, $html, $help, $clas, $tags); $name = __('All to lower', 'wp-photo-album-plus'); $desc = __('Convert all file-extensions to lowercase.', 'wp-photo-album-plus'); $help = esc_js(__('Affects display files, thumbnail files, and saved extensions in database table. Leaves sourcefiles untouched', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('If both upper and lowercase files exist, the file with the uppercase extension will be removed.', 'wp-photo-album-plus')); $slug2 = 'wppa_all_ext_to_lower'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '8.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Watermark all', 'wp-photo-album-plus'); $desc = __('Apply watermark according to current settings to all photos.', 'wp-photo-album-plus'); $help = esc_js(__('See Table IX_F for the current watermark settings', 'wp-photo-album-plus')); $slug2 = 'wppa_watermark_all'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,water'; wppa_setting(false, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Create all autopages', 'wp-photo-album-plus'); $desc = __('Create all the pages to display slides individually.', 'wp-photo-album-plus'); $help = esc_js(__('See also Table IV-A10.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Make sure you have a custom menu and the "Automatically add new top-level pages to this menu" box UNticked!!', 'wp-photo-album-plus')); $slug2 = 'wppa_create_all_autopages'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,page'; wppa_setting(false, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Delete all autopages', 'wp-photo-album-plus'); $desc = __('Delete all the pages to display slides individually.', 'wp-photo-album-plus'); $help = esc_js(__('See also Table IV-A10.', 'wp-photo-album-plus')); $help .= ''; $slug2 = 'wppa_delete_all_autopages'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,page'; wppa_setting(false, '10.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Leading zeroes', 'wp-photo-album-plus'); $desc = __('If photoname numeric, add leading zeros', 'wp-photo-album-plus'); $help = esc_js(__('You can extend the name with leading zeros, so alphabetic sort becomes equal to numeric sort order.', 'wp-photo-album-plus')); $slug1 = 'wppa_zero_numbers'; $slug2 = 'wppa_leading_zeros'; $html1 = wppa_input($slug1, '50px') . __('Total chars', 'wp-photo-album-plus'); $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Add GPX tag', 'wp-photo-album-plus'); $desc = __('Make sure photos with gpx data have a Gpx tag', 'wp-photo-album-plus'); $help = ''; $slug2 = 'wppa_add_gpx_tag'; $html1 = wppa_cronjob_button($slug2); $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '12', $name, $desc, $html, $help, $clas, $tags); if (function_exists('ewww_image_optimizer')) { $name = __('Optimize files', 'wp-photo-album-plus'); $desc = __('Optimize with EWWW image optimizer', 'wp-photo-album-plus'); $help = ''; $slug2 = 'wppa_optimize_ewww'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '13', $name, $desc, $html, $help, $clas, $tags); } $name = __('Edit tag', 'wp-photo-album-plus'); $desc = __('Globally change a tagname.', 'wp-photo-album-plus'); $help = ''; $slug1 = 'wppa_tag_to_edit'; $slug2 = 'wppa_new_tag_value'; $slug3 = 'wppa_edit_tag'; $tags = wppa_get_taglist(); $opts = array(__('-select a tag-', 'wp-photo-album-plus')); $vals = array(''); if ($tags) { foreach (array_keys($tags) as $tag) { $opts[] = $tag; $vals[] = $tag; } } $html1 = '<div><small style="float:left;margin-right:5px;" >' . __('Tag:', 'wp-photo-album-plus') . '</small>' . wppa_select($slug1, $opts, $vals) . '</div>'; $html2 = '<div style="clear:both" ><small style="float:left;margin-right:5px;" >' . __('Change to:', 'wp-photo-album-plus') . '</small>' . wppa_edit($slug2, trim(get_option($slug2), ','), '100px') . '</div>'; $html3 = wppa_maintenance_button($slug3); $html4 = wppa_status_field($slug3); $html5 = wppa_togo_field($slug3); $html = array($html1 . '<br />' . $html2, $html3, $html4, $html5); $clas = ''; $tags = 'system,meta'; wppa_setting(false, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Synchronize Cloudinary', 'wp-photo-album-plus'); $desc = __('Removes/adds images in the cloud.', 'wp-photo-album-plus'); $help = esc_js(__('Removes old images and verifies/adds new images to Cloudinary.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('See Table IX-K4.7 for the configured lifetime.', 'wp-photo-album-plus')); $slug2 = 'wppa_sync_cloud'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = 'cloudinary'; $tags = 'system'; wppa_setting(false, '15', $name, $desc, $html, $help, $clas, $tags); $name = __('Fix tags', 'wp-photo-album-plus'); $desc = __('Make sure photo tags format is uptodate', 'wp-photo-album-plus'); $help = esc_js(__('Fixes tags to be conform current database rules.', 'wp-photo-album-plus')); $slug2 = 'wppa_sanitize_tags'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '16', $name, $desc, $html, $help, $clas, $tags); $name = __('Fix cats', 'wp-photo-album-plus'); $desc = __('Make sure album cats format is uptodate', 'wp-photo-album-plus'); $help = esc_js(__('Fixes cats to be conform current database rules.', 'wp-photo-album-plus')); $slug2 = 'wppa_sanitize_cats'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '17', $name, $desc, $html, $help, $clas, $tags); $name = __('Set owner to name', 'wp-photo-album-plus'); $desc = __('If photoname equals user display name, set him owner.', 'wp-photo-album-plus'); $help = ''; $slug2 = 'wppa_owner_to_name_proc'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '18', $name, $desc, $html, $help, $clas, $tags); $name = __('Move all photos', 'wp-photo-album-plus'); $desc = __('Move all photos from one album to another album.', 'wp-photo-album-plus'); $help = ''; $slug2 = 'wppa_move_all_photos'; $html1 = ''; $html2 = wppa_maintenance_button($slug2); $html3 = wppa_status_field($slug2); $html4 = wppa_togo_field($slug2); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '19', $name, $desc, $html, $help, $clas, $tags); if (wppa_get_total_album_count() > 200) { // Many albums: input id $name = __('From', 'wp-photo-album-plus'); $desc = __('Move from album number', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_move_all_photos_from'; $html = wppa_input($slug, '100px'); $html = array($html, '', '', ''); $clas = ''; $tags = 'system'; wppa_setting(false, '19.1', $name, $desc, $html, $help, $clas, $tags); $name = __('To', 'wp-photo-album-plus'); $desc = __('Move to album number', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_move_all_photos_to'; $html = wppa_input($slug, '100px'); $html = array($html, '', '', ''); $clas = ''; $tags = 'system'; wppa_setting(false, '19.2', $name, $desc, $html, $help, $clas, $tags); } else { // Few albums: selectionbox $name = __('From', 'wp-photo-album-plus'); $desc = __('Move from album', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_move_all_photos_from'; $html = '<select' . ' id=""' . ' onchange="wppaAjaxUpdateOptionValue(\'move_all_photos_from\',this)"' . ' name="move_all_photos_to"' . ' style="float:left;"' . ' >' . wppa_album_select_a(array('addpleaseselect' => true, 'path' => true, 'selected' => get_option('wppa_move_all_photos_from'))) . '</select>' . '<img' . ' id="img_move_all_photos_from"' . ' class=""' . ' src="' . wppa_get_imgdir() . 'star.ico"' . ' title="' . __('Setting unmodified', 'wp-photo-album-plus') . '"' . ' style="padding-left:4px; float:left; height:16px; width:16px;"' . ' />'; $html = array($html, '', '', ''); $clas = ''; $tags = 'system'; wppa_setting(false, '19.1', $name, $desc, $html, $help, $clas, $tags); $name = __('To', 'wp-photo-album-plus'); $desc = __('Move to album', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_move_all_photos_to'; $html = '<select' . ' id=""' . ' onchange="wppaAjaxUpdateOptionValue(\'move_all_photos_to\',this)"' . ' name="move_all_photos_to"' . ' style="float:left;"' . ' >' . wppa_album_select_a(array('addpleaseselect' => true, 'path' => true, 'selected' => get_option('wppa_move_all_photos_to'))) . '</select>' . '<img' . ' id="img_move_all_photos_to"' . ' class=""' . ' src="' . wppa_get_imgdir() . 'star.ico"' . ' title="' . __('Setting unmodified', 'wp-photo-album-plus') . '"' . ' style="padding-left:4px; float:left; height:16px; width:16px;"' . ' />'; $html = array($html, '', '', ''); $clas = ''; $tags = 'system'; wppa_setting(false, '19.2', $name, $desc, $html, $help, $clas, $tags); } /* $name = __('Test proc'); $desc = __('For OpaJaap only'); $help = ''; $slug2 = 'wppa_test_proc'; $html1 = ''; $html2 = wppa_maintenance_button( $slug2 ); $html3 = wppa_status_field( $slug2 ); $html4 = wppa_togo_field( $slug2 ); $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '99', $name, $desc, $html, $help, $clas, $tags); /**/ wppa_setting_subheader('C', '4', __('Listings', 'wp-photo-album-plus')); $name = __('List Logfile', 'wp-photo-album-plus'); $desc = __('Show the content of wppa+ (error) log.', 'wp-photo-album-plus'); $help = ''; $slug1 = 'wppa_errorlog_purge'; $slug2 = 'wppa_list_errorlog'; $html1 = wppa_ajax_button(__('Purge logfile', 'wp-photo-album-plus'), 'errorlog_purge', '0', true); $html2 = wppa_popup_button($slug2); $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('List Ratings', 'wp-photo-album-plus'); $desc = __('Show the most recent ratings.', 'wp-photo-album-plus'); $help = ''; $slug1 = ''; $slug2 = 'wppa_list_rating'; $html1 = ''; $html2 = wppa_popup_button($slug2); $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,rating'; wppa_setting(false, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('List Index', 'wp-photo-album-plus'); $desc = __('Show the content if the index table.', 'wp-photo-album-plus'); $help = ''; $slug1 = 'wppa_list_index_display_start'; $slug2 = 'wppa_list_index'; $html1 = '<small style="float:left;">' . __('Start at text:', 'wp-photo-album-plus') . '</small>' . wppa_input($slug1, '150px'); $html2 = wppa_popup_button($slug2); $html3 = ''; $html4 = ''; $clas = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,search'; wppa_setting(false, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('List active sessions', 'wp-photo-album-plus'); $desc = __('Show the content of the sessions table.', 'wp-photo-album-plus'); $help = ''; $slug1 = ''; $slug2 = 'wppa_list_session'; $html1 = ''; $html2 = wppa_popup_button($slug2); $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system'; wppa_setting(false, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('List comments', 'wp-photo-album-plus'); $desc = __('Show the content of the comments table.', 'wp-photo-album-plus'); $help = ''; $slug1 = 'wppa_list_comments_by'; $slug2 = 'wppa_list_comments'; $opts = array('Email', 'Name', 'Timestamp'); $vals = array('email', 'name', 'timestamp'); $html1 = '<small style="float:left;">' . __('Order by:', 'wp-photo-album-plus') . '</small>' . wppa_select($slug1, $opts, $vals); $html2 = wppa_popup_button($slug2); $html3 = ''; $html4 = ''; $html = array($html1, $html2, $html3, $html4); $clas = ''; $tags = 'system,comment'; wppa_setting(false, '5', $name, $desc, $html, $help, $clas, $tags); ?> </tbody> <tfoot style="font-weight: bold;" class="wppa_table_8"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Specification', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Do it!', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Status', 'wp-photo-album-plus'); ?> </td> <td><?php _e('To Go', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </tfoot> </table> </div> <?php // Table 9: Miscellaneous ?> <?php wppa_settings_box_header('9', __('Table IX:', 'wp-photo-album-plus') . ' ' . __('Miscellaneous:', 'wp-photo-album-plus') . ' ' . __('This table lists all settings that do not fit into an other table', 'wp-photo-album-plus')); ?> <div id="wppa_table_9" style="display:none" > <table class="widefat wppa-table wppa-setting-table"> <thead style="font-weight: bold; " class="wppa_table_9"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Setting', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </thead> <tbody class="wppa_table_9"> <?php $wppa_table = 'IX'; wppa_setting_subheader('A', '1', __('Internal engine related settings', 'wp-photo-album-plus')); $name = __('WPPA+ Filter priority', 'wp-photo-album-plus'); $desc = __('Sets the priority of the wppa+ content filter.', 'wp-photo-album-plus'); $help = esc_js(__('If you encounter conflicts with the theme or other plugins, increasing this value sometimes helps. Use with great care!', 'wp-photo-album-plus')); $slug = 'wppa_filter_priority'; $html = wppa_input($slug, '50px'); $clas = ''; $tags = 'system'; wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Do_shortcode priority', 'wp-photo-album-plus'); $desc = __('Sets the priority of the do_shortcode() content filter.', 'wp-photo-album-plus'); $help = esc_js(__('If you encounter conflicts with the theme or other plugins, increasing this value sometimes helps. Use with great care!', 'wp-photo-album-plus')); $slug = 'wppa_shortcode_priority'; $html = wppa_input($slug, '50px'); $clas = ''; $tags = 'system'; wppa_setting($slug, '1.2', $name, $desc, $html, $help, $clas, $tags); $name = __('WPPA shortcode at Filter priority', 'wp-photo-album-plus'); $desc = __('Execute shortcode expansion on filter priority in posts and pages.', 'wp-photo-album-plus'); $help = esc_js(__('Use to fix certain layout problems', 'wp-photo-album-plus')); $slug = 'wppa_shortcode_at_priority'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '1.3', $name, $desc, $html, $help, $clas, $tags); $name = __('WPPA shortcode at Filter priority widget', 'wp-photo-album-plus'); $desc = __('Execute shortcode expansion on filter priority in widgets.', 'wp-photo-album-plus'); $help = esc_js(__('Use to fix certain layout problems', 'wp-photo-album-plus')); $slug = 'wppa_shortcode_at_priority_widget'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '1.4', $name, $desc, $html, $help, $clas, $tags); $name = __('JPG image quality', 'wp-photo-album-plus'); $desc = __('The jpg quality when photos are downsized', 'wp-photo-album-plus'); $help = esc_js(__('The higher the number the better the quality but the larger the file', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Possible values 20..100', 'wp-photo-album-plus')); $slug = 'wppa_jpeg_quality'; $html = wppa_input($slug, '50px'); $clas = ''; $tags = 'system'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Allow WPPA+ Debugging', 'wp-photo-album-plus'); $desc = __('Allow the use of &debug=.. in urls to this site.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: appending (?)(&)debug or (?)(&)debug=<int> to an url to this site will generate the display of special WPPA+ diagnostics, as well as php warnings', 'wp-photo-album-plus')); $slug = 'wppa_allow_debug'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Auto continue', 'wp-photo-album-plus'); $desc = __('Continue automatic after time out', 'wp-photo-album-plus'); $help = esc_js(__('If checked, an attempt will be made to restart an admin process when the time is out.', 'wp-photo-album-plus')); $slug = 'wppa_auto_continue'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Max execution time', 'wp-photo-album-plus'); $desc = __('Set max execution time here.', 'wp-photo-album-plus'); $help = esc_js(__('If your php config does not properly set the max execution time, you can set it here. Seconds, 0 means do not change.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('A safe value is 45 in most cases', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(sprintf(__('The PHP setting max_execution_time is set to %s.', 'wp-photo-album-plus'), ini_get('max_execution_time'))); // $help .= '\n'.esc_js(sprintf(__('The PHP setting safe_mode is set to %s.', 'wp-photo-album-plus'), ini_get('safe_mode'))); $slug = 'wppa_max_execution_time'; $html = wppa_input($slug, '50px', '', 'seconds'); $clas = ''; $tags = 'system'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Feed use thumb', 'wp-photo-album-plus'); $desc = __('Feeds use thumbnail pictures always.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_feed_use_thumb'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Enable <i>in-line</i> settings', 'wp-photo-album-plus'); $desc = __('Activates shortcode [wppa_set][/wppa_set].', 'wp-photo-album-plus'); $help = esc_js(__('Syntax: [wppa_set name="any wppa setting" value="new value"][/wppa_set]', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Example: [wppa_set name="wppa_thumbtype" value="masonry-v"][/wppa_set] sets the thumbnail type to vertical masonry style', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Do not forget to reset with [wppa_set][/wppa_set]', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Use with great care! There is no check on validity of values!', 'wp-photo-album-plus')); $slug = 'wppa_enable_shortcode_wppa_set'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Runtime modifyable settings', 'wp-photo-album-plus'); $desc = __('The setting slugs that may be altered using [wppa_set] shortcode.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_set_shortcodes'; $html = wppa_input($slug, '90%'); $clas = ''; $tags = 'system'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('B', '1', __('WPPA+ Admin related miscellaneous settings', 'wp-photo-album-plus')); $name = __('Allow HTML', 'wp-photo-album-plus'); $desc = __('Allow HTML in album and photo descriptions.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: html is allowed. WARNING: No checks on syntax, it is your own responsability to close tags properly!', 'wp-photo-album-plus')); $slug = 'wppa_html'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Allow HTML custom', 'wp-photo-album-plus'); $desc = __('Allow HTML in custom photo datafields.', 'wp-photo-album-plus'); $help = esc_js(__('If checked: html is allowed. WARNING: No checks on syntax, it is your own responsability to close tags properly!', 'wp-photo-album-plus')); $slug = 'wppa_allow_html_custom'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Check tag balance', 'wp-photo-album-plus'); $desc = __('Check if the HTML tags are properly closed: "balanced".', 'wp-photo-album-plus'); $help = esc_js(__('If the HTML tags in an album or a photo description are not in balance, the description is not updated, an errormessage is displayed', 'wp-photo-album-plus')); $slug = 'wppa_check_balance'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Use WP editor', 'wp-photo-album-plus'); $desc = __('Use the wp editor for multiline text fields.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_use_wp_editor'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Album sel hierarchic', 'wp-photo-album-plus'); $desc = __('Show albums with (grand)parents in selection lists.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_hier_albsel'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,album'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Page sel hierarchic', 'wp-photo-album-plus'); $desc = __('Show pages with (grand)parents in selection lists.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_hier_pagesel'; $warn = 'This setting will be effective after reload of the page'; $html = wppa_checkbox_warn($slug, '', '', $warn); $clas = ''; $tags = 'system,page'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Album admin page size', 'wp-photo-album-plus'); $desc = __('The number of albums per page on the Edit Album admin page.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_album_admin_pagesize'; $options = array(__('--- off ---', 'wp-photo-album-plus'), '10', '20', '50', '100', '200'); $values = array('0', '10', '20', '50', '100', '200'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'system,page'; wppa_setting($slug, '6.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Photo admin page size', 'wp-photo-album-plus'); $desc = __('The number of photos per page on the <br/>Edit Album -> Manage photos and Edit Photos admin pages.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_photo_admin_pagesize'; $options = array(__('--- off ---', 'wp-photo-album-plus'), '10', '20', '50', '100', '200'); $values = array('0', '10', '20', '50', '100', '200'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'system,page'; wppa_setting($slug, '6.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Photo admin max albums', 'wp-photo-album-plus'); $desc = __('Max albums to show in album selectionbox.', 'wp-photo-album-plus'); $help = esc_js(__('If there are more albums in the system, display an input box asking for album id#', 'wp-photo-album-plus')); $slug = 'wppa_photo_admin_max_albums'; $options = array(__('--- off ---', 'wp-photo-album-plus'), '10', '20', '50', '100', '200', '500', '1000'); $values = array('0', '10', '20', '50', '100', '200', '500', '1000'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'system'; wppa_setting($slug, '6.3', $name, $desc, $html, $help, $clas, $tags); $name = __('Comment admin page size', 'wp-photo-album-plus'); $desc = __('The number of comments per page on the Comments admin pages.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_comment_admin_pagesize'; $options = array(__('--- off ---', 'wp-photo-album-plus'), '10', '20', '50', '100', '200'); $values = array('0', '10', '20', '50', '100', '200'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'system,page,comment'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Geo info edit', 'wp-photo-album-plus'); $desc = __('Lattitude and longitude may be edited in photo admin.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_geo_edit'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,meta'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Admin bar menu admin', 'wp-photo-album-plus'); $desc = __('Show menu on admin bar on admin pages.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_adminbarmenu_admin'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Admin bar menu frontend', 'wp-photo-album-plus'); $desc = __('Show menu on admin bar on frontend pages.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_adminbarmenu_frontend'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Add shortcode to posts', 'wp-photo-album-plus'); $desc = __('Add a shortcode to the end of all posts.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_add_shortcode_to_post'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Shortcode to add', 'wp-photo-album-plus'); $desc = __('The shortcode to be added to the posts.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_shortcode_to_add'; $html = wppa_input($slug, '300px'); $clas = ''; $tags = 'system'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Import page prieviews', 'wp-photo-album-plus'); $desc = __('Show thumbnail previews in import admin page.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_import_preview'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Upload audiostub', 'wp-photo-album-plus'); $desc = __('Upload a new audio stub file', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_audiostub_upload'; $html = '<input id="my_file_element" type="file" name="file_3" style="float:left; font-size: 11px;" />'; $html .= wppa_doit_button(__('Upload audio stub image', 'wp-photo-album-plus'), $slug, '', '31', '16'); $clas = ''; $tags = 'audio,upload'; wppa_setting(false, '15', $name, $desc, $html, $help, $clas, $tags); $name = __('Confirm create', 'wp-photo-album-plus'); $desc = __('Display confirmation dialog before creating album.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_confirm_create'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '16', $name, $desc, $html, $help, $clas, $tags); $name = __('Import source root', 'wp-photo-album-plus'); $desc = __('Specify the highest level in the filesystem where to import from', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_import_root'; $opts = array(); $prev = ''; $curr = ABSPATH . 'wp-content'; while ($prev != $curr) { $opts[] = $curr; $prev = $curr; $curr = dirname($prev); } $vals = $opts; $html = wppa_select($slug, $opts, $vals, '', '', false, '', '500'); $clas = ''; $tags = 'system,upload'; wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags); $name = __('Allow import from WPPA+ source folders', 'wp-photo-album-plus'); $desc = __('Only switch this on if you know what you are doing!', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_allow_import_source'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,upload'; wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('C', '1', __('SEO related settings', 'wp-photo-album-plus')); $name = __('Meta on page', 'wp-photo-album-plus'); $desc = __('Meta tags for photos on the page.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the header of the page will contain metatags that refer to featured photos on the page in the page context.', 'wp-photo-album-plus')); $slug = 'wppa_meta_page'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Meta all', 'wp-photo-album-plus'); $desc = __('Meta tags for all featured photos.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the header of the page will contain metatags that refer to all featured photo files.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('If you have many featured photos, you might wish to uncheck this item to reduce the size of the page header.', 'wp-photo-album-plus')); $slug = 'wppa_meta_all'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Add og meta tags', 'wp-photo-album-plus'); $desc = __('Add og meta tags to the page header.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_og_tags_on'; $warn = esc_js(__('Turning this off may affect the functionality of social media items in the share box that rely on open graph tags information.', 'wp-photo-album-plus')); $html = wppa_checkbox_warn_off($slug, '', '', $warn, false); $clas = ''; $tags = 'system'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Image Alt attribute type', 'wp-photo-album-plus'); $desc = __('Select kind of HTML alt="" content for images.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_alt_type'; $options = array(__('--- none ---', 'wp-photo-album-plus'), __('photo name', 'wp-photo-album-plus'), __('name without file-ext', 'wp-photo-album-plus'), __('set in album admin', 'wp-photo-album-plus')); $values = array('none', 'fullname', 'namenoext', 'custom'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'system'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('D', '1', __('New Album and New Photo related miscellaneous settings', 'wp-photo-album-plus')); $options = array(__('--- off ---', 'wp-photo-album-plus'), sprintf(_n('%d hour', '%d hours', '1', 'wp-photo-album-plus'), '1'), sprintf(_n('%d day', '%d days', '1', 'wp-photo-album-plus'), '1'), sprintf(_n('%d day', '%d days', '2', 'wp-photo-album-plus'), '2'), sprintf(_n('%d day', '%d days', '3', 'wp-photo-album-plus'), '3'), sprintf(_n('%d day', '%d days', '4', 'wp-photo-album-plus'), '4'), sprintf(_n('%d day', '%d days', '5', 'wp-photo-album-plus'), '5'), sprintf(_n('%d day', '%d days', '6', 'wp-photo-album-plus'), '6'), sprintf(_n('%d week', '%d weeks', '1', 'wp-photo-album-plus'), '1'), sprintf(_n('%d day', '%d days', '8', 'wp-photo-album-plus'), '8'), sprintf(_n('%d day', '%d days', '9', 'wp-photo-album-plus'), '9'), sprintf(_n('%d day', '%d days', '10', 'wp-photo-album-plus'), '10'), sprintf(_n('%d week', '%d weeks', '2', 'wp-photo-album-plus'), '2'), sprintf(_n('%d week', '%d weeks', '3', 'wp-photo-album-plus'), '3'), sprintf(_n('%d week', '%d weeks', '4', 'wp-photo-album-plus'), '4'), sprintf(_n('%d month', '%d months', '1', 'wp-photo-album-plus'), '1')); $values = array(0, 60 * 60, 60 * 60 * 24, 60 * 60 * 24 * 2, 60 * 60 * 24 * 3, 60 * 60 * 24 * 4, 60 * 60 * 24 * 5, 60 * 60 * 24 * 6, 60 * 60 * 24 * 7, 60 * 60 * 24 * 8, 60 * 60 * 24 * 9, 60 * 60 * 24 * 10, 60 * 60 * 24 * 7 * 2, 60 * 60 * 24 * 7 * 3, 60 * 60 * 24 * 7 * 4, 60 * 60 * 24 * 30); $name = __('New Album', 'wp-photo-album-plus'); $desc = __('Maximum time an album is indicated as New', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_max_album_newtime'; $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'system,album'; wppa_setting($slug, '1.1', $name, $desc, $html, $help, $clas, $tags); $name = __('New Photo', 'wp-photo-album-plus'); $desc = __('Maximum time a photo is indicated as New', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_max_photo_newtime'; $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'system'; wppa_setting($slug, '1.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Modified Album', 'wp-photo-album-plus'); $desc = __('Maximum time an album is indicated as Modified', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_max_album_modtime'; $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'system,album'; wppa_setting($slug, '1.3', $name, $desc, $html, $help, $clas, $tags); $name = __('Modified Photo', 'wp-photo-album-plus'); $desc = __('Maximum time a photo is indicated as Modofied', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_max_photo_modtime'; $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'system'; wppa_setting($slug, '1.4', $name, $desc, $html, $help, $clas, $tags); $name = __('Use text labels', 'wp-photo-album-plus'); $desc = __('Use editable text for the New and Modified labels', 'wp-photo-album-plus'); $help = esc_js(__('If UNticked, you can specify the urls for custom images to be used.', 'wp-photo-album-plus')); $slug = 'wppa_new_mod_label_is_text'; $onch = 'wppaCheckCheck(\'' . $slug . '\',\'nmtxt\');'; $html = wppa_checkbox($slug, $onch); $clas = ''; $tags = 'system'; wppa_setting($slug, '1.5', $name, $desc, $html, $help, $clas, $tags); $opts = array(__('Red', 'wp-photo-album-plus'), __('Orange', 'wp-photo-album-plus'), __('Yellow', 'wp-photo-album-plus'), __('Green', 'wp-photo-album-plus'), __('Blue', 'wp-photo-album-plus'), __('Purple', 'wp-photo-album-plus'), __('Black/white', 'wp-photo-album-plus')); $vals = array('red', 'orange', 'yellow', 'green', 'blue', 'purple', 'black'); $name = __('New label', 'wp-photo-album-plus'); $desc = __('Specify the "New" indicator details.', 'wp-photo-album-plus'); $help = esc_js(__('If you use qTranslate, the text may be multilingual.', 'wp-photo-album-plus')); $slug1 = 'wppa_new_label_text'; $slug2 = 'wppa_new_label_color'; $html1 = '<span style="float:left">' . __('Text', 'wp-photo-album-plus') . ': </span>' . wppa_input($slug1, '150px'); $html2 = '<span style="float:left">' . __('Color', 'wp-photo-album-plus') . ': </span>' . wppa_select($slug2, $opts, $vals); $clas = 'nmtxt'; $tags = 'system'; wppa_setting($slug1, '1.6', $name, $desc, $html1 . ' ' . $html2, $help, $clas, $tags); $name = __('Modified label', 'wp-photo-album-plus'); $desc = __('Specify the "Modified" indicator details.', 'wp-photo-album-plus'); $help = esc_js(__('If you use qTranslate, the text may be multilingual.', 'wp-photo-album-plus')); $slug1 = 'wppa_mod_label_text'; $slug2 = 'wppa_mod_label_color'; $html1 = '<span style="float:left">' . __('Text', 'wp-photo-album-plus') . ': </span>' . wppa_input($slug1, '150px'); $html2 = '<span style="float:left">' . __('Color', 'wp-photo-album-plus') . ': </span>' . wppa_select($slug2, $opts, $vals); $clas = 'nmtxt'; $tags = 'system'; wppa_setting($slug1, '1.7', $name, $desc, $html1 . ' ' . $html2, $help, $clas, $tags); $name = __('New label', 'wp-photo-album-plus'); $desc = __('Specify the "New" indicator url.', 'wp-photo-album-plus'); $help = ' '; $slug = 'wppa_new_label_url'; $html = wppa_input($slug, '300px'); $clas = '-nmtxt'; $tags = 'system'; wppa_setting($slug, '1.8', $name, $desc, $html, $help, $clas, $tags); $name = __('Modified label', 'wp-photo-album-plus'); $desc = __('Specify the "Modified" indicator url.', 'wp-photo-album-plus'); $help = ' '; $slug = 'wppa_mod_label_url'; $html = wppa_input($slug, '300px'); $clas = '-nmtxt'; $tags = 'system'; wppa_setting($slug, '1.9', $name, $desc, $html, $help, $clas, $tags); $name = __('Limit LasTen New', 'wp-photo-album-plus'); $desc = __('Limits the LasTen photos to those that are \'New\', or newly modified.', 'wp-photo-album-plus'); $help = esc_js(__('If you tick this box and configured the new photo time, you can even limit the number by the setting in Table I-F7, or set that number to an unlikely high value.', 'wp-photo-album-plus')); $slug = 'wppa_lasten_limit_new'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '2.1', $name, $desc, $html, $help, $clas, $tags); $name = __('LasTen use Modified', 'wp-photo-album-plus'); $desc = __('Use the time modified rather than time upload for LasTen widget/shortcode.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_lasten_use_modified'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '2.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Apply Newphoto desc', 'wp-photo-album-plus'); $desc = __('Give each new photo a standard description.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, each new photo will get the description (template) as specified in the next item.', 'wp-photo-album-plus')); $slug = 'wppa_apply_newphoto_desc'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,meta'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('New photo desc', 'wp-photo-album-plus'); $desc = __('The description (template) to add to a new photo.', 'wp-photo-album-plus'); $help = esc_js(__('Enter the default description.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If you use html, please check item A-1 of this table.', 'wp-photo-album-plus')); $slug = 'wppa_newphoto_description'; $html = wppa_textarea($slug, $name); $clas = ''; $tags = 'system,meta'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('New photo owner', 'wp-photo-album-plus'); $desc = __('The owner of a new uploaded photo.', 'wp-photo-album-plus'); $help = esc_js(__('If you leave this blank, the uploader will be set as the owner', 'wp-photo-album-plus')); $slug = 'wppa_newphoto_owner'; $html = wppa_input($slug, '50px', '', __('leave blank or enter login name', 'wp-photo-album-plus')); $clas = ''; $tags = 'system,meta'; wppa_setting($slug, '5.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Upload limit', 'wp-photo-album-plus'); $desc = __('New albums are created with this upload limit.', 'wp-photo-album-plus'); $help = esc_js(__('Administrators can change the limit settings in the "Edit Album Information" admin page.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('A value of 0 means: no limit.', 'wp-photo-album-plus')); $slug = 'wppa_upload_limit_count'; $html = wppa_input($slug, '50px', '', __('photos', 'wp-photo-album-plus')); $slug = 'wppa_upload_limit_time'; $options = array(__('for ever', 'wp-photo-album-plus'), __('per hour', 'wp-photo-album-plus'), __('per day', 'wp-photo-album-plus'), __('per week', 'wp-photo-album-plus'), __('per month', 'wp-photo-album-plus'), __('per year', 'wp-photo-album-plus')); // 364 days $values = array('0', '3600', '86400', '604800', '2592000', '31449600'); $html .= wppa_select($slug, $options, $values); $clas = ''; $tags = 'system,upload'; wppa_setting(false, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Default parent', 'wp-photo-album-plus'); $desc = __('The parent album of new albums.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_default_parent'; $opts = array(__('--- none ---', 'wp-photo-album-plus'), __('--- separate ---', 'wp-photo-album-plus')); $vals = array('0', '-1'); $albs = $wpdb->get_results("SELECT `id`, `name` FROM`" . WPPA_ALBUMS . "` ORDER BY `name`", ARRAY_A); if ($albs) { foreach ($albs as $alb) { $opts[] = __(stripslashes($alb['name']), 'wp-photo-album-plus'); $vals[] = $alb['id']; } } $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'system,album'; wppa_setting($slug, '7.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Default parent always', 'wp-photo-album-plus'); $desc = __('The parent album of new albums is always the default, except for administrators.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_default_parent_always'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,album'; wppa_setting($slug, '7.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Show album full', 'wp-photo-album-plus'); $desc = __('Show the Upload limit reached message if appropriate.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_show_album_full'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,album'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Grant an album', 'wp-photo-album-plus'); $desc = __('Create an album for each user logging in.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_grant_an_album'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,album'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Grant album name', 'wp-photo-album-plus'); $desc = __('The name to be used for the album.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_grant_name'; $opts = array(__('Login name', 'wp-photo-album-plus'), __('Display name', 'wp-photo-album-plus'), __('Id', 'wp-photo-album-plus'), __('Firstname Lastname', 'wp-photo-album-plus')); $vals = array('login', 'display', 'id', 'firstlast'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'system,album'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Grant parent selection method', 'wp-photo-album-plus'); $desc = __('The way the grant parents are defined.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_grant_parent_sel_method'; $opts = array(__('An album (multi)selectionbox', 'wp-photo-album-plus'), __('An album category', 'wp-photo-album-plus'), __('An index search token', 'wp-photo-album-plus')); $vals = array('selectionbox', 'category', 'indexsearch'); $onch = 'wppaRefreshAfter();'; $html = wppa_select($slug, $opts, $vals, $onch); $clas = ''; $tags = 'system,album'; wppa_setting($slug, '11.0', $name, $desc, $html, $help, $clas, $tags); switch (wppa_opt('grant_parent_sel_method')) { case 'selectionbox': $name = __('Grant parent', 'wp-photo-album-plus'); $desc = __('The parent album(s) of the auto created albums.', 'wp-photo-album-plus'); $help = esc_js(__('You may select multiple albums. All logged in visitors will get their own sub-album in each granted parent.', 'wp-photo-album-plus')); $slug = 'wppa_grant_parent'; $opts = array(__('--- none ---', 'wp-photo-album-plus'), __('--- separate ---', 'wp-photo-album-plus')); $vals = array('0', '-1'); $albs = $wpdb->get_results("SELECT `id`, `name` FROM`" . WPPA_ALBUMS . "` ORDER BY `name`", ARRAY_A); if ($albs) { foreach ($albs as $alb) { $opts[] = __(stripslashes($alb['name']), 'wp-photo-album-plus'); $vals[] = $alb['id']; } } $html = wppa_select_m($slug, $opts, $vals, '', '', true); $clas = ''; $tags = 'system,album'; wppa_setting($slug, '11.1', $name, $desc, $html, $help, $clas, $tags); break; case 'category': $name = __('Grant parent category', 'wp-photo-album-plus'); $desc = __('The category of the parent album(s) of the auto created albums.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_grant_parent'; $catlist = wppa_get_catlist(); $opts = array(); foreach ($catlist as $cat) { $opts[] = $cat['cat']; } $vals = $opts; $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'system,album'; wppa_setting($slug, '11.1', $name, $desc, $html, $help, $clas, $tags); break; case 'indexsearch': $name = __('Grant parent index token', 'wp-photo-album-plus'); $desc = __('The index token that defines the parent album(s) of the auto created albums.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_grant_parent'; $html = wppa_input($slug, '150px'); $clas = ''; $tags = 'system,album'; wppa_setting($slug, '11.1', $name, $desc, $html, $help, $clas, $tags); break; } $name = __('Max user albums', 'wp-photo-album-plus'); $desc = __('The max number of albums a user can create.', 'wp-photo-album-plus'); $help = esc_js(__('The maximum number of albums a user can create when he is not admin and owner only is active', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('A number of 0 means No limit', 'wp-photo-album-plus')); $slug = 'wppa_max_albums'; $html = wppa_input($slug, '50px', '', 'albums'); $clas = ''; $tags = 'system,count,album'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Default photo name', 'wp-photo-album-plus'); $desc = __('Select the way the name of a new uploaded photo should be determined.', 'wp-photo-album-plus'); $help = esc_js('If you select an IPTC Tag and it is not found, the filename will be used instead.'); $slug = 'wppa_newphoto_name_method'; $opts = array(__('Filename', 'wp-photo-album-plus'), __('Filename without extension', 'wp-photo-album-plus'), __('IPTC Tag 2#005 (Graphic name)', 'wp-photo-album-plus'), __('IPTC Tag 2#120 (Caption)', 'wp-photo-album-plus'), __('No name at all', 'wp-photo-album-plus')); $vals = array('filename', 'noext', '2#005', '2#120', 'none'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'system,meta,album'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Default coverphoto', 'wp-photo-album-plus'); $desc = __('Name of photofile to become cover image', 'wp-photo-album-plus'); $help = esc_js(__('If you name a photofile like this setting before upload, it will become the coverimage automaticly.', 'wp-photo-album-plus')); $slug = 'wppa_default_coverimage_name'; $html = wppa_input($slug, '150px'); $clas = ''; $tags = 'system,thumb,album'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Copy Timestamp', 'wp-photo-album-plus'); $desc = __('Copy timestamp when copying photo.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the copied photo is not "new"', 'wp-photo-album-plus')); $slug = 'wppa_copy_timestamp'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '15.0', $name, $desc, $html, $help, $clas, $tags); $name = __('Copy Owner', 'wp-photo-album-plus'); $desc = __('Copy the owner when copying photo.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_copy_owner'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '15.1', $name, $desc, $html, $help, $clas, $tags); $name = __('FE Albums public', 'wp-photo-album-plus'); $desc = __('Frontend created albums are --- public ---', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_frontend_album_public'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,access,album'; wppa_setting($slug, '16', $name, $desc, $html, $help, $clas, $tags); $name = __('Optimize files', 'wp-photo-album-plus'); $desc = __('Optimize image files right after upload/import', 'wp-photo-album-plus'); $help = esc_js(__('This option requires the plugin EWWW Image Optimizer to be activated', 'wp-photo-album-plus')); $slug = 'wppa_optimize_new'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags); $name = __('Default album linktype', 'wp-photo-album-plus'); $desc = __('The album linktype for new albums', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_default_album_linktype'; $opts = array(__('the sub-albums and thumbnails', 'wp-photo-album-plus'), __('the sub-albums', 'wp-photo-album-plus'), __('the thumbnails', 'wp-photo-album-plus'), __('the album photos as slideshow', 'wp-photo-album-plus'), __('no link at all', 'wp-photo-album-plus')); $vals = array('content', 'albums', 'thumbs', 'slide', 'none'); $html = wppa_select($slug, $opts, $vals); wppa_setting($slug, '18', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('E', '1', __('Search Albums and Photos related settings', 'wp-photo-album-plus')); $name = __('Search page', 'wp-photo-album-plus'); $desc = __('Display the search results on page.', 'wp-photo-album-plus'); $help = esc_js(__('Select the page to be used to display search results. The page MUST contain [wppa][/wppa].', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('You may give it the title "Search results" or something alike.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Or you ou may use the standard page on which you display the generic album.', 'wp-photo-album-plus')); $slug = 'wppa_search_linkpage'; wppa_verify_page($slug); $query = "SELECT ID, post_title, post_content FROM " . $wpdb->posts . " WHERE post_type = 'page' AND post_status = 'publish' ORDER BY post_title ASC"; $pages = $wpdb->get_results($query, ARRAY_A); $options = false; $values = false; $options[] = __('--- Please select a page ---', 'wp-photo-album-plus'); $values[] = '0'; if ($pages) { if (wppa_switch('hier_pagesel')) { $pages = wppa_add_parents($pages); } else { // Just translate foreach (array_keys($pages) as $index) { $pages[$index]['post_title'] = __(stripslashes($pages[$index]['post_title']), 'wp-photo-album-plus'); } } $pages = wppa_array_sort($pages, 'post_title'); foreach ($pages as $page) { if (strpos($page['post_content'], '%%wppa%%') !== false || strpos($page['post_content'], '[wppa') !== false) { $options[] = __($page['post_title'], 'wp-photo-album-plus'); $values[] = $page['ID']; } else { $options[] = '|' . __($page['post_title'], 'wp-photo-album-plus') . '|'; $values[] = $page['ID']; } } } $clas = ''; $tags = 'system,search,page'; $html = wppa_select($slug, $options, $values, '', '', true); wppa_setting(false, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Exclude separate', 'wp-photo-album-plus'); $desc = __('Do not search \'separate\' albums.', 'wp-photo-album-plus'); $help = esc_js(__('When checked, albums (and photos in them) that have the parent set to --- separate --- will be excluded from being searched.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Except when you start searching in a \'saparate\' album, with the "search in current section" box ticked.', 'wp-photo-album-plus')); $slug = 'wppa_excl_sep'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,search'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Include tags', 'wp-photo-album-plus'); $desc = __('Do also search the photo tags.', 'wp-photo-album-plus'); $help = esc_js(__('When checked, the tags of the photo will also be searched.', 'wp-photo-album-plus')); $slug = 'wppa_search_tags'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,search,meta'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Include categories', 'wp-photo-album-plus'); $desc = __('Do also search the album categories.', 'wp-photo-album-plus'); $help = esc_js(__('When checked, the categories of the album will also be searched.', 'wp-photo-album-plus')); $slug = 'wppa_search_cats'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,search,meta'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Include comments', 'wp-photo-album-plus'); $desc = __('Do also search the comments on photos.', 'wp-photo-album-plus'); $help = esc_js(__('When checked, the comments of the photos will also be searched.', 'wp-photo-album-plus')); $slug = 'wppa_search_comments'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,search,comment'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Photos only', 'wp-photo-album-plus'); $desc = __('Search for photos only.', 'wp-photo-album-plus'); $help = esc_js(__('When checked, only photos will be searched for.', 'wp-photo-album-plus')); $slug = 'wppa_photos_only'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,search'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); /* per 5.5.0 indexed search only $name = __('Indexed search'); $desc = __('Searching uses index db table.'); $help = ''; $slug = 'wppa_indexed_search'; $onchange = 'wppaCheckIndexSearch()'; $html = wppa_checkbox($slug, $onchange); wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); */ $name = __('Max albums found', 'wp-photo-album-plus'); $desc = __('The maximum number of albums to be displayed.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_max_search_albums'; $html = wppa_input($slug, '50px'); $clas = ''; $tags = 'system,search,count'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Max photos found', 'wp-photo-album-plus'); $desc = __('The maximum number of photos to be displayed.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_max_search_photos'; $html = wppa_input($slug, '50px'); $clas = ''; $tags = 'system,search,count'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Tags OR only', 'wp-photo-album-plus'); $desc = __('No and / or buttons', 'wp-photo-album-plus'); $help = esc_js(__('Hide the and/or radiobuttons and do the or method in the multitag widget and shortcode.', 'wp-photo-album-plus')); $slug = 'wppa_tags_or_only'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,search'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Tags add Inverse', 'wp-photo-album-plus'); $desc = __('Add a checkbox to invert the selection.', 'wp-photo-album-plus'); $help = esc_js(__('Adds an Invert (NOT) checkbox on the multitag widget and shortcode.', 'wp-photo-album-plus')); $slug = 'wppa_tags_not_on'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,search'; wppa_setting($slug, '10.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Floating searchtoken', 'wp-photo-album-plus'); $desc = __('A match need not start at the first char.', 'wp-photo-album-plus'); $help = esc_js(__('A match is found while searching also when the entered token is somewhere in the middle of a word.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('This works in indexed search only!', 'wp-photo-album-plus')); $slug = 'wppa_wild_front'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,search'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Search results display', 'wp-photo-album-plus'); $desc = __('Select the way the search results should be displayed.', 'wp-photo-album-plus'); $help = esc_js(__('If you select anything different from "Albums and thumbnails", "Photos only" is assumed (Table IX-E6).', 'wp-photo-album-plus')); $slug = 'wppa_search_display_type'; $opts = array(__('Albums and thumbnails', 'wp-photo-album-plus'), __('Slideshow', 'wp-photo-album-plus'), __('Slideonly slideshow', 'wp-photo-album-plus')); $vals = array('content', 'slide', 'slideonly'); $html = wppa_select($slug, $opts, $vals); $clas = ''; $tags = 'system,search,layout'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Name max length', 'wp-photo-album-plus'); $desc = __('Max length of displayed photonames in supersearch selectionlist', 'wp-photo-album-plus'); $help = esc_js(__('To limit the length of the selectionlist, enter the number of characters to show.', 'wp-photo-album-plus')); $slug = 'wppa_ss_name_max'; $html = $html = wppa_input($slug, '50px'); $clas = ''; $tags = 'system,search'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); $name = __('Text max length', 'wp-photo-album-plus'); $desc = __('Max length of displayed photo text in supersearch selectionlist', 'wp-photo-album-plus'); $help = esc_js(__('To limit the length of the selectionlist, enter the number of characters to show.', 'wp-photo-album-plus')); $slug = 'wppa_ss_text_max'; $html = $html = wppa_input($slug, '50px'); $clas = ''; $tags = 'system,search'; wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); $name = __('Search toptext', 'wp-photo-album-plus'); $desc = __('The text at the top of the search box.', 'wp-photo-album-plus'); $help = esc_js(__('May contain unfiltered HTML.', 'wp-photo-album-plus')); $slug = 'wppa_search_toptext'; $html = wppa_textarea($slug, $name); $clas = ''; $tags = 'system,search'; wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags); $name = __('Section search text', 'wp-photo-album-plus'); $desc = __('The labeltext at the checkbox.', 'wp-photo-album-plus'); $help = ' '; $slug = 'wppa_search_in_section'; $html = wppa_input($slug, '300px;'); $clas = ''; $tags = 'system,search'; wppa_setting($slug, '16', $name, $desc, $html, $help, $clas, $tags); $name = __('Results search text', 'wp-photo-album-plus'); $desc = __('The labeltext at the checkbox.', 'wp-photo-album-plus'); $help = ' '; $slug = 'wppa_search_in_results'; $html = wppa_input($slug, '300px;'); $clas = ''; $tags = 'system,search'; wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('F', '1', __('Watermark related settings', 'wp-photo-album-plus')); $name = __('Watermark', 'wp-photo-album-plus'); $desc = __('Enable the application of watermarks.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, photos can be watermarked during upload / import.', 'wp-photo-album-plus')); $slug = 'wppa_watermark_on'; $onchange = 'wppaCheckWatermark()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'water,upload'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Watermark file', 'wp-photo-album-plus'); $desc = __('The default watermarkfile to be used.', 'wp-photo-album-plus'); $help = esc_js(__('Watermark files are of type png and reside in', 'wp-photo-album-plus') . ' ' . WPPA_UPLOAD_URL . '/watermarks/'); $help .= '\\n\\n' . esc_js(__('A suitable watermarkfile typically consists of a transparent background and a black text or drawing.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__(sprintf('The watermark image will be overlaying the photo with %s%% transparency.', 100 - wppa_opt('watermark_opacity')), 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('You may also select one of the textual watermark types at the bottom of the selection list.', 'wp-photo-album-plus')); $slug = 'wppa_watermark_file'; $html = '<select style="float:left; font-size:11px; height:20px; margin:0 4px 0 0; padding:0; " id="wppa_watermark_file" onchange="wppaAjaxUpdateOptionValue(\'watermark_file\', this)" >' . wppa_watermark_file_select('default') . '</select>'; $html .= '<img id="img_watermark_file" src="' . wppa_get_imgdir() . 'star.ico" title="' . __('Setting unmodified', 'wp-photo-album-plus') . '" style="padding-left:4px; float:left; height:16px; width:16px;" />'; $html .= '<span style="float:left; margin-left:12px;" >' . __('position:', 'wp-photo-album-plus') . '</span><select style="float:left; font-size:11px; height:20px; margin:0 0 0 20px; padding:0; " id="wppa_watermark_pos" onchange="wppaAjaxUpdateOptionValue(\'watermark_pos\', this)" >' . wppa_watermark_pos_select('default') . '</select>'; $html .= '<img id="img_watermark_pos" src="' . wppa_get_imgdir() . 'star.ico" title="' . __('Setting unmodified', 'wp-photo-album-plus') . '" style="padding-left:4px; float:left; height:16px; width:16px;" />'; $clas = 'wppa_watermark'; $tags = 'water'; wppa_setting(false, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Upload watermark', 'wp-photo-album-plus'); $desc = __('Upload a new watermark file', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_watermark_upload'; $html = '<input id="my_file_element" type="file" name="file_1" style="float:left; font-size: 11px;" />'; $html .= wppa_doit_button(__('Upload watermark image', 'wp-photo-album-plus'), $slug, '', '31', '16'); $clas = 'wppa_watermark'; $tags = 'water,upload'; wppa_setting(false, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Watermark opacity image', 'wp-photo-album-plus'); $desc = __('You can set the intensity of image watermarks here.', 'wp-photo-album-plus'); $help = esc_js(__('The higher the number, the intenser the watermark. Value must be > 0 and <= 100.', 'wp-photo-album-plus')); $slug = 'wppa_watermark_opacity'; $html = wppa_input($slug, '50px', '', '%'); $clas = 'wppa_watermark'; $tags = 'water'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Textual watermark style', 'wp-photo-album-plus'); $desc = __('The way the textual watermarks look like', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_textual_watermark_type'; $clas = 'wppa_watermark'; $sopts = array(__('TV subtitle style', 'wp-photo-album-plus'), __('White text on black background', 'wp-photo-album-plus'), __('Black text on white background', 'wp-photo-album-plus'), __('Reverse TV style (Utopia)', 'wp-photo-album-plus'), __('White on transparent background', 'wp-photo-album-plus'), __('Black on transparent background', 'wp-photo-album-plus')); $svals = array('tvstyle', 'whiteonblack', 'blackonwhite', 'utopia', 'white', 'black'); $font = wppa_opt('textual_watermark_font'); $onchange = 'wppaCheckFontPreview()'; $html = wppa_select($slug, $sopts, $svals, $onchange); $preview = '<img style="background-color:#777;" id="wm-type-preview" src="" />'; $clas = 'wppa_watermark'; $tags = 'water'; wppa_setting($slug, '6', $name, $desc, $html . ' ' . $preview, $help, $clas); $name = __('Predefined watermark text', 'wp-photo-album-plus'); $desc = __('The text to use when --- pre-defined --- is selected.', 'wp-photo-album-plus'); $help = esc_js(__('You may use the following keywords:', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('w#site, w#displayname, all standard photo keywords, iptc and exif keywords', 'wp-photo-album-plus')); $slug = 'wppa_textual_watermark_text'; $html = wppa_textarea($slug, $name); $clas = 'wppa_watermark'; $tags = 'water'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Textual watermark font', 'wp-photo-album-plus'); $desc = __('The font to use with textusl watermarks.', 'wp-photo-album-plus'); $help = esc_js(__('Except for the system font, are font files of type ttf and reside in', 'wp-photo-album-plus') . ' ' . WPPA_UPLOAD_URL . '/fonts/'); $slug = 'wppa_textual_watermark_font'; $fopts = array('System'); $fvals = array('system'); $style = wppa_opt('textual_watermark_type'); $fonts = glob(WPPA_UPLOAD_PATH . '/fonts/*.ttf'); sort($fonts); foreach ($fonts as $font) { $f = basename($font); $f = preg_replace('/\\.[^.]*$/', '', $f); $F = strtoupper(substr($f, 0, 1)) . substr($f, 1); $fopts[] = $F; $fvals[] = $f; } $onchange = 'wppaCheckFontPreview()'; $html = wppa_select($slug, $fopts, $fvals, $onchange); $preview = '<img style="background-color:#777;" id="wm-font-preview" src="" />'; $clas = 'wppa_watermark'; $tags = 'water'; wppa_setting($slug, '8', $name, $desc, $html . ' ' . $preview, $help, $clas); foreach (array_keys($sopts) as $skey) { foreach (array_keys($fopts) as $fkey) { wppa_create_textual_watermark_file(array('content' => '---preview---', 'font' => $fvals[$fkey], 'text' => $sopts[$skey], 'style' => $svals[$skey], 'filebasename' => $svals[$skey] . '-' . $fvals[$fkey])); wppa_create_textual_watermark_file(array('content' => '---preview---', 'font' => $fvals[$fkey], 'text' => $fopts[$fkey], 'style' => $svals[$skey], 'filebasename' => $fvals[$fkey] . '-' . $svals[$skey])); } } $name = __('Textual watermark font size', 'wp-photo-album-plus'); $desc = __('You can set the size of the truetype fonts only.', 'wp-photo-album-plus'); $help = esc_js(__('System font can have size 1,2,3,4 or 5, in some stoneage fontsize units. Any value > 5 will be treated as 5.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Truetype fonts can have any positive integer size, if your PHPs GD version is 1, in pixels, in GD2 in points.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('It is unclear howmany pixels a point is...', 'wp-photo-album-plus')); $slug = 'wppa_textual_watermark_size'; $html = wppa_input($slug, '50px', '', 'points'); $clas = 'wppa_watermark'; $tags = 'water'; wppa_setting($slug, '8.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Foreground color', 'wp-photo-album-plus'); $desc = __('Textual watermark foreground color (black).', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_watermark_fgcol_text'; $onch = 'wppaRefreshAfter();'; $html = wppa_input_color($slug, '100px;', '', '', $onch); $clas = 'wppa_watermark'; $tags = 'water'; wppa_setting($slug, '8.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Background color', 'wp-photo-album-plus'); $desc = __('Textual watermark background color (white).', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_watermark_bgcol_text'; $onch = 'wppaRefreshAfter();'; $html = wppa_input_color($slug, '100px;', '', '', $onch); $clas = 'wppa_watermark'; $tags = 'water'; wppa_setting($slug, '8.3', $name, $desc, $html, $help, $clas, $tags); $name = __('Upload watermark font', 'wp-photo-album-plus'); $desc = __('Upload a new watermark font file', 'wp-photo-album-plus'); $help = esc_js(__('Upload truetype fonts (.ttf) only, and test if they work on your server platform.', 'wp-photo-album-plus')); $slug = 'wppa_watermark_font_upload'; $html = '<input id="my_file_element" type="file" name="file_2" style="float:left; font-size: 11px;" />'; $html .= wppa_doit_button(__('Upload TrueType font', 'wp-photo-album-plus'), $slug, '', '31', '16'); $clas = 'wppa_watermark'; $tags = 'water,upload'; wppa_setting(false, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Watermark opacity text', 'wp-photo-album-plus'); $desc = __('You can set the intensity of a text watermarks here.', 'wp-photo-album-plus'); $help = esc_js(__('The higher the number, the intenser the watermark. Value must be > 0 and <= 100.', 'wp-photo-album-plus')); $slug = 'wppa_watermark_opacity_text'; $html = wppa_input($slug, '50px', '', '%'); $clas = 'wppa_watermark'; $tags = 'water'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Preview', 'wp-photo-album-plus'); $desc = __('A real life preview. To update: refresh the page.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_watermark_preview'; $id = $wpdb->get_var("SELECT `id` FROM `" . WPPA_PHOTOS . "` ORDER BY RAND() LIMIT 1"); $tr = floor(127 * (100 - wppa_opt('watermark_opacity_text')) / 100); $args = array('id' => $id, 'content' => '---predef---', 'pos' => 'cencen', 'url' => true, 'width' => '1000', 'height' => '400', 'transp' => $tr); $html = '<div style="text-align:center; max-width:400px; overflow:hidden; background-image:url(' . WPPA_UPLOAD_URL . '/fonts/turkije.jpg);" ><img src="' . wppa_create_textual_watermark_file($args) . '?ver=' . rand(0, 4711) . '" /></div><div style="clear:both;"></div>'; $clas = 'wppa_watermark'; $tags = 'water'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Watermark thumbnails', 'wp-photo-album-plus'); $desc = __('Watermark also the thumbnail image files.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_watermark_thumbs'; $html = wppa_checkbox($slug); $clas = 'wppa_watermark'; $tags = 'water,thumb'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('G', '1', __('Slideshow elements sequence order settings', 'wp-photo-album-plus')); if (wppa_switch('split_namedesc')) { $indexopt = wppa_opt('slide_order_split'); $indexes = explode(',', $indexopt); $names = array(__('StartStop', 'wp-photo-album-plus'), __('SlideFrame', 'wp-photo-album-plus'), __('Name', 'wp-photo-album-plus'), __('Desc', 'wp-photo-album-plus'), __('Custom', 'wp-photo-album-plus'), __('Rating', 'wp-photo-album-plus'), __('FilmStrip', 'wp-photo-album-plus'), __('Browsebar', 'wp-photo-album-plus'), __('Comments', 'wp-photo-album-plus'), __('IPTC data', 'wp-photo-album-plus'), __('EXIF data', 'wp-photo-album-plus'), __('Share box', 'wp-photo-album-plus')); $enabled = '<span style="color:green; float:right;">( ' . __('Enabled', 'wp-photo-album-plus'); $disabled = '<span style="color:orange; float:right;">( ' . __('Disabled', 'wp-photo-album-plus'); $descs = array(__('Start/Stop & Slower/Faster navigation bar', 'wp-photo-album-plus') . (wppa_switch('show_startstop_navigation') ? $enabled : $disabled) . ' II-B1 )</span>', __('The Slide Frame', 'wp-photo-album-plus') . '<span style="float:right;">' . __('( Always )', 'wp-photo-album-plus') . '</span>', __('Photo Name Box', 'wp-photo-album-plus') . (wppa_switch('show_full_name') ? $enabled : $disabled) . ' II-B5 )</span>', __('Photo Description Box', 'wp-photo-album-plus') . (wppa_switch('show_full_desc') ? $enabled : $disabled) . ' II-B6 )</span>', __('Custom Box', 'wp-photo-album-plus') . (wppa_switch('custom_on') ? $enabled : $disabled) . ' II-B14 )</span>', __('Rating Bar', 'wp-photo-album-plus') . (wppa_switch('rating_on') ? $enabled : $disabled) . ' II-B7 )</span>', __('Film Strip with embedded Start/Stop and Goto functionality', 'wp-photo-album-plus') . (wppa_switch('filmstrip') ? $enabled : $disabled) . ' II-B3 )</span>', __('Browse Bar with Photo X of Y counter', 'wp-photo-album-plus') . (wppa_switch('show_browse_navigation') ? $enabled : $disabled) . ' II-B2 )</span>', __('Comments Box', 'wp-photo-album-plus') . (wppa_switch('show_comments') ? $enabled : $disabled) . ' II-B10 )</span>', __('IPTC box', 'wp-photo-album-plus') . (wppa_switch('show_iptc') ? $enabled : $disabled) . ' II-B17 )</span>', __('EXIF box', 'wp-photo-album-plus') . (wppa_switch('show_exif') ? $enabled : $disabled) . ' II-B18 )</span>', __('Social media share box', 'wp-photo-album-plus') . (wppa_switch('share_on') ? $enabled : $disabled) . ' II-C1 )</span>'); $i = '0'; while ($i < '12') { $name = $names[$indexes[$i]]; $desc = $descs[$indexes[$i]]; $html = $i == '0' ? ' ' : wppa_doit_button(__('Move Up', 'wp-photo-album-plus'), 'wppa_moveup', $i); $help = ''; $slug = 'wppa_slide_order'; $clas = ''; $tags = 'slide,layout'; wppa_setting($slug, $indexes[$i] + 1, $name, $desc, $html, $help, $clas, $tags); $i++; } } else { $indexopt = wppa_opt('slide_order'); $indexes = explode(',', $indexopt); $names = array(__('StartStop', 'wp-photo-album-plus'), __('SlideFrame', 'wp-photo-album-plus'), __('NameDesc', 'wp-photo-album-plus'), __('Custom', 'wp-photo-album-plus'), __('Rating', 'wp-photo-album-plus'), __('FilmStrip', 'wp-photo-album-plus'), __('Browsebar', 'wp-photo-album-plus'), __('Comments', 'wp-photo-album-plus'), __('IPTC data', 'wp-photo-album-plus'), __('EXIF data', 'wp-photo-album-plus'), __('Share box', 'wp-photo-album-plus')); $enabled = '<span style="color:green; float:right;">( ' . __('Enabled', 'wp-photo-album-plus'); $disabled = '<span style="color:orange; float:right;">( ' . __('Disabled', 'wp-photo-album-plus'); $descs = array(__('Start/Stop & Slower/Faster navigation bar', 'wp-photo-album-plus') . (wppa_switch('show_startstop_navigation') ? $enabled : $disabled) . ' II-B1 )</span>', __('The Slide Frame', 'wp-photo-album-plus') . '<span style="float:right;">' . __('( Always )', 'wp-photo-album-plus') . '</span>', __('Photo Name & Description Box', 'wp-photo-album-plus') . (wppa_switch('show_full_name') || wppa_switch('show_full_desc') ? $enabled : $disabled) . ' II-B5,6 )</span>', __('Custom Box', 'wp-photo-album-plus') . (wppa_switch('custom_on') ? $enabled : $disabled) . ' II-B14 )</span>', __('Rating Bar', 'wp-photo-album-plus') . (wppa_switch('rating_on') ? $enabled : $disabled) . ' II-B7 )</span>', __('Film Strip with embedded Start/Stop and Goto functionality', 'wp-photo-album-plus') . (wppa_switch('filmstrip') ? $enabled : $disabled) . ' II-B3 )</span>', __('Browse Bar with Photo X of Y counter', 'wp-photo-album-plus') . (wppa_switch('show_browse_navigation') ? $enabled : $disabled) . ' II-B2 )</span>', __('Comments Box', 'wp-photo-album-plus') . (wppa_switch('show_comments') ? $enabled : $disabled) . ' II-B10 )</span>', __('IPTC box', 'wp-photo-album-plus') . (wppa_switch('show_iptc') ? $enabled : $disabled) . ' II-B17 )</span>', __('EXIF box', 'wp-photo-album-plus') . (wppa_switch('show_exif') ? $enabled : $disabled) . ' II-B18 )</span>', __('Social media share box', 'wp-photo-album-plus') . (wppa_switch('share_on') ? $enabled : $disabled) . ' II-C1 )</span>'); $i = '0'; while ($i < '11') { $name = $names[$indexes[$i]]; $desc = $descs[$indexes[$i]]; $html = $i == '0' ? ' ' : wppa_doit_button(__('Move Up', 'wp-photo-album-plus'), 'wppa_moveup', $i); $help = ''; $slug = 'wppa_slide_order'; $clas = ''; $tags = 'slide,layout'; wppa_setting($slug, $indexes[$i] + 1, $name, $desc, $html, $help, $clas, $tags); $i++; } } $name = __('Swap Namedesc', 'wp-photo-album-plus'); $desc = __('Swap the order sequence of name and description', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_swap_namedesc'; $html = wppa_checkbox($slug); $clas = 'swap_namedesc'; $tags = 'slide,layout,meta'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Split Name and Desc', 'wp-photo-album-plus'); $desc = __('Put Name and Description in separate boxes', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_split_namedesc'; $html = wppa_checkbox($slug, 'alert(\'' . __('Please reload this page after the green checkmark appears!', 'wp-photo-album-plus') . '\');wppaCheckSplitNamedesc();'); $clas = ''; $tags = 'slide,layout,meta'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('H', '1', __('Source file management and other upload/import settings and actions.', 'wp-photo-album-plus')); $name = __('Keep sourcefiles admin', 'wp-photo-album-plus'); $desc = __('Keep the original uploaded and imported photo files.', 'wp-photo-album-plus'); $help = esc_js(__('The files will be kept in a separate directory with subdirectories for each album', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('These files can be used to update the photos used in displaying in wppa+ and optionally for downloading original, un-downsized images.', 'wp-photo-album-plus')); $slug = 'wppa_keep_source_admin'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Keep sourcefiles frontend', 'wp-photo-album-plus'); $desc = __('Keep the original frontend uploaded photo files.', 'wp-photo-album-plus'); $help = esc_js(__('The files will be kept in a separate directory with subdirectories for each album', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('These files can be used to update the photos used in displaying in wppa+ and optionally for downloading original, un-downsized images.', 'wp-photo-album-plus')); $slug = 'wppa_keep_source_frontend'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Source directory', 'wp-photo-album-plus'); $desc = __('The path to the directory where the original photofiles will be saved.', 'wp-photo-album-plus'); $help = esc_js(__('You may change the directory path, but it can not be an url.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('The parent of the directory that you enter here must exist and be writable.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('The directory itsself will be created if it does not exist yet.', 'wp-photo-album-plus')); $slug = 'wppa_source_dir'; $html = wppa_input($slug, '300px'); $clas = ''; $tags = 'system'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('Keep sync', 'wp-photo-album-plus'); $desc = __('Keep source synchronously with wppa system.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, photos that are deleted from wppa, will also be removed from the sourcefiles.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Also, copying or moving photos to different albums, will also copy/move the sourcefiles.', 'wp-photo-album-plus')); $slug = 'wppa_keep_sync'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('Remake add', 'wp-photo-album-plus'); $desc = __('Photos will be added from the source pool', 'wp-photo-album-plus'); $help = esc_js(__('If checked: If photo files are found in the source directory that do not exist in the corresponding album, they will be added to the album.', 'wp-photo-album-plus')); $slug = 'wppa_remake_add'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Save IPTC data', 'wp-photo-album-plus'); $desc = __('Store the iptc data from the photo into the iptc db table', 'wp-photo-album-plus'); $help = esc_js(__('You will need this if you enabled the display of iptc data in Table II-B17 or if you use it in the photo descriptions.', 'wp-photo-album-plus')); $slug = 'wppa_save_iptc'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,meta'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Save EXIF data', 'wp-photo-album-plus'); $desc = __('Store the exif data from the photo into the exif db table', 'wp-photo-album-plus'); $help = esc_js(__('You will need this if you enabled the display of exif data in Table II-B18 or if you use it in the photo descriptions.', 'wp-photo-album-plus')); $slug = 'wppa_save_exif'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,meta'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); $name = __('Max EXIF tag array size', 'wp-photo-album-plus'); $desc = __('Truncate array tags to ...', 'wp-photo-album-plus'); $help = esc_js(__('A value of 0 disables this feature', 'wp-photo-album-plus')); $slug = 'wppa_exif_max_array_size'; $html = wppa_input($slug, '40px', '', __('elements', 'wp-photo-album-plus')); $clas = ''; $tags = 'system,meta'; wppa_setting($slug, '9', $name, $desc, $html, $help, $clas, $tags); $name = __('Import Create page', 'wp-photo-album-plus'); $desc = __('Create wp page when a directory to album is imported.', 'wp-photo-album-plus'); $help = esc_js(__('As soon as an album is created when a directory is imported, a wp page is made that displays the album content.', 'wp-photo-album-plus')); $slug = 'wppa_newpag_create'; $onchange = 'wppaCheckNewpag()'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'system,page'; wppa_setting($slug, '10', $name, $desc, $html, $help, $clas, $tags); $name = __('Page content', 'wp-photo-album-plus'); $desc = __('The content of the page. Must contain <b>w#album</b>', 'wp-photo-album-plus'); $help = esc_js(__('The content of the page. Note: it must contain w#album. This will be replaced by the album number in the generated shortcode.', 'wp-photo-album-plus')); $slug = 'wppa_newpag_content'; $clas = 'wppa_newpag'; $html = wppa_input($slug, '90%'); $clas = ''; $tags = 'system,page'; wppa_setting($slug, '11', $name, $desc, $html, $help, $clas, $tags); $name = __('Page type', 'wp-photo-album-plus'); $desc = __('Select the type of page to create.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_newpag_type'; $clas = 'wppa_newpag'; $options = array(__('Page', 'wp-photo-album-plus'), __('Post', 'wp-photo-album-plus')); $values = array('page', 'post'); $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'system,page'; wppa_setting($slug, '12', $name, $desc, $html, $help, $clas, $tags); $name = __('Page status', 'wp-photo-album-plus'); $desc = __('Select the initial status of the page.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_newpag_status'; $clas = 'wppa_newpag'; $options = array(__('Published', 'wp-photo-album-plus'), __('Draft', 'wp-photo-album-plus')); $values = array('publish', 'draft'); // 'draft' | 'publish' | 'pending'| 'future' | 'private' $html = wppa_select($slug, $options, $values); $clas = ''; $tags = 'system,page'; wppa_setting($slug, '13', $name, $desc, $html, $help, $clas, $tags); if (!is_multisite() || WPPA_MULTISITE_GLOBAL) { $name = __('Permalink root', 'wp-photo-album-plus'); $desc = __('The name of the root for the photofile permalink structure.', 'wp-photo-album-plus'); $help = esc_js(__('Choose a convenient name like "albums" or so; this will be the name of a folder inside .../wp-content/. Make sure you choose a unique name', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('If you make this field empty, the feature is disabled.', 'wp-photo-album-plus')); $slug = 'wppa_pl_dirname'; $clas = ''; $tags = 'system'; $html = wppa_input($slug, '150px'); wppa_setting($slug, '14', $name, $desc, $html, $help, $clas, $tags); } $name = __('Import parent check', 'wp-photo-album-plus'); $desc = __('On import dirs to albums: keep dir tree as albums.', 'wp-photo-album-plus'); $help = esc_js(__('Untick only if all your albums have unique names. Then: additional photos may be ftp\'d to toplevel depot subdirs.', 'wp-photo-album-plus')); $slug = 'wppa_import_parent_check'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,upload'; wppa_setting($slug, '15', $name, $desc, $html, $help, $clas, $tags); $name = __('IPTC need utf8 conversion', 'wp-photo-album-plus'); $desc = __('This setting converts iso to utf8 in iptc text.', 'wp-photo-album-plus'); $help = esc_js(__('Untick if you have funny characters in iptc data', 'wp-photo-album-plus')); $slug = 'wppa_iptc_need_utf8'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,upload,meta'; wppa_setting($slug, '16', $name, $desc, $html, $help, $clas, $tags); $name = __('Keep dir to album files', 'wp-photo-album-plus'); $desc = __('Keep imported files after dir to album import', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_keep_import_files'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,upload'; wppa_setting($slug, '17', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('J', '1', __('Other plugins related settings', 'wp-photo-album-plus')); $name = __('Foreign shortcodes general', 'wp-photo-album-plus'); $desc = __('Enable foreign shortcodes in album names, albums desc and photo names', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_allow_foreign_shortcodes_general'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,album,cover,meta,slide'; wppa_setting($slug, '0', $name, $desc, $html, $help, $clas, $tags); $name = __('Foreign shortcodes fullsize', 'wp-photo-album-plus'); $desc = __('Enable the use of non-wppa+ shortcodes in fullsize photo descriptions.', 'wp-photo-album-plus'); $help = esc_js(__('When checked, you can use shortcodes from other plugins in the description of photos.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('The shortcodes will be expanded in the descriptions of fullsize images.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('You will most likely need also to check Table IX-A1 (Allow HTML).', 'wp-photo-album-plus')); $slug = 'wppa_allow_foreign_shortcodes'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,slide,meta'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('Foreign shortcodes thumbnails', 'wp-photo-album-plus'); $desc = __('Enable the use of non-wppa+ shortcodes in thumbnail photo descriptions.', 'wp-photo-album-plus'); $help = esc_js(__('When checked, you can use shortcodes from other plugins in the description of photos.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('The shortcodes will be expanded in the descriptions of thumbnail images.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('You will most likely need also to check Table IX-A1 (Allow HTML).', 'wp-photo-album-plus')); $slug = 'wppa_allow_foreign_shortcodes_thumbs'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system,thumb,meta'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('Lightbox keyname', 'wp-photo-album-plus'); $desc = __('The identifier of lightbox.', 'wp-photo-album-plus'); $help = esc_js(__('If you use a lightbox plugin that uses rel="lbox-id" you can enter the lbox-id here.', 'wp-photo-album-plus')); $slug = 'wppa_lightbox_name'; $html = wppa_input($slug, '100px'); $clas = 'wppa_alt_lightbox'; $tags = 'system'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('myCRED / Cube Points: Comment', 'wp-photo-album-plus'); $desc = __('Number of points for giving a comment', 'wp-photo-album-plus'); $help = esc_js(__('This setting requires the plugin myCRED or Cube Points', 'wp-photo-album-plus')); $slug = 'wppa_cp_points_comment'; $html = wppa_input($slug, '50px', '', __('points per comment', 'wp-photo-album-plus')); $clas = ''; $tags = 'system,comment'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); $name = __('myCRED / Cube Points: Appr Comment', 'wp-photo-album-plus'); $desc = __('Number of points for receiving an approved comment', 'wp-photo-album-plus'); $help = esc_js(__('This setting requires the plugin myCRED or Cube Points', 'wp-photo-album-plus')); $slug = 'wppa_cp_points_comment_appr'; $html = wppa_input($slug, '50px', '', __('points per comment', 'wp-photo-album-plus')); $clas = ''; $tags = 'system,comment'; wppa_setting($slug, '4.1', $name, $desc, $html, $help, $clas, $tags); $name = __('myCRED / Cube Points: Rating', 'wp-photo-album-plus'); $desc = __('Number of points for a rating vote', 'wp-photo-album-plus'); $help = esc_js(__('This setting requires the plugin myCRED or Cube Points', 'wp-photo-album-plus')); $slug = 'wppa_cp_points_rating'; $html = wppa_input($slug, '50px', '', __('points per vote', 'wp-photo-album-plus')); $clas = ''; $tags = 'system,rating'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('myCRED / Cube Points: Upload', 'wp-photo-album-plus'); $desc = __('Number of points for a successfull frontend upload', 'wp-photo-album-plus'); $help = esc_js(__('This setting requires the plugin myCRED or Cube Points', 'wp-photo-album-plus')); $slug = 'wppa_cp_points_upload'; $html = wppa_input($slug, '50px', '', __('points per upload', 'wp-photo-album-plus')); $clas = ''; $tags = 'system,upload'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Use SCABN', 'wp-photo-album-plus'); $desc = __('Use the wppa interface to Simple Cart & Buy Now plugin.', 'wp-photo-album-plus'); $help = esc_js(__('If checked, the shortcode to use for the "add to cart" button in photo descriptions is [cart ...]', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('as opposed to [scabn ...] for the original scabn "add to cart" button.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('The shortcode for the check-out page is still [scabn]', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('The arguments are the same, the defaults are: name = photoname, price = 0.01.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Supplying the price should be sufficient; supply a name only when it differs from the photo name.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('This shortcode handler will also work with Ajax enabled.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Using this interface makes sure that the item urls and callback action urls are correct.', 'wp-photo-album-plus')); $slug = 'wppa_use_scabn'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags); $name = __('Use CM Tooltip Glossary', 'wp-photo-album-plus'); $desc = __('Use plugin CM Tooltip Glossary on photo and album descriptions.', 'wp-photo-album-plus'); $help = esc_js(__('You MUST set Table IV-A13: Defer javascript, also if you do not want this plugin to act on album and photo descriptions!', 'wp-photo-album-plus')); $slug = 'wppa_use_CMTooltipGlossary'; $html = wppa_checkbox($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '8', $name, $desc, $html, $help, $clas, $tags); wppa_setting_subheader('K', '1', __('External services related settings and actions.', 'wp-photo-album-plus')); $name = __('QR Code widget size', 'wp-photo-album-plus'); $desc = __('The size of the QR code display.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_qr_size'; $html = wppa_input($slug, '50px', '', __('pixels', 'wp-photo-album-plus')); $clas = ''; $tags = 'system'; wppa_setting($slug, '1', $name, $desc, $html, $help, $clas, $tags); $name = __('QR color', 'wp-photo-album-plus'); $desc = __('The display color of the qr code (dark)', 'wp-photo-album-plus'); $help = esc_js(__('This color MUST be given in hexadecimal format!', 'wp-photo-album-plus')); $slug = 'wppa_qr_color'; $html = wppa_input($slug, '100px', '', '', "checkColor('" . $slug . "')") . wppa_color_box($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '2', $name, $desc, $html, $help, $clas, $tags); $name = __('QR background color', 'wp-photo-album-plus'); $desc = __('The background color of the qr code (light)', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_qr_bgcolor'; $html = wppa_input($slug, '100px', '', '', "checkColor('" . $slug . "')") . wppa_color_box($slug); $clas = ''; $tags = 'system'; wppa_setting($slug, '3', $name, $desc, $html, $help, $clas, $tags); $name = __('CDN Service', 'wp-photo-album-plus'); $desc = __('Select a CDN Service you want to use.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_cdn_service'; $opts = array(__('--- none ---', 'wp-photo-album-plus'), 'Cloudinary', __('Cloudinary in maintenance mode', 'wp-photo-album-plus')); $vals = array('', 'cloudinary', 'cloudinarymaintenance'); $onch = 'wppaCheckCDN()'; $html = wppa_select($slug, $opts, $vals, $onch); $clas = ''; $tags = 'system'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); if (PHP_VERSION_ID >= 50300) { $name = __('Cloud name', 'wp-photo-album-plus'); $desc = ''; $help = ''; $slug = 'wppa_cdn_cloud_name'; $html = wppa_input($slug, '500px'); $clas = 'cloudinary'; $tags = 'system'; wppa_setting($slug, '4.1', $name, $desc, $html, $help, $clas, $tags); $name = __('API key', 'wp-photo-album-plus'); $desc = ''; $help = ''; $slug = 'wppa_cdn_api_key'; $html = wppa_input($slug, '500px'); $clas = 'cloudinary'; $tags = 'system'; wppa_setting($slug, '4.2', $name, $desc, $html, $help, $clas, $tags); $name = __('API secret', 'wp-photo-album-plus'); $desc = ''; $help = ''; $slug = 'wppa_cdn_api_secret'; $html = wppa_input($slug, '500px'); $clas = 'cloudinary'; $tags = 'system'; wppa_setting($slug, '4.3', $name, $desc, $html, $help, $clas, $tags); $name = __('Delete all', 'wp-photo-album-plus'); $desc = '<span style="color:red;" >' . __('Deletes them all !!!', 'wp-photo-album-plus') . '</span>'; $help = ''; $slug = 'wppa_delete_all_from_cloudinary'; $html = wppa_doit_button('', $slug); $clas = 'cloudinary'; $tags = 'system'; wppa_setting(false, '4.5', $name, $desc, $html, $help, $clas, $tags); $name = __('Delete derived images', 'wp-photo-album-plus'); $desc = '<span style="color:red;" >' . __('Deletes all derived images !!!', 'wp-photo-album-plus') . '</span>'; $help = ''; $slug = 'wppa_delete_derived_from_cloudinary'; $html = wppa_doit_button('', $slug); $clas = 'cloudinary'; $tags = 'system'; wppa_setting(false, '4.6', $name, $desc, $html, $help, $clas, $tags); $name = __('Max lifetime', 'wp-photo-album-plus'); $desc = __('Old images from local server, new images from Cloudinary.', 'wp-photo-album-plus'); $help = esc_js(__('If NOT set to Forever: You need to run Table VIII-B15 on a regular basis.', 'wp-photo-album-plus')); $slug = 'wppa_max_cloud_life'; $opts = array(__('Forever', 'wp-photo-album-plus'), sprintf(_n('%d day', '%d days', '1', 'wp-photo-album-plus'), '1'), sprintf(_n('%d week', '%d weeks', '1', 'wp-photo-album-plus'), '1'), sprintf(_n('%d month', '%d months', '1', 'wp-photo-album-plus'), '1'), sprintf(_n('%d month', '%d months', '2', 'wp-photo-album-plus'), '2'), sprintf(_n('%d month', '%d months', '3', 'wp-photo-album-plus'), '3'), sprintf(_n('%d month', '%d months', '6', 'wp-photo-album-plus'), '6'), sprintf(_n('%d month', '%d months', '9', 'wp-photo-album-plus'), '9'), sprintf(_n('%d year', '%d years', '1', 'wp-photo-album-plus'), '1'), sprintf(_n('%d month', '%d months', '18', 'wp-photo-album-plus'), '18'), sprintf(_n('%d year', '%d years', '2', 'wp-photo-album-plus'), '2')); $vals = array(0, 24 * 60 * 60, 7 * 24 * 60 * 60, 31 * 24 * 60 * 60, 61 * 24 * 60 * 60, 92 * 24 * 60 * 60, 183 * 24 * 60 * 60, 274 * 24 * 60 * 60, 365 * 24 * 60 * 60, 548 * 24 * 60 * 60, 730 * 24 * 60 * 60); $onch = ''; $html = wppa_select($slug, $opts, $vals, $onch); $clas = 'cloudinary'; $tags = 'system'; wppa_setting($slug, '4.7', $name, $desc, $html, $help, $clas, $tags); $name = __('Cloudinary usage', 'wp-photo-album-plus'); if (function_exists('wppa_get_cloudinary_usage')) { $data = wppa_get_cloudinary_usage(); if (is_array($data)) { $desc = '<style type="text/css" scoped>table, tbody, tr, td { margin:0; padding:0; border:none; font-size: 9px; line-height: 11px; } td { height:11px; }</style>'; $desc .= '<table style="margin:0;padding:0;border:none:" ><tbody>'; foreach (array_keys($data) as $i) { $item = $data[$i]; if (is_array($item)) { $desc .= '<tr>' . '<td>' . $i . '</td>'; foreach (array_keys($item) as $j) { if ($j == 'used_percent') { $color = 'green'; if ($item[$j] > 80.0) { $color = 'orange'; } if ($item[$j] > 95.0) { $color = 'red'; } $desc .= '<td>' . $j . ': <span style="color:' . $color . '">' . $item[$j] . '</span></td>'; } else { $desc .= '<td>' . $j . ': ' . $item[$j] . '</td>'; } } $desc .= '</tr>'; } else { $desc .= '<tr>' . '<td>' . $i . '</td>' . '<td>' . $item . '</td>' . '<td></td>' . '<td></td>' . '</tr>'; } } $desc .= '</tbody></table>'; } else { $desc = __('Cloudinary usage data not available', 'wp-photo-album-plus'); } } else { $desc = __('Cloudinary routines not installed.', 'wp-photo-album-plus'); } $help = ''; $html = ''; $clas = 'cloudinary'; $tags = 'system'; wppa_setting($slug, '4.8', $name, $desc, $html, $help, $clas, $tags); } else { $name = __('Cloudinary', 'wp-photo-album-plus'); $desc = __('<span style="color:red;">Requires at least PHP version 5.3</span>', 'wp-photo-album-plus'); $help = ''; $html = ''; $clas = 'cloudinary'; $tags = 'system'; wppa_setting($slug, '4', $name, $desc, $html, $help, $clas, $tags); } $name = __('GPX Implementation', 'wp-photo-album-plus'); $desc = __('The way the maps are produced.', 'wp-photo-album-plus'); $help = esc_js(__('Select the way the maps are produced.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('When using Google maps GPX viewer plugin, you can not use Ajax (Table IV-A1)', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('When using WPPA+ Embedded code, you can use Ajax, but there are less display options.', 'wp-photo-album-plus')); $slug = 'wppa_gpx_implementation'; $opts = array(__('--- none ---', 'wp-photo-album-plus'), __('WPPA+ Embedded code', 'wp-photo-album-plus'), __('Google maps GPX viewer plugin', 'wp-photo-album-plus')); $vals = array('none', 'wppa-plus-embedded', 'google-maps-gpx-viewer'); $onch = 'wppaCheckGps();alert(\'' . __('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus') . '\');wppaRefreshAfter();'; $html = wppa_select($slug, $opts, $vals, $onch); $clas = ''; $tags = 'system'; wppa_setting($slug, '5', $name, $desc, $html, $help, $clas, $tags); $name = __('Map height', 'wp-photo-album-plus'); $desc = __('The height of the map display.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_map_height'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = 'wppa_gpx_native'; $tags = 'system'; wppa_setting($slug, '5.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Google maps API key', 'wp-photo-album-plus'); $desc = __('Enter your Google maps api key here if you have one.', 'wp-photo-album-plus'); $help = ''; $slug = 'wppa_map_apikey'; $html = wppa_input($slug, '200px', ''); $clas = 'wppa_gpx_native'; $tags = 'system'; wppa_setting($slug, '5.2', $name, $desc, $html, $help, $clas, $tags); $name = __('GPX Shortcode', 'wp-photo-album-plus'); $desc = __('The shortcode to be used for the gpx feature.', 'wp-photo-album-plus'); $help = esc_js(__('Enter / modify the shortcode to be generated for the gpx plugin. It must contain w#lat and w#lon as placeholders for the lattitude and longitude.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('This item is required for using Google maps GPX viewer plugin only', 'wp-photo-album-plus')); $slug = 'wppa_gpx_shortcode'; $html = wppa_input($slug, '500px'); $clas = 'wppa_gpx_plugin'; $tags = 'system'; wppa_setting($slug, '5.3', $name, $desc, $html, $help, $clas, $tags); $name = __('Fotomoto', 'wp-photo-album-plus'); $desc = __('Yes, we use Fotomoto on this site. Read the help text!', 'wp-photo-album-plus'); $help = esc_js(__('In order to function properly:', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('1. Get yourself a Fotomoto account.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('2. Install the Fotomoto plugin, enter the "Fotomoto Site Key:" and check the "Use API Mode:" checkbox.', 'wp-photo-album-plus')); $help .= '\\n\\n' . esc_js(__('Note: Do NOT Disable the Custom box in Table II-B14.', 'wp-photo-album-plus')); $help .= '\\n' . esc_js(__('Do NOT remove the text w#fotomoto from the Custombox ( Table II-B15 ).', 'wp-photo-album-plus')); $slug = 'wppa_fotomoto_on'; $onchange = 'wppaCheckFotomoto();alert(\'' . __('The page will be reloaded after the action has taken place.', 'wp-photo-album-plus') . '\');wppaRefreshAfter();'; $html = wppa_checkbox($slug, $onchange); $clas = ''; $tags = 'system'; wppa_setting($slug, '6', $name, $desc, $html, $help, $clas, $tags); $name = __('Fotomoto fontsize', 'wp-photo-album-plus'); $desc = __('Fontsize for the Fotomoto toolbar.', 'wp-photo-album-plus'); $help = esc_js(__('If you set it here, it overrules a possible setting for font-size in .FotomotoToolbarClass on the Fotomoto dashboard.', 'wp-photo-album-plus')); $slug = 'wppa_fotomoto_fontsize'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = 'wppa_fotomoto'; $tags = 'system'; wppa_setting($slug, '6.1', $name, $desc, $html, $help, $clas, $tags); $name = __('Hide when running', 'wp-photo-album-plus'); $desc = __('Hide toolbar on running slideshows', 'wp-photo-album-plus'); $help = esc_js(__('The Fotomoto toolbar will re-appear when the slidshow stops.', 'wp-photo-album-plus')); $slug = 'wppa_fotomoto_hide_when_running'; $html = wppa_checkbox($slug); $clas = 'wppa_fotomoto'; $tags = 'system'; wppa_setting($slug, '6.2', $name, $desc, $html, $help, $clas, $tags); $name = __('Fotomoto minwidth', 'wp-photo-album-plus'); $desc = __('Minimum width to display Fotomoto toolbar.', 'wp-photo-album-plus'); $help = esc_js(__('The display of the Fotomoto Toolbar will be suppressed on smaller slideshows.', 'wp-photo-album-plus')); $slug = 'wppa_fotomoto_min_width'; $html = wppa_input($slug, '40px', '', __('pixels', 'wp-photo-album-plus')); $clas = 'wppa_fotomoto'; $tags = 'system'; wppa_setting($slug, '6.3', $name, $desc, $html, $help, $clas, $tags); ?> </tbody> <tfoot style="font-weight: bold;" class="wppa_table_9"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Setting', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </tfoot> </table> </div> <?php // Table 10: IPTC Configuration ?> <?php wppa_settings_box_header('10', __('Table X:', 'wp-photo-album-plus') . ' ' . __('IPTC Configuration:', 'wp-photo-album-plus') . ' ' . __('This table defines the IPTC configuration', 'wp-photo-album-plus')); ?> <div id="wppa_table_10" style="display:none" > <table class="widefat wppa-table wppa-setting-table"> <thead style="font-weight: bold; " class="wppa_table_10"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Tag', 'wp-photo-album-plus'); ?> </td> <td></td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Status', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </thead> <tbody class="wppa_table_10"> <?php $wppa_table = 'X'; $wppa_subtable = 'Z'; $labels = $wpdb->get_results("SELECT * FROM `" . WPPA_IPTC . "` WHERE `photo` = '0' ORDER BY `tag`", ARRAY_A); if (is_array($labels)) { $i = '1'; foreach ($labels as $label) { $name = $label['tag']; $desc = ''; $help = ''; $slug1 = 'wppa_iptc_label_' . $name; $slug2 = 'wppa_iptc_status_' . $name; $html1 = wppa_edit($slug1, $label['description']); $options = array(__('Display', 'wp-photo-album-plus'), __('Hide', 'wp-photo-album-plus'), __('Optional', 'wp-photo-album-plus')); $values = array('display', 'hide', 'option'); $html2 = wppa_select_e($slug2, $label['status'], $options, $values); $html = array($html1, $html2); $clas = ''; $tags = 'meta'; wppa_setting(false, $i, $name, $desc, $html, $help, $clas, $tags); $i++; } } ?> </tbody> <tfoot style="font-weight: bold;" class="wppa_table_10"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Tag', 'wp-photo-album-plus'); ?> </td> <td></td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Status', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </tfoot> </table> </div> <?php // Table 11: EXIF Configuration ?> <?php wppa_settings_box_header('11', __('Table XI:', 'wp-photo-album-plus') . ' ' . __('EXIF Configuration:', 'wp-photo-album-plus') . ' ' . __('This table defines the EXIF configuration', 'wp-photo-album-plus')); ?> <div id="wppa_table_11" style="display:none" > <table class="widefat wppa-table wppa-setting-table"> <thead style="font-weight: bold; " class="wppa_table_11"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Tag', 'wp-photo-album-plus'); ?> </td> <td></td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Status', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </thead> <tbody class="wppa_table_11"> <?php $wppa_table = 'XI'; $wppa_subtable = 'Z'; if (!function_exists('exif_read_data')) { wppa_setting_subheader('', '1', '</b><span style="color:red;">' . __('Function exif_read_data() does not exist. This means that <b>EXIF</b> is not enabled. If you want to use <b>EXIF</b> data, ask your hosting provider to add <b>\'--enable-exif\'</b> to the php <b>Configure Command</b>.', 'wp-photo-album-plus') . '<b></span>'); } $labels = $wpdb->get_results("SELECT * FROM `" . WPPA_EXIF . "` WHERE `photo` = '0' ORDER BY `tag`", ARRAY_A); if (is_array($labels)) { $i = '1'; foreach ($labels as $label) { $name = $label['tag']; $desc = ''; $help = ''; $slug1 = 'wppa_exif_label_' . $name; $slug2 = 'wppa_exif_status_' . $name; $html1 = wppa_edit($slug1, $label['description']); $options = array(__('Display', 'wp-photo-album-plus'), __('Hide', 'wp-photo-album-plus'), __('Optional', 'wp-photo-album-plus')); $values = array('display', 'hide', 'option'); $html2 = wppa_select_e($slug2, $label['status'], $options, $values); $html = array($html1, $html2); $clas = ''; $tags = 'meta'; wppa_setting(false, $i, $name, $desc, $html, $help, $clas, $tags); $i++; } } ?> </tbody> <tfoot style="font-weight: bold;" class="wppa_table_11"> <tr> <td><?php _e('#', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Tag', 'wp-photo-album-plus'); ?> </td> <td></td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Status', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Help', 'wp-photo-album-plus'); ?> </td> </tr> </tfoot> </table> </div> <?php // Table 12: Php configuration ?> <?php wppa_settings_box_header('12', __('Table XII:', 'wp-photo-album-plus') . ' ' . __('WPPA+ and PHP Configuration:', 'wp-photo-album-plus') . ' ' . __('This table lists all WPPA+ constants and PHP server configuration parameters and is read only', 'wp-photo-album-plus')); ?> <?php $wppa_table = 'XII'; $wppa_subtable = 'Z'; ?> <div id="wppa_table_12" style="display:none" > <!-- <div class="wppa_table_12" style="margin-top:20px; text-align:left; "> --> <table class="widefat wppa-table wppa-setting-table"> <thead style="font-weight: bold; " class="wppa_table_12"> <tr> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Value', 'wp-photo-album-plus'); ?> </td> <td></td> </tr> <tbody class="wppa_table_12"> <tr style="color:#333;"> <td>WPPA_ALBUMS</td> <td><small><?php _e('Albums db table name.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_ALBUMS; ?> </td> <td><?php if (wppa_user_is('administrator')) { echo '<a onclick="wppaExportDbTable(\'' . WPPA_ALBUMS . '\')" >' . __('Download', 'wp-photo-album-plus') . ' ' . WPPA_ALBUMS . '.csv' . '</a> ' . '<img id="' . WPPA_ALBUMS . '-spin" src="' . wppa_get_imgdir('spinner.gif') . '" style="display:none;" />'; } ?> </td> </tr> <tr style="color:#333;"> <td>WPPA_PHOTOS</td> <td><small><?php _e('Photos db table name.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_PHOTOS; ?> </td> <td><?php if (wppa_user_is('administrator')) { echo '<a onclick="wppaExportDbTable(\'' . WPPA_PHOTOS . '\')" >' . __('Download', 'wp-photo-album-plus') . ' ' . WPPA_PHOTOS . '.csv' . '</a> ' . '<img id="' . WPPA_PHOTOS . '-spin" src="' . wppa_get_imgdir('spinner.gif') . '" style="display:none;" />'; } ?> </td> </tr> <tr style="color:#333;"> <td>WPPA_RATING</td> <td><small><?php _e('Rating db table name.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_RATING; ?> </td> <td><?php if (wppa_user_is('administrator')) { echo '<a onclick="wppaExportDbTable(\'' . WPPA_RATING . '\')" >' . __('Download', 'wp-photo-album-plus') . ' ' . WPPA_RATING . '.csv' . '</a> ' . '<img id="' . WPPA_RATING . '-spin" src="' . wppa_get_imgdir('spinner.gif') . '" style="display:none;" />'; } ?> </td> </tr> <tr style="color:#333;"> <td>WPPA_COMMENTS</td> <td><small><?php _e('Comments db table name.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_COMMENTS; ?> </td> <td><?php if (wppa_user_is('administrator')) { echo '<a onclick="wppaExportDbTable(\'' . WPPA_COMMENTS . '\')" >' . __('Download', 'wp-photo-album-plus') . ' ' . WPPA_COMMENTS . '.csv' . '</a> ' . '<img id="' . WPPA_COMMENTS . '-spin" src="' . wppa_get_imgdir('spinner.gif') . '" style="display:none;" />'; } ?> </td> </tr> <tr style="color:#333;"> <td>WPPA_IPTC</td> <td><small><?php _e('IPTC db table name.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_IPTC; ?> </td> <td><?php if (wppa_user_is('administrator')) { echo '<a onclick="wppaExportDbTable(\'' . WPPA_IPTC . '\')" >' . __('Download', 'wp-photo-album-plus') . ' ' . WPPA_IPTC . '.csv' . '</a> ' . '<img id="' . WPPA_IPTC . '-spin" src="' . wppa_get_imgdir('spinner.gif') . '" style="display:none;" />'; } ?> </td> </tr> <tr style="color:#333;"> <td>WPPA_EXIF</td> <td><small><?php _e('EXIF db table name.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_EXIF; ?> </td> <td><?php if (wppa_user_is('administrator')) { echo '<a onclick="wppaExportDbTable(\'' . WPPA_EXIF . '\')" >' . __('Download', 'wp-photo-album-plus') . ' ' . WPPA_EXIF . '.csv' . '</a> ' . '<img id="' . WPPA_EXIF . '-spin" src="' . wppa_get_imgdir('spinner.gif') . '" style="display:none;" />'; } ?> </td> </tr> <tr style="color:#333;"> <td>WPPA_INDEX</td> <td><small><?php _e('Index db table name.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_INDEX; ?> </td> <td><?php if (wppa_user_is('administrator')) { echo '<a onclick="wppaExportDbTable(\'' . WPPA_INDEX . '\')" >' . __('Download', 'wp-photo-album-plus') . ' ' . WPPA_INDEX . '.csv' . '</a> ' . '<img id="' . WPPA_INDEX . '-spin" src="' . wppa_get_imgdir('spinner.gif') . '" style="display:none;" />'; } ?> </td> </tr> <tr style="color:#333;"> <td>WPPA_SESSION</td> <td><small><?php _e('Index db table name.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_SESSION; ?> </td> <td><?php if (wppa_user_is('administrator')) { echo '<a onclick="wppaExportDbTable(\'' . WPPA_SESSION . '\')" >' . __('Download', 'wp-photo-album-plus') . ' ' . WPPA_SESSION . '.csv' . '</a> ' . '<img id="' . WPPA_SESSION . '-spin" src="' . wppa_get_imgdir('spinner.gif') . '" style="display:none;" />'; } ?> </td> </tr> <tr style="color:#333;"> <td>WPPA_FILE</td> <td><small><?php _e('Plugins main file name.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_FILE; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>WPPA_ABSPATH</td> <td><small><?php _e('ABSPATH windows proof', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_ABSPATH; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>WPPA_PATH</td> <td><small><?php _e('Path to plugins directory.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_PATH; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>WPPA_NAME</td> <td><small><?php _e('Plugins directory name.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_NAME; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>WPPA_URL</td> <td><small><?php _e('Plugins directory url.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_URL; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>WPPA_UPLOAD</td> <td><small><?php _e('The relative upload directory.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_UPLOAD; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>WPPA_UPLOAD_PATH</td> <td><small><?php _e('The upload directory path.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_UPLOAD_PATH; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>WPPA_UPLOAD_URL</td> <td><small><?php _e('The upload directory url.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_UPLOAD_URL; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>WPPA_DEPOT</td> <td><small><?php _e('The relative depot directory.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_DEPOT; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>WPPA_DEPOT_PATH</td> <td><small><?php _e('The depot directory path.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_DEPOT_PATH; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>WPPA_DEPOT_URL</td> <td><small><?php _e('The depot directory url.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_DEPOT_URL; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>WPPA_CONTENT_PATH</td> <td><small><?php _e('The path to wp-content.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_CONTENT_PATH; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>WPPA_CONTENT_URL</td> <td><small><?php _e('WP Content url.', 'wp-photo-album-plus'); ?> </small></td> <td><?php echo WPPA_CONTENT_URL; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>wp_upload_dir() : ['basedir']</td> <td><small><?php _e('WP Base upload dir.', 'wp-photo-album-plus'); ?> </small></td> <td><?php $wp_uploaddir = wp_upload_dir(); echo $wp_uploaddir['basedir']; ?> </td> <td></td> </tr> <tr style="color:#333;"> <td>$_SERVER['HTTP_HOST']</td> <td><small><?php ?> </small></td> <td><?php echo $_SERVER['HTTP_HOST']; ?> </td> <td></td> </tr> </tbody> </table> <p> </p> <?php wppa_phpinfo(); ?> <!-- </div>--> </div> </form> <script type="text/javascript">wppaInitSettings();wppaCheckInconsistencies();</script> <?php echo sprintf(__('<br />Memory used on this page: %6.2f Mb.', 'wp-photo-album-plus'), memory_get_peak_usage(true) / (1024 * 1024)); ?> <?php echo sprintf(__('<br />There are %d settings and %d runtime parameters.', 'wp-photo-album-plus'), count($wppa_opt), count($wppa)); ?> </div> <?php wppa_initialize_runtime(true); }
function wppa_album_photos_bulk($album) { global $wpdb; // Check input wppa_vfy_arg('wppa-page'); // Init $count = '0'; $abort = false; if (isset($_POST['wppa-bulk-action'])) { check_admin_referer('wppa-bulk', 'wppa-bulk'); if (isset($_POST['wppa-bulk-photo'])) { $ids = $_POST['wppa-bulk-photo']; $newalb = isset($_POST['wppa-bulk-album']) ? $_POST['wppa-bulk-album'] : '0'; $status = isset($_POST['wppa-bulk-status']) ? $_POST['wppa-bulk-status'] : ''; $owner = isset($_POST['wppa-bulk-owner']) ? $_POST['wppa-bulk-owner'] : ''; $totcount = count($ids); if (!is_numeric($newalb)) { wp_die('Security check failure 1'); } if (is_array($ids)) { foreach (array_keys($ids) as $id) { $skip = false; switch ($_POST['wppa-bulk-action']) { case 'wppa-bulk-delete': wppa_delete_photo($id); break; case 'wppa-bulk-move-to': if ($newalb) { $photo = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . WPPA_PHOTOS . ' WHERE `id` = %s', $id), ARRAY_A); if (wppa_switch('void_dups')) { // Check for already exists $exists = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `filename` = %s AND `album` = %s", $photo['filename'], $newalb)); if ($exists) { // Already exists wppa_error_message(sprintf(__('A photo with filename %s already exists in album %s.', 'wp-photo-album-plus'), $photo['filename'], $newalb)); $skip = true; } } if ($skip) { continue; } wppa_flush_treecounts($photo['album']); // Current album wppa_flush_treecounts($newalb); // New album $wpdb->query($wpdb->prepare('UPDATE `' . WPPA_PHOTOS . '` SET `album` = %s WHERE `id` = %s', $newalb, $id)); wppa_move_source($photo['filename'], $photo['album'], $newalb); } else { wppa_error_message('Unexpected error #4 in wppa_album_photos_bulk().'); } break; case 'wppa-bulk-copy-to': if ($newalb) { $photo = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . WPPA_PHOTOS . ' WHERE `id` = %s', $id), ARRAY_A); if (wppa_switch('void_dups')) { // Check for already exists $exists = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `filename` = %s AND `album` = %s", $photo['filename'], $newalb)); if ($exists) { // Already exists wppa_error_message(sprintf(__($exists . 'A photo with filename %s already exists in album %s.', 'wp-photo-album-plus'), $photo['filename'], $newalb)); $skip = true; } } if ($skip) { continue; } wppa_copy_photo($id, $newalb); wppa_flush_treecounts($newalb); } else { wppa_error_message('Unexpected error #3 in wppa_album_photos_bulk().'); } break; case 'wppa-bulk-status': if (!in_array($status, array('publish', 'pending', 'featured', 'scheduled', 'gold', 'silver', 'bronze', 'private'))) { wppa_log('error', 'Unknown status ' . strip_tags($status) . ' found in wppa-photo-admin-autosave.php -> wppa_album_photos_bulk()'); $status = 'publish'; } if (current_user_can('wppa_admin') || current_user_can('wppa_moderate')) { if ($status == 'publish' || $status == 'pending' || wppa_user_is('administrator') || !wppa_switch('ext_status_restricted')) { $wpdb->query("UPDATE `" . WPPA_PHOTOS . "` SET `status` = '" . $status . "' WHERE `id` = " . $id); wppa_flush_treecounts($id, wppa_get_photo_item($id, 'album')); } else { wp_die('Security check failure 2'); } } else { wp_die('Security check failure 3'); } break; case 'wppa-bulk-owner': if (wppa_user_is('administrator') && wppa_switch('photo_owner_change')) { if ($owner) { $owner = sanitize_user($owner); $exists = $wpdb->get_var("SELECT COUNT(*) FROM `" . $wpdb->users . "` WHERE `user_login` = '" . $owner . "'"); if ($exists) { $wpdb->query("UPDATE `" . WPPA_PHOTOS . "` SET `owner` = '" . $owner . "' WHERE `id` = " . $id); } else { wppa_error_message('A user with login name ' . $owner . ' does not exist.'); $skip = true; } } else { wp_die('Missing required arg in bulk change owner'); } } else { wp_die('Security check failure 4'); } break; default: wppa_error_message('Unimplemented bulk action requested in wppa_album_photos_bulk().'); break; } if (!$skip) { $count++; } if (wppa_is_time_up()) { wppa_error_message(sprintf(__('Time is out after processing %d out of %d items.', 'wp-photo-album-plus'), $count, $totcount)); $abort = true; } if ($abort) { break; } } } else { wppa_error_message('Unexpected error #2 in wppa_album_photos_bulk().'); } } else { wppa_error_message('Unexpected error #1 in wppa_album_photos_bulk().'); } if ($count && !$abort) { switch ($_POST['wppa-bulk-action']) { case 'wppa-bulk-delete': $message = sprintf(__('%d photos deleted.', 'wp-photo-album-plus'), $count); break; case 'wppa-bulk-move-to': $message = sprintf(__('%1$s photos moved to album %2$s.', 'wp-photo-album-plus'), $count, $newalb . ': ' . wppa_get_album_name($newalb)); break; case 'wppa-bulk-copy-to': $message = sprintf(__('%1$s photos copied to album %2$s.', 'wp-photo-album-plus'), $count, $newalb . ': ' . wppa_get_album_name($newalb)); break; case 'wppa-bulk-status': $message = sprintf(__('Changed status to %1$s on %2$s photos.', 'wp-photo-album-plus'), $status, $count); break; case 'wppa-bulk-owner': $message = sprintf(__('Changed owner to %1$s on %2$s photos.', 'wp-photo-album-plus'), $owner, $count); break; default: $message = sprintf(__('%d photos processed.', 'wp-photo-album-plus'), $count); break; } wppa_ok_message($message); } } $pagesize = wppa_opt('photo_admin_pagesize'); $page = isset($_GET['wppa-page']) ? $_GET['wppa-page'] : '1'; $skip = ($page - '1') * $pagesize; $limit = $pagesize < '1' ? '' : ' LIMIT ' . $skip . ',' . $pagesize; if ($album) { if ($album == 'search') { $count = wppa_get_edit_search_photos('', 'count_only'); $photos = wppa_get_edit_search_photos($limit); $link = wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit_id=' . $album . '&wppa-searchstring=' . wppa_sanitize_searchstring($_REQUEST['wppa-searchstring']) . '&bulk'); wppa_show_search_statistics(); } else { $counts = wppa_treecount_a($album); $count = $counts['selfphotos'] + $counts['pendphotos']; //$wpdb->get_var( $wpdb->prepare( 'SELECT COUNT(*) FROM `'.WPPA_PHOTOS.'` WHERE `album` = %s', $album ) ); $photos = $wpdb->get_results($wpdb->prepare('SELECT * FROM `' . WPPA_PHOTOS . '` WHERE `album` = %s ' . wppa_get_photo_order($album, 'norandom') . $limit, $album), ARRAY_A); $link = wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit_id=' . $album . '&bulk'); } if ($photos) { wppa_admin_page_links($page, $pagesize, $count, $link, '#manage-photos'); ?> <script type="text/javascript" > function wppaBulkActionChange( elm, id ) { wppa_setCookie( 'wppa_bulk_action',elm.value,365 ); if ( elm.value == 'wppa-bulk-move-to' || elm.value == 'wppa-bulk-copy-to' ) jQuery( '#wppa-bulk-album' ).css( 'display', 'inline' ); else jQuery( '#wppa-bulk-album' ).css( 'display', 'none' ); if ( elm.value == 'wppa-bulk-status' ) jQuery( '#wppa-bulk-status' ).css( 'display', 'inline' ); else jQuery( '#wppa-bulk-status' ).css( 'display', 'none' ); if ( elm.value == 'wppa-bulk-owner' ) jQuery( '#wppa-bulk-owner' ).css( 'display', 'inline' ); else jQuery( '#wppa-bulk-owner' ).css( 'display', 'none' ); } function wppaBulkDoitOnClick() { var photos = jQuery( '.wppa-bulk-photo' ); var count=0; for ( i=0; i< photos.length; i++ ) { var photo = photos[i]; if ( photo.checked ) count++; } if ( count == 0 ) { alert( 'No photos selected' ); return false; } var action = document.getElementById( 'wppa-bulk-action' ).value; switch ( action ) { case '': alert( 'No action selected' ); return false; break; case 'wppa-bulk-delete': break; case 'wppa-bulk-move-to': case 'wppa-bulk-copy-to': var album = document.getElementById( 'wppa-bulk-album' ).value; if ( album == 0 ) { alert( 'No album selected' ); return false; } break; case 'wppa-bulk-status': var status = document.getElementById( 'wppa-bulk-status' ).value; if ( status == 0 ) { alert( 'No status selected' ); return false; } break; case 'wppa-bulk-owner': var owner = documnet.getElementById( 'wppa-bulk-owner' ).value; if ( owner == 0 ) { alert( 'No new owner selected' ); return false; } break; default: alert( 'Unimplemented action requested: '+action ); return false; break; } return true; } function wppaSetThumbsize( elm ) { var thumbsize = elm.value; wppa_setCookie( 'wppa_bulk_thumbsize',thumbsize,365 ); jQuery( '.wppa-bulk-thumb' ).css( 'max-width', thumbsize+'px' ); jQuery( '.wppa-bulk-thumb' ).css( 'max-height', ( thumbsize/2 )+'px' ); jQuery( '.wppa-bulk-dec' ).css( 'height', ( thumbsize/2 )+'px' ); } jQuery( document ).ready( function() { var action = wppa_getCookie( 'wppa_bulk_action' ); document.getElementById( 'wppa-bulk-action' ).value = action; if ( action == 'wppa-bulk-move-to' || action == 'wppa-bulk-copy-to' ) { jQuery( '#wppa-bulk-album' ).css( 'display','inline' ); document.getElementById( 'wppa-bulk-album' ).value = wppa_getCookie( 'wppa_bulk_album' ); } if ( action == 'wppa-bulk-status' ) { jQuery( '#wppa-bulk-status' ).css( 'display','inline' ); document.getElementById( 'wppa-bulk-status' ).value = wppa_getCookie( 'wppa_bulk_status' ); } if ( action == 'wppa-bulk-owner' ) { jQuery( '#wppa-bulk-owner' ).css( 'display','inline' ); document.getElementById( 'wppa-bulk-owner' ).value = wppa_getCookie( 'wppa_bulk_owner' ); } } ); </script> <form action="<?php echo $link . '&wppa-page=' . $page . '#manage-photos'; ?> " method="post" > <?php wp_nonce_field('wppa-bulk', 'wppa-bulk'); ?> <h3> <span style="font-weight:bold;" ><?php _e('Bulk action:', 'wp-photo-album-plus'); ?> </span> <select id="wppa-bulk-action" name="wppa-bulk-action" onchange="wppaBulkActionChange( this, 'bulk-album' )" > <option value="" ></option> <option value="wppa-bulk-delete" ><?php _e('Delete', 'wp-photo-album-plus'); ?> </option> <option value="wppa-bulk-move-to" ><?php _e('Move to', 'wp-photo-album-plus'); ?> </option> <option value="wppa-bulk-copy-to" ><?php _e('Copy to', 'wp-photo-album-plus'); ?> </option> <?php if (current_user_can('wppa_admin') || current_user_can('wppa_moderate')) { ?> <option value="wppa-bulk-status" ><?php _e('Set status to', 'wp-photo-album-plus'); ?> </option> <?php } ?> <?php if (wppa_user_is('administrator') && wppa_switch('photo_owner_change')) { ?> <option value="wppa-bulk-owner" ><?php _e('Set owner to', 'wp-photo-album-plus'); ?> </option> <?php } ?> </select> <select name="wppa-bulk-album" id="wppa-bulk-album" style="display:none;" onchange="wppa_setCookie( 'wppa_bulk_album',this.value,365 );" > <?php echo wppa_album_select_a(array('checkaccess' => true, 'path' => wppa_switch('hier_albsel'), 'exclude' => $album, 'selected' => '0', 'addpleaseselect' => true)); ?> </select> <select name="wppa-bulk-status" id="wppa-bulk-status" style="display:none;" onchange="wppa_setCookie( 'wppa_bulk_status',this.value,365 );" > <option value="" ><?php _e('- select a status -', 'wp-photo-album-plus'); ?> </option> <option value="pending" ><?php _e('Pending', 'wp-photo-album-plus'); ?> </option> <option value="publish" ><?php _e('Publish', 'wp-photo-album-plus'); ?> </option> <?php if (wppa_switch('ext_status_restricted') && !wppa_user_is('administrator')) { $dis = ' disabled'; } else { $dis = ''; } ?> <option value="featured"<?php echo $dis; ?> ><?php _e('Featured', 'wp-photo-album-plus'); ?> </option> <option value="gold" <?php echo $dis; ?> ><?php _e('Gold', 'wp-photo-album-plus'); ?> </option> <option value="silver" <?php echo $dis; ?> ><?php _e('Silver', 'wp-photo-album-plus'); ?> </option> <option value="bronze" <?php echo $dis; ?> ><?php _e('Bronze', 'wp-photo-album-plus'); ?> </option> <option value="scheduled" <?php echo $dis; ?> ><?php _e('Scheduled', 'wp-photo-album-plus'); ?> </option> <option value="private" <?php echo $dis; ?> ><?php _e('Private', 'wp-photo-album-plus'); ?> </option> </select> <!-- Owner --> <?php $users = wppa_get_users(); if (count($users)) { ?> <select name="wppa-bulk-owner" id="wppa-bulk-owner" style="display:none;" onchange="wppa_setCookie( 'wppa_bulk_owner',this.value,365 );"> <option value="" ><?php _e('- select an owner -', 'wp-photo-album-plus'); ?> </option> <?php foreach ($users as $user) { echo '<option value="' . $user['user_login'] . '" >' . $user['display_name'] . ' (' . $user['user_login'] . ')</option>'; } ?> </select> <?php } else { ?> <input name="wppa-bulk-owner" id="wppa-bulk-owner" style="display:none;" onchange="wppa_setCookie( 'wppa_bulk_owner',this.value,365 );" /> <?php } ?> <!-- Submit --> <input type="submit" onclick="return wppaBulkDoitOnClick()" class="button-primary" value="<?php _e('Doit!', 'wp-photo-album-plus'); ?> " /> <span style="font-family:sans-serif; font-size:12px; font-style:italic; font-weight:normal;" > <?php _e('Pressing this button will reload the page after executing the selected action', 'wp-photo-album-plus'); ?> </span> </h3> <table class="widefat" > <thead style="font-weight:bold;" > <td><input type="checkbox" class="wppa-bulk-photo" onchange="jQuery( '.wppa-bulk-photo' ).attr( 'checked', this.checked );" /></td> <td><?php _e('ID', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Preview', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Status', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Owner', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Remark', 'wp-photo-album-plus'); ?> </td> </thead> <tbody> <?php foreach ($photos as $photo) { ?> <?php $id = $photo['id']; ?> <tr id="photoitem-<?php echo $photo['id']; ?> " > <!-- Checkbox --> <td> <input type="hidden" id="photo-nonce-<?php echo $photo['id']; ?> " value="<?php echo wp_create_nonce('wppa_nonce_' . $photo['id']); ?> " /> <input type="checkbox" name="wppa-bulk-photo[<?php echo $photo['id']; ?> ]" class="wppa-bulk-photo" /> </td> <!-- ID and delete link --> <td><?php echo $photo['id']; ?> <br /><a onclick="if ( confirm( '<?php _e('Are you sure you want to delete this photo?', 'wp-photo-album-plus'); ?> ' ) ) wppaAjaxDeletePhoto( <?php echo $photo['id']; ?> , '<td colspan=3 >', '</td>' )" style="color:red;font-weight:bold;"><?php _e('Delete', 'wp-photo-album-plus'); ?> </a> </td> <!-- Preview --> <td style="min-width:240px; text-align:center;" > <?php if (wppa_is_video($photo['id'])) { ?> <a href="<?php echo str_replace('xxx', 'mp4', wppa_get_photo_url($photo['id'])); ?> " target="_blank" title="Click to see fullsize" > <?php // Animating size changes of a video tag is not a good idea. It will rapidly screw up browser cache and cpu ?> <?php echo wppa_get_video_html(array('id' => $id, 'height' => '60', 'controls' => false, 'tagid' => 'pa-id-' . $id, 'events' => ' onmouseover="jQuery( this ).css( \'height\', \'160\' )" onmouseout="jQuery( this ).css( \'height\', \'60\' )"', 'preload' => 'metadata', 'use_thumb' => true)); ?> <!-- <video preload="metadata" style="height:60px;" onmouseover="jQuery( this ).css( 'height', '160' )" onmouseout="jQuery( this ).css( 'height', '60' )" > <?php // echo wppa_get_video_body( $photo['id'] ) ?> </video> --> </a> <?php } else { ?> <a href="<?php echo wppa_fix_poster_ext(wppa_get_photo_url($photo['id']), $photo['id']); ?> " target="_blank" title="Click to see fullsize" > <img class="wppa-bulk-thumb" src="<?php echo wppa_fix_poster_ext(wppa_get_thumb_url($photo['id']), $photo['id']); ?> " style="height:60px;" onmouseover="jQuery( this ).stop().animate( {height:120}, 100 )" onmouseout="jQuery( this ).stop().animate( {height:60}, 100 )" /> </a> <?php } ?> </td> <td style="width:25%;" > <input type="text" style="width:100%;" id="pname-<?php echo $photo['id']; ?> " onchange="wppaAjaxUpdatePhoto( <?php echo $photo['id']; ?> , 'name', this );" value="<?php echo esc_attr(stripslashes($photo['name'])); ?> " /> <?php if (wppa_is_video($photo['id'])) { echo '<br />' . wppa_get_videox($photo['id']) . ' x ' . wppa_get_videoy($photo['id']) . ' px.'; } else { $sp = wppa_get_source_path($photo['id']); if (is_file($sp)) { $ima = getimagesize($sp); if (is_array($ima)) { echo '<br />' . $ima['0'] . ' x ' . $ima['1'] . ' px.'; } } } ?> </td> <!-- Description --> <td style="width:25%;" > <textarea class="wppa-bulk-dec" style="height:50px; width:100%" onchange="wppaAjaxUpdatePhoto( <?php echo $photo['id']; ?> , 'description', this )" ><?php echo stripslashes($photo['description']); ?> </textarea> </td> <!-- Status --> <td> <?php if (current_user_can('wppa_admin') || current_user_can('wppa_moderate')) { ?> <select id="status-<?php echo $photo['id']; ?> " onchange="wppaAjaxUpdatePhoto( <?php echo $photo['id']; ?> , 'status', this ); wppaPhotoStatusChange( <?php echo $photo['id']; ?> ); "> <option value="pending" <?php if ($photo['status'] == 'pending') { echo 'selected="selected"'; } ?> ><?php _e('Pending', 'wp-photo-album-plus'); ?> </option> <option value="publish" <?php if ($photo['status'] == 'publish') { echo 'selected="selected"'; } ?> ><?php _e('Publish', 'wp-photo-album-plus'); ?> </option> <?php if (wppa_switch('ext_status_restricted') && !wppa_user_is('administrator')) { $dis = ' disabled'; } else { $dis = ''; } ?> <option value="featured" <?php if ($photo['status'] == 'featured') { echo 'selected="selected"'; } echo $dis; ?> ><?php _e('Featured', 'wp-photo-album-plus'); ?> </option> <option value="gold" <?php if ($photo['status'] == 'gold') { echo 'selected="selected"'; } echo $dis; ?> ><?php _e('Gold', 'wp-photo-album-plus'); ?> </option> <option value="silver" <?php if ($photo['status'] == 'silver') { echo 'selected="selected"'; } echo $dis; ?> ><?php _e('Silver', 'wp-photo-album-plus'); ?> </option> <option value="bronze" <?php if ($photo['status'] == 'bronze') { echo 'selected="selected"'; } echo $dis; ?> ><?php _e('Bronze', 'wp-photo-album-plus'); ?> </option> <option value="scheduled" <?php if ($photo['status'] == 'scheduled') { echo 'selected="selected"'; } echo $dis; ?> ><?php _e('Scheduled', 'wp-photo-album-plus'); ?> </option> <option value="private" <?php if ($photo['status'] == 'private') { echo 'selected="selected"'; } echo $dis; ?> ><?php _e('Private', 'wp-photo-album-plus'); ?> </option> </select> <?php } else { if ($photo['status'] == 'pending') { _e('Pending', 'wp-photo-album-plus'); } elseif ($photo['status'] == 'publish') { _e('Publish', 'wp-photo-album-plus'); } elseif ($photo['status'] == 'featured') { e('Featured'); } elseif ($photo['status'] == 'gold') { _e('Gold', 'wp-photo-album-plus'); } elseif ($photo['status'] == 'silver') { _e('Silver', 'wp-photo-album-plus'); } elseif ($photo['status'] == 'bronze') { _e('Bronze', 'wp-photo-album-plus'); } elseif ($photo['status'] == 'scheduled') { _e('Scheduled', 'wp-photo-album-plus'); } elseif ($photo['status'] == 'private') { _e('Private', 'wp-photo-album-plus'); } } ?> </td> <!-- Owner --> <td> <?php echo $photo['owner']; ?> </td> <!-- Remark --> <td id="photostatus-<?php echo $photo['id']; ?> " style="width:25%;" > <?php _e('Not modified', 'wp-photo-album-plus'); ?> <script type="text/javascript">wppaPhotoStatusChange( <?php echo $photo['id']; ?> )</script> </td> </tr> <?php } ?> </tbody> <tfoot style="font-weight:bold;" > <td><input type="checkbox" class="wppa-bulk-photo" onchange="jQuery( '.wppa-bulk-photo' ).attr( 'checked', this.checked );" /></td> <td><?php _e('ID', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Preview', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Name', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Description', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Status', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Owner', 'wp-photo-album-plus'); ?> </td> <td><?php _e('Remark', 'wp-photo-album-plus'); ?> </td> </tfoot> </table> </form> <?php wppa_admin_page_links($page, $pagesize, $count, $link); } else { if ($page == '1') { if (isset($_REQUEST['wppa-searchstring'])) { echo '<h3>' . __('No photos matching your search criteria.', 'wp-photo-album-plus') . '</h3>'; } else { echo '<h3>' . __('No photos yet in this album.', 'wp-photo-album-plus') . '</h3>'; } } else { $page_1 = $page - '1'; echo sprintf(__('Page %d is empty, try <a href="%s" >page %d</a>.', 'wp-photo-album-plus'), $page, $link . '&wppa-page=' . $page_1 . '#manage-photos', $page_1); } } } else { wppa_dbg_msg('Missing required argument in wppa_album_photos() 2', 'red', 'force'); } }
function wppa_do_albumlist($parent, $nestinglevel, $albums, $seq) { global $wpdb; $alt = true; foreach (array_keys($seq) as $s) { // Obey the global sequence $album = $albums[$s]; if ($album['a_parent'] == $parent) { if (wppa_have_access($album)) { $counts = wppa_treecount_a($album['id']); $pendcount = $counts['pendphotos']; $schedulecount = $counts['scheduledphotos']; $haschildren = wppa_have_accessable_children($album); $class = ''; if ($parent != '0' && $parent != '-1') { $class .= 'wppa-alb-on-' . $parent . ' '; $par = $parent; while ($par != '0' && $par != '-1') { $class .= 'wppa-alb-off-' . $par . ' '; $par = wppa_get_parentalbumid($par); } } if ($alt) { $class .= ' alternate'; } $style = ''; if ($pendcount) { $style .= 'background-color:#ffdddd; '; } // if ( $haschildren ) $style .= 'font-weight:bold; '; if ($parent != '0' && $parent != '-1') { $style .= 'display:none; '; } $onclickon = 'jQuery(\'.wppa-alb-on-' . $album['id'] . '\').css(\'display\',\'\'); jQuery(\'#alb-arrow-on-' . $album['id'] . '\').css(\'display\',\'none\'); jQuery(\'#alb-arrow-off-' . $album['id'] . '\').css(\'display\',\'\');'; $onclickoff = 'jQuery(\'.wppa-alb-off-' . $album['id'] . '\').css(\'display\',\'none\'); jQuery(\'#alb-arrow-on-' . $album['id'] . '\').css(\'display\',\'\'); jQuery(\'#alb-arrow-off-' . $album['id'] . '\').css(\'display\',\'none\'); checkArrows();'; $indent = $nestinglevel; if ($indent > '5') { $indent = 5; } ?> <tr class="<?php echo $class; ?> " style="<?php echo $style; ?> " > <?php $i = 0; while ($i < $indent) { echo '<td style="padding:2px;" ></td>'; $i++; } ?> <td style="padding:2px; text-align:center;" ><?php if ($haschildren) { ?> <img id="alb-arrow-off-<?php echo $album['id']; ?> " class="alb-arrow-off" style="height:16px; display:none;" src="<?php echo wppa_get_imgdir() . 'backarrow.gif'; ?> " onclick="<?php echo $onclickoff; ?> " title="<?php _e('Collapse subalbums', 'wp-photo-album-plus'); ?> " /> <img id="alb-arrow-on-<?php echo $album['id']; ?> " class="alb-arrow-on" style="height:16px;" src="<?php echo wppa_get_imgdir() . 'arrow.gif'; ?> " onclick="<?php echo $onclickon; ?> " title="<?php _e('Expand subalbums', 'wp-photo-album-plus'); ?> " /> <?php } ?> </td> <td style="padding:2px;" ><?php echo $album['id']; ?> </td> <?php $i = $indent; while ($i < 5) { echo '<td style="padding:2px;" ></td>'; $i++; } ?> <td><?php echo esc_attr(__(stripslashes($album['name']))); ?> </td> <td><small><?php echo esc_attr(__(stripslashes($album['description']))); ?> </small></td> <?php if (current_user_can('administrator')) { ?> <td><?php echo $album['owner']; ?> </td> <?php } ?> <td><?php echo $album['a_order']; ?> </td> <td><?php echo wppa_get_album_name($album['a_parent'], 'extended'); ?> </td> <?php $url = wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit_id=' . $album['id']); ?> <?php $na = $counts['selfalbums']; ?> <?php $np = $counts['selfphotos']; ?> <?php $nm = $counts['pendphotos']; ?> <?php $ns = $counts['scheduledphotos']; ?> <td><?php echo $na . '/' . $np . '/' . $nm . '/' . $ns; ?> </td> <?php if ($album['owner'] != '--- public ---' || wppa_user_is('administrator')) { ?> <?php $url = wppa_ea_url($album['id']); ?> <td><a href="<?php echo $url; ?> " class="wppaedit"><?php _e('Edit', 'wp-photo-album-plus'); ?> </a></td> <td><a href="<?php echo $url . '&quick'; ?> " class="wppaedit"><?php _e('Quick', 'wp-photo-album-plus'); ?> </a></td> <td><a href="<?php echo $url . '&bulk#manage-photos'; ?> " class="wppaedit"><?php _e('Bulk', 'wp-photo-album-plus'); ?> </a></td> <td><a href="<?php echo $url . '&seq'; ?> " class="wppaedit"><?php _e('Seq', 'wp-photo-album-plus'); ?> </a></td> <?php $url = wppa_ea_url($album['id'], 'del'); ?> <td><a href="<?php echo $url; ?> " class="wppadelete"><?php _e('Delete', 'wp-photo-album-plus'); ?> </a></td> <?php if (wppa_can_create_album()) { $url = wppa_dbg_url(get_admin_url() . 'admin.php?page=wppa_admin_menu&tab=edit&edit_id=new&parent_id=' . $album['id']); if (wppa_switch('confirm_create')) { $onc = 'if (confirm(\'' . __('Are you sure you want to create a subalbum?', 'wp-photo-album-plus') . '\')) document.location=\'' . $url . '\';'; echo '<td><a onclick="' . $onc . '" class="wppacreate">' . __('Create', 'wp-photo-album-plus') . '</a></td>'; } else { echo '<td><a href="' . $url . '" class="wppacreate">' . __('Create', 'wp-photo-album-plus') . '</a></td>'; } } } else { ?> <td></td><td></td><?php if (wppa_can_create_album()) { echo '<td></td'; } ?> <?php } ?> </tr> <?php if ($alt == '') { $alt = ' class="alternate" '; } else { $alt = ''; } if ($haschildren) { wppa_do_albumlist($album['id'], $nestinglevel + '1', $albums, $seq); } } } } }
function wppa_get_edit_search_photos($limit = '', $count_only = false) { global $wpdb; global $wppa_search_stats; $doit = false; // if ( wppa_user_is( 'administrator' ) ) $doit = true; if (current_user_can('wppa_admin') && current_user_can('wppa_moderate')) { $doit = true; } if (wppa_opt('upload_edit') != 'none') { $doit = true; } if (!$doit) { // Should never get here. Only when url is manipulted manually. die('Security check failure #309'); } $words = explode(',', wppa_sanitize_searchstring($_REQUEST['wppa-searchstring'])); $wppa_search_stats = array(); $first = true; if (wppa_user_is('administrator') && wppa_is_int($_REQUEST['wppa-searchstring'])) { $photo_array = array($_REQUEST['wppa-searchstring']); } else { foreach ($words as $word) { // Find lines in index db table if (wppa_switch('wild_front')) { $pidxs = $wpdb->get_results("SELECT `slug`, `photos` FROM `" . WPPA_INDEX . "` WHERE `slug` LIKE '%" . $word . "%'", ARRAY_A); } else { $pidxs = $wpdb->get_results("SELECT `slug`, `photos` FROM `" . WPPA_INDEX . "` WHERE `slug` LIKE '" . $word . "%'", ARRAY_A); } $photos = ''; foreach ($pidxs as $pi) { $photos .= $pi['photos'] . ','; } if ($first) { $photo_array = wppa_index_array_remove_dups(wppa_index_string_to_array(trim($photos, ','))); $count = empty($photo_array) ? '0' : count($photo_array); $list = implode(',', $photo_array); if (!$list) { $list = '0'; } // if ( wppa_user_is( 'administrator' ) ) { if (current_user_can('wppa_admin') && current_user_can('wppa_moderate')) { $real_count = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `id` IN (" . $list . ") "); if ($count != $real_count) { update_option('wppa_remake_index_photos_status', __('Required', 'wp-photo-album-plus')); // echo 'realcount mismatch:1'; // echo ' count='.$count.', realcount='.$real_count.'<br/>'; } } else { // Not admin, can edit own photos only $real_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `id` IN (" . $list . ") AND `owner` = %s", wppa_get_user())); } $wppa_search_stats[] = array('word' => $word, 'count' => $real_count); $first = false; } else { $temp_array = wppa_index_array_remove_dups(wppa_index_string_to_array(trim($photos, ','))); $count = empty($temp_array) ? '0' : count($temp_array); $list = implode(',', $temp_array); // if ( wppa_user_is( 'administrator' ) ) { if (current_user_can('wppa_admin') && current_user_can('wppa_moderate')) { $real_count = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `id` IN (" . $list . ") "); if ($count != $real_count) { update_option('wppa_remake_index_photos_status', __('Required', 'wp-photo-album-plus')); // echo 'realcount mismatch:2'; // echo ' count='.$count.', realcount='.$real_count.'<br/>'; } } else { // Not admin, can edit own photos only $real_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `id` IN (" . $list . ") AND `owner` = %s", wppa_get_user())); } $wppa_search_stats[] = array('word' => $word, 'count' => $real_count); $photo_array = array_intersect($photo_array, $temp_array); } } } if (!empty($photo_array)) { $list = implode(',', $photo_array); // if ( wppa_user_is( 'administrator' ) ) { if (current_user_can('wppa_admin') && current_user_can('wppa_moderate')) { $totcount = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `id` IN (" . $list . ") "); } else { // Not admin, can edit own photos only $totcount = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` WHERE `id` IN (" . $list . ") AND `owner` = %s", wppa_get_user())); } $wppa_search_stats[] = array('word' => __('Combined', 'wp-photo-album-plus'), 'count' => $totcount); // if ( wppa_user_is( 'administrator' ) ) { if (current_user_can('wppa_admin') && current_user_can('wppa_moderate')) { $photos = $wpdb->get_results("SELECT * FROM `" . WPPA_PHOTOS . "` WHERE `id` IN (" . $list . ") " . wppa_get_photo_order('0', 'norandom') . $limit, ARRAY_A); } else { // Not admin, can edit own photos only $photos = $wpdb->get_results($wpdb->prepare("SELECT * FROM `" . WPPA_PHOTOS . "` WHERE `id` IN (" . $list . ") AND `owner` = %s" . wppa_get_photo_order('0', 'norandom') . $limit, wppa_get_user()), ARRAY_A); } } else { $photos = false; } if ($count_only) { if (is_array($photos)) { return count($photos); } else { return '0'; } } else { return $photos; } }
function wppa_get_thumb_default($id) { global $wpdb; // Validate args if (!wppa_is_int($id) || $id < '0') { wppa_dbg_msg('Please check file wppa-theme.php or any other php file that calls wppa_get_thumb_default(). Argument 1: photo id is missing or illegal!', 'red', 'force'); die('Please check your configuration'); } // Initialize $result = ''; // Get the photo info $thumb = wppa_cache_thumb($id); // Get the album info $album = wppa_cache_album($thumb['album']); wppa('current_album', $album['id']); // Get photo info $is_video = wppa_is_video($id); $has_audio = wppa_has_audio($id); $com_alt = wppa('is_comten') && wppa_switch('comten_alt_display') && !wppa_in_widget(); $frameattr_a = wppa_get_thumb_frame_style_a(); $framestyle = $frameattr_a['style']; $framewidth = $frameattr_a['width']; $frameheight = $frameattr_a['height']; // Get class depending of comment alt display if ($com_alt) { $class = 'thumbnail-frame-comalt thumbnail-frame-comalt-' . wppa('mocc') . ' thumbnail-frame-photo-' . $id; } else { $class = 'thumbnail-frame thumbnail-frame-' . wppa('mocc') . ' thumbnail-frame-photo-' . $id; } // If no image to display, die gracefully $imgsrc = wppa_fix_poster_ext(wppa_get_thumb_path($id), $id); if (!wppa_is_video($id) && !is_file($imgsrc) && !wppa_has_audio($id)) { $result .= '<div' . ' class="' . $class . '"' . ' style="' . $framestyle . '; color:red;" >' . 'Missing thumbnail image #' . $id . '</div>'; return $result; } // Find image attributes $alt = $album['alt_thumbsize'] == 'yes' ? '_alt' : ''; $imgattr_a = wppa_get_imgstyle_a($id, $imgsrc, wppa_opt('thumbsize' . $alt), 'optional', 'thumb'); $imgstyle = $imgattr_a['style']; $imgwidth = $imgattr_a['width']; $imgheight = $imgattr_a['height']; $imgmargintop = $imgattr_a['margin-top']; $imgmarginbottom = $imgattr_a['margin-bottom']; // Special case for comment alt display if ($com_alt) { $imgwidth = wppa_opt('comten_alt_thumbsize'); $imgheight = round($imgwidth * $imgattr_a['height'] / $imgattr_a['width']); $imgstyle .= 'float:left; margin:0 20px 8px 0;width:' . $imgwidth . 'px; height:' . $imgheight . 'px;'; } // Cursor depends on link $cursor = $imgattr_a['cursor']; // Find the required image sizes if (wppa_switch('use_thumb_popup')) { // Landscape? if ($imgwidth > $imgheight) { $popwidth = wppa_opt('popupsize'); $popheight = round($popwidth * $imgheight / $imgwidth); } else { $popheight = wppa_opt('popupsize'); $popwidth = round($popheight * $imgwidth / $imgheight); } } else { $popwidth = $imgwidth; $popheight = $imgheight; } // More image attributes $imgurl = wppa_fix_poster_ext(wppa_get_thumb_url($id, '', $popwidth, $popheight), $id); $events = wppa_get_imgevents('thumb', $id); $imgalt = wppa_get_imgalt($id); // returns something like ' alt="Any text" ' $title = esc_attr(wppa_get_photo_name($id)); // Feed ? if (is_feed()) { $imgattr_a = wppa_get_imgstyle_a($id, $imgsrc, '100', '4', 'thumb'); $style = $imgattr_a['style']; $result .= '<a href="' . get_permalink() . '">' . '<img src="' . $imgurl . '" ' . $imgalt . ' title="' . $title . '" style="' . $style . '" />' . '</a>'; return $result; } // Open Com alt wrapper if ($com_alt) { $result .= '<div>'; } // Open the thumbframe $result .= '<div' . ' id="thumbnail_frame_' . $id . '_' . wppa('mocc') . '"' . ' class="' . $class . '"' . ' style="' . $framestyle . '"' . ' >'; // Open the image container $imgcontheight = $com_alt ? $imgheight : max($imgwidth, $imgheight); if (!is_file($imgsrc)) { $imgcontheight = 2 * wppa_get_audio_control_height(); } if ($com_alt) { $framewidth = $imgwidth + '4'; } $result .= '<div' . ' class="wppa-tn-img-container"' . ' style="' . 'height:' . $imgcontheight . 'px;' . 'width:' . $framewidth . 'px;' . ($com_alt ? 'float:left;' : '') . 'overflow:hidden;"' . '>'; // The medals if at the top $medalsize = $com_alt ? 'S' : 'M'; $result .= wppa_get_medal_html_a(array('id' => $id, 'size' => $medalsize, 'where' => 'top')); // The audio when no popup if (wppa_switch('thumb_audio') && wppa_has_audio($id) && !$com_alt) { $result .= '<div style="position:relative;z-index:11;">'; $is_safari = strpos($_SERVER["HTTP_USER_AGENT"], 'Safari'); $cont_h = $is_safari ? 16 : 28; $audiotop = $imgattr_a['height'] + $imgattr_a['margin-top'] - $cont_h; if (!is_file($imgsrc)) { // Audio without image $audiotop = wppa_get_audio_control_height(); $imgwidth = wppa_opt('tf_width'); $imgheight = wppa_get_audio_control_height(); } $result .= wppa_get_audio_html(array('id' => $id, 'width' => $imgwidth, 'height' => $cont_h, 'style' => 'position:absolute;top:' . $audiotop . 'px;left:0;border:none;')); $result .= '</div>'; } // Get the image link if (wppa('is_topten')) { $no_album = !wppa('start_album'); if ($no_album) { $tit = __('View the top rated photos', 'wp-photo-album-plus'); } else { $tit = esc_attr(__(stripslashes($thumb['description']))); } $link = wppa_get_imglnk_a('thumb', $id, '', $tit, '', $no_album); } else { $link = wppa_get_imglnk_a('thumb', $id); } // voor parent uplr // See if ajax possible if ($link) { // Is link an url? if ($link['is_url']) { if (wppa_switch('allow_ajax') && wppa_opt('thumb_linktype') == 'photo' && wppa_opt('thumb_linkpage') == '0' && !wppa_switch('thumb_blank') && !(wppa_switch('thumb_overrule') && $thumb['linkurl']) && !wppa('is_topten') && !wppa('is_lasten') && !wppa('is_comten') && !wppa('is_featen') && !wppa('is_tag') && !wppa('is_upldr') && !wppa('src') && !wppa('supersearch') && (wppa_is_int(wppa('start_album')) || wppa('start_album') == '')) { // Ajax possible // The a img ajax $p = wppa('calendar') ? '' : '&wppa-photo=' . $id; $onclick = 'wppaDoAjaxRender( ' . wppa('mocc') . ', \'' . wppa_get_slideshow_url_ajax(wppa('start_album'), '0') . '&wppa-photo=' . $id . '\', \'' . wppa_convert_to_pretty(wppa_get_slideshow_url(wppa('start_album'), '0') . $p) . '\' )'; $result .= '<a style="position:static;" class="thumb-img" id="x-' . $id . '-' . wppa('mocc') . '">'; // Video? if ($is_video) { $result .= wppa_get_video_html(array('id' => $id, 'width' => $imgwidth, 'height' => $imgheight, 'controls' => wppa_switch('thumb_video'), 'margin_top' => '0', 'margin_bottom' => '0', 'tagid' => 'i-' . $id . '-' . wppa('mocc'), 'cursor' => 'cursor:pointer;', 'events' => $events, 'title' => $title, 'preload' => 'metadata', 'onclick' => $onclick, 'lb' => false, 'class' => '', 'style' => $imgstyle)); } else { $result .= '<img' . ' onclick="' . $onclick . '"' . ' id="i-' . $id . '-' . wppa('mocc') . '"' . ' src="' . $imgurl . '"' . ' ' . $imgalt . ($title ? ' title="' . $title . '"' : '') . ' width="' . $imgwidth . '"' . ' height="' . $imgheight . '"' . ' style="' . $imgstyle . ' cursor:pointer;"' . ' ' . $events . ' />'; } // Close the a img ajax $result .= '</a>'; } else { // The a img non ajax $result .= '<a style="position:static;" href="' . $link['url'] . '" target="' . $link['target'] . '" class="thumb-img" id="x-' . $id . '-' . wppa('mocc') . '">'; if ($is_video) { $result .= wppa_get_video_html(array('id' => $id, 'width' => $imgwidth, 'height' => $imgheight, 'controls' => wppa_switch('thumb_video'), 'margin_top' => '0', 'margin_bottom' => '0', 'tagid' => 'i-' . $id . '-' . wppa('mocc'), 'cursor' => 'cursor:pointer;', 'events' => $events, 'title' => $title, 'preload' => 'metadata', 'onclick' => '', 'lb' => false, 'class' => '', 'style' => $imgstyle)); } else { $result .= '<img' . ' id="i-' . $id . '-' . wppa('mocc') . '"' . ' src="' . $imgurl . '" ' . $imgalt . ($title ? ' title="' . $title . '"' : '') . ' width="' . $imgwidth . '"' . ' height="' . $imgheight . '"' . ' style="' . $imgstyle . ' cursor:pointer;"' . ' ' . $events . ' />'; } // Close the img non ajax $result .= '</a>'; } } elseif ($link['is_lightbox']) { $title = wppa_get_lbtitle('thumb', $id); // The a img $result .= '<a href="' . $link['url'] . '" target="' . $link['target'] . '"' . ($is_video ? ' data-videohtml="' . esc_attr(wppa_get_video_body($id)) . '"' . ' data-videonatwidth="' . wppa_get_videox($id) . '"' . ' data-videonatheight="' . wppa_get_videoy($id) . '"' : '') . ($has_audio ? ' data-audiohtml="' . esc_attr(wppa_get_audio_body($id)) . '"' : '') . ' ' . wppa('rel') . '="' . wppa_opt('lightbox_name') . '[occ' . wppa('mocc') . ']"' . ' ' . wppa('lbtitle') . '="' . $title . '" ' . ' class="thumb-img" id="x-' . $id . '-' . wppa('mocc') . '">'; if ($is_video) { $result .= wppa_get_video_html(array('id' => $id, 'width' => $imgwidth, 'height' => $imgheight, 'controls' => wppa_switch('thumb_video'), 'margin_top' => '0', 'margin_bottom' => '0', 'tagid' => 'i-' . $id . '-' . wppa('mocc'), 'cursor' => $cursor, 'events' => $events, 'title' => wppa_zoom_in($id), 'preload' => 'metadata', 'onclick' => '', 'lb' => false, 'class' => '', 'style' => $imgstyle)); } else { $title = wppa_zoom_in($id); $result .= '<img' . ' id="i-' . $id . '-' . wppa('mocc') . '"' . ' src="' . $imgurl . '"' . ' ' . $imgalt . ($title ? ' title="' . $title . '"' : '') . ' width="' . $imgwidth . '"' . ' height="' . $imgheight . '"' . ' style="' . $imgstyle . $cursor . '"' . ' ' . $events . ' />'; } // Close the a img $result .= '</a>'; } else { // is onclick // The div img $result .= '<div onclick="' . $link['url'] . '" class="thumb-img" id="x-' . $id . '-' . wppa('mocc') . '">'; if ($is_video) { $result .= wppa_get_video_html(array('id' => $id, 'width' => $imgwidth, 'height' => $imgheight, 'controls' => wppa_switch('thumb_video'), 'margin_top' => '0', 'margin_bottom' => '0', 'tagid' => 'i-' . $id . '-' . wppa('mocc'), 'cursor' => 'cursor:pointer;', 'events' => $events, 'title' => $title, 'preload' => 'metadata', 'onclick' => '', 'lb' => false, 'class' => '', 'style' => $imgstyle)); } else { $result .= '<img' . ' id="i-' . $id . '-' . wppa('mocc') . '"' . ' src="' . $imgurl . '"' . ' ' . $imgalt . ($title ? ' title="' . $title . '"' : '') . ' width="' . $imgwidth . '"' . ' height="' . $imgheight . '"' . ' style="' . $imgstyle . ' cursor:pointer;"' . ' ' . $events . ' />'; } $result .= '</div>'; $result .= '<script type="text/javascript">'; $result .= '/* <![CDATA[ */'; $result .= 'wppaPopupOnclick[' . $id . '] = "' . $link['url'] . '";'; $result .= '/* ]]> */'; $result .= '</script>'; } } else { // no link if (wppa_switch('use_thumb_popup')) { $result .= '<div id="x-' . $id . '-' . wppa('mocc') . '">'; if ($is_video) { $result .= wppa_get_video_html(array('id' => $id, 'width' => $imgwidth, 'height' => $imgheight, 'controls' => false, 'margin_top' => '0', 'margin_bottom' => '0', 'tagid' => 'i-' . $id . '-' . wppa('mocc'), 'cursor' => '', 'events' => $events, 'title' => $title, 'preload' => 'metadata', 'onclick' => '', 'lb' => false, 'class' => '', 'style' => $imgstyle)); } else { $result .= '<img' . ' src="' . $imgurl . '"' . ' ' . $imgalt . ($title ? ' title="' . $title . '"' : '') . ' width="' . $imgwidth . '"' . ' height="' . $imgheight . '"' . ' style="' . $imgstyle . '"' . ' ' . $events . ' />'; } $result .= '</div>'; } else { if ($is_video) { $result .= wppa_get_video_html(array('id' => $id, 'width' => $imgwidth, 'height' => $imgheight, 'controls' => wppa_switch('thumb_video'), 'margin_top' => '0', 'margin_bottom' => '0', 'tagid' => 'i-' . $id . '-' . wppa('mocc'), 'cursor' => '', 'events' => $events, 'title' => $title, 'preload' => 'metadata', 'onclick' => '', 'lb' => false, 'class' => '', 'style' => $imgstyle)); } else { $result .= '<img' . ' src="' . $imgurl . '"' . ' ' . $imgalt . ($title ? ' title="' . $title . '"' : '') . ' width="' . $imgwidth . '"' . ' height="' . $imgheight . '"' . ' style="' . $imgstyle . '"' . ' ' . $events . ' />'; } } } // The medals if near the bottom $result .= wppa_get_medal_html_a(array('id' => $id, 'size' => $medalsize, 'where' => 'bot')); // Close the image container $result .= '</div>'; /* // The audio when popup if ( wppa_switch( 'use_thumb_popup' ) && wppa_switch( 'thumb_audio' ) && wppa_has_audio( $id ) && ! $com_alt ) { $result .= wppa_get_audio_html( array( 'id' => $id, 'width' => $imgwidth )); } */ // Comten alt display? if ($com_alt) { $result .= '<div' . ' class="wppa-com-alt wppa-com-alt-' . wppa('mocc') . '"' . ' style="' . 'height:' . $imgheight . 'px;' . 'overflow:auto;' . 'margin: 0 0 8px 10px;' . 'border:1px solid ' . wppa_opt('bcolor_alt') . ';' . '"' . ' >'; $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM `" . WPPA_COMMENTS . "` WHERE `photo` = %s AND `status` = 'approved' ORDER BY `timestamp` DESC", $id), ARRAY_A); $first = true; if ($comments) { foreach ($comments as $com) { $result .= '<h6' . ' style="' . 'font-size:10px;' . 'line-height:12px;' . 'font-weight:bold;' . 'padding:' . ($first ? '0' : '6px') . ' 0 0 6px;' . 'margin:0;float:left;' . '"' . '>' . $com['user'] . ' ' . __('wrote', 'wp-photo-album-plus') . ' ' . wppa_get_time_since($com['timestamp']) . ':' . '</h6>' . '<p' . ' style="' . 'font-size:10px;' . 'line-height:12px;' . 'padding:0 0 0 6px;' . 'text-align:left;' . 'margin:0;' . 'clear:left;' . '"' . '>' . html_entity_decode(convert_smilies(stripslashes($com['comment']))) . '</p>'; $first = false; } } $result .= '</div>'; } else { // Open the subtext container $margtop = wppa_switch('align_thumbtext') ? '' : 'margin-top:' . -$imgmarginbottom . 'px;'; $subtextcontheight = $frameheight - max($imgwidth, $imgheight); if (!wppa_switch('align_thumbtext')) { $subtextcontheight += $imgmarginbottom; } $result .= '<div' . ' style="' . 'height:' . $subtextcontheight . 'px;' . 'width:' . $framewidth . 'px;' . 'position:absolute;' . $margtop . 'overflow:hidden;' . '" >'; // Single button voting system if (wppa_opt('rating_max') == '1' && wppa_switch('vote_thumb')) { $mylast = $wpdb->get_row($wpdb->prepare('SELECT * FROM `' . WPPA_RATING . '` WHERE `photo` = %s AND `user` = %s ORDER BY `id` DESC LIMIT 1', $id, wppa_get_user()), ARRAY_A); $buttext = $mylast ? __(wppa_opt('voted_button_text'), 'wp-photo-album-plus') : __(wppa_opt('vote_button_text'), 'wp-photo-album-plus'); $result .= '<input' . ' id="wppa-vote-button-' . wppa('mocc') . '-' . $id . '"' . ' class="wppa-vote-button-thumb"' . ' style="margin:0;"' . ' type="button"' . ' onclick="wppaVoteThumb( ' . wppa('mocc') . ', ' . $id . ' )"' . ' value="' . $buttext . '"' . ' />'; } // Name if (wppa_switch('thumb_text_name') || wppa_switch('thumb_text_owner')) { $result .= '<div' . ' class="wppa-thumb-text"' . ' style="' . __wcs('wppa-thumb-text') . '"' . ' >' . wppa_get_photo_name($id, wppa_switch('thumb_text_owner'), false, false, wppa_switch('thumb_text_name')) . '</div>'; } // searching, link to album // if ( wppa( 'src' ) || wppa( 'supersearch' ) || ( ( wppa( 'is_comten') || wppa( 'is_topten' ) || wppa( 'is_lasten' ) || wppa( 'is_featen') ) && wppa( 'start_album' ) != $thumb['album'] ) ) { if (wppa_switch('thumb_text_virt_album') && wppa_is_virtual() && wppa('start_album') != $thumb['album']) { $result .= '<div' . ' class="wppa-thumb-text"' . ' style="' . __wcs('wppa-thumb-text') . '"' . ' >' . '<a' . ' href="' . wppa_get_album_url($thumb['album']) . '"' . ' >' . '<span class="wppa-tnpar" >(</span>' . stripslashes(__(wppa_get_album_name($thumb['album']), 'wp-photo-album-plus')) . '<span class="wppa-tnpar" >)</span>' . '</a>' . '</div>'; } // Share if (wppa_switch('share_on_thumbs')) { $result .= '<div' . ' class="wppa-thumb-text"' . ' style="' . __wcs('wppa-thumb-text') . '"' . ' >' . wppa_get_share_html($id, 'thumb') . '</div>'; } // Delete and Edit links if (wppa_switch('edit_thumb') && !wppa_is_user_blacklisted()) { if (wppa_user_is('administrator') || current_user_can('wppa_moderate') || wppa_get_user() == wppa_get_photo_owner($id) && wppa_switch('upload_edit')) { $result .= '<div' . ' class="wppa-thumb-text"' . ' style="' . __wcs('wppa-thumb-text') . '"' . ' >' . '<a' . ' style="color:red;cursor:pointer;"' . ' onclick="' . esc_attr('if ( confirm( "' . __('Are you sure you want to remove this photo?', 'wp-photo-album-plus') . '" ) ) wppaAjaxRemovePhoto( ' . wppa('mocc') . ', ' . $id . ', false ); return false;') . '"' . ' >' . __('Delete', 'wp-photo-album-plus') . '</a>' . ' ' . '<a' . ' style="color:green;cursor:pointer;"' . ' onclick="wppaEditPhoto( ' . wppa('mocc') . ', ' . $id . ' ); return false;"' . ' >' . __('Edit', 'wp-photo-album-plus') . '</a>' . '</div>'; } } // Description if (wppa_switch('thumb_text_desc') || $thumb['status'] == 'pending' || $thumb['status'] == 'scheduled') { $desc = ''; if ($thumb['status'] == 'pending' || $thumb['status'] == 'scheduled') { $desc .= wppa_moderate_links('thumb', $id); } $desc .= wppa_get_photo_desc($id, wppa_switch('allow_foreign_shortcodes_thumbs')); $result .= '<div' . ' class="wppa-thumb-text"' . ' style="' . __wcs('wppa-thumb-text') . '"' . ' >' . $desc . '</div>'; } // Rating if (wppa_switch('thumb_text_rating')) { $rating = wppa_get_rating_by_id($id); if ($rating && wppa_switch('show_rating_count')) { $rating .= ' ( ' . wppa_get_rating_count_by_id($id) . ' )'; } $result .= '<div' . ' class="wppa-thumb-text"' . ' style="' . __wcs('wppa-thumb-text') . '"' . ' >' . $rating . '</div>'; } // Comcount if (wppa_switch('thumb_text_comcount')) { $comcount = $wpdb->get_var("SELECT COUNT(*) FROM `" . WPPA_COMMENTS . "` WHERE `photo` = " . $id); if ($comcount) { $result .= '<div' . ' class="wppa-thumb-text"' . ' style="' . __wcs('wppa-thumb-text') . '"' . ' >' . sprintf(_n('%d comment', '%d comments', $comcount, 'wp-photo-album-plus'), $comcount) . '</div>'; } } // Viewcount if (wppa_switch('thumb_text_viewcount')) { $result .= '<div' . ' class="wppa-thumb-text"' . ' style="clear:both;' . __wcs('wppa-thumb-text') . '"' . ' >' . sprintf(_n('%d view', '%d views', $thumb['views'], 'wp-photo-album-plus'), $thumb['views']) . '</div>'; } // Close the subtext container $result .= '</div>'; } // if ! $com_alt // Close the thumbframe $result .= '</div>'; if ($com_alt) { $result .= '</div>'; } return $result; }
function wppa_get_user_create_html($alb, $width, $where = '', $mcr = false) { // Init $result = ''; $mocc = wppa('mocc'); $occur = wppa('occur'); if ($alb < '0') { $alb = '0'; } // Feature enabled ? if (!wppa_switch('user_create_on')) { return ''; } // Have access? if ($alb && !wppa_have_access($alb)) { return ''; } // Can create album? if (!$alb && !wppa_can_create_top_album()) { return ''; } if ($alb && !wppa_can_create_album()) { return ''; } if (!wppa_user_is('administrator') && wppa_switch('owner_only')) { if ($alb) { $album = wppa_cache_album($alb); // Need to be admin to create public subalbums if ($album['owner'] == '--- public ---') { return ''; } } } // In a widget or multi column responsive? $small = wppa_in_widget() == 'upload' || $mcr; // Create the return url $returnurl = wppa_get_permalink(); if ($where == 'cover') { $returnurl .= 'wppa-album=' . $alb . '&wppa-cover=0&wppa-occur=' . $occur; } elseif ($where == 'thumb') { $returnurl .= 'wppa-album=' . $alb . '&wppa-cover=0&wppa-occur=' . $occur; } elseif ($where == 'widget' || $where == 'uploadbox') { } if (wppa('page')) { $returnurl .= '&wppa-page=' . wppa('page'); } $returnurl = trim($returnurl, '?'); $returnurl = wppa_trim_wppa_($returnurl); $t = $mcr ? 'mcr-' : ''; // The links $result .= '<div style="clear:both"></div>' . '<a' . ' id="wppa-cr-' . $alb . '-' . $mocc . '"' . ' class="wppa-create-' . $where . '"' . ' onclick="' . 'jQuery( \'#wppa-create-' . $t . $alb . '-' . $mocc . '\' ).css( \'display\',\'block\' );' . 'jQuery( \'#wppa-cr-' . $alb . '-' . $mocc . '\' ).css( \'display\',\'none\' );' . 'jQuery( \'#wppa-up-' . $alb . '-' . $mocc . '\' ).css( \'display\',\'none\' );' . 'jQuery( \'#wppa-ea-' . $alb . '-' . $mocc . '\' ).css( \'display\',\'none\' );' . 'jQuery( \'#wppa-cats-' . $alb . '-' . $mocc . '\' ).css( \'display\',\'none\' );' . 'jQuery( \'#_wppa-cr-' . $alb . '-' . $mocc . '\' ).css( \'display\',\'block\' );' . '_wppaDoAutocol( ' . $mocc . ' )' . '"' . ' style="float:left; cursor:pointer;"' . '> ' . __('Create Album', 'wp-photo-album-plus') . '</a>' . '<a' . ' id="_wppa-cr-' . $alb . '-' . $mocc . '"' . ' class="wppa-create-' . $where . '"' . ' onclick="' . 'jQuery( \'#wppa-create-' . $t . $alb . '-' . $mocc . '\' ).css( \'display\',\'none\' );' . 'jQuery( \'#wppa-cr-' . $alb . '-' . $mocc . '\' ).css( \'display\',\'block\' );' . 'jQuery( \'#wppa-up-' . $alb . '-' . $mocc . '\' ).css( \'display\',\'block\' );' . 'jQuery( \'#wppa-ea-' . $alb . '-' . $mocc . '\' ).css( \'display\',\'block\' );' . 'jQuery( \'#wppa-cats-' . $alb . '-' . $mocc . '\' ).css( \'display\',\'block\' );' . 'jQuery( \'#_wppa-cr-' . $alb . '-' . $mocc . '\' ).css( \'display\',\'none\' );' . '_wppaDoAutocol( ' . $mocc . ' )' . '"' . ' style="float:right; cursor:pointer;display:none;"' . ' >' . __(wppa_opt('close_text'), 'wp-photo-album-plus') . '</a>'; // The create form $result .= '<div' . ' id="wppa-create-' . $t . $alb . '-' . $mocc . '"' . ' class="wppa-file-' . $t . $mocc . '"' . ' style="width:' . $width . 'px;text-align:center;display:none;"' . ' >' . '<form' . ' id="wppa-creform-' . $alb . '-' . $mocc . '"' . ' action="' . $returnurl . '"' . ' method="post"' . ' >' . wppa_nonce_field('wppa-album-check', 'wppa-nonce', false, false, $alb) . '<input type="hidden" name="wppa-album-parent" value="' . $alb . '" />' . '<input type="hidden" name="wppa-fe-create" value="yes" />' . '<div' . ' class="wppa-box-text wppa-td"' . ' style="' . 'clear:both;' . 'float:left;' . 'text-align:left;' . __wcs('wppa-box-text') . __wcs('wppa-td') . '"' . ' >' . __('Enter album name.', 'wp-photo-album-plus') . ' <span style="font-size:10px;" >' . __('Don\'t leave this blank!', 'wp-photo-album-plus') . '</span>' . '</div>' . '<input' . ' type="text"' . ' class="wppa-box-text wppa-file-' . $t . $mocc . '"' . ' style="padding:0; width:' . ($width - 6) . 'px; ' . __wcs('wppa-box-text') . '"' . ' name="wppa-album-name"' . ' />' . '<div' . ' class="wppa-box-text wppa-td"' . ' style="' . 'clear:both;' . 'float:left;' . 'text-align:left;' . __wcs('wppa-box-text') . __wcs('wppa-td') . '"' . ' >' . __('Enter album description', 'wp-photo-album-plus') . '</div>' . '<textarea' . ' class="wppa-user-textarea wppa-box-text wppa-file-' . $t . $mocc . '"' . ' style="padding:0;height:120px; width:' . ($width - 6) . 'px; ' . __wcs('wppa-box-text') . '"' . ' name="wppa-album-desc" >' . '</textarea>' . '<div style="float:left; margin: 6px 0;" >' . '<div style="float:left;">' . wppa_make_captcha(wppa_get_randseed('session')) . '</div>' . '<input' . ' type="text"' . ' id="wppa-captcha-' . $mocc . '"' . ' name="wppa-captcha"' . ' style="margin-left: 6px; width:50px; ' . __wcs('wppa-box-text') . __wcs('wppa-td') . '"' . ' />' . '</div>' . '<input' . ' type="submit"' . ' class="wppa-user-submit"' . ' style="margin: 6px 0; float:right; ' . __wcs('wppa-box-text') . '"' . ' value="' . __('Create album', 'wp-photo-album-plus') . '"' . ' />' . '</form>' . '</div>'; return $result; }
function wppa_get_uploadable_album_count($alb = false) { global $wpdb; // If album array given, prepare partial where clause to limit album ids. if (is_array($alb)) { $where = " `id` IN (" . implode(',', $alb) . ") "; $where = trim($where, ','); } else { $where = false; } // Admin, do not look to owner if (wppa_user_is('administrator')) { $result = $wpdb->get_var("SELECT COUNT(*) " . "FROM `" . WPPA_ALBUMS . "` " . ($where ? "WHERE " . $where : "")); } elseif (wppa_switch('upload_owner_only')) { $result = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) " . "FROM `" . WPPA_ALBUMS . "` " . "WHERE `owner` = '--- public ---' OR `owner` = %s" . ($where ? "AND " . $where : ""), wppa_get_user())); } else { $result = $wpdb->get_var("SELECT COUNT(*) " . "FROM `" . WPPA_ALBUMS . "` " . ($where ? "WHERE " . $where : "")); } // Done! return $result; }