FRIHOST • FORUMS • SEARCH • FAQ • TOS • BLOGS • COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


AutoUpdate PHP-Nuke downloads module with files in directory





toughtrio
I AM WILLING TO PAY 200 FriH for THIS.

I have around 1000 files in different directories that I want to share with my users. I won't add up each file to the downloads, copying its link and its filename for a thousand different files.

Is there a script that will allow me to add the files automatically?
Each new new sub-folder should create a new sub-category under that parent category in PHP-Nuke Downloads module, until it reaches a final directory with files. The file name should be copied and that should be the NAME of the file. The link should obviously be the path to that file.

I've had a script for this long time ago, but its problem was that it couldn't detect the apache name tags. My files are generally E-books with long names and spaces and hyphens in them, which the script detected as apache codes like %20 etc. I don't want that to happen and no bugs should be there in the script.

Note - Mods, please also put this in marketplace.
AftershockVibe
It would be a lot easier if you could post the original script and someone could just modify it to replace the encoded url characters in the file name with normal characters.
toughtrio
I've tried alot to find it, but with no luck. I am willing to pay any amount of FriH for this.. Someone please help me out.

EDIT - I think I've finally gotten the previous script that adds only to ONE category from a directory with only files. What is needed now is editing. Please let the offers come in.

Code:
<?php
global $prefix, $dbi;
include_once("mainfile.php");
$url_downloads_folder = "http://humpa.com/images"; // put the url to the
               // directory with your downloads - you need the trailing slash!
$cat = 2; // the download category id (cid)
$description = "Harry Potter";
$name = "webmaster";
$email = "humpa@humpa.com";
$the_hits = 0; // you can change this if you want
$filesize = 0;  // you can change this if you want
$version = "";  // you can put something betwenn the quotes if you want, or leave them empty
$homepage = "http://www.blackpapers.info ";
$fp = @fopen("$url_downloads_folder","r");
if($fp) {
        echo "success opening the $url_downloads$downloads_folder folder.<br><br>";
       
        $i=1;
        $buffer = "";
        while (!feof ($fp)) {
                $i++;
                $buffer_temp = fgets($fp, 2048);
                $buffer = "$buffer$buffer_temp";
        }
fclose ($fp);
}else {
        echo "couldn't connect to $url_downloads_folder";
        die();
}
$buffer = str_replace("A HREF=\"/", "", $buffer);
$buffer = str_replace("A HREF=\"?", "", $buffer);
$i=0;
while(eregi("(<A HREF=\")([a-zA-Z0-9._-]+)(\">)",$buffer,$array_data)) {
              $i++;
                $buffer = str_replace($array_data[1].$array_data[2].$array_data[3],"",$buffer);
                echo "$array_data[2] is data-2<br>";
                $file_names[$i] = $array_data[2];
}
echo "found $i files<br>";
while($i>0) {
        echo "$file_names[$i]<br>";
        $title = eregi_replace("(.+)(\.)(.+)","\\1",$file_names[$i]);
        $url = $url_downloads_folder.$file_names[$i];
        //$the_sql_querys .= "insert into ".$prefix."_downloads_downloads values
//(NULL, '$cat', '0', '$title', '$url', '$description', now(), '$name', '$email',
//'$the_hits','$name','0','0','0', '$filesize', '$version', '$homepage');<br><br>";
       $i--;
}
//echo "<br><br>$the_sql_querys";
?>
==============================
Related topics
PHP-Nuke 7.8 Upload
Php Nuke Upgrade
PHP ve PHPNUKE kaynaklar
Problems with PHP-Nuke on Server2
PHP-NUKE - How to add own pages and add to menu?
PHP NUKE Mod
Can΄t connect to my database with php-nuke
PHP-NUKE install
Need a dedicated designer, knowing PHP-Nuke and how to MODit
PHP-Nuke platium?
PHP Nuke 7.7
php nuke - a wesome CMS
Where do we get free best php-nuke themes?
Php-nuke comments pending
Reply to topic    Frihost Forum Index -> Scripting -> Website Software

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.