*** 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'); ?>

MIME Management System

- ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! '; } ?> --- 13,83 ---- require('./GLOBALS.php'); fud_use('adm.inc', true); fud_use('widgets.inc', true); + fud_use('icons_adm.inc', true); $tbl = $GLOBALS['DBHOST_TBL_PREFIX']; + $icon = new fud_icons('mime', 'frm_mime'); + 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, $icon_name) = db_saq('SELECT descr, mime_hdr, fl_ext, icon FROM '.$tbl.'mime WHERE id='.(int)$_GET['edit']); $edit = (int)$_GET['edit']; } else { ! $icon_name = $edit = $mime_descr = $mime_mime_hdr = $mime_fl_ext = ''; } if (isset($_POST['btn_update'], $_POST['edit'])) { ! $icon_store = $icon->submit_icon(); ! 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($icon_store).' WHERE id='.(int)$_POST['edit']); } else if (isset($_POST['btn_submit'])) { ! $icon_store = $icon->submit_icon(); ! 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($icon_store).')'); } + $icon->setup_icon($icon_name); + $icon_html = $icon->icon_html(); + $upload_html = $icon->upload_html(); require($WWW_ROOT_DISK . 'adm/admpanel.php'); ?>

MIME Management System

!
MIME Icon Upload (upload mime icons into the system)
MIME Icon Upload:
Only (.gif, *.jpg, *.png) files are supported
Web server does not have write permissions to 'images/mime/', mime icon upload disabled
 
MIME Management
MIME Description:
MIME Header:
File Extension:
Files with this extension (case-insensitive) will be attributed to this MIME.
MIME Icon: [select MIME icon]
Preview Image: ! ! !
!
'; ! } else { echo '
! ! ! ! ! ! ! ! '; + } else { + echo ''; } ?> *************** *** 134,140 **** } else { $bgcolor = ($i++%2) ? ' class="resultrow2""' : ' class="resultrow1"'; } ! echo ''; } unset($c); ?> --- 103,110 ---- } else { $bgcolor = ($i++%2) ? ' class="resultrow2""' : ' class="resultrow1"'; } ! # $src = substr($r[1], 0, 11) == '/image.php?' ? '': '/images/mime/'; ! echo ''."\n"; } unset($c); ?>
 
MIME Management
MIME Description:
MIME Header:
File Extension:
Files with this extension (case-insensitive) will be attributed to this MIME.
'; echo ''.$r[2].''.$r[4].''.$r[3].'[Edit] [Delete]
'.$r[2].''.$r[4].''.$r[3].'[Edit] [Delete]