| View previous topic :: View next topic |
| Author |
Message |
komi
Joined: 27 Nov 2009 Posts: 159
|
Posted: Dec 06, 2009 1:19 am Post subject: |
|
|
Ofcourse you can. That's the way I use direct links myself.
| Code: | | <a href="<TMPL_VAR direct_link>"><img src="<TMPL_VAR site_url>/images/download.gif" border="0"></a> |
You probably also need to move the direct link piece from sub Download2 to sub Download1 in index.cgi |
|
| Back to top |
|
 |
Arthur
Joined: 04 Dec 2009 Posts: 69
|
Posted: Dec 06, 2009 1:29 am Post subject: |
|
|
| k i got the button in and when I click it just refreshes the page what exactly do I change in the index.cgi |
|
| Back to top |
|
 |
komi
Joined: 27 Nov 2009 Posts: 159
|
Posted: Dec 06, 2009 1:36 am Post subject: |
|
|
I'm going to get some sleep (I live in Europe), I will check back tomorrow.
Temporarily restore the download button if you want. |
|
| Back to top |
|
 |
Arthur
Joined: 04 Dec 2009 Posts: 69
|
Posted: Dec 06, 2009 1:50 am Post subject: |
|
|
k thnx for the help Ill try to figure it out till then  |
|
| Back to top |
|
 |
Arthur
Joined: 04 Dec 2009 Posts: 69
|
Posted: Dec 07, 2009 2:06 am Post subject: |
|
|
| couldnt figure it out..little more help? |
|
| Back to top |
|
 |
PilgrimX182

Joined: 22 Mar 2006 Posts: 2109 Location: UFO Lab
|
Posted: Dec 07, 2009 8:59 am Post subject: |
|
|
Solution for dl.cgi: comment this line in index.cgi:
| Code: | | my $fname = $file->{file_name}; |
|
|
| Back to top |
|
 |
Arthur
Joined: 04 Dec 2009 Posts: 69
|
Posted: Dec 07, 2009 10:45 pm Post subject: |
|
|
I have this in my index.cgi
| Code: | if($c->{mp3_mod} && $file->{file_name}=~/\.mp3$/i && !$file->{message})
{
DownloadTrack($file) if $c->{mp3_mod_no_download};
$file->{song_url} = DownloadGenLink($file,"$file->{file_code}.mp3");
(undef,$file->{mp3_secs},$file->{mp3_bitrate},$file->{mp3_freq},$file->{mp3_artist},$file->{mp3_title},$file->{mp3_album},$file->{mp3_year}) = split(/\|/,$file->{file_spec}) if $file->{file_spec}=~/^A\|/;
$file->{no_link}=1 if $c->{mp3_mod_no_download};
$ses->{meta_keywords}.=", $file->{mp3_artist}" if $file->{mp3_artist};
$ses->{meta_keywords}.=", $file->{mp3_title}" if $file->{mp3_title};
$ses->{meta_keywords}.=", $file->{mp3_album}" if $file->{mp3_album};
} |
Where would I put that line? |
|
| Back to top |
|
 |
Arthur
Joined: 04 Dec 2009 Posts: 69
|
Posted: Dec 08, 2009 3:51 am Post subject: |
|
|
But I would like to use the direct link download instead. I have replaced the generate button with an image but now which parts need to be change in the index.cgi to make it download right away when clicking on image..
Whats exact direct link code would I copy from sub Download2 to sub Download1 in index.cgi? |
|
| Back to top |
|
 |
Arthur
Joined: 04 Dec 2009 Posts: 69
|
Posted: Dec 09, 2009 1:53 am Post subject: |
|
|
| Never mind figured everything out. |
|
| Back to top |
|
 |
komi
Joined: 27 Nov 2009 Posts: 159
|
Posted: Dec 09, 2009 9:29 am Post subject: |
|
|
| Great! Maybe an idea to post exactly what you did? I'm sure some people are interested in doing this. |
|
| Back to top |
|
 |
shynobee
Joined: 28 Apr 2009 Posts: 29
|
Posted: Dec 12, 2009 2:46 pm Post subject: |
|
|
| yea would be cool when u can tell us what you did..im also trying to find out what i need to change in index.cgi |
|
| Back to top |
|
 |
Arthur
Joined: 04 Dec 2009 Posts: 69
|
Posted: Dec 17, 2009 6:15 pm Post subject: |
|
|
All you got to do is put this code under sub 1 download in the index.cgi
| Code: | | $file->{direct_link} = &DownloadGenLink($file); |
it goes right after this
| Code: | if($c->{mp3_mod} && $file->{file_name}=~/\.mp3$/i && !$file->{message})
{
DownloadTrack($file) if $c->{mp3_mod_no_download};
$file->{song_url} = DownloadGenLink($file,"$file->{file_code}.mp3");
(undef,$file->{mp3_secs},$file->{mp3_bitrate},$file->{mp3_freq},$file->{mp3_artist},$file->{mp3_title},$file->{mp3_album},$file->{mp3_year}) = split(/\|/,$file->{file_spec}) if $file->{file_spec}=~/^A\|/;
$file->{no_link}=1 if $c->{mp3_mod_no_download};
$ses->{meta_keywords}.=", $file->{mp3_artist}" if $file->{mp3_artist};
$ses->{meta_keywords}.=", $file->{mp3_title}" if $file->{mp3_title};
$ses->{meta_keywords}.=", $file->{mp3_album}" if $file->{mp3_album};
} |
|
|
| Back to top |
|
 |
shynobee
Joined: 28 Apr 2009 Posts: 29
|
Posted: Dec 17, 2009 8:38 pm Post subject: |
|
|
| thx Arthur works fine |
|
| Back to top |
|
 |
revive
Joined: 04 Apr 2010 Posts: 9
|
Posted: Jun 09, 2010 3:33 am Post subject: |
|
|
Just saw this thread and was working on the same thing for one of our sites.. thought this might be a helpful addition.
When we added the Direct Link for the MP3's and moved the index.cgi code accordingly.. we ended up with BOTH the 'Generate Direct Link' and 'Direct Link' links.. (say that 10 times fast!).. anyway, here is a small code snippet for your download1.html file that will hide all but your MP3 direct download link, IF the file is an MP3..
| Code: |
<TMPL_UNLESS song_url>
<TMPL_IF direct_links>
<input type="hidden" name="down_direct" value="1">
<input type="submit" id="btn_download" value="Get Direct Link">
<TMPL_ELSE>
<input type="hidden" name="down_script" value="1">
<input type="submit" id="btn_download" value="<TMPL_VAR lang_download_file>">
</TMPL_IF>
</TMPL_UNLESS>
<TMPL_IF song_url>
<a href="<TMPL_VAR direct_link>" id="btn_download">Download Song Instantly</a>
</TMPL_IF>
|
It's pretty self explanatory,.. but, for those not as familiar with XFileSharing Pro's code.. I've wrapped the original IF/ELSE statement with an UNLESS statement.. meaning, UNLESS its an MP3, show that code.. then after that.. since it will effective hide the original buttons if its an MP3 file.. I've added the IF song_url code.. this checks to make sure its an MP3 and then adds the link accordingly.. I've styled it using CSS and changed the image to text, from the previous posters example.
You can see the results here:
http://gigashares.net/tktejzp68ier.html
Cheers |
|
| Back to top |
|
 |
|