Stop data retention! Click here & act! Are you a webmaster and want to participate? Here you can find all necessary material for your website - Willst du auch an der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:
Chris Karakas Online Forum Index Karakas Online
 FAQFAQ   Forum SearchForum Search   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
How to add 200+ filles to the PHP-Nuke Downloads module



 
Post new topic   Reply to topic
   Chris Karakas Online Forum Index -> PHP-Nuke Forum RSS Feed of this Forum
Share this page: These icons link to social bookmarking sites where readers can share and discover new web pages.Digg  del.icio.us  tc.eserver.org  Blinklist  Furl  Reddit  Blogmarks  Magnolia  Sphere  Yahoo!  Google  Windows Live  Technorati  Blue Dot  Simpy  Newsvine  Stumble Upon  co.mments.com  Blinkbits  BlogMemes  Connotea  View previous topic :: View next topic  
Author Message
meetzah
Warrant Officer
Warrant Officer


Joined: 09 Aug 2005
Posts: 63

PostPosted: Thu Feb 16, 2006 4:26 pm    Post subject: How to add 200+ filles to the PHP-Nuke Downloads module
Reply with quote

hello,

I just got 200+ filles for my download module and I need to make them available to public. there is any way to make them available in "bulk"? I mean if I can place them all to my download module without adding each fille manualy.

I hope you understand what I want to do. Please help me if you know how to resolve this problem.

Thank you.
_________________
Life has given nothing to mortals without hard work!
Back to top
View user's profile Send private message
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6262
Location: Outer Space

PostPosted: Thu Feb 16, 2006 6:07 pm    Post subject:
Reply with quote

Use the method described in How to enter thousands of web links in PHP-Nuke and How to enter thousands of download links.
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
meetzah
Warrant Officer
Warrant Officer


Joined: 09 Aug 2005
Posts: 63

PostPosted: Fri Feb 17, 2006 4:13 pm    Post subject:
Reply with quote

Hello,

I try to use that script to add 200+ filles to my download module in phpnuke 7.7 version. I set the address correct and all other setiings in script but I don't succes. My site is e-oferta.ro and my download folder is e-oferta.ro/docs

Can you please tell me what I do wrong? Also, here is the downloadadd.php fille i run on my root folder. Also, I don't have a index.htm fille om my download folder. My download filles have spaces is the name. Is there a problem?

Thank you.

Code:
<?php
global $prefix, $dbi;
include_once("mainfile.php");
$url_downloads_folder = "http://www.e-oferta.ro/docs/"; // put the url to the
               // directory with your downloads - you need the trailing slash!
$cat = 1; // the download category id (cid)
$description = "Model de contract. Folositi pe propria raspundere.";
$name = "meetzah";
$email = "admin@e-oferta.ro";
$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.e-oferta.ro";
$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','0','0','0', '$filesize', '$version', '$homepage');<br><br>";
        $i--;
}
echo "<br><br>$the_sql_querys";
?>

_________________
Life has given nothing to mortals without hard work!
Back to top
View user's profile Send private message
chris
Dark Lord of the Sith


Joined: 10 May 2003
Posts: 6262
Location: Outer Space

PostPosted: Thu Feb 23, 2006 11:07 am    Post subject:
Reply with quote

meetzah wrote:
Open quoteMy download filles have spaces is the name. Is there a problem? Close quote


Oh yes, a big one indeed.

That's a damage that Microsoft has done in users brains...

Space is a command option delimiter (i.e. it is used to separate filenames from other things like options, parameters, other filenames etc. on the command line), how on earth would one think of misusing it as part of a filename?

You have to "escape" the spaces in filenames, i.e. you have to use "\ " (backslash space) whenever you see a " " in the filename.

What's worse, you may have to escape the backslash with another backslash, so that the sed scripts work (not sure about that).

You open a Pandorra's Box with blanks in filenames. The URLs for your web server must then contain "%20" in place of blanks. That is "http://www.mysite.xx/some filename with blanks in the name.html" must become "http://www.mysite.xx/some%20filename%20with%20blanks%20in%20the%20name.html".

Is that all worth the trouble? Are those blanks in the filenames a MUST? Then go ahead and do all these changes in the scipts and so on. But I cannot help you with that. Ask Microsoft for help.

However, if the blanks are not that important, I suggest you rename the files, replacing each blank with, say, a minus ("-") and try again.
_________________
Regards

Chris Karakas
www.karakas-online.de
Back to top
View user's profile Send private message Send e-mail Visit poster's website
meetzah
Warrant Officer
Warrant Officer


Joined: 09 Aug 2005
Posts: 63

PostPosted: Sat Feb 25, 2006 12:09 pm    Post subject:
Reply with quote

Quote:
Open quoteAsk Microsoft for help. Close quote


Laughing Laughing Laughing Laughing

thank you.
_________________
Life has given nothing to mortals without hard work!
Back to top
View user's profile Send private message
Share this page: These icons link to social bookmarking sites where readers can share and discover new web pages.Digg  del.icio.us  tc.eserver.org  Blinklist  Furl  Reddit  Blogmarks  Magnolia  Sphere  Yahoo!  Google  Windows Live  Technorati  Blue Dot  Simpy  Newsvine  Stumble Upon  co.mments.com  Blinkbits  BlogMemes  Connotea 
Display posts from previous:   
Post new topic   Reply to topic
   Chris Karakas Online Forum Index -> PHP-Nuke Forum
Page 1 of 1
This page contains valid HTML 4.01 Transitional - click here to check it!
This page contains a valid CSS - click here to check it!

 

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group