Jack_mcs Posted July 7, 2018 Share Posted July 7, 2018 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. valquiria23, raiwa and JcMagpie 3 Quote 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 More sharing options...
♥Tsimi Posted September 25, 2018 Share Posted September 25, 2018 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. Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted September 25, 2018 Author Share Posted September 25, 2018 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? Quote 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 More sharing options...
♥Tsimi Posted September 25, 2018 Share Posted September 25, 2018 (edited) 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 September 25, 2018 by Tsimi Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted September 25, 2018 Author Share Posted September 25, 2018 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>'; Quote 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 More sharing options...
♥Tsimi Posted September 25, 2018 Share Posted September 25, 2018 (edited) 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. 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 September 25, 2018 by Tsimi Quote Link to comment Share on other sites More sharing options...
luboshsh Posted November 11, 2018 Share Posted November 11, 2018 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 :-) Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 11, 2018 Author Share Posted November 11, 2018 @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. Quote 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 More sharing options...
Jack_mcs Posted November 11, 2018 Author Share Posted November 11, 2018 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. Tsimi 1 Quote 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 More sharing options...
artfulweb Posted December 7, 2018 Share Posted December 7, 2018 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 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 7, 2018 Author Share Posted December 7, 2018 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. Quote 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 More sharing options...
artfulweb Posted December 25, 2018 Share Posted December 25, 2018 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 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 26, 2018 Author Share Posted December 26, 2018 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'); Quote 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 More sharing options...
artfulweb Posted December 27, 2018 Share Posted December 27, 2018 Yep as you say, "life gets in the way"... crushed vertebra in the back so life is going to be tough. Have to rethink a lot of things. Thanks so much for the fix. Wishing you a very Happy New Year! Barbie Quote Link to comment Share on other sites More sharing options...
artfulweb Posted March 9, 2019 Share Posted March 9, 2019 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 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted March 9, 2019 Author Share Posted March 9, 2019 @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)) { Quote 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 More sharing options...
artfulweb Posted March 9, 2019 Share Posted March 9, 2019 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? Quote Link to comment Share on other sites More sharing options...
artfulweb Posted March 9, 2019 Share Posted March 9, 2019 (edited) Oh, note that I have error reporting on in the admin section so I can spot these errors because if not I get a white page. Edited March 9, 2019 by artfulweb did not finish Quote Link to comment Share on other sites More sharing options...
artfulweb Posted March 9, 2019 Share Posted March 9, 2019 Sorry Jack, I uploaded the wrong admin/includes/functions/faq.php. Your correction $c = 0; $result = array(); while ($buffer = tep_db_fetch_array($daftar)) { DOES work. Thank you ! Barbie Jack_mcs 1 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted March 9, 2019 Author Share Posted March 9, 2019 Great. Thanks for testing it. Quote 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 More sharing options...
Jack_mcs Posted December 1, 2019 Author Share Posted December 1, 2019 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. valquiria23 1 Quote 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 More sharing options...
valquiria23 Posted December 2, 2019 Share Posted December 2, 2019 Thank you very much Jack @Jack_mcsfor your support of the OSC community. Especially for your excellent support and for SHARING. Cheers Valqui Quote Community Oscommerce fan You'll find the latest osC community version here. Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 30, 2020 Author Share Posted May 30, 2020 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. radhavallabh and valquiria23 2 Quote 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 More sharing options...
radhavallabh Posted May 30, 2020 Share Posted May 30, 2020 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 Quote Link to comment Share on other sites More sharing options...
FlagShipper Posted August 3, 2020 Share Posted August 3, 2020 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.