Hiring PHP coder

Status
Not open for further replies.

mp3show

Active Member
150
2011
0
0
Hello..

Im currently looking for a php coder to code mea file managment script. Now i currently have 1 already but its lacking in certain functions i want, this is what im currently using and can be found in the link below

http://phpfm.sourceforge.net/img/ss0.9.2.png
http://phpfm.sourceforge.net/

the functions is missing for me is

when you select compress, i would like it to take the folder name automatically and create either a zip or tar file. at present the script lets you compress but you need to manually enter the file name, also if possible rather than selecting 1 file at a time, to be able to mass select and it would also create individual .tars for each folder.

replacing a certain part of the filename, for example this_is_my_file.zip, when selected this would then replace the .zip with this_is_my_file_author.zip, this i guess would be classed a mass renamer of some sorts add intot he filename _author before the .zip, or either what ever the extension is. preferably i prefer .tar

i know most of this can be done, as i had a script before a friend created, but ive not seen him in around 3 years and i no longer have a copy of this :(


if you need any more info
 
9 comments
For the "mass renamer" that renames this_is_my_file.zip to this_is_my_file_author.zip, use this function:

PHP:
<?php
function add_author($filename, $author) {
$array = explode(".", $filename);
$array[0] = $array[0] . "_" . $author;
$return = implode(".", $array);
return $return;
?>
Example usage that renames this_is_my_file.zip to this_is_my_file_loget.zip:

PHP:
<?php
$filename = "this_is_my_file.zip";
$renamed =  add_author($filename, "loget");
echo $renamed;
?>
 
For the "mass renamer" that renames this_is_my_file.zip to this_is_my_file_author.zip, use this function:

PHP:
<?php
function add_author($filename, $author) {
$array = explode(".", $filename);
$array[0] = $array[0] . "_" . $author;
$return = implode(".", $array);
return $return;
?>
Example usage that renames this_is_my_file.zip to this_is_my_file_loget.zip:

PHP:
<?php
$filename = "this_is_my_file.zip";
$renamed =  add_author($filename, "loget");
echo $renamed;
?>


thanks, but how would i implement this into the current script i use? i created a .php file for the script u said but it returns this error

Parse error: syntax error, unexpected $end in /var/www/rename.php on line 7
 
Just paste the first part, not the second, the second is just an example of how to use it. It only works on file names without tons of dots (like your example in the first post).
 
Hi loget, i only added the first part into a php file and caled it renamer.php yet im still gettin that error as mentioned.

would it be at all possible for you to edit the index.php file of my script and add the renamer?
 
Sorry forgot the closing }. Try this:

PHP:
<?php
function add_author($filename, $author) {
$array = explode(".", $filename);
$array[0] = $array[0] . "_" . $author;
$return = implode(".", $array);
return $return;
}
?>
 
Status
Not open for further replies.
Back
Top