Westside2004
asked on
Showing user an image dynamically for a day?
Hi,
I wanted to see if someone can help with this issue.
I wanted to add this small feature for our site. Basically when a user creates a new document in our web based app, we show the user a list of the documents associated with their account in a nice html table. Their documents are listed as hyperlinks.
I want to display a simple image on my page that has the words "new" on it next to the hyperlink if the document was created "today". So for the whole day the user would see the *New* image next to the hyperlink.
The next day when the user logs in, the new image would be gone as it would be the next day.
How can I accomplish this? Does it involve client variables or would it be done through a cookie? If user does not accept cookies, what alternatives are there? It is my understanding that client variables compare the information from a db or a registry to a cookie on the users machine so if the user does not have cookies enabled, what does the client var in our db compare itself to???
Thanks,
West
I wanted to see if someone can help with this issue.
I wanted to add this small feature for our site. Basically when a user creates a new document in our web based app, we show the user a list of the documents associated with their account in a nice html table. Their documents are listed as hyperlinks.
I want to display a simple image on my page that has the words "new" on it next to the hyperlink if the document was created "today". So for the whole day the user would see the *New* image next to the hyperlink.
The next day when the user logs in, the new image would be gone as it would be the next day.
How can I accomplish this? Does it involve client variables or would it be done through a cookie? If user does not accept cookies, what alternatives are there? It is my understanding that client variables compare the information from a db or a registry to a cookie on the users machine so if the user does not have cookies enabled, what does the client var in our db compare itself to???
Thanks,
West
ASKER
Yes, that makes sense..
Will try what you gave me..
I am basically looking to show the image if the document is 6 hours old or less, if so, mark it new by showing the new img
Otherwise, don't show any image at all..
Thanks
-West
Will try what you gave me..
I am basically looking to show the image if the document is 6 hours old or less, if so, mark it new by showing the new img
Otherwise, don't show any image at all..
Thanks
-West
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
HI,
Will try it now..
What is the "h"?
Will try it now..
What is the "h"?
Hi Westside2004,
seth has good suggestion. h stands for hour. As you are looking for six hours difference.
Regards,
---Pinal
seth has good suggestion. h stands for hour. As you are looking for six hours difference.
Regards,
---Pinal
ASKER
Ok..
I thought that... but wanted to just make sure...
Thanks
-Westside
I thought that... but wanted to just make sure...
Thanks
-Westside
Hey West,
All you need is the age of the document.
Wether it's a file or a record in a database, there should be a date associated with it's creation. Use that date to determine wether the 'new' graphic gets displayed or not:
<cfif datediff(userdocument.date
Something like that.
Regards,
Seth