FAQ mod for CPG-1.4 FAQ mod for CPG-1.4
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

FAQ mod for CPG-1.4

Started by Amit Badkas, June 27, 2005, 12:04:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Amit Badkas

FAQ mod for Coppermine Photo Gallery version 1.4.

It has three PHP scripts attached in the zip.

First script is 'faqInstaller.php' which is used to handle installation of FAQ mod.

Second script is 'myfaq.php' which is used to display FAQs with their categories and, if logged in as admin, to delete FAQs and their categories.

Third script is 'manageFAQ.php' which is used by admin to add/edit FAQs and their categories.

To install this mod, unzip the PHP files where you have installed your CPG. Run 'faqInstaller.php' as admin from your web browser, ex:- http://www.somedomain.com/cpg/faqInstaller.php and it will create two database tables.

If you already have any one of these two database tables created then you have to move or delete those tables and run the installer again.

After installation is done, please remove 'faqInstaller.php' for security purpose and access FAQ URL, ex:- http://www.somedomain.com/cpg/myfaq.php to view/manage your FAQs.

For the first time, there are no FAQs/categories. You have to create the FAQ/category by logged in as admin and to click on one of the 'Add New Category' or 'Add FAQ Entry' links.

If you click on 'Add New Category' link then a pop-up window will open which has a textbox to enter title for new category. You cannot have two categories with same title.

If you click on 'Add New Entry' link then a pop-up window will open which has a drop-down of categories (if exists), a textarea to enter question text and another textarea to enter answer text. You can save FAQ in any category or if you do not want to save the FAQ in any category then select 'No category' option. You can use CPG's bbcodes for answer's text.

To edit/delete any FAQ/category, click on respective links next to FAQ/category titles.

If you delete a category which has FAQs then those FAQs will be moved under root category.

You have to manually add link for FAQ page in the navigation area.

That's all  :)

Screenshot for 'Add FAQ' screen :-
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2FfaqAdmin_addFAQ.jpg&hash=8e1ac550c5d34ed247227dbfb6584bd6eca35f58)

Screenshot for 'Add Category' screen :-
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2FfaqAdmin_addCategory.jpg&hash=609d6501c821604cbad159cb36f5fd5abdb5613b)

Screenshot for main screen for admin :-
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2FfaqAdmin_general.jpg&hash=12eb5fbcaa94a34d9f3737b161bc4d18f086e9ac)

Screenshot for 'Edit FAQ' screen :-
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2FfaqAdmin_editFAQ.jpg&hash=4738714b24e81d9400db658340ef91abe82020be)

Screenshot for 'Edit Category' screen :-
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2FfaqAdmin_editCategory.jpg&hash=689219ad1eb038a31519192d082dec50abec73b9)

Note:- You can see working example of this mod at NagpurBirds.

Amit Badkas

#1
Hi all,

More modifications made in FAQ mod to make category tree collapsible.

The attached zip contains modified myfaq.php and two images. The images should be placed in your coppermine installation's images directory and it must be 'images'.

That's all !!!

Screenshot to view how this looks :-
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2Ffaq_collapsibleTree.jpg&hash=addd98544643243c03a60c45e466dde7d44c261a)

Amit :)

Joachim Müller

split discussion about cpg1.3.x version of this mod into a separate thread: FAQ mod for CPG-1.3

Pascal YAP

hi Amit,

Nice but i've get this error message when i run faqInstaller.php, do you know why ?
(CPG 1.4.0 in Admin mode)
Fatal error: Call to undefined function: cpg_db_fetch_row() in /var/www/MyHost.fr/b/f/webotron/myDir/faqInstaller.php on line 18
Line 18 is visible here :
// Query to select tables in the database
$query = 'SHOW TABLES FROM '.$CONFIG['dbname'];
$result = cpg_db_query($query);

while ($row = cpg_db_fetch_row($result)) {
 if ($row[0] == $CONFIG['TABLE_PREFIX'].'faqs') {
   $faqTableExists = true;
 } else if ($row[0] == $CONFIG['TABLE_PREFIX'].'faqCategories') {
   $categoryTableExists = true;
 } else if ($faqTableExists && $categoryTableExists) {
   break;
 }
}

Correction on faqCatgeories by faqCategories

Thanx
PYAP

Amit Badkas

Hi PYAP,

The function 'cpg_db_fetch_row' exists in 'functions.inc.php' of CPG-1.4.x. Please check your file, if the function is not there please get the updated file from cvs.

Amit :)

Pascal YAP

#5
Quotefunction 'cpg_db_fetch_row' exists in 'functions.inc.php' of CPG-1.4.x. Please check your file..from cvs.

it's OK now, i had downloaded some brand new files ;D
But i have the same error message again ???

In futur can i place your MOD (for 1.4.x and 1.3.x), here, in our French Coppermine Board ? (in few days)
Thanx
PYAP

Amit Badkas

Hi PYAP,

Quote from: PYAP on July 26, 2005, 05:45:08 PM
it's OK now, i had downloaded some brand new files ;D
But i have the same error message again ???

The function 'cpg_db_fetch_row' is not in my mod but in CPG-1.4.x itself, so it is possible that there is something wrong in your 'functions.inc.php' file.

Quote from: PYAP on July 26, 2005, 05:45:08 PM
In futur can i place your MOD (for 1.4.x and 1.3.x), here, in our French Coppermine Board ? (in few days)

Yes. You can.

Amit :)

Joachim Müller

Pascal: cpg1.4.0 is completely outdated, there have been huge changes from the alpha release to the cpg1.4.1 beta. It's mandatory that you upgrade to cpg1.4.1, preferably the latest devel cvs checkout. There's no point in hunting down particular issues for cpg1.4.0.

Pascal YAP

GauGau,
Quotecpg1.4.0 is completely outdated
Well ! i'm waiting CPG NG  ;D

PYAP

Amit Badkas

Hi all,

Links 'Collapse All' and 'Expand All' have been added for collapsible category tree.

Attached the modified 'myfaq.php' script.

Screenshots to view how these links will be displayed :-
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2Ffaq_collapseAll.jpg&hash=a8d8976ba103f8cb21ba87c041968a660fc0f4d4)

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2Ffaq_expandAll.jpg&hash=3868314e2f61cf6f219ea07d2d0ae15ffbf7d96c)

Amit :)

Amit Badkas

#10
Hi all,

Attached new PHP scripts in a zip for FAQ mod having multi-level categories.
One more file 'faqFunctions.inc.php' has been added into the mod and many changes made in 'manageFAQ.php' and 'myfaq.php'.

I hope all of you will like it.

Main screen :-
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2Ffaq_mlc1.jpg&hash=73219d57e92b9ceb64f6c57e9644657ccda10f2f)
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2Ffaq_mlc2.jpg&hash=80eac85979d83bbbde8e1feeef9276ca6fd2493f)

Screen to add category (pop-up window) :-
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2Ffaq_mlc3.jpg&hash=a1a554ae4a541a09acbf01a4f66dd09f8c8c8e7d)

Thanks :)
Amit

Amit Badkas

For database table modifications related to multi-level categories, you have to run following two queries :-

ALTER TABLE `cpg140_faqCatgeoriesTest` ADD `parentCategory` INT NOT NULL AFTER `categoryId`;
ALTER TABLE `cpg140_faqCatgeoriesTest` ADD INDEX (`parentCategory`);

Also don't forget to change database table prefix according to your need.

Amit :)

BT-loader

This doesn´t work for me.  :(

Everytime i try to run www.mysite.com/faqInstaller.php, i come to a blank page.

What sql am i supposed to use for this, maybe i can do it manually?
:: BT-loader ::
"The one and only..."

Aditya Mooley

Have you got the correct version of CPG? The version you have selected is 1.3.x and this mod is only for 1.4.x
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

BT-loader

Quote from: Aditya Mooley on August 20, 2005, 06:48:05 AM
Have you got the correct version of CPG? The version you have selected is 1.3.x and this mod is only for 1.4.x
I´m not sure which version of CPG i have.  :-[
Is there a easy way to find out which version i´m using?
:: BT-loader ::
"The one and only..."

Aditya Mooley

View the HTML source of the index.php page. The version is written at the bottom of the page.
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

BT-loader

Quote from: Aditya Mooley on August 20, 2005, 09:19:11 AM
View the HTML source of the index.php page. The version is written at the bottom of the page.
Oh, ok...
It seems that i´m using version: 1.3.3.  :\'(

Is there another "faq mod" i can use instead?
:: BT-loader ::
"The one and only..."

Aditya Mooley

Yes, there is a mod for 1.3.x
http://forum.coppermine-gallery.net/index.php?topic=20077.0
But a lot of features are missing from it like collapsible tree and multi-level categories.
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

BT-loader

Quote from: Aditya MooleyBut a lot of features are missing from it like collapsible tree and multi-level categories.
That´s to bad...  :-\\
:: BT-loader ::
"The one and only..."

Aditya Mooley

If you know PHP, you can take this 1.4 mod and change it for 1.3
As far as I know, some function names related to database needs to be changed. But do it on your own risk. :)
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter