Danny74 Posted April 25, 2009 Posted April 25, 2009 I'm getting this error on some of my products on the product information page: Warning: implode() [function.implode]: Invalid arguments passed in /home/danny/public_html/includes/functions/general.php on line 239 How can I solve this, as it is clustering around my buttons? Thanks!
spooks Posted April 26, 2009 Posted April 26, 2009 you are passing invalid parameters u need to post the code from product info for anyone to have any idea what. Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al.
NickTheMonkey Posted February 1, 2010 Posted February 1, 2010 I too am having the same problem although it is only present in the shopping cart, so I am not sure if its possible to recreate it via one link. On investigating it more it seems that it is only there when you add items to your cart, then log in and go to checkout straight away. Warning: implode() [function.implode]: Invalid arguments passed in /home/thehells/public_html/includes/functions/general.php on line 239';/' The section of code around the button in question is <?php $back = sizeof($navigation->path)-3; if (isset($navigation->path[$back])) { ?> <td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td> <?php } else { ?> <td class="main"> <?php $referer = $_SERVER['HTTP_REFERER']; if (!$referer == '') { echo '<a href="' . $referer . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_BACK) . '</a>'; } else { echo '<a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_path($current_category_id = '')) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_BACK) . '</a>'; } ?></td>
NickTheMonkey Posted February 1, 2010 Posted February 1, 2010 I have sorted my problem, it was down to my SSL certificate and the settings I put in the configure files. First : I needed to force the SSL certificate to run on the whole site http://www.besthostratings.com/articles/force-ssl-htaccess.html Second : Then I set all the locations in the /includes/configure.php files to include the s in httpS:// I followed the instructions on installing an SSL from here http://www.oscommerce.com/forums/index.php?showtopic=151162 So the code containing direct web addresses became define('HTTP_SERVER', 'httpS://www.yourdomain.com'); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', 'https://yourdomain.com'); // eg, https://localhost - should not be empty for productive servers and define('HTTP_SERVER', 'httpS://www.yourdomain.com'); // eg, http://localhost - should not be empty for productive servers define('HTTP_CATALOG_SERVER', 'httpS://www.yourdomain.com'); define('HTTPS_CATALOG_SERVER', 'https://yourdomain.com');
Pelvis Posted February 7, 2010 Posted February 7, 2010 I'm getting this error on some of my products on the product information page: Warning: implode() [function.implode]: Invalid arguments passed in /home/danny/public_html/includes/functions/general.php on line 239 How can I solve this, as it is clustering around my buttons? Thanks! Replace the function in general.php from lines (206-243) with this function: //// // Generate a path to categories function tep_get_path($current_category_id = '') { global $cPath_array; if (tep_not_null($current_category_id)) { $cp_size = sizeof($cPath_array); if ($cp_size == 0) { $cPath_new = $current_category_id; } else { $cPath_new = ''; $last_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$cPath_array[($cp_size-1)] . "'"); $last_category = tep_db_fetch_array($last_category_query); $current_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $current_category = tep_db_fetch_array($current_category_query); if ($last_category['parent_id'] == $current_category['parent_id']) { for ($i=0; $i<($cp_size-1); $i++) { $cPath_new .= '_' . $cPath_array[$i]; } } else { for ($i=0; $i<$cp_size; $i++) { $cPath_new .= '_' . $cPath_array[$i]; } } $cPath_new .= '_' . $current_category_id; if (substr($cPath_new, 0, 1) == '_') { $cPath_new = substr($cPath_new, 1); } } } else { // Sanity check on $cPath_array if ( is_array($cPath_array) && !empty($cPath_array) ){ $cPath_new = implode('_', $cPath_array); } else { // OK..$cPath_array is either not set or is empty // Declare $current_category_id global so we bring it into local scope global $current_category_id; // Switch on the value, will always be set even if zero switch($current_category_id){ case '0': return ''; break; default: $cPath_new = $current_category_id; break; } # end switch } # end else sanity check } # end tep_not_null check return 'cPath=' . $cPath_new; } # end of function
taiji2078 Posted June 11, 2010 Posted June 11, 2010 Tested the code above on my live site and I confirm it's working perfectly. This is an OSCommerce bug, as I have this in my errorlog since I uploaded the site on my hosting server ... didn't care much to check it, but once I've installed the great contribution from TiM ([TiM's osC Solutions] Cached image thumbnails) I have noticed one error from him (that was nicely and fast fixed) and along with that the implode error described above. Now everything is fixed and working faster & great, w/o errors at all. You should all check your error logs from time to time, even if you don't have any visible problems with your site. BTW, this code didn't change anything on my Google indexed pages. Every links it's working just like before the change, and no 404 errors from mr.G ... this if you worry about loosing indexed pages because of this fix. This should be implemented by every template user. Thank you for sharing this code with us mr. Pelvis (funny name btw :)) I'm a doctor irl) ! @danny: try to avoid in later posts sharing your root path, because it contains your cpanel account name and it's a vulnerability risk. Some bad persons could exploit this, even if you didn't say your website name here. Make sure you edit your post or avoid saying your www in other posts.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.