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
1944_beach
View 1944_beach
The Allies must infiltrate the Axis Beach to build a Command Tower and capture the Axis documents: the Axis must protect their Forward Bunker and repel the Allies.
Hits: 2
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 Grandmother's Day


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

Az ajtó mögötti rész

 
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
 
Duplicating the PHP-Nuke FAQ module

22.1. Duplicating the PHP-Nuke FAQ module

Suppose you would like to have two FAQ modules. You might of course ask why on earth you would want such a complication in your PHP-Nuke site, but if you recall that PHP-Nuke lets you decide for each module individually whether to all visitors, only registered ones, or only administrators to view it, you will find out that two identical FAQ modules would be a simple way to have two FAQs, one only for administrators and one for all users.

We will now follow the steps outlined above for the purpose of duplicating the FAQ module:

  • We copy the whole directory modules/FAQ to modules/Admin_FAQ

  • We also copy:

    • admin/modules/adminfaq.php to admin/modules/adminfaq2.php,

    • admin/links/links.faq.php to admin/links/links.faq2.php and

    • admin/case/case.adminfaq.php to admin/case/case.adminfaq2.php.

  • Code inspection reveals that the only tables used by the FAQ module are faqAnswer and faqCategories.

  • The relevant part of nuke.sql that creates and populates faqAnswer and faqCategories is easily located. After we append a "2" at the table names and copy it to nuke2.sql, the latter will have the following content:

    # 
    # Table structure for table `nuke_faqAnswer2`
    # 
      
    CREATE TABLE nuke_faqAnswer2 (
      id tinyint(4) NOT NULL auto_increment,
      id_cat tinyint(4) NOT NULL default '0',
      question varchar(255) default ",
      answer text,
      PRIMARY KEY  (id),
      KEY id (id), 
      KEY id_cat (id_cat)
    ) TYPE=MyISAM;
    #
    # Dumping data for table `nuke_faqAnswer2`
    #
    # --------------------------------------------------------
    #
    # Table structure for table `nuke_faqCategories2`
    #
    CREATE TABLE nuke_faqCategories2 (
      id_cat tinyint(3) NOT NULL auto_increment,
      categories varchar(255) default NULL,
      flanguage varchar(30) NOT NULL default ",
      PRIMARY KEY  (id_cat),
      KEY id_cat (id_cat)
    ) TYPE=MyISAM;
    #
    # Dumping data for table `nuke_faqCategories2`
    #
    # --------------------------------------------------------
    
  • We run the nuke2.sql file from the MySQL prompt::

    mysql -u dbuname -p dbname < nuke2.sql
    
  • This will create the nuke_faqAnswer2 and nuke_faqCategories2 tables in the database dbname (remember to replace dbuname and dbname with their real values from your config.php!). Since the FAQ module does not come with preset categories and answers, the tables are not populated with data.

  • We edit all files under modules/Admin-FAQ and also the administrative files admin/modules/adminfaq2.php, admin/links/links.faq2.php and admin/case/case.adminfaq2.php: we change all references to faqAnswer or faqCategories to faqAnswer2 and faqCategories2 respectively.

  • In admin/case/case.adminfaq.php we change

    include ("admin/modules/adminfaq.php");
    

    to

    include ("admin/modules/adminfaq2.php");
    

Finally, we activate the Admin-FAQ module and specify that it can be viewed only by administrators.

Caution Don't forget the "op"s!
 

If you want your duplicate module to perform slightly different functions than the original one, there is no way around to creating duplicate "op" functions to be called from the "switch($op)" part of the admin file. In our example, this would mean that we would change

switch($op) {
 case "FaqCatSave":
   FaqCatSave($id_cat, $categories, $flanguage); /* Multilingual Code : added variable */
   break;
 case "FaqCatGoSave":
   FaqCatGoSave($id, $question, $answer);
   break;
 case "FaqCatAdd":
   FaqCatAdd($categories, $flanguage); /* Multilingual Code : added variable */
   break;
 case "FaqCatGoAdd":
   FaqCatGoAdd($id_cat, $question, $answer);
   break;
 case "FaqCatEdit":
   FaqCatEdit($id_cat);
   break;
 case "FaqCatGoEdit":
   FaqCatGoEdit($id);
   break;
 case "FaqCatDel":
   FaqCatDel($id_cat, $ok);
   break;
 case "FaqCatGoDel":
   FaqCatGoDel($id, $ok);
   break;
 case "FaqAdmin":
   FaqAdmin();
   break;
 case "FaqCatGo":
   FaqCatGo($id_cat);
   break;
}
} else {
 echo "Access Denied";
}

in the admin/modules/adminfaq.php file, to:

switch($op) {
 case "FaqCatSave2":
   FaqCatSave2($id_cat, $categories, $flanguage); /* Multilingual Code : added variable */
   break;
 case "FaqCatGoSave2":
   FaqCatGoSave2($id, $question, $answer);
   break;
 case "FaqCatAdd2":
   FaqCatAdd2($categories, $flanguage); /* Multilingual Code : added variable */
   break;
 case "FaqCatGoAdd2":
   FaqCatGoAdd2($id_cat, $question, $answer);
   break;
 case "FaqCatEdit2":
   FaqCatEdit2($id_cat);
   break;
 case "FaqCatGoEdit2":
   FaqCatGoEdit2($id);
   break;
 case "FaqCatDel2":
   FaqCatDel2($id_cat, $ok);
   break;
 case "FaqCatGoDel2":
   FaqCatGoDel2($id, $ok);
   break;
 case "FaqAdmin2":
   FaqAdmin2();
   break;
 case "FaqCatGo2":
   FaqCatGo2($id_cat);
   break;
}
} else {
 echo "Access Denied";
}

and then program the new functionality into the new functions (the ones with the 2 suffix in their name).


Help us make a better PHP-Nuke HOWTO!

Want to contribute to this HOWTO? Have a suggestion or a solution to a problem that was not treated here? Post your comments on my PHP-Nuke Forum!

Chris Karakas, Maintainer PHP-Nuke HOWTO

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.22 Seconds

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