' ; $tagClose = '' ; // Search tag for($index = 0; $index < $lineCount; $index++) { $pos = strpos($fileContent[$index], $tagOpen) ; if ($pos !== false) { $start = $index ; } } // Found ? if ($start > -1) { $line = time() . $DOKUWIKI_TWEET_CONFIG['separator'] . getUser() . $DOKUWIKI_TWEET_CONFIG['separator'] . getMessage() ; $fileContent[$start] = str_replace($tagOpen, $tagOpen . $line . "\n", $fileContent[$start]) ; $nbMsg = $DOKUWIKI_TWEET_CONFIG['max_msg'] ; // If -1 no delete if ($nbMsg > -1) { // Clear line for($index = $start + 1; $index < $lineCount; ) { $pos = strpos($fileContent[$index], $tagClose) ; if ($pos !== false) { break ; } $nbMsg-- ; if ($nbMsg < 1) { array_splice($fileContent, $index, 1) ; $lineCount-- ; } else { $index++ ; } } } $fileContent = implode('', $fileContent) ; saveWikiText($pageId, $fileContent, "Message added", true) ; unlock($pageId) ; } //} } if (isset($_GET['action'])) { $action = $_GET['action'] ; if ($action == 'save') { saveMessage() ; } } ?>