RE: [PHP] RE: phpwiki save button

2002-01-24 Thread Tim Ward

without the full source code of the classes you are using I'd be guessing,
but within savePreview() and savePage() $content is passed to an object
method that does the saving. You could just pass date("d/m/Y H:i:s - ") .
$content instead of $content. However it looks like this may be amended from
previous versions ... if so you'll need to strip the first x characters from
the front ... but this is getting messy.

the better way to do this is with a last_updated field in the database
holding a timestamp and handle including it at the top of the text when
displaying. I'd be surprised if the table doesn't already have a field like
that. 


Tim
www.chessish.com

> -Original Message-
> From: Tim Bogart [SMTP:[EMAIL PROTECTED]]
> Sent: 24 January 2002 15:43
> To:   Tim Ward; [EMAIL PROTECTED]
> Subject:  Re: [PHP] RE: phpwiki save button
> 
> No, you're not missing a thing.  I just need to know exactly where to put
> the 
> line you sent me.  The word "content" is mentioned a few times in the
> script 
> and I'm not a programmer, remember?  Could you please indicate exactly
> where 
> you would put the line you sent me?  I'm sure you are taking for granted
> that 
> I know more than I seem, but I don't.  I'm a newbie at this and have to
> have 
> my nose put down into it before I understand.  Where should I put the
> line?
> 
> Thanks!
> 
> Tim
> 
> On Thursday 24 January 2002 10:07 am, Tim Ward wrote:
> > I think you just need to add the timestamp to the start of the story
> before
> > you save it,
> > i.e.
> > $content = date("d/m/Y H:i:s - ") . $content;
> >
> > or am I missing something?
> >
> >
> > Tim
> > www.chessish.com
> >
> > > -Original Message-
> > > From: Tim Bogart [SMTP:[EMAIL PROTECTED]]
> > > Sent: 24 January 2002 15:01
> > > To:   Tim Ward; [EMAIL PROTECTED]
> > > Subject:  Re: phpwiki save button
> > >
> > > On Thursday 24 January 2002 06:36 am, Tim Ward wrote:
> > > > What is it you actually want to do? Add the current date/time or a
> > > > timestamp entered on the submitting form?
> > >
> > > yes.  That is exactly what I wish to do.
> > >
> > > See date() for the former. Once
> > >
> > > > you've got your stamp in a format you want just add it to the front
> of
> > >
> > > the
> > >
> > > > story before saving. Give us a bit more detail about what it is that
> > >
> > > isn't
> > >
> > > > working, or the code that you want to modify.
> > >
> > > The following is the savepage.php script.  It (in as much as I can
> > > figure) is
> > >  what is executed when one pushes or clicks on the "save" button when
> > > phpwiki
> > > is serving up the"editpage.html" file to a user on his or her browser,
> > > and
> > >
> > > the individual is finished editing, and wishes to save their entry.
> The
> > > "save" button is at the bottom of the edit page.  What I wish to have
> > > happen
> > > is, to have the save button do what it does now, save the changes, but
> in
> > > addition to that, if I had my perfect world, I would like this
> > > savepage.php
> > > script prefix the edited text with a date and time stamp on the left
> side
> > > of
> > > the page, appearing as a (redundancy here) prefix to the typed
> material.
> > > That way each entry would have a date and time stamp.  I hope I am
> > > describing
> > > this in a fashon you can understand.  Let me give you an example.  One
> > > types
> > > ...
> > >
> > > This is a good day.
> > >
> > > Then the individual pushes the save button.  The save is executed, and
> > > the
> > >
> > > user is bounced back to the preview page (the preview page part
> happens
> > > as a
> > > result simply of how the thing just works).  When the preview page is
> > > displayed, the newly added text appears, but looks like this...
> > >
> > > 2002 01/24 09:33:45  This is a good day.
> > >
> > > The format of the date and time are really fluff to me, as long as it
> > > appears.
> > >
> > > I hope my description is understandable.  I eagerly await your
> response.
> > >
> > > Tim B.
> > >
> > > Here's the script..

Re: [PHP] RE: phpwiki save button

2002-01-24 Thread Tim Bogart

No, you're not missing a thing.  I just need to know exactly where to put the 
line you sent me.  The word "content" is mentioned a few times in the script 
and I'm not a programmer, remember?  Could you please indicate exactly where 
you would put the line you sent me?  I'm sure you are taking for granted that 
I know more than I seem, but I don't.  I'm a newbie at this and have to have 
my nose put down into it before I understand.  Where should I put the line?

Thanks!

Tim

On Thursday 24 January 2002 10:07 am, Tim Ward wrote:
> I think you just need to add the timestamp to the start of the story before
> you save it,
> i.e.
> $content = date("d/m/Y H:i:s - ") . $content;
>
> or am I missing something?
>
>
>   Tim
>   www.chessish.com
>
> > -Original Message-
> > From:   Tim Bogart [SMTP:[EMAIL PROTECTED]]
> > Sent:   24 January 2002 15:01
> > To: Tim Ward; [EMAIL PROTECTED]
> > Subject:Re: phpwiki save button
> >
> > On Thursday 24 January 2002 06:36 am, Tim Ward wrote:
> > > What is it you actually want to do? Add the current date/time or a
> > > timestamp entered on the submitting form?
> >
> > yes.  That is exactly what I wish to do.
> >
> > See date() for the former. Once
> >
> > > you've got your stamp in a format you want just add it to the front of
> >
> > the
> >
> > > story before saving. Give us a bit more detail about what it is that
> >
> > isn't
> >
> > > working, or the code that you want to modify.
> >
> > The following is the savepage.php script.  It (in as much as I can
> > figure) is
> >  what is executed when one pushes or clicks on the "save" button when
> > phpwiki
> > is serving up the"editpage.html" file to a user on his or her browser,
> > and
> >
> > the individual is finished editing, and wishes to save their entry.  The
> > "save" button is at the bottom of the edit page.  What I wish to have
> > happen
> > is, to have the save button do what it does now, save the changes, but in
> > addition to that, if I had my perfect world, I would like this
> > savepage.php
> > script prefix the edited text with a date and time stamp on the left side
> > of
> > the page, appearing as a (redundancy here) prefix to the typed material.
> > That way each entry would have a date and time stamp.  I hope I am
> > describing
> > this in a fashon you can understand.  Let me give you an example.  One
> > types
> > ...
> >
> > This is a good day.
> >
> > Then the individual pushes the save button.  The save is executed, and
> > the
> >
> > user is bounced back to the preview page (the preview page part happens
> > as a
> > result simply of how the thing just works).  When the preview page is
> > displayed, the newly added text appears, but looks like this...
> >
> > 2002 01/24 09:33:45  This is a good day.
> >
> > The format of the date and time are really fluff to me, as long as it
> > appears.
> >
> > I hope my description is understandable.  I eagerly await your response.
> >
> > Tim B.
> >
> > Here's the script...
> >
> > -
> >
> > s_id('$Id: savepage.php,v 1.17 2001/11/14 21:05:38 dairiki Exp $');
> > require_once('lib/Template.php');
> > require_once('lib/transform.php');
> > require_once('lib/ArchiveCleaner.php');
> >
> > /* All page saving events take place here. All page info is also taken
> > care
> > of here. This is klugey. But it works. There's probably a slicker way of
> > coding it.
> > */
> >
> > // FIXME: some links so that it's easy to get back to someplace useful
> > from
> > these // error pages.
> >
> > function ConcurrentUpdates($pagename) { /* xgettext only knows about
> > c/c++
> >
> > line-continuation strings is does not know about php's dot operator. We
> > want
> > to translate this entire paragraph as one string, of course.
> > */
> > $html = ""; $html .= gettext ("PhpWiki is unable to save your changes,
> > because another user edited and saved the page while you were editing the
> > page too. If saving proceeded now changes from the previous author would
> > be
> > lost.");
> > $html .= "\n"; $html .= gettext ("In order to recover from this
> > situation follow these steps:");
> > $html .= "\n"; $html .= gettext ("Use your browser's Back
> > button to go back to the edit page.");
> > $html .= "\n"; $html .= gettext ("Copy your changes to the
> > clipboard
> > or to another temporary place (e.g. text editor).");
> > $html .= "\n"; $html .= gettext ("Reload the page. You
> > should
> > now see the most current version of the page. Your changes are no longer
> > there.");
> > $html .= "\n"; $html .= gettext ("Make changes to the file
> > again.
> >
> > Paste your additions from the clipboard (or text editor).");
> > $html .= "\n"; $html .= gettext ("Press Save again.");
> > $html .= "\n"; $html .= QElement('p', gettext ("Sorry for
> > the
> > inconvenience."));
> >
> > echo GeneratePage('MESSAGE', $html, sprintf (gettext ("Problem while
> > updating
> > %s"), $pagename));
> > ExitWiki()