osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

PHPList for OsCommerce

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....


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > New osCommerce Contributions

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack Thread Tools
  #1  
Old 04-26-2007, 10:00 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,185
Thanks: 66
Thanked 290 Times in 276 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Post PHPList for OsCommerce

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 06:36 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2008 osCMax