RegisterRegister    SearchSearch   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AJAX upload progress bar

File sharing script

File mirror script

Newsletter script
mp3 preview problems
Goto page Previous  1, 2
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    SibSoft Ltd Forum Index -> XFileSharing Pro
View previous topic :: View next topic  
Author Message
komi



Joined: 27 Nov 2009
Posts: 159

PostPosted: Dec 06, 2009 1:19 am    Post subject: Reply with quote

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
View user's profile Send private message
Arthur



Joined: 04 Dec 2009
Posts: 69

PostPosted: Dec 06, 2009 1:29 am    Post subject: Reply with quote

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
View user's profile Send private message
komi



Joined: 27 Nov 2009
Posts: 159

PostPosted: Dec 06, 2009 1:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Arthur



Joined: 04 Dec 2009
Posts: 69

PostPosted: Dec 06, 2009 1:50 am    Post subject: Reply with quote

k thnx for the help Ill try to figure it out till then Wink
Back to top
View user's profile Send private message
Arthur



Joined: 04 Dec 2009
Posts: 69

PostPosted: Dec 07, 2009 2:06 am    Post subject: Reply with quote

couldnt figure it out..little more help?
Back to top
View user's profile Send private message
PilgrimX182



Joined: 22 Mar 2006
Posts: 2109
Location: UFO Lab

PostPosted: Dec 07, 2009 8:59 am    Post subject: Reply with quote

Solution for dl.cgi: comment this line in index.cgi:
Code:
my $fname = $file->{file_name};
Back to top
View user's profile Send private message Visit poster's website
Arthur



Joined: 04 Dec 2009
Posts: 69

PostPosted: Dec 07, 2009 10:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Arthur



Joined: 04 Dec 2009
Posts: 69

PostPosted: Dec 08, 2009 3:51 am    Post subject: Reply with quote

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
View user's profile Send private message
Arthur



Joined: 04 Dec 2009
Posts: 69

PostPosted: Dec 09, 2009 1:53 am    Post subject: Reply with quote

Never mind figured everything out.
Back to top
View user's profile Send private message
komi



Joined: 27 Nov 2009
Posts: 159

PostPosted: Dec 09, 2009 9:29 am    Post subject: Reply with quote

Great! Maybe an idea to post exactly what you did? I'm sure some people are interested in doing this.
Back to top
View user's profile Send private message
shynobee



Joined: 28 Apr 2009
Posts: 29

PostPosted: Dec 12, 2009 2:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
Arthur



Joined: 04 Dec 2009
Posts: 69

PostPosted: Dec 17, 2009 6:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
shynobee



Joined: 28 Apr 2009
Posts: 29

PostPosted: Dec 17, 2009 8:38 pm    Post subject: Reply with quote

thx Arthur works fine
Back to top
View user's profile Send private message
revive



Joined: 04 Apr 2010
Posts: 9

PostPosted: Jun 09, 2010 3:33 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    SibSoft Ltd Forum Index -> XFileSharing Pro All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group