PHP Web Host - Quality Web Hosting For All PHP Applications Clan Themes! We make clans look good!!
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
phpnewbie
New Member
New Member


Joined: Sep 02, 2005
Posts: 19

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

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: 6044

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

The option value needs to match the original. You're displaying HTML, but storing the value for text in the database.
View user's profile Send private message
phpnewbie
New Member
New Member


Joined: Sep 02, 2005
Posts: 19

PostPosted: Fri Sep 02, 2005 7:54 am Reply with quote Back to top

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


Joined: Jun 04, 2004
Posts: 6044

PostPosted: Fri Sep 02, 2005 8:39 am Reply with quote Back to top

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.
View user's profile Send private message
phpnewbie
New Member
New Member


Joined: Sep 02, 2005
Posts: 19

PostPosted: Fri Sep 02, 2005 9:28 am Reply with quote Back to top

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


Joined: Jun 04, 2004
Posts: 6044

PostPosted: Fri Sep 02, 2005 10:53 am Reply with quote Back to top

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.
View user's profile Send private message
phpnewbie
New Member
New Member


Joined: Sep 02, 2005
Posts: 19

PostPosted: Fri Sep 02, 2005 5:23 pm Reply with quote Back to top

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


Joined: Jun 04, 2004
Posts: 6044

PostPosted: Fri Sep 02, 2005 5:29 pm Reply with quote Back to top

Glad to help, but even more happy you were able to get it working.
View user's profile Send private message
BobMarion
Former Admin in Good Standing


Joined: Oct 30, 2002
Posts: 1043
Location: RedNeck Land (known as Kentucky)

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

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; }
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum