Hey,
OppTupacShakur
, you have
11 messages
, 0 are new.
06-27-2007, 12:42:22
News:
TorrentFlux Forums
Code Hacks and Tools
TorrentFlux 2.1 Hacks
unRAR Hack
« previous
next »
Pages:
1
2
[
All
]
Author
Topic: unRAR Hack (Read 5995 times)
Bandi
Jr. Member
Offline
TF Base: Linux 2.x
Posts: 87
unRAR Hack
«
on:
04-10-2006, 09:23:13 »
Hello,
This is my old v2.0 Hack for unRARing Files directly on your Box! I've tested it on 2 Systems and it is also working with Version v2.1 It works like the SFV Check hack! It will still unRAR your files when you close the Window!
First step is to download unRAR from
http://www.rarlabs.com/
to you Box! If you have trouble with older OS and the newest Version use an older one Tongue
Write this in dir.php where you want the unRAR Button to appear
Code:
if(false !== ($rar = unRAR($dirName.$entry)))
{
echo '<a href="javascript:unRAR(\''.
$rar[dir] . '\',\''.$rar[rar].'\')"><img '.
'src="images/rar_enabled.gif" border="0" '.
'width=16 height=16 alt="unrar files"></a>';
} else {
echo '<img src="images/rar_disabled.gif" border="0" width=16 height=16 alt="no rar found">';
}
In functions.php right after the <?
Code:
//**************************************************************************
// unRAR()
// This method Builds and displays the Torrent Section of the Index Page
function unRAR($dirName)
{
$rar = false;
$d = dir($dirName);
while (false !== ($entry = $d->read()))
{
if($entry != '.' && $entry != '..' && !empty($entry) )
{
if(is_file($dirName.'/'.$entry) && substr($entry, -4, 4) == '.rar')
{
$rar[dir] = $dirName;
$rar[rar] = $dirName.'/'.$entry;
}
}
}
$d->close();
return $rar;
}
The Rest comes after the <META> Tag at the start of DisplayHead in functions.php
Code:
<script type="text/javascript">
function unRAR(dir,file) {
var width = screen.width/2-300;
var height = screen.height/2-300;
var InfoWin = window.open("unRAR.php?dir="+dir+"&file="+file, "unRAR",
"status=no,toolbar=no,scrollbars=yes,resizable=no,menubar=no,width=500,height=300,left="+width+",top="+height);
}
</script>
That's all
Then download the unrar.php and the two Pictures - Both attached Wink
Don't forget to edit the Path to your unrar File in your unrar.php
This sould be all! Make sure that your unrar File is executable!
MfG Bandi
rar_disabled.gif
(0.54 KB, 16x16 - viewed 843 times.)
rar_enabled.gif
(0.65 KB, 16x16 - viewed 834 times.)
unRAR.php
(0.77 KB - downloaded 147 times.)
«
Last Edit: 04-10-2006, 09:31:14 by Bandi
»
Report to moderator
Logged
kanchke
Newbie
Offline
Posts: 24
Re: unRAR Hack
«
Reply #1 on:
04-13-2006, 06:17:06 »
Could you give some more details please on howto install this hack ?
Quote
Write this in dir.php where you want the unRAR Button to appear
... their like 514 lines of code (seems to be written all in chinese to me) and I have no clue where to copy/paste this code, where did you put it ?
Quote
In functions.php right after the <?
this is even worse, 2568 lines with a lot of <? first comes best served ?
Quote
The Rest comes after the <META> Tag at the start of DisplayHead in functions.php
Ok, this is clear to me
thanx,
k.
Report to moderator
Logged
P3 733 | FreeBSD6.0 | 128MB RAM
Lighttpd 1.4.11 | PHP 5.1.2 (cgi-fcgi) | Postgres8.1 | Python 2.3.4
TF 2.1 w/ AJAX on indexpage| MRTG statistics
Paczesiowa
Full Member
Offline
TF Base: Linux 2.x
Posts: 177
Re: unRAR Hack
«
Reply #2 on:
04-13-2006, 10:06:34 »
check this hack:
http://www.torrentflux.com/forum/index.php/topic,603.0.html
Report to moderator
Logged
check out my TF Handler for windows
deags
Full Member
Offline
Posts: 118
Re: unRAR Hack
«
Reply #3 on:
04-13-2006, 13:03:19 »
thanks mate it is all working
Report to moderator
Logged
lysip
Jr. Member
Offline
Posts: 53
Re: unRAR Hack
«
Reply #4 on:
04-15-2006, 03:18:23 »
Does my unrar hack work well still in 2.1? there might be some changes in where you place code but who knows.
Report to moderator
Logged
CentOS 4.2 (kernel: 2.6.9-22.ELsmp)
TorrentFlux version - 2.1
Python version - 2.4.1
PHP Version - 4.3.9
Webserver software and version - Apache 2.0
Add-ons/Hacks - rememberme, multiup
ridewitme
Newbie
Offline
Posts: 27
God of English
Re: unRAR Hack
«
Reply #5 on:
04-15-2006, 07:41:41 »
Quote from: lysip on 04-15-2006, 03:18:23
Does my unrar hack work well still in 2.1? there might be some changes in where you place code but who knows.
Nope, works fine in 2.1 without changing the place of code, just have to modify the 2.1 dir.php with your code, can't use a previous dir.php from 2.0
Report to moderator
Logged
kahfau
Newbie
Offline
Posts: 5
Re: unRAR Hack
«
Reply #6 on:
04-15-2006, 15:03:32 »
hi all
first of all: great software, great hacks, great forum
i have a feature request for the unrar hack. is there any possibility to add a specific target dir? would be cool to press the unrar button, then in the pop-up-window you can enter a target dir and press a go button or something.
unfortunately i'm not firm in php, so any advice would be nice.
regards
-kahfau
Report to moderator
Logged
Bandi
Jr. Member
Offline
TF Base: Linux 2.x
Posts: 87
Re: unRAR Hack
«
Reply #7 on:
04-17-2006, 06:15:39 »
Maybe comming in a newer Version...
Report to moderator
Logged
lysip
Jr. Member
Offline
Posts: 53
Re: unRAR Hack
«
Reply #8 on:
04-17-2006, 20:01:01 »
Yes, thats easily possible except its not really worth it to do... Mine atm is probley the most robust solution.
http://www.torrentflux.com/forum/index.php/topic,603.0.html
it still works, i havnt had a reason to look into it again... a better way of exacuting a command from php would be prefrable.
Report to moderator
Logged
CentOS 4.2 (kernel: 2.6.9-22.ELsmp)
TorrentFlux version - 2.1
Python version - 2.4.1
PHP Version - 4.3.9
Webserver software and version - Apache 2.0
Add-ons/Hacks - rememberme, multiup
kahfau
Newbie
Offline
Posts: 5
Re: unRAR Hack
«
Reply #9 on:
04-22-2006, 03:04:24 »
@lysip
this didn't solve my prob. it still extracts the rar/zip into the flux-dir, not asking me for a specific extracting path (like the specific save path)
-kahfau
Report to moderator
Logged
Bandi
Jr. Member
Offline
TF Base: Linux 2.x
Posts: 87
Re: unRAR Hack
«
Reply #10 on:
04-22-2006, 13:41:29 »
Nobody said, that the other hack does!
Report to moderator
Logged
olhoore
Newbie
Offline
Posts: 1
Re: unRAR Hack
«
Reply #11 on:
04-23-2006, 10:57:29 »
I got the message when trying to view directory:
Fatal error: Call to a member function on a non-object in $PATH of flux/functions.php on line 74
Line 74 is part of the new code
Code:
//**************************************************************************
// unRAR()
// This method Builds and displays the Torrent Section of the Index Page
function unRAR($dirName)
{
$rar = false;
$d = dir($dirName);
while (false !== ($entry = $d->read()))
{
if($entry != '.' && $entry != '..' && !empty($entry) )
{
if(is_file($dirName.'/'.$entry) && substr($entry, -4, 4) == '.rar')
{
$rar[dir] = $dirName;
$rar[rar] = $dirName.'/'.$entry;
}
}
}
$d->close();
return $rar;
}
in detail the line: while (false !== ($entry = $d->read()))
Can anybody help me please?
Maybe I misplaced the code? I added it at the functions area in the functions.php, I don't know what <? is meant by the original poster...
Report to moderator
Logged
kahfau
Newbie
Offline
Posts: 5
Re: unRAR Hack
«
Reply #12 on:
04-24-2006, 02:36:54 »
Quote from: Bandi on 04-22-2006, 13:41:29
Nobody said, that the other hack does!
sry, I misunderstood lysip's post...
Report to moderator
Logged
Bandi
Jr. Member
Offline
TF Base: Linux 2.x
Posts: 87
Re: unRAR Hack
«
Reply #13 on:
04-24-2006, 10:21:36 »
Quote from: olhoore on 04-23-2006, 10:57:29
Maybe I misplaced the code? I added it at the functions area in the functions.php, I don't know what <? is meant by the original poster...
<? shows the Start of a PHP Code! You must set this Code right after this one or between 2 other one! Actually you can't miss it
Report to moderator
Logged
skks
Newbie
Offline
TF Base: Linux 2.x
Posts: 5
Re: unRAR Hack
«
Reply #14 on:
04-24-2006, 13:11:48 »
Quote from: lysip on 04-15-2006, 03:18:23
Does my unrar hack work well still in 2.1?
Works but stops TF from responding for using other functions (like browsing the directory, adding torrents etc.) while it's extracting an archive. This was normal in 2.0, you could only do one thing at a time - but in 2.1 it's no longer so.
However, the unrar function saves a lot of time and I'd rather have it this way than not working at all. Great work regardless.
Report to moderator
Logged
lysip
Jr. Member
Offline
Posts: 53
Re: unRAR Hack
«
Reply #15 on:
04-30-2006, 20:44:59 »
Well im not sure how tf does it but i suspect they place a link in a dir for you to directly download from. yet again im not sure tho. i beleave the reason it hangs atm is because my hack creates a thread inside apaches process, yet again this is just my hunch, i havnt researched it at all.
Report to moderator
Logged
CentOS 4.2 (kernel: 2.6.9-22.ELsmp)
TorrentFlux version - 2.1
Python version - 2.4.1
PHP Version - 4.3.9
Webserver software and version - Apache 2.0
Add-ons/Hacks - rememberme, multiup
xyster
Newbie
Offline
Posts: 27
Re: unRAR Hack
«
Reply #16 on:
05-02-2006, 09:09:50 »
Thnx to dergs, i was havving trouble with this.
he made it work, woohoo, i love him
in a non gay way
Report to moderator
Logged
puttyman
Jr. Member
Offline
Posts: 59
Re: unRAR Hack
«
Reply #17 on:
05-15-2006, 00:33:22 »
Is there a way to rar a downloaded directory/file instead of unraring ?
I need an inverse of this hax
..
«
Last Edit: 05-15-2006, 14:34:25 by puttyman
»
Report to moderator
Logged
MeneM
Newbie
Offline
Posts: 1
Re: unRAR Hack
«
Reply #18 on:
05-20-2006, 18:05:39 »
Hi,
I tried this hack as well, but I'm getting stuck at adding the function. I've tried a few places inside the fucntions.php file, but I always get the same error:
Code:
Fatal error: Call to a member function read() on a non-object in /usr/share/torrentflux/www/functions.ph
I know what
Code:
<?php ?>
does, but where exactly do I need to add ar append to already existing tags?
Thanks,
Mark
Report to moderator
Logged
gardar
Newbie
Offline
TF Base: Linux 2.x
Posts: 9
seed whore
Re: unRAR Hack
«
Reply #19 on:
08-21-2006, 17:56:46 »
I was trying this out and obviously doing something wrong because if I open a directory that includes rar files it seems to be empty
I guess I'm placing this code at the wrong place
Code:
if(false !== ($rar = unRAR($dirName.$entry)))
{
echo '<a href="javascript:unRAR(\''.
$rar[dir] . '\',\''.$rar[rar].'\')"><img '.
'src="images/rar_enabled.gif" border="0" '.
'width=16 height=16 alt="unrar files"></a>';
} else {
echo '<img src="images/rar_disabled.gif" border="0" width=16 height=16 alt="no rar found">';
}
Where do you recommend I should place it?
Report to moderator
Logged
RedHat Linux
TorrentFlux 2.1
1gbit up/down
outsider
Newbie
Offline
TF Base: Linux 2.x
Posts: 4
Re: unRAR Hack
«
Reply #20 on:
09-18-2006, 20:54:46 »
Quote from: Bandi on 04-10-2006, 09:23:13
The Rest comes after the <META> Tag at the start of DisplayHead in functions.php
Code:
<script type="text/javascript">
function unRAR(dir,file) {
var width = screen.width/2-300;
var height = screen.height/2-300;
var InfoWin = window.open("unRAR.php?dir="+dir+"&file="+file, "unRAR",
"status=no,toolbar=no,scrollbars=yes,resizable=no,menubar=no,width=500,height=300,left="+width+",top="+height);
}
</script>
I can't find any <META> or DisplayHeader in functions.php
Am I missing something?
Report to moderator
Logged
Beowulf
Newbie
Offline
Posts: 28
Re: unRAR Hack
«
Reply #21 on:
02-09-2007, 19:48:02 »
Is there a solution for this fault?
Quote from: olhoore on 04-23-2006, 10:57:29
I got the message when trying to view directory:
Fatal error: Call to a member function on a non-object in $PATH of flux/functions.php on line 74
Line 74 is part of the new code
Code:
//**************************************************************************
// unRAR()
// This method Builds and displays the Torrent Section of the Index Page
function unRAR($dirName)
{
$rar = false;
$d = dir($dirName);
while (false !== ($entry = $d->read()))
{
if($entry != '.' && $entry != '..' && !empty($entry) )
{
if(is_file($dirName.'/'.$entry) && substr($entry, -4, 4) == '.rar')
{
$rar[dir] = $dirName;
$rar[rar] = $dirName.'/'.$entry;
}
}
}
$d->close();
return $rar;
}
in detail the line: while (false !== ($entry = $d->read()))
Can anybody help me please?
Maybe I misplaced the code? I added it at the functions area in the functions.php, I don't know what <? is meant by the original poster...
I think the failure occures in connection with $d but as far as I am not proffesional with php I cannot get out the fault on my own.
Report to moderator
Logged
martijn
Newbie
Offline
Posts: 1
Re: unRAR Hack
«
Reply #22 on:
05-22-2007, 07:24:19 »
Does this work with 2.3 as well?
Report to moderator
Logged
ares0027
Newbie
Offline
Posts: 10
Re: unRAR Hack
«
Reply #23 on:
06-09-2007, 19:11:43 »
if you can make unrar hack i think you can make a rar hack too right?
i need to rar/zip and split my files and save them to my ftp.is that possible?
Report to moderator
Logged
deags
Full Member
Offline
Posts: 118
Re: unRAR Hack
«
Reply #24 on:
06-10-2007, 07:59:44 »
i'll have a poke around and see if i can make anything for ya bud. Simple parameters like size and bytes to split them into... new or old naming system?
Report to moderator
Logged
ares0027
Newbie
Offline
Posts: 10
Re: unRAR Hack
«
Reply #25 on:
06-10-2007, 08:40:59 »
old i think
Report to moderator
Logged
deags
Full Member
Offline
Posts: 118
Re: unRAR Hack
«
Reply #26 on:
06-10-2007, 09:45:40 »
okay here it is 100% stolen code
find this in functions.php
Code:
// ***************************************************************************
// ***************************************************************************
// Display the header portion of admin views
function DisplayHead($subTopic, $showButtons=true, $refresh="", $percentdone="")
{
global $cfg;
?>
<html>
<HEAD>
<TITLE><?php echo $percentdone.$cfg["pagetitle"] ?></TITLE>
<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<LINK REL="StyleSheet" HREF="themes/<?php echo $cfg["theme"] ?>/style.css" TYPE="text/css">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache" charset="<?php echo _CHARSET ?>">
Now add this underneath
Code:
<script type="text/javascript">
function RAR(dir,file) {
var width = screen.width/2-300;
var height = screen.height/2-300;
var InfoWin = window.open("RARget.php?dir="+dir+"&file="+file, "RAR",
"status=no,toolbar=no,scrollbars=yes,resizable=no,menubar=no,width=550,height=400,left="+width+",top="+height);
}
</script>
In dir.php find this
Code:
if ($cfg["enable_file_download"])
{
// Yes, let them download
echo "<a href=\"dir.php?down=".urlencode($dir.$entry)."\" >";
echo "<img src=\"".$image."\" width=\"16\" height=\"16\" alt=\"".$entry."\" border=\"0\"></a>";
echo "<a href=\"dir.php?down=".urlencode($dir.$entry)."\" >".$entry."</a>";
}
else
{
// No, just show the name
echo "<img src=\"".$image."\" width=\"16\" height=\"16\" alt=\"".$entry."\" border=\"0\">";
echo $entry;
}
replace it with
Code:
if ($cfg["enable_file_download"])
{
// Yes, let them download
echo "<a href=\"dir.php?down=".urlencode($dir.$entry)."\" >";
echo "<img src=\"".$image."\" width=\"16\" height=\"16\" alt=\"".$entry."\" border=\"0\"></a>";
echo "<a href=\"dir.php?down=".urlencode($dir.$entry)."\" >".$entry."</a>";
echo ' <a href="javascript:RAR(\''.
$dirName.''.$entry . '\',\''.$dirName.''.$entry.'\')"><font color="red">RAR</font></a>';
}
else
{
// No, just show the name
echo "<img src=\"".$image."\" width=\"16\" height=\"16\" alt=\"".$entry."\" border=\"0\">";
echo $entry;
echo ' <a href="javascript:RAR(\''.
$dirName.''.$entry . '\',\''.$dirName.''.$entry.'\')"><font color="red">RAR</font></a>';
}
Now just download this file and place it in the same directory as dir.php
http://home.graffiti.net/biglou/TF/RARget.php
Change the $path_to_rar variable in RARget.php to suite your server.
Possibly add some more sizes.
Here is RAR(if needed)
http://home.graffiti.net/biglou/TF/f4m0700a.zip
«
Last Edit: 06-10-2007, 09:47:36 by deags
»
Report to moderator
Logged
Pages:
1
2
[
All
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
TorrentFlux
-----------------------------
=> TorrentFlux News
=> TorrentFlux Search Engine Modules and Updates
=> Forum/Website Problems
-----------------------------
TorrentFlux Support
-----------------------------
=> Linux Installations Support
=> Windows Installations (Limited Support)
=> International Support
-----------------------------
Bugs, Fixes, and Feature Requests
-----------------------------
=> Official TorrentFlux Fixes
=> Linux Bugs
=> Windows Bugs
=> Feature Requests
-----------------------------
Code Hacks and Tools
-----------------------------
=> TorrentFlux Tools
=> TorrentFlux 2.1 Hacks
=> TorrentFlux 2.0 Hacks
=> TorrentFlux 1.x Hacks
=> TorrentFlux Themes (skins)
-----------------------------
Off The Wall
-----------------------------
=> Off Topic Discussion
Powered by SMF 1.1.1
|
SMF © 2006, Simple Machines LLC