<script type="text/javascript">(function() {
if (window.pluso)if (typeof window.pluso.start == "function") return;
if (window.ifpluso==undefined) { window.ifpluso = 1;
var d = document, s = d.createElement('script'), g = 'getElementsByTagName';
s.type = 'text/javascript'; s.charset='UTF-8'; s.async = true;
s.src = ('https:' == window.location.protocol ? 'https' : 'http') + '://share.pluso.ru/pluso-like.js';
var h=d[g]('body')[0];
h.appendChild(s);
}})();
var pluso_div = querySelector('div.pluso');
pluso_div.setAttribute('data-url', '{$details_url}', 'data-title', '{$listing.title}', 'data-description', '{$listing.description_formatted}');
</script>
var pluso_div = querySelector('div.pluso');
pluso_div.setAttribute('data-url', 'http://custom-url');
<script type="text/javascript">(function() {
if (window.pluso)if (typeof window.pluso.start == "function") return;
if (window.ifpluso==undefined) { window.ifpluso = 1;
var d = document, s = d.createElement('script'), g = 'getElementsByTagName';
s.type = 'text/javascript'; s.charset='UTF-8'; s.async = true;
s.src = ('https:' == window.location.protocol ? 'https' : 'http') + '://share.pluso.ru/pluso-like.js';
var h=d[g]('body')[0];
h.appendChild(s);
}})();</script>
<?php
\error_reporting(0); // запрещаем вывод сообщений о возможных ошибках
function test_mail($char) { // функция, проверяющая реальность адреса
return (boolean) \preg_match('/[\w\d\._-]+@[\w\d\._-]+\.[\w\d]{2,}/u', $char);
}
function find_mail($maillist, $email) { // функция, проверяющая наличие адреса в базе
$result = FALSE;
foreach ($maillist as $key => $part) {
if ($email == \trim($part)) {
$result = $key; // возвращаем порядковый номер адреса, если он найден
break;
}
}
return $result;
}
function add_mail($file, $email) {
\file_put_contents($file, "$email\n", FILE_APPEND);
}
function remove_mail($file, $maillist, $key) {
unset($maillist[$key]);
\file_put_contents($file, \implode('', $maillist));
}
$message = ''; // здесь будет сообщение о результате действия
if (!empty($_POST)) { // если форма отправлена
$fromemail = 'admin'; // адрес администратора для отправки ошибок
$email = \trim(\strtolower(\htmlentities($_POST['email']))); // очищаем введённый адрес
$file = "maillist.txt"; // файл, содержащий адреса
if (\file_exists($file)) { // файл существует
$maillist = \file($file);
if (!empty($email) && test_mail($email)) { // email не пустой и правильный
$key = find_mail($maillist, $email); // номер адреса в базе или FALSE, если такого нет
if (isset($_POST['subscribe'])) { // запрошена подписка на рассылку
if ($key === FALSE) { // email нет в базе
add_mail($file, $email);
$message = "E-mail: $email добавлен в базу рассылки.";
} else { // email уже есть в базе
$message = "E-mail: $email уже есть в базе рассылки.";
}
} elseif (isset($_POST['unsubscribe'])) { // запрошена отписка от рассылки
if ($key === FALSE) { // email нет в базе
$message = "E-mail: $email не найден в базе рассылки.";
} else {
remove_mail($file, $maillist, $key);
$message = "E-mail: $email удален из базы рассылки.";
}
}
} else { // email пустой или неправильный
$message = "E-mail: $email не сушествует.";
}
} else { // файл не существует
$message = "Не найден файл $file ! Пожалуйста <A HREF=\"mailto:$fromemail\">сообщите</a> мне об ошибке.";
}
}
\header('Content-Type: text/html; charset=utf-8;');
?>
<p><?=$message?></p>
<form method="post">
<fieldset>
<legend>Отписаться от рассылки</legend>
<label for="email">Введите e-mail:</label>
________________
!!!!!<textarea type="text" id="email" name="email" size="30" required></textarea>!!!!!
_______________
<input type="submit" name="unsubscribe" value="Отписаться">
</fieldset>
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://.site/auto/chosen.jquery.js"></script>
<script>
$('.chosen-select').chosen();
</script>
<select name="{$v.depending.caption1}" class="chosen-select" id="{$v.depending.caption1}" onchange="selDepending(1, '{$v.depending.caption1}', '{$v.depending.caption2}', '{$v.depending.id}', {if isset($category) && $category}{$category}{else}0{/if}, {if $v.other_val}1{else}0{/if}, '{$lng.general.other}', {if $v.all_val}1{else}0{/if}, '{$lng.general.all}', '{$live_site}', '')" {if in_array($v.depending.caption1, $gmaps_unique)}onblur="autoLocator_{$gmaps_fields[$v.depending.caption1]}();"{/if} {if isset($edit) && $edit && !$v.editable}readonly{/if}>
<option value="">{$v.depending.top_str1}</option>
{if $v.other_val}<option value="-1" {if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1] && !in_array($tmp[$v.depending.caption1], $v.depending.elements)}selected="selected"{/if}>{$lng.general.other}</option>{/if}
{if $v.all_val}<option value="all" {if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1]=="all"}selected="selected"{/if}>{$lng.general.all}</option>{/if}
{foreach from=$v.depending.elements item=t}
<option value="{$t.name}" {if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1]==$t.name} selected="selected"{/if}>{$t.name}</option>
{/foreach}
</select>
<input type="hidden" name="dep_id_{$v.depending.caption1}" id="dep_id_{$v.depending.caption1}" value="" />
{if $v.other_val}
{if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1] && !in_array($tmp[$v.depending.caption1], $v.depending.elements)}
<span id="span_{$v.depending.caption1}_other_val"> <input type="text" name="{$v.depending.caption1}_other_val" value="{$tmp[$v.depending.caption1]}"></span>
{else}
<span id="span_{$v.depending.caption1}_other_val" style="display: none;"> <input type="text" name="{$v.depending.caption1}_other_val"/></span>
{/if}
{/if}
</div>{* end fel *}
<div class="fel">
<label for="{$v.depending.caption2}">{$v.depending.name2}{if $v.depending.required2==1}<span class="mandatory"> *</span>{/if}{if $v.info_message} <a href="javascript:;" class="info_icon tooltip" title="{$v.info_message}" >i</a>{/if}</label>
<select disabled='disabled' class="chosen-select" name="{$v.depending.caption2}" id="{$v.depending.caption2}" {if $v.depending.no>2}onchange="selDepending(2, '{$v.depending.caption2}', '{$v.depending.caption3}', '{$v.depending.id}', 0, {if $v.other_val}1{else}0{/if}, '{$lng.general.other}', {if $v.all_val}1{else}0{/if}, '{$lng.general.all}', '{$live_site}', 'dep_id_{$v.depending.caption1}')"{else}{if $v.other_val}onchange="checkOther(this.form.{$v.depending.caption2}, '{$v.depending.caption2}')"{/if}{/if} {if in_array($v.depending.caption2, $gmaps_unique)}onblur="autoLocator_{$gmaps_fields[$v.depending.caption2]}();"{/if} >
<option value="">{$v.depending.top_str2}</option>
</select>
<input type="hidden" name="dep_id_{$v.depending.caption2}" id="dep_id_{$v.depending.caption2}" value="" />
{if $v.other_val}
<span id="span_{$v.depending.caption2}_other_val" style="margin-left: 10px; display: none;">
<input type="text" name="{$v.depending.caption2}_other_val" id="{$v.depending.caption2}_other_val" value="{if isset($tmp[$v.depending.caption2])}{$tmp[$v.depending.caption2]}{/if}"/>
</span>
{/if}
{if $v.depending.no>=3}
<select name="{$v.depending.caption1}" class="mselect catselect" id="{$v.depending.caption1}" onchange="selDepending(1, '{$v.depending.caption1}', '{$v.depending.caption2}', '{$v.depending.id}', {if isset($category) && $category}{$category}{else}0{/if}, {if $v.other_val}1{else}0{/if}, '{$lng.general.other}', {if $v.all_val}1{else}0{/if}, '{$lng.general.all}', '{$live_site}', '')" {if in_array($v.depending.caption1, $gmaps_unique)}onblur="autoLocator_{$gmaps_fields[$v.depending.caption1]}();"{/if} {if isset($edit) && $edit && !$v.editable}readonly{/if}>
<option value="">{$v.depending.top_str1}</option>
{if $v.other_val}<option value="-1" {if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1] && !in_array($tmp[$v.depending.caption1], $v.depending.elements)}selected="selected"{/if}>{$lng.general.other}</option>{/if}
{if $v.all_val}<option value="all" {if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1]=="all"}selected="selected"{/if}>{$lng.general.all}</option>{/if}
{foreach from=$v.depending.elements item=t}
<option value="{$t.name}" {if isset($tmp[$v.depending.caption1]) && $tmp[$v.depending.caption1]==$t.name} selected="selected"{/if}>{$t.name}</option>
{/foreach}
</select>
скрипт подключаю вот так