Ok.
Well i have understood what u say but i would like to have some assistance of how to code it?
Thanks
This code should get you going. It's not tested, i wrote i off the top of my head, so let me know if you have any issues which you are unable to resolve.
I would suggest, in order to maintain clean code, move a lot of this into some sort of user management cfc then just invoke User.popupStatus()..etc..
all a matter of taste really.
-------- Set the following application Variables in your application.cfc ------
<cfscript>
//This will save you setting these variables over and over on every request (so long as your application.cfc is written correctly and this is inside onApplicationStart()
application.loginPopup = structNew();
//this means weeks, check here for more info on unit info: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_c-d_28.html
application.loginPopup.repeatUnit = "ww";
application.loginPopup.repeatFrequency = 2; //2 of Unit
</cfscript>
-------- Insert this where ever you want the popup in your post-login page -----
<!--- Replace with what ever your login detection code is etc --->
<cfif IsLoggedIn()>
<!--- Consider moving this to User.cfc (or DAO of sorts) -> getLastPopupDate( Number userId ); --->
<cfquery name="userCheck" datasource="dsn">
SELECT lastPopupDate
FROM tblUser
WHERE userid = <cfqueryparam cfsqltype="cf_sql_integer" value="#session.userId#" />
</cfquery>
<!--- DateDiff documentation here http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_c-d_28.html --->
<cfif DateDiff( application.loginPopup.repeatUnit, checkUser.lastPopupDate, Now() ) GTE application.loginPopup.repeatFrequency>
<script type="text/javascript">
//Your popup code here
</script>
<!--- Change getdate to what ever native date function your DBMS uses, or use a coldfusion param, doesn't really matter --->
<!--- Consider moving this to User.cfc (or DAO of sorts) -> setLastPopupDate( Number userId, DateTime lastDisplayed = Now() ); --->
<cfquery datasource="dsn">
UPDATE tblUser
SET lastPopupDate = getDate()
WHERE userid = <cfqueryparam cfsqltype="cf_sql_integer" value="#session.userId#" />
</cfquery>
</cfif>
</cfif>
Message was edited by: parkerst Adjusted for lack of CfLogin