I'm using newslettersubscribe extension and everything looks fine only the subscribe or unsubscribe button doesn't do anything. So I looked into the code but don't understand what goes wrong, so here is the peace of code and I hope someone can give me a hand.
Code: Select all
<div class="box">
<div class="box-heading"><?php echo $heading_title; ?></div>
<div class="box-content" style="text-align: center;">
<?php
if($thickbox) { ?>
<a href="#frm_subscribe" title="Newsletter Subscribe" class="fancybox_sub"> <?php echo($text_subscribe); ?> </a>
<?php } ?>
<?php
if($thickbox) { ?> <div id="frm_subscribe_hidden" style="display:none;"> <?php } ?>
<div id="frm_subscribe">
<form name="subscribe" id="subscribe" >
<table border="0" cellpadding="2" cellspacing="2">
<tr>
<td align="left"><span class="required">*</span> <?php echo $entry_email; ?><br /><input type="text" value="" name="subscribe_email" id="subscribe_email"></td>
</tr>
<tr>
<td align="left"><?php echo $entry_name; ?> <br /><input type="text" value="" name="subscribe_name" id="subscribe_name"> </td>
</tr>
<?php
for($ns=1;$ns<=$option_fields;$ns++) {
$ns_var= "option_fields".$ns;
?>
<tr>
<td align="left">
<?php
if($$ns_var!=""){
echo($$ns_var." <br/>");
echo('<input type="text" value="" name="option'.$ns.'" id="option'.$ns.'">');
}
?>
</td>
</tr>
<?php
}
?>
<tr>
<td align="left">
<a class="button" onclick="email_subscribe()"><span><?php echo $entry_button; ?></span></a><?php if($option_unsubscribe) { ?>
<a class="button" onclick="email_unsubscribe()"><span><?php echo $entry_unbutton; ?></span></a>
<?php } ?>
</td>
</tr>
<tr>
<td align="center" id="subscribe_result"></td>
</tr>
</table>
</form>
</div>
<?php if($thickbox) { ?> </div> <?php } ?>
</div>
<div class="bottom"> </div>
<script language="javascript">
<?php
if(!$thickbox) {
?>
function email_subscribe(){
$.ajax({
type: 'post',
url: 'index.php?route=module/newslettersubscribe/subscribe',
dataType: 'html',
data:$("#subscribe").serialize(),
success: function (html) {
eval(html);
}});
}
function email_unsubscribe(){
$.ajax({
type: 'post',
url: 'index.php?route=module/newslettersubscribe/unsubscribe',
dataType: 'html',
data:$("#subscribe").serialize(),
success: function (html) {
eval(html);
}});
}
<?php }else{ ?>
function email_subscribe(){
$.ajax({
type: 'post',
url: 'index.php?route=module/newslettersubscribe/subscribe',
dataType: 'html',
data:$("#subscribe").serialize(),
success: function (html) {
eval(html);
}});
}
function email_unsubscribe(){
$.ajax({
type: 'post',
url: 'index.php?route=module/newslettersubscribe/unsubscribe',
dataType: 'html',
data:$("#subscribe").serialize(),
success: function (html) {
eval(html);
}});
}
<?php } ?>
$('.fancybox_sub').fancybox({
width: 180,
height: 180,
autoDimensions: false
});
</script>
</div>
nothing happens when you klick the subscribe button
thanks,
Ruud