Latest News: (loading..)

Mystefyer

Members
  • Content count

    11
  • Joined

  • Last visited

About Mystefyer

  • Birthday 06/08/1980

Profile Information

  1. 14Steve14, if you are reffering to the code edits of http://addons.oscommerce.com/info/8507, I looked into it, but none of the entries you are supposed to edit can be found in 2.3 except for the parts in product_info.php, the differences in that file are not so big compared with 2.2. As to the problem with my code lies within product_listing.php. It now replaces all Buy Now buttons for all items in the list, despite their stock status. Changing the 0 to a 1 in the 2nd if ($listing['products_quantity'] > 0) { result in Buy Now buttons for all products. The idea is to replace only the buttons for items which have a stock of 0 Regards, Emile
  2. @@14steve14, I looked at that one, but alas, it is not compliant with 2.3. The code you need tho change according to the install html is for 2.2 which is drastically different than 2.3. I could not find an addon which works for 2.3, hence I started making my own.
  3. Hi, I'm working on a new add-on to remove the Add to Cart button on the product_listing.php and the product_info.php for OsCommerce 2.3. This is because I want to be able to show our customers products we carry but do not have in stock but prevent them from adding them to their cart. On product_info.php I got it working perfectly. For now the button is replaced with some text stating to use the contact form for more info. In a later stage I will change this to a neat button linking to the contact form and move the text to beneath the product image. Here's the code I have so far for product_info.php for who is interested : <div class="buttonSet"> <?php if ($product_info['products_quantity'] >=1) { ?> <span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span> <?php } else { ?> <span class="OutOfStock"><?php echo TEXT_OUT_OF_STOCK_CONTACT; ?></span> <?php } ?> So far no real challenges there. But when it comes to product_listing.php I've hit a snag. What I want to accomplish is that when a products stock hits 0, the Add to Cart button is replaced by a Out of stock button which when clicked will open the product info page. Here's the code so far : case 'PRODUCT_LIST_BUY_NOW': if ($listing['products_quantity'] == 0) { $prod_list_contents .= ' <td align="center">' . tep_draw_button(IMAGE_BUTTON_OUT_OF_STOCK) . '</td>'; } else if ($listing['products_quantity'] > 0) { $prod_list_contents .= ' <td align="center">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])) . '</td>'; } break; The thing is it replaces all the Add to cart (Buy now) buttons for the Out of stock button and seems to ignore the else statement. So I hope any of you guys wants to pitch in and can find the thing I'm overlooking. Any help is much appreciated. Regards, Emile
  4. Hi all, Love the contrib. But has anyone succesfully integrated it with sending newsletters in HTML, as in the version for 2.3.1 newsletters still get send in plain text. I would like to send newsletters in html using a uhtml template but can't figure out how to do it. So if anyone knows, thanks in advance for the help. Regards
  5. Already found the problem. My code was in the wrong order in the top part of the php file. If anyone is interested I can post the working code for the guestbook as a contri or in this topic. Just let me know. Greetz, Emile Lensink
  6. Hi, Its a great contry and works perfect on my create_account and contact_us forms. Now I tried to add the verification to the guestbook_sign.php. I know there is a different contri for all three but that did not seemed to work. So I copied some code. I got the code in there but I get an error at the top : and this one at the bottom : when guestbook_sign.php opens. It also does not require the code to be entered when posting in the guestbook. If I could get this to work it would be great against all the spam that comes into the guestbook. Here's my adapted code changed is in red: // BOF Anti Robot Validation v2.5 if (ACCOUNT_VALIDATION == 'true' && [color="#FF0000"]GUESTBOOK_SIGN[/color]_VALIDATION == 'true') { require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_VALIDATION); include_once('includes/functions/' . FILENAME_ACCOUNT_VALIDATION); } // EOF Anti Robot Registration v2.5 // BOF Anti Robotic Registration v2.5 if (ACCOUNT_VALIDATION == 'true' && [color="#FF0000"]GUESTBOOK_SIGN[/color]_VALIDATION == 'true') { $sql = "SELECT * FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE session_id = '" . tep_session_id() . "' LIMIT 1"; if( !$result = tep_db_query($sql) ) { $error = true; $entry_antirobotreg_error = true; $text_antirobotreg_error = ERROR_VALIDATION_1; } else { $entry_antirobotreg_error = false; $anti_robot_row = tep_db_fetch_array($result); if (( strtoupper($HTTP_POST_VARS['antirobotreg']) != $anti_robot_row['reg_key'] ) || ($anti_robot_row['reg_key'] == '') || (strlen($antirobotreg) != ENTRY_VALIDATION_LENGTH)) { $error = true; $entry_antirobotreg_error = true; $text_antirobotreg_error = ERROR_VALIDATION_2; } else { $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE session_id = '" . tep_session_id() . "'"; if( !$result = tep_db_query($sql) ) { $error = true; $entry_antirobotreg_error = true; $text_antirobotreg_error = ERROR_VALIDATION_3; } else { $sql = "OPTIMIZE TABLE " . TABLE_ANTI_ROBOT_REGISTRATION . ""; if( !$result = tep_db_query($sql) ) { $error = true; $entry_antirobotreg_error = true; $text_antirobotreg_error = ERROR_VALIDATION_4; } else { $entry_antirobotreg_error = false; } } } } if ($entry_antirobotreg_error == true) $messageStack->add('[color="#FF0000"]guestbook[/color]', $text_antirobotreg_error); } // EOF Anti Robotic Registration v2.5 // BOF Anti Robot Registration v2.5 if (ACCOUNT_VALIDATION == 'true' && [color="#FF0000"]GUESTBOOK_SIGN[/color]_VALIDATION == 'true') { $antirobotreg = tep_db_prepare_input($HTTP_POST_VARS['antirobotreg']); } // EOF Anti Robot Registration v2.5 <!-- // BOF Anti Robot Registration v2.5--> <?php if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,[color="#FF0000"]'guestbook_sign'[/color]) && [color="#FF0000"]GUESTBOOK_SIGN[/color]_VALIDATION == 'true') { ?> <tr> <td class="main"><b><?php echo CATEGORY_ANTIROBOTREG; ?></b></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" cellspacing="2" cellpadding="2"> <tr> <?php if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,[color="#FF0000"]'guestbook_sign'[/color]) && [color="#FF0000"]GUESTBOOK_SIGN[/color]_VALIDATION == 'true') { if ($is_read_only == false || (strstr($PHP_SELF,[color="#FF0000"]'guestbook_sign'[/color])) ) { $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . tep_session_id() . "'"; if( !$result = tep_db_query($sql) ) { die('Could not delete validation key'); } $reg_key = gen_reg_key(); $sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . tep_session_id() . "', '" . $reg_key . "', '" . time() . "')"; if( !$result = tep_db_query($sql) ) { die('Could not check registration information'); } ?> <tr> <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea"> <tr> <td class="main"><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" width="100%" NOWRAP><span class="main"> <?php echo ENTRY_ANTIROBOTREG; ?></span></td> </tr> <tr> <td class="main" width="100%"> <?php $check_anti_robotreg_query = tep_db_query("select session_id, reg_key, timestamp from anti_robotreg where session_id = '" . tep_session_id() . "'"); $new_guery_anti_robotreg = tep_db_fetch_array($check_anti_robotreg_query); $validation_images = tep_image('validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id']); if ($entry_antirobotreg_error == true) { ?> <span> <?php echo $validation_images . ' <br> '; echo tep_draw_input_field('antirobotreg') . ' <br><b><font color="red">' . ERROR_VALIDATION . '<br>' . $text_antirobotreg_error . '</b></font>'; } else { ?> <span> <?php echo $validation_images . ' <br> '; echo tep_draw_input_field('antirobotreg', $account['entry_antirobotreg']) . ' ' . ENTRY_ANTIROBOTREG_TEXT; } } } ?> </span> </td> </tr> </table></td> </tr> </table></td> </tr> </tr> </table></td> </tr> </table></td> </tr> <tr> <td> <?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); } ?> </td> </tr> <!-- // EOF Anti Robot Registration v2.5--> Thats all. As I said it shows the verification and errors. i'm probably overlooking something. I already have the option for guestbook in the admin on 'true' in the antibot reg. If i put it on false the code and errors do not appear. So thats working fine. If anyone can help me, thanks for the effort in advance. Kind regards, Emile Lensink