File size: 96,548 Bytes
a47e1ac | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 | <?php
function ums_text_panel()
{
$theme = wp_get_theme();
if ( 'Madara' != $theme->name && 'Madara' != $theme->parent_theme ) {
echo '<h1>This plugin requires the "Madara" theme to be installed and active on this site before it can function! Please install it from here: <a href="https://mangabooth.com/product/wp-manga-theme-madara/" target="_blank">Madara - WordPress Theme for Manga</a></h1>';
return;
}
if( ! class_exists('WP_MANGA_STORAGE') ) {
echo '<h1>This plugin requires the "Madara Core" plugin to be installed and active on this site before it can function! Please install it from here: <a href="https://mangabooth.com/product/wp-manga-theme-madara/" target="_blank">Madara - WordPress Theme for Manga</a></h1>';
return;
}
$ums_Main_Settings = get_option('ums_Main_Settings', false);
$GLOBALS['wp_object_cache']->delete('ums_text_list', 'options');
$all_rules = get_option('ums_text_list', array());
if($all_rules === false)
{
$all_rules = array();
}
$rules_count = count($all_rules);
$rules_per_page = get_option('ums_posts_per_page', 10);
$max_pages = ceil($rules_count/$rules_per_page);
if($max_pages == 0)
{
$max_pages = 1;
}
?>
<div class="wp-header-end"></div>
<div class="wrap gs_popuptype_holder seo_pops">
<h2><?php echo esc_html__("WuxiaWorld.site Novels Scraper", 'ultimate-manga-scraper');?></h2>
<div>
<form id="myForm" method="post" action="<?php echo (ums_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";?>">
<?php
wp_nonce_field('ums_save_rules', '_umsr_nonce');
if (isset($_GET['settings-updated'])) {
?>
<div>
<p class="cr_saved_notif"><strong><?php echo esc_html__("Settings saved.", 'ultimate-manga-scraper');?></strong></p>
</div>
<?php
}
$hu = get_home_url();
if (stristr($hu, '143.198.112.144') !== false)
{
?>
<div id="message" class="updated">
<p class="cr_saved_notif"><strong> <?php echo esc_html__('This is a demo version of the "Ultimate Web Novel And Manga Scraper" plugin, you will have access to a limited feature set only (maximum scraped chapter count limited to 3). To gain access to the full feature set of the plugin, please purchase it', 'ultimate-manga-scraper');?> <a href="https://1.envato.market/ultimate-manga-scraper" targetr="_blank">CodeCanyon</a>.</strong></p>
</div>
<?php
}
?>
<div>
<div class="hideMain">
<hr/>
<div class="table-responsive">
<table id="mainRules" class="responsive table cr_main_table">
<thead>
<tr>
<th>
<?php echo esc_html__("ID", 'ultimate-manga-scraper');?>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("This is the ID of the rule.", 'ultimate-manga-scraper');
?>
</div>
</div>
</th>
<th>
<?php echo esc_html__("Novels URL / Search Keyword", 'ultimate-manga-scraper');?>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Add the URL of the Web Novel (or a comma separated list of Web Novel URLs) or a keyword search. Example Web Novel URL: https://wuxiaworld.site/novel/super-gene-webnovel-read/ - you can also add a comma separated list of similar URLs. If you want to query all web novels, you can enter here a * (star symbol).", 'ultimate-manga-scraper');
?>
</div>
</div>
</th>
<th><?php echo esc_html__("Schedule", 'ultimate-manga-scraper');?><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
$unlocker = get_option('ums_minute_running_unlocked', false);
if($unlocker == '1')
{
echo esc_html__("Select the interval in minutes after which you want this rule to run. Defined in minutes.", 'ultimate-manga-scraper');
}
else
{
echo esc_html__("Select the interval in hours after which you want this rule to run. Defined in hours.", 'ultimate-manga-scraper');
}
?>
</div>
</div></th>
<th><?php echo esc_html__("Max # Chapters", 'ultimate-manga-scraper');?><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Number of chapters to scrape from each web novel is listed and scraped by this rule.", 'ultimate-manga-scraper');
?>
</div>
</div></th>
<th>
<?php echo esc_html__("Chapter Status", 'ultimate-manga-scraper');?><br/>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Select the chapter status: published, draft, pending.", 'ultimate-manga-scraper');
?>
</div>
</div>
</th>
<th><?php echo esc_html__("Novel Author", 'ultimate-manga-scraper');?><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Select the author that you want to assign for the automatically generated web novels.", 'ultimate-manga-scraper');
?>
</div>
</div></th>
<th><?php echo esc_html__("More Options", 'ultimate-manga-scraper');?><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Shows advanced settings for this rule.", 'ultimate-manga-scraper');
?>
</div>
</div></th>
<th class="cr_max_width_20"><?php echo esc_html__("Del", 'ultimate-manga-scraper');?><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Do you want to delete this rule?", 'ultimate-manga-scraper');
?>
</div>
</div></th>
<th class="cr_max_42"><?php echo esc_html__("Active", 'ultimate-manga-scraper');?><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Do you want to enable this rule? You can deactivate any rule (you don't have to delete them to deactivate them).", 'ultimate-manga-scraper');
?>
</div>
</div>
<br/>
<input type="checkbox" onchange="thisonChangeHandler(this)" id="exclusion"></th>
<th class="cr_max_32"><?php echo esc_html__("Info", 'ultimate-manga-scraper');?><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("The number of web novels this rule has generated so far.", 'ultimate-manga-scraper');
?>
</div>
</div></th>
<th class="cr_actions"><?php echo esc_html__("Actions", 'ultimate-manga-scraper');?><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Do you want to run this rule now? Note that only one instance of a rule is allowed at once.", 'ultimate-manga-scraper');
?>
</div>
</div></th>
</tr>
</thead>
<tbody>
<?php
echo ums_expand_rules_text($hu);
if(isset($_GET['ums_page']))
{
$current_page = $_GET['ums_page'];
}
else
{
$current_page = '';
}
if($current_page == '' || (is_numeric($current_page) && $current_page == $max_pages))
{
?>
<tr>
<td class="cr_comm_td">-</td>
<td class="cr_short_td"><input type="text" name="ums_text_list[location][]" placeholder="https://wuxiaworld.site/novel/..." value="" class="cr_width_full"/></td>
<td class="cr_comm_td"><input type="number" step="1" min="1" name="ums_text_list[schedule][]" max="8765812" class="cr_width_60" placeholder="Select the rule schedule interval" value="<?php if(isset($ums_Main_Settings['default_schedule']) && $ums_Main_Settings['default_schedule'] != '') {echo esc_html($ums_Main_Settings['default_schedule']);}else{echo '24';} ?>"/></td>
<td class="cr_comm_td"><input type="number" step="1" min="0"<?php if (stristr($hu, '143.198.112.144') !== false){ echo ' max="3"';}?> name="ums_text_list[max][]" placeholder="Select the max # of generated chapters" value="<?php if(isset($ums_Main_Settings['default_chapters']) && $ums_Main_Settings['default_chapters'] != '') {echo esc_html($ums_Main_Settings['default_chapters']);}else{echo '1';} ?>" class="cr_width_60"/></td>
<td class="cr_status"><select id="submit_status" name="ums_text_list[submit_status][]" class="cr_width_70">
<option value="pending"><?php echo esc_html__("Pending -> Moderate", 'ultimate-manga-scraper');?></option>
<option value="draft"><?php echo esc_html__("Draft -> Moderate", 'ultimate-manga-scraper');?></option>
<option value="publish" selected><?php echo esc_html__("Published", 'ultimate-manga-scraper');?></option>
<option value="private"><?php echo esc_html__("Private", 'ultimate-manga-scraper');?></option>
<option value="trash"><?php echo esc_html__("Trash", 'ultimate-manga-scraper');?></option>
</select> </td>
<td class="cr_author"><select id="post_author" name="ums_text_list[post_author][]" class="cr_width_auto cr_max_width_150">
<?php
$blogusers = get_users( [ 'role__in' => [ 'contributor', 'author', 'editor', 'administrator' ] ] );
foreach ($blogusers as $user) {
echo '<option value="' . esc_html($user->ID) . '"';
echo '>' . esc_html($user->display_name) . '</option>';
}
?>
<option value="rand"><?php echo esc_html__("Random user", 'ultimate-manga-scraper');?></option>
<option value="feed-news"><?php echo esc_html__("Import author", 'ultimate-manga-scraper');?></option>
</select> </td>
<td class="cr_width_70">
<input type="button" id="mybtnfzr" value="Settings">
<div id="mymodalfzr" class="codemodalfzr">
<div class="codemodalfzr-content">
<div class="codemodalfzr-header">
<span id="ums_close" class="codeclosefzr">×</span>
<h2><span class="cr_color_white"><?php echo esc_html__("New Rule", 'ultimate-manga-scraper');?></span> <?php echo esc_html__("Advanced Settings", 'ultimate-manga-scraper');?></h2>
</div>
<div class="codemodalfzr-body">
<div class="table-responsive">
<table class="responsive table cr_main_table_nowr">
<tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Do you want to reverse scraping of chapters and start with oldest?", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("Reverse Scraping (Start With Oldest Chapters):", 'ultimate-manga-scraper');?></b>
</td><td>
<input type="checkbox" id="reverse_chapters" name="ums_text_list[reverse_chapters][]" checked>
</div>
</td></tr>
<tr><td class="cr_min_width_200">
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Set the maximum web novel count to scrape. This value is optional.", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("Maximum Number Of Novels to Scrape:", 'ultimate-manga-scraper');?></b>
</td><td><input type="number" min="1" name="ums_text_list[max_manga][]"<?php if (stristr($hu, '143.198.112.144') !== false){ echo ' max="1"';}?> value="<?php if(isset($ums_Main_Settings['default_manga']) && $ums_Main_Settings['default_manga'] != '') {echo esc_html($ums_Main_Settings['default_manga']);}else{echo '1';} ?>" placeholder="Maximum number of web novels to scrape" class="cr_width_full">
</div>
</td></tr>
<tr><td class="cr_min_width_200">
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Select the web novel genre that you want for the automatically generated web novel to have.", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("Additional Novel Genre:", 'ultimate-manga-scraper');?></b>
</td><td>
<select id="default_category" name="ums_text_list[default_category][]" class="cr_width_full">
<option value="ums_no_category_12345678" selected><?php echo esc_html__("Do Not Add a Genre", 'ultimate-manga-scraper');?></option>
<?php
$categories = get_terms( 'wp-manga-genre', array( 'hide_empty' => false ) );
foreach ($categories as $category) {
?>
<option value="<?php
echo esc_html($category->term_id);
?>"><?php
echo esc_html(sanitize_text_field($category->name));
?></option>
<?php
}
?>
</select>
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Do you want to automatically add web novel genres from the web novel items?", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("Auto Add Genres:", 'ultimate-manga-scraper');?></b>
</td><td>
<select class="cr_width_full" id="auto_categories" name="ums_text_list[auto_categories][]">
<option value="disabled"><?php echo esc_html__("Disabled", 'ultimate-manga-scraper');?></option>
<option value="genre" selected><?php echo esc_html__("Novel Genres", 'ultimate-manga-scraper');?></option>
</select>
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Do you want to automatically add web novel tags from the web novel items?", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("Auto Add Novel Tags:", 'ultimate-manga-scraper');?></b>
</td><td>
<select class="cr_width_full" id="auto_tags" name="ums_text_list[auto_tags][]">
<option value="disabled" selected><?php echo esc_html__("Disabled", 'ultimate-manga-scraper');?></option>
<option value="genre"><?php echo esc_html__("Novel Genres", 'ultimate-manga-scraper');?></option>
<option value="tags" selected><?php echo esc_html__("Novel Tags", 'ultimate-manga-scraper');?></option>
</select>
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Select the web novel tags that you want for the automatically generated web novel to have.", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("Additional Novel Tags:", 'ultimate-manga-scraper');?></b>
</td><td>
<input type="text" name="ums_text_list[default_tags][]" value="" placeholder="Please insert your additional web novel tags here" class="cr_width_full">
</div>
</td></tr>
<tr>
<td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px"><?php echo esc_html__("Do you want to try to use PhantomJS to try to parse JavaScript from crawled pages (for pages that create dynamic content, on page load, using JavaScript)? Please note that for this to work, you must have PhantomJs installed on your server. You can configure the path to PhantomJS from your server, from plugin's 'Main Settings'.", 'ultimate-manga-scraper');?>
</div>
</div>
<b><?php echo esc_html__("Content Scraping Method To Use:", 'ultimate-manga-scraper');?></b><div class="cr_float_right bws_help_box bws_help_box_right dashicons cr_align_middle"><img class="cr_align_middle" src="<?php echo plugins_url('../images/new.png', __FILE__);?>" alt="new feature"/>
<div class="bws_hidden_help_text cr_min_260px"><?php echo esc_html__("New feature added to this plugin: it is able to use HeadlessBrowserAPI to scrape with JavaScript rendered content any website from the internet. Also, the Tor node of the API will be able to scrape .onion sites from the Dark Net!", 'ultimate-manga-scraper');?>
</div>
</div>
</div>
</td>
<td>
<div>
<select id="use_phantom" name="ums_text_list[use_phantom][]" class="cr_width_full">
<option value="0"><?php echo esc_html__("WordPress (Default)", 'ultimate-manga-scraper');?></option>
<option value="1"><?php echo esc_html__("Use PhantomJS", 'ultimate-manga-scraper');?></option>
<option value="2" selected><?php echo esc_html__("Use Puppeteer", 'ultimate-manga-scraper');?></option>
<option value="4"<?php if (!isset($ums_Main_Settings['headlessbrowserapi_key']) || trim($ums_Main_Settings['headlessbrowserapi_key']) == ''){echo ' title="' . esc_html__("This option is disabled. To enable it, add a HeadlessBrowserAPI Key in the plugin's 'Main Settings' menu.", 'ultimate-manga-scraper') . '" disabled';}?>><?php echo esc_html__("Puppeteer (HeadlessBrowserAPI)", 'ultimate-manga-scraper');if (!isset($ums_Main_Settings['headlessbrowserapi_key']) || trim($ums_Main_Settings['headlessbrowserapi_key']) == ''){echo esc_html__(' - to enable, add a HeadlessBrowserAPI key in the plugin\'s \'Main Settings\'', 'ultimate-manga-scraper');}?></option>
<option value="5"<?php if (!isset($ums_Main_Settings['headlessbrowserapi_key']) || trim($ums_Main_Settings['headlessbrowserapi_key']) == ''){echo ' title="' . esc_html__("This option is disabled. To enable it, add a HeadlessBrowserAPI Key in the plugin's 'Main Settings' menu.", 'ultimate-manga-scraper') . '" disabled';}?>><?php echo esc_html__("Tor (HeadlessBrowserAPI)", 'ultimate-manga-scraper');if (!isset($ums_Main_Settings['headlessbrowserapi_key']) || trim($ums_Main_Settings['headlessbrowserapi_key']) == ''){echo esc_html__(' - to enable, add a HeadlessBrowserAPI key in the plugin\'s \'Main Settings\'', 'ultimate-manga-scraper');}?></option>
<option value="6"<?php if (!isset($ums_Main_Settings['headlessbrowserapi_key']) || trim($ums_Main_Settings['headlessbrowserapi_key']) == ''){echo ' title="' . esc_html__("This option is disabled. To enable it, add a HeadlessBrowserAPI Key in the plugin's 'Main Settings' menu.", 'ultimate-manga-scraper') . '" disabled';}?>><?php echo esc_html__("PhantomJS (HeadlessBrowserAPI)", 'ultimate-manga-scraper');if (!isset($ums_Main_Settings['headlessbrowserapi_key']) || trim($ums_Main_Settings['headlessbrowserapi_key']) == ''){echo esc_html__(' - to enable, add a HeadlessBrowserAPI key in the plugin\'s \'Main Settings\'', 'ultimate-manga-scraper');}?></option>
</select>
</div>
</td>
</tr>
<tr>
<td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px"><?php echo esc_html__("Set the number of milliseconds that phantomjs should wait before rendering pages (1000 ms = 1 sec).", 'ultimate-manga-scraper');?>
</div>
</div>
<b><?php echo esc_html__("Headless Browser Wait Before Rendering Pages (ms):", 'ultimate-manga-scraper');?></b>
</div>
</td>
<td>
<div>
<input type="number" min="0" step="1" id="phantom_wait" name="ums_text_list[phantom_wait][]" value="" placeholder="0" class="cr_width_full">
</div>
</td>
</tr>
<tr>
<td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Do you want to enable comments for the generated web novel?", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("Enable Comments For Novel:", 'ultimate-manga-scraper');?></b>
</td>
<td>
<input type="checkbox" id="enable_comments" name="ums_text_list[enable_comments][]" checked>
</div>
</td>
</tr>
<tr>
<td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Do you want to enable pingbacks/trackbacks for the generated web novel?", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("Enable Pingback/Trackback:", 'ultimate-manga-scraper');?></b>
</td>
<td>
<input type="checkbox" id="enable_pingback" name="ums_text_list[enable_pingback][]">
</div>
</td>
</tr>
<tr>
<td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Do you want to get the publish date from the source web novels?", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("Get Publish Date From Novel:", 'ultimate-manga-scraper');?></b>
</td>
<td>
<input type="checkbox" id="get_date" name="ums_text_list[get_date][]">
</div>
</td>
</tr>
<tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Set a global chapter warning message to display on the scraped web novel.", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("Global Chapter Warning Message:", 'ultimate-manga-scraper');?></b>
</td><td>
<input type="text" name="ums_text_list[chapter_warning][]" value="" placeholder="Global Chapter Warning Message" class="cr_width_full">
</div>
</td></tr>
<tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Set the first chapter slug for the scraped web novel. This needs to be set only if the first chapter URL is different than chapter-1", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("First Chapter Slug:", 'ultimate-manga-scraper');?></b>
</td><td>
<input type="text" name="ums_text_list[chapter_slug][]" value="" placeholder="chapter-1" class="cr_width_full">
</div>
</td></tr>
<tr>
<td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Do you want to strip images, videos and scripts from newly published chapters?", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("Strip Images, Videos And Scripts From Chapters:", 'ultimate-manga-scraper');?></b>
</td>
<td>
<input type="checkbox" id="strip_images" name="ums_text_list[strip_images][]" checked>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<h3><?php echo esc_html__("Translation Options:", 'ultimate-manga-scraper');?></h3>
</td>
</tr>
<tr>
<td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px"><?php echo esc_html__("Do you want to automatically translate generated content using Google Translate? If set, this will overwrite the 'Automatically Translate Content To' option from plugin's 'Main Settings'.", 'ultimate-manga-scraper');?>
</div>
</div>
<b><?php echo esc_html__("Automatically Translate Content To:", 'ultimate-manga-scraper');?></b><br/><b><?php echo esc_html__("Info:", 'ultimate-manga-scraper');?></b> <?php echo esc_html__("for translation, the plugin also supports WPML.", 'ultimate-manga-scraper');?> <b><a href="https://wpml.org/?aid=238195&affiliate_key=ix3LsFyq0xKz" target="_blank"><?php echo esc_html__("Get WPML now!", 'ultimate-manga-scraper');?></a></b>
</td>
<td>
<select class="cr_width_full" id="translate" name="ums_text_list[rule_translate][]" >
<?php
$i = 0;
foreach ($GLOBALS['language_names'] as $lang) {
echo '<option value="' . esc_attr($GLOBALS['language_codes'][$i]) . '"';
if ($i == 0) {
echo ' selected';
}
echo '>' . esc_html($GLOBALS['language_names'][$i]) . '</option>';
$i++;
}
if(isset($ums_Main_Settings['deepl_auth']) && $ums_Main_Settings['deepl_auth'] != '')
{
$i = 0;
foreach ($GLOBALS['language_names_deepl'] as $lang) {
echo '<option value="' . esc_attr($GLOBALS['language_codes_deepl'][$i]) . '"';
echo '>' . esc_html($GLOBALS['language_names_deepl'][$i]) . '</option>';
$i++;
}
}
if(isset($ums_Main_Settings['bing_auth']) && $ums_Main_Settings['bing_auth'] != '')
{
$i = 0;
foreach ($GLOBALS['language_names_bing'] as $lang) {
echo '<option value="' . esc_attr($GLOBALS['language_codes_bing'][$i]) . '"';
echo '>' . esc_html($GLOBALS['language_names_bing'][$i]) . '</option>';
$i++;
}
}
?>
</select>
</div>
</td>
</tr>
<tr>
<td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("Do you want to not translate web novel titles", 'ultimate-manga-scraper');
?>
</div>
</div>
<b><?php echo esc_html__("Do Not Translate Title:", 'ultimate-manga-scraper');?></b>
</td>
<td>
<input type="checkbox" id="no_translate_title" name="ums_text_list[no_translate_title][]">
</div>
</td>
</tr>
</table></div>
</div>
<div class="codemodalfzr-footer">
<br/>
<h3 class="cr_inline">Ultimate Web Novel & Manga Scraper</h3><span id="ums_ok" class="codeokfzr cr_inline">OK </span>
<br/><br/>
</div>
</div>
</div>
</td>
<td class="cr_comm_td"><span class="cr_gray20">X</span></td>
<td class="cr_comm_td"><input type="checkbox" name="ums_text_list[active][]" value="1" checked />
<input type="hidden" name="ums_text_list[last_run][]" value="1988-01-27 00:00:00"/></td>
<td class="cr_comm_td"><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">
<?php
echo esc_html__("No info.", 'ultimate-manga-scraper');
?>
</div>
</div></td>
<td class="cr_center">
<div>
<img src="<?php
echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/running.gif');
?>" alt="Running" class="cr_running">
<div class="codemainfzr cr_gray_back">
<select id="actions" class="actions" name="actions" disabled>
<option value="select" disabled selected><?php echo esc_html__("Select an Action", 'ultimate-manga-scraper');?></option>
<option value="run" onclick=""><?php echo esc_html__("Run This Rule Now", 'ultimate-manga-scraper');?></option>
<option value="trash" onclick=""><?php echo esc_html__("Move All Novel To Trash", 'ultimate-manga-scraper');?></option>
<option value="delete" onclick=""><?php echo esc_html__("Permanently Delete All Novel", 'ultimate-manga-scraper');?></option>
</select>
</div>
</div>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<hr/>
<?php
$next_url = (ums_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if(stristr($next_url, 'ums_page=') === false)
{
if(stristr($next_url, '?') === false)
{
if($max_pages == 1)
{
$next_url .= '?ums_page=1';
}
else
{
$next_url .= '?ums_page=2';
}
}
else
{
if($max_pages == 1)
{
$next_url .= '&ums_page=1';
}
else
{
$next_url .= '&ums_page=2';
}
}
}
else
{
if(isset($_GET['ums_page']))
{
$curent_page = $_GET["ums_page"];
}
else
{
$curent_page = '';
}
if(is_numeric($curent_page))
{
$next_page = $curent_page + 1;
if($next_page > $max_pages)
{
$next_page = $max_pages;
}
if($next_page <= 0)
{
$next_page = 1;
}
$next_url = str_replace('ums_page=' . $curent_page, 'ums_page=' . $next_page, $next_url);
}
else
{
if(stristr($next_url, '?') === false)
{
if($max_pages == 1)
{
$next_url .= '?ums_page=1';
}
else
{
$next_url .= '?ums_page=2';
}
}
else
{
if($max_pages == 1)
{
$next_url .= '&ums_page=1';
}
else
{
$next_url .= '&ums_page=2';
}
}
}
}
$prev_url = (ums_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if(stristr($prev_url, 'ums_page=') === false)
{
if(stristr($prev_url, '?') === false)
{
$prev_url .= '?ums_page=1';
}
else
{
$prev_url .= '&ums_page=1';
}
}
else
{
if(isset($_GET['ums_page']))
{
$curent_page = $_GET["ums_page"];
}
else
{
$curent_page = '';
}
if(is_numeric($curent_page))
{
$go_to = $curent_page - 1;
if($go_to <= 0)
{
$go_to = 1;
}
if($go_to > $max_pages)
{
$go_to = $max_pages;
}
$prev_url = str_replace('ums_page=' . $curent_page, 'ums_page=' . $go_to, $prev_url);
}
else
{
if(stristr($prev_url, '?') === false)
{
$prev_url .= '?ums_page=1';
}
else
{
$prev_url .= '&ums_page=1';
}
}
}
$first_url = (ums_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if(stristr($first_url, 'ums_page=') === false)
{
if(stristr($first_url, '?') === false)
{
$first_url .= '?ums_page=1';
}
else
{
$first_url .= '&ums_page=1';
}
}
else
{
if(isset($_GET['ums_page']))
{
$curent_page = $_GET["ums_page"];
}
else
{
$curent_page = '';
}
if(is_numeric($curent_page))
{
$first_url = str_replace('ums_page=' . $curent_page, 'ums_page=1', $first_url);
}
else
{
if(stristr($first_url, '?') === false)
{
$first_url .= '?ums_page=1';
}
else
{
$first_url .= '&ums_page=1';
}
}
}
$last_url = (ums_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if(stristr($last_url, 'ums_page=') === false)
{
if(stristr($last_url, '?') === false)
{
$last_url .= '?ums_page=' . $max_pages;
}
else
{
$last_url .= '&ums_page=' . $max_pages;
}
}
else
{
if(isset($_GET['ums_page']))
{
$curent_page = $_GET["ums_page"];
}
else
{
$curent_page = '';
}
if(is_numeric($curent_page))
{
$last_url = str_replace('ums_page=' . $curent_page, 'ums_page=' . $max_pages, $last_url);
}
else
{
if(stristr($last_url, '?') === false)
{
$last_url .= '?ums_page=' . $max_pages;
}
else
{
$last_url .= '&ums_page=' . $max_pages;
}
}
}
if(isset($_GET['ums_page']) && is_numeric($_GET['ums_page']))
{
$this_page = $_GET["ums_page"];
}
else
{
$this_page = '1';
}
echo '<center><a href="' . esc_url_raw($first_url) . '">' . esc_html__('First Page', 'ultimate-manga-scraper') . '</a> <a href="' . esc_url_raw($prev_url) . '">' . esc_html__('Previous Page', 'ultimate-manga-scraper') . '</a> ' . esc_html__('Page', 'ultimate-manga-scraper') . ' ' . esc_html($this_page) . ' ' . esc_html__('of', 'ultimate-manga-scraper') . ' ' . esc_html($max_pages) . ' - ' . esc_html__("Rules Per Page:", 'ultimate-manga-scraper') . ' <input class="cr_50" type="number" min="2" step="1" max="999" name="posts_per_page" value="' . esc_attr($rules_per_page). '" required/> <a href="' . esc_url_raw($next_url) . '">' . esc_html__('Next Page', 'ultimate-manga-scraper') . '</a> <a href="' . esc_url_raw($last_url) . '">' . esc_html__('Last Page', 'ultimate-manga-scraper') . '</a></center>
<center></center>
<center>Info: You can add new rules only on the last page.</center>';
?>
<div>
<p class="crsubmit"><input type="submit" name="btnSubmit" id="btnSubmit" class="button button-primary" onclick="unsaved = false;" value="<?php echo esc_html__("Save Settings", 'ultimate-manga-scraper');?>"/></p>
</div>
<div>
<?php echo esc_html__("Confused about rule running status icons?", 'ultimate-manga-scraper');?> <a href="http://coderevolution.ro/knowledge-base/faq/how-to-interpret-the-rule-running-visual-indicators-red-x-yellow-diamond-green-tick-from-inside-plugins/" target="_blank"><?php echo esc_html__("More info", 'ultimate-manga-scraper');?></a><br/>
<div class="cr_none" id="midas_icons">
<table>
<tr>
<td><img id="run_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/running.gif');?>" alt="Running" title="status"></td>
<td><?php echo esc_html__("In Progress", 'ultimate-manga-scraper');?> - <b><?php echo esc_html__("Importing is Running", 'ultimate-manga-scraper');?></b></td>
</tr>
<tr>
<td><img id="ok_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/ok.gif');?>" alt="OK" title="status"></td>
<td><?php echo esc_html__("Success", 'ultimate-manga-scraper');?> - <b><?php echo esc_html__("New Novel Created", 'ultimate-manga-scraper');?></b></td>
</tr>
<tr>
<td><img id="fail_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/failed.gif');?>" alt="Faield" title="status"></td>
<td><?php echo esc_html__("Failed", 'ultimate-manga-scraper');?> - <b><?php echo esc_html__("An Error Occurred.", 'ultimate-manga-scraper');?> <b><?php echo esc_html__("Please check 'Activity and Logging' plugin menu for details.", 'ultimate-manga-scraper');?></b></td>
</tr>
<tr>
<td><img id="nochange_img" src="<?php echo esc_url_raw(plugin_dir_url(dirname(__FILE__)) . 'images/nochange.gif');?>" alt="NoChange" title="status"></td>
<td><?php echo esc_html__("No Change - No New Novel Created", 'ultimate-manga-scraper');?> - <b><?php echo esc_html__("Possible reasons:", 'ultimate-manga-scraper');?></b></td>
</tr>
<tr>
<td></td>
<td>
<ul>
<li>► <?php echo esc_html__("Already all web novel are published that match your search and web novels will be published when new content will be available", 'ultimate-manga-scraper');?></li>
<li>► <?php echo esc_html__("Some restrictions you defined in the plugin's 'Main Settings'", 'ultimate-manga-scraper');?> <i>(<?php echo esc_html__("example: 'Minimum Content Word Count', 'Maximum Content Word Count', 'Minimum Title Word Count', 'Maximum Title Word Count', 'Banned Words List', 'Reuired Words List', 'Skip Novel Without Images'", 'ultimate-manga-scraper');?>)</i> <?php echo esc_html__("prevent posting of new web novels.", 'ultimate-manga-scraper');?></li>
</ul>
</td>
</tr>
</table>
</div>
</div>
</form>
</div>
</div>
<?php
}
if (isset($_POST['ums_text_list'])) {
add_action('admin_init', 'ums_save_rules_text');
}
function ums_save_rules_text($data2)
{
$init_rules_per_page = get_option('ums_posts_per_page', 10);
$rules_per_page = get_option('ums_posts_per_page', 10);
if(isset($_POST['posts_per_page']))
{
update_option('ums_posts_per_page', $_POST['posts_per_page']);
}
check_admin_referer('ums_save_rules', '_umsr_nonce');
$data2 = $_POST['ums_text_list'];
$rules = get_option('ums_text_list', array());
if($rules === false)
{
$rules = array();
}
$initial_count = count($rules);
$add = false;
$scad = false;
if(isset($_GET["ums_page"]) && is_numeric($_GET["ums_page"]))
{
$curent_page = $_GET["ums_page"];
}
else
{
$curent_page = 1;
}
$offset = ($curent_page - 1) * $rules_per_page;
$cont = 0;
$cat_cont = $offset;
if (isset($data2['location'][0])) {
for ($i = 0; $i < sizeof($data2['location']); ++$i) {
$bundle = array();
if (isset($data2['schedule'][$i]) && $data2['schedule'][$i] != '' && trim($data2['location'][$i]) != '') {
$bundle[] = trim($data2['location'][$i]);
$bundle[] = trim(sanitize_text_field($data2['schedule'][$i]));
if (isset($data2['active'][$i])) {
$bundle[] = trim(sanitize_text_field($data2['active'][$i]));
} else {
$bundle[] = '0';
}
$bundle[] = trim(sanitize_text_field($data2['last_run'][$i]));
$bundle[] = trim(sanitize_text_field($data2['max'][$i]));
$bundle[] = trim(sanitize_text_field($data2['submit_status'][$i]));
$bundle[] = trim(sanitize_text_field($data2['post_author'][$i]));
$bundle[] = trim(sanitize_text_field($data2['default_tags'][$i]));
$bundle[] = trim(sanitize_text_field($data2['default_category'][$i]));
$bundle[] = trim(sanitize_text_field($data2['auto_categories'][$i]));
$bundle[] = trim(sanitize_text_field($data2['auto_tags'][$i]));
$bundle[] = trim(sanitize_text_field($data2['use_phantom'][$i]));
$bundle[] = trim(sanitize_text_field($data2['reverse_chapters'][$i]));
$bundle[] = trim(sanitize_text_field($data2['max_manga'][$i]));
$bundle[] = trim($data2['chapter_warning'][$i]);
$bundle[] = trim(sanitize_text_field($data2['enable_comments'][$i]));
$bundle[] = trim(sanitize_text_field($data2['enable_pingback'][$i]));
$bundle[] = trim(sanitize_text_field($data2['get_date'][$i]));
$bundle[] = trim(sanitize_text_field($data2['rule_translate'][$i]));
$bundle[] = trim(sanitize_text_field($data2['no_translate_title'][$i]));
$bundle[] = trim(sanitize_text_field($data2['chapter_slug'][$i]));
$bundle[] = trim(sanitize_text_field($data2['phantom_wait'][$i]));
$bundle[] = trim(sanitize_text_field($data2['strip_images'][$i]));
$rules[$offset + $cont] = $bundle;
$cont++;
$cat_cont++;
}
}
while($cont < $init_rules_per_page)
{
if(isset($rules[$offset + $cont]))
{
$rules[$offset + $cont] = false;
}
$cont = $cont + 1;
$cat_cont++;
}
$rules = array_values(array_filter($rules));
}
update_option('ums_text_list', $rules, false);
$final_count = count($rules);
if($final_count > $initial_count)
{
$add = true;
}
elseif($final_count < $initial_count)
{
$scad = true;
}
if(count($rules) % $rules_per_page === 1 && $add === true)
{
$rules_count = count($rules);
$max_pages = ceil($rules_count/$rules_per_page);
if($max_pages == 0)
{
$max_pages = 1;
}
$last_url = (ums_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if(stristr($last_url, 'ums_page=') === false)
{
if(stristr($last_url, '?') === false)
{
$last_url .= '?ums_page=' . $max_pages;
}
else
{
$last_url .= '&ums_page=' . $max_pages;
}
}
else
{
if(isset($_GET['ums_page']))
{
$curent_page = $_GET["ums_page"];
}
else
{
$curent_page = '';
}
if(is_numeric($curent_page))
{
$last_url = str_replace('ums_page=' . $curent_page, 'ums_page=' . $max_pages, $last_url);
}
else
{
if(stristr($last_url, '?') === false)
{
$last_url .= '?ums_page=' . $max_pages;
}
else
{
$last_url .= '&ums_page=' . $max_pages;
}
}
}
ums_redirect($last_url);
}
elseif(count($rules) != 0 && count($rules) % $rules_per_page === 0 && $scad === true)
{
$rules_count = count($rules);
$max_pages = ceil($rules_count/$rules_per_page);
if($max_pages == 0)
{
$max_pages = 1;
}
$last_url = (ums_isSecure() ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if(stristr($last_url, 'ums_page=') === false)
{
if(stristr($last_url, '?') === false)
{
$last_url .= '?ums_page=' . $max_pages;
}
else
{
$last_url .= '&ums_page=' . $max_pages;
}
}
else
{
if(isset($_GET['ums_page']))
{
$curent_page = $_GET["ums_page"];
}
else
{
$curent_page = '';
}
if(is_numeric($curent_page))
{
$last_url = str_replace('ums_page=' . $curent_page, 'ums_page=' . $max_pages, $last_url);
}
else
{
if(stristr($last_url, '?') === false)
{
$last_url .= '?ums_page=' . $max_pages;
}
else
{
$last_url .= '&ums_page=' . $max_pages;
}
}
}
ums_redirect($last_url);
}
}
function ums_expand_rules_text($hu)
{
$ums_Main_Settings = get_option('ums_Main_Settings', false);
$categories = get_terms( 'wp-manga-genre', array( 'hide_empty' => false ) );
if (!get_option('ums_running_list')) {
$running = array();
} else {
$running = get_option('ums_running_list');
}
$GLOBALS['wp_object_cache']->delete('ums_text_list', 'options');
$rules = get_option('ums_text_list');
if(!is_array($rules))
{
$rules = array();
}
$output = '';
$cont = 0;
if (!empty($rules)) {
if(isset($_GET["ums_page"]) && is_numeric($_GET["ums_page"]))
{
$curent_page = $_GET["ums_page"];
}
else
{
$curent_page = 1;
}
$unlocker = get_option('ums_minute_running_unlocked', false);
$posted_items = array();
$post_list = array();
$postsPerPage = 50000;
$paged = 0;
do
{
$postOffset = $paged * $postsPerPage;
$query = array(
'post_status' => array(
'publish',
'draft',
'pending',
'trash',
'private',
'future'
),
'post_type' => array(
'any'
),
'numberposts' => $postsPerPage,
'meta_key' => 'ums_parent_rule',
'fields' => 'ids',
'offset' => $postOffset
);
$got_me = get_posts($query);
$post_list = array_merge($post_list, $got_me);
$paged++;
}while(!empty($got_me));
wp_suspend_cache_addition(true);
foreach ($post_list as $post) {
$rule_id = get_post_meta($post, 'ums_parent_rule', true);
if ($rule_id != '') {
$exp = explode('-', $rule_id);
if(isset($exp[0]) && isset($exp[1]) && $exp[0] == '1')
{
$posted_items[] = $exp[1];
}
}
}
$phantom = false;
wp_suspend_cache_addition(false);
$counted_vals = array_count_values($posted_items);
$unlocker = get_option('ums_minute_running_unlocked', false);
$rules_per_page = get_option('ums_posts_per_page', 10);
foreach ($rules as $request => $bundle[]) {
if(($cont < ($curent_page - 1) * $rules_per_page) || ($cont >= $curent_page * $rules_per_page))
{
$cont++;
continue;
}
if (isset($counted_vals[$cont])) {
$generated_posts = $counted_vals[$cont];
} else {
$generated_posts = 0;
}
$bundle_values = array_values($bundle);
$myValues = $bundle_values[$cont];
$array_my_values = array_values($myValues);for($iji=0;$iji<count($array_my_values);++$iji){if(is_string($array_my_values[$iji])){$array_my_values[$iji]=stripslashes($array_my_values[$iji]);}}
$manga_name = $array_my_values[0];
$schedule = $array_my_values[1];
$active = $array_my_values[2];
$last_run = $array_my_values[3];
$max = $array_my_values[4];
$status = $array_my_values[5];
$post_user_name = $array_my_values[6];
$default_tags = $array_my_values[7];
$default_category = $array_my_values[8];
$auto_categories = $array_my_values[9];
$auto_tags = $array_my_values[10];
$use_phantom = $array_my_values[11];
$reverse_chapters = $array_my_values[12];
$max_manga = $array_my_values[13];
$chapter_warning = $array_my_values[14];
$enable_comments = $array_my_values[15];
$enable_pingback = $array_my_values[16];
$get_date = $array_my_values[17];
$rule_translate = $array_my_values[18];
$no_translate_title = $array_my_values[19];
$chapter_slug = $array_my_values[20];
$phantom_wait = $array_my_values[21];
$strip_images = $array_my_values[22];
wp_add_inline_script('ums-footer-script', 'createAdmin(' . esc_html($cont) . ');', 'after');
$output .= '<tr>
<td class="cr_comm_td">' . esc_html($cont) . '</td>
<td class="cr_short_td"><input type="text" step="1" name="ums_text_list[location][]" placeholder="https://wuxiaworld.site/novel/..." value="' . esc_attr($manga_name) . '" class="cr_width_full" required/></td>
<td class="cr_comm_td"><input type="number" step="1" min="1" placeholder="# h" name="ums_text_list[schedule][]" max="8765812" value="' . esc_attr($schedule) . '" class="cr_width_60" required></td>
<td class="cr_comm_td"><input type="number" step="1" min="0" placeholder="# max" name="ums_text_list[max][]"';if (stristr($hu, '143.198.112.144') !== false){ $output .= ' max="3"';} $output .= ' value="' . esc_attr($max) . '" class="cr_width_60" required></td>
<td class="cr_status"><select id="submit_status" name="ums_text_list[submit_status][]" class="cr_width_70">
<option value="pending"';
if ($status == 'pending') {
$output .= ' selected';
}
$output .= '>' . esc_html__("Pending -> Moderate", 'ultimate-manga-scraper') . '</option>
<option value="draft"';
if ($status == 'draft') {
$output .= ' selected';
}
$output .= '>' . esc_html__("Draft -> Moderate", 'ultimate-manga-scraper') . '</option>
<option value="publish"';
if ($status == 'publish') {
$output .= ' selected';
}
$output .= '>' . esc_html__("Published", 'ultimate-manga-scraper') . '</option>
<option value="private"';
if ($status == 'private') {
$output .= ' selected';
}
$output .= '>' . esc_html__("Private", 'ultimate-manga-scraper') . '</option>
<option value="trash"';
if ($status == 'trash') {
$output .= ' selected';
}
$output .= '>' . esc_html__("Trash", 'ultimate-manga-scraper') . '</option>
</select> </td>
<td class="cr_author"><select id="post_author" name="ums_text_list[post_author][]" class="cr_width_auto cr_max_width_150">';
$blogusers = get_users( [ 'role__in' => [ 'contributor', 'author', 'editor', 'administrator' ] ] );
foreach ($blogusers as $user) {
$output .= '<option value="' . esc_html($user->ID) . '"';
if ($post_user_name == $user->ID) {
$output .= " selected";
}
$output .= '>' . esc_html($user->display_name) . '</option>';
}
$output .= '<option value="rand"';
if ($post_user_name == "rand") {
$output .= " selected";
}
$output .= '>' . esc_html__("Random user", 'ultimate-manga-scraper') . '</option>';
$output .= '<option value="feed-news"';
if ($post_user_name == "feed-news") {
$output .= " selected";
}
$output .= '>' . esc_html__("Import author", 'ultimate-manga-scraper') . '</option>';
$output .= '</select> </td>
<td class="cr_width_70">
<input type="button" id="mybtnfzr' . esc_html($cont) . '" value="Settings">
<div id="mymodalfzr' . esc_html($cont) . '" class="codemodalfzr">
<div class="codemodalfzr-content">
<div class="codemodalfzr-header">
<span id="ums_close' . esc_html($cont) . '" class="codeclosefzr">×</span>
<h2>' . esc_html__('Rule', 'ultimate-manga-scraper') . ' <span class="cr_color_white">ID ' . esc_html($cont) . '</span> ' . esc_html__('Advanced Settings', 'ultimate-manga-scraper') . '</h2>
</div>
<div class="codemodalfzr-body">
<div class="table-responsive">
<table class="responsive table cr_main_table_nowr">
<tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to reverse scraping of chapters and start with oldest?", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Reverse Scraping (Start With Oldest Chapters)", 'ultimate-manga-scraper') . ':</b>
</td><td>
<input type="checkbox" id="reverse_chapters" name="ums_text_list[reverse_chapters][]"';
if ($reverse_chapters == '1') {
$output .= ' checked';
}
$output .= '>
</div>
</td></tr>
<tr><td class="cr_min_width_200">
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set a maximum number of web novel to scrape. This value is optional.", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Maximum Number Of Novel to Scrape", 'ultimate-manga-scraper') . ':</b>
</td><td>
<input class="cr_width_full" type="number" min="1" name="ums_text_list[max_manga][]"';if (stristr($hu, '143.198.112.144') !== false){ $output .= ' max="1"';} $output .= ' value="' . esc_attr($max_manga) . '" placeholder="Maximum number of web novels to scrape" >
</div>
</td></tr>
<tr><td colspan="2"><h3>' . esc_html__("Miscellaneous Options:", 'ultimate-manga-scraper') . '</h3></td></tr><tr><td class="cr_min_width_200">
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select the web novel genre that you want for the automatically generated web novel to have.", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Additional Novel Genre", 'ultimate-manga-scraper') . ':</b>
</td><td>
<select class="cr_width_full" id="default_category" name="ums_text_list[default_category][]">
<option value="ums_no_category_12345678">' . esc_html__("Do Not Add a Genre", 'ultimate-manga-scraper') . '</option>';
foreach ($categories as $category) {
$output .= '<option value="' . esc_attr($category->term_id) . '"';
if ($category->term_id == $default_category) {
$output .= ' selected';
}
$output .= '>' . sanitize_text_field($category->name) . '</option>';
}
$output .= '</select>
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to automatically add web novel genres from the feed items?", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Auto Add Genres", 'ultimate-manga-scraper') . ':</b>
</td><td>
<select class="cr_width_full" id="auto_categories" name="ums_text_list[auto_categories][]">
<option value="disabled"';
if ($auto_categories == 'disabled') {
$output .= ' selected';
}
$output .= '>' . esc_html__("Disabled", 'ultimate-manga-scraper') . '</option>
<option value="genre"';
if ($auto_categories == 'genre') {
$output .= ' selected';
}
$output .= '>' . esc_html__("Novel Genres", 'ultimate-manga-scraper') . '</option>
</select>
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to automatically add web novel tags from the feed items?", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Auto Add Novel Tags", 'ultimate-manga-scraper') . ':</b>
</td><td>
<select class="cr_width_full" id="auto_tags" name="ums_text_list[auto_tags][]">
<option value="disabled"';
if ($auto_tags == 'disabled') {
$output .= ' selected';
}
$output .= '>' . esc_html__("Disabled", 'ultimate-manga-scraper') . '</option>
<option value="genre"';
if ($auto_tags == 'genre') {
$output .= ' selected';
}
$output .= '>' . esc_html__("Novel Genres", 'ultimate-manga-scraper') . '</option>
<option value="tags"';
if ($auto_tags == 'tags') {
$output .= ' selected';
}
$output .= '>' . esc_html__("Novel Tags", 'ultimate-manga-scraper') . '</option>
</select>
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Select the web novel tags that you want for the automatically generated web novel to have.", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Additional Novel Tags", 'ultimate-manga-scraper') . ':</b>
</td><td>
<input class="cr_width_full" type="text" name="ums_text_list[default_tags][]" value="' . esc_attr($default_tags) . '" placeholder="Please insert your additional web novel tags here" >
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to try to use PhantomJS to try to parse JavaScript from crawled pages (for pages that create dynamic content, on page load, using JavaScript)? Please note that for this to work, you must have PhantomJs installed on your server. You can configure the path to PhantomJS from your server, from plugin\'s \'Main Settings\'.", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Content Scraping Method To Use", 'ultimate-manga-scraper') . ':</b><div class="cr_float_right bws_help_box bws_help_box_right dashicons cr_align_middle"><img class="cr_align_middle" src="' . plugins_url('../images/new.png', __FILE__) . '" alt="new feature"/>
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("New feature added to this plugin: it is able to use HeadlessBrowserAPI to scrape with JavaScript rendered content any website from the internet. Also, the Tor node of the API will be able to scrape .onion sites from the Dark Net!", 'ultimate-manga-scraper') . '</div></div>';
if($use_phantom == '1')
{
if($phantom === false)
{
$phantom = ums_testPhantom();
}
if($phantom === 0)
{
$output .= '<br/><span class="cr_red12"><b>' . esc_html__('INFO: PhantomJS not found - please install it on your server or configure the path to it in plugin\'s \'Main Settings\'!', 'ultimate-manga-scraper') . '</b> <a href=\'//coderevolution.ro/knowledge-base/faq/how-to-install-phantomjs/\' target=\'_blank\'>' . esc_html__('How to install PhantomJs?', 'ultimate-manga-scraper') . '</a></span>';
}
elseif($phantom === -1)
{
$output .= '<br/><span class="cr_red12"><b>' . esc_html__('INFO: PhantomJS cannot run - shell exec is not enabled on your server. Please enable it and retry using this feature of the plugin.', 'ultimate-manga-scraper') . '</b></span>';
}
elseif($phantom === -2)
{
$output .= '<br/><span class="cr_red12"><b>' . esc_html__('INFO: PhantomJS cannot run - shell exec is not allowed to run on your server (in disable_functions list in php.ini). Please enable it and retry using this feature of the plugin.', 'ultimate-manga-scraper') . '</b></span>';
}
elseif($phantom === 1)
{
$output .= '<br/><span class="cr_green12"><b>' . esc_html__('INFO: PhantomJS OK', 'ultimate-manga-scraper') . '</b></span>';
}
}
$output .= '</div>
</td><td>
<div>
<select id="use_phantom" name="ums_text_list[use_phantom][]" class="cr_width_full">
<option value="0"';
if ($use_phantom == '0' || $use_phantom == '') {
$output .= ' selected';
}
$output .= '>' . esc_html__("WordPress (Default)", 'ultimate-manga-scraper') . '</option>
<option value="1"';
if ($use_phantom == '1') {
$output .= ' selected';
}
$output .= '>' . esc_html__("Use PhantomJS", 'ultimate-manga-scraper') . '</option>
<option value="2"';
if ($use_phantom == '2') {
$output .= ' selected';
}
$output .= '>' . esc_html__("Use Puppeteer", 'ultimate-manga-scraper') . '</option>
<option value="4"';
if ($use_phantom == '4') {
$output .= ' selected';
}
if (!isset($ums_Main_Settings['headlessbrowserapi_key']) || trim($ums_Main_Settings['headlessbrowserapi_key']) == '')
{
$output .= ' title="' . esc_html__("This option is disabled. To enable it, add a HeadlessBrowserAPI Key in the plugin's 'Main Settings' menu.", 'ultimate-manga-scraper') . '" disabled';
}
$output .= '>' . esc_html__("Puppeteer (HeadlessBrowserAPI)", 'ultimate-manga-scraper') . '</option>
<option value="5"';
if ($use_phantom == '5') {
$output .= ' selected';
}
if (!isset($ums_Main_Settings['headlessbrowserapi_key']) || trim($ums_Main_Settings['headlessbrowserapi_key']) == '')
{
$output .= ' title="' . esc_html__("This option is disabled. To enable it, add a HeadlessBrowserAPI Key in the plugin's 'Main Settings' menu.", 'ultimate-manga-scraper') . '" disabled';
}
$output .= '>' . esc_html__("Tor (HeadlessBrowserAPI)", 'ultimate-manga-scraper') . '</option>
<option value="6"';
if ($use_phantom == '6') {
$output .= ' selected';
}
if (!isset($ums_Main_Settings['headlessbrowserapi_key']) || trim($ums_Main_Settings['headlessbrowserapi_key']) == '')
{
$output .= ' title="' . esc_html__("This option is disabled. To enable it, add a HeadlessBrowserAPI Key in the plugin's 'Main Settings' menu.", 'ultimate-manga-scraper') . '" disabled';
}
$output .= '>' . esc_html__("PhantomJS (HeadlessBrowserAPI)", 'ultimate-manga-scraper') . '</option>
</select>
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the number of milliseconds that phantomjs should wait before rendering pages (1000 ms = 1 sec).", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Headless Browser Wait Before Rendering Pages (ms)", 'ultimate-manga-scraper') . ':</b>
</div>
</td><td>
<div>
<input type="number" min="0" step="1" id="phantom_wait" name="ums_text_list[phantom_wait][]" value="' . esc_attr($phantom_wait) . '" placeholder="0" class="cr_width_full">
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to enable comments for the generated web novel?", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Enable Comments For Novel", 'ultimate-manga-scraper') . ':</b>
</td><td>
<input type="checkbox" id="enable_comments" name="ums_text_list[enable_comments][]"';
if ($enable_comments == '1') {
$output .= ' checked';
}
$output .= '>
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to enable pingbacks and trackbacks for the generated web novel?", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Enable Pingback/Trackback", 'ultimate-manga-scraper') . ':</b>
</td><td>
<input type="checkbox" id="enable_pingback" name="ums_text_list[enable_pingback][]"';
if ($enable_pingback == '1') {
$output .= ' checked';
}
$output .= '>
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to get the publish date from the source web novels?", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Get Publish Date From Novel", 'ultimate-manga-scraper') . ':</b>
</td><td>
<input type="checkbox" id="get_date" name="ums_text_list[get_date][]"';
if ($get_date == '1') {
$output .= ' checked';
}
$output .= '>
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set a global chapter warning message to display on the scraped web novel.", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Global Chapter Warning Message", 'ultimate-manga-scraper') . ':</b>
</td><td>
<input class="cr_width_full" type="text" name="ums_text_list[chapter_warning][]" value="' . esc_attr($chapter_warning) . '" placeholder="Global Chapter Warning Message" >
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Set the first chapter slug for the scraped web novel. This needs to be set only if the first chapter URL is different than chapter-1", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("First Chapter Slug", 'ultimate-manga-scraper') . ':</b>
</td><td>
<input class="cr_width_full" type="text" name="ums_text_list[chapter_slug][]" value="' . esc_attr($chapter_slug) . '" placeholder="chapter-1" >
</div>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to strip images, videos and scripts from newly published chapters?", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Strip Images, Videos And Scripts From Chapters", 'ultimate-manga-scraper') . ':</b>
</td><td>
<input type="checkbox" id="strip_images" name="ums_text_list[strip_images][]"';
if ($strip_images == '1') {
$output .= ' checked';
}
$output .= '>
</div>
</td></tr><tr><td>
<h3>' . esc_html__("Translation Options:", 'ultimate-manga-scraper') . '</h3></td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to automatically translate generated content using Google Translate? If set, this will overwrite the \'Automatically Translate Content To\' option from plugin\'s \'Main Settings\'.", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Automatically Translate Content To", 'ultimate-manga-scraper') . ':</b><br/><b>' . esc_html__("Info:", 'ultimate-manga-scraper') . '</b> ' . esc_html__("for translation, the plugin also supports WPML.", 'ultimate-manga-scraper') . ' <b><a href="https://wpml.org/?aid=238195&affiliate_key=ix3LsFyq0xKz" target="_blank">' . esc_html__("Get WPML now!", 'ultimate-manga-scraper') . '</a></b>
</td><td>
<select class="cr_width_full" id="translate" name="ums_text_list[rule_translate][]" >';
$i = 0;
foreach ($GLOBALS['language_names'] as $lang) {
$output .= '<option value="' . esc_attr($GLOBALS['language_codes'][$i]) . '"';
if ($rule_translate == $GLOBALS['language_codes'][$i]) {
$output .= ' selected';
}
$output .= '>' . esc_html($GLOBALS['language_names'][$i]) . '</option>';
$i++;
}
if(isset($ums_Main_Settings['deepl_auth']) && $ums_Main_Settings['deepl_auth'] != '')
{
$i = 0;
foreach ($GLOBALS['language_names_deepl'] as $lang) {
$output .= '<option value="' . esc_attr($GLOBALS['language_codes_deepl'][$i]) . '"';
if ($rule_translate == $GLOBALS['language_codes_deepl'][$i]) {
$output .= ' selected';
}
$output .= '>' . esc_html($GLOBALS['language_names_deepl'][$i]) . '</option>';
$i++;
}
}
if(isset($ums_Main_Settings['bing_auth']) && $ums_Main_Settings['bing_auth'] != '')
{
$i = 0;
foreach ($GLOBALS['language_names_bing'] as $lang) {
$output .= '<option value="' . esc_attr($GLOBALS['language_codes_bing'][$i]) . '"';
if ($rule_translate == $GLOBALS['language_codes_bing'][$i]) {
$output .= ' selected';
}
$output .= '>' . esc_html($GLOBALS['language_names_bing'][$i]) . '</option>';
$i++;
}
}
$output .= '</select>
</div>
</td></tr>
</td></tr><tr><td>
<div>
<div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__("Do you want to not translate web novel titles?", 'ultimate-manga-scraper') . '
</div>
</div>
<b>' . esc_html__("Do Not Translate Title", 'ultimate-manga-scraper') . ':</b>
</td><td>
<input type="checkbox" id="no_translate_title" name="ums_text_list[no_translate_title][]"';
if ($no_translate_title == '1') {
$output .= ' checked';
}
$output .= '>
</div></table></div>
</div>
<div class="codemodalfzr-footer">
<br/>
<h3 class="cr_inline">Ultimate Web Novel & Manga Scraper</h3><span id="ums_ok' . esc_html($cont) . '" class="codeokfzr cr_inline">OK </span>
<br/><br/>
</div>
</div>
</div>
</td>
<td class="cr_comm_td"><span class="wpums-delete">X</span></td>
<td class="cr_comm_td"><input type="checkbox" name="ums_text_list[active][]" class="activateDeactivateClass" value="1"';
if (isset($active) && $active === '1') {
$output .= ' checked';
}
$output .= '/>
<input type="hidden" name="ums_text_list[last_run][]" value="' . esc_attr($last_run) . '"/></td>
<td class="cr_comm_td"><div class="bws_help_box bws_help_box_right dashicons dashicons-editor-help cr_align_middle">
<div class="bws_hidden_help_text cr_min_260px">' . esc_html__('Novels Generated:', 'ultimate-manga-scraper') . ' ' . esc_html($generated_posts) . '<br/>';
if ($generated_posts != 0) {
$output .= '<a href="' . get_admin_url() . 'edit.php?coderevolution_post_source=Ums_1_' . esc_html($cont) . '&post_type=wp-manga" target="_blank">' . esc_html__('View Generated Novels', 'ultimate-manga-scraper') . '</a><br/>';
}
$output .= esc_html__('Last Run: ', 'ultimate-manga-scraper');
if ($last_run == '1988-01-27 00:00:00') {
$output .= 'Never';
} else {
$output .= $last_run;
}
$output .= '<br/>' . esc_html__('Next Run: ', 'ultimate-manga-scraper');
if($unlocker == '1')
{
$nextrun = ums_add_minute($last_run, $schedule);
}
else
{
$nextrun = ums_add_hour($last_run, $schedule);
}
$now = ums_get_date_now();
if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) {
$output .= esc_html__('WP-CRON Disabled. Rules will not automatically run!', 'ultimate-manga-scraper');
}
else
{
if (isset($active) && $active === '1') {
if($unlocker == '1')
{
$ums_hour_diff = (int)ums_minute_diff($now, $nextrun);
}
else
{
$ums_hour_diff = (int)ums_hour_diff($now, $nextrun);
}
if ($ums_hour_diff >= 0) {
$append = 'Now.';
$cron = _get_cron_array();
if ($cron != FALSE) {
$date_format = _x('Y-m-d H:i:s', 'Date Time Format1', 'ultimate-manga-scraper');
foreach ($cron as $timestamp => $cronhooks) {
foreach ((array) $cronhooks as $hook => $events) {
if ($hook == 'umsaction') {
foreach ((array) $events as $key => $event) {
$append = date_i18n($date_format, $timestamp);
}
}
}
}
}
$output .= $append;
} else {
$output .= $nextrun;
}
} else {
$output .= esc_html__('Rule Disabled', 'ultimate-manga-scraper');
}
}
$output .= '<br/>' . esc_html__('Local Time: ', 'ultimate-manga-scraper') . $now;
$output .= '</div>
</div></td>
<td class="cr_center">
<div>
<img id="run_img' . esc_html($cont) . '" src="' . plugin_dir_url(dirname(__FILE__)) . 'images/running.gif' . '" alt="Running" class="cr_status_icon';
if (!empty($running)) {
if (!in_array(array($cont => 1), $running)) {
$output .= ' cr_hidden';
}
else
{
$f = fopen(get_temp_dir() . 'ums_1_' . $cont, 'w');
if($f !== false)
{
if (!flock($f, LOCK_EX | LOCK_NB)) {
}
else
{
$output .= ' cr_hidden';
flock($f, LOCK_UN);
if (($xxkey = array_search(array($cont => 1), $running)) !== false) {
unset($running[$xxkey]);
update_option('ums_running_list', $running);
}
}
}
}
} else {
$output .= ' cr_hidden';
}
$output .= '" title="status">
<div class="codemainfzr">
<select id="actions" class="actions" name="actions" onchange="actionsChangedManual(' . esc_html($cont) . ', this.value, 1);" onfocus="this.selectedIndex = 0;">
<option value="select" disabled selected>' . esc_html__("Select an Action", 'ultimate-manga-scraper') . '</option>
<option value="run">' . esc_html__("Run This Rule Now", 'ultimate-manga-scraper') . '</option>
<option value="trash">' . esc_html__("Move All Novels To Trash", 'ultimate-manga-scraper') . '</option>
<option value="delete">' . esc_html__("Permanently Delete All Novels", 'ultimate-manga-scraper') . '</option>
</select>
</div>
</div>
</td>
</tr>
';
$cont = $cont + 1;
}
}
return $output;
}
?> |