Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Frequently Asked Questions (FAQ) Plugin
Author Message
mikeh Offline
Senior Member

Posts: 661
Joined: Feb 2011
2012-02-01 12:13:29
Frequently Asked Questions (FAQ) Plugin
F.A.Q. Plugin
Click Here To Download From Extend
View GitHub Repos

This is a simple and easy to use F.A.Q. manager.

Features:
[list=*]
[*]Create, edit & delete categories[/*]
[*]Create, edit & delete questions for categories[/*]
[*]Include faq categories within pages[/*]
[*]Place the faq in your template files[/*]
[/list]

Installation:
[list=*]
[*]Drag the faq.php file to your plugins directory and navigate to 'pages->F.A.Q. Manager' in your Admin Panel.[/*]
[*]There is a help page within the admin panel to explain how to include the faqs in your template or pages.[/*]
[/list]


Screenshots:

View All Questions & Categories

[Image: viewall.jpg]


Add New Question:

[Image: addnewquestion.jpg]


Manage Categories:

[Image: categories.jpg]


Add New Categories:

[Image: addcagory.jpg]


Help:

[Image: help.jpg]


Any suggestions to improve usability/functionality are appreciated.

Multi User
Front End User Login
GS Blog v.0
All my plugins
Visit this user's website Find all posts by this user Quote this message in a reply
verbunk Offline
Junior Member

Posts: 1
Joined: Feb 2012
2012-02-01 15:07:24
Frequently Asked Questions (FAQ) Plugin
Great looking plugin!

I just installed but get an error message on every page,

Code:
Notice: Undefined offset: 0 in /home/content/26/8289626/html/get_simple/plugins/faq.php on line 511

Notice: Undefined offset: 0 in /home/content/26/8289626/html/get_simple/plugins/faq.php on line 516

This is a fresh install of GS. Any tips?

-J
Find all posts by this user Quote this message in a reply
mikeh Offline
Senior Member

Posts: 661
Joined: Feb 2011
2012-02-02 02:30:03
Frequently Asked Questions (FAQ) Plugin
verbunk wrote:Great looking plugin!

I just installed but get an error message on every page,

Code:
Notice: Undefined offset: 0 in /home/content/26/8289626/html/get_simple/plugins/faq.php on line 511

Notice: Undefined offset: 0 in /home/content/26/8289626/html/get_simple/plugins/faq.php on line 516

This is a fresh install of GS. Any tips?

-J
Re-install the plugin, it has been fixed in version 1.1.
Sorry about that, I forgot to check if a variable isset.

Multi User
Front End User Login
GS Blog v.0
All my plugins
Visit this user's website Find all posts by this user Quote this message in a reply
zenn57 Offline
Junior Member

Posts: 6
Joined: Jan 2012
2012-02-05 15:56:30
Frequently Asked Questions (FAQ) Plugin
Hey. I just installed this and get this error:
Quote:Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'i18n_base_admin_pre_header' not found or invalid function name in /customers/8/5/b/englishaliveacademy.org/httpd.www/GetSimple_3.0/GetSimple_3.1B_r610/admin/inc/plugin_functions.php on line 223
When I try to put a FAQ into the source cod, it puts it in comment blocks.

Im using your Random Generator though and it works great. Thanks a bunch for that.

Ben
Find all posts by this user Quote this message in a reply
mvlcek Offline
Posting Freak

Posts: 1,737
Joined: Jan 2011
2012-02-05 18:40:51
Frequently Asked Questions (FAQ) Plugin
zenn57 wrote:Hey. I just installed this and get this error:
Quote:Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'i18n_base_admin_pre_header' not found or invalid function name in /customers/8/5/b/englishaliveacademy.org/httpd.www/GetSimple_3.0/GetSimple_3.1B_r610/admin/inc/plugin_functions.php on line 223

This is an error in the I18N plugin, which I have not tested so far with 3.1 beta.
Try the new version 2.5.2.

I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Visit this user's website Find all posts by this user Quote this message in a reply
jimmivader Offline
Junior Member

Posts: 8
Joined: Feb 2011
2012-02-09 22:33:23
Frequently Asked Questions (FAQ) Plugin
cool plugin, however it generates error in p01-contact

" Notice: Trying to get property of non-object in *****************************/plugins/p01-contact_gs.php on line 69 "

using 3.0 version
Find all posts by this user Quote this message in a reply
polyfragmented Offline
Senior Member

Posts: 524
Joined: Mar 2011
2012-02-09 23:09:12
Frequently Asked Questions (FAQ) Plugin
Jimmy,

the notice you posted originates in the p01 Plugin, not the FAQ plugin.

Cheers, Thorsten

→ Deutsche GetSimple-Website mit Anleitungen sowie Tipps und Tricks
Find all posts by this user Quote this message in a reply
jimmivader Offline
Junior Member

Posts: 8
Joined: Feb 2011
2012-02-10 03:35:15
Frequently Asked Questions (FAQ) Plugin
I know, but the contact plugin works OK without the FAQ plugin. That's why I posted it here.
I will ask in the contact plugin thread
Find all posts by this user Quote this message in a reply
hairyhi Offline
Junior Member

Posts: 1
Joined: Feb 2012
2012-02-13 10:46:21
Frequently Asked Questions (FAQ) Plugin
Hey thanks for the plugin. it works grat. I am just wondering if it is possible to setup FAQ page as a top level page (one of the pages) with all the categories and q&A?

Basically I want a complete FAQ page which even has a menu item in nav.
Find all posts by this user Quote this message in a reply
shawn_a Offline
Developer

Posts: 2,011
Joined: Sep 2011
2012-02-21 03:50:25
Frequently Asked Questions (FAQ) Plugin
There is already another plugin called faq that uses faq.php.
You might want to prefix uour file to make it unique, caused me great confusion installing it.
heh

NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Visit this user's website Find all posts by this user Quote this message in a reply
bandrzej Offline
Junior Member

Posts: 9
Joined: Feb 2012
2012-02-21 13:44:34
Frequently Asked Questions (FAQ) Plugin
Tried to do this:
Quote:To show a category of FAQ from within a page use the following coding:
This will show posts on your page from the category you specify

{$ Your Category Name $}
However, not working for me. The tag disappears from displaying on the page output, but never shows the FAQ category name and its content.

Using Innovation Theme (no modifications) and install base of 3.1B - Beta
Find all posts by this user Quote this message in a reply
mikeh Offline
Senior Member

Posts: 661
Joined: Feb 2011
2012-03-13 05:12:07
Frequently Asked Questions (FAQ) Plugin
shawn_a wrote:There is already another plugin called faq that uses faq.php.
You might want to prefix uour file to make it unique, caused me great confusion installing it.
heh

Sorry about that. I was not aware. I will fix it in the next version.

Multi User
Front End User Login
GS Blog v.0
All my plugins
Visit this user's website Find all posts by this user Quote this message in a reply
simplicity Offline
Junior Member

Posts: 4
Joined: Feb 2012
2012-03-19 02:26:56
Frequently Asked Questions (FAQ) Plugin
can not delete questions, nor categories. clickin the "X" seems to be successfull, but after page refresh or revisit the deleted question/category is still showing up. any ideas? thx!
Find all posts by this user Quote this message in a reply
wirehack7 Offline
Junior Member

Posts: 2
Joined: Apr 2012
2012-04-25 21:09:06
Frequently Asked Questions (FAQ) Plugin
Yes, there's a failure when deleting entries. Nothing will be deleted but the message appears that the item is deleted.
Would you fix that please?
Find all posts by this user Quote this message in a reply
Wos Offline
Junior Member

Posts: 4
Joined: Apr 2012
2012-04-27 23:52:34
Frequently Asked Questions (FAQ) Plugin
Hi,

Since I needed this plugin in my language, I added i18n functions and files,
and corrected the "delete question" problem.

You can find it here : GitHub
just click the "Downloads" link and select "download as zip" or Download as tar.gz"
You'll get a new faq.php, and a folder with 2 languages files (en_US and fr_FR)


Else, to correct the "delete question problem" only,
you can modify the faq.php file, remplacing lines 113-118
Code:
else
{
$child = $c_child->addChild('content');
$child->addAttribute('title', $atts['title']);
$child->addCData($content);
}

by

Code:
else
{
    if($delete_faq != null && $_GET['category_of_deleted'] ==  $c_atts['name'] && $_GET['delete'] == $atts['title'])
    {
        //Do nothing. Do not add it to new xml file
    }
    else {
        $child = $c_child->addChild('content');
        $child->addAttribute('title', $atts['title']);
        $child->addCData($content);
    }
}

AND

add at line 460, before
Code:
elseif(isset($_GET['faq_help']))

Code:
elseif(isset($_GET['delete']) && isset($_GET['category_of_deleted']))
{
    $FAQ->processFAQData(null,null,null,$_GET['delete']);
}
Find all posts by this user Quote this message in a reply
wirehack7 Offline
Junior Member

Posts: 2
Joined: Apr 2012
2012-04-28 00:32:03
Frequently Asked Questions (FAQ) Plugin
A very, very special thanks! You helped me out.
Next is: how I show questions first as anchor links and then each question with answer? :X
Find all posts by this user Quote this message in a reply
Wos Offline
Junior Member

Posts: 4
Joined: Apr 2012
2012-04-28 06:29:55
Frequently Asked Questions (FAQ) Plugin
wirehack7 wrote:A very, very special thanks! You helped me out.
Next is: how I show questions first as anchor links and then each question with answer? :X

Hi,

You can change the getFAQData function in faq.php with this one :
or add it with another name, read post 19
(NB. I added <span class="faqC">, </span> and other class="faqQ" class="faqA" for use in CSS, you can erase them in the function)

Code:
function getFAQData($display_category=null,$display_faq=null)
{
    $data_file = getXML(FAQFile);
    $end_result = '';
    foreach($data_file->category as $category)
    {
        $c_atts= $category->attributes();
        if($display_category == null)
        {
            $end_result .= '<ul><li><span class="faqC">'.$c_atts['name'].'</span><ul>';
            
            foreach($category->content as $content)
            {
                $atts = $content->attributes();
                $end_result .= '<li><a class="faqQ" href="?id=faq&display_category='.urlencode($c_atts['name']).'&display_faq='.urlencode($atts['title']).'">'.$atts['title'].'</a></li>';
            }
            $end_result .= '</ul></li></ul>';
        }
        elseif($display_category == $c_atts['name'])
        {
            $end_result .= '<ul><li><span class="faqC">'.$c_atts['name'].'</span><ul>';
            foreach($category->content as $content)
            {
                $atts = $content->attributes();
                if($display_faq == null)
                {
                    $end_result .= '<li><a class="faqQ" href="?id=faq&display_category='.urlencode($c_atts['name']).'&display_faq='.urlencode($atts['title']).'">'.$atts['title'].'</a></li>';
                }
                elseif($display_faq == $atts['title'])
                {
                    $end_result .= '<li class="faqQ">'.$atts['title'].'<ul><li class="faqA">'.$content.'</li></ul></li>';
                }
            }
            $end_result .= '</ul></li></ul>';
        }
    }
    return $end_result;
}

You need to modify getFAQ too for :
or add it with another name, read post 19
Code:
function getFAQ($display_category=null,$display_faq=null)
{
    echo getFAQData($display_category,$display_faq);
}

and you can test it in a template with :
Code:
<style>
.faqC { color:magenta; }
.faqQ { color:purple; }
.faqA { color:grey; }
</style>
    <div class="wrapper clearfix">
        <!-- page content -->
        <article>
            <section>
                
                <!-- title and content -->
                <?php
                    if ($_GET && isset($_GET["display_category"]))
                    {
                        if (isset($_GET["display_faq"]))
                        {
                            getFAQ($_GET["display_category"], $_GET["display_faq"]);
                        }
                        else
                        {
                            getFAQ($_GET["display_category"]);
                        }
                    }
                    else {
                        getFAQ(); /* all categories and Q/A */ ?> <hr />
                        <?php getFAQ("Catégorie de test"); /* the category "Catégorie de test" */ ?> <hr />
                        <?php getFAQ('Tests v2', null); /* the category "Tests v2" same as above */ ?> <hr />
                        <?php getFAQ('Tests v2', 'test 02'); /* the category "Tests v2", question "test 02" */ ?>
                <?php
                    }
                 ?>
            </section>        
        </article>


It was for testing the different results, in real you would prefer in your template :
again, use it with another name, read post 19
(and if you keep the css part, it' better in the theme .css)
Code:
<?php
if ($_GET && isset($_GET["display_category"]))
{
    if (isset($_GET["display_faq"]))
    {
        getFAQ($_GET["display_category"], $_GET["display_faq"]);
    }
    else
    {
        getFAQ($_GET["display_category"]);
    }
}
else {
    // put here your default display fonction, i.e.
    getFAQ();
}
?>
Find all posts by this user Quote this message in a reply
mikeh Offline
Senior Member

Posts: 661
Joined: Feb 2011
2012-04-29 06:34:29
Frequently Asked Questions (FAQ) Plugin
Version 1.2 Has Been Uploaded To Extend
It contains the internationalization and "Delete Question" fix provided by Wos

Thank you for your contributions Wos.

Multi User
Front End User Login
GS Blog v.0
All my plugins
Visit this user's website Find all posts by this user Quote this message in a reply
Wos Offline
Junior Member

Posts: 4
Joined: Apr 2012
2012-04-29 16:33:52
Frequently Asked Questions (FAQ) Plugin
@Mike First, big thanks you for your plugins.

@wirehack7 about the link tweak, instead of replacing the former functions, it would be better to simply add them with different names, i.e. :
Code:
function getFAQDataLink($display_category=null,$display_faq=null)
{
...
}
function getFAQLink($display_category=null,$display_faq=null)
{
    echo getFAQDataLink($display_category,$display_faq);
}

This way you keep all the functionalities.
And for the template, more options :
Code:
getFAQ(); // all categories
getFAQ("Catégorie de test"); // this category
getFAQLink(); // all categories as links
getFAQLink("Catégorie de test"); // this category as link
getFAQLink("Category 1", "Question 1"); // this answer

The "in real, useful template part" :
Code:
<section>
<!-- title and content -->
<?php
    if ($_GET && isset($_GET["display_category"]))
    {
        if (isset($_GET["display_faq"]))
        {
            getFAQLink($_GET["display_category"], $_GET["display_faq"]);
        }
        else
        {
            getFAQLink($_GET["display_category"]);
        }
    }
    else {
        getFAQLink(); /* all categories and Q/A */
    }
?>
</section>
Find all posts by this user Quote this message in a reply
thedoglett Offline
Junior Member

Posts: 14
Joined: Jun 2012
2012-11-10 03:47:00
RE: Frequently Asked Questions (FAQ) Plugin
(2012-02-21 13:44:34)bandrzej wrote:  Tried to do this:

To show a category of FAQ from within a page use the following coding:
This will show posts on your page from the category you specify

{$ Your Category Name $}

However, not working for me. The tag disappears from displaying on the page output, but never shows the FAQ category name and its content.

I'm having the same problem here, cannot for the life of me get anything to display. The backend works perfectly but no matter how much I try, I can't get anything to display on any page using the snippet above.

I have a FAQ with the name 'How long until my parcel is delivered?' so I've used {$ How long until my parcel is delivered? $} but it doesn't work.

I did notice the following are blank - is this the reason why?

Code:
    /*********
    Front End Functions
    *********/
    public function viewFAQ()
    {
    
    }
    
    public function filterFAQ()
    {
    
    }

    public function viewCategories()
    {
    
    }
Find all posts by this user Quote this message in a reply
thedoglett Offline
Junior Member

Posts: 14
Joined: Jun 2012
2012-11-12 20:22:08
RE: Frequently Asked Questions (FAQ) Plugin
**Bump** - anyone got any ideas why this isn't working?
Find all posts by this user Quote this message in a reply
gd5670 Offline
Junior Member

Posts: 8
Joined: Mar 2013
2013-03-17 17:47:30
RE: Frequently Asked Questions (FAQ) Plugin
Can anyone help me out a bit ? I am using the MyCompany theme for my website.I created a new faq page , but find it a bit hard to figure out where exactly i should put the code to display the faq questions.

For this page i am using frontpage.php as a template , renamed it to frontpage2.php to allow me to use a different image on the faq page.

This is the code of frontpage2.php :

PHP Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
/****************************************************
*
* @File:             template.php
* @Package:        GetSimple
* @Action:        myCompany theme for GetSimple CMS
*
*****************************************************/

# Include the header template
include('header.inc.php'); ?>

    <div id="main-container">
        <div class="inmain">
    <div id="main" class="wrapper clearfix frontpage">
            
            <article>
        <header>
          <h1><?php get_page_title(); ?></h1>
                </header>
                <section>
                  <?php get_page_content(); ?>  
                </section>
            </article>
      <aside>
      <img src="<?php get_theme_url(); ?>/customize/flowers.png" alt="Notebook with screenshot" />
      </aside>
<!---            
            <aside>
                <h3>aside</h3>
                <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam sodales urna non odio egestas tempor. Nunc vel vehicula ante. Etiam bibendum iaculis libero, eget molestie nisl pharetra in. In semper consequat est, eu porta velit mollis nec. Curabitur posuere enim eget turpis feugiat tempor. Etiam ullamcorper lorem dapibus velit suscipit ultrices.</p>
            </aside>
-->             
        </div> <!-- #main -->
        </div>
    </div> <!-- #main-container -->

<?php 
# Include the footer template
include('footer.inc.php'); ?>

My website is located here : http://is.gd/gGfetD

What i would need is to know where the code should be put to have it displayed below the 2 columns and above the social likns icons.

So far it has not worked for me yet !

Anyone ?
(This post was last modified: 2013-03-17 18:19:00 by Connie.)
Find all posts by this user Quote this message in a reply
benrusso Offline
Junior Member

Posts: 17
Joined: Jan 2012
Yesterday 07:31:06
RE: Frequently Asked Questions (FAQ) Plugin
(2012-11-12 20:22:08)thedoglett wrote:  **Bump** - anyone got any ideas why this isn't working?

In version 1.2, the callback function is this:

Code:
function faq_replace($content)  {
    $the_callback = preg_match('/(<p>\s*)?{\$\s*([a-zA-Z0-9_]+)(\s+[^\$]+)?\s*\$}(\s*<\/p>)?/', $content, $matches);
    if(isset($matches[0])) {
        $display_category = str_replace('{$ ', '', $matches[0]);
        $display_category = str_replace(' $}', '', $display_category);
        $display_category = str_replace('<p>', '', $display_category);
        $display_category = str_replace('</p>', '', $display_category);
        $faq = returnFAQ($display_category);
        echo str_replace($matches[0],$faq,$content);
    } else {
        return $content;
    }
}

Version 1.0 had a different set of functions for this:

Code:
function faq_replace($content) {
    return preg_replace_callback('/(<p>\s*)?{\$\s*([a-zA-Z0-9_]+)(\s+[^\$]+)?\s*\$}(\s*<\/p>)?/', 'faq_replace_match', $content);
}

function faq_replace_match($matches) {    
    $category = trim($matches[2].$matches[3]);
    getFAQ($category);
}


The bandaid solution is to replace the new code with the old code. I don't know enough to properly fix it, though.

Hope that helps.
Find all posts by this user Quote this message in a reply
gd5670 Offline
Junior Member

Posts: 8
Joined: Mar 2013
Yesterday 09:47:20
RE: Frequently Asked Questions (FAQ) Plugin
(Yesterday 07:31:06)benrusso wrote:  
(2012-11-12 20:22:08)thedoglett wrote:  **Bump** - anyone got any ideas why this isn't working?

In version 1.2, the callback function is this:

Code:
function faq_replace($content)  {
    $the_callback = preg_match('/(<p>\s*)?{\$\s*([a-zA-Z0-9_]+)(\s+[^\$]+)?\s*\$}(\s*<\/p>)?/', $content, $matches);
    if(isset($matches[0])) {
        $display_category = str_replace('{$ ', '', $matches[0]);
        $display_category = str_replace(' $}', '', $display_category);
        $display_category = str_replace('<p>', '', $display_category);
        $display_category = str_replace('</p>', '', $display_category);
        $faq = returnFAQ($display_category);
        echo str_replace($matches[0],$faq,$content);
    } else {
        return $content;
    }
}

Version 1.0 had a different set of functions for this:

Code:
function faq_replace($content) {
    return preg_replace_callback('/(<p>\s*)?{\$\s*([a-zA-Z0-9_]+)(\s+[^\$]+)?\s*\$}(\s*<\/p>)?/', 'faq_replace_match', $content);
}

function faq_replace_match($matches) {    
    $category = trim($matches[2].$matches[3]);
    getFAQ($category);
}


The bandaid solution is to replace the new code with the old code. I don't know enough to properly fix it, though.

Hope that helps.

Hi !

Thanks for the effort though i already fixed it in a different way by adding more css to the relevant files and do some extra coding to enable a tool tip and thus creating a differet faq page.

Anyway , hope this topic may get someone else on its way , if they experience the same issue(s)
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)

Generate Leads from Documents vCard Hosting