function remote_videos_uninstall() { global $CONFIG; foreach (remote_videos_get_hoster() as $filetype => $value) { $CONFIG['allowed_mov_types'] = str_replace("/{$filetype}", '', $CONFIG['allowed_mov_types']); $CONFIG['allowed_mov_types'] = str_replace("{$filetype}/", '', $CONFIG['allowed_mov_types']); $CONFIG['allowed_mov_types'] = str_replace("{$filetype}", '', $CONFIG['allowed_mov_types']); cpg_db_query("DELETE FROM {$CONFIG['TABLE_FILETYPES']} WHERE extension = '{$filetype}'"); } cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = '{$CONFIG['allowed_mov_types']}' WHERE name = 'allowed_mov_types'"); return true; }
/************************************************** Coppermine 1.5.x Plugin - remote_videos ************************************************* Copyright (c) 2009-2015 eenemeenemuu ************************************************* $HeadURL$ $Revision$ $LastChangedBy$ $Date$ **************************************************/ $superCage = Inspekt::makeSuperCage(); $album = $superCage->post->getInt('album'); if (remote_videos_upload_permission($album)) { // check if url is supported and extension is enabled for upload $extension = ""; foreach (remote_videos_get_hoster() as $key => $value) { if (is_numeric(strpos($superCage->post->getAlpha('url'), $key))) { $extension = $key; break; } } if ($extension == "" || !is_numeric(strpos($CONFIG['allowed_mov_types'], $extension))) { cpg_die(ERROR, 'file extension', __FILE__, __LINE__); } // CHECK IF IT'S POSSIBLE TO CREATE THE FILE TEMPORARY ON THE SERVER AND THEN SUBMIT IT TO THE UPLOAD FORM! // check if quota is exceeded // generate file name by hoster video id + extension // check if file exists // check if directory exists (try to create if not exists) // file_put_contents to appropriate userpics directory // create message "uploaded successfully"