Esempio n. 1
0
function subscribePage($id)
{
    #  return subscribePage2($id);
    list($attributes, $attributedata) = PageAttributes($GLOBALS['pagedata']);
    $selected_lists = explode(',', $GLOBALS['pagedata']['lists']);
    $html = '<title>' . $GLOBALS['strSubscribeTitle'] . '</title>';
    $html .= $GLOBALS['pagedata']['header'];
    $html .= $GLOBALS['pagedata']['intro'];
    $html .= '

<div class="error"><span class="required">' . $GLOBALS['strRequired'] . '</span></div>
' . $GLOBALS['msg'] . '

<script language="Javascript" type="text/javascript">

function checkform()
{
  for (i=0;i<fieldstocheck.length;i++) {
    if (eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].type") == "checkbox") {
      if (document.subscribeform.elements[fieldstocheck[i]].checked) {
      } else {
        alert("' . $GLOBALS['strPleaseEnter'] . ' "+fieldnames[i]);
        eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].focus()");

        return false;
      }
    } else {
      if (eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].value") == "") {
        alert("' . $GLOBALS['strPleaseEnter'] . ' "+fieldnames[i]);
        eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].focus()");

        return false;
      }
    }
  }
  for (i=0;i<groupstocheck.length;i++) {
    if (!checkGroup(groupstocheck[i],groupnames[i])) {
      return false;
    }
  }
  ';
    if ($GLOBALS['pagedata']['emaildoubleentry'] == 'yes') {
        $html .= '
  if (! compareEmail()) {
    alert("' . str_replace('"', '\\"', $GLOBALS['strEmailsNoMatch']) . '");

    return false;
  }';
    }
    $html .= '
  if (! checkEmail()) {
    alert("' . str_replace('"', '\\"', $GLOBALS['strEmailNotValid']) . '");

    return false;
  }';
    $html .= '

  return true;
}

var fieldstocheck = new Array();
var fieldnames = new Array();
function addFieldToCheck(value,name)
{
  fieldstocheck[fieldstocheck.length] = value;
  fieldnames[fieldnames.length] = name;
}
var groupstocheck = new Array();
var groupnames = new Array();
function addGroupToCheck(value,name)
{
  groupstocheck[groupstocheck.length] = value;
  groupnames[groupnames.length] = name;
}

function compareEmail()
{
  return (document.subscribeform.elements["email"].value == document.subscribeform.elements["emailconfirm"].value);
}

function checkEmail()
{
  var re = /^(([^<>()[\\]\\.,;:\\s@\\"]+(\\.[^<>()[\\]\\.,;:\\s@\\"]+)*)|(\\".+\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;
    return re.test(document.subscribeform.elements["email"].value);
}

function checkGroup(name,value)
{
  option = -1;
  for (i=0;i<document.subscribeform.elements[name].length;i++) {
    if (document.subscribeform.elements[name][i].checked) {
      option = i;
    }
  }
  if (option == -1) {
    alert ("' . $GLOBALS['strPleaseEnter'] . ' "+value);

    return false;
  }

  return true;
}

</script>';
    $html .= formStart('name="subscribeform"');
    # @@@ update
    if (isset($_SESSION['adminloggedin']) && $_SESSION['adminloggedin']) {
        $html .= '<div class="adminmessage"><p><b>' . s('You are logged in as administrator (%s) of this phpList system', $_SESSION['logindetails']['adminname']) . '</b></p>';
        $html .= '<p>' . s('You are therefore offered the following choice, which your subscribers will not see when they load this page.') . '</p>';
        $html .= '<p><a href="' . $GLOBALS['adminpages'] . '" class="button">' . s('Go back to admin area') . '</a></p>';
        $html .= '<p><b>' . s('Please choose') . '</b>: <br/><input type=radio name="makeconfirmed" value="1"> ' . s('Make this subscriber confirmed immediately') . '
      <br/><input type=radio name="makeconfirmed" value="0" checked> ' . s('Send this subscriber a request for confirmation email') . ' </p></div>';
    }
    $html .= '<table border=0>';
    $html .= ListAttributes($attributes, $attributedata, $GLOBALS['pagedata']['htmlchoice'], 0, $GLOBALS['pagedata']['emaildoubleentry']);
    $html .= '</table>';
    //obsolete, moved to rssmanager plugin
    //  if (ENABLE_RSS) { // replaced bij display
    //    $html .= rssOptions($data);
    //   }
    foreach ($GLOBALS['plugins'] as $pluginname => $plugin) {
        #  dbg($plugin->name);
        if ($plugin->enabled) {
            $html .= $plugin->displaySubscriptionChoice($GLOBALS['pagedata']);
        }
    }
    $html .= ListAvailableLists('', $GLOBALS['pagedata']['lists']);
    if (empty($GLOBALS['pagedata']['button'])) {
        $GLOBALS['pagedata']['button'] = $GLOBALS['strSubmit'];
    }
    if (USE_SPAM_BLOCK) {
        $html .= '<div style="display:none"><input type="text" name="VerificationCodeX" value="" size="20"></div>';
    }
    $html .= '<p><input type=submit name="subscribe" value="' . $GLOBALS['pagedata']['button'] . '" onClick="return checkform();"></p></form>';
    $html .= '<br/><br/>';
    if (SHOW_UNSUBSCRIBELINK) {
        $html .= '<p><a href="' . getConfig('unsubscribeurl') . '&id=' . $id . '">' . $GLOBALS['strUnsubscribe'] . '</a></p>';
    }
    $html .= $GLOBALS['PoweredBy'];
    $html .= $GLOBALS['pagedata']['footer'];
    unset($_SESSION['subscriberConfirmed']);
    return $html;
}
Esempio n. 2
0
function subscribePage($id) {
	$data = PageData($id);
  list($attributes,$attributedata) = PageAttributes($data);
  $selected_lists = explode(',',$data["lists"]);
	$html = '<title>'.$GLOBALS["strSubscribeTitle"].'</title>';
  $html .= $data["header"];
  $html .= $data["intro"];
  $html .= '

<br/><font class="required">'.$GLOBALS["strRequired"].'</font><br/>
'.$GLOBALS["msg"].'

<script language="Javascript" type="text/javascript">

var fieldstocheck = new Array();
    fieldnames = new Array();

function checkform() {
  for (i=0;i<fieldstocheck.length;i++) {
    if (eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].value") == "") {
      alert("'.$GLOBALS["strPleaseEnter"].' "+fieldnames[i]);
      eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].focus()");
      return false;
    }
  }
  return true;
}
function addFieldToCheck(value,name) {
  fieldstocheck[fieldstocheck.length] = value;
  fieldnames[fieldnames.length] = name;
}

</script>';
	$html .= formStart('name="subscribeform"');
  if ($_SESSION["adminloggedin"]) {
  	$html .= '<p><b>You are logged in as '.$_SESSION["logindetails"]["adminname"].'</b></p>';
  	$html .= '<p><b>Please choose</b>: <br/><input type=radio name="makeconfirmed" value="1"> Make confirmed immediately
    	<br/><input type=radio name="makeconfirmed" value="0"> Send request for confirmation email </p>';
  }
	$html .= '<table border=0>';
  $html .= ListAttributes($attributes,$attributedata,$data["htmlchoice"]);
	$html .= '</table>';
  if (ENABLE_RSS) {
		$html .= RssOptions($data);
 	}
	$html .= ListAvailableLists("",$data["lists"]);

	$html .= '<p><input type=submit name="subscribe" value="'.$data["button"].'" onClick="return checkform();"></p>
		</form><br/><br/>
		<p><a href="'.getConfig("unsubscribeurl").'">'.$GLOBALS["strUnsubscribe"].'</a></p>
  '.$GLOBALS["PoweredBy"];
	$html .= $data["footer"];
	###### HACK FOR AMP ###########################################################################
	$html='';
	###### END HACK FOR AMP ####################################################################
  return $html;
  
}
function subscribePage($id)
{
    $data = PageData($id);
    if (isset($data['language_file']) && is_file(dirname(__FILE__) . '/texts/' . $data['language_file'])) {
        @(include dirname(__FILE__) . '/texts/' . $data['language_file']);
    }
    list($attributes, $attributedata) = PageAttributes($data);
    $selected_lists = explode(',', $data["lists"]);
    $html = '<title>' . $GLOBALS["strSubscribeTitle"] . '</title>';
    $html .= $data["header"];
    $html .= $data["intro"];
    $html .= '

<br/><font class="required">' . $GLOBALS["strRequired"] . '</font><br/>
' . $GLOBALS["msg"] . '

<script language="Javascript" type="text/javascript">

function checkform() {
  for (i=0;i<fieldstocheck.length;i++) {
    if (eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].type") == "checkbox") {
      if (document.subscribeform.elements[fieldstocheck[i]].checked) {
      } else {
        alert("' . $GLOBALS["strPleaseEnter"] . ' "+fieldnames[i]);
        eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].focus()");
        return false;
      }
    }
    else {
      if (eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].value") == "") {
        alert("' . $GLOBALS["strPleaseEnter"] . ' "+fieldnames[i]);
        eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].focus()");
        return false;
      }
    }
  }
  for (i=0;i<groupstocheck.length;i++) {
    if (!checkGroup(groupstocheck[i],groupnames[i])) {
      return false;
    }
  }
  ';
    if ($data['emaildoubleentry'] == 'yes') {
        $html .= '
  if(! compareEmail())
  {
    alert("' . str_replace('"', '\\"', $GLOBALS["strEmailsNoMatch"]) . '");
    return false;
  }';
    }
    $html .= '
  return true;
}

var fieldstocheck = new Array();
var fieldnames = new Array();
function addFieldToCheck(value,name) {
  fieldstocheck[fieldstocheck.length] = value;
  fieldnames[fieldnames.length] = name;
}
var groupstocheck = new Array();
var groupnames = new Array();
function addGroupToCheck(value,name) {
  groupstocheck[groupstocheck.length] = value;
  groupnames[groupnames.length] = name;
}

function compareEmail()
{
  return (document.subscribeform.elements["email"].value == document.subscribeform.elements["emailconfirm"].value);
}
function checkGroup(name,value) {
  option = -1;
  for (i=0;i<document.subscribeform.elements[name].length;i++) {
    if (document.subscribeform.elements[name][i].checked) {
      option = i;
    }
  }
  if (option == -1) {
    alert ("' . $GLOBALS["strPleaseEnter"] . ' "+value);
    return false;
  }
  return true;
}

</script>';
    $html .= formStart('name="subscribeform"');
    # @@@ update
    if (isset($_SESSION["adminloggedin"]) && $_SESSION["adminloggedin"]) {
        $html .= '<style type="text/css">
      div.adminmessage {
        width: 100%;
        border: 2px dashed #000000;
        padding: 10px;
        margin-bottom: 15px;
        background-color: #E7BE8F;

      }
      </style>';
        $html .= '<div class="adminmessage"><p><b>You are logged in as administrator (' . $_SESSION["logindetails"]["adminname"] . ') of this phplist system</b></p>';
        $html .= '<p>You are therefore offered the following choice, which your users will not see when they load this page.</p>';
        $html .= '<p><a href="' . $GLOBALS['adminpages'] . '">Go back to admin area</a></p>';
        $html .= '<p><b>Please choose</b>: <br/><input type=radio name="makeconfirmed" value="1"> Make this user confirmed immediately
      <br/><input type=radio name="makeconfirmed" value="0" checked> Send this user a request for confirmation email </p></div>';
    }
    $html .= '<table border=0>';
    $html .= ListAttributes($attributes, $attributedata, $data["htmlchoice"], 0, $data['emaildoubleentry']);
    $html .= '</table>';
    if (ENABLE_RSS) {
        $html .= RssOptions($data);
    }
    $html .= ListAvailableLists("", $data["lists"]);
    if (empty($data['button'])) {
        $data['button'] = $GLOBALS['strSubmit'];
    }
    if (USE_SPAM_BLOCK) {
        $html .= '<div style="display:none"><input type="text" name="VerificationCodeX" value="" size="20"></div>';
    }
    $html .= '<p><input type=submit name="subscribe" value="' . $data["button"] . '" onClick="return checkform();"></p>
    </form><br/><br/>
    <p><a href="' . getConfig("unsubscribeurl") . '&id=' . $id . '">' . $GLOBALS["strUnsubscribe"] . '</a></p>
  ' . $GLOBALS["PoweredBy"];
    $html .= $data["footer"];
    return $html;
}
Esempio n. 4
0
function subscribePage($id)
{
    $data = PageData($id);
    list($attributes, $attributedata) = PageAttributes($data);
    $selected_lists = explode(',', $data["lists"]);
    $html = '<title>' . $GLOBALS["strSubscribeTitle"] . '</title>';
    $html .= $data["header"];
    $html .= $data["intro"];
    $html .= '

<br/><font class="required">' . $GLOBALS["strRequired"] . '</font><br/>
' . $GLOBALS["msg"] . '

<script language="Javascript" type="text/javascript">

var fieldstocheck = new Array();
    fieldnames = new Array();

function checkform() {
  for (i=0;i<fieldstocheck.length;i++) {
    if (eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].value") == "") {
      alert("' . $GLOBALS["strPleaseEnter"] . ' "+fieldnames[i]);
      eval("document.subscribeform.elements[\'"+fieldstocheck[i]+"\'].focus()");
      return false;
    }
  }
';
    if ($data['emaildoubleentry'] == 'yes') {
        $html .= '
  if(! compareEmail())
  {
    alert("Email addresses you entered do not match");
    return false;
  }';
    }
    $html .= '
  return true;
}


function addFieldToCheck(value,name) {
  fieldstocheck[fieldstocheck.length] = value;
  fieldnames[fieldnames.length] = name;
}

function compareEmail()
{
  return (document.subscribeform.elements["email"].value == document.subscribeform.elements["emailconfirm"].value);
}

</script>';
    $html .= formStart('name="subscribeform"');
    # @@@ update
    if (isset($_SESSION["adminloggedin"]) && $_SESSION["adminloggedin"]) {
        $html .= '<style type="text/css">
      div.adminmessage {
        width: 100%;
        border: 2px dashed #000000;
        padding: 10px;
        margin-bottom: 15px;
        background-color: #E7BE8F;

      }
      </style>';
        $html .= '<div class="adminmessage"><p><b>You are logged in as administrator (' . $_SESSION["logindetails"]["adminname"] . ') of this phplist system</b></p>';
        $html .= '<p>You are therefore offered the following choice, which your users will not see when they load this page.</p>';
        $html .= '<p><b>Please choose</b>: <br/><input type=radio name="makeconfirmed" value="1"> Make this user confirmed immediately
      <br/><input type=radio name="makeconfirmed" value="0" checked> Send this user a request for confirmation email </p></div>';
    }
    $html .= '<table border=0>';
    $html .= ListAttributes($attributes, $attributedata, $data["htmlchoice"], 0, $data['emaildoubleentry']);
    $html .= '</table>';
    if (ENABLE_RSS) {
        $html .= RssOptions($data);
    }
    $html .= ListAvailableLists("", $data["lists"]);
    $html .= '<p><input type=submit name="subscribe" value="' . $data["button"] . '" onClick="return checkform();"></p>
    </form><br/><br/>
    <p><a href="' . getConfig("unsubscribeurl") . '&id=' . $id . '">' . $GLOBALS["strUnsubscribe"] . '</a></p>
  ' . $GLOBALS["PoweredBy"];
    $html .= $data["footer"];
    return $html;
}