How to [in theory] influence members to edit their profiled:
-
Note steps outlined below are pretty straight forward
-
There are is a how to setting cookie value/time interval
-
*Disclaimer; please make sure you adhere to applicable rules about using cookies
### STEP 1 ###
Upload “jquery.cookie.js” script file (provided separately via link below) to the site… (Dashboard > Website > Files… within the /resources/Site folder).
### STEP 2 ###
Copy/Paste the following “Custom Profile Edit script by Nicasio LLC” javascript to the top of “Global javascript” editor… (Dashboard > Website > Settings > Global javascript):
<!– Custom Profile Edit script by Nicasio LLC –>
<!– Needed for forceProfileEdit() –>
<script type=”text/javascript” src=”/resources/Site/jquery.cookie.js”></script>
<script>
jq$(document).ready(function() {
/* Change this number for days between forcing a user to edit their profile */
fpe_cookie_days = 1;
/* Change this message for alerting a user to edit their profile */
fpe_alert_msg = “It appears you haven’t updated your profile in a while. Please check for new membership fields and update your profile as needed.”;
// uncomment to reset cookie (for testing purposes only)…
//jq$.removeCookie(‘forceProfileEdit’, { path: ‘/’ });
/* Pushes member to the Edit Profile form, if necessary, on page load, only when logged in, or shows the page content */
if ( jq$(‘body.memberContentView’).length > 0 ) {
forceProfileEdit(fpe_cookie_days);
} else {
jq$(‘html’).show();
}
// Where the magic happens (a function)…
function forceProfileEdit(fpe_cookie_days) {
// Check for existence of our cookie being used conditionally…
if ( !jq$.cookie(‘forceProfileEdit’) ) {
// Our cookie doesn’t exist so we need to take action…
// Force the user to the edit profile form…
if ( jq$(‘#FunctionalBlock1_ctl00_ctl00_editButtonTop‘).length > 0 ) {
// The “Edit Profile” button exists on this page…
// Create the cookie…
jq$.cookie(‘forceProfileEdit’, ‘true’, { expires: fpe_cookie_days, path: ‘/’ });
// Create a cookie for alerts/customizations to page…
jq$.cookie(‘forceProfileEdit_alert’, ‘true’, { expires: fpe_cookie_days, path: ‘/’ });
// Click that button to force the user to the edit form…
jq$(‘#FunctionalBlock1_ctl00_ctl00_editButtonTop‘).click();
} else {
// We must not be on the Edit Profile page…
// So redirect to the Edit Profile page first…
window.location = ‘/Sys/Profile’;
}
} else {
// Our cookie exists…
// So forget about creating the cookies and the redirect, and show the hidden page content instead…
// But let’s add in a check for our custom alert cookie…
if ( !jq$.cookie(‘forceProfileEdit_alert’) ) {
// custom alerts not necessary
// Ok, load content as usual…
jq$(‘html’).show();
} else {
// custom alerts are necessary
// lets include our alert message when viewing the edit profile form…
if ( jq$(‘.WaGadgetContactProfileStateMain’).length > 0 ) {
// add our alert mesage to the page
jq$(‘.WaGadgetContactProfileStateMain’).prepend(‘<div id=”forceEditProfile_alertMsg” class=”commonMessageBox”><div class=”confirmWindowWarning”><div class=”cww”><div class=”cww1″></div><div class=”cww2″></div><div class=”cww3″></div><div class=”cww4″></div></div><div class=”cww-inner”><div class=”cww-co”><div class=”text”>’ + fpe_alert_msg + ‘</div></div></div><div class=”cww”><div class=”cww4″></div><div class=”cww3″></div><div class=”cww2″></div><div class=”cww1″></div></div></div></div>’);
}
// Ok, load content as usual…
jq$(‘html’).show();
// remove the alert cookie so it isn’t persistent
$.removeCookie(‘forceProfileEdit_alert’, { path: ‘/’ });
}
}
}
});
</script>
<!– End Custom Profile Edit script –>
#### STEP 3 ###
You can set the duration of the time between forcing the alert in the “Custom Profile Edit script by Nicasio LLC” code above, by changing the “fpe_cookie_days = 1;” value… where 1 is equal to 1 day.
i.e., fpe_cookie_days = 60; would wait 60 days between each log in.
Make this change in the “Custom Profile Edit script” above within the Global javascript editor and remember to Save your changes.
#### STEP 4 ###
Copy/Paste the following custom CSS code to the top of “CSS Customization” editor… (Dashboard > Website > CSS):
/* Profile Edit CSS
Added by Nicasio LLC
Avoids page load lag seen with Profile Edit script
Html shown after Profile Edit script runs
Remove if Profile Edit script is not being used!
*/
html {
display: none;
}
/* End Profile Edit CSS by Nicasio LLC *
/
4576-WA_Nicasio_Profile-Edit-Alert