*** adm/admmime.php --- adm/admmime.php 2005-10-14 09:00:42.856206989 -0600 *************** *** 13,114 **** require('./GLOBALS.php'); fud_use('adm.inc', true); fud_use('widgets.inc', true); $tbl = $GLOBALS['DBHOST_TBL_PREFIX']; if (isset($_GET['del'])) { q('DELETE FROM '.$tbl.'mime WHERE id='.(int)$_GET['del']); } if (isset($_GET['edit'])) { ! list($mime_descr, $mime_mime_hdr, $mime_fl_ext, $mime_icon) = db_saq('SELECT descr, mime_hdr, fl_ext, icon FROM '.$tbl.'mime WHERE id='.(int)$_GET['edit']); $edit = (int)$_GET['edit']; } else { ! $mime_icon = $edit = $mime_descr = $mime_mime_hdr = $mime_fl_ext = ''; ! } ! ! if (isset($_FILES['icoul']) && $_FILES['icoul']['size'] && preg_match('!\.(jpg|jpeg|gif|png)$!i', $_FILES['icoul']['name'])) { ! move_uploaded_file($_FILES['icoul']['tmp_name'], $GLOBALS['WWW_ROOT_DISK'] . 'images/mime/' . $_FILES['icoul']['name']); ! if (empty($_POST['mime_icon'])) { ! $_POST['mime_icon'] = $_FILES['icoul']['name']; ! } } if (isset($_POST['btn_update'], $_POST['edit'])) { ! q('UPDATE '.$tbl.'mime SET descr='.ssn($_POST['mime_descr']).', mime_hdr='.ssn($_POST['mime_mime_hdr']).', fl_ext='.ssn($_POST['mime_fl_ext']).', icon='.ssn($_POST['mime_icon']).' WHERE id='.(int)$_POST['edit']); } else if (isset($_POST['btn_submit'])) { ! q('INSERT INTO '.$tbl.'mime (descr, mime_hdr, fl_ext, icon) VALUES ('.ssn($_POST['mime_descr']).', '.ssn($_POST['mime_mime_hdr']).', '.ssn($_POST['mime_fl_ext']).', '.ssn($_POST['mime_icon']).')'); } require($WWW_ROOT_DISK . 'adm/admpanel.php'); ?>