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
How to move divx player to download2.html

 
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XFileSharing Pro
View previous topic :: View next topic  
Author Message
th3hotcake



Joined: 07 Apr 2009
Posts: 51

PostPosted: Jun 29, 2009 4:57 am    Post subject: How to move divx player to download2.html Reply with quote

DivX player only works on download1.html. If I take this code any move it to download2.html it doesn't do anything. I've looked through all the coding and can't figure out what to do.

Code:
<TMPL_IF video_code>
<table cellpadding=0 cellspacing=0 style="margin:5px;border:1px solid #555;"><tr><td>
<TMPL_VAR video_code>
</td></tr></table>
</div>
</TMPL_IF>


I need to do this so free users won't be able to watch videos non-stop.

Thanks
Back to top
View user's profile Send private message
PilgrimX182



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

PostPosted: Jun 29, 2009 2:13 pm    Post subject: Reply with quote

This is not that quick hack, email support@sibsoft.net for custom quote.
Back to top
View user's profile Send private message Visit poster's website
th3hotcake



Joined: 07 Apr 2009
Posts: 51

PostPosted: Jun 29, 2009 2:30 pm    Post subject: Reply with quote

That would not be a problem at all, except I have already paid $50. It seems like the video files should be played only after the free user generates the link so they can't just leech from your site all day without any restrictions. Does that make sense?

I know it has to do with this code. If you understand, I would hope you reconsider. The divx mod is almost useless if free users can watch without restrictions.

Code:
$file->{video_code}=qq[document.write('<object id="ie_vid" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="$file->{vid_width}" height="$file->{vid_height}" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
<param name="custommode" value="Stage6" />
<param name="wmode" value="transparent" />
<param name="previewImage" value="$file->{video_img_url}" />
<param name="allowContextMenu" value="false">
<param name="bannerEnabled" value="false" />
<param name="previewMessage" value="Play" />
<param name="autoPlay" value="false" />
<param name="src" value="$file->{direct_link}" />
<embed id="np_vid" type="video/divx" src="$file->{direct_link}" custommode="Stage6" wmode="transparent" width="512" height="288" previewImage="$file->{video_img_url}" autoPlay="false" bannerEnabled="false" previewImage="$file->{direct_img}" allowContextMenu="false" previewMessage="Play" pluginspage="http://go.divx.com/plugin/download/"></embed>
</object>');];

      $file->{video_code} = &encodeJS($file->{video_code});


Best regards
Back to top
View user's profile Send private message
PilgrimX182



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

PostPosted: Jul 01, 2009 6:08 am    Post subject: Reply with quote

In index.cgi: from sub Download1 cut this part:
Code:
   if($ses->iPlg('v') && $c->{m_v} && $file->{file_spec}=~/^V/)
   {
      my @fields=qw(vid vid_length vid_width vid_height vid_bitrate vid_audio_bitrate vid_audio_rate vid_codec vid_audio_codec vid_fps);
      my @vinfo = split(/\|/,$file->{file_spec});
      $file->{$fields[$_]}=$vinfo[$_] for (0..$#fields);
      $file->{vid_codec}=~s/ffo//i;
      $file->{vid_codec}=~s/ff//i;
      $file->{vid_codec}=uc $file->{vid_codec};
      $file->{vid_audio_codec}=~s/faad/AAC/i;
      $file->{vid_audio_codec}=~s/ff//i;
      $file->{vid_audio_codec}=uc $file->{vid_audio_codec};
      $file->{vid_fps}=~s/\.000//;
      $file->{vid_length2} = sprintf("%02d:%02d:%02d",int($file->{vid_length}/3600),int($file->{vid_length}/60)%3600,$file->{vid_length}%60);
      my $dx = sprintf("%05d",($file->{file_real_id}||$file->{file_id})/$c->{files_per_folder});
      $file->{srv_htdocs_url}=~/(.+)\/.+$/;
      $file->{video_img_url}="$1/i/$dx/$file->{file_real}.jpg";
      if($file->{vid_codec}=~/(divx|xvid)/i)
      {
         my $res = $ses->api($file->{srv_cgi_url},
                          {
                           op           => 'gen_link',
                           file_id      => $file->{file_real_id}||$file->{file_id},
                           file_code    => $file->{file_real},
                           file_name    => $file->{file_name},
                           fs_key       => $file->{srv_key},
                           ip           => $ses->getIP });
      my ($ddcode) = $res=~/^OK:(.+)$/;
      $file->{direct_link} = "$file->{srv_htdocs_url}/$ddcode/$file->{file_name}";

$file->{video_code}=qq[document.write('<object id="ie_vid" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="$file->{vid_width}" height="$file->{vid_height}" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
<param name="custommode" value="Stage6" />
<param name="wmode" value="transparent" />
<param name="previewImage" value="$file->{video_img_url}" />
<param name="allowContextMenu" value="false">
<param name="bannerEnabled" value="false" />
<param name="previewMessage" value="Play" />
<param name="autoPlay" value="false" />
<param name="src" value="$file->{direct_link}" />
<embed id="np_vid" type="video/divx" src="$file->{direct_link}" custommode="Stage6" wmode="transparent" width="$file->{vid_width}" height="$file->{vid_height}" previewImage="$file->{video_img_url}" autoPlay="false" bannerEnabled="false" previewImage="$file->{direct_img}" allowContextMenu="false" previewMessage="Play" pluginspage="http://go.divx.com/plugin/download/"></embed>
</object>');];

      $file->{video_code} = &encodeJS($file->{video_code});
      }
   }

and paste it ABOVE this line in sub Download2:
Code:
$ses->PrintTemplate("download2.html",


Then cut this code from download1.html:
Code:
<TMPL_IF video_code>
<table cellpadding=0 cellspacing=0 style="margin:5px;border:1px solid #555;"><tr><td>
<TMPL_VAR video_code>
</td></tr></table>
</div>
</TMPL_IF>

and paste in required place in download2.html

But if you have XFSPro1.5 without custom mods then better wait 40 mins - I'm gonna add this feature to current release.
Back to top
View user's profile Send private message Visit poster's website
th3hotcake



Joined: 07 Apr 2009
Posts: 51

PostPosted: Jul 01, 2009 6:31 am    Post subject: Reply with quote

Thank you so much. I'll try this tomorrow morning.
Back to top
View user's profile Send private message
PilgrimX182



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

PostPosted: Jul 01, 2009 6:56 am    Post subject: Reply with quote

Allright, added this to production. Made even better: so you can choose in settings to show on Download1 or Download2 page. If Download2 page selected for player, then we still show video info and snapshot on Download1 page.

Get the latest ZIP from client area and update index.cgi, download1.html, download2.html, admin_settings.html.
Back to top
View user's profile Send private message Visit poster's website
th3hotcake



Joined: 07 Apr 2009
Posts: 51

PostPosted: Jul 01, 2009 11:38 am    Post subject: Reply with quote

Epic! Will try this after I get back from work. Thanks again.
Back to top
View user's profile Send private message
th3hotcake



Joined: 07 Apr 2009
Posts: 51

PostPosted: Jul 01, 2009 5:22 pm    Post subject: Reply with quote

Pilgrim, it appears that I cannot choose between pages (download1 vs download2) in the settings page. When I select download2 and click save, it just goes back to download1 automatically. I'm going to see if I can fix this code for myself, but thought I would let you know. It might be something I'm doing wrong, but I doubt it. Copied all files you said to.

EDIT: Direct downloads must be checked to take the user to download2.html. Would it be possible to not run direct downloads, but still take the user to download2.html IF the file is a video file? That sounds complicated, but I thought I'd ask.
Back to top
View user's profile Send private message
PilgrimX182



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

PostPosted: Jul 01, 2009 6:12 pm    Post subject: Reply with quote

oh, forgot to mention - you need new option in XFileConfig.pm:
Code:
m_v_page => '1',


check this in XFileConfig from new zip.

dl.cgi and download2 page is possible but I don't think I will provide you quick hack or put this into official version.
Back to top
View user's profile Send private message Visit poster's website
th3hotcake



Joined: 07 Apr 2009
Posts: 51

PostPosted: Jul 01, 2009 10:04 pm    Post subject: Reply with quote

Works nicely. Although I checked the the newest files on your site do not have this line.

Code:
m_v_page => '1',


I got it working, though. Thanks again for the great support.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SibSoft Ltd Forum Index -> XFileSharing Pro All times are GMT
Page 1 of 1

 
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