TorrentFlux.com Hey, OppTupacShakur, you have 11 messages, 0 are new.
05-07-2007, 11:37:16
Home Help Search Profile Logout donate chat
News:


+  TorrentFlux Forums
|-+  Code Hacks and Tools
| |-+  TorrentFlux 2.1 Hacks
| | |-+  Move and Rename files/folders Hack and unRAR Hack Password extension
« previous next »
Pages: 1 2 3 [All] Go Down Reply Notify of replies Send this topic Print
Author Topic: Move and Rename files/folders Hack and unRAR Hack Password extension  (Read 3408 times)
nu_pagadi
Newbie
*
Offline Offline

Posts: 6



View Profile Personal Message (Offline)
« on: 06-16-2006, 06:38:36 » Reply with quote

Hi @all,
I wrote for the TorrentFlux 2.1-b4rt-85 the following Hacks. I hope some of you like it.

Move Hack
With this hack is it possible zu move files/folders to a specified destination
on the own server. I also added categories, which are subfolders in the
destination folder.
The destination and categories must be set in the admin settings area.

Here how to install the Move Hack

modify admin.php
Search:
Code:
<tr><td colspan="2" align="center" bgcolor="<?php echo($cfg["table_header_bg"]); ?>"><strong>Bins</strong></td></tr>

Insert before that row this:
   
Code:
<!--// Move Hack -->
<?php include('move_extensionSettings.php'); ?>

Search:
Code:
function updateConfigSettings() {
    global $cfg;
Insert after that:
   
Code:
// move hack...
include('move_functions.php');
createCategoryFolders();

modify dir.php
Search:
Code:
if ($cfg['enable_sfvcheck'] == 1) {

Insert before that row this:
   
Code:
// rename hack
include('rename_dir_extension.php');

Search:
Code:
if ($cfg['enable_rar'] == 1) {

Insert before that row this:
   
Code:
// rename hack
include('rename_dir_extension.php');


modify config.php
Insert before the last "?>" this:
Code:
// include move hack
include('move_const.php');

Copy the following files into the tf folder (all of them are in the move_hack.tar):
   move.php
   move_const.php
   move_dir_extension.php
   move_extensionSetting.js
   move_extensionSettings.php
   move_functions.php
   images/_move.gif

================================================================
Rename Hack
With this hack is it possible zu rename files/folders in the TF directory.

Install Rename Hack
modify admin.php
Search:
Code:
<tr><td colspan="2" align="center" bgcolor="<?php echo($cfg["table_header_bg"]); ?>"><strong>Bins</strong></td></tr>

Insert before that row this:
Code:
<!--// rename files Hack -->
<?php include('rename_extensionSettings.php'); ?>

modify dir.php
Search:
Code:
if ($cfg['enable_sfvcheck'] == 1) {

Insert before that row this:
Code:
// move hack
include('rename_dir_extension.php');

Search:
Code:
if ($cfg['enable_rar'] == 1) {

Insert before that row this:
Code:
// move hack
include('rename_dir_extension.php');

modify config.php
Insert before the last "?>" this:
Code:
//include rename hack
include('rename_const.php');

Copy the following files into the tf folder (all of them are in the rename_hack.tar):
   renameFolder.php
   rename_const.php
   rename_dir_extension.php
   rename_extensionSettings.php
   images/rename.gif
=================================================================
unRAR Hack Password Extension
Extend UnRAR Hack with Password support
I added to the usual UnRAR Hack a Passwordfield for rar files that needs a password
for extraction.
Just enter the right password and hit OK. Thats all then.

modify uncompress.php

Search:
Code:
$arg4 = $argv[4];
Replace with:
Code:
$arg4 = $argv[5];
$arg5 = $argv[4];

Search:
Code:
$Command = escapeshellarg($arg4)." x " . escapeshellarg($arg1) . " " . escapeshellarg($arg2);
Replace with:
Code:
$Command = escapeshellarg($arg4)." x -p". $arg5 ." ". escapeshellarg($arg1) . " " . escapeshellarg($arg2);

Replace the umcomp.php with the one attached in unRAR_hack.zip.

If someone wants to implement all hacks, just extract the allhacks.zip into your TF folder and add
Code:
// include move hack
include('move_const.php');

//include rename hack
include('rename_const.php');
into config.php.

* rename_hack.zip (25.79 KB - downloaded 62 times.)
* unRAR_hack.zip (2.11 KB - downloaded 45 times.)
* screenshots.zip (86.47 KB - downloaded 52 times.)
* allHacks.zip (30.82 KB - downloaded 48 times.)
* move_hack.zip (27.68 KB - downloaded 55 times.)
« Last Edit: 06-16-2006, 16:24:02 by nu_pagadi » Report to moderator   Logged
Paczesiowa
Full Member
***
Offline Offline

TF Base: Linux 2.x
Posts: 177



View Profile Email Personal Message (Offline)
« Reply #1 on: 06-16-2006, 08:17:43 » Reply with quote

that move hack looks great!
but cant get it to work:
1)
there is no
Code:
<tr><td colspan="2" align="center" bgcolor="<?php echo($cfg["table_header_bg"]); ?>"><strong>Bins</strong></td></tr>
in my admin.php but there is:
Code:
echo "<tr><td colspan=6 bgcolor=\"".$cfg["table_header_bg"]."\" background=\"themes/".$cfg["theme"]."/images/bar.gif\"><div align=\"center\">";

2) I cant find
Code:
if ($cfg['enable_sfvcheck'] == 1) {
cause I don't use sfv hack so I put it somewhere else

3)
Code:
// rename hack
include('rename_dir_extension.php');
that's not move hack:]

but all these are minors
my problem is this hack is disabled in admin.php and I cant enable it (it'a always grayed out and "enable move files" is set to false and after page reload it gets back to false:/ I cant use ur admin.php because of unrecognized function smthsuperadminlink blah blah. does this code use sql? because I have sqlite not mysql.
« Last Edit: 06-16-2006, 08:19:15 by Paczesiowa » Report to moderator   Logged

nu_pagadi
Newbie
*
Offline Offline

Posts: 6



View Profile Personal Message (Offline)
« Reply #2 on: 06-16-2006, 12:53:50 » Reply with quote

Hi,
what Torrentflux version do you use? The HowTo is for torrentflux TorrentFlux 2.1-b4rt-85, if you want to implement the hack into the usuall Torrentflux use following:

Move Hack
modify admin.php
Search:
Code:
</table>
        <br>
        <input type="Submit" value="Update Settings">

Insert before that row this:
   
Code:
<!--// Move Hack -->
<?php include('move_extensionSettings.php'); ?>

Search:
Code:
function updateConfigSettings() {
    global $cfg;
Insert after that:
   
Code:
// move hack...
include('move_functions.php');
createCategoryFolders();

modify dir.php
Search:
Code:
                // download
                if ($cfg["enable_file_download"])

Insert before that row this:
   
Code:
// move hack
include('move_dir_extension.php');

Search again for:
Code:
                // download
                if ($cfg["enable_file_download"])

And intert before that row again this:
   
Code:
// move hack
include('move_dir_extension.php');

modify config.php
Insert before the last "?>" this:
Code:
// include move hack
include('move_const.php');

Copy the following files into the tf folder (all of them are in the move_hack.tar):
   move.php
   move_const.php
   move_dir_extension.php
   move_extensionSetting.js
   move_extensionSettings.php
   move_functions.php
   images/_move.gif

================================================================
Rename Hack
With this hack is it possible zu rename files/folders in the TF directory.

Install Rename Hack
modify admin.php
Search:
Code:
</table>
        <br>
        <input type="Submit" value="Update Settings">

Insert before that row this:
Code:
<!--// rename files Hack -->
<?php include('rename_extensionSettings.php'); ?>

modify dir.php
Search:
Code:
                // download
                if ($cfg["enable_file_download"])

Insert before that row this:
Code:
// move hack
include('rename_dir_extension.php');

Search again for:
Code:
                // download
                if ($cfg["enable_file_download"])

And intert before that row again this:
   
Code:
// move hack
include('rename_dir_extension.php');


modify config.php
Insert before the last "?>" this:
Code:
//include rename hack
include('rename_const.php');

Copy the following files into the tf folder (all of them are in the rename_hack.tar):
   renameFolder.php
   rename_const.php
   rename_dir_extension.php
   rename_extensionSettings.php
   images/rename.gif
=================================================================
unRAR Hack Password Extension
This Hack will only work, if the unRAR Hack is already implemented. So please implement the unRAR Hack before.

Extending the usual UnRAR Hack a Passwordfield for rar files that needs a password
for extraction.
Just enter the right password and hit OK. Thats all then.

modify uncompress.php

Search:
Code:
$arg4 = $argv[4];
Replace with:
Code:
$arg4 = $argv[5];
$arg5 = $argv[4];

Search:
Code:
$Command = escapeshellarg($arg4)." x " . escapeshellarg($arg1) . " " . escapeshellarg($arg2);
Replace with:
Code:
$Command = escapeshellarg($arg4)." x -p". $arg5 ." ". escapeshellarg($arg1) . " " . escapeshellarg($arg2);

Replace the umcomp.php with the one attached in unRAR_hack.zip.

If someone wants to implement all hacks, just extract the allhacks.zip into your TF folder and add
Code:
// include move hack
include('move_const.php');

//include rename hack
include('rename_const.php');
into config.php.

Quote
but all these are minors
my problem is this hack is disabled in admin.php and I cant enable it (it'a always grayed out and "enable move files" is set to false and after page reload it gets back to false:/ I cant use ur admin.php because of unrecognized function smthsuperadminlink blah blah. does this code use sql? because I have sqlite not mysql.

My code doesn't use sql. I just use the code from torrentflux.
Which browser do you use? I found a bug in move_extensionSettings.js. The Hack didn't work with the Internet Explorer, but I corrected it. Please replace the file with the one in the attachments.

I hope I could help.

* move_corr.zip (2 KB - downloaded 27 times.)
« Last Edit: 06-16-2006, 16:29:10 by nu_pagadi » Report to moderator   Logged
b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 542



View Profile WWW Email Personal Message (Offline)
« Reply #3 on: 06-16-2006, 13:26:33 » Reply with quote


hi nu_pagadi,

first impression after flying over thread is "clean and well done" so i cant wait to check out your code later Smiley

regards,
b4rt
Report to moderator   Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
Paczesiowa
Full Member
***
Offline Offline

TF Base: Linux 2.x
Posts: 177



View Profile Email Personal Message (Offline)
« Reply #4 on: 06-16-2006, 13:27:38 » Reply with quote

ok now it's better:]
I can see move icons in dir.php (but why only with directories? I want to move files too) but when I click it and choose option there is error:
Code:
mv: cannot move `/data/bittornado/paczesiowa/1' to `/var/www/***/files/Filmy': No such file or directory
An error accured, please try again!

first path is correct but no idea where did second path come from... I choosed path like "/data/Filmy" and I don't use vhost I'm not even german:D
and when I look inside Filmy dir there is another dir Filmy created (what for?) and 2 directories with names like "Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?Huh?" when I try to enter them with mc, it crashes

EDIT:
that was when I choosed category name. choosing blank option says "done" but it doesnt move files and again plenty of weird "??" directories
« Last Edit: 06-16-2006, 18:29:24 by Paczesiowa » Report to moderator   Logged

nu_pagadi
Newbie
*
Offline Offline

Posts: 6



View Profile Personal Message (Offline)
« Reply #5 on: 06-16-2006, 16:25:56 » Reply with quote

Quote
I can see move icons in dir.php (but why only with directories? I want to move files too) but when I click it and choose option there is error

Again my Fault if forgot to show, that you have to Search in the dir.php for the second
Code:
if ($cfg["enable_file_download"]) {

Insert before that row this:
Code:
// move hack
include('move_dir_extension.php');

The first one is for directories and the second one is for the other entries like rar files and so on...

I also corrected my posts before.


Quote
first path is correct but no idea where did second path come from...
I found the bug, sorry, didn't see it before  :'(
Just replace the the files attached in this reply.

Quote
I look inside Filmy dir there is another dir Filmy created (what for?)
Hmm thats realy weird. should never happen. I also don't know what the Huh?Huh?Huh? files are coming from. Sorry.
But I think the files are not from the Hack, because I use only the "mv" command.


Regards,

nu_pagadi

* move_corr.zip (2 KB - downloaded 12 times.)
Report to moderator   Logged
b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 542



View Profile WWW Email Personal Message (Offline)
« Reply #6 on: 06-16-2006, 19:01:19 » Reply with quote

Quote
I can see move icons in dir.php (but why only with directories? I want to move files too) but when I click it and choose option there is error

Again my Fault if forgot to show, that you have to Search in the dir.php for the second
Code:
if ($cfg["enable_file_download"]) {

Insert before that row this:
Code:
// move hack
include('move_dir_extension.php');

The first one is for directories and the second one is for the other entries like rar files and so on...

I also corrected my posts before.


Quote
first path is correct but no idea where did second path come from...
I found the bug, sorry, didn't see it before  :'(
Just replace the the files attached in this reply.

Quote
I look inside Filmy dir there is another dir Filmy created (what for?)
Hmm thats realy weird. should never happen. I also don't know what the Huh?Huh?Huh? files are coming from. Sorry.
But I think the files are not from the Hack, because I use only the "mv" command.


Regards,

nu_pagadi

i am just integrating this and found a source for possible errors (maybe the "weird dirs" Paczesiowa mentioned come from this)

you are not presetting the config-vars with values. (database) thats not so a big problem for the "booleans" as they are just wrong if not present and are set to true when submiting admin-form.
you can run into problems in the case of the other fields move_path and move_categories. eg on a talky php they are preset with a notice-message with html-markup which is no good for a "dir-string".
eg i just had this in one of those fields (complete with newlines and all ~):
Code:

<br />
<b>Notice</b>:  Undefined index:  move_categories in <b>/var/www/admin.php</b> on line <b>2194</b><br />


i guess with such strings in path + category-fields the code processing this may freak out.

presets for all used vars may be a wise thing to do.
(have in mind presetting enable-bools to 1, and move-path to something like /usr/local/torrent/username/incoming, dunno at categories.. didnt look into that so far)

EDIT: erm i just noticed a specific move-path per user is not possible how things are now. maybe this var just should be a suffix and concatenated to the dir /usr/local/torrent/username/.
(still wouldnt be settable per user but a suitable default)

regards,
b4rt
« Last Edit: 06-16-2006, 19:11:06 by b4rt » Report to moderator   Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
Paczesiowa
Full Member
***
Offline Offline

TF Base: Linux 2.x
Posts: 177



View Profile Email Personal Message (Offline)
« Reply #7 on: 06-16-2006, 19:05:27 » Reply with quote

ok moving files to "blank" option works fine now. those categories dont: creating new category = 1 or 2  ? ? ? ? ? ? ? directories:/

IMO this category aproach doesn't make sense because this forces user to have one 'move' directory and 1 subdirectory inside it for each category. better aproach would be to have pairs <name,path> and display names in move.php and moving them to corresponding paths which can be unrelated to each other. and this wouldn't require to create directories (because updating settings with new categories makes these Huh? dirs) so there shouldnt be errors.
Report to moderator   Logged

b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 542



View Profile WWW Email Personal Message (Offline)
« Reply #8 on: 06-16-2006, 19:39:37 » Reply with quote

after setting move_categories to empty string and adding a test-entry it is still creating weird dirs.

thats what is in the field in the database (with newline):
Code:

;test

to fix the weird dir-creation i did this:

change in admin.php :
Code:
<input type="hidden" name="move_categories" value="
<?php if ($cfg["enable_move"]) {
echo $cfg["move_categories"];
}
?>
">

to (just remove newlines inside param) :
Code:
<input type="hidden" name="move_categories" value="<?php if ($cfg["enable_move"]) { echo $cfg["move_categories"]; } ?> ">

EDIT: to solve more probs i did :

changed in function updateConfigSettings in admin.php :
Code:
createCategoryFolders();
to this:
Code:
// move hack
unset($_POST['addCatButton']);
unset($_POST['remCatButton']);
unset($_POST['categorylist']);
unset($_POST['category']);
$_POST["move_categories"] = trim($_POST["move_categories"]);
if ($_POST["enable_move"])
  createCategoryFolders();


EDIT: current version of function createCategoryFolders :
Code:
function createCategoryFolders() {
$movePath = $_POST['move_path'];
// add a slash at the end if needed...
if(substr($movePath, strlen($movePath)) != "/")
$movePath .= "/";
// create the needed folders...
if ((isset($_POST["move_categories"])) && (strlen($_POST["move_categories"]) > 0)) {
    $cats = split(";",$_POST["move_categories"]);
    for ($index = 0; $index < count($cats); $index++) {
    $target = trim($movePath.$cats[$index]);
    if ((strlen($target) > 0) && ((substr($target, 0, 1)) != ";"))
      checkDirectory($target,0777);
    }
}
}

where function checkDirectory is defined as :
Code:
/**
 * checks a dir. recursive process to emulate "mkdir -p" if dir not present
 *
 * @param $dir the name of the dir
 * @param $mode the mode of the dir if created. default is 0755
 * @return boolean if dir exists/could be created
 */
function checkDirectory($dir, $mode = 0755) {
  if ((is_dir($dir) && is_writable ($dir)) || @mkdir($dir,$mode))
    return true;
  if (! checkDirectory(dirname($dir),$mode))
    return false;
  return @mkdir($dir,$mode);
}


now cat-list is safed without the empty first field.


regards,
b4rt
« Last Edit: 06-16-2006, 21:20:01 by b4rt » Report to moderator   Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 542



View Profile WWW Email Personal Message (Offline)
« Reply #9 on: 06-16-2006, 20:03:18 » Reply with quote

ok moving files to "blank" option works fine now. those categories dont: creating new category = 1 or 2  ? ? ? ? ? ? ? directories:/

IMO this category aproach doesn't make sense because this forces user to have one 'move' directory and 1 subdirectory inside it for each category. better aproach would be to have pairs <name,path> and display names in move.php and moving them to corresponding paths which can be unrelated to each other. and this wouldn't require to create directories (because updating settings with new categories makes these Huh? dirs) so there shouldnt be errors.

true somehow, in its current form move/category implementation is only suitable for single-user-installation.
easiest way to have it multi-user in parts would be to dont use a abolute move-to path but a suffix in that cfg-string which is concatenated to the users torrents-dir (/usr/local/torrent/username/move)
still there would only be global categories and all users would always have those dirs created.
in my version (which has per-user-settings) both could be solved generic and user-configurable. just a possible solution as i still didnt cross the line "per-user-settings are only presentation-settings. no hacks can be tweaked per user".

i wont modify this hack further (for multi-user-usage) now, waiting what the author of this hack thinks about things first Smiley

EDIT: about the category-dirs created... doing this on demand in the move-process would be better as creating all dirs on admin-safe.

regards,
b4rt
« Last Edit: 06-16-2006, 22:23:29 by b4rt » Report to moderator   Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
Paczesiowa
Full Member
***
Offline Offline

TF Base: Linux 2.x
Posts: 177



View Profile Email Personal Message (Offline)
« Reply #10 on: 06-16-2006, 21:13:05 » Reply with quote

ok with b4rt's fixes it works. and those categories can point to any directory: just make main directory point to some 'virtual' directory with symlinks to real directories. and those symlinks have categories name.

last thing is removing categories - it doesn't work. I have 3 blanks and 10 test categories and I cant delete them.
Report to moderator   Logged

b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 542



View Profile WWW Email Personal Message (Offline)
« Reply #11 on: 06-16-2006, 21:14:21 » Reply with quote

check my edit-update in post above.
debugin this atm too.. my only problem left is i cant remove entries i can just add new entries.
i still didnt look into the js-code ~

EDIT:
oh to remove entries by hand you can do something like this :
Code:
UPDATE tf_settings SET tf_value = '' WHERE tf_key = 'move_categories';


regards,
b4rt
« Last Edit: 06-16-2006, 21:17:33 by b4rt » Report to moderator   Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 542



View Profile WWW Email Personal Message (Offline)
« Reply #12 on: 06-16-2006, 22:17:54 » Reply with quote


to fix the problem that you cant remove cat-entries you could use this modified function removeEntry :

Code:
function removeEntry() {
var catliststr = document.theForm.move_categories;
if(document.theForm.categorylist.selectedIndex != -1) {
document.theForm.categorylist.remove(document.theForm.categorylist.selectedIndex);
var newValue = "";
for (var j = 0; j < document.theForm.categorylist.options.length; j++) {
            if (j > 0) {
                newValue += ";";
            }
    newValue += mytrim(document.theForm.categorylist.options[j].text);
}
catliststr.value = mytrim(newValue);
} else {
alert("Please select an entry first!");
}
}

regards,
b4rt
Report to moderator   Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
nu_pagadi
Newbie
*
Offline Offline

Posts: 6



View Profile Personal Message (Offline)
« Reply #13 on: 06-17-2006, 03:48:36 » Reply with quote

Hi,
I'm glad you guys like it and sorry for all the bugs.

As I was writing the hack, I just wanted to move the files to a directory, shared with users, that are not allowed to use torrentflux. I wasn't thinking about multi user support at this point, but it seems to be useful  Wink
Unfortunately I have no ideas how to do that.

@b4rt of course you can modify the hack to multi user support if you want to Smiley

Thanks to you two for looking through and for the corrections.

Regards,

nu_pagadi

p.s. I upped the hack again with all corrections.

* move_hack.zip (28.37 KB - downloaded 15 times.)
* allHacks.zip (33.05 KB - downloaded 20 times.)
Report to moderator   Logged
Paczesiowa
Full Member
***
Offline Offline

TF Base: Linux 2.x
Posts: 177



View Profile Email Personal Message (Offline)
« Reply #14 on: 06-17-2006, 07:11:49 » Reply with quote

move hack now works great! big tx!

but can u tell how to do 2 things?
1) how to not display blank option in move.php? (there is no blank option in settings)
2) I don't want that window saying "done" can it autoclose itself?
Report to moderator   Logged

b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 542



View Profile WWW Email Personal Message (Offline)
« Reply #15 on: 06-17-2006, 08:32:10 » Reply with quote

Hi,
I'm glad you guys like it and sorry for all the bugs.

As I was writing the hack, I just wanted to move the files to a directory, shared with users, that are not allowed to use torrentflux. I wasn't thinking about multi user support at this point, but it seems to be useful  Wink
Unfortunately I have no ideas how to do that.

@b4rt of course you can modify the hack to multi user support if you want to Smiley

Thanks to you two for looking through and for the corrections.

Regards,

nu_pagadi

p.s. I upped the hack again with all corrections.

@multi-user :
i think i will do that, i am not really satisfied with the single-user-version Smiley
i dont like my "easy hack"-approach with just a dir-suffix so i am thinking of the "per-user-settings"-solution here. as this requires to have hack-settings per user i think i gonna review all existing hacks where a per-user-setting may make sense and is possible and alter em. also this solution will only work on tf-b4rt as tf 2.1 final does not have per-user-settings.

@corrections :
made more than i posted here. as i test on a setup with an unbuffered and ultra-talky php i found some buffer-errors (notices) and php-notices here and there which i fixed. didnt paste em here as they are most "mini" and loose. (and i was lazy + sleepy Wink)

@modifications + codebase :
dunno how to push back the modifications until i have a new release ready yet... i cant give you guys access to my cvs ... maybe i should just put it on sf.
lord_nor has written a new queuemanager with integration-class for tf-b4rt which i have already integrated, our work on the same codeparts of this is done in a very manual way so far... we just send each other complete source-files and patch in stuff per hand, a rcs available for all could make things easier here as well Wink


regards,
b4rt
Report to moderator   Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
PlymWS
Jr. Member
**
Offline Offline

Posts: 53



View Profile Email Personal Message (Offline)
« Reply #16 on: 06-18-2006, 10:51:50 » Reply with quote

I just tried to implement this on a clean install and it didn't work.  I downloaded all the scripts from the second to last post on the first page and ftp'd them to the server but the icons do not show up.

Any ideas ?

PS. TF version is latest available from the download page
Report to moderator   Logged
nu_pagadi
Newbie
*
Offline Offline

Posts: 6



View Profile Personal Message (Offline)
« Reply #17 on: 06-18-2006, 14:45:57 » Reply with quote

Hi,
can you please tell how tried to implement it?

Regards,

nu_pagadi
Report to moderator   Logged
nu_pagadi
Newbie
*
Offline Offline

Posts: 6



View Profile Personal Message (Offline)
« Reply #18 on: 06-18-2006, 15:03:48 » Reply with quote

Quote
move hack now works great! big tx!

but can u tell how to do 2 things?
1) how to not display blank option in move.php? (there is no blank option in settings)
2) I don't want that window saying "done" can it autoclose itself?

1. Search in move.php for
Code:
<option value=""></option>
and remove it. There won't be a blank option anymore.

2. If you want to autoclose window:
For the move hack modify move.php
Search for:
Code:
echo "Done";
Insert after that this:
Code:
echo '<html><body onLoad="window.opener.location.reload();setTimeout(window.close, 100);"></body></html>';

For the rename hack modify renameFolder.php
Search for:
Code:
echo _REN_DONE;
Insert after that this:
Code:
echo '<html><body onLoad="window.opener.location.reload();setTimeout(window.close, 100);"></body></html>';
For the unRAR hack modify uncomp.php
Search for:
Code:
pclose($handle);
Insert after that this:
Code:
echo '<html><body onLoad="window.opener.location.reload();setTimeout(window.close, 100);"></body></html>';

This code will close the window after 100ms. If you want to close the window in a other amount of time, just change the 100 into something else.

I hope I could help.

Regards,

nu_pagadi
Report to moderator   Logged
Paczesiowa
Full Member
***
Offline Offline

TF Base: Linux 2.x
Posts: 177



View Profile Email Personal Message (Offline)
« Reply #19 on: 06-18-2006, 16:33:56 » Reply with quote

big thx! I cant think of anything else I need with this hack:]
Report to moderator   Logged

b4rt
Hero Member
*****
Offline Offline

TF Base: Linux 2.x
Posts: 542



View Profile WWW Email Personal Message (Offline)
« Reply #20 on: 06-18-2006, 16:42:38 » Reply with quote

done with integration (and redesign/rewrite in parts ~) of this hacks.
snip of changelog for next release  :

Code:
- "Move and Rename files/folders Hack and unRAR Hack Password extension"-hacks
  from nu_pagadi (http://www.torrentflux.com/forum/index.php/topic,1605.0.html)
  modified :
  ~ changed the design of the move hack :
    old : one move-hack basedir and n subdirs (= categories). target-dir is
          "basedir + category-dir".
    new : n move-hack target-dirs. (abolute paths and can be any path)
          additional a custom-dir may be choosen in the move-dialog.
  ~ per-user settings and not per-install for move-hack. move-hack settings in
    admin-page are the users defaults. users can set their move-settings in
    their profile-page if admin enabled the move-hack.
  ~ target-dirs are not created on "form-submit" when configuring move-hack
    settings. target-dirs are created on demand in move.php when a move
    operation is processed. also the mkdir subshell-call is replaced with
    php-code emulating "mkdir -p".
  ~ bugs, warnings and notices fixed. ;)
  !!! caution !!!
  be aware that users can specify any target-path and can move files outside
  their homedirs with this hack. if you dont want that disable the move-hack.
  (the move-hack is disabled per default.)
  i didnt want to jail users into their homedirs hardcoded... specific
  safe-path has the same behaviour so imho its ok for now how things are atm in
  tflux (no ownerships and no acls), at least this more flexible implementation
  is how i want this hack to be. selfish me ;)

regards,
b4rt
Report to moderator   Logged

torrentflux-b4rt svn-trunk
Linux 2.4.34.1, Apache 2.0.59, PHP 4.4.5, Perl 5.8.8, Python 2.5, MySQL 4.1.22
Paczesiowa
Full Member
***
Offline Offline

TF Base: Linux 2.x
Posts: 177



View Profile Email Personal Message (Offline)
« Reply #21 on: 07-07-2006, 06:05:57 » Reply with quote

nu_pagadi I want one more thing with move hack:]
Can u insert in that combobox all subdirectories and "levelup" (../) directory?

if I have directory "download" and inside there are 2 dirs "1" and "2" and movie.avi and I click move button on movie.avi file I want to have 3 more options - moving to "1", to "2" and to higher diretory than download in tree.
mv movie.avi 1/movie.avi
mv movie.avi 2/movie.avi
mv movie.avi ../movie.avi

I can do it with rename hack but it takes time:D
Report to moderator   Logged

snouser
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 10



View Profile Email Personal Message (Offline)
« Reply #22 on: 10-01-2006, 07:56:07 » Reply with quote

Is it poseble to move folders with this hack?
I can't find that option right now..
Report to moderator   Logged
Paczesiowa
Full Member
***
Offline Offline

TF Base: Linux 2.x
Posts: 177



View Profile Email Personal Message (Offline)
« Reply #23 on: 10-01-2006, 11:45:36 » Reply with quote

check ur settings, I can move dirs
Report to moderator   Logged

snouser
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 10



View Profile Email Personal Message (Offline)
« Reply #24 on: 10-04-2006, 02:27:07 » Reply with quote

Witch settings.
I've tried to search for errors but i can't find any.
Report to moderator   Logged
Paczesiowa
Full Member
***
Offline Offline

TF Base: Linux 2.x
Posts: 177



View Profile Email Personal Message (Offline)
« Reply #25 on: 10-04-2006, 12:20:39 » Reply with quote

I think that tere is code snippet (move icon) to insert in 2 places in dir.php, perhaps u just inserted it in file section and forgot to insert it also in dir section
Report to moderator   Logged

snouser
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 10



View Profile Email Personal Message (Offline)
« Reply #26 on: 10-04-2006, 13:35:07 » Reply with quote

Thanks

I forget to edit all config rows Cheesy
Report to moderator   Logged
Beowulf
Newbie
*
Offline Offline

Posts: 28



View Profile Email Personal Message (Offline)
« Reply #27 on: 02-09-2007, 18:24:21 » Reply with quote

If you want the move hack to work with multiuser just change this line in move.php:

Code:
$cmd = "mv \"".$cfg["path"].$_POST['file']."\" ".$cfg["move_path"].$_POST['selector']."";

to this one:

Code:
$cmd = "mv \"".$cfg["path"].$cfg["user"].'/'.$_POST['file']."\" ".$cfg["move_path"].$_POST['selector']."";


rename files hack works with multiuser after you have changed following line in renameFolder.php:

Code:
$cmd = "mv \"".$cfg["path"].$_POST['dir'].$_POST['fileFrom']."\" \"".$cfg["path"].$_POST['dir'].$_POST['fileTo']."\"";

to:

Code:
$cmd = "mv \"".$cfg["path"].$cfg["user"].'/'.$_POST['dir'].$_POST['fileFrom']."\" \"".$cfg["path"].$cfg["user"].'/'.$_POST['dir'].$_POST['fileTo']."\"";


Both are working fine with TF2.3.
« Last Edit: 02-09-2007, 18:35:19 by Beowulf » Report to moderator   Logged
abadaba
Newbie
*
Offline Offline

TF Base: Linux 2.x
Posts: 18



View Profile Personal Message (Offline)
« Reply #28 on: 02-10-2007, 00:45:36 » Reply with quote

Every RAR file that i have. If i chosoe too unrar it, it always ask me for a password. Even files that i create with out a password, it ask me for one. And if i dont put anything in the password field, it just gives me errors. Has anyone else had this same type of problem? Ive already searched the boards, an not found any ideas.
Report to moderator   Logged
Beowulf
Newbie
*
Offline Offline

Posts: 28



View Profile Email Personal Message (Offline)
« Reply #29 on: 02-10-2007, 10:00:27 » Reply with quote

Did you install this one here first?:

http://www.torrentflux.com/forum/index.php/topic,1115.0.html
Report to moderator   Logged
firepong
Newbie
*
Offline Offline

Posts: 5



View Profile Personal Message (Offline)
« Reply #30 on: 03-08-2007, 17:38:59 » Reply with quote

well, i tryed this on 2.3 and it didnt work...Can someone make a rename/move hack for 2.3? I would be really gratefull.
Report to moderator   Logged
MaZO
Newbie
*
Offline Offline

Posts: 5



View Profile Personal Message (Offline)
« Reply #31 on: 04-09-2007, 10:23:03 » Reply with quote

Hello,

I need help concerning the rename hack at http://www.torrentflux.com/forum/index.php/topic,1605.0.html
would you please guide how to make the rename hack work with TF 2.3 (or even 2.1). I did all modifications written but the problem is in modifying dir.php
I can't find
Code:
                // download
                if ($cfg["enable_file_download"])

All I can find are those lines:
Code:
                // Can users download files?
                if ($cfg["enable_file_download"])
and only one time ( not two as mentioned ). even adding
Code:
// move hack
include('rename_dir_extension.php');
before it doesn't work for me. Also why it is called "// move hack" ? Maybe I mixed things up ?

Does anybody know what might cause the problem ?
Report to moderator   Logged
ttt
Newbie
*
Offline Offline

Posts: 3



View Profile Personal Message (Offline)
« Reply #32 on: 04-10-2007, 05:27:31 » Reply with quote

hi why not you edit the all settings and upload the hack so it would be easier for us u know
Report to moderator   Logged
Pages: 1 2 3 [All] Go Up Reply Notify of replies Send this topic Print 
« previous next »
Jump to:  


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