Permalink
Browse files

allow custom filetypes in upload

  • Loading branch information...
1 parent 21d8c4a commit d589dfd9123ccaefcbf2d1a77ce6496addf0c538 Spiros Ioannou committed Jun 28, 2012
Showing with 10 additions and 6 deletions.
  1. +6 −3 index.php
  2. 0 itdb.php
  3. +4 −3 php/uploadframe.php
View
@@ -5,7 +5,10 @@
$version="1.7";
$fordbversion=1;
-/***********************************************************************/
+/***********************************************************************
+ ***********************************************************************
+ ***********************************************************************/
+
$itdb_start=getmicrotime();
function getmicrotime() {
$a = explode (' ',microtime());
@@ -322,8 +325,8 @@ function getmicrotime() {
}
else {
-if (isset($_COOKIE["itdbuser"])) $itdbuser=$_COOKIE["itdbuser"];
-else $itdbuser="username";
+ if (isset($_COOKIE["itdbuser"])) $itdbuser=$_COOKIE["itdbuser"];
+ else $itdbuser="username";
echo "\n<form name=itdbloginfrm method=post>".
"<input name=authusername size=10 onfocus=\"this.value='';\" ".
View
No changes.
View
@@ -64,16 +64,16 @@ function rst() {
</head>
<body >
<?php
-$types=$_GET['types'];
+//$types=$_GET['types'];
+//$types_arr=explode(",",$types);
isset($_GET['defdate'])?$defdate=$_GET['defdate']:$defdate="";
-$types_arr=explode(",",$types);
$id=$_GET['id'];
if (!is_numeric($id)) {
echo "Cannot upload files to unsaved items.";
exit;
}
-$sql="SELECT * from filetypes WHERE id IN ($types) order by typedesc";
+$sql="SELECT * from filetypes WHERE id <> 3 order by typedesc";
$sth=db_execute($dbh,$sql);
while ($r=$sth->fetch(PDO::FETCH_ASSOC)) $ftypes[$r['id']]=$r;
?>
@@ -103,6 +103,7 @@ function rst() {
if (count($ftypes)==1) $s="selected"; else $s=""; //if just 1 type, pre-select it
foreach ($ftypes as $t) {
+
$dbid=$t['id'];
$desc=$t['typedesc'];
echo "\t<option $s value='$dbid' title='$dbid'>".ucfirst($desc)."</option>\n";

0 comments on commit d589dfd

Please sign in to comment.