Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

FAQ's BS


Recommended Posts

This addon provides a FAQ page for any shop that is able to install addons via the modules content section. All of the FAQ's are handled in the admin. This version is compatible with any oscommerce shop that uses modules to load infoboxes in admin (about since V 2.3.1).
                        
This addon is based on the FAQ System addon but has many improvements and security fixes.

Installation only requires one file change.
                      

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 months later...

Hi Jack

I had a look at this FAQ app of yours and I got all up and running thus far.
I have no issues adding or editing Questions/Answers in the admin area except for the delete function.
I cannot delete any of the created Questions/Answers. Running this in an Edge test shop.

Link to comment
Share on other sites

I tried it here in a few shops and it is working. What php version are you using? When you click delete, does the page change to the confirm delete page? Does the url change and have "faq_action=Delete" in it?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thanks for your reply Jack.

The URL does have the "faq_action=Delete"  in it. (.../admin/faq_manager.php?faq_action=Delete&faq_id=3)
Once I click on the X in the listing page I get redirected to the "Delete confirmation" page where the title says for example "Delete Confirmation FAQ ID= 3"
Then on that page when I click the X again I get redirected back to the listing page (faq_manager.php) and the entry, in my example ID=3, is still there.

Running PHP 5.6.31 at the moment.

I did however get 2 error messages after the initial install.
 

Quote

Fatal error: Cannot re-assign auto-global variable _GET in C:\xampp\htdocs\edge1\admin\faq_manager.php on line 104

Quote

Fatal error: Cannot re-assign auto-global variable _GET in C:\xampp\htdocs\edge1\admin\includes\functions\faq.php on line 50

I fixed those by removing the $_GET variables from the lines mentioned in the error messages.

Edited by Tsimi
Link to comment
Share on other sites

Thanks for mentioning the errors Lambros. It reminded me that I had removing those from the unreleased version. I checked that version and found I had also changed the delete buttons so that is probably the problem you are having. In faq_manager.php, find the following starting around line 135

      //echo tep_image_submit('button_delete.gif', IMAGE_DELETE);
      echo '<a href="' . tep_href_link('faq_manager.php') . '"><i class="fa fa-times dodelete"></i></a>';

and replace them with

      echo tep_image_submit('button_delete.gif', IMAGE_DELETE);
      echo '<a href="' . tep_href_link('faq_manager.php') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

6 hours ago, Jack_mcs said:

I checked that version and found I had also changed the delete buttons so that is probably the problem you are having.

That did the trick. Thanks for the quick support. :thumbsup:
Change mine to this
 

echo tep_draw_button(IMAGE_DELETE);
echo tep_draw_button(IMAGE_CANCEL, NULL, tep_href_link('faq_manager.php', '', 'NONSSL'));

 

Something else, isn't this following line

echo tep_draw_form('faq_manager','faq_manager.php', 'faq_action=DelSure&faq_id='.$val[faq_id]);

suppose to look like this?

echo tep_draw_form('faq_manager','faq_manager.php', 'faq_action=DelSure&faq_id='.$faq_id);

When I look at the form using "Inspect Element" on my Firefox browser the faq_id= within the form is empty but when I change the line from faq_id='.$val[faq_id] to faq_id='.$faq_id the id is passed on and shows fine. However no matter which one I use the FAQ gets deleted correctly so not sure if it is a major issue.

Edited by Tsimi
Link to comment
Share on other sites

  • 1 month later...

Hi,

I was not able to sucessfully run faq_manager.php in admin. Although I am not an expert, I believe there is an error in function tep_set_faq_visible in admin/faq_manager.php arround line 107:

function tep_set_faq_visible($faq_id, $_GET) {
     if ($_GET['visible'] == 1) {
        return tep_db_query("update faq set visible = '0', date = now() where faq_id = '" . (int)$faq_id . "'");
     } else{
        return tep_db_query("update faq set visible = '1', date = now() where faq_id = '" . (int)$faq_id . "'");
     } 
   }

I modified the code as follows:

   $faq_visible = $_GET['visible'];
   function tep_set_faq_visible($faq_id, $faq_visible) {
     if ($_GET['visible'] == 1) {
        tep_db_query("update faq set visible = '0', date = now() where faq_id = '" . (int)$faq_id . "'");
     } else{
        tep_db_query("update faq set visible = '1', date = now() where faq_id = '" . (int)$faq_id . "'");
     } 
   }

I am not sure why, but this is working for me :-)

Link to comment
Share on other sites

@TsimiThank you for mentioning the mistake. That code would work in lower versions of php but probably fail in the newer ones.

@luboshshThank you for mentioning that. This addon is based on one that has been around for years and the coding in that was sloppy. I thought I had corrected all of those but see I missed some.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

A new version has been uploaded with these changes:

  • Added cancel and delete buttons back in.
  • Added commands to remove backslashes on the shops FAQ page.
  • Corrected code for the delete function. Found by member Tismi,
  • Merged a number of functions into the code since they were not needed.
  • Removed the tep_set_faq_visible function. Found by member luboshsh.
  • Removed $_GET from function calls that were left over from the previous addon and no longer needed.

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 4 weeks later...

Hello Jack, using php 7.2  I get the following errors :

Warning: Use of undefined constant faq_lang - assumed 'faq_lang'  in includes/functions/faq.php line 52

Warning: Use of undefined constant v_order - assumed 'v_order' in admin/faq_form. php line 43

Warning: Use of undefined constant visible - assumed 'visible' in admin/faq_form. php on line 54

...any ideas?

Thank you in advance,

Barbie

Link to comment
Share on other sites

Those are leftover from the original addon that I missed. Here's how to fix them:

Line 52 should be:

$query_lang = "WHERE language = '" . (int)$_GET['faq_lang'] . "'";

Line 43 and 44 should be:

 if ($edit['v_order']) {
  	$no = $edit['v_order']; 

Line 54 should be:

if ($edit['visible']) {

Line 32 should be:

echo $val[v_order] . ', ';

Basically, any [name] should be ['name'] (add apostrophes).

Those checks probably include isset commands but I don't have a test shop set up to test them at the moment. Please try the above changes and let me know how it goes.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 3 weeks later...

Hello again Jack,

Merry Christmas§ Sorry, I had an accident and just back back home.

There is another error :

Parse error: syntax error, unexpected '$no' (T_VARIABLE) in /xxxx/xxxx/xxxx/xxxx/admin/faq_form.php on line 47

Can not figure this one out.

Thank you in advance for your help.

 

Barbie

Link to comment
Share on other sites

21 hours ago, artfulweb said:

I had an accident

I hate it when life gets in the way.  :) Hope you are alreight.

To fix the error, in the file find this line:

echo tep_draw_input_field('v_order', "$no", 'size=3 maxlength=4');

and change it to this (just remove the quotes around $no)

echo tep_draw_input_field('v_order', $no, 'size=3 maxlength=4');

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 months later...

Hello Jack,

I believe there is a correction to make for PHP 7.2 users to avoid the error message

"Warning: sizeof(): Parameter must be an array or an object that implements Countable in /xxx/xxx/xxx/xxx/admin/faq_manager.php on line 35"

change line 35 from:

     if (sizeof($data) > 0) {

to:
  if (is_array($data) && sizeof($data) > 0) {

 

and the same for the warning 

""Warning: sizeof(): Parameter must be an array or an object that implements Countable in /xxx/xxx/xxx/xxx/admin/faq_form.php on line 30""

on line 30

     if (sizeof($data) > 0) {

to:
  if (is_array($data) && sizeof($data) > 0) {

Hope this helps, it worked for me

 

-Barbie

Link to comment
Share on other sites

@artfulwebThanks for posting that Barbie. I don't have a test shop setup with 7.2 so I can't test it. But the version of this addon I have here has the following change. If you have the time to bother with it, I would be interested to know if it fixes the issue without your change in? If you want to try it, reverse your changes and then in admin/includes/functions/faq.php fine (around line 58)

     $c = 0;
     while ($buffer = tep_db_fetch_array($daftar)) {

and change to

     $c = 0;
     $result = array();
     while ($buffer = tep_db_fetch_array($daftar)) {

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

33 minutes ago, Jack_mcs said:

@artfulwebThanks for posting that Barbie. I don't have a test shop setup with 7.2 so I can't test it. But the version of this addon I have here has the following change. If you have the time to bother with it, I would be interested to know if it fixes the issue without your change in? If you want to try it, reverse your changes and then in admin/includes/functions/faq.php fine (around line 58)


     $c = 0;
     while ($buffer = tep_db_fetch_array($daftar)) {

and change to


     $c = 0;
     $result = array();
     while ($buffer = tep_db_fetch_array($daftar)) {

 

Hello again Jack,

I reverted back and put your replacement code in admin/includes/functions/faq.php and the errors are back so maybe the sizeof function is no longer valid in php 7.2? With my change it works like a charm on my site. What do you think?

Link to comment
Share on other sites

  • 8 months later...

A new version has been uploaded with these changes:

  • Changed the cursor to a pointer when mousing over questions.
  • Corrected some php 7.2 problems.

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 5 months later...

A new version has been uploaded with these changes:

  • Added an icon for Phoenix.
  • Changes admin FAQ files to work with Phoenix 1.0.6.2.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

1 hour ago, Jack_mcs said:

A new version has been uploaded with these changes:

  • Added an icon for Phoenix.
  • Changes admin FAQ files to work with Phoenix 1.0.6.2.

Hi;

I run my store in 3 languages;

Currently I face for example a issue i insert a testimonial in english and german;

When I add a question in german-it does not show up on the admin(english default) or catalog side in german language.. Please note I added a duplicate FAQ language file in german folder already.

Your help will be deeply appreciated

Regds./

radhavallabh

Link to comment
Share on other sites

  • 2 months later...

Running 2.3.4 and installed, the only hiccup being my includes/modules/content/footer/templates/tpl_cm_footer_information_links.php is just includes/modules/content/footer/templates/links.php

I have a FAQs link on the footer and a FAQs option in Admin and can add/delete questions without an issue, but the faq.php itself just shows up blank. I didn't get any errors, do I need to change any other files due to the links.php being named differently?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...