Latest News: (loading..)

insomniac2

Members
  • Content count

    406
  • Joined

  • Last visited

1 Follower

About insomniac2

Profile Information

  1. raja9983 ... Sounds like your missing the password_funcs in the admin/includes/functions directory from the Admin Access Mod. You need to put the password_funcs.php in that directory so the path will look like this: admin/includes/functions/password_funcs.php The code inside the password_funcs.php file should be: <?php /* $Id: password_funcs.php,v 1.10 2003/02/11 01:31:02 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License Access with Level Account (v. 2.2a) for the Admin Area of osCommerce (MS2) This file may be deleted if disabling the above contribution */ //// // This function compares a plain text password with an encrpyted password function tep_validate_password($plain, $encrypted) { if (tep_not_null($plain) && tep_not_null($encrypted)) { // split apart the hash / salt $stack = explode(':', $encrypted); if (sizeof($stack) != 2) return false; if (md5($stack[1] . $plain) == $stack[0]) { return true; } } return false; } //// // This function makes a new encrypted password from a plain text password. function tep_encrypt_password($plain) { $password = ''; for ($i=0; $i<10; $i++) { $password .= tep_rand(); } $salt = substr(md5($password), 0, 2); $password = md5($salt . $plain) . ':' . $salt; return $password; } ?> Once you have done that your password validation error should go away .... then you can go from there and see what happens. Hope this helps.
  2. That has to be done in each specific shipping module you are using by adding custom code to the weight output. For example: catalog/includes/modules/shipping/zones.php by using the round function an example piece of the code would be: if ($shipping_weight != 1) { $shipping_method .= (round($shipping_weight, 2)) . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS . 's'; } else { $shipping_method .= (round($shipping_weight, 2)) . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS; } Essentially if the weight is not equal to 1 or less it will be a multiple so adds an s ie:lbs Or else it is singular and will display only lb It may be able to be done an easier way .. but this is how I did it by adding the code to each module. As you probably already know ... the new osCommerce will have a shipping weight class incorporated ... so you may want to wait for it's release before you go recoding a lot of stuff.
  3. Danitrin ... could you please send / message me your code. I will work off of your copy. Somethings serverly screwed in mine LOL. Thanks. Oh and P.S. Did you do the database modification? ... or are you using the original SQL.
  4. Glad to hear it works for you danitrin. I still have one issue I am trying to resolve. I have spent hours and can't figure it out LOL You know how the proper product now shows up with it's associated document right? Well now my associated documents choice list is not defaulting to the document that is currently associated to the product. It always opens with the same document .. sorta like in alphabetical order or something. Is yours doing this to? I am now trying to get the document that is associated to the product to show up instantly on the list .. but it's driving me nuts LOL please get back to me on this one. If your is working properly I would like to see your code to compare to mine. Thanx.
  5. Sorry took so long to reply to your question azer. Yes I guess that does make sense to do the language bolding that way. I never thought of that. As for the onmouseevent effecting Admin Access. Basically some or most of the admin files have a command like 'action=edit' in the mouseevent section. I did a test and noticed that these commands were oeveriding Admin Access Rights .. because Admin Access only explains and has the code for controlling Admin Buttons like the Edit button in categories.php etc. The current contribution code does not prevent the onmouseclick actions .. only the buttons .. unless you custom code like I have been slowly doing and I`ve taken out all the '&action=edit' etc. Now when someone doubleclicks on a line it does nothing for them. They have to use the Buttons. Hope this makes some sense to you. yes i know that , but would be better to do it on the code page ot in the language , so if 5 language 5 times less work would be maybe next release :-)
  6. OK got it fixed now to show proper product you are editing. FIND approximate lines 337 to 360 which read: <?php $documents = "select d.documents_description, d.documents_id, dc.documents_products_id, pd.products_name FROM " . TABLE_DOCUMENTS_PRODUCTS . " dc LEFT JOIN " . TABLE_DOCUMENTS . " d ON dc.documents_id = d.documents_id LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON dc.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by dc.documents_products_id"; $next_id = 1; $documents = tep_db_query($documents); while ($document_details = tep_db_fetch_array($documents)) { ?> <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>"> <?php if (($action == 'update_document') && ($HTTP_GET_VARS['documents_products_id'] == $document_details['documents_products_id'])) { ?> <td class="smallText"> <?php echo $document_details['documents_products_id']; ?><input type="hidden" name="documents_products_id" value="<?php echo $document_details['documents_products_id']; ?>"> </td> <td class="smallText"> <select name="products_id"> <?php $products = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . $languages_id . "' order by pd.products_name"); while($products_values = tep_db_fetch_array($products)) { if ($document_details['products_id'] == $products_values['products_id']) { echo "\n" . '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '" SELECTED>' . $products_values['products_name'] . '</option>'; } else { echo "\n" . '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '">' . $products_values['products_name'] . '</option>'; } } ?> AND REPLACE the WHOLE SECTION with: <?php $documents = "select d.documents_description, d.documents_id, dc.documents_products_id, pd.products_name from " . TABLE_DOCUMENTS_PRODUCTS . " dc left join " . TABLE_DOCUMENTS . " d on dc.documents_id = d.documents_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on dc.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by dc.documents_products_id"; $next_id = 1; $documents = tep_db_query($documents); while ($document_details = tep_db_fetch_array($documents)) { ?> <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>"> <?php if (($action == 'update_document') && ($_GET['documents_products_id'] == $document_details['documents_products_id'])) { ?> <td class="smallText" align="right"> <?php echo $document_details['documents_products_id']; ?><input type="hidden" name="documents_products_id" value="<?php echo $document_details['documents_products_id']; ?>"></td> <td class="smallText"> <select name="products_id"> <?php $products = tep_db_query("select d.documents_description, d.documents_id, dc.documents_products_id, pd.products_name from " . TABLE_DOCUMENTS_PRODUCTS . " dc left join " . TABLE_DOCUMENTS . " d on dc.documents_id = d.documents_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on dc.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by dc.documents_products_id"); while($products_values = tep_db_fetch_array($products)) { if ($_GET['documents_products_id'] == $products_values['documents_products_id']) { echo "\n" . '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '" SELECTED>' . $products_values['products_name'] . '</option>'; } else { echo "\n" . '<option name="' . $products_values['products_name'] . '" value="' . $products_values['products_id'] . '">' . $products_values['products_name'] . '</option>'; } } ?> If that doesn't work for you you may have to alter the table DOCUMENTS to this: DROP TABLE IF EXISTS documents; CREATE TABLE documents ( documents_id int(11) NOT NULL auto_increment, language_id int DEFAULT '1' NOT NULL, documents_description varchar(128) default NULL, documents_file_name varchar(64) default NULL, documents_file_size int(11) default NULL, PRIMARY KEY (documents_id, language_id), KEY idx_documents_file_name (documents_file_name) ); I have reformed the table for the future incorporation of languages. I am looking at the products extra fields contribution and it has the code I need to do this eventually.
  7. Sorry IGNORE THAT LAST POST. It seems that this whole file is not correctly using languages. When I added a new document it added the file to all the products in all languages .. so now I have listed 3 documents for each product. One document for each language. I will try to look into it. I think when inputing a new file code needs to be added to specify which language the document is in. This will also require adding the language_id field to the TABLE_DOCUMENTS_PRODUCTS and TABLE_DOCUMENTS .. which could lead to some work .. LOL
  8. There is also an incorrect query which does not pull the proper product that you are working on when you do an edit. This will fix the problem by selecting the current product you are working on for you. Find Around line 339: $documents = "select d.documents_description, d.documents_id, dc.documents_products_id, pd.products_name from " . TABLE_DOCUMENTS_PRODUCTS . " dc left join " . TABLE_DOCUMENTS . " d on dc.documents_id = d.documents_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on dc.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by dc.documents_products_id"; REPLACE WITH: $documents = "select d.documents_description, d.documents_id, dc.products_id, dc.documents_products_id, pd.products_id, pd.products_name from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id left join " . TABLE_DOCUMENTS_PRODUCTS . " dc on dc.products_id = pd.products_id LEFT JOIN " . TABLE_DOCUMENTS . " d ON dc.documents_id = dc.documents_id where dc.products_id = pd.products_id and pd.products_id = p.products_id and dc.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'";
  9. Around Line 363 FIND: <?php $files = tep_db_query("select documents_id, documents_description from " . TABLE_DOCUMENTS . ""); while($file_details = tep_db_fetch_array($files)) { if ($document_details['documents_id'] == $file_details['documents_id']) { echo "\n" . '<option name="' . $file_details['documents_description'] . '" value="' . $file_details['documents_id'] . '" SELECTED>' . $file_details['documents_description'] . '</option>'; } else { echo "\n" . '<option name="' . $file_details['documents_description'] . '" value="' . $file_details['documents_id'] . '">' . $file_details['documents_description'] . '</option>'; } } ?> CHANGE TO: <?php $files = tep_db_query("select documents_id, documents_file_name, documents_description from " . TABLE_DOCUMENTS . ""); while($file_details = tep_db_fetch_array($files)) { if ($document_details['documents_id'] == $file_details['documents_id']) { echo "\n" . '<option name="' . $file_details['documents_file_name'] . ' - [ ' . $file_details['documents_description'] . ' ]" value="' . $file_details['documents_id'] . '" SELECTED>' . $file_details['documents_file_name'] . ' - [ ' . $file_details['documents_description'] . ' ]</option>'; } else { echo "\n" . '<option name="' . $file_details['documents_file_name'] . ' - [ ' . $file_details['documents_description'] . ' ]" value="' . $file_details['documents_file_name'] . ' - [ ' . $file_details['documents_description'] . ' ]">' . $file_details['documents_description'] . '</option>'; } } ?> Also around Line 414 FIND: <?php $files = tep_db_query("select * from " . TABLE_DOCUMENTS . " order by documents_file_name"); while ($file_details = tep_db_fetch_array($files)) { echo '<option name="' . $file_details['documents_description'] . '" value="' . $file_details['documents_id'] . '">' . $file_details['documents_description'] . '</option>'; } ?> CHANGE TO: <?php $files = tep_db_query("select * from " . TABLE_DOCUMENTS . " order by documents_file_name"); while ($file_details = tep_db_fetch_array($files)) { echo '<option name="' . $file_details['documents_file_name'] . ' - [ ' . $file_details['documents_description'] . ' ]" value="' . $file_details['documents_id'] . '">' . $file_details['documents_file_name'] . ' - [ ' . $file_details['documents_description'] . ' ]</option>'; } ?> This will show you the documents actual download file and after the description you have given it in admin.
  10. To correct time: FIND line 21: $today = date("d/m/Y"); CHANGE TO: $today = now(); ------------------------------------------------------- TO CORRECT SEARCH QUERY: REPLACE: $keywords = " o.orders_id like '%" . $keywords . "%' or o.orders_id like '%" . $keywords . "%' or o.customers_name like '%" . $keywords . "%' or o.customers_id like '%" . $keywords . "%' or o.customers_id like '%" . $keywords . "%' or o.customers_company like '%" . $keywords . "%' or o.customers_street_address like '%" . $keywords . "%' or o.customers_suburb like '%" . $keywords . "%' or o.customers_city like '%" . $keywords . "%' or o.customers_postcode like '%" . $keywords . "%' or o.customers_state like '%" . $keywords . "%' or o.customers_country like '%" . $keywords . "%' or o.customers_telephone like '%" . $keywords . "%' or o.customers_email_address like '%" . $keywords . "%' or o.delivery_name like '%" . $keywords . "%' or o.delivery_company like '%" . $keywords . "%' or o.delivery_street_address like '%" . $keywords . "%' or o.delivery_suburb like '%" . $keywords . "%' or o.delivery_city like '%" . $keywords . "%' or o.delivery_postcode like '%" . $keywords . "%' or o.delivery_state like '%" . $keywords . "%' or o.delivery_country like '%" . $keywords . "%' or o.billing_name like '%" . $keywords . "%' or o.billing_company like '%" . $keywords . "%' or o.billing_street_address like '%" . $keywords . "%' or o.billing_suburb like '%" . $keywords . "%' or o.billing_city like '%" . $keywords . "%' or o.billing_postcode like '%" . $keywords . "%' or o.billing_state like '%" . $keywords . "%' or o.billing_country like '%" . $keywords . "%' o.payment_method like '%" . $keywords . "%' or o.cc_number like '%" . $keywords . "%' "; WITH: $keywords = "o.orders_id like '%" . $keywords . "%' or o.customers_name like '%" . $keywords . "%' or o.customers_id like '%" . $keywords . "%' or o.customers_company like '%" . $keywords . "%' or o.customers_street_address like '%" . $keywords . "%' or o.customers_suburb like '%" . $keywords . "%' or o.customers_city like '%" . $keywords . "%' or o.customers_postcode like '%" . $keywords . "%' or o.customers_state like '%" . $keywords . "%' or o.customers_country like '%" . $keywords . "%' or o.customers_telephone like '%" . $keywords . "%' or o.customers_email_address like '%" . $keywords . "%' or o.delivery_name like '%" . $keywords . "%' or o.delivery_company like '%" . $keywords . "%' or o.delivery_street_address like '%" . $keywords . "%' or o.delivery_suburb like '%" . $keywords . "%' or o.delivery_city like '%" . $keywords . "%' or o.delivery_postcode like '%" . $keywords . "%' or o.delivery_state like '%" . $keywords . "%' or o.delivery_country like '%" . $keywords . "%' or o.billing_name like '%" . $keywords . "%' or o.billing_company like '%" . $keywords . "%' or o.billing_street_address like '%" . $keywords . "%' or o.billing_suburb like '%" . $keywords . "%' or o.billing_city like '%" . $keywords . "%' or o.billing_postcode like '%" . $keywords . "%' or o.billing_state like '%" . $keywords . "%' or o.billing_country like '%" . $keywords . "%' or o.payment_method like '%" . $keywords . "%' or o.cc_number like '%" . $keywords . "%' "; ---------------------------------- As for a customers who bought a product filter .. I will see what I can do. Thanks for alerting me of the glitches.
  11. Yes I tried php5 to and ran into tons of problems. Unfortunately a lot of the mods available are incompatable with the way php handles database and code variables. Just stick with php 4. If it works!! Don't fix it!! I say LOL
  12. Sorry .. I still left some custom fields I use in the code. I took the billing_telephone and delivery_telephone out. You can download the 5.1b corrected version now. Let me know if that works for you. Link: http://www.oscommerce.com/community/contributions,1836
  13. Since you can't find the original contrib .. they are all pretty much the same. You can use this code. You need to add this case near the top of your orders.php with the other cases: Change all cases below of cvvnumber to whatever your orders.php $HTTP_POST_VARS cvv number value is. case 'deletecc_cvv': $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); $cvvnumber = tep_db_prepare_input ($HTTP_POST_VARS['cvvnumber']); tep_db_query("update " . TABLE_ORDERS . " set cvvnumber = null " . tep_db_input($cvvnumber) . " where orders_id = '" . tep_db_input($oID) . "'"); $order_updated = true; if ($order_updated) { $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success'); } else { $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning'); } tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit')); break;
  14. You should be able to get it from one of the previous releases. Heres the code anyway: <?php // Code: categories_description // Author: Brian Lowe <blowe@wpcusrgrp.org> // Date: June 2002 // // Contains code snippets for the categories_description contribution to // osCommerce. // Code: categories_description MS2 1.5 // Editor: Lord Illicious <shaolin-venoms@illicious.net> // Date: July 2003 // // Get a category heading_title or description // These should probably be in admin/includes/functions/general.php, but since // this is a contribution and not part of the base code, they are here instead function tep_get_category_heading_title($category_id, $language_id) { $category_query = tep_db_query("select categories_heading_title from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'"); $category = tep_db_fetch_array($category_query); return $category['categories_heading_title']; } function tep_get_category_description($category_id, $language_id) { $category_query = tep_db_query("select categories_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$category_id . "' and language_id = '" . (int)$language_id . "'"); $category = tep_db_fetch_array($category_query); return $category['categories_description']; } ?>
  15. You should be a able to see any items in carts by using the Admin Who's Online Tool.