podPress_class();
return;
}
/*************************************************************/
/* Functions for editing and saving posts */
/*************************************************************/
function settings_general_edit() {
GLOBAL $wpdb, $wp_rewrite;
podPress_isAuthorized();
if (isset($_GET['updated']) && $_GET['updated'] == 'true') {
echo '
'."\n";
echo '
'.__('General Options', 'podpress').' 
'."\n";
echo '
'."\n";
echo '
'."\n";
echo '
'."\n";
$sql = "SELECT * FROM ".$wpdb->prefix."postmeta WHERE meta_key IN('podPress_podcastStandardAudio',
'podPress_podcastStandardAudioSize',
'podPress_podcastStandardAudioDuration',
'podPress_podcastEnhancedAudio',
'podPress_podcastEnhancedAudioSize',
'podPress_podcastEnhancedAudioDuration',
'podPress_podcastVideo',
'podPress_podcastVideoSize',
'podPress_podcastVideoDuration',
'podPress_podcastVideoDimension',
'podPress_webVideo',
'podPress_webVideoSize',
'podPress_webVideoDuration',
'podPress_webVideoDimension',
'podPress_podcastEbook',
'podPress_podcastEbookSize',
'itunes:duration',
'enclosure',
'enclosure_hold'
)";
$stats = $wpdb->get_results($sql);
if($stats) {
echo '
'."\n";
}
echo '
'."\n";
}
function settings_general_save() {
GLOBAL $wpdb;
if(function_exists('wp_cache_flush')) {
wp_cache_flush();
}
// settings for the player
if(isset($_POST['mediaWebPath'])) {
if(substr($_POST['podPress_mediaWebPath'], -1) == '/')
{
$_POST['mediaWebPath'] = substr($_POST['mediaWebPath'], 0, -1);
}
$this->settings['mediaWebPath'] = $_POST['mediaWebPath'];
}
if(isset($_POST['mediaFilePath'])) {
//if(substr($_POST['mediaFilePath'], -1) == '/' || substr($_POST['mediaFilePath'], -1) == '\\')
//{
// $_POST['mediaFilePath'] = substr($_POST['mediaFilePath'], 0, -1);
//}
$this->settings['mediaFilePath'] = $_POST['mediaFilePath'];
}
if(isset($_POST['enableStats'])) {
$this->settings['enableStats'] = true;
} else {
$this->settings['enableStats'] = false;
}
if(isset($_POST['statMethod'])) {
$this->settings['statMethod'] = $_POST['statMethod'];
}
if(isset($_POST['statLogging'])) {
$this->settings['statLogging'] = $_POST['statLogging'];
}
if(isset($_POST['enablePodTracStats'])) {
$this->settings['enablePodTracStats'] = true;
} else {
$this->settings['enablePodTracStats'] = false;
}
if(isset($_POST['enableMobatalkAudioComments'])) {
$this->settings['enableMobatalkAudioComments'] = true;
} else {
$this->settings['enableMobatalkAudioComments'] = false;
}
if(isset($_POST['mobatalkID']) && $_POST['mobatalkID'] != 'Free PodPress Special' && is_numeric($_POST['mobatalkID'])) {
$this->settings['mobatalkID'] = $_POST['mobatalkID'];
} else {
$this->settings['mobatalkID'] = '352';
}
if(isset($_POST['maxMediaFiles'])) {
$this->settings['maxMediaFiles'] = $_POST['maxMediaFiles'];
}
if(isset($_POST['enablePremiumContent'])) {
$this->settings['enablePremiumContent'] = true;
} else {
$this->settings['enablePremiumContent'] = false;
}
if(isset($_POST['premiumMethod']) && $_POST['premiumMethod'] == 'Basic') {
$this->settings['premiumMethod'] = 'Basic';
} else {
$this->settings['premiumMethod'] = 'Digest';
}
if(isset($_POST['premiumContentFakeEnclosure'])) {
$this->settings['premiumContentFakeEnclosure'] = true;
} else {
$this->settings['premiumContentFakeEnclosure'] = false;
}
if(isset($_POST['enableTorrentCasting'])) {
$this->settings['enableTorrentCasting'] = true;
} else {
$this->settings['enableTorrentCasting'] = false;
}
if(isset($_POST['feedCacheDir'])) {
$this->settings['feedCacheDir'] = $_POST['feedCacheDir'];
}
if(isset($_POST['contentBeforeMore'])) {
$this->settings['contentBeforeMore'] = $_POST['contentBeforeMore'];
}
if(isset($_POST['contentLocation'])) {
$this->settings['contentLocation'] = $_POST['contentLocation'];
}
if(isset($_POST['contentImage'])) {
$this->settings['contentImage'] = $_POST['contentImage'];
}
if(isset($_POST['contentPlayer'])) {
$this->settings['contentPlayer'] = $_POST['contentPlayer'];
}
if(isset($_POST['contentDownload'])) {
$this->settings['contentDownload'] = $_POST['contentDownload'];
}
if(isset($_POST['contentDownloadText'])) {
$this->settings['contentDownloadText'] = $_POST['contentDownloadText'];
}
if(isset($_POST['contentDownloadStats'])) {
$this->settings['contentDownloadStats'] = $_POST['contentDownloadStats'];
}
if(isset($_POST['contentDuration'])) {
$this->settings['contentDuration'] = $_POST['contentDuration'];
}
if(isset($_POST['enableFooter'])) {
$this->settings['enableFooter'] = true;
} else {
$this->settings['enableFooter'] = false;
}
delete_option('podPress_config');
podPress_add_option('podPress_config', $this->settings);
if(isset($_POST['cleanupOldMetaKeys'])) {
$sql = "DELETE FROM ".$wpdb->prefix."postmeta WHERE meta_key IN('podPress_podcastStandardAudio',
'podPress_podcastStandardAudioSize',
'podPress_podcastStandardAudioDuration',
'podPress_podcastEnhancedAudio',
'podPress_podcastEnhancedAudioSize',
'podPress_podcastEnhancedAudioDuration',
'podPress_podcastVideo',
'podPress_podcastVideoSize',
'podPress_podcastVideoDuration',
'podPress_podcastVideoDimension',
'podPress_webVideo',
'podPress_webVideoSize',
'podPress_webVideoDuration',
'podPress_webVideoDimension',
'podPress_podcastEbook',
'podPress_podcastEbookSize',
'itunes:duration',
'enclosure',
'enclosure_hold'
)";
$wpdb->query($sql);
}
$location = get_option('siteurl') . '/wp-admin/admin.php?page=podpress/podpress_general.php&updated=true';
header('Location: '.$location);
exit;
}
}