One Hat Cyber Team
Your IP :
216.73.216.164
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
vo
/
umj
/
View File Name :
getit-issues
#!/usr/bin/php <? $startyear = "1987"; $endyear = "1987"; $startissue = "1"; // issue and year are independent $endissue = "12"; $outFile = $startyear . '-' . $endyear . '_' . $startissue . '-' . $endissue . '.xml'; $m = mysqli_connect('localhost','umzh1','7qqRQQ555','umzh1'); mysqli_query($m, "set character_set_results='utf8'"); mysqli_query($m, "SET NAMES 'utf8'"); mysqli_query($m, "SET CHARACTER SET utf8"); mysqli_query($m, "SET SESSION collation_connection = 'utf8_unicode_ci'"); $sql = "select distinct article_year, article_item from articles"; $sql = $sql . " where article_print='Y' and article_year >= $startyear and article_year <= $endyear"; $sql = $sql . " and article_item >= $startissue and article_item <= $endissue"; $sql = $sql . " order by article_year, article_item"; // echo $sql; $res = mysqli_query($m, $sql); $out = new DOMDocument('1.0'); $out->preserveWhiteSpace = false; $out->formatOutput = true; $lang = [ 1 => "uk", 2 => "ru", 3 => "en"]; $sectionRef = [ 1 => 'RES', 2 => 'SHT', 3 => 'IND', 4 => 'CHR', 5 => 'JUB', 6 => 'REV', 7 => 'LTR', 8 => 'ERR', 9 => 'OBT', 10 => 'ABS', 11 => 'ANN', 15 => 'NONE']; $issueId = 0; $articleId = 0; $rootNode = $out->createElementNS('http://pkp.sfu.ca', "issues"); // for each year and issue while ($row = mysqli_fetch_assoc($res)) { $year = $row['article_year']; $issue = $row['article_item']; $volume = $year - 1948; if ($year < 1989) $month = 2*$issue; else $month = $issue; if ($year == 1991 and $issue == 7) { $issue = "7-8"; $month = "8"; } if ($year == 1994 and $issue == 1) { $issue = "1-2"; $month = "2"; } if ($month<10) $month="0" . $month; $datePublished = $year . "-" . $month . "-25"; $dateModified = date("Y-m-d"); $issueId++; // Issue $issueNode = $out->createElementNS('http://pkp.sfu.ca', "issue"); $issueNode->setAttribute("published", "1"); $issueNode->setAttribute("current", "0"); $issueNode->setAttribute("access_status", "1"); // Issue Id $issueIdNode = $out->createElement("id", $issueId); $issueIdNode->setAttribute("type", "internal"); $issueIdNode->setAttribute("advice", "ignore"); $issueNode->appendChild($issueIdNode); // Issue identification $issueIdentificationNode = $out->createElement("issue_identification"); $volumeNode = $out->createElement("volume", $volume); $numberNode = $out->createElement("number", $issue); $yearNode = $out->createElement("year", $year); $issueIdentificationNode->appendChild($volumeNode); $issueIdentificationNode->appendChild($numberNode); $issueIdentificationNode->appendChild($yearNode); $issueNode->appendChild($issueIdentificationNode); // Dates $dateNode = $out->createElement("date_published", $datePublished); $issueNode->appendChild($dateNode); $lastModifiedNode = $out->createElement("last_modified", $dateModified); $issueNode->appendChild($lastModifiedNode); // Sections $sectionsNode = $out->createElement("sections"); $sectionNode = $out->createElement("section"); $sectionNode->setAttribute("ref", "RES"); $sectionNode->setAttribute("seq", "1"); $sectionNode->setAttribute("editor_restricted", "0"); $sectionNode->setAttribute("meta_indexed", "1"); $sectionNode->setAttribute("meta_reviewed", "1"); $sectionNode->setAttribute("abstracts_not_required", "0"); $sectionNode->setAttribute("hide_title", "0"); $sectionNode->setAttribute("hide_author", "0"); $sectionNode->setAttribute("abstract_word_count", "0"); $sectionSubNode = $out->createElement("id", "1"); $sectionSubNode->setAttribute("type", "internal"); $sectionSubNode->setAttribute("advice", "ignore"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "RES"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "RES"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Research articles"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Статті"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionsNode->appendChild($sectionNode); $sectionNode = $out->createElement("section"); $sectionNode->setAttribute("ref", "SHT"); $sectionNode->setAttribute("seq", "2"); $sectionNode->setAttribute("editor_restricted", "0"); $sectionNode->setAttribute("meta_indexed", "1"); $sectionNode->setAttribute("meta_reviewed", "1"); $sectionNode->setAttribute("abstracts_not_required", "0"); $sectionNode->setAttribute("hide_title", "0"); $sectionNode->setAttribute("hide_author", "0"); $sectionNode->setAttribute("abstract_word_count", "0"); $sectionSubNode = $out->createElement("id", "2"); $sectionSubNode->setAttribute("type", "internal"); $sectionSubNode->setAttribute("advice", "ignore"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "SHT"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "SHT"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Short communications"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Короткі повідомлення"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionsNode->appendChild($sectionNode); $sectionNode = $out->createElement("section"); $sectionNode->setAttribute("ref", "IND"); $sectionNode->setAttribute("seq", "3"); $sectionNode->setAttribute("editor_restricted", "1"); $sectionNode->setAttribute("meta_indexed", "0"); $sectionNode->setAttribute("meta_reviewed", "0"); $sectionNode->setAttribute("abstracts_not_required", "1"); $sectionNode->setAttribute("hide_title", "0"); $sectionNode->setAttribute("hide_author", "1"); $sectionNode->setAttribute("abstract_word_count", "0"); $sectionSubNode = $out->createElement("id", "8"); $sectionSubNode->setAttribute("type", "internal"); $sectionSubNode->setAttribute("advice", "ignore"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "IND"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "IND"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Index"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Алфавітний покажчик"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionsNode->appendChild($sectionNode); $sectionNode = $out->createElement("section"); $sectionNode->setAttribute("ref", "CHR"); $sectionNode->setAttribute("seq", "4"); $sectionNode->setAttribute("editor_restricted", "1"); $sectionNode->setAttribute("meta_indexed", "0"); $sectionNode->setAttribute("meta_reviewed", "0"); $sectionNode->setAttribute("abstracts_not_required", "1"); $sectionNode->setAttribute("hide_title", "0"); $sectionNode->setAttribute("hide_author", "1"); $sectionNode->setAttribute("abstract_word_count", "0"); $sectionSubNode = $out->createElement("id", "9"); $sectionSubNode->setAttribute("type", "internal"); $sectionSubNode->setAttribute("advice", "ignore"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "CHR"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "CHR"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Chronicles"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Хроніка"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionsNode->appendChild($sectionNode); $sectionNode = $out->createElement("section"); $sectionNode->setAttribute("ref", "JUB"); $sectionNode->setAttribute("seq", "5"); $sectionNode->setAttribute("editor_restricted", "1"); $sectionNode->setAttribute("meta_indexed", "0"); $sectionNode->setAttribute("meta_reviewed", "0"); $sectionNode->setAttribute("abstracts_not_required", "1"); $sectionNode->setAttribute("hide_title", "0"); $sectionNode->setAttribute("hide_author", "1"); $sectionNode->setAttribute("abstract_word_count", "0"); $sectionSubNode = $out->createElement("id", "3"); $sectionSubNode->setAttribute("type", "internal"); $sectionSubNode->setAttribute("advice", "ignore"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "JUB"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "JUB"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Anniversaries"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Ювілеї"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionsNode->appendChild($sectionNode); $sectionNode = $out->createElement("section"); $sectionNode->setAttribute("ref", "REV"); $sectionNode->setAttribute("seq", "6"); $sectionNode->setAttribute("editor_restricted", "0"); $sectionNode->setAttribute("meta_indexed", "0"); $sectionNode->setAttribute("meta_reviewed", "0"); $sectionNode->setAttribute("abstracts_not_required", "1"); $sectionNode->setAttribute("hide_title", "0"); $sectionNode->setAttribute("hide_author", "0"); $sectionNode->setAttribute("abstract_word_count", "0"); $sectionSubNode = $out->createElement("id", "10"); $sectionSubNode->setAttribute("type", "internal"); $sectionSubNode->setAttribute("advice", "ignore"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "REV"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "REV"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "BookReview"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Критика та бібліографія"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionsNode->appendChild($sectionNode); $sectionNode = $out->createElement("section"); $sectionNode->setAttribute("ref", "LTR"); $sectionNode->setAttribute("seq", "7"); $sectionNode->setAttribute("editor_restricted", "0"); $sectionNode->setAttribute("meta_indexed", "0"); $sectionNode->setAttribute("meta_reviewed", "0"); $sectionNode->setAttribute("abstracts_not_required", "1"); $sectionNode->setAttribute("hide_title", "0"); $sectionNode->setAttribute("hide_author", "0"); $sectionNode->setAttribute("abstract_word_count", "0"); $sectionSubNode = $out->createElement("id", "11"); $sectionSubNode->setAttribute("type", "internal"); $sectionSubNode->setAttribute("advice", "ignore"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "LTR"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "LTR"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Letter"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Лист до редакції"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionsNode->appendChild($sectionNode); $sectionNode = $out->createElement("section"); $sectionNode->setAttribute("ref", "ERR"); $sectionNode->setAttribute("seq", "8"); $sectionNode->setAttribute("editor_restricted", "0"); $sectionNode->setAttribute("meta_indexed", "1"); $sectionNode->setAttribute("meta_reviewed", "0"); $sectionNode->setAttribute("abstracts_not_required", "1"); $sectionNode->setAttribute("hide_title", "0"); $sectionNode->setAttribute("hide_author", "0"); $sectionNode->setAttribute("abstract_word_count", "0"); $sectionSubNode = $out->createElement("id", "12"); $sectionSubNode->setAttribute("type", "internal"); $sectionSubNode->setAttribute("advice", "ignore"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "ERR"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "ERR"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Modifications"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Поправки"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionsNode->appendChild($sectionNode); $sectionNode = $out->createElement("section"); $sectionNode->setAttribute("ref", "OBT"); $sectionNode->setAttribute("seq", "9"); $sectionNode->setAttribute("editor_restricted", "1"); $sectionNode->setAttribute("meta_indexed", "0"); $sectionNode->setAttribute("meta_reviewed", "0"); $sectionNode->setAttribute("abstracts_not_required", "1"); $sectionNode->setAttribute("hide_title", "0"); $sectionNode->setAttribute("hide_author", "0"); $sectionNode->setAttribute("abstract_word_count", "0"); $sectionSubNode = $out->createElement("id", "4"); $sectionSubNode->setAttribute("type", "internal"); $sectionSubNode->setAttribute("advice", "ignore"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "OBT"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "OBT"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Obituaries"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Некрологи"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionsNode->appendChild($sectionNode); $sectionNode = $out->createElement("section"); $sectionNode->setAttribute("ref", "ABS"); $sectionNode->setAttribute("seq", "10"); $sectionNode->setAttribute("editor_restricted", "1"); $sectionNode->setAttribute("meta_indexed", "0"); $sectionNode->setAttribute("meta_reviewed", "0"); $sectionNode->setAttribute("abstracts_not_required", "1"); $sectionNode->setAttribute("hide_title", "0"); $sectionNode->setAttribute("hide_author", "0"); $sectionNode->setAttribute("abstract_word_count", "0"); $sectionSubNode = $out->createElement("id", "13"); $sectionSubNode->setAttribute("type", "internal"); $sectionSubNode->setAttribute("advice", "ignore"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "ABS"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "ABS"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Abstracts"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Реферати"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionsNode->appendChild($sectionNode); $sectionNode = $out->createElement("section"); $sectionNode->setAttribute("ref", "ANN"); $sectionNode->setAttribute("seq", "11"); $sectionNode->setAttribute("editor_restricted", "1"); $sectionNode->setAttribute("meta_indexed", "0"); $sectionNode->setAttribute("meta_reviewed", "0"); $sectionNode->setAttribute("abstracts_not_required", "1"); $sectionNode->setAttribute("hide_title", "0"); $sectionNode->setAttribute("hide_author", "1"); $sectionNode->setAttribute("abstract_word_count", "0"); $sectionSubNode = $out->createElement("id", "14"); $sectionSubNode->setAttribute("type", "internal"); $sectionSubNode->setAttribute("advice", "ignore"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "ANN"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("abbrev", "ANN"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Announcement"); $sectionSubNode->setAttribute("locale", "en_US"); $sectionNode->appendChild($sectionSubNode); $sectionSubNode = $out->createElement("title", "Повідомлення"); $sectionSubNode->setAttribute("locale", "uk_UA"); $sectionNode->appendChild($sectionSubNode); $sectionsNode->appendChild($sectionNode); $issueNode->appendChild($sectionsNode); // Issue coverpage // Issue galleys $issueGalleysNode = $out->createElementNS('http://pkp.sfu.ca', "issue_galleys"); $issueGalleysNode->setAttribute('xsi:schemaLocation', "http://pkp.sfu.ca native.xsd"); $issueNode->appendChild($issueGalleysNode); // Articles $articlesNode = $out->createElementNS('http://pkp.sfu.ca', "articles"); $articlesNode->setAttribute('xsi:schemaLocation', "http://pkp.sfu.ca native.xsd"); $sql = "SELECT * FROM articles"; $sql = $sql . " WHERE article_print='Y' AND article_year = " . $row['article_year'] ; $sql = $sql . " AND article_item = " . $row['article_item']; $sql = $sql . " ORDER BY CAST(SUBSTRING_INDEX(article_pages_ua, '-', 1) AS signed)"; // Article $resArt = mysqli_query($m, $sql); $artSeq = 0; while ($rowArt = mysqli_fetch_assoc($resArt)) { // print_r($rowArt); echo $rowArt['article_id'] .' '; $artSeq++; $articleLocale = "uk_UA"; if ($lang[$rowArt['article_language']] == 'en') $articleLocale = "en_US"; if ($lang[$rowArt['article_language']] == 'ru') $articleLocale = "ru_RU"; $isRu = 0; if ($lang[$rowArt['article_language']] == 'ru') $isRu = 1; $authorSortKey = "name_ua"; if ($articleLocale == "en_US") $authorSortKey = "name_en"; // Create article $articleNode = $out->createElementNS('http://pkp.sfu.ca', "article"); $articleNode->setAttribute('xsi:schemaLocation', "http://pkp.sfu.ca native.xsd"); $articleNode->setAttribute("locale", $articleLocale); $articleNode->setAttribute("language", $lang[$rowArt['article_language']]); $articleNode->setAttribute("date_submitted", $datePublished); $articleNode->setAttribute("stage", "production"); $articleNode->setAttribute("date_published", $datePublished); $articleNode->setAttribute("section_ref", $sectionRef[$rowArt['article_type']]); $articleNode->setAttribute("seq", $artSeq); $articleNode->setAttribute("access_status", "0"); // Article id $articleIdNode = $out->createElement('id', $rowArt['article_id']); $articleIdNode->setAttribute("type", "internal"); $articleIdNode->setAttribute("advice", "ignore"); $articleNode->appendChild($articleIdNode); // Title $data = $rowArt['article_name_en']; $articleTitleNode = $out->createElement('title'); $cdata = $out->createCDATASection($data); $articleTitleNode->appendChild($cdata); $articleTitleNode->setAttribute("locale", "en_US"); $articleNode->appendChild($articleTitleNode); $data = $rowArt['article_name_ua']; $articleTitleNode = $out->createElement('title'); $cdata = $out->createCDATASection($data); $articleTitleNode->appendChild($cdata); $articleTitleNode->setAttribute("locale", "uk_UA"); $articleNode->appendChild($articleTitleNode); // Abstract $data = $rowArt['article_abstract_en']; $data = preg_replace('/<[\/]*a[^>]*>/i', '', $data); $articleAbstractNode = $out->createElement('abstract'); $cdata = $out->createCDATASection($data); $articleAbstractNode->appendChild($cdata); $articleAbstractNode->setAttribute("locale", "en_US"); $articleNode->appendChild($articleAbstractNode); $data = $rowArt['article_abstract_ua']; $data = preg_replace('/<[\/]*a[^>]*>/i', '', $data); $articleAbstractNode = $out->createElement('abstract'); $cdata = $out->createCDATASection($data); $articleAbstractNode->appendChild($cdata); $articleAbstractNode->setAttribute("locale", "uk_UA"); $articleNode->appendChild($articleAbstractNode); // Copyright $articleCopyrightHolderEnNode = $out->createElement('copyrightHolder'); $articleCopyrightHolderEnNode->setAttribute("locale", "en_US"); $articleNode->appendChild($articleCopyrightHolderEnNode); $articleCopyrightHolderUkNode = $out->createElement('copyrightHolder'); $articleCopyrightHolderUkNode->setAttribute("locale", "uk_UA"); $articleNode->appendChild($articleCopyrightHolderUkNode); $articleCopyrightYearNode = $out->createElement('copyrightYear', $year); $articleNode->appendChild($articleCopyrightYearNode); // Keywords // Authors $authorsNode = $out->createElementNS('http://pkp.sfu.ca', "authors"); $authorsNode->setAttribute('xsi:schemaLocation', "http://pkp.sfu.ca native.xsd"); $sql = "SELECT distinct a.author_name_en as name_en, a.author_name_ua as name_ua, a.author_name_ru as name_ru, a.author_institute as author_institute, a.author_email as author_email FROM authors a, authors_to_article b WHERE b.article_id='" . $rowArt["article_id"] . "' and b.author_id=a.author_id ORDER BY " . $authorSortKey; $resAuth = mysqli_query($m, $sql); if (mysqli_num_rows($resAuth) == 0) { echo "\nNo authors for " . $rowArt["article_id"] . "!\n"; die; } $authorsUk = []; $authorsEn = []; while ($rowAuth = mysqli_fetch_assoc($resAuth)) { $nameEn = $rowAuth['name_en']; $nameUk = $rowAuth['name_ua']; $nameRu = $rowAuth['name_ru']; if ($isRu and (strlen($nameRu) == 0) ) $nameRu = $nameUk; if ($isRu) $nameUk = $nameRu; array_push($authorsEn, $nameEn); array_push($authorsUk, $nameUk); $givenNameEn = ""; $givenNameUk = ""; $givenNameRu = ""; $nameParts = explode(" ", $nameEn); $familyNameEn = array_shift($nameParts); if($nameParts[0] == "Board") $familyNameEn = $familyNameEn . array_shift($nameParts); $givenNameEn .= implode(" ", $nameParts); if ($givenNameEn == ""){ $givenNameEn = $familyNameEn; $familyNameEn = ""; } if ($givenNameEn == ""){ echo "No English name for " . $rowArt['article_id']; die; } $nameParts = explode(" ", $nameUk); $familyNameUk = array_shift($nameParts); $givenNameUk .= implode(" ", $nameParts); if ($givenNameUk == ""){ $givenNameUk = $familyNameUk; $familyNameUk = ""; } if ($givenNameUk == ""){ echo "No Ukrainian name for " . $rowArt['article_id']; die; } if($isRu){ $nameParts = explode(" ", $nameRu); $familyNameRu = array_shift($nameParts); $givenNameRu .= implode(" ", $nameParts); if ($givenNameRu == ""){ $givenNameRu = $familyNameRu; $familyNameRu = ""; } if ($givenNameRu == ""){ echo "No Russian name for " . $rowArt['article_id']; die; } } $authorNode = $out->createElement('author'); // $authorNode->setAttribute('primary_contact', 'true'); $authorNode->setAttribute('include_in_browse', 'true'); $authorNode->setAttribute('user_group_ref', 'Author'); $givenNameNode = $out->createElement('givenname', $givenNameEn); $givenNameNode->setAttribute('locale','en_US'); $authorNode->appendChild($givenNameNode); $givenNameNode = $out->createElement('givenname', $givenNameUk); $givenNameNode->setAttribute('locale','uk_UA'); $authorNode->appendChild($givenNameNode); if ($isRu){ $givenNameNode = $out->createElement('givenname', $givenNameRu); $givenNameNode->setAttribute('locale','ru_RU'); $authorNode->appendChild($givenNameNode); } $familyNameNode = $out->createElement('familyname', $familyNameEn); $familyNameNode->setAttribute('locale','en_US'); $authorNode->appendChild($familyNameNode); $familyNameNode = $out->createElement('familyname', $familyNameUk); $familyNameNode->setAttribute('locale','uk_UA'); $authorNode->appendChild($familyNameNode); if ($isRu){ $familyNameNode = $out->createElement('familyname', $familyNameRu); $familyNameNode->setAttribute('locale','ru_RU'); $authorNode->appendChild($familyNameNode); } // Affiliation $affiliationNode = $out->createElement('affiliation'); $cdata = $out->createCDATASection($rowAuth['author_institute']); $affiliationNode->appendChild($cdata); $affiliationNode->setAttribute('locale','en_US'); $authorNode->appendChild($affiliationNode); $affiliationNode = $out->createElement('affiliation'); $cdata = $out->createCDATASection($rowAuth['author_institute']); $affiliationNode->appendChild($cdata); $affiliationNode->setAttribute('locale','uk_UA'); $authorNode->appendChild($affiliationNode); // Country $countryNode = $out->createElement('country', 'UA'); $authorNode->appendChild($countryNode); // Email $emailNode = $out->createElement('email', $rowAuth['author_email']); $authorNode->appendChild($emailNode); $authorsNode->appendChild($authorNode); } $articleCopyrightHolderEnNode->nodeValue = implode("; ", $authorsEn); $articleCopyrightHolderUkNode->nodeValue = implode("; ", $authorsUk); $articleNode->appendChild($authorsNode); // Submission files $basepath = '/var/www/vhost/umj/archiv/'; $subdir = $rowArt['article_item']; if ($subdir < 10) $subdir = '0' . $subdir; $dirpath = $basepath . $year . '/' . $subdir . '/'; if($rowArt['article_attach_pdf']){ $path = $dirpath . $rowArt['article_attach_pdf']; $filename = basename($path); $size = filesize($path); $contents = file_get_contents($path); $submissionNode = $out->createElementNS('http://pkp.sfu.ca', 'submission_file'); $submissionNode->setAttribute('xsi:schemaLocation', "http://pkp.sfu.ca native.xsd"); $submissionNode->setAttribute('stage', 'proof'); $submissionNode->setAttribute('id', $rowArt['article_id']); $revisionNode = $out->createElement('revision'); $revisionNode->setAttribute('number', '1'); $revisionNode->setAttribute('genre', 'Article text (PDF)'); $revisionNode->setAttribute('filename', $rowArt['article_attach_pdf']); $revisionNode->setAttribute('viewable', 'true'); $revisionNode->setAttribute('date_uploaded', date("Y-m-d")); $revisionNode->setAttribute('date_modified', date("Y-m-d")); $revisionNode->setAttribute('filesize', $size); $revisionNode->setAttribute('filetype', 'application/pdf'); $revisionNode->setAttribute('uploader', 'admin'); $nameNode = $out->createElement('name', 'Імпортовано: ' . $filename); $nameNode->setAttribute('locale', 'uk_UA'); $revisionNode->appendChild($nameNode); $nameNode = $out->createElement('name', 'Imported: ' . $filename); $nameNode->setAttribute('locale', 'en_US'); $revisionNode->appendChild($nameNode); $embedNode = $out->createElement('embed'); $embedNode->setAttribute('encoding', 'base64'); $embedNode->nodeValue = base64_encode($contents); $revisionNode->appendChild($embedNode); $submissionNode->appendChild($revisionNode); $articleNode->appendChild($submissionNode); } // Article galleys $galleyNode = $out->createElementNS('http://pkp.sfu.ca', 'article_galley'); $galleyNode->setAttribute('xsi:schemaLocation', "http://pkp.sfu.ca native.xsd"); $galleyNode->setAttribute('approved', 'true'); $galleyIdNode = $out->createElement('id', $rowArt['article_id'] . '.0'); $galleyIdNode->setAttribute('type', 'internal'); $galleyIdNode->setAttribute('advice', 'ignore'); $galleyNode->appendChild($galleyIdNode); $galleyNameNode = $out->createElement('name', 'PDF'); $galleyNameNode->setAttribute('locale', $articleLocale); $galleyNode->appendChild($galleyNameNode); $galleySeqNode = $out->createElement('seq', '0'); $galleyNode->appendChild($galleySeqNode); $galleySubNode = $out->createElement('submission_file_ref'); $galleySubNode->setAttribute('id', $rowArt['article_id']); $galleySubNode->setAttribute('revision', '1'); $galleyNode->appendChild($galleySubNode); if($rowArt['article_attach_pdf']) $articleNode->appendChild($galleyNode); $galleyNode = $out->createElementNS('http://pkp.sfu.ca', 'article_galley'); $galleyNode->setAttribute('xsi:schemaLocation', "http://pkp.sfu.ca native.xsd"); $galleyNode->setAttribute('approved', 'true'); $galleyIdNode = $out->createElement('id', $rowArt['article_id'] . '.1'); $galleyIdNode->setAttribute('type', 'internal'); $galleyIdNode->setAttribute('advice', 'ignore'); $galleyNode->appendChild($galleyIdNode); $galleyNameNode = $out->createElement('name', 'Springer'); $galleyNameNode->setAttribute('locale', 'en_US'); $galleyNode->appendChild($galleyNameNode); $galleySeqNode = $out->createElement('seq', '1'); $galleyNode->appendChild($galleySeqNode); $galleySubNode = $out->createElement('remote'); $galleySubNode->setAttribute('src', $rowArt['article_url_en']); $galleyNode->appendChild($galleySubNode); if ($rowArt['article_url_en']) $articleNode->appendChild($galleyNode); // Pages $pagesNode = $out->createElement('pages', $rowArt['article_pages_ua']); $articleNode->appendChild($pagesNode); $articlesNode->appendChild($articleNode); } $issueNode->appendChild($articlesNode); $rootNode->appendChild($issueNode); } $rootNode->setAttributeNS('http://www.w3.org/2000/xmlns/', "xmlns:xsi" , 'http://www.w3.org/2001/XMLSchema-instance'); $rootNode->setAttribute('xsi:schemaLocation', "http://pkp.sfu.ca native.xsd"); $out->appendChild($rootNode); $out->save($outFile); // echo $out->saveXML(); die;