Поддержка Проблемы и решения Передать post_title and post_url в форму заказа, доработка (SMCF)

  • Использую плагин SimpleModal Contact Form (SMCF) подскажите пожалуйста как сделать чтобы в поле «Тема» автоматом прописывалось название и ссылка страницы с которой пользователь отправляет мне письмо. В старой форме это осуществлялось при помощи:

    <?php $url = $_SERVER['HTTP_REFERER']; echo $url;?>

    Часть кода плагина, форма:

    // create the contact form HTML
    		$output .= "<div id='smcf-content' style='display:none'>
    	<div class='smcf-top'></div>
    	<div class='smcf-content'>
    		<h1 class='smcf-title'>" . $title . "</h1>
    		<div class='smcf-loading' style='display:none'></div>
    		<div class='smcf-message' style='display:none'></div>
    		<form action='" . $url["path"] . "/smcf_data.php' style='display:none'>
    			<label for='smcf-name'>*" . __("Name", "smcf") . ":</label>
    			<input type='text' id='smcf-name' class='smcf-input' name='name' value='' tabindex='1001' />
    			<label for='smcf-email'>*" . __("Email", "smcf") . ":</label>
    			<input type='text' id='smcf-email' class='smcf-input' name='email' value='' tabindex='1002' />";
    
    		if (get_option("smcf_form_subject") == 1) {
    			$output .= "<label for='smcf-subject'>" . __("Subject", "smcf") . ":</label>
    			<input type='text' id='smcf-subject' class='smcf-input' name='subject' value='' tabindex='1003' />";
    		}
    
    		$output .= "<label for='smcf-message'>*" . __("Message", "smcf") . ":</label>
    			<textarea id='smcf-message' class='smcf-input' name='message' cols='40' rows='4' tabindex='1004'></textarea><br/>";
    
    		if (get_option("smcf_form_cc_sender") == 1) {
    			$output .= "<label> </label>
    			<input type='checkbox' id='smcf-cc' name='cc' value='1' tabindex='1005' /> <span class='smcf-cc'>" . __("Send me a copy", "smcf") . "</span>
    			<br/>";
    		}
    
    		$output .= "<label> </label>
    			<button type='submit' class='smcf-button smcf-send' tabindex='1006'>" . __("Send", "smcf") . "</button>
    			<button type='submit' class='smcf-button smcf-cancel simplemodal-close' tabindex='1007'>" . __("Cancel", "smcf") . "</button>
    			<input type='hidden' name='token' value='" . $this->token() . "'/>
    			<br/>
    		</form>
    	</div>
    	<div class='smcf-bottom'><a href='http://www.ericmmartin.com/projects/smcf/'>" . __('Powered by', 'smcf') . " SimpleModal Contact Form</a></div>
    </div>";
    
    		echo $output;
    	}
    
    	function page_menu_list($page) {
    		$title = get_option("smcf_link_title");
    		$find = '/title="'.$title.'"/';
    		$replace = 'title="'.$title.'" class="smcf-link"';
    		return preg_replace($find, $replace, $page);
    	}
    
    	function token() {
    		$admin_email = get_option("admin_email");
    		return md5("smcf-" . $admin_email . date("WY"));
    	}
    }
    
    $smcf = new SimpleModalContactForm();
Просмотр 2 ответов — с 1 по 2 (всего 2)
Просмотр 2 ответов — с 1 по 2 (всего 2)
  • Тема «Передать post_title and post_url в форму заказа, доработка (SMCF)» закрыта для новых ответов.