forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started by: Amit Badkas on June 27, 2005, 12:04:01 pm

Title: FAQ mod for CPG-1.4
Post by: Amit Badkas on June 27, 2005, 12:04:01 pm
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://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2FfaqAdmin_addFAQ.jpg&hash=8e1ac550c5d34ed247227dbfb6584bd6eca35f58)

Screenshot for 'Add Category' screen :-
(https://forum.coppermine-gallery.net/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://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2FfaqAdmin_general.jpg&hash=12eb5fbcaa94a34d9f3737b161bc4d18f086e9ac)

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

Screenshot for 'Edit Category' screen :-
(https://forum.coppermine-gallery.net/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 (http://www.nagpurbirds.org/myfaq.php).
Title: Collapsible category tree
Post by: Amit Badkas on July 20, 2005, 01:46:33 pm
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://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2Ffaq_collapsibleTree.jpg&hash=addd98544643243c03a60c45e466dde7d44c261a)

Amit :)
Title: Re: FAQ mod for CPG-1.4
Post by: Joachim Müller on July 22, 2005, 08:11:08 am
split discussion about cpg1.3.x version of this mod into a separate thread: FAQ mod for CPG-1.3 (http://forum.coppermine-gallery.net/index.php?topic=20077.0)
Title: Re: FAQ mod for CPG-1.4
Post by: Pascal YAP on July 26, 2005, 11:28:22 am
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)
Code: [Select]
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 :
Code: [Select]
// 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
Title: Re: FAQ mod for CPG-1.4
Post by: Amit Badkas on July 26, 2005, 01:41:16 pm
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 :)
Title: Re: FAQ mod for CPG-1.4
Post by: Pascal YAP on July 26, 2005, 05:45:08 pm
Quote
function '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 (http://forum.coppermine-gallery.net/index.php?board=38.0) ? (in few days)
Thanx
PYAP
Title: Re: FAQ mod for CPG-1.4
Post by: Amit Badkas on July 28, 2005, 07:04:41 am
Hi PYAP,

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.

In futur can i place your MOD (for 1.4.x and 1.3.x), here, in our French Coppermine Board (http://forum.coppermine-gallery.net/index.php?board=38.0) ? (in few days)

Yes. You can.

Amit :)
Title: Re: FAQ mod for CPG-1.4
Post by: Joachim Müller on July 28, 2005, 07:38:38 am
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.
Title: Re: FAQ mod for CPG-1.4
Post by: Pascal YAP on July 28, 2005, 03:00:16 pm
GauGau,
Quote
cpg1.4.0 is completely outdated
Well ! i'm waiting CPG NG  ;D

PYAP
Title: Links 'Collapse All' and 'Expand All' for collapsible category tree
Post by: Amit Badkas on August 01, 2005, 02:16:03 pm
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://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2Ffaq_collapseAll.jpg&hash=a8d8976ba103f8cb21ba87c041968a660fc0f4d4)

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

Amit :)
Title: FAQ mod with multilevel categories
Post by: Amit Badkas on August 16, 2005, 02:25:34 pm
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://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2Ffaq_mlc1.jpg&hash=73219d57e92b9ceb64f6c57e9644657ccda10f2f)
(https://forum.coppermine-gallery.net/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://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2F65.254.32.58%2F%7Eamitrb%2FfaqScreenshots%2Ffaq_mlc3.jpg&hash=a1a554ae4a541a09acbf01a4f66dd09f8c8c8e7d)

Thanks :)
Amit
Title: Database table modifications for multi-level categories
Post by: Amit Badkas on August 17, 2005, 08:45:20 am
For database table modifications related to multi-level categories, you have to run following two queries :-

Code: [Select]
ALTER TABLE `cpg140_faqCatgeoriesTest` ADD `parentCategory` INT NOT NULL AFTER `categoryId`;
Code: [Select]
ALTER TABLE `cpg140_faqCatgeoriesTest` ADD INDEX (`parentCategory`);
Also don't forget to change database table prefix according to your need.

Amit :)
Title: Re: FAQ mod for CPG-1.4
Post by: BT-loader on August 20, 2005, 12:49:58 am
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?
Title: Re: FAQ mod for CPG-1.4
Post by: 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
Title: Re: FAQ mod for CPG-1.4
Post by: BT-loader on August 20, 2005, 09:10:53 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?
Title: Re: FAQ mod for CPG-1.4
Post by: 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.
Title: Re: FAQ mod for CPG-1.4
Post by: BT-loader on August 20, 2005, 09:26:23 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?
Title: Re: FAQ mod for CPG-1.4
Post by: Aditya Mooley on August 20, 2005, 09:39:25 am
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.
Title: Re: FAQ mod for CPG-1.4
Post by: BT-loader on August 20, 2005, 09:58:55 am
Quote from: Aditya Mooley
But a lot of features are missing from it like collapsible tree and multi-level categories.
That´s to bad...  :-\\
Title: Re: FAQ mod for CPG-1.4
Post by: Aditya Mooley on August 20, 2005, 10:18:40 am
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. :)
Title: Re: FAQ mod for CPG-1.4
Post by: BT-loader on August 20, 2005, 10:29:32 am
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. :)
Why not just add the functions from 1.4 and add it to 1.3?    ;)
Title: Re: FAQ mod for CPG-1.4
Post by: Aditya Mooley on August 20, 2005, 11:09:16 am
 :D :D
That is not possible. Think how much code we will have to change for this.
I just checked the code once again,
find all the occurances of
Code: [Select]
cpg_db_query
and
cpg_db_fetch_row
and replace it with
Code: [Select]
db_query
and
db_fetch_row

This should be sufficient to make it work with 1.3.x
Title: Re: FAQ mod for CPG-1.4
Post by: BT-loader on August 20, 2005, 11:49:14 am
:D :D
That is not possible. Think how much code we will have to change for this.
I just checked the code once again,
find all the occurances of
Code: [Select]
cpg_db_query
and
cpg_db_fetch_row
and replace it with
Code: [Select]
db_query
and
db_fetch_row

This should be sufficient to make it work with 1.3.x
Is that all?  ;D

But i have allready installed the "old" mod, can i just replace the files or what?
Title: Re: Single-level collapsible tree for CPG-1.3.x FAQ mod
Post by: Amit Badkas on August 20, 2005, 12:46:11 pm
Hi,

But i have allready installed the "old" mod, can i just replace the files or what?

I have posted the procedure to add/change code in your FAQ mod to work single-level collapsible tree in topic http://forum.coppermine-gallery.net/index.php?topic=20077 because your posts are related to CPG-1.3.x.

Thanks :)
Amit
Title: Re: Single-level collapsible tree for CPG-1.3.x FAQ mod
Post by: BT-loader on August 20, 2005, 01:12:37 pm
Hi,

But i have allready installed the "old" mod, can i just replace the files or what?

I have posted the procedure to add/change code in your FAQ mod to work single-level collapsible tree in topic http://forum.coppermine-gallery.net/index.php?topic=20077 because your posts are related to CPG-1.3.x.

Thanks :)
Amit
Thanks mate...  ;D
Title: FAQ mod for CPG-1.4 with multi-level categories and collapsible category tree
Post by: Amit Badkas on September 05, 2005, 08:04:08 pm
FAQ mod for Coppermine Photo Gallery version 1.4.

It has four 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.

Fourth script is 'faqFunctions.inc.php' which has functions related to FAQ mod.

There are also two images which you have to place in 'images' directory of your coppermine installation.

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 can also select parent category for a 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  :)
Title: Re: FAQ mod for CPG-1.4
Post by: kcocco on September 06, 2005, 03:08:04 am
Amit, looks like an excellent mod!

I am having issues downloading the .zip?  The forum gives me the message: "It seems that you are not allowed to download or view attachments on this board." and gives me the login interface.  This happens when I am logged in as a user.  Is there some other level of access I need or other process to download this code?

Thanks
~Kevin
Title: Re: FAQ mod for CPG-1.4
Post by: Amit Badkas on September 06, 2005, 07:04:46 am
Hi kcocco,

Thanks for appreciating my work.

Amit, looks like an excellent mod!

I am having issues downloading the .zip?  The forum gives me the message: "It seems that you are not allowed to download or view attachments on this board." and gives me the login interface.  This happens when I am logged in as a user.  Is there some other level of access I need or other process to download this code?

Thanks
~Kevin

I think your session was expired. Please try after login again. I have checked the download with two more forum users and it worked for me.

Amit :)
Title: Re: FAQ mod for CPG-1.4
Post by: kcocco on September 06, 2005, 08:23:50 am
Amit,
I was able to get the download to work using Firefox browser.  I was previously using IE (not my machine) with no success?
Thank you
~Kevin
Title: Re: FAQ mod for CPG-1.4
Post by: Amit Badkas on September 06, 2005, 09:01:12 am
Kevin,

I was able to get the download to work using Firefox browser. I was previously using IE (not my machine) with no success?

I always prefers Firefox on Linux and Windows both. In fact, on Windows, Firefox runs as faster as IE.

Amit :)
Title: FAQ mod for CPG-1.4 with multi-level categories and collapsible category tree
Post by: Amit Badkas on September 07, 2005, 08:13:20 pm
Hi all,

You can view demo of FAQ mod for CPG-1.4 with multi-level categories and collapsible category tree on My Site (http://65.254.32.58/~amitrb/cpg140/myfaq.php).

Amit :)
Title: bbCode Toolbar for FAQ's answer
Post by: Amit Badkas on September 28, 2005, 07:04:20 pm
Hi,

Attached modified 'manageFAQ.php' file with new PNG toolbar images (should be placed in 'images' directory of your coppermine installation) and 'faq.js' javascript file (should be placed in root directory of your coppermine installation, i.e., where 'manageFAQ.php' file resides).

You can view demo of bbCode toolbar on My Site (http://65.254.32.58/~amitrb/toolbarExample.html).

That's all.

Amit :)
Title: Re: FAQ mod for CPG-1.4
Post by: Joachim Müller on September 29, 2005, 08:37:12 am
This mod is very good, I'm planning to add it to the core code of the next version. Is that OK, Amit?
Title: Re: FAQ mod for CPG-1.4
Post by: Amit Badkas on September 29, 2005, 09:13:25 am
Hi GauGau,

This mod is very good, I'm planning to add it to the core code of the next version. Is that OK, Amit?

Thanks for recognizing my work and considering it in the core code of future version.

Amit :)
Title: Re: FAQ mod for CPG-1.4
Post by: Crazymodder on February 20, 2008, 03:25:56 pm
Thanks for that great Mod. There is only one Problem I have a Gallery with German as Language and sometimes I need to write letters like ä,ö,ü but if I write them an save them I only se a ? and not the ä or ü or ö. If I look into the database via phpymyadmin and change the lette to ä or ü or ö nothing change in phmyadmin you can the the right letter but in myfaq.php you only see a ?. Where is the Problem? What do I have to change ;)

Thx
Title: Re: FAQ mod for CPG-1.4
Post by: paquets on July 02, 2009, 07:33:25 pm
Great work! Thanks for a very useful Mod.
 ;)