Author Topic: Custom fields question  (Read 3986 times)

Pavel

  • Posts: 14
    • View Profile
Custom fields question
« on: February 01, 2006, 02:30:15 am »
Hello Dean

Please tell me is it somehow possible to update a custom field without altering other custom fields when a visitor signups or re-signups?

During the visitor signup process I need to insert a new piece of info to the custom field #2 without deleting or modifying custom filed #1. This will help me to use rule-based list-selection feature in the future.

Are there any options to do this?

Thanks.
Pavel Lenshin
NeoProfit Circle

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Custom fields question
« Reply #1 on: February 01, 2006, 06:09:17 pm »
Pavel,

I guess the solution would be to have an "update_dupes" option on the signup form, which will signal to the script that it should simply update the user and overwrite any provided data, but not touch existing data in other fields.  Yes, this could work.  I will make a note to try to include this in a future update.  I am trying not to do custom features for money anymore but for $100 I'm yours. :D

Regards, DW
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting

Pavel

  • Posts: 14
    • View Profile
Custom fields question
« Reply #2 on: February 02, 2006, 11:19:12 am »
Dean,

It would be a great feature for marketers who want to "mark" certain subscriber groups without starting a separate list, so please consider it for the next releases.

The problem is that when update_dupes is used, the script reports:

=====
The error messages are as follows:
That email address is already subscribed to this list!
=====

Is it possible to re-signup a subscriber with the same email and update a custom field at the same time?

Thanks
Pavel Lenshin
NeoProfit Circle

DW

  • Administrator
  • Posts: 3787
    • View Profile
    • https://legacy.listmailpro.com
Custom fields question
« Reply #3 on: February 10, 2006, 09:10:39 am »
update_dupes is not currently a feature but was a thought of how I might implement your request in the future.

This might work, but you'd want/have to clear out all existing duplicates on your list:

Use the allow_dupes option.

Copy signup-xtra.php from ./xtra to the main Listmail folder.  Modify the file to contain the following code, replacing the list number with your desired list and user1 with your desired custom field:
Code: [Select]
<?php
$mylist 
'1';
if(
$list==$mylist){
 
// update existing entries if exist
 
mysql_query("update lm_users set user1 = '".addslashes($user1)."' where list = '$mylist' and uid <> '$uid';");
 if(
mysql_affected_rows()>0){
  
// delete the new user only if already existed
  
mysql_query("delete from lm_users where uid = '$uid';");
 }
}
?>


Regards
Dean Wiebe
ListMailPRO Author & Developer - Help | Support | Hosting