voxforge.org
VoxForge Dev

Changeset 31

Show
Ignore:
Timestamp:
04/23/07 16:16:15 (2 years ago)
Author:
trevarthan
Message:

Add template-like detail to body of forum submission. This way users see at a glance what the tar.gz contains without going through the trouble of opening it first.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/submit_audio.php

    r23 r31  
    5555  else crash(3,"ERROR: cannot parse login result; login probably failed"); 
    5656 
    57   $result = upload($upload_url,$session_id,$tar_gz_path); 
     57  $result = upload($upload_url,$session_id,$tar_gz_path,$session_dir); 
    5858  if (!$result) crash(4,'ERROR: upload failed'); 
    5959  $upload_status = parse_upload($result); 
     
    126126} 
    127127 
    128 function upload($url,$session_id,$tar_gz_path) { 
     128function upload($url,$session_id,$tar_gz_path,$session_dir) { 
     129  $body_s  = ''; 
     130  $body_s .= file_get_contents("$session_dir/README"); 
     131  $body_s .= "<h2>License:</h2>\n"; 
     132  $body_s .= file_get_contents("$session_dir/LICENSE"); 
     133  $body_s .= "<h2>Transcriptions (i.e. the prompts file):</h2>\n"; 
     134  $body_s .= file_get_contents("$session_dir/prompts"); 
     135  $body_s = preg_replace("/\n/m","<br>\n",$body_s); 
    129136  $post_a = array( 
    130137    'func'        => 'editSave', 
     
    133140    'proceed'     => 'showConfirmation', 
    134141    'title'       => "voxforge-ivr-$session_id", 
    135     'content'     => 'automated submission; see .tgz for details', 
    136     'contentType' => 'text', 
     142    'content'     => $body_s, 
    137143    '__storageId_action' => 'upload', 
    138144    'storageId_file' => "@$tar_gz_path", 
     
    140146    'submit'      => 'save', 
    141147  ); 
     148 
    142149  $ch = curl_init(); 
    143150  curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookies.txt");