Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
kevinkap
Involved
Involved



Joined: Apr 22, 2006
Posts: 356

PostPosted: Thu Nov 08, 2007 7:19 pm Reply with quote

Is it possible to add a second FAQ module? I would like on that is only available to site admins and not the normal user. Is there something else that would work for this?

_________________
Kevin Kappes 
View user's profile Send private message
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Thu Nov 08, 2007 11:01 pm Reply with quote

You'd probably have to duplicate the FAQ tables and then copy your scripts, replacing all the table references to the new tables. Then make that module admin-only

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
kevinkap







PostPosted: Fri Nov 09, 2007 8:34 am Reply with quote

Ok, I have found a little tutorial on Karakus about this, but it references some files not in rn2.10.01. I am not sure sure how to proceed.

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

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

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

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







PostPosted: Fri Nov 09, 2007 10:58 am Reply with quote

All the admin files now refer to files within modules/FAQ/admin
(adminfaq.php should be changed to index.php ... links.faq.php to links.php ... case.adminfaq.php to case.php)
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©