XFileSharing Pro - Need quick fix for mp3/image preview bug

Message
Author
qq_bbq
Posts: 122
Joined: Jul 05, 2009 11:33 pm

Need quick fix for mp3/image preview bug

#1 Postby qq_bbq » Aug 19, 2009 10:30 pm

If mp3/image preview is enabled and user go to the download page, the last download is not updated.

So it will be deleted as inactive even though they were played/viewed. Especially the images are vulnerable since not many will push download button.

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#2 Postby PilgrimX182 » Aug 20, 2009 6:24 am

Good point, thanks!

In index.cgi find

Code: Select all

   if($c->{image_mod} && $file->{file_name}=~/\.(jpg|jpeg|gif|png|bmp)$/i && $file->{file_size}<1048576*3)
   {
and add line below:

Code: Select all

$db->Exec("UPDATE Files SET file_downloads=file_downloads+1, file_last_download=NOW() WHERE file_id=?",$file->{file_id});
add same line after

Code: Select all

   if($c->{mp3_mod} && $file->{file_name}=~/\.mp3$/i && $file->{file_size}<1048576*10 && !$file->{message})
   {