>- see footer for list info -<
hi Peter

For the first part, have a form with whatever fields your President
needs, perhaps Title, Summary and Main Text.  Main Text and perhaps
Summary being textareas, Title being a text field.  Submit this form to
another .cfm file, which stores the info in the database.  Then have a
page that grabs this information from the database, either the most
recent one, or the archived list.

Form page: 
<form action="page2.cfm" method="post">
Title: <input type="text" name="Title"><br>
Summary: <textarea name="summary" rows="5" cols="30"></textarea><br>
Main Text:  <textarea name="MainText" rows="5"
cols="30"></textarea><br>
<input type="Submit">
</form>

page2: 
<cfparam name="Form.Title" default="">
<cfparam name="Form.Summary" default="">
<cfparam name="Form.MainText" default="">

<!--- check they entered something --->
<cfif Len(Form.Title) OR Len(Form.Summary) OR Len(Form.MainText)>
  <!--- store the info in the database --->
  <cfquery name="addData" datasource="#yourDSN#">
    INSERT 
    INTO Messages (Title, Summary, MainText, DatePosted)
    VALUES ('#Form.Title#', '#Form.Summary#', 
'#Form.MainText#', '#Now()#')
  </cfquery>
  Your data has been saved.
<cfelse>
  You must enter something! 
</cfif>

To display most recent message: 
<!--- gets most recent message --->
<cfquery name="getMessage"  datasource="#yourDSN#">
  SELECT TOP 1 * 
  FROM Messages
  ORDER BY DatePosted DESC
</cfquery>

<cfif getMessage.RecordCount GT 0>
  <cfoutput query="getMessage">
    #getMessage.Title# - #DateFormat(getMessage.DatePosted)#<br>
    #getMessage.Summary#<br>
    #getMessage.MainText#<br>
  </cfoutput>
<cfelse>
  No message of the day available.
</cfif>

To list older messages: 
<cfquery name="getArchivedMessages"  datasource="#yourDSN#">
  SELECT *
  FROM Messages
  ORDER BY DatePosted DESC
</cfquery>

<cfif getArchivedMessages.RecordCount GT 1>
<!--- just display the title and summary --->
  <cfoutput query="getArchivedMessages" startrow="2">
  <!--- start at the second row, as the first one is our most recent
message --->
    <a
href="messageDetails.cfm?ID=#getMessage.ID#">#getMessage.Title#</a> -
#DateFormat(getMessage.DatePosted)#<br>
    #getMessage.Summary#<br>
   </cfoutput>
</cfif>

Display more details of the archive message: 
<cfparam name="URL.ID" default="">

<cfif IsNumeric(URL.ID)>
  <cfquery name="getMessage"  datasource="#yourDSN#">
    SELECT *
    FROM Messages
    WHERE ID = #URL.ID#
  </cfquery>
<cfelse>
  ID has to be numeric.
</cfif>

<cfif getMessage.RecordCount GT 0>
  <cfoutput query="getMessage">
    #getMessage.Title# - #DateFormat(getMessage.DatePosted)#<br>
    #getMessage.Summary#<br>
    #getMessage.MainText#<br>
  </cfoutput>
<cfelse>
  No message found.
</cfif>


That's a very simplistic way of doing it, with a lot of room for
improvement, but it's just to give you an idea of how you might want to
go about it.  


Duncan Cumming
New Media Developer
700 4105 / 01592 414105 

>>> [EMAIL PROTECTED] 14/12/2004 17:25:43 >>>
>- see footer for list info -<
Good morning everyone,

    I just wanted to drop a quick note to introduce myself.  My name
is
Peter Donahue, and I'm from San Antonio Texas here in the good old USA.
I
live here with my wife Mary.  I was introduced to Cold Fusion during
the
past few months while taking an Internet Commerce Course at Northwest
Vista
College here in San Antonio.  Of all of the Web Languages I've seen
for
adding interactivity I find Cold Fusion to be the most
programmer/developer
friendly.  What really drew me to the language is the fact that one can
add
this interactivity and write CF pages with nothing more than a good
text
editor such as Notepad.  This is especially important if you're a
blind
developer who must rely on special software called screen readers to
access
your computer's screen output.  I was amazed at how easy it was to
implement
a database in to several websites I'm developing by using CF and
notepad
instead of a clunky Web Editing program such as FrontPage.   I say
clunky in
that these packages do not always work well with screen reading
software.
Efforts are under way to make Macromedia's Dream Weaver blind-friendly.
 If
you want to check out my CF work to date visit:
http://www.freecfm.com/0/1nvc/index.cfm 

    I'm also developing my first CF Website for an organization Mary
and I
belong to.  You can get to that site from the URL given above.

    The President of the organization mentioned above wants the ability
to
be able to post a periodic message to the website for our visitors.  I
told
him I could develop a form he could use to compose the message which
would
appear on a page on the site.  Having the ability to archive these
messages
to allow visitors to view previous messages is also wanted.  If anyone
has
code, or tutorials I can check out for creating a message posting
facility
I'll appreciate that very much.

    We also want to add the ability to include photo albums and
slideshows
too.  If you have code, or know of good tutorials for developing these
components in CF that will be appreciated also.

    Anyway that's a little about me to allow you to know who I am, and
what
I'm doing with CF.  Take care and have a great day.

Peter Donahue----- Original Message ----- 
From: "Tim Blair" <[EMAIL PROTECTED]>
To: "Coldfusion Development" <[EMAIL PROTECTED]>
Sent: Tuesday, December 14, 2004 3:19 AM
Subject: RE: [CF-Dev] DNS service


>- see footer for list info -<

> Any other recommendations?

http://www.gradwell.com/ 

Blimey, that's the second recommendation Peter's been given in a
week...
Anyone would think we know him or something ;)

Seriously: very good service, always willing to help out where needed.
Complete control panel allows hosting of email/web/ftp etc too, but
the
DNS service gives total control over your zone file, so you can add
what
you like!

Tim.


--
-------------------------------------------------------
Badpen Tech - CF and web-tech: http://tech.badpen.com/ 
-------------------------------------------------------
    RAWNET LTD - independent digital media agency
    "We are big, we are funny and we are clever!"
     New site launched at http://www.rawnet.com/ 
-------------------------------------------------------
This message may contain information which is legally
privileged and/or confidential.  If you are not the
intended recipient, you are hereby notified that any
unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such
notification notwithstanding, any comments, opinions,
information or conclusions expressed in this message
are those of the originator, not of rawnet limited,
unless otherwise explicitly and independently indicated
by an authorised representative of rawnet limited.
------------------------------------------------------- 

_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go
to
http://list.cfdeveloper.co.uk/mailman/listinfo 

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your
help -<


_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go
to http://list.cfdeveloper.co.uk/mailman/listinfo 

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your
help -<


**********************************************************************
This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed and 
should not be disclosed to any other party. 
If you have received this email in error please notify your system manager and 
the sender of this message.

This email message has been swept for the presence of computer viruses but no 
guarantee is given that this e-mail message and any attachments are free from 
viruses.

Fife Council
Tel: +44 (0) 1592 414141
**********************************************************************

_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to