Welcome to Fogfighters Hungary!
 
  Login or Register
.week  
Time
 
 
 
Languages
Select Interface Language:

 
Google Translation
Translation
 
Traffic Report
 
Where are you from?
 
Map Random
Objective
Capuzzo Airport beta1
View Capuzzo Airport beta1
Story:<br /> <br /> January 1943 - The war in Africa is finally coming to an end. The Allied intelligence has discovered a group of Axis engineers planning a new super plane in Capuzzo Airport. Allies are attemp
Hits: 5
Total Maps: 85
 
Modules
· Home
· About Easter
· Büntetés kalkulátor
· Bible
· Biorythm
· Birds
· Black Gallery
· Cats
· Coppermine
· Dogs
· eCards
· ET Game manual
· ET Handbuch
· ET játékleírás
· ET Maps
· Fórumok
· FIFA World Cup 2006
· Fish
· Google Guide
· Googlemaps
· Hírküldés
· Help Desk
· Internet_TV
· Keresés
· Letöltések
· Members List
· Member_Map
· News
· Online Radios
· PHP-Nuke_HOWTO
· PHP-Nuke_Tools
· Private Messages
· Punkbuster
· Saját beállításaid
· Shout Box
· Statisztikák
· Szavazások
· Szerencsejáték
· Tagfelvétel
· Viccek
· Videó kollekció
· Web címek
· Web Development
 
MS-Analysis
Top-Ten Countries visiting Fogfighters Hungary

1 United States United States
2 China China
3 Viet nam Viet nam
4 Russian Federation Russian Federation
5 France France
6 Hungary Hungary
7 unknown unknown
8 Ukraine Ukraine
9 Canada Canada
10 United Kingdom United Kingdom
11 Germany Germany
12 Netherlands Netherlands
13 Poland Poland
14 Italy Italy
15 Taiwan, Province of China Taiwan, Province of China
16 Seychelles Seychelles
17 Australia Australia
18 Romania Romania
19 Indonesia Indonesia
20 India India
21 Thailand Thailand
22 Sweden Sweden
23 Brazil Brazil
24 Japan Japan
25 South Africa South Africa
26 Lithuania Lithuania
27 Argentina Argentina
28 Spain Spain
29 Iran, Islamic Republic of Iran, Islamic Republic of
30 Chile Chile
31 Luxembourg Luxembourg
32 Turkey Turkey
33 Moldova, Republic of Moldova, Republic of
34 Korea, Republic of Korea, Republic of
35 Belarus Belarus
36 Malaysia Malaysia
37 Venezuela Venezuela
38 Switzerland Switzerland
39 Singapore Singapore
40 Colombia Colombia
41 Hong Kong Hong Kong
42 Mexico Mexico
43 Mongolia Mongolia
44 Czech Republic Czech Republic
45 Belize Belize
46 Greece Greece
47 Honduras Honduras
48 Estonia Estonia
49 Latvia Latvia
50 Bulgaria Bulgaria

View MS-Analysis
 
Scrolling Links
Mods:































Community:




































Clans:






























































League:










Anticheat:












Other:

































 
Special days




World Sport Journalist Day


 
Képes Naptár
There is a problem right now with this block.
 
CPG Random Picture

A kantin belülről

 
Latest Videos


Last added videos

Orvosnál

Orvosnál

Last added videos

Funny

Funny Mortar

Last added videos

Shy

Shy Rose - I Cry For You
 
How to enter thousands of download links

27.6. How to enter thousands of download links

Figure 27-5. Administration panel: Downloads.

Administration panel: Downloads.



You have gathered, or you have found , thousands of download links that you would like to enter in the PHP-Nuke Downloads module. You don't want to do this manually. You can use a PHP script to read the links and create the file with the SQL commands for you.

Put the following script (which you can download from downloadadd.txt) in the PHP-Nuke root directory (the directory where also the config.php file is located), using .php as the ending, instead of .txt:

<?php
global $prefix, $dbi;
include_once("mainfile.php");
$url_downloads_folder = "http://www.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 = "You can put a generic description here - this will be on all of them!!!!";
$name = "PutThe_Subbmitted_By_Name_Here";
$email = "PutEmailHere";
$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.HomePage.com";
$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";
?>

You must of course adapt the script to your situation. The following variables must be set correctly:

  • $url_downloads_folder: the url to the directory with your downloads - you need the trailing slash (obligatory)!

  • $cat: the download category id (cid) (obligatory).

  • $description: you can put a generic description here - this will be on all of them! (optional)

  • $name: this will be the Subbmitted_By name (optional).

  • $email : your email (optional).

  • $version: the download version (optional).

  • $homepage: your homepage address (optional).

When you point the browser to the locally saved downloadadd.php script, it will print out some messages about the files it found in your downloads folder and also all the necessary SQL INSERT commands for those files to be entered as Downloads in the Downloads module.

Caution You should not have a file named index.html in your downloads folder!
 

If you have an index.html, index.htm or similar file in the $url_downloads_folder, the script will analyze the contents of this file, instead of the contents of the folder itself! Thus, to get the right SQL INSERT commands, you should make sure that your download folder does not contain any index.htm* file.

You can copy and paste them in a text file, call it downloads.sql for example, then run that file in the MySQL prompt, just as we did with the dmoz.sql file in Section 27.5:

mysql < downloads.sql
Tip Test a few INSERTSs first!
 

You should copy and test a few INSERTs first, before you run the whole downloads.sql file! You might not be satisfied with the resulted entries, you might discover an error, or decide to change some optional variable in the script - all this is much easier if you just tested a few commands first!

See How to add many downloads to my phpnuke site?, Question about bulk upload and Can this be done?.

Send all questions and comments to:
Webmaster
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest Fogfighters Hungary © 2007 - 2022

You can syndicate our news using the file backend.php or ultramode.txt

PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.25 Seconds

:: subBlack phpbb2 style by spectre :: PHP-Nuke theme by www.nukemods.com ::