Multimedia inportatzeko orria
Lotutako hitzak berbaren dagokion sarreran erantsita azalduko dira.
filepath, -3); if(in_array($ext, $video_ext)){ $filepath = substr($r->filepath, 0, -4) . '.flv'; } else { $filepath = $r->filepath; } $filepath = 'tmp/mmedia/' . $filepath; $node = node_load($r->nid); $jasotzeko[$node->nid] = $filepath; $node_link = $node ? l($node->nid, "node/$node->nid", array('attributes' => array('title' => $node->title))) : $r->nid; $import_link = l('jaso', $_GET['q'], array('query' => "jaso=$node->nid")); $delete_link = l('ezabatu', $_GET['q'], array('query' => "ezabatu=$node->nid")); $ok = file_exists($filepath) ? round(filesize($filepath) / 1024, 2) : '-'; $item = array('nid' => $node_link, 'path' => $r->filepath, 'iraupen' => $r->iraupen, 'genero' => $r->genero, 'Ok' => $ok, 'import' => $import_link, 'delete' => $delete_link); $data[$node->nid] = $item; $items[] = $item; } $headers = array('NID', 'Path', 'Iraupen', 'Genero', 'OK', 'Jaso', 'Ezabatu'); print theme('table', $headers, $items); if(isset($_GET['jaso'])){ $nid = $_GET['jaso']; extra_fitxategia_jaso($jasotzeko[$nid], $nid); db_query('UPDATE grabaketa SET iraupen = %d WHERE nid = %d', $data[$nid]['iraupen'], $nid); drupal_set_message(t('Fitxategia jaso da, !link', array('!link' => l('ikusi', "node/$nid")))); drupal_goto($_GET['q']); } if(isset($_GET['ezabatu'])){ $nid = $_GET['ezabatu']; unlink($jasotzeko[$nid]); db_query('DELETE FROM _mmedia WHERE nid = %d', $nid); drupal_set_message(t('%file fitxategia ezabatu da', array('%file' => $jasotzeko[$nid]))); drupal_goto($_GET['q']); } ?>