Guest Posted May 16, 2014 Share Posted May 16, 2014 (edited) MWNNVA79, Haven't been around for a while, but I'm back for a visit :thumbsup: If you're going to do this, back the site up first...Just in case I had the same problems when I installed this onto my site too. It looks like it's because the database has changed with the last few editions of OSCommerce, and the code in this offering hasn't been updated to make it compatible. You'll have to make these changes for it to work. All three of the main admin files need changing and a few of the sales ones too. open admin\builder_catagories.php at line 23 change this // create tables if they dont exist --------------------------- if (mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))==1) { to this // create tables if they dont exist --------------------------- if (tep_db_num_rows(tep_db_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))==1) { then line 166-168 from this } else { if (mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))!=1) { tep_redirect(tep_href_link(FILENAME_BUILDER_OPTIONS)); } to this } else { if (tep_db_num_rows(tep_db_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))!=1) { tep_redirect(tep_href_link(FILENAME_BUILDER_OPTIONS)); then another at 190 // be sure the tables already exist if( mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . TABLE_BUILDER_CATEGORIES. "'"))==1) { change to this // be sure the tables already exist if(tep_db_num_rows(tep_db_query("SHOW TABLES LIKE '" . TABLE_BUILDER_CATEGORIES. "'"))==1) { Save the file and open this one..admin\builder_dependences.php at line 16 you'll find this line if (mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))!=1) { tep_redirect(tep_href_link(FILENAME_BUILDER_OPTIONS)); } change it to this if (tep_db_num_rows(tep_db_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))!=1) { tep_redirect(tep_href_link(FILENAME_BUILDER_OPTIONS)); } Ok that's the only instance of the error in this file save and then close the file and open the last admin file. admin\builder_options.php go to line 22 where you'll find this // create tables if they dont exist --------------------------- if (mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))!=1) { change it to this // create tables if they dont exist --------------------------- if (tep_db_num_rows(tep_db_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))!=1) { the goto line 551 and find this // be sure the tables already exist if( mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))==1) { change it for this // be sure the tables already exist if(tep_db_num_rows(tep_db_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))==1) { now goto line 667-669 and find this <?php if (mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))!=1) { ?> change it to this <?php if (tep_db_num_rows(tep_db_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))!=1) { ?> That's it for the admin section. Basically just exchanging the internal tep_db_num_rows(tep_db_query for the mysql_num_rows(mysql_query You'll have to make these changes in the cataloge half of your shop also. Files effected are builder_main.php, at line 24 in builder_product_info.php at line 18 and builder_product_list.php at line 22. One word of caution, if you've already put the database onto the server (pressed the update button), and got the green bar at the top of the screen AND the red bar saying the tables still don't exist. Then clicked update for a second time, you'll get an error message saying "this row already exists in the database" and the php will stop, this will also actually delete your other two database tables (builder_categories and builder_dependences), and it won't work properly, Unless you either manually put these back in or delete the builder_options tables and start from scratch. Best way to do this is go into myphpadmin and drop the row called builder_options (don't touch anything else or you may break the site!), then you should be back at the red war saying that the database tables don't exist.. Hope this helps.... Edited May 16, 2014 by Nefandous Quote Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2014 Share Posted May 16, 2014 (edited) Well it seems I can't edit the above to make more sense. Hopefully if you need to use it, you get it! ;) Should make this work with oscommerce 2.3.3.4 and higher after changing it. Edited May 16, 2014 by Nefandous Quote Link to comment Share on other sites More sharing options...
dynamok Posted May 27, 2014 Share Posted May 27, 2014 Can you guys post a few snapshots of how this module looks? Quote Link to comment Share on other sites More sharing options...
RS Designs Posted May 31, 2014 Share Posted May 31, 2014 (edited) @@Nefandous Hello, I have done everything you have listed above and it seems to be starting to work now but still got a few errors, Could you help me out. I will attach the error and the code from the file (Also will highlight the line of code which is causing the problem. Here they are: #1 ( ! ) Deprecated: Function split() is deprecated in C:\wamp\www\store\catalog\admin\builder_options.php on line 813 Call Stack # Time Memory Function Location 1 0.0020 703808 {main}( ) ..\builder_options.php:0 <?php $the_files_array = Array(); $handle = opendir(DIR_FS_CATALOG . DIR_WS_IMAGES); while (false!== ($file = readdir($handle))) { if ($file!= "." && $file!= ".." &&!is_dir($file)) { $namearr = split('\.',$file); if (($namearr[count($namearr)-1] == 'gif') || ($namearr[count($namearr)-1] == 'jpg') || ($namearr[count($namearr)-1] == 'png')) { $the_files_array[] = array( 'text' => $file, 'id' => $file); } } } #2 ( ! ) Deprecated: Function split() is deprecated in C:\wamp\www\store\catalog\admin\builder_options.php on line 937 Call Stack # Time Memory Function Location 1 0.0020 703808 {main}( ) ..\builder_options.php:0 <?php $the_files_array = Array(); $handle = opendir(DIR_FS_CATALOG . DIR_WS_IMAGES . $cpb_category_images_folder); while (false!== ($file = readdir($handle))) { if ($file!= "." && $file!= ".." &&!is_dir($file)) { $namearr = split('\.',$file); if (($namearr[count($namearr)-1] == 'gif') || ($namearr[count($namearr)-1] == 'jpg') || ($namearr[count($namearr)-1] == 'png')) { $the_files_array[] = array( 'text' => $file, 'id' => $file); } } } #3 ( ! ) Deprecated: Function split() is deprecated in C:\wamp\www\store\catalog\admin\builder_options.php on line 1463 Call Stack # Time Memory Function Location 1 0.0020 703808 {main}( ) ..\builder_options.php:0 <?php $the_files_array = Array(); $handle = opendir(DIR_FS_CATALOG . DIR_WS_IMAGES . $cpb_product_images_folder); while (false!== ($file = readdir($handle))) { if ($file!= "." && $file!= ".." &&!is_dir($file)) { $namearr = split('\.',$file); if (($namearr[count($namearr)-1] == 'gif') || ($namearr[count($namearr)-1] == 'jpg') || ($namearr[count($namearr)-1] == 'png')) { $the_files_array[] = array( 'text' => $file, 'id' => $file); } } } I noticed that is seems to be the same line but do not know how to fix it. Line: $namearr = split('\.',$file); Edited May 31, 2014 by RS Designs Quote Link to comment Share on other sites More sharing options...
RS Designs Posted May 31, 2014 Share Posted May 31, 2014 @@dynamok Here is a picture of the errors I am getting (Note I did combine them into one picture) Quote Link to comment Share on other sites More sharing options...
burt Posted May 31, 2014 Share Posted May 31, 2014 The split problem has been covered many times in the past. Google Quote Link to comment Share on other sites More sharing options...
RS Designs Posted May 31, 2014 Share Posted May 31, 2014 @@burt Hello, You are correct that it has been looked at a bunch before but can not seem to find one to fix this problem. Here is the split line of test: $namearr = split('\.',$file); Do you know what I should change it too Quote Link to comment Share on other sites More sharing options...
Guest Posted June 3, 2014 Share Posted June 3, 2014 @@RS Designs On the newer version of PHP "split" is no longer used and split_preg is used instead. Haven't tried it, but should work if you change the above to $namearr = split_preg('\.',$file); Just another thing that needed to be updated. I'll take a look later to see if it's right. :) Quote Link to comment Share on other sites More sharing options...
Guest Posted June 4, 2014 Share Posted June 4, 2014 Ooops Sorry just realised, I put that on backwards...ignore that, it should be... $namearr = preg_split('\.',$file); Embarrassing :blush: Quote Link to comment Share on other sites More sharing options...
RS Designs Posted June 4, 2014 Share Posted June 4, 2014 @@Nefandous Thank you for the response but it does not work either. All 5 errors are still there and now they have a second line. (See picture) Here is a pastebin of the builders categories file: http://pastebin.com/m0Zhb6gE Here is a pastebin of the builders option file: http://pastebin.com/h3xkw5cp I don't understand why I isn't working and do not know enough about the code to be able to fix it. any help is greatly appreciated. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 4, 2014 Share Posted June 4, 2014 That's because I got the syntax wrong...here's the real working one...sorry for that :- $namearr = preg_split('/\./',$file); And this works. I didn't have a chance to try it till now. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 4, 2014 Share Posted June 4, 2014 (edited) The reason it didn't work is that preg_split has changed from split, with the syntax it uses to split each file. this particular function is splitting graphics file names so they'll show in a pull down menu. It would work, but you'll get errors thrown back at you. What used to be $whatever = split('\.', $file) to $whatever = preg_split('/\./', $file) So this worked till split was deprecated... Edited June 4, 2014 by Nefandous Quote Link to comment Share on other sites More sharing options...
Guest Posted June 4, 2014 Share Posted June 4, 2014 Just found another error in the bm_builder.php found in Catalog/includes/modules/boxes. And it's another MySQL change at line 38 should be if(tep_db_num_rows(tep_db_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))==1) { rather than the line that's there. Quote Link to comment Share on other sites More sharing options...
RS Designs Posted June 4, 2014 Share Posted June 4, 2014 @@Nefandous You my sir are a life saver :) Thank you. Quote Link to comment Share on other sites More sharing options...
RS Designs Posted June 4, 2014 Share Posted June 4, 2014 @@Nefandous Ok, I might have spoken a little to soon. Everything seems to be working now BUT when I enable the builder the button never shows up on my website. Everything says it is enable but just no button..... Any ideas? Quote Link to comment Share on other sites More sharing options...
RS Designs Posted June 5, 2014 Share Posted June 5, 2014 @@Nefandous Ok, Starting to make some progress now. I did get the box to show up on the website now but when I click it nothing happens. just seems to refresh the page. Any thoughts? Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2014 Share Posted June 5, 2014 (edited) @@RS Designs It's not displaying the builder because there's another error with the code. In builder_main.php in your catalog. It's on line 24. And should read if (tep_db_num_rows(tep_db_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))==1) { rather than the lineif (mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))==1) { And the page displays correctly now. However, there may be another error in the code. When I put in the first component, it displays a database error. Will look into this when I have a little more time. Edited June 5, 2014 by Nefandous Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2014 Share Posted June 5, 2014 Yes. Worked it out. Look in builder_product_list.php in your catalog line 22 should read if (tep_db_num_rows(tep_db_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))==1) { I'll test it some more later just to make sure it's all working on every part. Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2014 Share Posted June 5, 2014 On the off chance there were any more of the same error. I found one more in builder_products_info.php at line 18. Should read if (tep_db_num_rows(tep_db_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))==1) { instead of if (mysql_num_rows(mysql_query("SHOW TABLES LIKE '" . TABLE_BUILDER_OPTIONS . "'"))==1) { That looks like the last instance of this error. I'll try it out later and see how it works... Quote Link to comment Share on other sites More sharing options...
Guest Posted June 5, 2014 Share Posted June 5, 2014 :P Maybe I should update this on the download so all the errors are fixed? :P Quote Link to comment Share on other sites More sharing options...
RS Designs Posted June 5, 2014 Share Posted June 5, 2014 @@Nefandous Thank you very much for fixing all the errors. Seems to all be working, Will keep testing it and keep you posted. Quote Link to comment Share on other sites More sharing options...
Aleman Jimmor Posted June 5, 2014 Share Posted June 5, 2014 Hi, i recently install the Custom Product Builder 2.3 on my Oscommerce 2.3.1 all was great, i configured the categories and the databases, apparently all right but when i go to the front end i don't see anything of the custom builder. What can i do for solve this ?? Thank you. Quote Link to comment Share on other sites More sharing options...
RS Designs Posted June 5, 2014 Share Posted June 5, 2014 @@Aleman Jimmor I had the same problem. Did you go into your admin- Modules tab, Boxes, Then the top right should say install module and it should be in there. Aleman Jimmor 1 Quote Link to comment Share on other sites More sharing options...
Aleman Jimmor Posted June 5, 2014 Share Posted June 5, 2014 @@Aleman Jimmor I had the same problem. Did you go into your admin- Modules tab, Boxes, Then the top right should say install module and it should be in there. Yeah!!! It WORKS!! @@RS Designs Thank You a lot!! You're the man. Quote Link to comment Share on other sites More sharing options...
RS Designs Posted June 5, 2014 Share Posted June 5, 2014 @@Nefandous Hello Sir, Well we are almost out of the woods. Everything seems to be working good except when you try to preview the order. I have attached a picture of the error I get. Also I am just using standard currency $0.00 (Canada) Nothing fancy or custom. 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.