Page 1 of 1

random url enhancements

PostPosted: Tue Apr 19, 2011 6:58 pm
by tom
i want to enhance the random url (number) given before the filename.
normall its 343filename
with my modification it its 34-filname

so its more human readable and better for some search engines :)

i am not a good coder, so i did not find a simple way to let the 3 random digits AND add a simple -.

so here are only 2 random digits :) (we could perhaps include a timestamp in the filename of the uploaded file... like this 2011-04-19_21-01-23_filename... what do you think about??)

$randName1 = rand('11','99');
$fancyurl = $randName1."-";


Code: Select all
$filename = stripslashes("$filename");
$filesize = $_FILES['upfile']['size'];

$randName1 = rand('11','99');
$fancyurl  = $randName1."-";

$rand2=("$fancyurl$filename");
$m=$shourturl;
if ($m=="true")
  $short= "";
else
  $short= "download.php?file=";

$bans=file("./secure/bans.dfh");
foreach($bans as $line)

Re: random url enhancements

PostPosted: Tue Feb 07, 2012 8:18 am
by sigma
I have modified upload.php:

$fancyurl=date('Y-m-d').'_'.rand('1','999');
$rand2=("$fancyurl"."_"."$filename");

As a result, I have a filenames, like
2012-01-18_678_myfile.txt

And I made the same modification in basic.php (for image upload)

//generate random number
$zufall = date('Y-m-d').'_'.rand('123','999999').'_';
$fupl = "$zufall";
$imgtext = $zufall.$_FILES['upimage']['name'];

Re: random url enhancements

PostPosted: Sat Dec 27, 2014 9:17 am
by faarisuman
I have been using DFH for a few weeks and I noticed that in the admin panel it shows the password for the password protected files but in the standard user panel it doesn't show the passwords. How can I make it show the password in the user panel?

Re: random url enhancements

PostPosted: Tue Dec 30, 2014 9:03 pm
by SamEA
By simply adding a new table row called Passwords in ./styles/[STYLE_NAME]/userpanel_filelist.php.

In this file, find:
Code: Select all
<td align=center bgcolor=#EBEBEB background="img/bg.png"><b><? echo $lang[ldload];?></b></td>


Add after the above line:
Code: Select all
<td align=center bgcolor=#EBEBEB background="img/bg.png"><b>Password</b></td>


Find:

Code: Select all
<td align=center style=padding-left:5px bgcolor=#F9F9F9><?php echo date('Y-m-d G:i', $filedata[4])?></td>


Add after the above line:

Code: Select all
<td align=center bgcolor=#F9F9F9><?php echo $filedata[9];?></td>