Advanced search  

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]

Pages: [1] 2   Go Down

Author Topic: FAQ mod for CPG-1.4  (Read 46495 times)

0 Members and 1 Guest are viewing this topic.

Amit Badkas

  • Dev Team member
  • Coppermine novice
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 43
    • Amit's Blog
FAQ mod for CPG-1.4
« 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 :-
(http://65.254.32.58/~amitrb/faqScreenshots/faqAdmin_addFAQ.jpg)

Screenshot for 'Add Category' screen :-
(http://65.254.32.58/~amitrb/faqScreenshots/faqAdmin_addCategory.jpg)

Screenshot for main screen for admin :-
(http://65.254.32.58/~amitrb/faqScreenshots/faqAdmin_general.jpg)

Screenshot for 'Edit FAQ' screen :-
(http://65.254.32.58/~amitrb/faqScreenshots/faqAdmin_editFAQ.jpg)

Screenshot for 'Edit Category' screen :-
(http://65.254.32.58/~amitrb/faqScreenshots/faqAdmin_editCategory.jpg)

Note:- You can see working example of this mod at NagpurBirds.
« Last Edit: March 23, 2006, 06:56:21 am by Amit Badkas »
Logged

Amit Badkas

  • Dev Team member
  • Coppermine novice
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 43
    • Amit's Blog
Collapsible category tree
« Reply #1 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 :-
(http://65.254.32.58/~amitrb/faqScreenshots/faq_collapsibleTree.jpg)

Amit :)
« Last Edit: March 23, 2006, 07:06:42 am by Amit Badkas »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: FAQ mod for CPG-1.4
« Reply #2 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
Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: FAQ mod for CPG-1.4
« Reply #3 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
Logged

Amit Badkas

  • Dev Team member
  • Coppermine novice
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 43
    • Amit's Blog
Re: FAQ mod for CPG-1.4
« Reply #4 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 :)
Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: FAQ mod for CPG-1.4
« Reply #5 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 ? (in few days)
Thanx
PYAP
« Last Edit: July 26, 2005, 05:54:04 pm by PYAP »
Logged

Amit Badkas

  • Dev Team member
  • Coppermine novice
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 43
    • Amit's Blog
Re: FAQ mod for CPG-1.4
« Reply #6 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 ? (in few days)

Yes. You can.

Amit :)
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: FAQ mod for CPG-1.4
« Reply #7 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.
Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: FAQ mod for CPG-1.4
« Reply #8 on: July 28, 2005, 03:00:16 pm »

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

PYAP
Logged

Amit Badkas

  • Dev Team member
  • Coppermine novice
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 43
    • Amit's Blog
Links 'Collapse All' and 'Expand All' for collapsible category tree
« Reply #9 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 :-
(http://65.254.32.58/~amitrb/faqScreenshots/faq_collapseAll.jpg)

(http://65.254.32.58/~amitrb/faqScreenshots/faq_expandAll.jpg)

Amit :)
« Last Edit: March 23, 2006, 07:10:40 am by Amit Badkas »
Logged

Amit Badkas

  • Dev Team member
  • Coppermine novice
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 43
    • Amit's Blog
FAQ mod with multilevel categories
« Reply #10 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 :-
(http://65.254.32.58/~amitrb/faqScreenshots/faq_mlc1.jpg)
(http://65.254.32.58/~amitrb/faqScreenshots/faq_mlc2.jpg)

Screen to add category (pop-up window) :-
(http://65.254.32.58/~amitrb/faqScreenshots/faq_mlc3.jpg)

Thanks :)
Amit
« Last Edit: March 23, 2006, 07:18:45 am by Amit Badkas »
Logged

Amit Badkas

  • Dev Team member
  • Coppermine novice
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 43
    • Amit's Blog
Database table modifications for multi-level categories
« Reply #11 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 :)
Logged

BT-loader

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 102
Re: FAQ mod for CPG-1.4
« Reply #12 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?
Logged
:: BT-loader ::
"The one and only..."

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: FAQ mod for CPG-1.4
« Reply #13 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
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

BT-loader

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 102
Re: FAQ mod for CPG-1.4
« Reply #14 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?
Logged
:: BT-loader ::
"The one and only..."

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: FAQ mod for CPG-1.4
« Reply #15 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.
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

BT-loader

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 102
Re: FAQ mod for CPG-1.4
« Reply #16 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?
Logged
:: BT-loader ::
"The one and only..."

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: FAQ mod for CPG-1.4
« Reply #17 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.
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter

BT-loader

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 102
Re: FAQ mod for CPG-1.4
« Reply #18 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...  :-\\
Logged
:: BT-loader ::
"The one and only..."

Aditya Mooley

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 781
    • My Sweet Home
Re: FAQ mod for CPG-1.4
« Reply #19 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. :)
Logged
--- "Its Nice 2 BE Important but its more Important 2 Be NICE" ---
Follow Coppermine on Twitter
Pages: [1] 2   Go Up
 

Page created in 0.046 seconds with 19 queries.