Author |
Message |
phpnewbie
New Member


Joined: Sep 02, 2005
Posts: 19
|
Posted:
Fri Sep 02, 2005 3:26 am |
|
I have set this up on my not yet live site and it seems perfect for what i need. HOWEVER, i want to send out HTML e-mails only.
So, i deleted the code out of the block giving the user the option to choose whether to recieve HTML emails or TEXT emails when they signup.
But the preference defaults to text rather than html...
I've been into the code were it says
<option value='0'>"._ML_TYPETEXT."</option>
<option value='1'>"._ML_TYPEHTML."</option>
and changed this to
<option value='0'>"._ML_TYPEHTML."</option>
<option value='1'>"._ML_TYPETEXT."</option>
but that makes no difference. When you sign up, it adds you with text preference. How can i change this? |
|
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Fri Sep 02, 2005 7:01 am |
|
The option value needs to match the original. You're displaying HTML, but storing the value for text in the database. |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
phpnewbie

|
Posted:
Fri Sep 02, 2005 7:54 am |
|
Ok... that makes sense and would explain why that didnt work.
But how can i get it to store HTML preference for everyone signing up then? Which code needs changing because i couldnt seem to find it.
Thankyou in advance... |
|
|
|
 |
kguske

|
Posted:
Fri Sep 02, 2005 8:39 am |
|
Not sure I understand. If you only want HTML, just remove the text option.
Code:<!-- option value='0'>"._ML_TYPETEXT."</option -->
<option value='1'>"._ML_TYPEHTML."</option>
|
It will default to HTML, and they won't be able to select anything else. |
|
|
|
 |
phpnewbie

|
Posted:
Fri Sep 02, 2005 9:28 am |
|
Sorry for not being clear...
Because i didn't want the user to be able to choose, i deleted the fields in the block so they have no options to choose. However it defaults to text rather than html... |
|
|
|
 |
kguske

|
Posted:
Fri Sep 02, 2005 10:53 am |
|
The default value for the field is probably 0 or blank, which the application processes as text. Instead of removing the field, you could make it hidden with a value of 1 or set the value of the field to 1 when processing the form. Or, you could change the default in the database to 1 or the insert / update statements to force one. |
|
|
|
 |
phpnewbie

|
Posted:
Fri Sep 02, 2005 5:23 pm |
|
Thanks for quick replies... It gave me some ideas as to what to do. Now i'm not going to lie. It took me a couple of hours to get sorted but it works!!!
1 bug i have found is that in 'Mailing List Admin' under 'View Subscribers', type will always display as text even if HTML is chosen (that threw me for ages).
Anyway, now this works if your are using 1 mailing list as it is chosen automatically, so is HTML preference (quite easy to ammend though).
Code i changed and used in NSN mailing list block is posted here. Hopefuly it'll help someone.
Thanks though for your help kguske and i have to say being new to PHP Nuke, the amount of support, help and items for download available is amazing. Keep it up!
Code:$content .= _ML_WELCOMEMESSAGE."<br>\n";
$content .= "<table align='center' border='0'>\n";
$content .= "<form action='modules.php?name=$modname&op=MLAction' method='POST'>\n";
$content .= "<tr><td align='center'><br><b>"._ML_EMAILADDRESS."</b><br><input type='text' name='email' value='".$usermail."' size='20' maxlength='100'></td></tr>\n";
$result = $db->sql_query("SELECT * FROM `".$prefix."_nsnml_lists`");
while($list_info = $db->sql_fetchrow($result)) { $content .= "<input type='hidden' name ='lid' value='".$list_info['lid']."'>\n"; }
$content .= "<tr><td align='center'><b>"._ML_CHOOSEPLEASE."</b><br><select name ='sub'>\n";
$content .= "<option value='sub'>"._ML_SUBSCRIBE."</option>\n";
$content .= "<option value='unsub'>"._ML_UNSUBSCRIBE."</option>\n";
$content .= "</select></td></tr><input type='hidden' name='type' value='1'>\n";
$content .= "<tr><td align='center' colspan='2'><br><input type='submit' value='"._ML_SEND."'></td></tr>\n";
$content .= "</form>\n";
$content .= "</table>\n";
|
|
|
|
|
 |
kguske

|
Posted:
Fri Sep 02, 2005 5:29 pm |
|
Glad to help, but even more happy you were able to get it working. |
|
|
|
 |
BobMarion
Former Admin in Good Standing

Joined: Oct 30, 2002
Posts: 1037
Location: RedNeck Land (known as Kentucky)
|
Posted:
Fri Sep 02, 2005 9:24 pm |
|
Code:if($user_info['type'] == '1') { echo _ML_TYPEHTML; } else { echo _ML_TYPETEXT; }
|
This is the section that displays HTML or Text.
It should be:Code:if($user_info['html'] == '1') { echo _ML_TYPEHTML; } else { echo _ML_TYPETEXT; }
|
|
_________________ Bob Marion
Codito Ergo Sum
Only registered users can see links on this board! Get registered or login! |
|
|
 |
|