"", "WP_USE_THEMES"=>"", "DEBUG_FLAG"=>"", "CONTESTS_PATH"=>"", "CONTESTS_SKIN"=>"", "DEFAULT_STATUS"=>"", "user"=>"", "parent_id"=>"", "DEFAULT_PAGENAME"=>"", "DEFAULT_TYPE"=>"", "DEFAULT_COMMENTS"=>"", "VOTING_METHOD"=>"", "ROLE_VOTING"=>"", "ROLE_UPLOAD"=>"", "VIEWIMG_BOX"=>"", "VISIBLE_UPLOAD"=>"", "N_PHOTO_X_PAGE"=>"", ); $_REQUEST = array_merge($checkArray,$_REQUEST); foreach($wp_roles->role_names as $role => $name) { $role_values[$role] = translate_with_context($name); $user_roles[] = $role; } $user_roles[] = ''; $action = wppc_checkOptions($_REQUEST['do'],array(__('Save settings', 'wp-photocontest'), 'fixpermissions')); $WP_USE_THEMES = wppc_checkOptions($_REQUEST['WP_USE_THEMES'], array('true','false'), WP_USE_THEMES); $DEBUG_FLAG = wppc_checkOptions($_REQUEST['DEBUG_FLAG'], array('0','1'),DEBUG_FLAG); $CONTESTS_PATH = wppc_checkString($_REQUEST['CONTESTS_PATH'], CONTESTS_PATH); $CONTESTS_SKIN = wppc_checkString($_REQUEST['CONTESTS_SKIN'], CONTESTS_SKIN); $DEFAULT_STATUS = wppc_checkOptions($_REQUEST['DEFAULT_STATUS'], array('publish','pending','draft'),DEFAULT_STATUS); $DEFAULT_UID = wppc_checkInteger($_REQUEST['user'], DEFAULT_UID); $DEFAULT_PARENT = wppc_checkInteger($_REQUEST['parent_id'], DEFAULT_PARENT); $DEFAULT_PAGENAME = wppc_checkString($_REQUEST['DEFAULT_PAGENAME'], DEFAULT_PAGENAME); $DEFAULT_TYPE = wppc_checkOptions($_REQUEST['DEFAULT_TYPE'], array('page','post'),DEFAULT_TYPE); $DEFAULT_COMMENTS = wppc_checkOptions($_REQUEST['DEFAULT_COMMENTS'], array('open','closed'),DEFAULT_COMMENTS); $VOTING_METHOD = wppc_checkOptions($_REQUEST['VOTING_METHOD'], array('star5','star10','option5','option10','hidden'),VOTING_METHOD); $ROLE_VOTING = wppc_checkOptions($_REQUEST['ROLE_VOTING'], $user_roles,ROLE_VOTING); $ROLE_UPLOAD = wppc_checkOptions($_REQUEST['ROLE_UPLOAD'], $user_roles,ROLE_UPLOAD); $VIEWIMG_BOX = wppc_checkInteger($_REQUEST['VIEWIMG_BOX'], VIEWIMG_BOX); $VISIBLE_UPLOAD = wppc_checkOptions($_REQUEST['VISIBLE_UPLOAD'], array('0','1'),VISIBLE_UPLOAD); $N_PHOTO_X_PAGE = wppc_checkInteger($_REQUEST['N_PHOTO_X_PAGE'], N_PHOTO_X_PAGE); $EDIT_DATE = date('Y-m-d h:m:i'); ### Add some vars $show_form = true; ### Form Processing if(!empty($action)) { // Decide What To Do switch($action) { case "fixpermissions": $role = get_role('administrator'); if(!$role->has_cap('manage_photocontest')) { $role->add_cap('manage_photocontest'); } if(!$role->has_cap('manage_photocontests')) { $role->add_cap('manage_photocontests'); } $text .= '

'.__('Succes saving PhotoContest fix.', 'wp-photocontest').'

'; $text .= '

'.__('Click here to continue', 'wp-photocontest').'

'; $show_form = false; break; // Add PhotoContest case __('Save settings', 'wp-photocontest'): // Check if contest name is set $default_options = $wpdb->update ( $wpdb->prefix.'photocontest_config', array( 'WP_USE_THEMES' => $WP_USE_THEMES, 'DEBUG_FLAG' => $DEBUG_FLAG, 'CONTESTS_PATH' => $CONTESTS_PATH, 'CONTESTS_SKIN' => $CONTESTS_SKIN, 'DEFAULT_STATUS' => $DEFAULT_STATUS, 'DEFAULT_UID' => $DEFAULT_UID, 'DEFAULT_PARENT' => $DEFAULT_PARENT, 'DEFAULT_PAGENAME' => $DEFAULT_PAGENAME, 'DEFAULT_TYPE' => $DEFAULT_TYPE, 'DEFAULT_COMMENTS' => $DEFAULT_COMMENTS, 'VOTING_METHOD' => $VOTING_METHOD, 'ROLE_VOTING' => $ROLE_VOTING, 'ROLE_UPLOAD' => $ROLE_UPLOAD, 'VIEWIMG_BOX' => $VIEWIMG_BOX, 'VISIBLE_UPLOAD' => $VISIBLE_UPLOAD, 'N_PHOTO_X_PAGE' => $N_PHOTO_X_PAGE, 'edit_date' => $EDIT_DATE, ), array( 'option_id' => 1 ) ); if ($default_options) { if ($VIEWIMG_BOX != VIEWIMG_BOX) { $text .= '

'.__('Note:', 'wp-photocontest').'

'; $text .= '

'.__('You changed the VIEWIMG_BOX value! Please manually resize and rename your already uploaded pictures!', 'wp-photocontest').'

'; $text .= '


'; } $text .= '

'.__('Succes saving PhotoContest options.', 'wp-photocontest').'

'; $text .= '

'.__('Click here to continue', 'wp-photocontest').'

'; $show_form = false; } else { //TODO: Rollback of directory and page $text .= '

'.__('Error saving PhotoContest options.', 'wp-photocontest').'

'; $text .= '

'.__('Can\'t insert into the database', 'wp-photocontest').'

'; $text .= '

'.wppc_printDatabaseError().'

'; $show_form = false; } wppc_printDatabaseError(); break; default: // We don't have a valid action. Just show the add-form break; } } photocontest_scripts_and_styles(); ?>
'.stripslashes($text).'
'; } ?> prefix."photocontest_config LIMIT 0,1"; $options_array = (array) $wpdb->get_row( $wpdb->prepare( $option_sql )); ?>


You do not have sufficient permissions to access this page-error?
Click here to fix it!

: 'True','false'=>'False'); $selectstring = ''; echo $selectstring; unset($selectstring); ?>
: 'True','0'=>'False'); $selectstring = ''; echo $selectstring; unset($selectstring); ?>
:
:
: __('Publish','wp-photocontest'),'pending'=>__('Pending','wp-photocontest'),'draft'=>__('Draft','wp-photocontest')); $selectstring = ''; echo $selectstring; unset($selectstring); ?>
: $options_array['DEFAULT_UID']));?>
: __('Page','wp-photocontest'),'post'=>__('Post','wp-photocontest')); $selectstring = ''; echo $selectstring; unset($selectstring); ?>



:
: 0, 'selected' => $options_array['DEFAULT_PARENT'], 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)','wp-photocontest'), 'sort_column'=> 'menu_order, post_title')); ?>
: __('Open','wp-photocontest'),'closed'=>__('Closed','wp-photocontest')); $selectstring = ''; echo $selectstring; unset($selectstring); ?>



: '5 stars','star10'=>'10 stars','option5'=>'5 option list','option10'=>'10 option list','hidden'=>'Hidden'); $selectstring = ''; echo $selectstring; unset($selectstring); ?>
: '; if (empty($options_array['ROLE_VOTING'])) { $selectstring .= ''; } else { $selectstring .= ''; } foreach ($role_values as $status_k=>$status_v) { $_selected = ''; if ($options_array['ROLE_VOTING'] == $status_k) { $_selected = ' selected="selected"'; } $selectstring .= ''; } $selectstring .= ''; echo $selectstring; unset($selectstring); ?>
: '; if (empty($options_array['ROLE_UPLOAD'])) { $selectstring .= ''; } else { $selectstring .= ''; } foreach ($role_values as $status_k=>$status_v) { $_selected = ''; if ($options_array['ROLE_UPLOAD'] == $status_k) { $_selected = ' selected="selected"'; } $selectstring .= ''; } $selectstring .= ''; echo $selectstring; unset($selectstring); ?>
:
: 'True','0'=>'False'); $selectstring = ''; echo $selectstring; unset($selectstring); ?>
: