Latest News: (loading..)
Sign in to follow this  
Followers 0
keoga

FAQ system contribution

73 posts in this topic

I am looking for the capability to have several groups of questions each grouped under different FAQ categories.

 

For example: General Questions, Wholesale FAQ, Shipping FAQ, etc.

 

Anyone?

Share this post


Link to post
Share on other sites
Anyone?

Not that I am aware of. Maybe you need to create two more copies and do filename renames and sql variants. Have no need for that myself.

Share this post


Link to post
Share on other sites

Hi there,

 

I've installed version 3 and installed everything, including trabi's faq_manager update but I'm getting this when I click on "FAQ System" in my admin panel:

 

Fatal error: Cannot redeclare do_magic_quotes_gpc() (previously declared in /home/yarnandk/public_html/admin/includes/functions/compatibility.php:18) in /home/yarnandk/public_html/admin/includes/functions/compatibility.php on line 18

 

Anyone knows how to fix this problem?

 

The compatibility.php code is here:

<?php
/*
 $Id: compatibility.php 1829 2008-01-29 22:44:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2007 osCommerce

 Released under the GNU General Public License
*/

////
// Recursively handle magic_quotes_gpc turned off.
// This is due to the possibility of have an array in
// $HTTP_xxx_VARS
// Ie, products attributes
 function do_magic_quotes_gpc(&$ar) {
   if (!is_array($ar)) return false;

   reset($ar);
   while (list($key, $value) = each($ar)) {
     if (is_array($ar[$key])) {
       do_magic_quotes_gpc($ar[$key]);
     } else {
       $ar[$key] = addslashes($value);
     }
   }
   reset($ar);
 }

 if (PHP_VERSION >= 4.1) {
   $HTTP_GET_VARS =& $_GET;
   $HTTP_POST_VARS =& $_POST;
   $HTTP_COOKIE_VARS =& $_COOKIE;
   $HTTP_SESSION_VARS =& $_SESSION;
   $HTTP_POST_FILES =& $_FILES;
   $HTTP_SERVER_VARS =& $_SERVER;
 } else {
   if (!is_array($HTTP_GET_VARS)) $HTTP_GET_VARS = array();
   if (!is_array($HTTP_POST_VARS)) $HTTP_POST_VARS = array();
   if (!is_array($HTTP_COOKIE_VARS)) $HTTP_COOKIE_VARS = array();
 }

// handle magic_quotes_gpc turned off.
 if (!get_magic_quotes_gpc()) {
   do_magic_quotes_gpc($HTTP_GET_VARS);
   do_magic_quotes_gpc($HTTP_POST_VARS);
   do_magic_quotes_gpc($HTTP_COOKIE_VARS);
 }

 if (!function_exists('is_numeric')) {
   function is_numeric($param) {
     return ereg("^[0-9]{1,50}.?[0-9]{0,50}$", $param);
   }
 }

 if (!function_exists('is_uploaded_file')) {
   function is_uploaded_file($filename) {
     if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
       $tmp_file = dirname(tempnam('', ''));
     }

     if (strchr($tmp_file, '/')) {
       if (substr($tmp_file, -1) != '/') $tmp_file .= '/';
     } elseif (strchr($tmp_file, '\\')) {
       if (substr($tmp_file, -1) != '\\') $tmp_file .= '\\';
     }

     return file_exists($tmp_file . basename($filename));
   }
 }

 if (!function_exists('move_uploaded_file')) {
   function move_uploaded_file($file, $target) {
     return copy($file, $target);
   }
 }

 if (!function_exists('checkdnsrr')) {
   function checkdnsrr($host, $type) {
     if(tep_not_null($host) && tep_not_null($type)) {
       @exec("nslookup -type=$type $host", $output);
       while(list($k, $line) = each($output)) {
         if(eregi("^$host", $line)) {
           return true;
         }
       }
     }
     return false;
   }
 }

 if (!function_exists('in_array')) {
   function in_array($lookup_value, $lookup_array) {
     reset($lookup_array);
     while (list($key, $value) = each($lookup_array)) {
       if ($value == $lookup_value) return true;
     }

     return false;
   }
 }

 if (!function_exists('array_merge')) {
   function array_merge($array1, $array2, $array3 = '') {
     if ($array3 == '') $array3 = array();

     while (list($key, $val) = each($array1)) $array_merged[$key] = $val;
     while (list($key, $val) = each($array2)) $array_merged[$key] = $val;

     if (sizeof($array3) > 0) while (list($key, $val) = each($array3)) $array_merged[$key] = $val;

     return (array)$array_merged;
   }
 }

 if (!function_exists('array_shift')) {
   function array_shift(&$array) {
     $i = 0;
     $shifted_array = array();
     reset($array);
     while (list($key, $value) = each($array)) {
       if ($i > 0) {
         $shifted_array[$key] = $value;
       } else {
         $return = $array[$key];
       }
       $i++;
     }
     $array = $shifted_array;

     return $return;
   }
 }

 if (!function_exists('array_reverse')) {
   function array_reverse($array) {
     $reversed_array = array();

     for ($i=sizeof($array)-1; $i>=0; $i--) {
       $reversed_array[] = $array[$i];
     }

     return $reversed_array;
   }
 }

 if (!function_exists('array_slice')) {
   function array_slice($array, $offset, $length = '0') {
     $length = abs($length);

     if ($length == 0) {
       $high = sizeof($array);
     } else {
       $high = $offset+$length;
     }

     for ($i=$offset; $i<$high; $i++) {
       $new_array[$i-$offset] = $array[$i];
     }

     return $new_array;
   }
 }

/*
* http_build_query() natively supported from PHP 5.0
* From Pear::PHP_Compat
*/

 if ( !function_exists('http_build_query') && (PHP_VERSION >= 4)) {
   function http_build_query($formdata, $numeric_prefix = null, $arg_separator = null) {
// If $formdata is an object, convert it to an array
     if ( is_object($formdata) ) {
       $formdata = get_object_vars($formdata);
     }

// Check we have an array to work with
     if ( !is_array($formdata) || !empty($formdata) ) {
       return false;
     }

// Argument seperator
     if ( empty($arg_separator) ) {
       $arg_separator = ini_get('arg_separator.output');

       if ( empty($arg_separator) ) {
         $arg_separator = '&';
       }
     }

// Start building the query
     $tmp = array();

     foreach ( $formdata as $key => $val ) {
       if ( is_null($val) ) {
         continue;
       }

       if ( is_integer($key) && ( $numeric_prefix != null ) ) {
         $key = $numeric_prefix . $key;
       }

       if ( is_scalar($val) ) {
         array_push($tmp, urlencode($key) . '=' . urlencode($val));
         continue;
       }

// If the value is an array, recursively parse it
       if ( is_array($val) || is_object($val) ) {
         array_push($tmp, http_build_query_helper($val, urlencode($key), $arg_separator));
         continue;
       }

// The value is a resource
       return null;
     }

     return implode($arg_separator, $tmp);
   }

// Helper function
   function http_build_query_helper($array, $name, $arg_separator) {
     $tmp = array();

     foreach ( $array as $key => $value ) {
       if ( is_array($value) ) {
         array_push($tmp, http_build_query_helper($value, sprintf('%s[%s]', $name, $key), $arg_separator));
       } elseif ( is_scalar($value) ) {
         array_push($tmp, sprintf('%s[%s]=%s', $name, urlencode($key), urlencode($value)));
       } elseif ( is_object($value) ) {
         array_push($tmp, http_build_query_helper(get_object_vars($value), sprintf('%s[%s]', $name, $key), $arg_separator));
       }
     }

     return implode($arg_separator, $tmp);
   }
 }

/*
* stripos() natively supported from PHP 5.0
* From Pear::PHP_Compat
*/

 if (!function_exists('stripos')) {
   function stripos($haystack, $needle, $offset = null) {
     $fix = 0;

     if (!is_null($offset)) {
       if ($offset > 0) {
         $haystack = substr($haystack, $offset, strlen($haystack) - $offset);
         $fix = $offset;
       }
     }

     $segments = explode(strtolower($needle), strtolower($haystack), 2);

// Check there was a match
     if (count($segments) == 1) {
       return false;
     }

     $position = strlen($segments[0]) + $fix;

     return $position;
   }
 }
?>

 

Thank you!

Edited by inoriz

Share this post


Link to post
Share on other sites

I can only tell you that there seems to be a problem with the Magic Quotes

redeclare do_magic_quotes_gpc()

Not sure if that helps you at all, just thought I try...

Share this post


Link to post
Share on other sites
I can only tell you that there seems to be a problem with the Magic Quotes

redeclare do_magic_quotes_gpc()

Not sure if that helps you at all, just thought I try...

 

 

So how do I go about fixing it?

Share this post


Link to post
Share on other sites

is there anyway to assign the faq to a category?

 

what i'm thinking is, when i buyer is in my TV pages and clicks on TV FAQ, he'll be sent to an faq just for tv's

 

same thing if he clicks on radio FAQ.

 

I suppose i can just duplicate all the files and make multiple FAQs, but i'm sure there's a better way through the database.

Share this post


Link to post
Share on other sites

Greetings, it's my first time installing this. Followed directions and now when in the admin I click on File Manage I get this error:

 

Warning: require(includes/languages/english/faq.php) [function.require]: failed to open stream: No such file or directory in /data/home/sahaj/websites/sahajherbs.com/docs/store/catalog/admin/faq_manager.php on line 13

 

Warning: require(includes/languages/english/faq.php) [function.require]: failed to open stream: No such file or directory in /data/home/sahaj/websites/sahajherbs.com/docs/store/catalog/admin/faq_manager.php on line 13

 

Fatal error: require() [function.require]: Failed opening required 'includes/languages/english/faq.php' (include_path='.:/usr/local/php5/share/pear:/usr/local/share/adodb') in /data/home/sahaj/websites/sahajherbs.com/docs/store/catalog/admin/faq_manager.php on line 13

 

 

Can anyone help me figure out what went wrong?

Share this post


Link to post
Share on other sites
Greetings, it's my first time installing this. Followed directions and now when in the admin I click on File Manage I get this error:

 

Warning: require(includes/languages/english/faq.php) [function.require]: failed to open stream: No such file or directory in /data/home/sahaj/websites/sahajherbs.com/docs/store/catalog/admin/faq_manager.php on line 13

 

Can anyone help me figure out what went wrong?

If includes/languages/english/faq.php exists, then check your admin/includes/configure.php file

Share this post


Link to post
Share on other sites
If includes/languages/english/faq.php exists, then check your admin/includes/configure.php file

 

Thank you for your reply. Not sure what I'm looking for here. Yes, I've uploaded all the files that came with the contribution.

:huh:

Share this post


Link to post
Share on other sites
Thank you for your reply. Not sure what I'm looking for here. Yes, I've uploaded all the files that came with the contribution.

:huh:

Check the configure.php for the catalog defines.

Share this post


Link to post
Share on other sites

Hello i have installed the newest version of this contribution. And now my information box has disappeared. well its there but the contents aren't. any idea which php file i should be checking?

 

I'm a n00b.

Share this post


Link to post
Share on other sites
Hello i have installed the newest version of this contribution. And now my information box has disappeared. well its there but the contents aren't. any idea which php file i should be checking?

 

I'm a n00b.

You should now have two information boxes.

Share this post


Link to post
Share on other sites

hi, does any one know how to change the code in order to use FCK HTML Editor with this FAQ System?

 

Also, is it possible to make the "answer" to appear at the popup window?

 

Thank you!

Share this post


Link to post
Share on other sites

I wonder if anyone can help me, I've installed this and it appears to work, I just don't get any link in my info box on the site!

 

Here's the code from catalog/includes/boxes/information.php

 

?>
<!-- information //-->
         <tr>
           <td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_INFORMATION);

 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');
                       // FAQ SYSTEM 2.1
                                        '<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' ; 
                       // FAQ SYSTEM 2.1

 new infoBox($info_box_contents);
?>

 

I find that I HAVE to remove the ) from the line which originally looked like this,

 

'<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>');

 

or I get an error message stating

 

Parse error: syntax error, unexpected ')' in C:\xampp\htdocs\oscommerce\catalog\includes\boxes\information.php on line 28

 

either way I don't get a link on the site :(

 

Any suggestions?

 

Thanks

Share this post


Link to post
Share on other sites

I wonder if anyone can help me, I've installed this and it appears to work, I just don't get any link in my info box on the site!

 

Here's the code from catalog/includes/boxes/information.php

 

?>
<!-- information //-->
         <tr>
           <td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('text' => BOX_HEADING_INFORMATION);

 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . BOX_INFORMATION_PRIVACY . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . BOX_INFORMATION_CONDITIONS . '</a><br>' .
                                        '<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>');
                       // FAQ SYSTEM 2.1
                                        '<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>' ; 
                       // FAQ SYSTEM 2.1

 new infoBox($info_box_contents);
?>

 

I find that I HAVE to remove the ) from the line which originally looked like this,

 

'<a href="' . tep_href_link(FILENAME_FAQ) . '">' . BOX_INFORMATION_FAQ . '</a><br>');

 

or I get an error message stating

 

Parse error: syntax error, unexpected ')' in C:\xampp\htdocs\oscommerce\catalog\includes\boxes\information.php on line 28

 

either way I don't get a link on the site :(

 

Any suggestions?

 

Thanks

 

 

Sorted! Basic syntax error.....my mistake.

Edited by darqawi

Share this post


Link to post
Share on other sites

Hi Guys,

I installed FAQ System 3.1 and I'm getting an error in catalog/faq.php

 

Here:

 

1146 - Table 'basket_giftbasket.TABLE_FAQ' doesn't exist

 

SELECT faq_id, question FROM TABLE_FAQ WHERE visible='1' and language='english' ORDER BY v_order

 

[TEP STOP]

 

It seems like there is no faq table in db? I don't know, db is not my forte,,,

Just for the record,

I did execute the sql file that was included in the package.

 

Thanks in advance,,,,

 

Ronnie

Share this post


Link to post
Share on other sites

Hi Guys,

I installed FAQ System 3.1 and I'm getting an error in catalog/faq.php

 

Here:

 

1146 - Table 'basket_giftbasket.TABLE_FAQ' doesn't exist

 

SELECT faq_id, question FROM TABLE_FAQ WHERE visible='1' and language='english' ORDER BY v_order

 

[TEP STOP]

 

It seems like there is no faq table in db? I don't know, db is not my forte,,,

Just for the record,

I did execute the sql file that was included in the package.

 

Thanks in advance,,,,

 

Ronnie

You can check in phpmyadmin if the table faq has been created.

Share this post


Link to post
Share on other sites

You can check in phpmyadmin if the table faq has been created.

 

Yep, it's there... I do notice something odd...

 

 

faq_id tinyint(3) UNSIGNED No auto_increment

&

v_order tinyint(3) UNSIGNED No 0

 

They both have "UNSIGNED" under the Attributes column...

 

I have no clue when it comes to DB, I stay away as much as I can from MyphpAdmin.

 

Thanks,

Ronnie

Share this post


Link to post
Share on other sites

i hope this thread still alive,

 

i'm using FAQ 3.1 and already running and have 34 data (question and answer) in it, and suddently now when i want to insert a new "faq data" the FAQ System doesn't give any respon. I try edit the old data, the FAQ System doesn't give any respon too, its all same with delete, active, and deactive function. Its seems the FAQ System suddently "dead", i cann't do anything.

 

I try to reinstall/resetup the FAQ System (except the database, because i don't want loose my old data) but it doesn't help.

 

anyone here can tell what should i do?

 

thanks before

Share this post


Link to post
Share on other sites

i hope this thread still alive,

 

i'm using FAQ 3.1 and already running and have 34 data (question and answer) in it, and suddently now when i want to insert a new "faq data" the FAQ System doesn't give any respon. I try edit the old data, the FAQ System doesn't give any respon too, its all same with delete, active, and deactive function. Its seems the FAQ System suddently "dead", i cann't do anything.

 

I try to reinstall/resetup the FAQ System (except the database, because i don't want loose my old data) but it doesn't help.

 

anyone here can tell what should i do?

 

thanks before

 

thanks GOD... my problem fixed with "trabi" solution (http://addons.oscommerce.com/info/1948)

 

thanks....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0