- $firstletter = lc(substr($2,0,1));
- $secondletter = lc(substr($4,0,1));
- if (($firstletter ne $story{'letter'})&&($story{'letter'} ne '')) {
- $message = 'The first word must start with '.uc($story{'letter'}).'.';
- }
- elsif ($firstletter eq $secondletter) {
- $message = 'The second word can\'t also start with '.uc($firstletter).'.';
+ if ($cgi{'next'} ne '') {
+ if (split(/\r?\n/,$story{'content'}) >= (STORY_LENGTH-1)) {
+ $story_path = DATA_STORY_PATH.$story_id;
+ write_data_file($story_path, '', '', \%story);
+ $new_story{'id' } = $story_id + 1;
+ $new_story{'letter' } = '';
+ $new_story{'lastip' } = $IP;
+ $new_story{'content'} = '';
+ $new_story{'pass' } = 0;
+ $new_story{'state' } = INTF_STATE->{'X'};
+ $intf_state = INTF_STATE->{'X'};
+ $intf_pass = 0;
+ $intf_mode = INTF_STATE->{'X'};
+ $intf_pause= 0;
+ if($ong_state == STATE->{'inactive'}) {
+ writeindex(WWW_INDEX_PATH,0,0,0); # TO REPLACE
+ }
+ write_data_file($story_file, '', '', \%new_story);
+ }
+ else {
+ $message = 'To early to finish this wordgame.';
+ write_data_file($story_file, '', '', \%story);
+ }