TorrentFlux.com Welcome, Guest. Please login or register.
02-09-2010, 06:14:10
Home Help Search Login Register donate
TorrentFlux Home | TorrentFlux Hosting

+  TorrentFlux Forums
|-+  Code Hacks and Tools
| |-+  TorrentFlux 2.1 Hacks
| | |-+  SFV Check
« previous next »
Pages: [1] 2  All Go Down Print
Author Topic: SFV Check  (Read 6991 times)
Bandi
Jr. Member
**
Offline Offline

TF Base: Linux 2.x
Posts: 87



View Profile
« on: 04-10-2006, 08:37:07 »

Hello,

this is jav's SFV Check Hack for previuos v2.0... But it is still working fine with v2.1!

First of all download cksfv http://zakalwe.virtuaalipalvelin.net/~shd/foss/cksfv/files/devel/ and take it there you want it to be Tongue
But remember: you need permission to execute it

Download the 2 images and the .php File where it belongs... Use your brain if you don't know Tongue

Write this in dir.php where you want the SFV Button to appear
Code:
if(false !== ($sfv = findSFV($dirName.$entry)))
{
echo '<a href="javascript:CheckSFV(\''.
$sfv[dir] . '\',\''.$sfv[sfv].'\')"><img '.
'src="images/sfv_enabled.gif" border="0" '.
'width=16 height=16 alt="sfv check torrent"></a>';
} else {
echo '<img src="images/sfv_disabled.gif" border="0" width=16 height=16 alt="sfv check torrent (no sfv found)">';
}

In functions.php right after the <?
Code:
//**************************************************************************
// findSVF()
// This method Builds and displays the Torrent Section of the Index Page
function findSFV($dirName)
{
$sfv = false;
$d = dir($dirName);
while (false !== ($entry = $d->read()))
{
    if($entry != '.' && $entry != '..' && !empty($entry) )
    {
    if(is_file($dirName.'/'.$entry) && substr($entry, -4, 4) == '.sfv')
    {
    $sfv[dir] = $dirName;
$sfv[sfv] = $dirName.'/'.$entry;
    }
    }
}
$d->close();
return $sfv;
}

The Rest comes after the <META> Tag at the start of DisplayHead in functions.php
Code:
<script type="text/javascript">
 function CheckSFV(dir,file) {
     var width = screen.width/2-300;
     var height = screen.height/2-110;
     var InfoWin = window.open("checkSFV.php?dir="+dir+"&file="+file, "CheckSFV",
"status=no,toolbar=no,scrollbars=no,resizable=no,menubar=no,width=500,height=110,left="+width+",top="+height);

}
</script>

Think that's all Wink

MfG Bandi
Logged
morsub4u
Newbie
*
Offline Offline

Posts: 41





View Profile
« Reply #1 on: 04-10-2006, 15:05:58 »

 Embarrassed What exactly does this do?  I see that it will have the SFV icon enabled or disabled, but does it actually check the SFV checksum?  Or does it just check to see that there is an SFV file available for an archive?  If it does check the checksum, when does it do this?  (when the SFV icon is clicked?, when a download finishes?)

Forgive my ignorance, but I wanted to be sure it does what I thought it did before I attempt to install it and not know the correct results.  Thanks for the hack!
Logged

Linux distrobution - Mandrake 10.2 (3.4.3-3mdk)
TorrentFlux version - 2.3
Python version - 2.4
PHP Version - 4.3.10
BitTornado Version - 0.3.13
Webserver software and version - Apache 2.0
Bandi
Jr. Member
**
Offline Offline

TF Base: Linux 2.x
Posts: 87



View Profile
« Reply #2 on: 04-11-2006, 01:12:26 »

After installing this Hack, you will see a Buttin in your Directory which you could press if an SFV File is available... Then you'll see a PopUp where you could see how cksfv check you Files Wink
Logged
sylver
Jr. Member
**
Offline Offline

Posts: 87





View Profile
« Reply #3 on: 04-11-2006, 04:23:46 »

It really looks great !
I'll try it when i'll be able to !
Logged
morsub4u
Newbie
*
Offline Offline

Posts: 41





View Profile
« Reply #4 on: 04-11-2006, 09:32:09 »

Well, out of the box this seems incomplete.  When I install it, I get this:

Code:
sh: /home/qkslm/torrentflux_2.0/cksfv/src/cksfv: No such file or directory
done

I believe that this line needs to be updated in checkSFV.php:

Code:
$path_to_cksfv = '/home/qkslm/torrentflux_2.0/cksfv/src/'; // note the trailing slash!

should be a pointer to your actual path.  By default, the app is installed to /usr/local/bin/.  So in my case this should be:

Code:
$path_to_cksfv = '/usr/local/bin/'; // note the trailing slash!

Once I changed this, it worked OK. 

Note to everyone out there that tries this that the the pop-up window that this creates is BLANK until the entier SFV process is finished.  At first, I thought that it was not working, but a simple ps -ef showed that the process was running.  Once it's done, it does show a display of the files individually and whether or not they passed the check.

Thanks for this great hack!

morsub4u
Logged

Linux distrobution - Mandrake 10.2 (3.4.3-3mdk)
TorrentFlux version - 2.3
Python version - 2.4
PHP Version - 4.3.10
BitTornado Version - 0.3.13
Webserver software and version - Apache 2.0
Bandi
Jr. Member
**
Offline Offline

TF Base: Linux 2.x
Posts: 87



View Profile
« Reply #5 on: 04-11-2006, 10:23:11 »

Yeah... I've written, that you have to edit the path in the .php ... No matter... I've done it that way that you don't need to install it because not every one want to install it Tongue It was written for my own TF TS-Version... In this one you don't need to install it... It is enough to gmake it Tongue
Logged
deags
Full Member
***
Offline Offline

Posts: 121



View Profile
« Reply #6 on: 04-13-2006, 11:15:12 »

thanks

i got some nicer icons tho IMO Smiley

disabled just doesnt show at all as the icon is clear
Logged
Bandi
Jr. Member
**
Offline Offline

TF Base: Linux 2.x
Posts: 87



View Profile
« Reply #7 on: 04-13-2006, 13:36:32 »

Well... If you don't want to see the icon if there is no .sfv available you can also edit your dir.php Wink

Use this ->
Code:
if(false !== ($sfv = findSFV($dirName.$entry)))
{
echo '<a href="javascript:CheckSFV(\''.
$sfv[dir] . '\',\''.$sfv[sfv].'\')"><img '.
'src="images/sfv_enabled.gif" border="0" '.
'width=16 height=16 alt="sfv check torrent"></a>';
}

Instead of this ->
Code:
if(false !== ($sfv = findSFV($dirName.$entry)))
{
echo '<a href="javascript:CheckSFV(\''.
$sfv[dir] . '\',\''.$sfv[sfv].'\')"><img '.
'src="images/sfv_enabled.gif" border="0" '.
'width=16 height=16 alt="sfv check torrent"></a>';
} else {
echo '<img src="images/sfv_disabled.gif" border="0" width=16 height=16 alt="sfv check torrent (no sfv found)">';
}

MfG Bandi
Logged
deags
Full Member
***
Offline Offline

Posts: 121



View Profile
« Reply #8 on: 04-13-2006, 19:19:34 »

i use the blank because i put my icon on the otherside... so it keeps it all lined up.

like this

http://img509.imageshack.us/img509/8688/stufff8pd.jpg
Logged
flieshunter
Newbie
*
Offline Offline

Posts: 5



View Profile
« Reply #9 on: 04-17-2006, 04:44:19 »

Anyone could send me this one compiled? i cant do it on my shell :/
Logged
Bandi
Jr. Member
**
Offline Offline

TF Base: Linux 2.x
Posts: 87



View Profile
« Reply #10 on: 04-17-2006, 05:13:22 »

Uploadet my one on rapidshare...

http://rapidshare.de/files/18215870/cksfv.html

The Website is german but for our English frinds... Press Free Wink Then type the symboles from the picture and press download button Wink
But I think you can figure this out without my help... Use rapidshare and lern GERMAN Tongue
Logged
jav
Newbie
*
Offline Offline

Posts: 15



View Profile
« Reply #11 on: 04-18-2006, 04:22:55 »

Hi!
I'm alive again Smiley
Nice to see that ppl actually use the mod!
Can you guys who use it post (or PM me) about how you use it and what you think it's good/bad?
My fingers are iching for more coding, and I was thinking of expanding the mod. Possibly adding some automation/dynamics.
Logged

Gentoo Linux
Lighttpd
PostgreeSQL
Torrentflux 2.1
total pwnage
thriff
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 11




View Profile WWW
« Reply #12 on: 04-18-2006, 14:13:46 »

Nice hack.

Just that i noticed when sfvchecking a directory with multiple files the window that appears is too small to show all of them. It would have been fine if a scroller appeared or the window resized itself to match the content but it didn't.

i use FF btw.
Logged

Debian Lenny w/ kernel: 2.6.22-3-686 on PentiumIII 550mhz 512MB RAM
Apache/2.2.8 | PHP/5.2.5 | MySQL/5.0.51a | Python/2.4.4 |
TF-b4rt 1.0-beta1
gringo
Full Member
***
Offline Offline

TF Base: Linux 1.x
Posts: 111





View Profile WWW
« Reply #13 on: 04-18-2006, 15:26:30 »

I noticed that too.  Change this to suit you better:
Code:
"status=no,toolbar=no,scrollbars=no,resizable=no,menubar=no,width=500,height=110,left="+width+",top="+height);
Logged

P4 2.8 | CentOS-4.2 | 1024MB RAM | 10 mb/s Connect

Apache 2.0.52 | PHP 4.3.9 | MySQL 4.1.12 | Python 2.3.4

TF 2.1b4rt with cosmetic changes.
Bandi
Jr. Member
**
Offline Offline

TF Base: Linux 2.x
Posts: 87



View Profile
« Reply #14 on: 04-18-2006, 15:29:53 »

No Problem Wink

Instead of
Code:
<script type="text/javascript">
 function CheckSFV(dir,file) {
     var width = screen.width/2-300;
     var height = screen.height/2-110;
     var InfoWin = window.open("checkSFV.php?dir="+dir+"&file="+file, "CheckSFV",
"status=no,toolbar=no,scrollbars=no,resizable=no,menubar=no,width=500,height=110,left="+width+",top="+height);

}
</script>

Use this one
Code:
<script type="text/javascript">
 function CheckSFV(dir,file) {
     var width = screen.width/2-300;
     var height = screen.height/2-110;
     var InfoWin = window.open("checkSFV.php?dir="+dir+"&file="+file, "CheckSFV",
"status=no,toolbar=no,scrollbars=yes,resizable=no,menubar=no,width=500,height=110,left="+width+",top="+height);

}
</script>

Now you can scroll

If you want your Window to be resizeable use this one
Code:
<script type="text/javascript">
 function CheckSFV(dir,file) {
     var width = screen.width/2-300;
     var height = screen.height/2-110;
     var InfoWin = window.open("checkSFV.php?dir="+dir+"&file="+file, "CheckSFV",
"status=no,toolbar=no,scrollbars=yes,resizable=yes,menubar=no,width=500,height=110,left="+width+",top="+height);

}
</script>

If you want, you can also edit the size of your window...
Code:
<script type="text/javascript">
 function CheckSFV(dir,file) {
     var width = screen.width/2-300;
     var height = screen.height/2-110;
     var InfoWin = window.open("checkSFV.php?dir="+dir+"&file="+file, "CheckSFV",
"status=no,toolbar=yes/no,scrollbars=yes/no,resizable=no,menubar=no,width=pixel,height=pixel,left="+width+",top="+height);

}
</script>
In this example you can edit the toolbar, scrollbar and size in pixel to that value you like it Wink

That should be all someone can want to have Tongue

MfG Bandi

[EDIT]Wanna have a shortet info ?! See Post above Tongue
Logged
Pages: [1] 2  All Go Up Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by SMF 1.1.1 | SMF © 2006, Simple Machines LLC Powered by PHP