// Enqueue all css here so that only happens when we're doing something
$this->glmMembersFrontCSS();
- // Get the current theme directory to check for modified views
- $theme = get_template_directory();
-
/*
* Because WordPress insists on forcing the timezone to UTC
* we need to save the current timezone setting, set the one
if ($view) {
// Get the specified view file - check theme first
- $viewPath = "$theme/$plugIn/views";
+ $viewPath = GLM_MEMBERS_PLUGIN_CURRENT_THEME_DIR."/$plugIn/views";
+ $viewPath2 = GLM_MEMBERS_WORDPRESS_PLUGIN_PATH . "$plugIn/views"; // Save default
$viewFile = $view;
- if (!is_file($viewPath.'/'.$viewFile)) {
+ // If the view is not found in the theme, fall back to views in the plugin
+ if (!is_file($viewPath.'/'.$viewFile)) {
// Next try the plugin/add-on
$viewPath = GLM_MEMBERS_WORDPRESS_PLUGIN_PATH . "$plugIn/views";
$viewFile = $view;
$errorMsg .= "<b>Bad or missing view file:</b> $viewPath/$viewFile";
}
-
}
}
'Front-End GLM Associate Error',
$mailMsg
);
- $viewPath = GLM_MEMBERS_WORDPRESS_PLUGIN_PATH.GLM_MEMBERS_PLUGIN_SLUG.'/views';
- $viewFile = 'front/error/index.html';
+// $viewPath = GLM_MEMBERS_WORDPRESS_PLUGIN_PATH.GLM_MEMBERS_PLUGIN_SLUG.'/views';
+// $viewFile = 'front/error/index.html';
require_once GLM_MEMBERS_WORDPRESS_PLUGIN_PATH.GLM_MEMBERS_PLUGIN_SLUG.'/models/front/error/index.php';
$model = new GlmMembersFront_error_index($this->wpdb, $this->config);
$results = $model->modelAction($actionData);
}
// Update the Smarty view path
- $smarty->template->addTemplateDir($viewPath);
+ $smarty->template->setTemplateDir($viewPath);
+
+ // If the view path doesn't match the default, add the default (using theme view)
+ if ($viewPath2 != $viewPath) {
+ $smarty->template->addTemplateDir($viewPath2);
+ }
// Generate output from model data and view
$out = $smarty->template->fetch($viewFile);
define('GLM_MEMBERS_PLUGIN_DB_PREFIX', $wpdb->prefix.'glm_members_');
define('GLM_MEMBERS_PLUGIN_ACTIVE_DB_OPTION', 'glmMembersDatabaseDbVersion');
+// Current Theme Information
+$glmCurrentTheme = wp_get_theme();
+define('GLM_MEMBERS_PLUGIN_CURRENT_THEME', $glmCurrentTheme->get_template());
+define('GLM_MEMBERS_PLUGIN_CURRENT_THEME_DIR', $glmCurrentTheme->get_template_directory());
<h2>Add New {$terms.term_member_cap} Profile</h2>
{/if} <!-- memberInfoID && memberInfo -->
+ {if $memberUpdateError}
+ <h1 class="glm-error">NOTICE: Your {$terms.term_member} information has not yet been submitted.<br>Please select the tabs indicating a problem, correct the indicated fields and resubmit.</h1>
+ {/if}
+
+
<form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
<input type="hidden" name="glm_action" value="memberInfo">
<input type="hidden" name="member" value="{$member.id}">