Update of /cvsroot/phpslash/phpslash-ft/class
In directory usw-pr-cvs1:/tmp/cvs-serv17590/phpslash-ft/class
Modified Files:
Story.class Story_base.class
Log Message:
story date on preview fixes
Index: Story.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Story.class,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** Story.class 15 Apr 2002 15:47:37 -0000 1.33
--- Story.class 22 Apr 2002 14:56:09 -0000 1.34
***************
*** 633,637 ****
* we get the time from the array if it's valid. else we generate it.
*/
! $q = "SELECT date_format('$ary[time]',$this->article_dateformat) AS datef";
$this->db->query($q);
$this->db->next_record();
--- 633,645 ----
* we get the time from the array if it's valid. else we generate it.
*/
! if ($ary['datetime'] == "") {
! if( $ary['story_date'] ) {
! $ary['datetime'] = implode( '-', $ary['story_date']) ." ". implode( ':',$ary['story_time']);
! } else {
! $ary['datetime'] = date("Y-m-d H:i:s");
! }
! }
!
! $q = "SELECT date_format('$ary[datetime]',$this->article_dateformat) AS datef";
$this->db->query($q);
$this->db->next_record();
***************
*** 1046,1053 ****
$ary['body_text'] = clean($ary['body_text']);
$ary['title'] = clean($ary['title']);
! if( $ary['time'] == "") {
! $ary['time'] = date("Y-m-d H:i:s");
! }
!
$this->template->set_var(array(
'DEPT' => $ary['dept'],
--- 1054,1062 ----
$ary['body_text'] = clean($ary['body_text']);
$ary['title'] = clean($ary['title']);
! if( $ary['story_date'] ) {
! $ary['datetime'] = implode( '-', $ary['story_date']) ." ". implode( ':',$ary['story_time']);
! } else {
! $ary['datetime'] = date("Y-m-d H:i:s");
! }
$this->template->set_var(array(
'DEPT' => $ary['dept'],
***************
*** 1055,1059 ****
'BODYTEXT' => $ary['body_text'],
'TITLE' => $ary['title'],
! 'TIME' => $ary['time'],
'AUTHOR_ID' => $author_id,
'AUTHOR_NAME' => $author_name
--- 1064,1068 ----
'BODYTEXT' => $ary['body_text'],
'TITLE' => $ary['title'],
! 'TIME' => $ary['datetime'],
'AUTHOR_ID' => $author_id,
'AUTHOR_NAME' => $author_name
***************
*** 1063,1071 ****
$this->template->set_var(array(
'TYPE' => "hidden",
! 'TIME_VALUE' => $ary['time']
));
$this->template->parse("datetime_rows","datetime_row",true);
} else {
! $datetime = split( ' ', $ary['time']);
$story_date = split( '-', $datetime[0]);
$story_time = split( ':', $datetime[1]);
--- 1072,1080 ----
$this->template->set_var(array(
'TYPE' => "hidden",
! 'TIME_VALUE' => $ary['datetime']
));
$this->template->parse("datetime_rows","datetime_row",true);
} else {
! $datetime = split( ' ', $ary['datetime']);
$story_date = split( '-', $datetime[0]);
$story_time = split( ':', $datetime[1]);
Index: Story_base.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Story_base.class,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Story_base.class 15 Apr 2002 15:59:05 -0000 1.10
--- Story_base.class 22 Apr 2002 14:56:09 -0000 1.11
***************
*** 460,468 ****
}
! if ($ary['time'] == "") {
if( $ary['story_date'] ) {
! $ary['time'] = implode( '-', $ary['story_date']) ." ". implode( ':',$ary['story_time']);
} else {
! $ary['time'] = date("Y-m-d H:i:s");
}
}
--- 460,468 ----
}
! if ($ary['datetime'] == "") {
if( $ary['story_date'] ) {
! $ary['datetime'] = implode( '-', $ary['story_date']) ." ". implode( ':',$ary['story_time']);
} else {
! $ary['datetime'] = date("Y-m-d H:i:s");
}
}
***************
*** 482,486 ****
SET user_id = '$ary[author_id]',
title = '$ary[title]',
! time = '$ary[time]',
dept = '$ary[dept]',
intro_text = '$ary[intro_text]',
--- 482,486 ----
SET user_id = '$ary[author_id]',
title = '$ary[title]',
! time = '$ary[datetime]',
dept = '$ary[dept]',
intro_text = '$ary[intro_text]',
***************
*** 539,543 ****
'$ary[intro_text]',
'$ary[body_text]',
! '$ary[time]',
'0')";
// echo "<PRE>INSERT INTO: $q</PRE>\n";
--- 539,543 ----
'$ary[intro_text]',
'$ary[body_text]',
! '$ary[datetime]',
'0')";
// echo "<PRE>INSERT INTO: $q</PRE>\n";
|