EasyCFM.COM ColdFusion Forums / Coding Help! / "New" is it possible?

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: "New" is it possible?

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

MIGhunter
03-01-2009 @ 5:30 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 570
Joined: Apr 2006

I have a system where I put in a blog type story on a gaming site.  It's set up so my gaming buddies can add comments but there is no login.  Is it possible to set it up so that it flags the stories when there is a new comment added?  Then when they view the page with the new comment it's marked as read?

MIGhunter
03-03-2009 @ 12:05 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 570
Joined: Apr 2006

any suggestions?

Webmaster
03-03-2009 @ 2:52 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

Are you keeping track of a post date?

Pablo Varando
Senior Application Architect
EasyCFM.COM, LLC.

904.483.1457 \\ mobile
webmaster@easycfm.com \\email

\m/ (>.<) \m/
--- rock on ---

MIGhunter
03-03-2009 @ 4:01 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 570
Joined: Apr 2006

Yes, I'm using CreateODBC(now()) to insert the time and date someone posts a comment.  Here is an example: http://botdls.com/blog_FullStory.cfm?blog_ID=44

Also, I'm using"

#DateFormat(commentDate, "mm/dd/yyyy")# at #TimeFormat(commentDate, "hh:mm:ss tt")#


to display the time.  How come all of the times say 12:00:00 AM?
Here is the insert code:

<html>
<head>
     <title>Input form</title>
</head>

<body>
<!--- Insert the new record --->
<cfquery name="AddComment" datasource="botd_2008" username="****" password="****">
     INSERT INTO event_blog_comments
     (blog_ID, commentContent, commentDate, name)
     VALUES (
               <cfqueryparam cfsqltype="cf_sql_integer" value="#Val(url.blog_ID)#">,
               <cfqueryparam cfsqltype="cf_sql_varchar" value="#Trim(Form.commentContent)#">,
               <cfqueryparam cfsqltype="cf_sql_date" value="#CreateODBCDate(now())#">,
               <cfqueryparam cfsqltype="cf_sql_varchar" value="#Trim(Form.name)#">
               )
</cfquery>

<h1>Comment Added</h1>
<cfoutput>You have added the comment, "#Form.commentContent# on #DateFormat(Now(), "mm/dd/yyyy")# to the
               Comment database.<br><br>
               <a href="../blog_FullStory.cfm?blog_ID=#val(URL.blog_ID)#">[Back]</a>
               
               
</cfoutput>

</body>
</html>


commentDate is a MySQL Date field.  Should it be a timestamp? {EDIT}I tried changing my table to DateTime and TimeStamp for the date field.  Didn't change anything.  I also tried changing the insert to CreateODBCDateTime(now()) and it didn't work.

This message was edited by MIGhunter on 3-3-09 @ 4:20 PM

MIGhunter
03-05-2009 @ 7:15 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 570
Joined: Apr 2006

So Pablo, I've been racking my brain and can't come up with a solution to making a new using the post date.  What were you thinking?

Webmaster
03-05-2009 @ 7:25 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

ok, create a secondary table.

commentID, userID, viewDate

then on each read; you insert a record in this table.

If no record exits; its unread. Otherwise it's read.

Pablo Varando
Senior Application Architect
EasyCFM.COM, LLC.

904.483.1457 \\ mobile
webmaster@easycfm.com \\email

\m/ (>.<) \m/
--- rock on ---

MIGhunter
03-05-2009 @ 9:15 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 570
Joined: Apr 2006

ok, first, I figured out the date issue I was having.  I took out the date insert in my code and just used MySQL to set the date.

Second, that is the problem.  There is no user table and no user ID.  Maybe that should be my next project.

megan
03-06-2009 @ 10:29 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 2398
Joined: Jan 2003

if there is no user id then you would have to use cookies - write the id of the comment to the user cookie when it is read, if the id of the comment is not in the cookie then show the flag - only thing is if they flush their cookies etc everything will be new again ;P - hth ~megan

-------------------------------------------------------
If you have a hobby you love, then you can create a profitable online business
that gives you an autopilot income stream in 30 days or less


Website Designed and Developed by Pablo Varando.