XFileSharing Pro - Making export links show thumbs - Page 2
If you already have image mod, make sure you are Enable it,
login to ftp open file XFileconfig.cgi and find
make sure its # 1 , if its empty you can put number 1 then click save .
It should work. Im just fixed for my site.[/code]
login to ftp open file XFileconfig.cgi and find
Code: Select all
# Show images instantly
image_mod => '1',
It should work. Im just fixed for my site.[/code]
I've changed this code:
###########################
$file->{download_link} = $ses->makeFileLink($file);
if($c->{image_mod} && $file->{file_name}=~/\.(jpg|jpeg|gif|png|bmp)$/i)
{
$ses->getThumbLink($file);
}
else
{
$file->{fsize} = $ses->makeFileSize($file->{file_size});
}
###########################
to this code:
###########################
$file->{download_link} = $ses->makeFileLink($file);
if($c->{image_mod} && $file->{file_name}=~/\.(jpg|jpeg|gif|png|bmp)$/i)
{
$ses->getThumbLink($file);
}
else
{
$ses->getThumbLink($file);
$file->{fsize} = $ses->makeFileSize($file->{file_size});
}
###########################
And now it is working. Noticed that it is failing the if statement:
if($c->{image_mod} && $file->{file_name}=~/\.(jpg|jpeg|gif|png|bmp)$/i)
It is saying that IF the variable $c->{image_mod} exists AND the filename ends with one of the supported extensions, THEN execute the getThumbLink subroutine. The variable $file->{thumb_url} only exists if that subroutine is executed. The "push" statements that follow the code above are compacted if statements. It EITHER shows the first part before the : or the 2nd part depending on if $file->thumb_url exists.
It is possible you can change the code in XFileConfig.pm line 105 to:
image_mod => '1',
###########################
$file->{download_link} = $ses->makeFileLink($file);
if($c->{image_mod} && $file->{file_name}=~/\.(jpg|jpeg|gif|png|bmp)$/i)
{
$ses->getThumbLink($file);
}
else
{
$file->{fsize} = $ses->makeFileSize($file->{file_size});
}
###########################
to this code:
###########################
$file->{download_link} = $ses->makeFileLink($file);
if($c->{image_mod} && $file->{file_name}=~/\.(jpg|jpeg|gif|png|bmp)$/i)
{
$ses->getThumbLink($file);
}
else
{
$ses->getThumbLink($file);
$file->{fsize} = $ses->makeFileSize($file->{file_size});
}
###########################
And now it is working. Noticed that it is failing the if statement:
if($c->{image_mod} && $file->{file_name}=~/\.(jpg|jpeg|gif|png|bmp)$/i)
It is saying that IF the variable $c->{image_mod} exists AND the filename ends with one of the supported extensions, THEN execute the getThumbLink subroutine. The variable $file->{thumb_url} only exists if that subroutine is executed. The "push" statements that follow the code above are compacted if statements. It EITHER shows the first part before the : or the 2nd part depending on if $file->thumb_url exists.
It is possible you can change the code in XFileConfig.pm line 105 to:
image_mod => '1',
-
- Posts: 12
- Joined: Mar 07, 2013 5:52 pm