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
MLB Hotchkiss
View MLB Hotchkiss
MLB_Hotchkiss an improved version of the Hotchkiss Factory map which was released in May 2003. There was a major issue with the bomb, a main objective in the map since it could be armed without loading the explosives on it
Hits: 4
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 Canada Canada
8 Ukraine Ukraine
9 United Kingdom United Kingdom
10 Netherlands Netherlands
11 Germany Germany
12 Poland Poland
13 Italy Italy
14 Taiwan, Province of China Taiwan, Province of China
15 Seychelles Seychelles
16 Romania Romania
17 Indonesia Indonesia
18 Sweden Sweden
19 Thailand Thailand
20 Brazil Brazil
21 Japan Japan
22 South Africa South Africa
23 Lithuania Lithuania
24 India India
25 Spain Spain
26 Luxembourg Luxembourg
27 Chile Chile
28 Turkey Turkey
29 Moldova, Republic of Moldova, Republic of
30 Korea, Republic of Korea, Republic of
31 Venezuela Venezuela
32 Malaysia Malaysia
33 unknown unknown
34 Australia Australia
35 Switzerland Switzerland
36 Singapore Singapore
37 Colombia Colombia
38 Hong Kong Hong Kong
39 Mexico Mexico
40 Argentina Argentina
41 Belize Belize
42 Greece Greece
43 Honduras Honduras
44 Estonia Estonia
45 Czech Republic Czech Republic
46 Latvia Latvia
47 Bangladesh Bangladesh
48 Bulgaria Bulgaria
49 Pakistan Pakistan
50 Albania Albania

View MS-Analysis
 
Scrolling Links
Mods:































Community:




































Clans:






























































League:










Anticheat:












Other:

































 
Special days




August


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

A vasajtó kinyílik ...

 
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 ::