This is a discussion on PHPList for OsCommerce within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; The 'Newsletter' field in the customers list in admin/Customers.php still reads from the old database. In admin/customers....
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| ||||
| ||||
| The 'Newsletter' field in the customers list in admin/Customers.php still reads from the old database. In admin/customers.php Find: while ($customers = tep_db_fetch_array($customers_query)) { And add directly below it: // PHPlist PHPlist Newsletter add-on require(DIR_WS_INCLUDES . '/phplist_define.php'); //get the phplist specifics $existing_email_query = tep_db_query("select id, email, foreignkey from " . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "user_user where email = '" . $customers['customers_email_address'] . "'"); //check for existing by email address $existing_user_query = tep_db_query("select id, foreignkey, email from " . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "user_user where foreignkey = " . $customers['customers_id'] . ""); //check for existing by phplist userid in case they subscribed using another method. $existing_email = tep_db_fetch_array($existing_email_query); $existing_user = tep_db_fetch_array($existing_user_query); if (tep_db_num_rows($existing_user_query) > 0) //check for user subscription $newsletter_query = tep_db_query("select userid from " . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "listuser where listid = " . PHPLIST_LISTNO . " and userid = " . $existing_user['id'] . ""); else $newsletter_query = tep_db_query("select userid from " . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "listuser," . PHPLIST_DB . "" . PHPLIST_TABLE_PREFIX . "user_user where listid = " . PHPLIST_LISTNO . " and userid = id and email = '" . $customers['customers_email_address'] . "'"); $customers['customers_newsletter'] = ((tep_db_num_rows($newsletter_query) < 1) ? '0' : '1'); // End PHPlist Newsletter add-on Attached is the latest version with this fix added. Known bugs: if you don't have a surname attribute in PHPList, the included config file says just to leave the field blank. The script doesn't seem to check for this and caused me errors. I had to comment out lines in create_account.php which used the surname value when accessing the database. This has not been done in the attached version, it's up to you... More...
__________________ Michael Sasek osCMax Developer osCMax Templates - Hundreds of premium quality templates. New designs every month! xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Instalador osCommerce espaņol - osCommerce install spanish | michael_s | New osCommerce Contributions | 0 | 01-19-2007 07:50 AM |
| Instalador osCommerce espaņol - osCommerce install spanish | michael_s | New osCommerce Contributions | 0 | 01-19-2007 06:50 AM |