Jump to content

gabrielk

Members
  • Content count

    47
  • Joined

  • Last visited

2 Followers

About gabrielk

  • Birthday 06/08/1978

Profile Information

  1. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    Hi folks, Unfortunately I won't be able to help with any current problems with this contribution. It was created as part of a project I was working on at the time, and I haven't had an osCommerce testbed in over a year. Hopefully someone else with knowledge of PHP can become involved and ensure this mod works with the latest releases of phpBB and osCommerce.
  2. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    This is possible, but really, really not recommended. You essentially have to modify every phpBB page. This would be fine if it were a one-time thing, but it seems every few months phpBB releases another version or a critical patch. I would look into Chavire's old 2.0.8 integration and use that as a template for the latest version of phpBB.
  3. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    Correct. If the error the person was getting said: Then I would guess the problem is one of three things: the path to the phpBB include file is incorrect, or is missing from this file. Make sure you're getting all the included files on the page, basically, since session_begin() is a function from the phpBB session file.
  4. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    Interesting! What you're doing there makes sense, since all I'm trying to do is grab the ip address. If that fixed the issue for you, I'll make sure and add it in another revision. I'm definitely not the best at this. :)
  5. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    Let me make sure I'm understanding you correctly. Are you saying: a user visits the shopping cart, logs in via osC, and then visits the forums and everything is OK. But if a user visits the forums, then visits osC and logs in, they are not properly logged into the forums? This would be a bug and I'd have to dig around to see what the problem is. Or are you saying: a user logs into the forums via phpBB, and when they visit the shopping cart they are not logged into osC? If so, then this is the intended behaviour. The idea here is to make is as seamless as possible. When you allow users to choose their own username, you open up a whole floodgate of new issues and possibilities. For example, what if a user doesn't specifically want a forum account? They will be annoyed and possibly abandon their sale if they are required to choose a forum username with no way to opt out; but take away the option and most people won't care, it will just be another feature they may or may not use (or even know about). You also then have to monitor against inappropriate usernames, which is just one more step for an already busy store owner. I suppose the short answer is, it's beyond the scope of this mod to allow users to choose their own username. It was considered, but I decided against it after discussing it with some folks. If you do enable this, I would suggest enabling it on the phpBB end of things, because the fewer things you have "cluttering" your user's checkout process, the better. Hi ACB, There is code in place that will create a new phpBB account upon logging into osC, after checking to see if one already exists, for exactly this purpose. Xavier, Unfortunately I don't have a live site where you can really see this running. As has been stated in this thread a couple of times, there's really nothing to see. Everything that happens, happens in the code; all that's really visible is a link to phpBB that looks like any other installation of phpBB. Tom, If you're still having problems updating, send me a PM with which version you used and I'll try to help. I'll see about putting upgrade instructions in next time I make an update.
  6. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    I realize I've been MIA for about a month now, and I apologize. Family illness and work ended up taking a very high priority these last few weeks, but I'm posting this to hopefully remedy some of the issues and bugs people have raised. Dan, Like CThomas said, it sounds like one of your constants is pointing to the wrong place. The code that redirects to password_forgotten.php references the following constance: HTTPS_SERVER, DIR_WS_HTTPS_CATALOG, and FILENAME_PASSWORD_FORGOTTEN. So one of these is the culprit. I'd wager on DIR_WS_HTTPS_CATALOG, so check your osC config file to make sure that this definition does not reference the phpbb2 folder. Also, you may be running into this problem if your DIR_WS_HTTPS_CATALOG is referencing a relative path instead of an absolute path. You can trouble shoot by adding this statement to any visible place on one of your pages: <?php echo 'HTTPS_SERVER = '.HTTPS_SERVER.'<br>'; echo 'DIR_WS_HTTPS_CATALOG = '.DIR_WS_HTTPS_CATALOG.'<br>'; echo 'FILENAME_PASSWORD_FORGOTTEN = '.FILENAME_PASSWORD_FORGOTTEN.'<br>'; ?> If any of those paths get echo'd as an incorrect path, then check the define() value. If not then it's something else; if you're still around and having this problem, post and let me know. CThomas, Thanks! I'll be adding that into v1.3. Find the string tep_get_zone_name( in the file. You'll normally see either two arguments being passed, or you'll see three with the last one being "0". Add or change the third argumen as follows: /catalog/account_edit.php Change: tep_get_zone_name((int)($customer_country_id),(int)($customer_zone_id)) To: tep_get_zone_name((int)($customer_country_id),(int)($customer_zone_id),0) * Note: Upon reviewing the code, I'm not sure any of these values are actually being passed. I'd appreciate some feedback. /catalog/login.php Change: tep_get_zone_name((int)($check_country['entry_country_id']),(int)($check_country['entry_zone_id'])) To: tep_get_zone_name((int)($check_country['entry_country_id']),(int)($check_country['entry_zone_id']),0) encode_ip() is a function from the phpBB2 login code. Make sure that you're including the path to the phpBB files as instructed in the installation instructions, and that the paths are correct.
  7. Have you looked at one of the carts specifically geared towards selling hosting and domain names, like www.whoiscart.net or www.modernbill.com ? That said, your best option for other osCommerce template sellers would be to to a Google search for osCommerce templates.
  8. gabrielk

    Multi_Vendor_Shipping new thread

    Hi guys, I just started using MVS 1.1 on my store, and I whipped up a function tonight that acts as a "teaser", telling customers how much more to spend in order to qualify for free shipping, should they have that vendor module enabled. Add the following code to /catalog/includes/languages/english.php just before the closing ?> bracket. define('FREE_SHIPPING_TEASER', 'Spend <span style="color:red;">%s</span> on %s products and get <strong>free shipping!</strong>'); define('FREE_SHIPPING_QUALIFY','Congratulations! You qualify for <strong>free shipping</strong> on %s products!'); define('FREE_SHIPPING_QUALIFY_UNK','Congratulations! You qualify for <strong>free shipping</strong> on %s products if you live in <strong>%s</strong>!'); define('FREE_SHIPPING_LEFT','<strong>Spend <span style="color:red;">%s</span> more</strong> on %s products to qualify for free shipping!'); define('FREE_SHIPPING_LEFT_UNK','<strong>Spend <span style="color:red;">%s</span> more</strong> on %s products to qualify for free shipping in <strong>%s</strong>!'); Add the following code to /catalog/includes/classes/shopping_cart.php just before the closing ?> bracket. // Build free shipping message string. // Make sure we have a shopping cart. if($_SESSION['cart']->total >= 0) { $_SESSION['cart']->calculate(); // Display vendor free shipping message(s). // Get all our vendor IDs via cart session. $cont = array_keys($_SESSION['cart']->contents); $pid = ' WHERE '; $i=0; foreach($cont as $value) { if($i==0) { $pid .= "products_id='".$value."'"; } else { $pid .= " OR products_id='".$value."'"; } $i++; } // If there's more to $pid than our default value, we can assume that // we found shopping cart contents and therefore can continue building // our message. if($pid==' WHERE ') { $pid .= 'v.vendors_id=1'; $teaser=true; } $get_vIDQuery = tep_db_query("SELECT p.vendors_id, v.vendors_name FROM ".TABLE_PRODUCTS." p LEFT JOIN ".TABLE_VENDORS." v ON p.vendors_id=v.vendors_id".$pid." GROUP BY vendors_id"); if(tep_db_num_rows($get_vIDQuery)>0 && !$teaser) { while($get_vID = tep_db_fetch_array($get_vIDQuery)) { $vID = $get_vID['vendors_id']; $vName = $get_vID['vendors_name']; // Start by checking if it's enabled... if((constant('MODULE_SHIPPING_FREEAMOUNT_STATUS_' . $vID)) && (constant('MODULE_SHIPPING_FREEAMOUNT_STATUS_' . $vID) == 'True')) { $free_shipping = false; // Now find out if it's restricted to a zone. // 0 = not zone restricted. if(constant('MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vID) > 0) { // Shipping is restricted to a zone. Now we find out if our customer // is within that zone. // Get the customer's country, if signed in. if($_SESSION['customer_country_id']) { $check_zone_country_id = $_SESSION['customer_country_id']; $check_zone_state_id = $_SESSION['customer_zone_id']; } else { // Customer is not signed in, get default country from store. $check_zone_country_id = STORE_COUNTRY; $check_zone_state_id = STORE_ZONE; } $geoZoneQuery = tep_db_query("SELECT gz.geo_zone_id, c.countries_name FROM ".TABLE_ZONES_TO_GEO_ZONES." gz LEFT JOIN ".TABLE_COUNTRIES." c ON gz.zone_country_id=c.countries_id WHERE ((zone_country_id = '".$check_zone_country_id."') AND (zone_id='".$check_zone_state_id."' OR zone_id IS NULL))"); if(tep_db_num_rows($geoZoneQuery)>0) { // Loop through our results to see if one matches a geo_zone while($geoZones = tep_db_fetch_array($geoZoneQuery)) { if($geoZones['geo_zone_id']==constant('MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vID)) { // Customer (if signed in) or store (if not signed // in) matches our free zone. The country name is // shown; if you'd rather show the zone name, // change the $geoZoneQuery and the variable below. $free_shipping = true; $free_shipping_location = $geoZones['countries_name']; } elseif($geoZones['geo_zone_id']!=constant('MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vID)) { // Customer or store does not match our free zone. $free_shipping = false; $free_shipping_location = $geoZones['countries_name']; } } } } elseif(constant('MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vID) == 0) { // Free shipping is not zone restricted, and enabled. $free_shipping = true; } else { // If for some reason the free shipping zone isn't 0 and isn't > 0 // we'll play it safe and say "false". $free_shipping = false; } // We've just determined if free_shipping = true || false // Figure out if there's enough in the cart to qualify. $remaining = (($_SESSION['cart']->total - constant('MODULE_SHIPPING_FREEAMOUNT_AMOUNT_' . $vID)) * -1); // Now we proceed if $free_shipping is true. if($free_shipping==true) { // Make sure we're under the weight limit. if($_SESSION['cart']->weight<=constant('MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX_' . $vID)) { // Tell the customer they qualify for free shipping. $free_shipping=true; if($free_shipping_location) { // We have a location, so we can assume we don't know where // our customer is located. Hence, we display the _UNK msg. $free_shipping_message[$vID] = sprintf(FREE_SHIPPING_QUALIFY_UNK, $free_shipping_location, $vName); } else { // No $free_shipping_message means we know where our customer // is coming from. $free_shipping_message[$vID] = sprintf(FREE_SHIPPING_QUALIFY, $vName); } } else { // They're over the weight limit, so they can't get free shipping. $free_shipping=false; } } elseif($free_shipping==false) { // Tell the customer how much more to spend for free shipping. if($free_shipping_location) { // We have a location, so we can assume we don't know where // our customer is located. Hence, we display the _UNK msg. $free_shipping_message[$vID] = sprintf(FREE_SHIPPING_LEFT_UNK, $currencies->format($remaining), $vName, $free_shipping_location); } else { // No $free_shipping_message means we know where our customer // is coming from. $free_shipping_message[$vID] = sprintf(FREE_SHIPPING_LEFT, $currencies->format($remaining)); } } } else { // Free shipping is not enabled. $free_shipping_message[$vID] = ''; }// End Display Free Shipping Message; echo $free_shipping_message to print it. unset($free_shipping); } // End while($vId); } // End get Vendors elseif((MODULE_SHIPPING_FREEAMOUNT_STATUS_1) && (MODULE_SHIPPING_FREEAMOUNT_STATUS_1 == 'True') && $teaser) { // We don't have any products in our cart, so we can't tell if a // specific vendor has free shipping or not. All is not lost: we can // still check our default vendor and display a teaser! $free_shipping_message[1] = sprintf(FREE_SHIPPING_TEASER, $currencies->format(MODULE_SHIPPING_FREEAMOUNT_AMOUNT_1), STORE_NAME); } else { // We ended up here because no vendors have free shipping, so make our // string blank. This allows us to keep the string in our display // code, ready to show up as soon as we do enable a vendor with free // shipping! $free_shipping_message = ''; } // This is ugly, but it works. Build a string outputting our messages. // Alternatively, you can call an individual vendors' messaged by printing // $free_shipping_message[x] -- where "x" is the vendor_id. if(is_array($free_shipping_message)) { $tmp = $free_shipping_message; unset($free_shipping_message); $free_shipping_message = ''; foreach($tmp as $value) { $free_shipping_message .= $value.'<br />'; } } } // End free shipping message builder. So basically you call it by echoing $free_shipping_message anywhere in your cart. The unfortunate part is, if you have several vendors and a customer has products from multiple vendors in their cart, they'll get an output message like: Spend $200.00 on VendorName products and get free shipping! Spend $35.21 more on VendorName2 products and get free shipping! Congratulations! You qualify for free shipping on VendorName3 products! Alternatively, you can comment out that last bit of code starting with if(is_array($free_shipping_message)) and just call each vendor's message separately, like: <?php echo $free_shipping_message[1]; ?> Where "1" is the vendor's ID number. Option #3 is to remove the array key from $free_shipping_message, making it a string that continually resets itself (e.g., instead of $free_shipping_message[$vID] = BLAH change it to $free_shipping_message = BLAH), and you only get one message...but it will be for the last vendor in your query array. This is useful if you only expect someone to purchase one vendor's products at a time, or if you only have one vendor with free shipping enabled. Anyway, hope someone finds that useful. It's not a full contribution, just a little code snippet. :)
  9. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    Hi Scott, That statement's a little unclear. It's not necessarily talking about an osC administrator login contrib. As part of the phpBB-osC bridge, there are osC admin fields set up that control the forum administrator account (username & password). Just make sure that the values of these match the values you chose when installing phpBB. Then, if you want to change your administrator's username/password/e-mail address, use the osC admin panel to do it. :) Regardless, it should actually fix itself the first time you change the username/password/e-mail address in the osC admin (it will update phpBB's account info to match when you do), so if you're getting an username/password mismatch when you click the Forum Admin link you can just edit your username & password in osC's Forum Config Values and it will re-sync everything. Hope that makes sense. Gabriel
  10. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    I think that means you have more (or less) values than rows. For example: INSERT INTO `configuration` (`field_1`, `field_2`, `field_3`) VALUES ('value_1', 'value_2'); Notice how there are fewer values listed than fields. It works the other way too, where there are more values listed. anyway, I'm pretty sure that's the error. I can't see why you could be getting it though. Ugh. You could try altering the SQL syntax a bit: INSERT INTO `configuration` SET `configuration_id` = NULL, `configuration_title` = 'Store URL', `configuration_key` = 'STORE_URL', `configuration_value` = 'www.mystore.de', `configuration_description` = '', `configuration_group_id`= '1', `sort_order` = '2', `last_modified` = NOW(), `date_added` = NOW(), `use_function` = NULL, `set_function` = NULL ; I'm not a SQL expert, so I hope there's no errors in that. =P But maybe retype the queries in that format? Also, you may try entering the queries one at a time, maybe it's a specific one that's having issues, could be a simple typo. Sorry the SQL statements seemt to be giving people so many problems...
  11. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    Haha, no problem, as you can see even I go blind from code... :)
  12. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    CThomas, and anyone else who's installed this, I am an idiot. The problem is missing code in the install text. You can probably ignore the troubleshooting below, and instead do this: In /catalog/login.php FIND: } else { $userdata = tep_db_fetch_array($check_bbusers_query); $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; tep_db_query("UPDATE " . TABLE_PHPBB_USERS . " SET user_session_time = '".$current_time."', user_session_page = '0', user_lastvisit = '".$last_visit."' WHERE user_id ='" . $check_customer['customers_id'] . "'"); $userdata['user_lastvisit'] = $last_visit; } REPLACE WITH: } else { if($check_bbusers_query['user_level']==1) { $admin='1'; } else { $admin='0'; } session_begin($customer_id, encode_ip(tep_get_ip_address()), PAGE_INDEX, FALSE, $autologin, $admin); $userdata = tep_db_fetch_array($check_bbusers_query); $last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time; tep_db_query("UPDATE " . TABLE_PHPBB_USERS . " SET user_session_time = '".$current_time."', user_session_page = '0', user_lastvisit = '".$last_visit."' WHERE user_id ='" . $check_customer['customers_id'] . "'"); $userdata['user_lastvisit'] = $last_visit; } I'm leaving the post above because it might still be useful to someone trying to troubleshoot their install. :)
  13. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    CThomas, Thanks for the complements. :) So just to clarify, when a CUSTOMER logs in, they are not being appropriately logged into the forums? First, double-check that the user accounts are actually being created in phpBB as they are supposed to. It sounds like they are, but just make sure, as it will change the nature of the problem if the accounts are not being created when customers create their accounts, and it would also prevent them from being simultaneously logged into the forums, obviously. :) Second, make sure the following block of code is ABOVE require('includes/application_top.php'); in your login page: // Added for phpBB-osCommerce Bridge define("IN_LOGIN", true); define('IN_PHPBB', true); $phpbb_root_path = './phpbb2'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); // End phpBB-osCommerce Bridge. If that code is present, please ensure that the paths to extension.inc and common.php are correct. You can do this by adding the following statement directly underneath that code: echo 'phpBB Extension: ' . $phpbb_root_path . 'extension.inc <br />'; echo 'phpBB common: ' . $phpbb_root_path . 'common.'.$phpEx.'<br /><br />'; This will cause an error when you load the page, but that's ok, because once you've verified the paths are correct remove those echo statements. If the paths displayed do not actually reflect where your phpBB files are, that's the problem, and just change the $phpbb_root_path variable. If that is not the problem, try something else: find the following code in login.php... $check_bbusers_query = tep_db_query("select * from " . TABLE_PHPBB_USERS . " where user_id = '" . $check_customer['customers_id'] . "'"); Directly underneath, add: echo 'phpBB User Query: ' . "select * from " . TABLE_PHPBB_USERS . " where user_id = '" . $check_customer['customers_id'] . "'"; Manually run the echo'd code in phpBB and make sure it returns a row. If it does not, your problem is that the login isn't finding your user's phpBB account to log them in with. If it does, then everything's ok here and there's something else going on...
  14. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    From the install documents: # IMPORTANT: you MUST change GROUP_ID to the group ID # inserted by the abvoe # configuration_group insert. The key word here is you CHANGE the text "group_id" to your actual group ID. In your code it looks like you added your group ID AFTER the text. In other words: GROUP_ID, '2', is wrong '2', is right. Notice the absense of GROUP_ID altogether. That's what the instructions mean: replace the text GROUP_ID with your actual group idea, don't just add it afterwards. :)
  15. gabrielk

    [Contribution] phpBB-osCommerce Bridge

    Ahh, I tracked down the problem. Edit /catalog/admin/forum_admin_login.php Edit line 10 to read: $adminCheck = tep_db_query("SELECT * FROM ".TABLE_PHPBB_USERS." WHERE username='".FORUM_USERNAME."' AND user_password=MD5('".FORUM_PASSWORD."')");
×