Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NSN Other
Author Message
phpnewbie
New Member
New Member


Joined: Sep 02, 2005
Posts: 19

PostPosted: Fri Sep 02, 2005 3:26 am Reply with quote

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?
 
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6383

PostPosted: Fri Sep 02, 2005 7:01 am Reply with quote

The option value needs to match the original. You're displaying HTML, but storing the value for text in the database.

_________________
I google, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
phpnewbie
PostPosted: Fri Sep 02, 2005 7:54 am Reply with quote

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
PostPosted: Fri Sep 02, 2005 8:39 am Reply with quote

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
PostPosted: Fri Sep 02, 2005 9:28 am Reply with quote

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
PostPosted: Fri Sep 02, 2005 10:53 am Reply with quote

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
PostPosted: Fri Sep 02, 2005 5:23 pm Reply with quote

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&amp;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
PostPosted: Fri Sep 02, 2005 5:29 pm Reply with quote

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)

PostPosted: Fri Sep 02, 2005 9:24 pm Reply with quote

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! 
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NSN Other

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©