From: Marcus C. <ma...@br...> - 2007-04-23 11:13:00
|
Hi, Some questions: Is there a variable in cchost which contains the local file root (as in /home/foo/bar/my_cchost_install)? Our Cchost (in dev) has a built-in flash sequencer for music students to learn about production. The sequencer saves XML song files on the server and there is a submit form to upload publish the songs into the cchost system. To achieve this I've inherited from existing classes and added custom methods (see below) I can publish the file ok but the upload listings have broken file page URLs. Where is the ['file_page_url'] attribute added to the upload record? I've hacked a fix by adding the value to the record in CCMediahost::OnUploadRow() I did notice this: <code> // NOTE: This hopefully didn't break anything ;) if ( ! isset($file['download_url']) ) { continue; } </code> I've inherited from CCUpload : <code> class MOUpload extends CCUpload { function PostProcessNewUploadForm( &$form, $ccud_tags, $relative_dir, $username, $parents = null) { $form->GetFormValues($values); $current_path = '/home/ccdev18/ccdev18.dreamhosters.com/sequencer/songs/'.$username.'/'.$values['upload_file_name']; $new_name = $values['upload_file_name']; $user_tags = $values['upload_tags']; // All fields here that start with 'upload_' are // considered to be fields in the CCUploads table // so.... // Destroy the $_FILES object so it doesn't get // confused with that CCDebug::Log("IN MOPostProcessNewUploadForm"); CCDebug::Log($current_path); unset($values['upload_file_name']); require_once('cclib/cc-uploadapi.php'); $ret = CCUploadAPI::PostProcessNewUpload( $values, $current_path, $new_name, $ccud_tags, $user_tags, $relative_dir, $parents ); if( is_string($ret) ) { $form->SetFieldError('upload_file_name',$ret); return(0); } return($ret); } } </code> Thanks for taking a look. Marcus -- Marcus Clements www.brightonart.org www.rocketfestival.com www.innerfield.co.uk |