srirahandcraft

Members
  • Content count

    42
  • Joined

  • Last visited

Community Reputation

0 Neutral

2 Followers

About srirahandcraft

  • Birthday 10/25/1972

Profile Information

  • Real Name
    Gerhard
  • Gender
    Male
  • Location
    Banglamung, Thailand

Contact Methods

  • Skype
    srirahandcraft1
  1. Hi ryder, I had the same problem and added the following line to the function: if ( is_null($link) ) { } So now the function looks like this: //Credit to surfalot (Run SQL Script) function qs_db_query($query, $link = 'db_link') { global $$link; if ( is_null($link) ) { return mysql_query($query, $$link); } } The warning has gone, but now i still have the problem that qsu isn't updating. When pushing the update button, it refreshes and gives the green message that the product has been updated. However database and file aren't updated. After refreshing, I still have the same information. I think this is part of the same problem. Some of the other funtions might have to be updated as well, but I don't know which ones and how to do it. I hope anyone can help with this. Thanks. Gerhard
  2. Hi Jim, I've just changed Documents manager to work with 2.3. Everything works fine except for one thing. The delete function for 'Document types' with files attached to them doesn't work. If I try to delete a Document type with files attached to it, I get the following message: Warning: unlink(E:/xampp/htdocs/document_manager/catalog/documents/brochures): No such file or directory in E:\xampp\htdocs\document_manager\catalog\admin\includes\functions\general.php on line 1127 Fatal error: Cannot use object of type mysqli_result as array in E:\xampp\htdocs\document_manager\catalog\admin\documents.php on line 121 Deleting empty Document types works and Deleting files in a Document type works perfectly. This is the part of the code from admin\documents.php including line 121 // Delete a document type case 'process_delete_type': if (isset ($_POST['type_name']) && $_POST['type_name'] != '') { tep_remove (DIR_FS_CATALOG_DOCUMENTS . $_POST['type_name']); } if (isset ($_POST['document_types_id']) && $_POST['document_types_id'] > 0) { $document_types_id = (int) $_POST['document_types_id']; $products_query_raw = " select documents_id from " . TABLE_DOCUMENTS . " where document_types_id = " . $document_types_id . " "; // print $products_query_raw . " \n"; $products_query = tep_db_query ($products_query_raw); while ($products_data = tep_db_fetch_array ($products_query)) { tep_db_query ("delete from " . TABLE_PRODUCTS_TO_DOCUMENTS . " where documents_id = '" . (int)$products_query['documents_id'] . "' "); } tep_db_query("delete from " . TABLE_DOCUMENTS . " where document_types_id = '" . $document_types_id . "' "); tep_db_query("delete from " . TABLE_DOCUMENT_TYPES . " where document_types_id = '" . $document_types_id . "' "); } tep_redirect (tep_href_link (FILENAME_DOCUMENTS, tep_get_all_get_params (array ('action','dt') ) ) ); break; Any ideas? Thanks, Gerhard
  3. Hi Jim, For the moment, I just copied the following line from catalog/product_reviews.php. tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif' and commented out the check box part in the file: catalog/includes/modules/product_reviews.php $rating = get_stars ($reviews['reviews_rating']); echo /*tep_draw_radio_field ('rating', '1', $rating[1], 'class="star-rating" disabled="disabled"') . ' ' . tep_draw_radio_field ('rating', '2', $rating[2], 'class="star-rating" disabled="disabled"') . ' ' . tep_draw_radio_field ('rating', '3', $rating[3], 'class="star-rating" disabled="disabled"') . ' ' . tep_draw_radio_field ('rating', '4', $rating[4], 'class="star-rating" disabled="disabled"') . ' ' . tep_draw_radio_field ('rating', '5', $rating[5], 'class="star-rating" disabled="disabled"') . */ ' ' . tep_image(DIR_WS_IMAGES . 'stars_' . $reviews['reviews_rating'] . '.gif') . This works. I have no idea how to fix the problem as I'm not a coder (still learning). Regards, Gerhard
  4. Hi Jim, I checked with Firebug and the code output looks OK. 3 different ratings. Sorry for the code, I tried to put it in a code block, but then the code doesn't show up. <td class="main"> <input class="star-rating" type="radio" disabled="disabled" checked="checked" value="1" name="rating"></input> <input class="star-rating" type="radio" disabled="disabled" checked="checked" value="2" name="rating"></input> <input class="star-rating" type="radio" disabled="disabled" checked="checked" value="3" name="rating"></input> <input class="star-rating" type="radio" disabled="disabled" checked="checked" value="4" name="rating"></input> <input class="star-rating" type="radio" disabled="disabled" checked="checked" value="5" name="rating"></input> </td> <td></td> </tr> <tr></tr> <tr> <td class="main"> <input class="star-rating" type="radio" disabled="disabled" checked="checked" value="1" name="rating"></input> <input class="star-rating" type="radio" disabled="disabled" value="2" name="rating"></input> <input class="star-rating" type="radio" disabled="disabled" value="3" name="rating"></input> <input class="star-rating" type="radio" disabled="disabled" value="4" name="rating"></input> <input class="star-rating" type="radio" disabled="disabled" value="5" name="rating"></input> </td> <td></td> </tr> <tr></tr> <tr> <td class="main"> <input class="star-rating" type="radio" disabled="disabled" checked="checked" value="1" name="rating"></input> <input class="star-rating" type="radio" disabled="disabled" checked="checked" value="2" name="rating"></input> <input class="star-rating" type="radio" disabled="disabled" checked="checked" value="3" name="rating"></input> <input class="star-rating" type="radio" disabled="disabled" value="4" name="rating"></input> <input class="star-rating" type="radio" disabled="disabled" value="5" name="rating"></input> </td> However it looks like it sees all of the check boxes as one set which means that only one check box can be checked, this is the rating of the first review given on the product. This is product related, it's the same for a new product, the first review rating shows up, the others don't. I'm not sure wether this is a jquery problem or not. Regards, Gerhard
  5. Hi Jim, At first, the review ratings didn't show up in the reviews tab. The code in the package was : tep_draw_radio_field ('rating', '2', $rating[2], 'class="star" disabled="disabled"'), I believe, this should be class="star-rating". After I changed this the ratings show up. file: catalog/includes/modules/product_reviews.php // Show product reviews ?> $rating = get_stars ($reviews['reviews_rating']); echo tep_draw_radio_field ('rating', '1', $rating[1], 'class="star-rating" disabled="disabled"') . ' ' . tep_draw_radio_field ('rating', '2', $rating[2], 'class="star-rating" disabled="disabled"') . ' ' . tep_draw_radio_field ('rating', '3', $rating[3], 'class="star-rating" disabled="disabled"') . ' ' . tep_draw_radio_field ('rating', '4', $rating[4], 'class="star-rating" disabled="disabled"') . ' ' . tep_draw_radio_field ('rating', '5', $rating[5], 'class="star-rating" disabled="disabled"') . ' ' . sprintf (TEXT_REVIEW_BY, tep_output_string_protected ($reviews['customers_name']) ) . ', ' . tep_date_long ($reviews['date_added']); ?> and $rating = get_stars ($rating); echo tep_draw_radio_field ('rating', '1', $rating[1], 'class="star-rating"') . ' ' . tep_draw_radio_field ('rating', '2', $rating[2], 'class="star-rating"') . ' ' . tep_draw_radio_field ('rating', '3', $rating[3], 'class="star-rating"') . ' ' . tep_draw_radio_field ('rating', '4', $rating[4], 'class="star-rating"') . ' ' . tep_draw_radio_field ('rating', '5', $rating[5], 'class="star-rating"'); ?> Now I've only got one problem left: - Adding reviews works perfectly. - After approval, reviews show up under the reviews tab, this works. - The review rating of the first review shows correctly, but the rating of additional reviews don't show up. The review picture (5 dots) shows, but no rating. This looks like an addition problem, right? Any idea what it could be? I appreciate your help. Regards, Gerhard
  6. <?php /* ================================================================================================================== AJAX-AttributeManager-for-osc2.3.1-V2 ================================================================================================================== Addons installed in this file: - Osc Version Upgrade from v2.3.3.1 to v2.3.3.2 ================================================================================================================== $Id: DB.class.php,v 1.0 21/02/06 Sam West$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Released under the GNU General Public License Copyright © 2006 Kangaroo Partners http://kangaroopartners.com osc@[member='KangarooPartners'].com */ /** * OSC Database functions wrapper - just in case they decide to release ms3 the moment i release this - he he */ class amDB { /** * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @package $strQuery sting - sql query string * @[member='Return'] query reference */ public static function query($strQuery) { return tep_db_query($strQuery); } /** * Fetches the next array from a mysql query reference * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $ref - referece from a mysql query * @[member='Return'] array */ public static function fetchArray($ref) { return tep_db_fetch_array($ref); } /** * Gets the field count from a mysql query reference * @[member='author'] Tomasz Iwanow aka TomaszBG - microvision@gmail.com * @[member='param'] $ref - referece from a mysql query * @[member='Return'] int - number of fields in result */ public static function numFields($ref) { return mysqli_field_count($ref); } /*function numFields($ref) { return mysql_num_fields($ref); } /** * Gets the field name from a mysql query reference * @[member='author'] Tomasz Iwanow aka TomaszBG - microvision@gmail.com * @[member='param'] $ref - referece from a mysql query * @[member='param'] $offset - offset of a field * @[member='Return'] string - name of the field */ public static function fieldName($ref,$offset) { return mysqli_fetch_field_direct($ref,$offset); } /*function fieldName($ref,$offset) { return mysql_field_name($ref,$offset); } /** * Counts the number of results from a mysql query referece * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $ref - reference from a mysql query * @[member='Return'] int - number of rows in result */ public static function numRows($ref) { return tep_db_num_rows($ref); } /** * peforms inserts / updates * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $strTable string tablename * @[member='param'] $arrData array data to be inserted/ updated * @[member='param'] $strAction sting - update / insert * @[member='param'] $strParams string additonal where clauses * @[member='Return'] void */ public static function perform($strTable,$arrData,$strAction='insert',$strParams='') { return tep_db_perform($strTable,$arrData,$strAction,$strParams); } /** * Returns a singular result from a mysql query * @[member='param'] $strQuery string - mysql query * @[member='Return'] mixed - first record, first row */ public static function getOne($strQuery) { $res = amDB::query($strQuery); if ($res && amDB::numRows($res)) return tep_db_result($res,0,0); return false; } /* function getOne($strQuery) { $res = amDB::query($strQuery); if ($res && amDB::numRows($res)) return mysql_result($res,0,0); return false; } /** * Returns all results from a mysql query * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $strQuery string - mysql query * @[member='Return'] array - all results */ public static function getAll($strQuery) { $res = amDB::query($strQuery); $results = array(); while($row = amDB::fetchArray($res)) $results[] = $row; return $results; } /** * Prepares string for database input * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $str string * @[member='Return'] void */ public static function input($str) { return tep_db_prepare_input($str); } /** * Returns placebo autoincrement value * @[member='access'] public * @[member='param'] $strTable string table name * @[member='param'] $strField string field name * @[member='Return'] mixed */ public static function getNextAutoValue($strTable,$strField) { return (int)amDB::getOne("select max($strField) + 1 as next from $strTable limit 1"); } /** * Some contributions such as the Ultimate SEO URLs have there own * database functions. This can cause the internal, last insert id to be * wrong if the link id isn't included in the mysql_insert_id statement. * For this reason i have not used the default osc function for this one as for some * reason they haven't put the link in their wrapper function. * @[member='author'] Sam West aka Nimmit - osc@[member='KangarooPartners'].com * @[member='param'] $link sting - db link name * @[member='Return'] void */ public static function insertId($link = 'db_link' ) { global $$link; return tep_db_insert_id($$link); } /* function insertId($link = 'db_link' ) { global $$link; return mysql_insert_id($$link); }*/ } ////////////////////////////////////////////////////////////////////////////////////////////////// if ( !function_exists('mysqli_field_count') ) { function mysqli_field_count($result) { return mysql_num_fields($result); } } if ( !function_exists('mysqli_fetch_field_direct') ) { function mysqli_fetch_field_direct($result, $fieldnr) { return mysql_field_name($result, $fieldnr); } } ?> Ah, ok, now it worked.
  7. I wanted to add the code, but for some reason it doesn't work.
  8. Hi Harald, Thanks for the response. I've tried this code, but unfortunately no luck My current version has "public static" in front of the functions which I believe came from an earlier update according to an error note.<p>
  9. Hi everybody, I've got the same problem as xtrgeo, Ithink it has something to do with the mysql_ commands since these have been changed to mysqli_ and are also in the amDB.class.php file, but I'm not a coder and have no idea how to get this right. If there's anybody who can help us out, it would be much appreciated. Thanks in advance,
  10. Hi Jim, I've installed the following addon: http://addons.oscommerce.com/info/8560/v,23 (Protected images for osc2.3.3 Now I'm trying to get the pdf-datasheet to be compatible with this addon. I think, I'm quite far in the right direction but as I'm not a coder, I'm not sure wether this is correct, I checked the new image route, this is correct, but I still get the following error message: TCPDF ERROR: [image] Unable to get image: images/1 The changed code is as follows: function execute() { global $PHP_SELF, $pdf, $products_id, $languages_id, $currencies, $current_y, $image_folder; if( basename( $PHP_SELF ) == 'pdf_datasheet.php' && isset( $products_id ) && $products_id > 0 ) { // Get the product name $product_info_query_raw = " select pd.products_description, pi.image, p.image_folder, p.image_display from " . TABLE_PRODUCTS . " p , " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_IMAGES . " pi on (pi.products_id = pd.products_id and pi.sort_order = '1') where pd.products_id = '" . $products_id . "' and pd.language_id = '" . ( int )$languages_id . "' "; $product_info_query = tep_db_query( $product_info_query_raw ); $product_info = tep_db_fetch_array( $product_info_query ); // BOF Protected Images for osCommerce 2.3.3 $image_size = ''; if ($product_info['image_display'] == 1) { // use "No Picture Available" image $image_size = tep_image(DIR_WS_LANGUAGES . $language . '/images/' . 'no_picture.gif', TEXT_NO_PICTURE, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5" style="float: right;"'); } elseif (($product_info['image_display'] != 2) && (tep_not_null($product_info['image']))) { // show product images // EOF Protected Images for osCommerce 2.3.3 // Get the image information $image_size = getimagesize(DIR_WS_IMAGES_PROD . $product_info['image_folder'] . $product_info['image']); I probably need to change more files, but I tried this one as a start. I hope you've got some time to help me out, Thanks, Gerhard
  11. Hi Jim, This is a great addon, and I'm happy, I removed the "products fields groups" addon, everything works fine exept for a few things. Is there gonna be a version 1.2?, I've installed version 1.1.11, but pretty much all the bugs discussed in the forum were still in this version. and the manual has to be reviewed. Now, after reading the forum several times, I've still got one problem. The "review tab", "ask a question tab" and "tell a friend tab" are not functioning 100% After submitting, it returns to the product_info.php but not to the right tab (just to the standard product_info.php with the description tab to be the first tab to show.. The "tell a friend" tab returns the success and error messages, but doesn't show the assigned definitions while they are defined. If I move the </form> tag up, the "add to cart" button isn't working anymore. I tried moving <p>
  12. @@kymation, I have to appologize for my last post, forget about it. I overlooked it in the manual. It must have been late, usually I don't ask these kind of questions as I try to find the solution myself first. Sorry about that, I take the blame :x 1 question: I saw that both X-Sell and document manager have been listed under the addons for v2.2. I found X-Sell for 2.3.1 (http://addons.oscommerce.com/info/8330/v,23) but I didn't find the Document manager for 2.3.1. Are both addons compatible with 2.3.1 or not yet (as you used them in your addon).? Regards, Gerhard.
  13. Hi Jim, Sorry for the confusion, I'll have a look at it myself. It wasn't meant as a question, if it was, I'd support it with code. I'm thinking about using this addon instead of the product fields group as I think this one has more options and is more complete. Is there a website with an example on what the tabs look like? What about my second messages? Have I overlooked something or is this table really missing in the sql file? Thanks for the help. Regards, Gerhard
  14. Hi Jim, I got the error TABLE_PRODUCTS_TO_DOCUMENTS doesn't exist This table is being called for in the file products_tabs.php. This table isn't in the sql file. Regards, Gerhard