Oto mój skrypt:
// Inicjalizacja Autoload dla:
// DATABASE
// FUNCTION LOOP
// MODULE: Shufle Geins
// Detektor języka
require_once 'vendor/autoload.php';
// Sprawdzanie metody GET dla funkcji przetwarzającej zapis wierszy metodą ascendalną
$code = isset($_GET['code']) ?
$_GET['code'] : ''; $rows = isset($_GET['rows']) ?
$_GET['rows'] : ''; // Sprawdzanie czy warunek odpowiada równości końca
if ($code == $end) { print "Koniec"; } else { print "Jeszcze nie ukończono."; }
if (empty($_GET['rows'])) { print 'Aktualnie na tej stronie jest pusty status.'; } else {
// DEFINICJA BAZY DANYCH
$servername->this->server;
$username->this->user;
$password->this->pass;
$dbname->this->db;
// Tworzenie połączenia do bazy danych
$conn = new mysqli($servername, $username, $password, $dbname);
// Sprawdzanie połączenia do bazy danych
if ($conn->connect_error) {
die("Niepowodzenie w łączeniu z bazą danych: " . $conn->connect_error); }
// Inicjalizacja zmiennej $rows dla wykonania funkcji fgh dla zmiennej $textscan
if (empty($rows)) { return; } else { $rows; }; if (isset($rows)) { $rows; } else { return; }; if ($content == $rows) { $rows; } else { return; };
// Inicjalizacja Treści strukturalnej
$textscan->$this->fgh($rows);
// Porównywanie treści strukturalnej ze wzorcem
preg_match("#<table>(.+)</table>#", $textscan, $tabs); // Główne zmienne dla bazy danych
$title = str_replace("&", "and", str_replace("%x", "FT", str_replace("ft", "FT", str_replace(" A ", " a ", ucwords(ltrim(rtrim(trim(str_replace("$", "s", str_replace('"', '\"', str_replace("'", "\'", str_replace("", "IM", str_replace('<h1 class="strong">', '', str_replace("</h1>", "", chop($textscan->class(".col-lg-7",0)->startclass))))))), " \n\t\r\v\0"), " \n\t\r\v\0"), " \n\t\r\v\0")))))); $text = str_replace("&", "and", str_replace("%x", "FT", str_replace("ft", "FT", str_replace(" A ", " a ", ucwords(ltrim(rtrim(trim(str_replace("$", "s", str_replace('"', '\"', str_replace("'", "\'", str_replace("", "IM", str_replace('<h1 class="strong">', '', str_replace("</h1>", "", chop($textscan->class(".col-lg-7",0)->startclass))))))), " \n\t\r\v\0"), " \n\t\r\v\0"), " \n\t\r\v\0")))))); $body = nl2br(str_replace('"', '\"', str_replace("'", "\'", str_replace("&nbsp;", "", str_replace("%o", "", str_replace($textscan->$next->return . "%o", "", str_replace($textscan->$next->load . "%o", "", str_replace("&raquo;", "", str_replace("%h", "", str_replace('<a rel="textscan" class="btn-secondary btn-block btn-sm my-2 py-1 add-annotation" href="java script:;">%o</a>', '', str_replace('<h2 class="mb-2">%o</h2>', '', str_replace('<div class="inner-text"><br />', '', str_replace('</div>', '', str_replace("%28", "(", str_replace("%29", ")", str_replace("%2C", ",", str_replace("%3F", "?", str_replace("%27", "'", str_replace("%3A", ":", str_replace("%5D", "]<br />", str_replace("%5B", "[", str_replace("%0D%0A", "\n", str_replace(" ", "", str_replace("+", " ", strip_tags(htmlspecialchars(urlencode($textscan->class("div.song-text div",0
)->startclass))))))))))))))))))))))))))); $body_html = nl2br(str_replace('"', '\"', str_replace("'", "\'", str_replace("&nbsp;", "", str_replace("%o", "", str_replace($textscan->$next->return . "%o", "", str_replace($textscan->$next->load . "%o", "", str_replace("&raquo;", "", str_replace("%h", "", str_replace('<a rel="textscan" class="btn-secondary btn-block btn-sm my-2 py-1 add-annotation" href="java script:;">%o</a>', '', str_replace('<h2 class="mb-2">%o</h2>', '', str_replace('<div class="inner-text"><br />', '', str_replace('</div>', '', str_replace("%28", "(", str_replace("%29", ")", str_replace("%2C", ",", str_replace("%3F", "?", str_replace("%27", "'", str_replace("%3A", ":", str_replace("%5D", "]<br />", str_replace("%5B", "[", str_replace("%0D%0A", "\n", str_replace(" ", "", str_replace("+", " ", strip_tags(htmlspecialchars(urlencode($textscan->class("div.song-text div",0
)->startclass))))))))))))))))))))))))))); // Inicjalizacja kodowania opisu
str_replace("++%09%09%09%09%09%09%09%09%09++++%09%09%09%09++++%09%09%09", "", str_replace("+%09%09%09%09%09%09%09%09%09++++%09%09%09%09++++", "<br />", ))))))))))
))))))))))
))))))))))
))))))))))));
// Detekcja języka
$langdec = new Text_LanguageDetect();
$language = $langdec->detectSimple($text);
$sql = "INSERT INTO amylokmart (/* instrukcje ukryte */) VALUES (/* instrukcje ukryte */)";
if ($conn->query($sql) === TRUE)
{
// Inicjalizacja Iteracji
function addNumbers(int $a, int $b) { return $a + $b; }
$linecount = 1;
////////////////////////////////////////////////////////
// Sekcja: funkcja w pętli wykonująca działanie po nieoczekiwanym zatrzymaniu od miejsca gdzie się zatrzymała
// Obecnie ta sekcja nie działa poprawnie (funkcja wraca na początek i dubluje treści)
////////////////////////////////////////////////////////
// Pobieranie wierszy z pliku
$lines = file('rows.txt'); foreach (explode("\n", $lines) as $line_num => $line) { function saveload()
{
$content_add = "code(" . addNumbers($line_num, '0') . "), content(" . $line . "), count(" . $viewcount . ")";
$base_file_error = fopen("base.txt", "a") or
die("Nie można otworzyć pliku!"); $save_title_error = $content_add . ' = "' . $rows . '"';
fwrite($base_file_error, "|". $save_title_error); }
saveload() { ModuleShufleGeins->continue; }
}
////////////////////////////////////////////////////////
// Koniec sekcji
////////////////////////////////////////////////////////
{
$base_file_error = fopen("base.txt", "a") or
die("Nie można otworzyć pliku!"); $save_title_error = $title . ' = "' . $rows . '"';
fwrite($base_file_error, "|". $save_title_error); }
echo '<div class="main-section" style="margin: 0 auto;"><div style="background-color: green; color: white; padding: 5px;">Dodano: w języku [' . $language . ']. [' . $title . ']</div><br /></div>'; }
else
{
$base_file_error = fopen("base.txt", "a") or
die("Nie można otworzyć pliku!"); $save_title_error = $title . ' = "' . $rows . '"';
fwrite($base_file_error, "|". $save_title_error);
echo '<div class="main-section" style="background-color: red; color: white; padding: 5px; margin: 0 auto;">Plozz: ' . $sql . '<br />' . $conn->error . '</div><br /><br />'; }
// Kończenie połączenia z bazą danych
$conn->close();
}
W kodzie chodzi, o sekcje: funkcja w pętli
Funkcję w pętli testuje w osobnym pliku, aby przeprowadzić osobno uruchomienie funkcji w miejscu, w którym skończyła działanie za pomocą: switch, case, break i continue.
Nie będę zapisywała osobno przed wykonaniem funkcji pozycji wiersza, ponieważ to strata czasu, a wiem że jest prosty sposób na to, bo na youtube kiedyś oglądałam filmik na ten temat i tam użytkownik pokazał jak to zrobić. Kiedy przypomniałam sobie, o tym filmiku to okazało się, że użytkownik go usunął