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
bremen_final
View bremen_final
Description
The Allies are attempting to steal an important.. thing... from the Axis. <br />Its invisible and already on the back of the truck, or maybe its the truck itself. <br />Whatever. I'm sick o
Hits: 12
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

Szintén szerepelt már a b1 - es verzióban ez az ajtó

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

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