View Single Post
  #15  
Old 07-18-2011, 05:28 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: newsletter signup from html page

In this case you should use the following form:
Code:
<form name="news_subscription" action="news.php" method="post"> <input type="hidden" name="mode" value="subscribe"> <input type="hidden" name="s_lists[]" value="1"> <input type="hidden" name="s_lists[]" value="2"> ... <input type="hidden" name="s_lists[]" value="[N]"> <input type="hidden" name="skip_validation" value="Y"> <input type="text" name="newsemail" size="30" value=""> <input type="hidden" name="sl" value="en"> <button class="button main-button" type="submit" title="Subscribe"> <span class="button-right"><span class="button-left">Subscribe</span></span> </button> </form>

Add all the necessary lists:
Code:
<input type="hidden" name="s_lists[]" value="[N]">

The list ID [N] can be found on admin/news.php (see the "targetlist" URL param for the corresponding news list).

Insert this code:
PHP Code:
if ($news_lists_num && $mode == "subscribe" && $skip_validation == 'Y') {
    
$validated_emails[] = stripslashes($email);


right before this line:
PHP Code:
if ($mode == 'view' || ($mode == "subscribe" && in_array(stripslashes($email), $validated_emails))) { 

in the "modules/News_Management/news_manage.php" script.
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote