Update of /cvsroot/phpslash/phpslash-ft/class
In directory usw-pr-cvs1:/tmp/cvs-serv25599/phpslash-ft/class
Modified Files:
Story.class Story_base.class
Log Message:
drop-down dates for stories
Index: Story.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Story.class,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** Story.class 20 Mar 2002 22:16:42 -0000 1.31
--- Story.class 15 Apr 2002 13:13:08 -0000 1.32
***************
*** 1029,1032 ****
--- 1029,1041 ----
$this->template->set_var('EXTTRANS_CHKBOX',"");
+ $this->template->set_block("newstory","datetime_row","datetime_rows");
+ $this->template->set_block("newstory","year_row","year_rows");
+ $this->template->set_block("newstory","month_row","month_rows");
+ $this->template->set_block("newstory","day_row","day_rows");
+ $this->template->set_block("newstory","hour_row","hour_rows");
+ $this->template->set_block("newstory","minute_row","minute_rows");
+ $this->template->set_block("newstory","second_row","second_rows");
+ $this->template->set_block("newstory","datetimeset_row","datetimeset_rows");
+
if ($data_source == "array") { /* this is what happens during a preview */
***************
*** 1050,1068 ****
'AUTHOR_NAME' => $author_name
));
!
if (!$this->perm->have_perm("story,root")) {
$this->template->set_var(array(
'TYPE' => "hidden",
'TIME_VALUE' => $ary['time']
! ));
} else {
! $this->template->set_var(array(
! 'TYPE' => "text",
! 'TIME_VALUE' => ""
! ));
! }
! if ($ary['content'] == "plain") {
$this->template->set_var('PLAIN_CHKBOX',"CHECKED");
$this->template->set_var('HTML_CHKBOX',"");
--- 1059,1151 ----
'AUTHOR_NAME' => $author_name
));
! // $this->template->set_block("newstory","datetime_row","datetime_rows");
if (!$this->perm->have_perm("story,root")) {
$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]);
+ // setup year select box
+ for( $i=1998; $i<2009; $i++) {
+ $this->template->set_var(array(
+ 'SELECTED' => '',
+ 'STORYYEAR' => $i
+ ));
+ if( $i == $story_date[0]) {
+ $this->template->set_var('SELECTED', "selected=\"selected\"");
+ }
+ $this->template->parse("year_rows","year_row",true);
+ }
+ // setup month select box
+ for( $i=1; $i<=12; $i++) {
+ $this->template->set_var(array(
+ 'SELECTED' => '',
+ 'STORYMONTH' => sprintf( "%02d", $i)
+ ));
+ if( $i == $story_date[1]) {
+ $this->template->set_var('SELECTED', "selected=\"selected\"");
+ }
+ $this->template->parse("month_rows","month_row",true);
+ }
! // setup day select box
! for( $i=1; $i<=31; $i++) {
! $this->template->set_var(array(
! 'SELECTED' => '',
! 'STORYDAY' => sprintf( "%02d", $i)
! ));
! if( $i == $story_date[2]) {
! $this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("day_rows","day_row",true);
! }
!
! // setup hour select box
! for( $i=1; $i<=24; $i++) {
! $this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYHOUR' => $i
! ));
! if( $i == $story_time[0]) {
! $this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("hour_rows","hour_row",true);
! }
!
! // setup minute select box
! for( $i=1; $i<=60; $i++) {
! $this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYMINUTE' => sprintf( "%02d", $i)
! ));
! if( $i == $story_time[1]) {
! $this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("minute_rows","minute_row",true);
! }
!
! // setup seconds select box
! for( $i=1; $i<=60; $i++) {
! $this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYSECOND' => sprintf( "%02d", $i)
! ));
! if( $i == $story_time[2]) {
! $this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("second_rows","second_row",true);
! }
! $this->template->parse("datetimeset_rows","datetimeset_row",true);
! }
!
! if ($ary['content'] == "plain") {
$this->template->set_var('PLAIN_CHKBOX',"CHECKED");
$this->template->set_var('HTML_CHKBOX',"");
***************
*** 1144,1153 ****
'TYPE' => "hidden",
'TIME_VALUE' => $this->db->Record['time']
! ));
} else {
! $this->template->set_var(array(
! 'TYPE' => "text",
! 'TIME_VALUE' => ""
! ));
}
--- 1227,1315 ----
'TYPE' => "hidden",
'TIME_VALUE' => $this->db->Record['time']
! ));
! $this->template->parse("datetime_rows","datetime_row",true);
} else {
! $datetime = split( ' ', $this->db->Record['time']);
! $story_date = split( '-', $datetime[0]);
! $story_time = split( ':', $datetime[1]);
!
! // setup year select box
! for( $i=1998; $i<2009; $i++) {
! $this->template->set_var(array(
! 'SELECTED' => '',
! 'STORYYEAR' => $i
! ));
!
! if( $i == $story_date[0]) {
! $this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("year_rows","year_row",true);
! }
!
! // setup month select box
! for( $i=1; $i<=12; $i++) {
! $this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYMONTH' => sprintf( "%02d", $i)
! ));
! if( $i == $story_date[1]) {
! $this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("month_rows","month_row",true);
! }
!
! // setup day select box
! for( $i=1; $i<=31; $i++) {
! $this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYDAY' => sprintf( "%02d", $i)
! ));
! if( $i == $story_date[2]) {
! $this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("day_rows","day_row",true);
! }
!
! // setup hour select box
! for( $i=1; $i<=24; $i++) {
! $this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYHOUR' => $i
! ));
! if( $i == $story_time[0]) {
! $this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("hour_rows","hour_row",true);
! }
!
! // setup minute select box
! for( $i=1; $i<=60; $i++) {
! $this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYMINUTE' => sprintf( "%02d", $i)
! ));
! if( $i == $story_time[1]) {
! $this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("minute_rows","minute_row",true);
! }
!
! // setup seconds select box
! for( $i=1; $i<=60; $i++) {
! $this->template->set_var(array(
! 'TYPE' => 'select',
! 'SELECTED' => '',
! 'STORYSECOND' => sprintf( "%02d", $i)
! ));
! if( $i == $story_time[2]) {
! $this->template->set_var('SELECTED', "selected=\"selected\"");
! }
! $this->template->parse("second_rows","second_row",true);
! }
! $this->template->parse("datetimeset_rows","datetimeset_row",true);
}
Index: Story_base.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-ft/class/Story_base.class,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Story_base.class 10 Apr 2002 03:37:36 -0000 1.8
--- Story_base.class 15 Apr 2002 13:13:08 -0000 1.9
***************
*** 461,465 ****
if ($ary['time'] == "") {
! $ary['time'] = date("Y-m-d H:i:s");
}
--- 461,469 ----
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");
! }
}
|