random url enhancements

Any hacks and modifications will be in here...

random url enhancements

Postby tom » Tue Apr 19, 2011 6:58 pm

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)
tom
Standard Member
 
Posts: 8
Joined: Sat Apr 16, 2011 2:04 pm

Re: random url enhancements

Postby sigma » Tue Feb 07, 2012 8:18 am

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'];
sigma
Standard Member
 
Posts: 5
Joined: Sat Feb 04, 2012 10:02 am

Re: random url enhancements

Postby faarisuman » Sat Dec 27, 2014 9:17 am

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?
Unlock the key of your success by Testking cisco certifications and testking.By using our latest Testking ceh exam and study material, you can easily pass madonna gmat with online exam training itil and you can also get best quality fnu.edu Your Exams.
faarisuman
Newbie Member
 
Posts: 1
Joined: Sat Dec 27, 2014 9:13 am

Re: random url enhancements

Postby SamEA » Tue Dec 30, 2014 9:03 pm

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>
SamEA,
DaddyScripts' Admin & Developer.

Require a PHP or general IT freelancer? Don't hesitate to PM me.
User avatar
SamEA
Site Admin
 
Posts: 1165
Joined: Sat Feb 19, 2011 7:51 pm


Return to Hacks and Modifications

Who is online

Users browsing this forum: No registered users and 3 guests

cron