|
@@ -151,6 +151,16 @@ if (!class_exists("plug_login")) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ function get_page_by_name($post_name, $output = OBJECT) {
|
|
|
+ global $wpdb;
|
|
|
+ $post = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_name = %s AND post_type='page'", $post_name));
|
|
|
+ if ($post) {
|
|
|
+ return get_post($post, $output);
|
|
|
+ }
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
function l_stylesheet_directory_uri($t) {
|
|
|
return str_replace(WP_SITEURL, WP_SITEURL_CDN, $t);
|
|
|
}
|
|
@@ -211,7 +221,25 @@ if (!class_exists("plug_login")) {
|
|
|
<p>';
|
|
|
|
|
|
if (isset($_GET['action'])) {
|
|
|
- $str .= get_option($this->pluginname . "_login_support_splash_" . $_GET['action'], false);
|
|
|
+ $type = isset($_GET['type']) ? $_GET['type'] : 'default';
|
|
|
+
|
|
|
+ if ($type !== "default") {
|
|
|
+
|
|
|
+ //print_r($args);
|
|
|
+ $page = $this->get_page_by_name($type);
|
|
|
+
|
|
|
+ if ($page) {
|
|
|
+ $str .= apply_filters('the_content', $page->post_content);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ $str .= get_option($this->pluginname . "_login_support_splash_" . $_GET['action'], false);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ $str .= get_option($this->pluginname . "_login_support_splash_" . $_GET['action'], false);
|
|
|
+
|
|
|
+ }
|
|
|
} else {
|
|
|
$str .= get_option($this->pluginname . "_login_support_splash", false);
|
|
|
}
|
|
@@ -228,15 +256,15 @@ if (!class_exists("plug_login")) {
|
|
|
}
|
|
|
|
|
|
function login_head() {
|
|
|
- $type = (empty($_REQUEST['type']) || !($_REQUEST['type'] == "Select" || $_REQUEST['type'] == "Pro")) ? " " : $_REQUEST['type'];
|
|
|
- if ($type !== "") {
|
|
|
+ $type = isset($_GET['type']) ? $_GET['type'] : 'default';
|
|
|
+ if ($type !== "default") {
|
|
|
?>
|
|
|
<script type='text/javascript' src='/wp-includes/js/jquery/jquery.js?ver=1.4.2'></script>
|
|
|
<script type="text/javascript">
|
|
|
jQuery(document).ready(function(){
|
|
|
if(jQuery("form").length>0 && jQuery("form").attr('action').indexOf('register')>-1){
|
|
|
console.log("SPECIAL REGV");
|
|
|
- jQuery("form").prepend('<h3><?php echo ($type) ?></h3><br>');
|
|
|
+ //jQuery("form").prepend('<h3><?php echo ($type) ?></h3><br>');
|
|
|
jQuery("p:contains('Brugernavn')").hide();
|
|
|
|
|
|
jQuery("#user_email").attr("tabindex","24")
|
|
@@ -284,7 +312,7 @@ if (!class_exists("plug_login")) {
|
|
|
}
|
|
|
|
|
|
function plugin_form() {
|
|
|
- $type = "Perspektiv"; //;(empty($_REQUEST['type']) || !($_REQUEST['type'] == "Select" || $_REQUEST['type'] == "Pro")) ? "Select" : $_REQUEST['type'];
|
|
|
+ $type = isset($_GET['type']) ? $_GET['type'] : 'default';
|
|
|
|
|
|
//19094 __system_side_medlem_af
|
|
|
//$tt = get_post( 19094);
|
|
@@ -296,15 +324,16 @@ if (!class_exists("plug_login")) {
|
|
|
|
|
|
$arr = explode("\n", get_option($this->pluginname . "_login_groups", false));
|
|
|
|
|
|
- $sel = '<select name="r_membership" id="r_membership" class="input nnl" tabindex="26">';
|
|
|
- $sel .= '<option ' . ((!isset($_POST['r_membership']) || $_POST['r_membership'] === "") ? "selected" : "") . '>Vælg </option>';
|
|
|
- foreach ($arr as $ii => $title) {
|
|
|
- if (strlen($title) > 3) {
|
|
|
- $sel .= '<option value="' . $title . '" ' . (isset($_POST['r_membership']) && $_POST['r_membership'] === $title ? "selected" : "") . '>' . $title . '</option>';
|
|
|
- }
|
|
|
- }
|
|
|
- $sel .= '</select>';
|
|
|
-
|
|
|
+/* $sel = '<select name="r_membership" id="r_membership" class="input nnl" tabindex="26">';
|
|
|
+$sel .= '<option ' . ((!isset($_POST['r_membership']) || $_POST['r_membership'] === "") ? "selected" : "") . '>Vælg </option>';
|
|
|
+foreach ($arr as $ii => $title) {
|
|
|
+if (strlen($title) > 3) {
|
|
|
+$sel .= '<option value="' . $title . '" ' . (isset($_POST['r_membership']) && $_POST['r_membership'] === $title ? "selected" : "") . '>' . $title . '</option>';
|
|
|
+}
|
|
|
+}
|
|
|
+$sel .= '</select>';
|
|
|
+ */
|
|
|
+ $sel = '<input type="hidden" name="r_membership" id="r_membership" value="' . $type . '">';
|
|
|
$html = '
|
|
|
<style type="text/css">
|
|
|
.nnl {
|
|
@@ -335,9 +364,8 @@ if (!class_exists("plug_login")) {
|
|
|
|
|
|
|
|
|
<p>
|
|
|
- <label style="display: block; margin-bottom: 5px;">' . __('Vælg', 'Vælg') . '
|
|
|
' . $sel . '
|
|
|
- </label>
|
|
|
+
|
|
|
</p>
|
|
|
|
|
|
|