";
update_post_meta($posts, $meta_key2, $meta_value2);
}
}
}
function cctag_create_menu() {
cctag_add_submenu_page('tools.php','Run CC-Tag Batch Index', 'cc-tagger batch index', 'manage_options', "cctag-options");
}
function cctag_api_init(){
global $shareType, $modType;
$defaultArray = array("default" => __("Default (as defined in Media -> Options)"));
$shareType2 = array_merge($defaultArray, $shareType);
$modType2 = array_merge($defaultArray, $modType);
cctag_add_settings_section('cctag_setting_section', '', 'when you submit this form, the posts between the starting and ending IDs will be tagged with the settings below. Media that is already tagged will not be changed unless the \'overwrite existing license option\' is checked.', "cctag-options");
cctag_add_settings_field('cc_start', 'batch starting post-id (leaving this blank will select the first media)', 'text', "cctag-options", 'cctag_setting_section', array (
));
cctag_add_settings_field('cc_end', 'batch ending post-id (leaving this blank will select the latest uploaded media)', 'text', "cctag-options", 'cctag_setting_section', array (
));
cctag_add_settings_field('cc_batch_mod', __('Allowed modification of untagged media:'), 'select', "cctag-options", 'cctag_setting_section', $modType2);
cctag_add_settings_field('cc_batch_share', __('Allowed use of untagged media:'), 'select', "cctag-options", 'cctag_setting_section', $shareType2);
cctag_add_settings_field('cc_batch_overwrite', __('Should these settings overwrite existing settings on the media'), 'radio', "cctag-options", 'cctag_setting_section', array("" => "don't overwrite existing license data", "true" => "overwrite existing license data "));
cctag_add_settings_section('mc_cc_setting_section', '
CC-Tagger Options', __("This section describes how the Creative Commons License settings work. The default settings are applied to any media that has its settings set to 'default'."), "media");
global $stateFullArray, $versionArray, $imageSizeArray, $linkTypeArray, $shareType, $modType;
$list_of_states = $stateFullArray;
foreach($versionArray as $version){
unset($list_of_states[$version]);
}
asort($list_of_states);
cctag_add_settings_field('mc_cc_area_setting_name', __('Jurisdiction of your license information:'), 'select', 'media', 'mc_cc_setting_section', $list_of_states);
cctag_add_settings_field('mc_cc_image_setting_name', __('Badge size:'), 'select', 'media', 'mc_cc_setting_section', $imageSizeArray);
cctag_add_settings_field('mc_cc_link_setting_name', __('Display a text link to the license:'), 'radio', 'media', 'mc_cc_setting_section', $linkTypeArray);
cctag_add_settings_field('mc_cc_default_"_setting_name', __('By Default allowed use of untagged media:'), 'select', 'media', 'mc_cc_setting_section', $shareType);
cctag_add_settings_field('mc_cc_default_mod_setting_name', __('By Default allowed modification of untagged media:'), 'select', 'media', 'mc_cc_setting_section', $modType);
cctag_add_settings_field('mc_cc_search_setting_name', __('Add search options to the search form'), 'select', 'media', 'mc_cc_setting_section', array("Yes" => __("Yes"), "" => __("No") ));
}
// CHANGE THE LINES BELOW AT YOUR OWN RISK
// THE SKY WILL FALL ON YOUR HEAD
add_action('admin_menu', 'cctag_create_menu');
add_action('admin_init', 'cctag_api_init');
if ( ! function_exists( 'cctag_plugin_options' ) ){
function cctag_plugin_options() {
global $cctag_page_title;
global $cctag_page_parent;
$page = $_GET["page"];
echo '