Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[r1283]: branches / 2.5.4RC1 / cgi-bin / yabb2 / Convert.pl Maximize Restore History

Download this file

Convert.pl    4017 lines (3587 with data), 178.8 kB

   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
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
#!/usr/bin/perl --
# $Id: YaBB Converter $
# $HeadURL: YaBB $
# $Source: /Convert.pl $
###############################################################################
# Convert.pl #
# $Date: 9.02.13 $ #
###############################################################################
# YaBB: Yet another Bulletin Board #
# Open-Source Community Software for Webmasters #
# Version: YaBB 2.5.41 #
# Packaged: September 1, 2013 #
# Distributed by: http://www.yabbforum.com #
# =========================================================================== #
# Copyright (c) 2000-2013 YaBB (www.yabbforum.com) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
###############################################################################
# use strict;
# use warnings;
no warnings qw(uninitialized once redefine);
use CGI::Carp qw(fatalsToBrowser);
use English qw(-no_match_vars);
our $VERSION = '2.5.41';
$convertplver = 'YaBB 2.5.4 RC1 $Revision: 1283 $';
# conversion will stop after $max_process_time
# in seconds, than the browser will call the script
# again until all is done. Don't put it too high
# or you will run into server or browser timeout
$max_process_time = 20;
$time_to_jump = time() + $max_process_time;
if ( $ENV{'SERVER_SOFTWARE'} =~ /IIS/sm ) {
$yyIIS = 1;
if ( $PROGRAM_NAME =~ m{(.*)(\\|/)}xsm ) {
$yypath = $1;
}
$yypath =~ s/\\/\//gxsm;
chdir $yypath;
push @INC, $yypath;
}
### Requirements and Errors ###
$script_root = $ENV{'SCRIPT_FILENAME'};
if ( !$script_root ) {
$script_root = $ENV{'PATH_TRANSLATED'};
$script_root =~ s/\\/\//gxsm;
}
$script_root =~ s/\/Convert\.(pl|cgi)//igxsm;
if ( -e './Paths.pm' ) { require Paths; }
elsif ( -e "$script_root/Paths.pm" ) { require "$script_root/Paths.pm"; }
elsif ( -e "$script_root/Variables/Paths.pm" ) {
require "$script_root/Variables/Paths.pm";
}
if ( -e 'YaBB.cgi' ) { $yyext = 'cgi'; }
else { $yyext = 'pl'; }
if ($boardurl) { $set_cgi = "$boardurl/Convert.$yyext"; }
else { $set_cgi = "Convert.$yyext"; }
# Make sure the module path is present
push @INC, './Modules';
require Sources::Subs;
require Sources::System;
require Sources::Load;
require Sources::DateTime;
#############################################
# Conversion starts here #
#############################################
$px = 'px';
# Conversion was rewritten and fixed for xx-large
# forums by Detlef Pilzecker (deti) in June 2008
# The 'our' function is available sincee Perl v5.6.0
# If your Perl version is lower, then comment the 'our'-lines out and use this:
# use vars qw(@categoryorder,@catboards,@catdata,@boarddata,@allboards,%catinfo,%cat,%board,%boarddata,$catfile,$boardfile,$key,$value,$cnt);
our ( @categoryorder, @catboards, @catdata, @boarddata, @allboards );
our ( %catinfo, %cat, %board, %boarddata );
our ( $catfile, $boardfile, $key, $value, $cnt );
our (%fixed_users);
if ( -e "$vardir/Setup.lock" ) {
if ( -e "$vardir/Converter.lock" ) { FoundConvLock(); }
if ( -e "$vardir/fixusers.txt" ) {
fopen( FIXUSER, "$vardir/fixusers.txt" )
|| setup_fatal_error( "$maintext_23 $vardir/fixusers.txt: ", 1 );
my @fixed = <FIXUSER>;
fclose(FIXUSER);
foreach (@fixed) {
my ( $user, $fixedname, undef, $displayedname, undef ) =
split /\|/xsm, $_;
@{ $fixed_users{$user} } = ( $fixedname, $displayedname );
}
}
tempstarter();
tabmenushow();
if ( $action && !$INFO{'convert'} ) {
# needed for: sub conv_stringtotime
require Time::Local;
import Time::Local 'timelocal';
}
elsif ( !$action || $INFO{'convert'} ) {
$yytabmenu =
$NavLink1 . $NavLink2 . $NavLink3 . $NavLink4 . $NavLink5 . $NavLink6;
$yymain = qq~
<div class="bordercolor borderbox">
<form action="$set_cgi?action=prepare" method="post">
<table class="cs_thin pad_4px">
<col style="width:5%" />
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2 fontbigger">
Make sure your YaBB 2.5.4 installation is running and that it has all the correct folder paths and URLs.<br />
Proceed through the following steps to convert your YaBB 1 Gold - SP 1.x forum to YaBB 2.5.4!<br /><br />
<b>If</b> your YaBB 1 Gold - SP 1.x forum is located on the same server as your YaBB 2.5.4 installation:
<ol>
<li>Insert the path to your YaBB 1 Gold - SP 1.x forum in the input field below</li>
<li>Click on the 'Continue' button</li>
</ol>
<b>Else</b> if your YaBB 1 Gold - SP 1.x forum is located on a different server than your YaBB 2.5.4 installation or if you do not know the path to your SP 1.x forum:
<ol>
<li>Copy all files in the /Boards, /Members, and /Messages folders from your YaBB 1 Gold - SP 1.x installation, to the corresponding Convert/Boards, Convert/Members, and Convert/Messages folders of your YaBB 2.5.4 installation, and chmod them 777.</li>
<li>Copy cat.txt from the /Variables folder of your YaBB 1 Gold - SP 1.x installation to the Convert/Variables folder of your YaBB 2.5.4 installation, and chmod it 666.</li>
<li>If you have 'Add More Membergroups' installed on your YaBB 1 Gold - SP 1.x, copy MemberStats.txt from the /Variables folder of your YaBB 1 Gold - SP 1.x installation to the Convert/Variables folder of your YaBB 2.5.4 installation, and chmod it 666.</li>
<li>Click on the 'Continue' button</li>
</ol>
<div style="width: 100%; text-align: center;">
<b>Path to your YaBB 1 Gold - SP 1.x files: </b> <input type="text" name="convertdir" value="$convertdir" size="50" />
</div>
<br />
</td>
</tr><tr>
<td class="catbg center" colspan="2">
<input type="submit" value="Continue" />
</td>
</tr>
</table>
</form>
</div>
~;
}
if ( $action eq 'prepare' ) {
UpdateCookie('delete');
$username = 'Guest';
$iamguest = '1';
$iamadmin = q{};
$iamgmod = q{};
$password = q{};
$yyim = q{};
local $ENV{'HTTP_COOKIE'} = q{};
$yyuname = q{};
$convertdir = $FORM{'convertdir'};
if ( !-d "$convertdir/Boards" ) {
setup_fatal_error( "Directory: $convertdir/Boards", 1 );
}
else { $convboardsdir = "$convertdir/Boards"; }
if ( !-e "$convertdir/Members/memberlist.txt" ) {
setup_fatal_error( "Directory: $convertdir/Members", 1 );
}
else { $convmemberdir = "$convertdir/Members"; }
if ( !-d "$convertdir/Messages" ) {
setup_fatal_error( "Directory: $convertdir/Messages", 1 );
}
else { $convdatadir = "$convertdir/Messages"; }
if ( !-e "$convertdir/Variables/cat.txt" ) {
setup_fatal_error( "Directory: $convertdir/Variables", 1 );
}
else { $convvardir = "$convertdir/Variables"; }
my $setfile = << "EOF";
\$convertdir = qq~$convertdir~;
\$convboardsdir = qq~$convertdir/Boards~;
\$convmemberdir = qq~$convertdir/Members~;
\$convdatadir = qq~$convertdir/Messages~;
\$convvardir = qq~$convertdir/Variables~;
1;
EOF
fopen( SETTING, ">$vardir/ConvSettings.txt" )
|| setup_fatal_error( "$maintext_23 $vardir/ConvSettings.txt: ", 1 );
print {SETTING} nicely_aligned_file($setfile)
or croak 'cannot print SETTING';
fclose(SETTING);
$yytabmenu =
$NavLink1a
. $NavLink2
. $NavLink3
. $NavLink4
. $NavLink5
. $NavLink6;
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<col style="width:5%" />
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2 fontbigger">
<ul>
<li>Members info found in: <b>$convmemberdir</b></li>
<li>Board and Category info found in: <b>$convboardsdir</b></li>
<li>Messages info found in: <b>$convdatadir</b></li>
<li>cat.txt found in: <b>$convvardir</b></li>
</ul>
</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2 fontbigger">
- Conversion can take a long time depending on the size of your forum (30 seconds to a couple hours).<br />
- Your browser will be refreshed automatically every $max_process_time seconds and you will see the ongoing process in the status bar.<br />
- Some internet connections refresh their IP-Address automatically every 24 hours.<br />
&nbsp; Make sure that your IP-Address will not change during conversion, or you must restart the conversion after that! <br />
- Your forum will be set to maintenance while converting.
<p id="memcontinued">Click on 'Members' in the menu to start.<br />&nbsp;</p>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function PleaseWait() {
document.getElementById("memcontinued").innerHTML = '<span style="color:red"><b>Converting - please wait!<br />If you want to stop \\'Members\\' conversion, click here on STOP before this red message appears again on next page.</b></span>';
}
</script>
~;
}
elsif ( $action eq 'members' ) {
if ( !exists $INFO{'mstart1'} ) { PrepareConv(); }
$INFO{'mstart2'} ? ConvertMembers2() : ConvertMembers1();
$yytabmenu =
$NavLink1
. $NavLink2a
. $NavLink3
. $NavLink4
. $NavLink5
. $NavLink6;
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<col style="width:5%" />
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2">
<div class="convdone">Member Conversion.</div>
$ConvDone
<div class="convnotdone">Board and Category Conversion.</div>
$ConvNotDone
<div class="convnotdone">Message Conversion.</div>
$ConvNotDone
<div class="convnotdone">Date &amp; Time Conversion.</div>
$ConvNotDone
<div class="convnotdone">Final Cleanup.</div>
$ConvNotDone
</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2 fontbigger">
New User data files have been created.<br />
Password encryption is done for each user the first time he/she logs in.<br />
<br />
You are converting <i>~
. int( ( $INFO{'st'} + 60 ) / 60 ) . qq~ minutes</i>.
<br />
<br />
<p id="memcontinued">Click on 'Boards &amp; Categories' in the menu to continue.<br />
If you do not do that the script will continue itself in 5 Minutes.</p>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function PleaseWait() {
document.getElementById("memcontinued").innerHTML = '<span style="color:red"><b>Converting - please wait!<br />If you want to stop \\'Boards & Categories\\' conversion, click here on STOP before this red message appears again on next page.</b></span>';
}
function membtick() {
PleaseWait();
location.href="$set_cgi?action=cats;st=$INFO{'st'}";
}
setTimeout("membtick()",300000);
</script>
~;
if ( -e "$vardir/fixusers.txt" ) {
fopen( FIXUSER, "$vardir/fixusers.txt" )
|| setup_fatal_error( "$maintext_23 $vardir/fixusers.txt: ", 1 );
my @fixed = <FIXUSER>;
fclose(FIXUSER);
chomp @fixed;
$yymain .= qq~
<br />
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<col style="width:5%" />
<tr>
<td class="windowbg" colspan="5">
Member(s) with illegal username(s) were found and converted to legal name(s).<br />
You can find this information in the <i>$vardir/fixusers.txt</i> file. If you do not need it, you can delete it later.
</td>
</tr><tr>
<td class="catbg center">Invalid name</td>
<td class="catbg center">Fixed name</td>
<td class="catbg center">Reg. date</td>
<td class="catbg center">Displayed name</td>
<td class="catbg center">E-mail</td>
</tr>~;
foreach my $userfixed (@fixed) {
( $inname, $fxname, $rgdate, $dspname, $tmail ) =
split /\|/xsm, $userfixed;
$yymain .= qq~<tr>
<td class="windowbg2">$inname</td>
<td class="windowbg2">$fxname</td>
<td class="windowbg2">$rgdate</td>
<td class="windowbg2">$dspname</td>
<td class="windowbg2">$tmail</td>
</tr>~;
}
$yymain .= q~
</table>
</div>~;
}
}
elsif ( $action eq 'members2' ) {
if ( $INFO{'mstart1'} <= 0 || $INFO{'mstart2'} < 0 ) {
setup_fatal_error(
"Member conversion (members2) 'mstart1' ($INFO{'mstart1'}), 'mstart2' ($INFO{'mstart2'}) error!"
);
}
$yytabmenu =
$NavLink1 . $NavLink2 . $NavLink3 . $NavLink4 . $NavLink5 . $NavLink6;
my $mwidth =
int( ( ( $INFO{'mstart2'} + $INFO{'mstart1'} ) / 2 ) /
$INFO{'mtotal'} *
100 );
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<col style="width:5%" />
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2">
<div class="convdone">Member Conversion.</div>
<div class="divouter">
<div class="divvary" style="width: $mwidth$px;">&nbsp;</div>
</div>
<div class="divvary2">$mwidth %</div>
<br />
<div class="convnotdone">Board and Category Conversion.</div>
$ConvNotDone
<div class="convnotdone">Message Conversion.</div>
$ConvNotDone
<div class="convnotdone">Date &amp; Time Conversion.</div>
$ConvNotDone
<div class="convnotdone">Final Cleanup.</div>
$ConvNotDone
</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2 fontbigger">
To prevent server time-out due to the amount of members to be converted, the conversion is split into more steps.<br />
<br />
The time-step (\$max_process_time) is set to <i>$max_process_time seconds</i>.<br />
The last step took <i>~
. ( $time_to_jump - $INFO{'starttime'} ) . q~ seconds</i>.
<br />
You are converting <i>~
. int( ( $INFO{'st'} + 60 ) / 60 ) . q~ minutes</i>.
<br />
<br />
There are <b>~
. int(
$INFO{'mtotal'} - ( ( $INFO{'mstart2'} + $INFO{'mstart1'} ) / 2 ) )
. qq~/$INFO{'mtotal'}</b> Members left to be converted.
<br />
<p id="memcontinued">If nothing happens in 5 seconds <a href="$set_cgi?action=members;st=$INFO{'st'};mstart1=$INFO{'mstart1'};mstart2=$INFO{'mstart2'}" onclick="PleaseWait();">click here to continue</a>...<br />If you want to <a href="javascript:stoptick();">STOP 'Members' conversion click here</a>. Then copy the actual browser adress and type it in when you are going to continue the conversion.</p>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function PleaseWait() {
document.getElementById("memcontinued").innerHTML = '<span style="color:red"><b>Converting - please wait!<br />If you want to stop \\'Members\\' conversion, click here on STOP before this red message appears again on next page.</b></span>';
}
function stoptick() { stop = 1; }
stop = 0;
function membtick() {
if (stop != 1) {
PleaseWait();
location.href="$set_cgi?action=members;st=$INFO{'st'};mstart1=$INFO{'mstart1'};mstart2=$INFO{'mstart2'}";
}
}
setTimeout("membtick()",2000);
</script>
~;
}
elsif ( $action eq 'cats' ) {
if ( !exists $INFO{'bstart'} || !exists $INFO{'bfstart'} ) {
GetCats();
CreateControl();
}
ConvertBoards();
$yytabmenu =
$NavLink1
. $NavLink2
. $NavLink3a
. $NavLink4
. $NavLink5
. $NavLink6;
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<col style="width:5%" />
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2">
<div class="convdone">Member Conversion.</div>
$ConvDone
<div class="convdone">Board &amp; Category Conversion.</div>
$ConvDone
<div class="convnotdone">Message Conversion.</div>
$ConvNotDone
<div class="convnotdone">Date &amp; Time Conversion.</div>
$ConvNotDone
<div class="convnotdone">Final Cleanup.</div>
$ConvNotDone
</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2 fontbigger">
New forum.master file has been created.<br />
New forum.control file has been created.<br />
All dates in files have been converted to timestamps.<br />
All threads have been converted.<br />
<br />
You are converting <i>~
. int( ( $INFO{'st'} + 60 ) / 60 ) . qq~ minutes</i>.<br />
<br />
<p id="memcontinued">Click on 'Messages' in the menu to continue.<br />
If you do not do that the script will continue by itself in 5 minutes.</p>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function PleaseWait() {
document.getElementById("memcontinued").innerHTML = '<span style="color:red"><b>Converting - please wait!<br />If you want to stop \\'Messages\\' conversion, click here on STOP before this red message appears again on next page.</b></span>';
}
function membtick() {
PleaseWait();
location.href="$set_cgi?action=messages;st=$INFO{'st'}";
}
setTimeout("membtick()",300000);
</script>
~;
}
elsif ( $action eq 'cats2' ) {
if ( ( !$INFO{'bstart'} && !$INFO{'bfstart'} )
|| $INFO{'bstart'} < 0
|| $INFO{'bfstart'} < 0 )
{
setup_fatal_error(
"Boards conversion (cats2) 'bstart' ($INFO{'bstart'}) or 'bfstart' ($INFO{'bfstart'}) error!"
);
}
$yytabmenu =
$NavLink1 . $NavLink2 . $NavLink3 . $NavLink4 . $NavLink5 . $NavLink6;
my $bwidth = int( $INFO{'bstart'} / $INFO{'btotal'} * 100 );
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<col style="width:5%" />
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2">
<div class="convdone">Member Conversion.</div>
$ConvDone
<div class="convdone">Board and Category Conversion.</div>
<div class="divouter">
<div class="divvary" style="width: $bwidth$px;">&nbsp;</div>
</div>
<div class="divvary2">$bwidth %</div>
<br />
<div class="convnotdone">Message Conversion.</div>
$ConvNotDone
<div class="convnotdone">Date &amp; Time Conversion.</div>
$ConvNotDone
<div class="convnotdone">Final Cleanup.</div>
$ConvNotDone
</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2 fontbigger">
To prevent server time-out due to the amount of boards to be converted, the conversion is split into more steps.<br />
<br />
The time-step (\$max_process_time) is set to <i>$max_process_time seconds</i>.<br />
The last step took <i>~
. ( $time_to_jump - $INFO{'starttime'} ) . q~ seconds</i>.<br />
You are converting <i>~
. int( ( $INFO{'st'} + 60 ) / 60 ) . q~ minutes</i>.<br />
<br />
There are <b>~
. ( $INFO{'btotal'} - $INFO{'bstart'} )
. qq~/$INFO{'btotal'}</b> Boards left to be converted.<br />
<p id="memcontinued">If nothing happens in 5 seconds <a href="$set_cgi?action=cats;st=$INFO{'st'};bstart=$INFO{'bstart'};bfstart=$INFO{'bfstart'}" onclick="PleaseWait();">click here to continue</a>...<br />If you want to <a href="javascript:stoptick();">STOP 'Boards & Categories' conversion click here</a>. Then copy the actual browser address and type it in when you are going to continue the conversion.</p>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function PleaseWait() {
document.getElementById("memcontinued").innerHTML = '<span style="color:red"><b>Converting - please wait!<br />If you want to stop \\'Boards & Categories\\' conversion, click here on STOP before this red message appears again on next page.</b></span>';
}
function stoptick() { stop = 1; }
stop = 0;
function membtick() {
if (stop != 1) {
PleaseWait();
location.href="$set_cgi?action=cats;st=$INFO{'st'};bstart=$INFO{'bstart'};bfstart=$INFO{'bfstart'}";
}
}
setTimeout("membtick()",2000);
</script>
~;
}
elsif ( $action eq 'messages' ) {
ConvertMessages();
$yytabmenu =
$NavLink1
. $NavLink2
. $NavLink3
. $NavLink4a
. $NavLink5
. $NavLink6;
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<col style="width:5%" />
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2">
<div class="convdone">Member Conversion.</div>
$ConvDone
<div class="convdone">Board and Category Conversion.</div>
$ConvDone
<div class="convdone">Message Conversion.</div>
$ConvDone
<div class="convnotdone">Date &amp; Time Conversion.</div>
$ConvNotDone
<div class="convnotdone">Final Cleanup.</div>
$ConvNotDone
</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2 fontbigger">
New style message files have been created.<br />
<br />
<i>$INFO{'total_threads'}</i> Threads have been converted.<br />
<i>$INFO{'total_mess'}</i> Messages have been converted.<br />
<br />
You are converting <i>~
. int( ( $INFO{'st'} + 60 ) / 60 ) . qq~ minutes</i>.<br />
<br />
<p id="memcontinued">Click on 'Date &amp; Time' in the menu to continue.<br />
If you do not do that the script will continue by itself in 5 minutes.</p>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function PleaseWait() {
document.getElementById("memcontinued").innerHTML = '<span style="color:red"><b>Converting - please wait!<br />If you want to stop \\'Date &amp; Time\\' conversion, click here on STOP before this red message appears again on next page.</b></span>';
}
function membtick() {
PleaseWait();
location.href="$set_cgi?action=dates;st=$INFO{'st'}";
}
setTimeout("membtick()",300000);
</script>
~;
}
elsif ( $action eq 'messages2' ) {
if ( ( !$INFO{'count'} && !$INFO{'tcount'} )
|| $INFO{'count'} < 0
|| $INFO{'tcount'} < 0 )
{
setup_fatal_error(
"Message conversion (messages2) 'count' ($INFO{'count'}) or 'tcount' ($INFO{'tcount'}) error!",
1
);
}
my $bwidth = int( $INFO{'count'} / $INFO{'totboard'} * 100 );
my $mwidth =
$INFO{'totmess'}
? int( $INFO{'tcount'} / $INFO{'totmess'} * 100 )
: 0;
$yytabmenu =
$NavLink1 . $NavLink2 . $NavLink3 . $NavLink4 . $NavLink5 . $NavLink6;
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<col style="width:5%" />
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2">
<div class="convdone">Member Conversion.</div>
$ConvDone
<div class="convdone">Board and Category Conversion.</div>
$ConvDone
<div class="convdone">Message Conversion.</div>
<div class="divouter">
<div class="divvary" style="width: $bwidth$px;">&nbsp;</div>
</div>
<div class="divvary2">$bwidth %</div><br />
<div class="convnotdone">Date &amp; Time Conversion.</div>
$ConvNotDone
<div class="convnotdone">Final Cleanup.</div>
$ConvNotDone
</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2 fontbigger">
To prevent server time-out due to the amount of messages to be converted, the conversion is split into more steps.<br />
<br />
The time-step (\$max_process_time) is set to <i>$max_process_time seconds</i>.<br />
The last step took <i>~
. ( $time_to_jump - $INFO{'starttime'} ) . q~ seconds</i>.<br />
You are converting <i>~
. int( ( $INFO{'st'} + 60 ) / 60 ) . qq~ minutes</i>.<br />
<br />
<i>$INFO{'total_threads'}</i> Threads where converted until now.<br />
<i>$INFO{'total_mess'}</i> Messages where converted until now.<br />
<br />
There are <b>~
. ( $INFO{'totboard'} - $INFO{'count'} )
. qq~/$INFO{'totboard'}</b> Boards left, to convert the Messages in.<br />
<div style="float: left;">There are <b>~
. ( $INFO{'totmess'} - $INFO{'tcount'} )
. qq~/$INFO{'totmess'}</b> Threads left in the actual Board to be converted. &nbsp; </div>
<div class="divouter">
<div class="divvary" style="width: $mwidth$px;">&nbsp;</div>
</div>
<div class="divvary2">$mwidth %</div>
<br />
<p id="memcontinued">If nothing happens in 5 seconds <a href="$set_cgi?action=messages;st=$INFO{'st'};count=$INFO{'count'};tcount=$INFO{'tcount'};total_mess=$INFO{'total_mess'};total_threads=$INFO{'total_threads'}" onclick="PleaseWait();">click here to continue</a>...<br />If you want to <a href="javascript:stoptick();">STOP 'Messages' conversion click here</a>. Then copy the actual browser address and type it in when you are going to continue the conversion.</p>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function PleaseWait() {
document.getElementById("memcontinued").innerHTML = '<span style="color:red"><b>Converting - please wait!<br />If you want to stop \\'Messages\\' conversion, click here on STOP before this red message appears again on next page.</b></span>';
}
function stoptick() { stop = 1; }
stop = 0;
function membtick() {
if (stop != 1) {
PleaseWait();
location.href="$set_cgi?action=messages;st=$INFO{'st'};count=$INFO{'count'};tcount=$INFO{'tcount'};total_mess=$INFO{'total_mess'};total_threads=$INFO{'total_threads'}";
}
}
setTimeout("membtick()",2000);
</script>
~;
}
elsif ( $action eq 'dates' ) {
ConvertTimeToString();
$yytabmenu =
$NavLink1
. $NavLink2
. $NavLink3
. $NavLink4
. $NavLink5a
. $NavLink6;
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<col style="width:5%" />
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2">
<div class="convdone">Member Conversion.</div>
$ConvDone
<div class="convdone">Board &amp; Category Conversion.</div>
$ConvDone
<div class="convdone">Message Conversion.</div>
$ConvDone
<div class="convdone">Date &amp; Time Conversion.</div>
$ConvDone
<div class="convnotdone">Final Cleanup.</div>
$ConvNotDone
</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2 fontbigger">
New style timestamps have been created throughout the board. All old style dates have been converted.<br />
<br />
You are converting <i>~
. int( ( $INFO{'st'} + 60 ) / 60 ) . qq~ minutes</i>.<br />
<br />
<p id="memcontinued">Click on 'Clean Up' in the menu to continue.<br />
If you do not do that the script will continue by itself in 5 minutes.</p>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function PleaseWait() {
document.getElementById("memcontinued").innerHTML = '<span style="color:red"><b>Converting - please wait!<br />If you want to stop \\'Clean Up\\', click here on STOP before this red message appears again on next page.</b></span>';
}
function membtick() {
PleaseWait();
location.href="$set_cgi?action=cleanup;st=$INFO{'st'}";
}
setTimeout("membtick()",300000);
</script>
~;
}
elsif ( $action eq 'dates2' ) {
if ( $INFO{'pollfile'} <= 0 && $INFO{'polledfile'} <= 0 ) {
setup_fatal_error(
"Date &amp; Time conversion (dates2) error! pollfile($INFO{'pollfile'}), polledfile($INFO{'polledfile'})",
1
);
}
my $pollwidth =
( $INFO{'totalpolls'} && $INFO{'pollfile'} )
? int( $INFO{'pollfile'} / $INFO{'totalpolls'} * 100 )
: 100;
$INFO{'pollfile'} =
$INFO{'pollfile'} ? $INFO{'pollfile'} : $INFO{'totalpolls'};
my $polledwidth =
( $INFO{'totalpolled'} && $INFO{'polledfile'} )
? int( $INFO{'polledfile'} / $INFO{'totalpolled'} * 100 )
: 0;
$INFO{'polledfile'} =
$INFO{'polledfile'} ? $INFO{'polledfile'} : $INFO{'totalpolled'};
$yytabmenu =
$NavLink1 . $NavLink2 . $NavLink3 . $NavLink4 . $NavLink5 . $NavLink6;
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<col style="width:5%" />
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2">
<div class="convdone">Member Conversion.</div>
$ConvDone
<div class="convdone">Board &amp; Category Conversion.</div>
$ConvDone
<div class="convdone">Message Conversion.</div>
$ConvDone
<div class="convdone">Date &amp; Time Conversion.</div>
<div class="divouter_center">
See info below!
</div>
<div class="divvary2">--- %</div><br />
<div class="convnotdone">Final Cleanup.</div>
$ConvNotDone
</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2 fontbigger">
To prevent server time-out due to the amount of Date &amp; Time conversion, the conversion is split into more steps.<br />
<br />
The time-step (\$max_process_time) is set to <i>$max_process_time seconds</i>.<br />
The last step took <i>~
. ( $time_to_jump - $INFO{'starttime'} ) . q~ seconds</i>.<br />
You are converting <i>~
. int( ( $INFO{'st'} + 60 ) / 60 ) . q~ minutes</i>.<br />
<br />
<div class="totals">There are <b>~
. ( $INFO{'totalpolls'} - $INFO{'pollfile'} )
. qq~/$INFO{'totalpolls'}</b> Polls left to be converted. &nbsp; </div>
<div class="divouter">
<div class="divvary" style="width: $pollwidth$px;">&nbsp;</div>
</div>
<div class="divvary2">$pollwidth %</div>
</div>
<br /><br />
<div class="totals">There are <b>~
. ( $INFO{'totalpolled'} - $INFO{'polledfile'} )
. qq~/$INFO{'totalpolled'}</b> Polled-Files left to be converted. &nbsp; </div>
<div class="divouter">
<div class="divvary" style="width: $polledwidth$px;">&nbsp;</div>
</div>
<div class="divvary2">$polledwidth %</div>
</div>
<br /><br />
<p id="memcontinued">If nothing happens in 5 seconds <a href="$set_cgi?action=dates;st=$INFO{'st'};timeconv=$INFO{'timeconv'};pollfile=$INFO{'pollfile'};totalpolls=$INFO{'totalpolls'};polledfile=$INFO{'polledfile'}" onclick="PleaseWait();">click here to continue</a>...<br />If you want to <a href="javascript:stoptick();">STOP 'Date &amp; Time' conversion click here</a>. Then copy the actual browser address and type it in when you are going to continue the conversion.</p>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function PleaseWait() {
document.getElementById("memcontinued").innerHTML = '<span style="color:red"><b>Converting - please wait!<br />If you want to stop \\'Date &amp; Time\\' conversion, click here on STOP before this red message appears again on next page.</b></span>';
}
function stoptick() { stop = 1; }
stop = 0;
function membtick() {
if (stop != 1) {
PleaseWait();
location.href="$set_cgi?action=dates;st=$INFO{'st'};timeconv=$INFO{'timeconv'};pollfile=$INFO{'pollfile'};totalpolls=$INFO{'totalpolls'};polledfile=$INFO{'polledfile'}";
}
}
setTimeout("membtick()",2000);
</script>
~;
}
elsif ( $action eq 'cleanup' ) {
require "$boardsdir/forum.master";
if ( !$INFO{'clean'} ) {
fopen( FORUMTOTALS, ">>$boardsdir/forum.totals" )
|| setup_fatal_error( "Can not open $boardsdir/forum.totals", 1 );
foreach my $testboard (@allboards) {
chomp $testboard;
if ( -e "$convboardsdir/$testboard.ttl" ) {
fopen( BOARDTTL, "$convboardsdir/$testboard.ttl" )
|| setup_fatal_error(
"Can not open $convboardsdir/$testboard.ttl", 1 );
my $line = <BOARDTTL>;
fclose(BOARDTTL);
chomp $line;
print {FORUMTOTALS} "$testboard|$line|\n"
or croak 'cannot print FORUMTOTALS';
#unlink "$convboardsdir/$testboard.ttl";
}
}
print {FORUMTOTALS} "recycle|0|0|N/A|N/A||||\n"
or croak 'cannot print FORUMTOTALS';
print {FORUMTOTALS} "announcements|0|0|N/A|N/A||||\n"
or croak 'cannot print FORUMTOTALS';
print {FORUMTOTALS} "general|1|1|1278201900|admin|1378046604|0|Welcome to your new YaBB 2\.5\.4 forum!|xx|0|\n"
or croak 'cannot print FORUMTOTALS';
fclose(FORUMTOTALS);
$yySetLocation =
qq~$set_cgi?action=cleanup2;st=~
. int( $INFO{'st'} + time() - $time_to_jump + $max_process_time )
. qq~;starttime=$time_to_jump;clean=1;pass_error=1;total_boards=~
. @allboards;
redirectexit();
}
if ( $INFO{'clean'} == 1 ) { MyReCountTotals(); }
if ( $INFO{'clean'} == 2 ) { MyMemberIndex(); }
if ( $INFO{'clean'} == 3 ) { MyMailNotify(); }
if ( $INFO{'clean'} == 4 ) { FixNopost(); }
if ( $INFO{'tmp_firstforum'} > $INFO{'firstforum'} ) {
$setforumstart = timeformat( $INFO{'tmp_firstforum'} );
$firstmember = timeformat( $INFO{'firstforum'} );
$forumstarttext =
qq~The Forum Start date was set to $setforumstart but the first member was registered $firstmember. So we changed the Forum Start Date to $firstmember.~;
}
$yytabmenu =
$NavLink1
. $NavLink2
. $NavLink3
. $NavLink4
. $NavLink5
. $NavLink7a
. $NavLink6a;
$formsession = cloak("$mbname$username");
if ( -e 'Convert/Members/admin.dat' ) {
$convtext .=
q~<br /><br />After you have tested your forum and made sure everything was converted correctly you can go to your Admin Center and delete /Convert/Boards, /Convert/Members, /Convert/Messages and /Convert/Variables folders and their contents.~;
}
if ( -e "$vardir/fixusers.txt" ) {
$convtext .=
qq~<br /><br />There were some illegal usernames. Their names were changed. Please inform them those users. You can find the list in the $vardir/fixusers.txt~;
}
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2">
<div class="convdone">Member Conversion.</div>
$ConvDone
<div class="convdone">Board and Category Conversion.</div>
$ConvDone
<div class="convdone">Message Conversion.</div>
$ConvDone
<div class="convdone">Date &amp; Time Conversion.</div>
$ConvDone
<div class="convdone">Final Cleanup.</div>
$ConvDone
</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2 fontbigger">
$forumstarttext
$convtext<br />
<br />
The conversion took <i>~
. int( ( $INFO{'st'} + 60 ) / 60 ) . qq~ minutes</i>.<br />
<br />
<br />
<span style="color:red">We recommend you delete the file "$ENV{'SCRIPT_NAME'}". This is to prevent someone else running the converter and damaging your files.<br />
<br />
Further more, we strongly recomend to run the following "Maintenance Controls" in the "Admin Center" before you start doing other things:<br />
- Rebuild Message Index<br />
- Recount Board Totals<br />
- Rebuild Members List<br />
- Recount Membership<br />
- Rebuild Members History<br />
- Rebuild Notifications Files<br />
- Clean Users Online Log<br />
- Attachment Functions => Rebuild Attachments<br /></span>
<br />
<br />
You may now log in to your forum or you can run the Extended Profiles converter by clicking on the button above. Enjoy using YaBB 2.5.4!
</td>
</tr><tr>
<td class="catbg center" colspan="2">
<form action="YaBB.$yyext" method="post" style="display: inline;">
<input type="submit" value="Start" />
<input type="hidden" name="formsession" value="$formsession" />
</form>
</td>
</tr>
</table>
</div>~;
# CreateConvLock();
}
elsif ( $action eq 'extended' ) {
ext_admin_convert();
$yytabmenu =
$NavLink1
. $NavLink2
. $NavLink3
. $NavLink4
. $NavLink5
. $NavLink7a
. $NavLink6a;
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2">
<div class="convdone">Member Conversion.</div>
$ConvDone
<div class="convdone">Board and Category Conversion.</div>
$ConvDone
<div class="convdone">Message Conversion.</div>
$ConvDone
<div class="convdone">Date &amp; Time Conversion.</div>
$ConvDone
<div class="convdone">Final Cleanup.</div>
$ConvDone
</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2 fontbigger">
The Extended Profiles conversion took <i>~
. int( ( $INFO{'st'} + 60 ) / 60 ) . qq~ minutes</i>.<br />
<br />
<br />
You may now login to your forum . Enjoy using YaBB 2.5.4!
</td>
</tr><tr>
<td class="catbg center" colspan="2">
<form action="YaBB.$yyext" method="post" style="display: inline;">
<input type="submit" value="Start" />
<input type="hidden" name="formsession" value="$formsession" />
</form>
</td>
</tr>
</table>
</div>~;
CreateConvLock();
}
elsif ( $action eq 'cleanup2' ) {
if ( ( !$INFO{'pass_error'} && $INFO{'my_re_tot'} <= 0 )
&& $INFO{'memb_index'} <= 0
&& $INFO{'my_mail_n'} <= 0
&& $INFO{'fix_nopost'} <= 1 )
{
setup_fatal_error(
"Clean Up (cleanup2) error! pass_error($INFO{'pass_error'}), my_re_tot($INFO{'my_re_tot'}), memb_index($INFO{'memb_index'}), my_mail_n($INFO{'my_mail_n'})",
1
);
}
my $re_tot_width =
( $INFO{'total_re_tot'} && $INFO{'my_re_tot'} )
? int( $INFO{'my_re_tot'} / $INFO{'total_re_tot'} * 100 )
: ( $INFO{'total_re_tot'} ? 100 : 0 );
$INFO{'my_re_tot'} =
$INFO{'my_re_tot'} ? $INFO{'my_re_tot'} : $INFO{'total_re_tot'};
my $memb_index_width =
( $INFO{'total_memb'} && $INFO{'memb_index'} )
? int( $INFO{'memb_index'} / $INFO{'total_memb'} * 100 )
: ( $INFO{'total_memb'} ? 100 : 0 );
$INFO{'memb_index'} =
$INFO{'memb_index'} ? $INFO{'memb_index'} : $INFO{'total_memb'};
my $mail_not_width =
( $INFO{'total_mail_n'} && $INFO{'my_mail_n'} )
? int( $INFO{'my_mail_n'} / $INFO{'total_mail_n'} * 100 )
: ( $INFO{'total_mail_n'} ? 100 : 0 );
$INFO{'my_mail_n'} =
$INFO{'my_mail_n'} ? $INFO{'my_mail_n'} : $INFO{'total_mail_n'};
my $nopost_width =
$INFO{'total_nopost'}
? int( $INFO{'fix_nopost'} / $INFO{'total_nopost'} * 100 )
: 0;
$yytabmenu =
$NavLink1 . $NavLink2 . $NavLink3 . $NavLink4 . $NavLink5 . $NavLink6;
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<col style="width:5%" />
<tr>
<td class="tabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/thread.gif" alt="" />
</td>
<td class="windowbg2">
<div class="convdone">Member Conversion.</div>
$ConvDone
<div class="convdone">Board &amp; Category Conversion.</div>
$ConvDone
<div class="convdone">Message Conversion.</div>
$ConvDone
<div class="convdone">Date &amp; Time Conversion.</div>
$ConvDone
<div class="convdone">Final Cleanup.</div>
<div class="divouter_center">
See info below!
</div>
<div class="divvary2">--- %</div>
</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2 fontbigger">
To prevent server time-out due to the amount to Clean Up, the Cleanup is split into more steps.<br />
<br />
The time-step (\$max_process_time) is set to <i>$max_process_time seconds</i>.<br />
The last step took <i>~
. ( $time_to_jump - $INFO{'starttime'} ) . q~ seconds</i>.<br />
You are converting <i>~
. int( ( $INFO{'st'} + 60 ) / 60 ) . qq~ minutes</i>.<br />
<br />
<div class="totals">There are <b>0/$INFO{'total_boards'}</b> Boards (1) left to be recounted. &nbsp; </div>
<div class="divouter">
<div class="divvary" style="width: 100px">&nbsp;</div>
</div>
<div class="divvary2">100 %</div>
</div>
<br /><br />
<div class="totals">There are <b>~
. ( $INFO{'total_re_tot'} - $INFO{'my_re_tot'} )
. qq~/$INFO{'total_re_tot'}</b> Boards (2) left to be recounted. &nbsp; </div>
<div class="divouter">
<div class="divvary" style="$re_tot_width$px">&nbsp;</div>
</div>
<div class="divvary2">$re_tot_width %</div>
</div>
<br /><br />
<div class="totals">There are <b>~
. ( $INFO{'total_memb'} - $INFO{'memb_index'} )
. qq~/$INFO{'total_memb'}</b> Members left to be recounted. &nbsp; </div>
<div class="divouter">
<div class="divvary" style="$mem_index_width$px">&nbsp;</div>
</div>
<div class="divvary2">$memb_index_width %</div>
</div>
<br /><br />
<div class="totals">There are <b>~
. ( $INFO{'total_mail_n'} - $INFO{'my_mail_n'} )
. qq~/$INFO{'total_mail_n'}</b> Notifications left to be written new. &nbsp; </div>
<div class="divouter">
<div class="divvary" style="$mail_not_width$px">&nbsp;</div>
</div>
<div class="divvary2">$mail_not_width %</div>
</div>
<br /><br />
<div class="totals">There are <b>~
. ( $INFO{'total_nopost'} - $INFO{'fix_nopost'} )
. qq~/$INFO{'total_nopost'}</b> NoPost-Membergroups left to be updated. &nbsp; </div>
<div class="divouter">
<div class="divvary" style="$nopost_width$px">&nbsp;</div>
</div>
<div class="divvary2">$nopost_width %</div>
</div>
<br /><br />
<p id="memcontinued">If nothing happens in 5 seconds <a href="$set_cgi?action=cleanup;st=$INFO{'st'};clean=$INFO{'clean'};total_boards=$INFO{'total_boards'};total_re_tot=$INFO{'total_re_tot'};my_re_tot=$INFO{'my_re_tot'};tmp_firstforum=$INFO{'tmp_firstforum'};firstforum=$INFO{'firstforum'};siglength=$INFO{'siglength'};total_memb=$INFO{'total_memb'};memb_index=$INFO{'memb_index'};total_mail_n=$INFO{'total_mail_n'};my_mail_n=$INFO{'my_mail_n'};total_nopost=$INFO{'total_nopost'};fix_nopost=$INFO{'fix_nopost'}" onclick="PleaseWait();">click here to continue</a>...<br />If you want to <a href="javascript:stoptick();">STOP 'Clean Up' conversion click here</a>. Then copy the actual browser address and type it in when you are going to continue the conversion.</p>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
function PleaseWait() {
document.getElementById("memcontinued").innerHTML = '<span style="color:red"><b>Converting - please wait!<br />If you want to stop \\'Clean Up\\', click here on STOP before this red message appears again on next page.</b></span>';
}
function stoptick() { stop = 1; }
stop = 0;
function membtick() {
if (stop != 1) {
PleaseWait();
location.href="$set_cgi?action=cleanup;st=$INFO{'st'};clean=$INFO{'clean'};total_boards=$INFO{'total_boards'};total_re_tot=$INFO{'total_re_tot'};my_re_tot=$INFO{'my_re_tot'};tmp_firstforum=$INFO{'tmp_firstforum'};firstforum=$INFO{'firstforum'};siglength=$INFO{'siglength'};total_memb=$INFO{'total_memb'};memb_index=$INFO{'memb_index'};total_mail_n=$INFO{'total_mail_n'};my_mail_n=$INFO{'my_mail_n'};total_nopost=$INFO{'total_nopost'};fix_nopost=$INFO{'fix_nopost'}";
}
}
setTimeout("membtick()",2000);
</script>
~;
}
$yyim = 'You are running the YaBB 2.5.4 Converter.';
$yytitle = 'YaBB 2.5.4 Converter';
SetupTemplate();
}
# Prepare Conversion ##
sub PrepareConv {
fopen( FILE, ">$boardsdir/dummy.testfile" ) || setup_fatal_error(
"The CHMOD of the $boardsdir is not set correctly! Cannot write this directory!",
1
);
print {FILE} "dummy testfile\n" or croak 'cannot print FILE';
fclose(FILE);
opendir( BDIR, $boardsdir ) || setup_fatal_error(
"The CHMOD of the $boardsdir is not set correctly! Cannot read this directory! ",
1
);
@boardlist = readdir BDIR;
closedir BDIR;
fopen( FILE, ">$memberdir/dummy.testfile" ) || setup_fatal_error(
"The CHMOD of the $memberdir is not set correctly! Cannot write this directory!",
1
);
print {FILE} "dummy testfile\n" or croak 'cannot print FILE';
fclose(FILE);
opendir( MBDIR, $memberdir ) || setup_fatal_error(
"The CHMOD of the $memberdir is not set correctly! Cannot read this directory! ",
1
);
@memblist = readdir MBDIR;
closedir MBDIR;
fopen( FILE, ">$datadir/dummy.testfile" ) || setup_fatal_error(
"The CHMOD of the $datadir is not set correctly! Cannot write this directory!",
1
);
print {FILE} "dummy testfile\n" or croak 'cannot print FILE';
fclose(FILE);
opendir( MSDIR, $datadir ) || setup_fatal_error(
"The CHMOD of the $datadir is not set correctly! Cannot read this directory! ",
1
);
@msglist = readdir MSDIR;
closedir MSDIR;
automaintenance('on');
unlink "$vardir/fixusers.txt";
foreach my $file (@boardlist) {
if ( $file ne '.htaccess'
&& $file ne 'index.html'
&& $file ne 'forum.control'
&& $file ne q{.}
&& $file ne q{..} )
{
unlink "$boardsdir/$file";
}
}
foreach my $file (@memblist) {
if ( $file ne '.htaccess'
&& $file ne 'index.html'
&& $file ne 'admin.vars'
&& $file ne q{.}
&& $file ne q{..} )
{
unlink "$memberdir/$file";
}
}
foreach my $file (@msglist) {
if ( $file ne '.htaccess'
&& $file ne 'index.html'
&& $file ne q{.}
&& $file ne q{..} )
{
unlink "$datadir/$file";
}
}
return;
}
# / Prepare Conversion ##
# Member Conversion ##
sub ConvertMembers1 {
fopen( MEMDIR, "$convmemberdir/memberlist.txt" )
|| setup_fatal_error( "$maintext_23 $convmemberdir/memberlist.txt: ", 1 );
my @memlist = <MEMDIR>;
fclose(MEMDIR);
for my $i ( ( $INFO{'mstart1'} || 0 ) .. ( @memlist - 1 ) ) {
$uname = $memlist[$i];
chomp $uname;
next if !-e "$convmemberdir/$uname.dat";
if ( $uname =~ /[^\w\+\-\.\@]|guest/ixsm ) {
IllegalUser($uname);
}
else {
MyUpdateUser($uname);
}
if ( time() > $time_to_jump && ( $i + 1 ) < @memlist ) {
$yySetLocation =
qq~$set_cgi?action=members2;st=~
. int( $INFO{'st'} + time() - $time_to_jump + $max_process_time )
. qq~;starttime=$time_to_jump;mtotal=~
. @memlist
. q~;mstart1=~
. ( $i + 1 );
redirectexit();
}
}
$INFO{'mstart1'} = @memlist;
if ( -e "$convvardir/MemberStats.txt" ) { groupconvert(); }
if ( -e "$vardir/fixusers.txt" ) {
fopen( FIXUSER, "$vardir/fixusers.txt" )
|| setup_fatal_error( "$maintext_23 $vardir/fixusers.txt: ", 1 );
my @fixed = <FIXUSER>;
fclose(FIXUSER);
foreach (@fixed) {
my ( $user, $fixedname, undef, $displayedname, undef ) =
split /\|/xsm, $_;
@{ $fixed_users{$user} } = ( $fixedname, $displayedname );
}
}
ConvertMembers2();
return;
}
sub IllegalUser {
my ($user) = @_;
my $fixeduser = $user;
$fixeduser =~ s/[^\w\+\-\.\@]|guest//gixsm;
if ( !$fixeduser ) { $fixeduser = 'fixeduser'; }
$fixeduser = check_existence( $memberdir, "$fixeduser.vars" );
$fixeduser =~ s/(\S+?)(\.\S+$)/$1/xsm;
fopen( LOADOLDUSER, "$convmemberdir/$user.dat" )
|| setup_fatal_error( "$maintext_23 $convmemberdir/$user.dat: ", 1 );
my @settings = <LOADOLDUSER>;
fclose(LOADOLDUSER);
chomp @settings;
my ( $pmignorelist, $pmnotify, $pmpopup, $pmspop );
if ( -e "$convmemberdir/$user.imconfig" ) {
fopen( PMUSER, "$convmemberdir/$user.imconfig" )
|| setup_fatal_error( "$maintext_23 $convmemberdir/$user.imconfig: ",
1 );
@pmconfics = <PMUSER>;
fclose(PMUSER);
chomp $pmconfics[0];
chomp $pmconfics[1];
chomp $pmconfics[3];
chomp $pmconfics[5];
$pmignorelist = $pmconfics[0];
$pmnotify = $pmconfics[1] ? 3 : 0;
$pmpopup = $pmconfics[3];
$pmspop = $pmconfics[5];
}
my ( $lastonline, $lastpost, $lastim );
if ( -e "$convmemberdir/$user.ll" ) {
fopen( LLFILE, "$convmemberdir/$user.ll" )
|| setup_fatal_error( "$maintext_23 $convmemberdir/$user.ll: ", 1 );
( $lastonline, $lastpost, $lastim ) = <LLFILE>;
fclose(LLFILE);
chomp $lastonline;
chomp $lastpost;
chomp $lastim;
$lastonline =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2})/&conv_stringtotime("$1 at $2")/eism;
$lastpost =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2})/&conv_stringtotime("$1 at $2")/eism;
$lastim =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2})/&conv_stringtotime("$1 at $2")/eism;
}
if ( -e "$convmemberdir/$user.yam" ) {
fopen( YAMFILE, "$convmemberdir/$user.yam" )
|| setup_fatal_error( "$maintext_23 $convmemberdir/$user.yam: ", 1 );
my @ipsettings = <YAMFILE>;
fclose(YAMFILE);
chomp $ipsettings[1];
( $c_ip_one, $c_ip_two, $c_ip_three ) = split /\|/xsm, $ipsettings[1];
if ( $c_ip_one eq '0' ) { $c_ip_one = q{}; }
if ( $c_ip_two eq '0' ) { $c_ip_two = q{}; }
if ( $c_ip_three eq '0' ) { $c_ip_three = q{}; }
}
$settings[14] = format_timestring( $settings[14] );
$regitime = "$settings[14]";
$regitime =~
s/(\d{2}\/\d{2}\/\d{2,4}).*?(\d{2}\:\d{2}\:\d{2})/&conv_stringtotime("$1 at $2")/eism;
if ($default_template) { $new_template = $default_template; }
else { $new_template = q~Forum default~; }
if ( $settings[1] eq q{} ) { $settings[1] = $user; }
if ( $settings[5] ) {
$settings[5] =~ s/&&/&amp;&amp;/gxsm;
$settings[5] =~ s/\"/&quot;/gxsm; #";
$settings[5] =~
s/\[size=([+-]?\d)\](.*?)\[\/size\]/ '\[size=' . conv_size($1) . "\]$2\[\/size\]" /igesm;
$settings[5] =~ s/<br>/<br \/>/igsm;
}
my @location = split /,|\|/xsm, $settings[15];
shift @location;
%{ $uid . $fixeduser } = (
'password' => "$settings[0]",
'realname' => "$settings[1]",
'email' => "$settings[2]",
'webtitle' => "$settings[3]",
'weburl' => (
( $settings[4] && $settings[4] !~ m{\Ahttps?://}sm )
? 'http://'
: q{}
)
. $settings[4],
'signature' => "$settings[5]",
'postcount' => "$settings[6]",
'position' => "$settings[7]",
'icq' => "$settings[8]",
'aim' => "$settings[9]",
'yim' => "$settings[10]",
'gender' => "$settings[11]",
'usertext' => "$settings[12]",
'userpic' => "$settings[13]",
'regdate' => "$settings[14]",
'regtime' => "$regitime",
'location' => join( ', ', grep { $_ } @location ),
'bday' => "$settings[16]",
'timeselect' => "$settings[17]",
'timeoffset' => "$timeoffset",
'hidemail' => ( $settings[19] ? 1 : 0 ),
'gtalk' => "$settings[32]",
'template' => "$new_template",
'language' => "$language",
'lastonline' => "$lastonline",
'lastpost' => "$lastpost",
'lastim' => "$lastim",
'im_ignorelist' => "$pmignorelist",
'notify_me' => "$pmnotify",
'im_popup' => ( $pmpopup ? 1 : 0 ),
'im_imspop' => ( $pmspop ? 1 : 0 ),
'cathide' => "$settings[30]",
'postlayout' => ( $settings[31] ? "$settings[31]|0" : q{} ),
'dsttimeoffset' => "$dstoffset",
'pageindex' => '1|1|1',
'lastips' => "$c_ip_one|$c_ip_two|$c_ip_three",
);
UserAccount( $fixeduser, 'update' );
fopen( FIXUSER, ">>$vardir/fixusers.txt" )
|| setup_fatal_error( "$maintext_23 $vardir/fixusers.txt: ", 1 );
print {FIXUSER} "$user|$fixeduser|$settings[14]|$settings[1]|$settings[2]\n"
or croak 'cannot print FIXUSER';
fclose(FIXUSER);
if ( $fixeduser ne $username ) { undef %{ $uid . $fixeduser }; }
return;
}
sub MyUpdateUser {
my ($user) = @_;
fopen( LOADOLDUSER, "$convmemberdir/$user.dat" )
|| setup_fatal_error( "$maintext_23 $convmemberdir/$user.dat: ", 1 );
my @settings = <LOADOLDUSER>;
fclose(LOADOLDUSER);
chomp @settings;
my ( $pmignorelist, $pmnotify, $pmpopup, $pmspop );
if ( -e "$convmemberdir/$user.imconfig" ) {
fopen( PMUSER, "$convmemberdir/$user.imconfig" )
|| setup_fatal_error( "$maintext_23 $convmemberdir/$user.imconfig: ",
1 );
@pmconfics = <PMUSER>;
fclose(PMUSER);
chomp $pmconfics[0];
chomp $pmconfics[1];
chomp $pmconfics[3];
chomp $pmconfics[5];
$pmignorelist = $pmconfics[0];
$pmnotify = $pmconfics[1] ? 3 : 0;
$pmpopup = $pmconfics[3];
$pmspop = $pmconfics[5];
}
my ( $lastonline, $lastpost, $lastim );
if ( -e "$convmemberdir/$user.ll" ) {
fopen( LLFILE, "$convmemberdir/$user.ll" )
|| setup_fatal_error( "$maintext_23 $convmemberdir/$user.ll: ", 1 );
( $lastonline, $lastpost, $lastim ) = <LLFILE>;
fclose(LLFILE);
chomp $lastonline;
chomp $lastpost;
chomp $lastim;
$lastonline =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2})/&conv_stringtotime("$1 at $2")/eism;
$lastpost =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2})/&conv_stringtotime("$1 at $2")/eism;
$lastim =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2})/&conv_stringtotime("$1 at $2")/eism;
}
if ( -e "$convmemberdir/$user.yam" ) {
fopen( YAMFILE, "$convmemberdir/$user.yam" )
|| setup_fatal_error( "$maintext_23 $convmemberdir/$user.yam: ", 1 );
my @ipsettings = <YAMFILE>;
fclose(YAMFILE);
chomp $ipsettings[1];
( $c_ip_one, $c_ip_two, $c_ip_three ) = split /\|/xsm, $ipsettings[1];
if ( $c_ip_one eq '0' ) { $c_ip_one = q{}; }
if ( $c_ip_two eq '0' ) { $c_ip_two = q{}; }
if ( $c_ip_three eq '0' ) { $c_ip_three = q{}; }
}
$settings[14] = format_timestring( $settings[14] );
$regitime = "$settings[14]";
$regitime =~
s/(\d{2}\/\d{2}\/\d{2,4}).*?(\d{2}\:\d{2}\:\d{2})/&conv_stringtotime("$1 at $2")/eism;
if ($default_template) { $new_template = $default_template; }
else { $new_template = q~Forum default~; }
if ( $settings[1] eq q{} ) { $settings[1] = $user; }
if ( $settings[5] ) {
$settings[5] =~ s/&&/&amp;&amp;/gxsm;
$settings[5] =~ s/\"/&quot;/gxsm; #";
$settings[5] =~
s/\[size=([+-]?\d)\](.*?)\[\/size\]/ '\[size=' . conv_size($1) . "\]$2\[\/size\]" /igesm;
$settings[5] =~ s/<br>/<br \/>/igxsm;
}
my @location = split /,|\|/xsm, $settings[15];
shift @location;
%{ $uid . $user } = (
'password' => "$settings[0]",
'realname' => "$settings[1]",
'email' => "$settings[2]",
'webtitle' => "$settings[3]",
'weburl' => (
( $settings[4] && $settings[4] !~ m{\Ahttps?://}sm )
? 'http://'
: q{}
)
. $settings[4],
'signature' => "$settings[5]",
'postcount' => "$settings[6]",
'position' => "$settings[7]",
'icq' => "$settings[8]",
'aim' => "$settings[9]",
'yim' => "$settings[10]",
'gender' => "$settings[11]",
'usertext' => "$settings[12]",
'userpic' => "$settings[13]",
'regdate' => "$settings[14]",
'regtime' => "$regitime",
'location' => join( ', ', grep { $_ } @location ),
'bday' => "$settings[16]",
'timeselect' => "$settings[17]",
'timeoffset' => "$timeoffset",
'hidemail' => ( $settings[19] ? 1 : 0 ),
'gtalk' => "$settings[32]",
'template' => "$new_template",
'language' => "$language",
'lastonline' => "$lastonline",
'lastpost' => "$lastpost",
'lastim' => "$lastim",
'im_ignorelist' => "$pmignorelist",
'notify_me' => "$pmnotify",
'im_popup' => ( $pmpopup ? 1 : 0 ),
'im_imspop' => ( $pmspop ? 1 : 0 ),
'cathide' => "$settings[30]",
'postlayout' => "$settings[31]|0",
'dsttimeoffset' => "$dstoffset",
'pageindex' => '1|1|1',
'lastips' => "$c_ip_one|$c_ip_two|$c_ip_three",
);
UserAccount( $user, 'update' );
if ( $user ne $username ) { undef %{ $uid . $user }; }
return;
}
sub groupconvert {
require "$convvardir/MemberStats.txt";
my $i = 0;
my $z = 1;
undef %Post;
$Post{'-1'} =
qq~$MemStatNewbie|$MemStarNumNewbie|$MemStarPicNewbie|$MemTypeColNewbie|0|0|0|0|0|0~;
while ( $MemStat[$i] ) {
if ( $MemPostNum[$i] eq 'x' ) {
$NoPost{$z} =
qq~$MemStat[$i]|$MemStarNum[$i]|$MemStarPic[$i]|$MemTypeCol[$i]|0|0|0|0|0|0~;
$z++;
}
else {
$Post{ $MemPostNum[$i] } =
qq~$MemStat[$i]|$MemStarNum[$i]|$MemStarPic[$i]|$MemTypeCol[$i]|0|0|0|0|0|0~;
}
$i++;
}
foreach my $key ( keys %Group ) {
$value = $Group{$key};
$value =~ s/'/&#39;/gxsm; #';
$Group{$key} = $value;
}
foreach my $key ( keys %NoPost ) {
$value = $NoPost{$key};
$value =~ s/'/&#39;/gxsm; #';
$NoPost{$key} = $value;
}
foreach my $key ( keys %Post ) {
$value = $Post{$key};
$value =~ s/'/&#39;/gxsm; #';
$Post{$key} = $value;
}
require Admin::NewSettings;
SaveSettingsTo('Settings.pm'); # save %Group, %NoPost and %Post
return;
}
sub ConvertMembers2 {
fopen( MEMDIR, "$convmemberdir/memberlist.txt" )
|| setup_fatal_error( "$maintext_23 $convmemberdir/memberlist.txt: ", 1 );
my @memlist = <MEMDIR>;
fclose(MEMDIR);
for my $i ( ( $INFO{'mstart2'} || 0 ) .. ( @memlist - 1 ) ) {
my $user = $memlist[$i];
chomp $user;
next if !-e "$convmemberdir/$user.dat";
my $newuser =
exists $fixed_users{$user} ? ${ $fixed_users{$user} }[0] : $user;
my @xtn = qw(msg ims imstore log outbox);
for my $cnt ( 0 .. ( @xtn - 1 ) ) {
if ( -e "$convmemberdir/$user.$xtn[$cnt]" ) {
fopen( FILEUSER, "$convmemberdir/$user.$xtn[$cnt]" )
|| setup_fatal_error(
"$maintext_23 $convmemberdir/$user.$xtn[$cnt]: ", 1 );
my @divfiles = <FILEUSER>;
fclose(FILEUSER);
if ( $cnt == 0 || $cnt == 2 || $cnt == 4 )
{ # msg || imstore || outbox
chomp @divfiles;
for my $i ( 0 .. ( @divfiles - 1 ) ) {
if ( $cnt == 2 ) { # imstore
my ( $name, $subject, $date, $message, $id, $ip,
$read_flag, $folder )
= split /\|/xsm, $divfiles[$i];
$name =
exists $fixed_users{$name}
? ${ $fixed_users{$name} }[0]
: $name;
$date =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2})/&conv_stringtotime("$1 at $2")/eism;
$message =~ s/<br>/<br \/>/igsm;
if ( $folder eq 'outbox' ) {
$folder = 'out';
if ( !$read_flag ) { $read_flag = 'u'; }
elsif ( $read_flag == 1 ) { $read_flag = 'r'; }
$divfiles[$i] =
"$id|$newuser|$name|||$subject|$date|$message|$id|0|$ip|s|$read_flag|$folder|\n";
}
elsif ( $folder eq 'inbox' ) {
$folder = 'in';
if ( $read_flag == 1 ) { $read_flag = 'u'; }
elsif ( $read_flag == 2 ) { $read_flag = 'r'; }
$divfiles[$i] =
"$id|$name|$newuser|||$subject|$date|$message|$id|0|$ip|s|$read_flag|$folder|\n";
}
}
else { # msg || outbox
my ( $name, $subject, $date, $message, $id, $ip,
$read_flag )
= split /\|/xsm, $divfiles[$i];
$name =
exists $fixed_users{$name}
? ${ $fixed_users{$name} }[0]
: $name;
$date =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2})/&conv_stringtotime("$1 at $2")/eism;
$message =~ s/<br>/<br \/>/igsm;
if ( $id < 101 || $id eq q{} ) { $id = $date; }
if ( $cnt == 0 ) { # msg
if ( $read_flag == 1 ) {
$read_flag = 'u';
} # u(nread)
elsif ( $read_flag == 2 ) {
$read_flag = 'r';
} # r(eplied)
$divfiles[$i] =
"$id|$name|$newuser|||$subject|$date|$message|$id|0|$ip|s|$read_flag||\n";
}
else { # outbox
if ( !$read_flag ) {
$read_flag = 'u';
} # u(rgent)
elsif ( $read_flag == 1 ) {
$read_flag = 's';
} # s(tandard)
$divfiles[$i] =
"$id|$newuser|$name|||$subject|$date|$message|$id|0|$ip|s|$read_flag||\n";
}
}
}
}
fopen( FILEUSER, ">$memberdir/$newuser.$xtn[$cnt]" )
|| setup_fatal_error(
"$maintext_23 $memberdir/$newuser.$xtn[$cnt]: ", 1 );
print {FILEUSER} @divfiles or croak 'cannot print FILEUSER';
fclose(FILEUSER);
}
}
if ( time() > $time_to_jump && ( $i + 1 ) < @memlist ) {
$yySetLocation =
qq~$set_cgi?action=members2;st=~
. int( $INFO{'st'} + time() - $time_to_jump + $max_process_time )
. qq~;starttime=$time_to_jump;mtotal=~
. @memlist
. qq~;mstart1=$INFO{'mstart1'};mstart2=~
. ( $i + 1 );
redirectexit();
}
}
return;
}
# / Member Conversion ##
# Board + Category Conversion ##
sub GetCats {
fopen( VDIR, "$convvardir/cat.txt" )
|| setup_fatal_error( "$maintext_23 $convvardir/cat.txt: ", 1 );
@categoryorder = <VDIR>;
fclose(VDIR);
chomp @categoryorder;
my @allboards;
foreach my $fcat (@categoryorder) {
fopen( VCAT, "$convboardsdir/$fcat.cat" )
|| setup_fatal_error( "$maintext_23 $convboardsdir/$fcat.cat: ", 1 );
@catdata = <VCAT>;
fclose(VCAT);
chomp @catdata;
$catinfo{$fcat} = qq~$catdata[0]|$catdata[1]|1~;
@catboards = ();
for my $cnt ( 2 .. ( @catdata - 1 ) ) {
if ( $catdata[$cnt] ) { push @catboards, $catdata[$cnt]; }
}
push @allboards, @catboards;
$cat{$fcat} = join q{,}, @catboards;
}
foreach my $fboard (@allboards) {
fopen( VBRD, "$convboardsdir/$fboard.dat" )
|| setup_fatal_error( "$maintext_23 $convboardsdir/$fboard.dat: ",
1 );
@bdata = <VBRD>;
fclose(VBRD);
chomp $bdata[0];
# get board access data
if ( -e "$convboardsdir/$fboard.mbo" ) {
require "$convboardsdir/$fboard.mbo";
}
$board{$fboard} =
qq~$bdata[0]|$view_groups{$fboard}|$showprivboards{$fboard}~;
}
# add trash if not exists
if ( !exists $cat{'staff'} ) {
push @categoryorder, 'staff';
$cat{'staff'} = 'announcements,recycle';
$catinfo{'staff'} = 'Forum Staff|Administrator, Global Moderator|0';
}
else {
my @temp;
foreach ( split /,/xsm, $cat{'staff'} ) {
if ( $_ ne 'recycle' && $_ ne 'announcements' ) { push @temp, $_; }
}
push @temp, 'recycle';
push @temp, 'announcements';
$cat{'staff'} = join q{,}, @temp;
}
if ( !exists $cat{'general'} ) {
push @categoryorder, 'general';
$cat{'general'} = 'general';
$catinfo{'general'} = 'General Category||0|';
}
else {
my @temp;
foreach ( split /,/xsm, $cat{'general'} ) {
if ( $_ ne 'general' ) { push @temp, $_; }
}
push @temp, 'general';
$cat{'general'} = join q{,}, @temp;
}
if ( !exists $board{'recycle'} ) { $board{'recycle'} = 'Recycle Bin||'; }
if ( !exists $board{'announcements'} ) {
$board{'announcements'} = 'Global Announcements||';
}
if ( !exists $board{'general'} ) { $board{'general'} = 'General Board||1'; }
@temparray = ();
while ( ( $key, $value ) = each %cat ) {
# Strip membergroups with a ~ from them
$value =~ s/~//gsm;
push @temparray, qq~\$cat{$key} = qq\~$value\~;\n~;
}
while ( ( $key, $value ) = each %catinfo ) {
# Strip membergroups with a ~ from them
$value =~ s/~//gxsm;
$value =~ s/,/, /gsm;
push @temparray, qq~\$catinfo{$key} = qq\~$value\~;\n~;
}
while ( ( $key, $value ) = each %board ) {
# Strip membergroups with a ~ from them
$value =~ s/~//gxsm;
$value =~ s/,/, /gsm;
push @temparray, qq~\$board{'$key'} = qq\~$value\~;\n~;
}
fopen( FILE, ">$boardsdir/forum.master" )
|| setup_fatal_error( "$maintext_23 $boardsdir/forum.master: ", 1 );
print {FILE} qq~\$mloaded = 1;\n~,
qq~\@categoryorder = qw(@categoryorder);\n~, @temparray, "\n1;"
or croak 'cannot print FILE';
fclose(FILE);
return;
}
sub CreateControl {
require "$boardsdir/forum.master";
foreach my $foundboard ( keys %board ) {
# get category
fopen( CINFO, "$convboardsdir/$foundboard.ctb" );
@category = <CINFO>;
fclose(CINFO);
chomp $category[0];
$cntcat = $category[0];
# get boardinfo
fopen( BINFO, "$convboardsdir/$foundboard.dat" );
@boardinfo = <BINFO>;
fclose(BINFO);
chomp @boardinfo;
$boardinfo[2] =~ s/^\||\|$//gxsm;
$boardinfo[2] =~ s/\|(\S?)/,$1/gxsm;
$cntmods = join q{,},
grep { exists $fixed_users{$_} ? ${ $fixed_users{$_} }[0] : $_; }
split /,/xsm, $boardinfo[2];
$cntpic = q{};
$cntdescription = $boardinfo[1];
# get board access data
if ( -e "$convboardsdir/$foundboard.mbo" ) {
require "$convboardsdir/$foundboard.mbo";
}
$cntstartperms = "$start_groups{$foundboard}";
$cntreplyperms = "$reply_groups{$foundboard}";
$cntpollperms = q{};
$cntstartperms =~ s/,/, /gsm;
$cntreplyperms =~ s/,/, /gsm;
$cntpollperms =~ s/,/, /gsm;
$cntpic = "$boardpic{$foundboard}";
$cntzero = q{};
$cntpassword = q{};
$cnttotals = q{};
$cntattperms = q{};
$spare = q{};
if ( $cntcat && $foundboard ) {
push @boardcontrol,
"$cntcat|$foundboard|$cntpic|$cntdescription|$cntmods|$cntmodgroups|$cntstartperms|$cntreplyperms|$cntpollperms|$cntzero|$cntpassword|$cnttotals|$cntattperms|$spare|||\n";
}
elsif ( !$cntcat && $foundboard eq 'general' )
{ # add general board if not exist
push @boardcontrol,
qq{general|general||This is the board for General Discussions.<br /><i>The board description can now hold multiple lines and can use HTML!</i>|admin|||||0||||1|||\n};
if ( !-e "$convboardsdir/general.txt" ) {
fopen( BOARDFILE, ">$convboardsdir/general.txt" )
|| setup_fatal_error(
"$maintext_23 $convboardsdir/general.txt: ", 1 );
print {BOARDFILE}
qq{1278201900|Welcome to your new YaBB 2.5.4 forum!|Administrator|webmaster\@yoursite.com|1378046604|0|admin|xx|0\n}
or croak 'cannot print BOARDFILE';
fclose(BOARDFILE);
}
}
elsif ( !$cntcat && $foundboard eq 'recycle' )
{ # add trash if not exists
push @boardcontrol,
qq{staff|recycle||If the Recycle Bin is turned on, removed topics will be moved to this board. This will allow you to recover them if it is necessary. You should purge messages in this board frequently to keep it clean.|admin|||||1|||1||||\n};
if ( !-e "$convboardsdir/recycle.txt" ) {
fopen( BOARDFILE, ">$convboardsdir/recycle.txt" )
|| setup_fatal_error(
"$maintext_23 $convboardsdir/recycle.txt: ", 1 );
print {BOARDFILE} q{} or croak 'cannot print BOARDFILE';
fclose(BOARDFILE);
}
}
elsif ( !$cntcat && $foundboard eq 'announcements' ) {
push @boardcontrol,
qq{staff|announcements||Topics you place in this board will display as a "Global Announcement" on the top of all other boards. Use this for things such as forum rules, top news articles, or important statements.|admin||Administrator|||0||1|||||\n};
if ( !-e "$convboardsdir/announcements.txt" ) {
fopen( BOARDFILE, ">$convboardsdir/announcements.txt" )
|| setup_fatal_error(
"$maintext_23 $convboardsdir/announcements.txt: ", 1 );
print {BOARDFILE} q{} or croak 'cannot print BOARDFILE';
fclose(BOARDFILE);
}
}
}
fopen( CONTROL, ">$boardsdir/forum.control" )
|| setup_fatal_error( "$maintext_23 $boardsdir/forum.control: ", 1 );
@boardcontrol = sort @boardcontrol;
print {CONTROL} @boardcontrol or croak 'cannot print CONTROL';
fclose(CONTROL);
return;
}
sub ConvertBoards {
require "$boardsdir/forum.master";
my %stickies;
if ( open $DATADIR, '<', "$convboardsdir/sticky.stk" ) {
my @stickies = <$DATADIR>;
close $DATADIR or croak 'cannot close stickies file';
chomp @stickies;
foreach (@stickies) { $stickies{$_} = 1; }
}
@boards = sort keys %board;
for my $i ( ( $INFO{'bstart'} || 0 ) .. ( @boards - 1 ) ) {
fopen( BOARDFILE, "$convboardsdir/$boards[$i].txt" )
|| setup_fatal_error( "$maintext_23 $convboardsdir/$boards[$i].txt: ",
1 );
@boardfile = <BOARDFILE>;
fclose(BOARDFILE);
@temparray = ();
for my $j ( ( $INFO{'bfstart'} || 0 ) .. ( @boardfile - 1 ) ) {
my $line = $boardfile[$j];
chomp $line;
my (
$mnum, $msub, $mname, $memail, $mdate,
$mreplies, $musername, $micon, $mstate
) = split /\|/xsm, $line;
next
if (!-e "$convdatadir/$mnum.txt"
|| -s "$convdatadir/$mnum.txt" < 35 );
$mname =
exists $fixed_users{$mname}
? ${ $fixed_users{$mname} }[1]
: $mname;
$musername =
exists $fixed_users{$musername}
? ${ $fixed_users{$musername} }[0]
: $musername;
$mdate =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2})/&conv_stringtotime("$1 at $2")/eism;
$mstate =~ s/1/l/xsm;
if ( exists $stickies{$mnum} ) { $mstate .= 's'; }
push @temparray,
"$mnum|$msub|$mname|$memail|$mdate|$mreplies|$musername|$micon|$mstate\n";
if ( time() > $time_to_jump && ( $j + 1 ) < @boardfile ) {
fopen( BOARDFILE, ">>$boardsdir/$boards[$i].txt" )
|| setup_fatal_error(
"$maintext_23 $boardsdir/$boards[$i].txt: ", 1 );
print {BOARDFILE} @temparray or croak 'cannot print BOARDFILE';
fclose(BOARDFILE);
$yySetLocation =
qq~$set_cgi?action=cats2;st=~
. int( $INFO{'st'} +
time() -
( $time_to_jump - $max_process_time ) )
. qq~;starttime=$time_to_jump;bfstart=~
. ( $j + 1 )
. qq~;bstart=$i;btotal=~
. @boards;
redirectexit();
}
}
fopen( BOARDFILE, ">>$boardsdir/$boards[$i].txt" )
|| setup_fatal_error( "$maintext_23 $boardsdir/$boards[$i].txt: ",
1 );
print {BOARDFILE} @temparray or croak 'cannot print BOARDFILE';
fclose(BOARDFILE);
if ( time() > $time_to_jump && ( $i + 1 ) < @boards ) {
$yySetLocation =
qq~$set_cgi?action=cats2;st=~
. int( $INFO{'st'} + time() - $time_to_jump + $max_process_time )
. qq~;starttime=$time_to_jump;mtotal=~
. @memlist
. q~;bfstart=0;bstart=~
. ( $i + 1 );
redirectexit();
}
$INFO{'bfstart'} = 0;
}
return;
}
# / Board + Category Conversion ##
# Message Conversion ##
sub ConvertMessages {
require "$boardsdir/forum.master";
${ $uid . $username }{'timeformat'} =
'SDT, DD MM YYYY HH:mm:ss zzz'; # the .ctb time format
${ $uid . $username }{'timeselect'} = 7;
my $ctbtime = timeformat( $date, 1, 'rfc' );
my %stickies;
if ( open $DATADIR, '<', "$convboardsdir/sticky.stk" ) {
my @stickies = <$DATADIR>;
close $DATADIR or croak 'cannot close sticky.stk';
chomp @stickies;
foreach (@stickies) { $stickies{$_} = 1; }
}
my @boards = sort keys %board;
my $totalbdr = @boards;
for my $next_board ( ( $INFO{'count'} || 0 ) .. ( $totalbdr - 1 ) ) {
my $boardname = $boards[$next_board];
fopen( BRDFILE, "$boardsdir/$boardname.txt" )
|| setup_fatal_error( "$maintext_23 $boardsdir/$boardname.txt: ", 1 );
my @brdmessageline = <BRDFILE>;
fclose(BRDFILE);
my %newreply = ();
my $totalmess = @brdmessageline;
for my $tops ( ( $INFO{'tcount'} || 0 ) .. ( $totalmess - 1 ) ) {
( $thread, undef, undef, undef, undef, $replies, undef ) =
split /\|/xsm, $brdmessageline[$tops], 7;
fopen( MSGFILE, "$convdatadir/$thread.txt" )
|| setup_fatal_error( "$maintext_23 $convdatadir/$thread.txt: ",
1 );
@messagelines = <MSGFILE>;
fclose(MSGFILE);
chomp @messagelines;
$INFO{'total_mess'} += @messagelines;
$INFO{'total_threads'}++;
@temparray = ();
foreach my $msgline (@messagelines) {
my (
$subject, $name, $email, $mdate,
$musername, $icon, $dummy, $user_ip,
$message, $ns, $editdate, $editby,
undef, $attachment
) = split /\|/xsm, $msgline;
$name =
exists $fixed_users{$name}
? ${ $fixed_users{$name} }[1]
: $name;
$musername =
exists $fixed_users{$musername}
? ${ $fixed_users{$musername} }[0]
: $musername;
$editby =
exists $fixed_users{$editby}
? ${ $fixed_users{$editby} }[0]
: $editby;
if ( $message =~ /\[[qgs]/ixsm )
{ # too many RegExpr take too much time!!!
$message =~
s/\[quote(\s+author=(.*?)\s+link=(.*?)\s+date=(.*?)\s*)?\](.*?)\[\/quote\]/QuoteFix($2,$3,$4,$5)/eigsm;
$message =~
s/\[(glow|shadow)=.*?\](.*?)\[\/(glow|shadow)\]/\[glb\]$2\[\/glb\]/igsm;
$message =~
s/\[size=([+-]?\d)\](.*?)\[\/size\]/ '\[size=' . conv_size($1) . "\]$2\[\/size\]" /igesm;
}
$message =~ s/<br>/<br \/>/igsm;
$mdate =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2}).*/&conv_stringtotime("$1 at $2")/eism;
$editdate =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2}).*/&conv_stringtotime("$1 at $2")/eism;
push @temparray,
"$subject|$name|$email|$mdate|$musername|$icon|$dummy|$user_ip|$message|$ns|$editdate|$editby|$attachment\n";
if ( $musername ne 'Guest' ) {
${ $uid . $thread }{$musername}++;
${ $uid . $thread . 'time' }{$musername} = $mdate;
}
}
fopen( MSGFILE, ">$datadir/$thread.txt" )
|| setup_fatal_error( "$maintext_23 $datadir/$thread.txt: ", 1 );
print {MSGFILE} @temparray
or croak "cannot print $datadir/$thread.txt";
fclose(MSGFILE);
# do the .ctb
my $views = 1;
if ( -e "$convdatadir/$thread.data" ) {
fopen( DATA, "$convdatadir/$thread.data" )
|| setup_fatal_error(
"$maintext_23 $convdatadir/$thread.data: ", 1 );
$data = <DATA>;
fclose(DATA);
chomp $data;
( $views, undef ) = split /\|/xsm, $data, 2;
}
my $trstate = exists $stickies{$thread} ? 's' : q{};
$lastposter = $musername eq 'Guest' ? "Guest-$name" : $musername;
fopen( CTB, ">$datadir/$thread.ctb" )
|| setup_fatal_error( "$maintext_23 $datadir/$thread.ctb: ", 1 );
print {CTB}
qq~### ThreadID: $thread, LastModified: $ctbtime ###\n\n'board',"$boardname"\n'replies',"$#messagelines"\n'views',"$views"\n'lastposter',"$lastposter"\n'lastpostdate',"$mdate"\n'threadstatus',"$trstate"\n'repliers',""\n~
or croak "cannot print $datadir/$thread.ctb";
fclose(CTB);
if ( $replies != $#messagelines ) {
$newreply{$tops} = $#messagelines;
}
if ( time() > $time_to_jump && ( $tops + 1 ) < $totalmess ) {
writerecentlog( ( $INFO{'tcount'} || 0 ),
$totalmess, \@brdmessageline );
if (%newreply) { # fix reply display
foreach ( keys %newreply ) {
my @temp = split /\|/xsm, $brdmessageline[$_];
$temp[5] = $newreply{$_};
$brdmessageline[$_] = join q{|}, @temp;
}
fopen( BOARDFILE, ">$boardsdir/$boardname.txt" )
|| setup_fatal_error(
"$maintext_23 $boardsdir/$boardname.txt: ", 1 );
print {BOARDFILE} @brdmessageline
or croak "cannot print $boardsdir/$boardname.txt";
fclose(BOARDFILE);
}
$yySetLocation =
qq~$set_cgi?action=messages2;st=~
. int( $INFO{'st'} +
time() -
( $time_to_jump - $max_process_time ) )
. qq~;starttime=$time_to_jump;count=$next_board;tcount=~
. ( $tops + 1 )
. qq~;total_mess=$INFO{'total_mess'};total_threads=$INFO{'total_threads'};totboard=$totalbdr;totmess=$totalmess~;
redirectexit();
}
}
writerecentlog( ( $INFO{'tcount'} || 0 ), $totalmess,
\@brdmessageline );
if (%newreply) { # fix reply display
foreach ( keys %newreply ) {
my @temp = split /\|/xsm, $brdmessageline[$_];
$temp[5] = $newreply{$_};
$brdmessageline[$_] = join q{|}, @temp;
}
fopen( BOARDFILE, ">$boardsdir/$boardname.txt" )
|| setup_fatal_error( "$maintext_23 $boardsdir/$boardname.txt: ",
1 );
print {BOARDFILE} @brdmessageline
or croak "cannot print $boardsdir/$boardname.txt";
fclose(BOARDFILE);
}
if ( time() > $time_to_jump && ( $next_board + 1 ) < $totalbdr ) {
$yySetLocation =
qq~$set_cgi?action=messages2;st=~
. int(
$INFO{'st'} + time() - ( $time_to_jump - $max_process_time ) )
. qq~;starttime=$time_to_jump;count=~
. ( $next_board + 1 )
. qq~;tcount=0;total_mess=$INFO{'total_mess'};total_threads=$INFO{'total_threads'};totboard=$totalbdr;totmess=0~;
redirectexit();
}
$INFO{'tcount'} = 0;
}
return;
}
sub QuoteFix {
my ( $qauthor, $qlink, $qdate, $qmessage ) = @_;
if ( $qauthor eq q{} || $qlink eq q{} || $qdate eq q{} ) {
$quote = "\[quote\]$qmessage\[/quote\]";
}
else {
$qdate = conv_stringtotime($qdate);
( undef, $threadlink, $start ) = split /;/xsm, $qlink;
( undef, $num ) = split /=/xsm, $threadlink;
( undef, $start ) = split /=/xsm, $start;
$quote =
"\[quote author=$qauthor link=$num/$start date=$qdate\]$qmessage\[/quote\]";
}
return $quote;
}
sub conv_size {
my $size = shift;
if ( $size eq '1' || $size eq '-2' ) { $size = 10; }
elsif ( $size eq '2' || $size eq '-1' ) { $size = 13; }
elsif ( $size eq '3' ) { $size = 16; }
elsif ( $size eq '4' || $size eq '+1' ) { $size = 18; }
elsif ( $size eq '5' || $size eq '+2' ) { $size = 24; }
elsif ( $size eq '6' || $size eq '+3' ) { $size = 32; }
elsif ( $size eq '7' || $size eq '+4' ) { $size = 48; }
return $size;
}
sub writerecentlog {
my ( $start, $total, $messageref ) = @_;
for my $t ( $start .. ( $total - 1 ) ) {
( $thread, undef ) = split /\|/xsm, ${$messageref}[$t], 2;
foreach my $user ( keys %{ $uid . $thread } ) {
fopen( RLOG, ">>$memberdir/$user.rlog" )
|| setup_fatal_error( "$maintext_23 $memberdir/$user.rlog: ", 1 );
print {RLOG}
"$thread\t${$uid.$thread}{$user},${$uid.$thread.'time'}{$user}\n"
or croak "cannot print $memberdir/$user.rlog";
fclose(RLOG);
}
undef %{ $uid . $thread };
undef %{ $uid . $thread . 'time' };
}
return;
}
# / Message Conversion ##
# Date Conversion ##
sub ConvertTimeToString {
if ( $INFO{'timeconv'} < 1 ) {
opendir( DATADIR, $convdatadir )
|| setup_fatal_error( "Directory: $convdatadir: ", 1 );
my @polls = sort grep { /\.poll$/xsm } readdir DATADIR;
closedir DATADIR;
my $totalpolls = @polls;
for my $i ( ( $INFO{'pollfile'} || 0 ) .. ( $totalpolls - 1 ) ) {
$file = $polls[$i];
fopen( POLLFILE, "$convdatadir/$file" )
|| setup_fatal_error( "$maintext_23 $convdatadir/$file: ", 1 );
@pollsfile = <POLLFILE>;
fclose(POLLFILE);
chomp $pollsfile[0];
my (
$dummy1, $dummy2, $polluname, $dummy4,
$dummy5, $pdate, $dummy6, $dummy7,
$dummy8, $epdate, $dummy10, $dummy11
) = split /\|/xsm, shift @pollsfile;
$polluname =
exists $fixed_users{$polluname}
? ${ $fixed_users{$polluname} }[0]
: $polluname;
$pdate =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2})/&conv_stringtotime("$1 at $2")/eism;
$epdate =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2}).*/&conv_stringtotime("$1 at $2")/eism;
fopen( POLLFILE, ">$datadir/$file" )
|| setup_fatal_error( "$maintext_23 $datadir/$file: ", 1 );
print {POLLFILE}
"$dummy1|$dummy2|$polluname|$dummy4|$dummy5|$pdate|$dummy6|$dummy7|$dummy8|$epdate|$dummy10|$dummy11\n",
@pollsfile
or croak "cannot print $datadir/$file";
fclose(POLLFILE);
if ( time() > $time_to_jump && ( $i + 1 ) < $totalpolls ) {
$yySetLocation =
qq~$set_cgi?action=dates2;st=~
. int(
$INFO{'st'} + time() - $time_to_jump + $max_process_time )
. qq~;starttime=$time_to_jump;timeconv=0;totalpolls=$totalpolls;pollfile=~
. ( $i + 1 );
redirectexit();
}
}
$INFO{'totalpolls'} = $totalpolls;
}
if ( $INFO{'timeconv'} < 2 ) {
opendir( DATADIR, $convdatadir )
|| setup_fatal_error( "Directory: $convdatadir: ", 1 );
my @polled = sort grep { /\.polled$/xsm } readdir DATADIR;
closedir DATADIR;
my $totalpolled = @polled;
for my $i ( ( $INFO{'polledfile'} || 0 ) .. ( $totalpolled - 1 ) ) {
$file = $polled[$i];
fopen( POLLEDFILE, "$convdatadir/$file" )
|| setup_fatal_error( "$maintext_23 $convdatadir/$file: ", 1 );
@polledfile = <POLLEDFILE>;
fclose(POLLEDFILE);
chomp @polledfile;
@temparray = ();
foreach my $line (@polledfile) {
my ( $dummy1, $pollername, $dummy3, $pdate ) =
split /\|/xsm, $line;
$pollername =
exists $fixed_users{$pollername}
? ${ $fixed_users{$pollername} }[0]
: $pollername;
$pdate =~
s/(\d{1,2}\/\d{1,2}\/\d{2,4}).*?(\d{1,2}\:\d{1,2}\:\d{1,2})/&conv_stringtotime("$1 at $2")/eism;
push @temparray, "$dummy1|$pollername|$dummy3|$pdate\n";
}
fopen( POLLEDFILE, ">$datadir/$file" )
|| setup_fatal_error( "$maintext_23 $datadir/$file: ", 1 );
print {POLLEDFILE} @temparray
or croak "cannot print $datadir/$file";
fclose(POLLEDFILE);
if ( time() > $time_to_jump && ( $i + 1 ) < $totalpolled ) {
$yySetLocation =
qq~$set_cgi?action=dates2;st=~
. int(
$INFO{'st'} + time() - $time_to_jump + $max_process_time )
. qq~;starttime=$time_to_jump;timeconv=1;totalpolls=$INFO{'totalpolls'};totalpolled=$totalpolled;polledfile=~
. ( $i + 1 );
redirectexit();
}
}
}
return;
}
# / Date Conversion ##
# Cleanup ##
sub MyReCountTotals {
@boards = sort keys %board;
my $totalboards = @boards;
for my $j ( ( $INFO{'my_re_tot'} || 0 ) .. ( $totalboards - 1 ) ) {
my $cntboard = $boards[$j];
next if !$cntboard;
fopen( BOARD, "$boardsdir/$cntboard.txt" )
|| setup_fatal_error( "$maintext_23 $boardsdir/$cntboard.txt: ", 1 );
my @threads = <BOARD>;
fclose(BOARD);
my $threadcount = @threads;
my $messagecount = $threadcount;
if ($threadcount) {
for my $i ( 0 .. ( @threads - 1 ) ) {
$messagecount += ( split /\|/xsm, $threads[$i] )[5];
}
}
BoardTotals( 'load', $cntboard );
${ $uid . $cntboard }{'threadcount'} = $threadcount;
${ $uid . $cntboard }{'messagecount'} = $messagecount;
# &BoardTotals("update", ...) is done in &BoardSetLastInfo
BoardSetLastInfo( $cntboard, \@threads );
if ( time() > $time_to_jump && ( $j + 1 ) < $totalboards ) {
$yySetLocation =
qq~$set_cgi?action=cleanup2;st=~
. int( $INFO{'st'} + time() - $time_to_jump + $max_process_time )
. qq~;starttime=$time_to_jump;clean=1;total_boards=$INFO{'total_boards'};total_re_tot=$totalboards;my_re_tot=~
. ( $j + 1 );
redirectexit();
}
}
$INFO{'total_re_tot'} = $totalboards;
$INFO{'clean'} = 2;
return;
}
sub MyMemberIndex {
if ( $INFO{'memb_index'} > 0 ) {
ManageMemberlist('load');
ManageMemberinfo('load');
$siglength = $INFO{'siglength'};
}
else {
$INFO{'tmp_firstforum'} = $INFO{'firstforum'} =
conv_stringtotime($forumstart);
$siglength = 200;
}
opendir( MEMBERS, $memberdir )
|| setup_fatal_error( "Directory: $memberdir: ", 1 );
@members = sort grep { /.\.vars$/xsm } readdir MEMBERS;
closedir MEMBERS;
$totalmemb = @members;
for my $j ( ( $INFO{'memb_index'} || 0 ) .. ( $totalmemb - 1 ) ) {
$member = $members[$j];
$member =~ s/\.vars$//gxsm;
LoadUser($member);
Recent_Load($member);
${ $uid . $member }{'postcount'} = 0;
foreach ( keys %recent ) {
${ $uid . $member }{'postcount'} += ${ $recent{$_} }[0];
}
if ( $INFO{'firstforum'} > ${ $uid . $member }{'regtime'} ) {
$INFO{'firstforum'} = ${ $uid . $member }{'regtime'};
}
if ( length( ${ $uid . $member }{'signature'} ) > $siglength ) {
$siglength = length( ${ $uid . $member }{'signature'} );
}
if ( ${ $uid . $member }{'position'} ) {
foreach my $key ( keys %NoPost ) {
( $NoPostname, undef ) = split /\|/xsm, $NoPost{$key}, 2;
if ( ${ $uid . $member }{'position'} eq $NoPostname ) {
${ $uid . $member }{'position'} = $key;
last;
}
}
}
if ( !${ $uid . $member }{'position'} ) {
${ $uid . $member }{'position'} =
MyMemberPostGroup( ${ $uid . $member }{'postcount'} );
}
if ( ${ $uid . $member }{'addgroups'} ) {
my $newaddigrp = q{};
foreach
my $addigrp ( split /, ?/sm, ${ $uid . $member }{'addgroups'} )
{
foreach my $key ( keys %NoPost ) {
( $NoPostname, undef ) = split /\|/xsm, $NoPost{$key}, 2;
if ( $addigrp eq $NoPostname ) { $addigrp = $key; last; }
}
$newaddigrp .= qq~$addigrp,~;
}
$newaddigrp =~ s/,$//xsm;
${ $uid . $member }{'addgroups'} = $newaddigrp;
}
UserAccount( $member, 'update' );
$memberlist{$member} = sprintf '%010d', ${ $uid . $member }{'regtime'};
$memberinf{$member} =
qq~${$uid.$member}{'realname'}|${$uid.$member}{'email'}|${$uid.$member}{'position'}|${$uid.$member}{'postcount'}~;
if ( time() > $time_to_jump && ( $j + 1 ) < $totalmemb ) {
ManageMemberlist('save');
ManageMemberinfo('save');
$yySetLocation =
qq~$set_cgi?action=cleanup2;st=~
. int( $INFO{'st'} + time() - $time_to_jump + $max_process_time )
. qq~;starttime=$time_to_jump;clean=2;total_boards=$INFO{'total_boards'};total_re_tot=$INFO{'total_re_tot'};tmp_firstforum=$INFO{'tmp_firstforum'};firstforum=$INFO{'firstforum'};siglength=$siglength;total_memb=$totalmemb;memb_index=~
. ( $j + 1 );
redirectexit();
}
}
ManageMemberlist('save');
ManageMemberinfo('save');
$INFO{'total_memb'} = $totalmemb;
$INFO{'clean'} = 3;
fopen( MEMBERLISTREAD, "$memberdir/memberlist.txt" )
|| setup_fatal_error( "$maintext_23 $memberdir/memberlist.txt: ", 1 );
my @num = <MEMBERLISTREAD>;
fclose(MEMBERLISTREAD);
my $membertotal = @num;
( $latestmember, undef ) = split /\t/xsm, $num[-1], 2;
fopen( MEMTTL, ">$memberdir/members.ttl" )
|| setup_fatal_error( "$maintext_23 $memberdir/members.ttl: ", 1 );
print {MEMTTL} qq~$membertotal|$latestmember~
or croak "cannot print $memberdir/members.ttl";
fclose(MEMTTL);
if ( $INFO{'tmp_firstforum'} > $INFO{'firstforum'} || $siglength > 200 ) {
SetInstall2();
}
return;
}
sub MyMemberPostGroup {
my ($userpostcnt) = @_;
$grtitle = q{};
foreach my $postamount ( reverse sort { $a <=> $b } keys %Post ) {
if ( $userpostcnt >= $postamount ) {
( $grtitle, undef ) = split /\|/xsm, $Post{$postamount}, 2;
last;
}
}
return $grtitle;
}
sub MyMailNotify {
require Sources::Notify;
ManageMemberinfo('load');
opendir( DIRECTORY, $convdatadir )
|| setup_fatal_error( "Directory: $convdatadir: ", 1 );
my @files = sort grep { /\.mail$/xsm } readdir DIRECTORY;
closedir DIRECTORY;
my $totalfiles = @files;
for my $j ( ( $INFO{'my_mail_n'} || 0 ) .. ( $totalfiles - 1 ) ) {
my $filename = ( split /\./xsm, $files[$j], 2 )[0];
fopen( MAILFILE, "$convdatadir/$filename.mail" )
|| setup_fatal_error( "$maintext_23 $convdatadir/$filename.mail: ",
1 );
my @mailaddresses = <MAILFILE>;
fclose(MAILFILE);
chomp @mailaddresses;
foreach my $mailaddress (@mailaddresses) {
while ( ( $curuser, $value ) = each %memberinf ) {
if ( $mailaddress eq ( split /\|/xsm, $value, 3 )[1] ) {
ManageThreadNotify( 'add', $filename, $curuser, $language,
1, 1 );
if ( $curuser ne $username ) { undef %{ $uid . $curuser }; }
last;
}
}
}
if ( time() > $time_to_jump && ( $j + 1 ) < $totalfiles ) {
$yySetLocation =
qq~$set_cgi?action=cleanup2;st=~
. int( $INFO{'st'} + time() - $time_to_jump + $max_process_time )
. qq~;starttime=$time_to_jump;clean=3;total_boards=$INFO{'total_boards'};total_re_tot=$INFO{'total_re_tot'};total_memb=$INFO{'total_memb'};tmp_firstforum=$INFO{'tmp_firstforum'};firstforum=$INFO{'firstforum'};total_mail_n=$totalfiles;my_mail_n=~
. ( $j + 1 );
redirectexit();
}
}
$INFO{'total_mail_n'} = $totalfiles;
$INFO{'clean'} = 4;
return;
}
sub FixNopost {
if ( $NoPost{'1'} ) {
fopen( FORUMCONTROL, "$boardsdir/forum.control" )
|| setup_fatal_error( "$maintext_23 $boardsdir/forum.control: ", 1 );
@boardcontrols = <FORUMCONTROL>;
fclose(FORUMCONTROL);
chomp @boardcontrols;
my $totalnoposts = keys %NoPost;
for my $i ( ( $INFO{'fix_nopost'} || 1 ) .. ( $totalnoposts - 1 ) ) {
( $grptitle, undef ) = split /\|/xsm, $NoPost{$i}, 2;
foreach my $key ( keys %catinfo ) {
( $catname, $catperms, $catcol ) =
split /\|/xsm, $catinfo{$key}, 3;
$newperm = q{};
foreach my $theperm ( split /, /sm, $catperms ) {
if ( $theperm eq $grptitle ) { $theperm = $i; }
$newperm .= qq~$theperm, ~;
}
$newperm =~ s/, $//sm;
$catinfo{$key} = qq~$catname|$newperm|$catcol~;
}
foreach my $key ( keys %board ) {
( $boardname, $boardperms, $boardshow ) =
split /\|/xsm, $board{$key}, 3;
$newperm = q{};
foreach my $theperm ( split /, /sm, $boardperms ) {
if ( $theperm eq $grptitle ) { $theperm = $i; }
$newperm .= qq~$theperm, ~;
}
$newperm =~ s/, $//sm;
$board{$key} = qq~$boardname|$newperm|$boardshow~;
}
for my $j ( 0 .. ( @boardcontrols - 1 ) ) {
(
$cntcat, $cntboard, $cntpic,
$cntdescription, $cntmods, $cntmodgroups,
$cnttopicperms, $cntreplyperms, $cntpollperms,
$cntzero, $cntmembergroups, $cntann,
$cntrbin, $cntattperms, $cntminageperms,
$cntmaxageperms, $cntgenderperms
) = split /\|/xsm, $boardcontrols[$j];
$newmodgroups = q{};
foreach my $theperm ( split /, /sm, $cntmodgroups ) {
if ( $theperm eq $grptitle ) { $theperm = $i; }
$newmodgroups .= qq~$theperm, ~;
}
$newmodgroups =~ s/, $//sm;
$newtopicperms = q{};
foreach my $theperm ( split /, /sm, $cnttopicperms ) {
if ( $theperm eq $grptitle ) { $theperm = $i; }
$newtopicperms .= qq~$theperm, ~;
}
$newtopicperms =~ s/, $//sm;
$newreplyperms = q{};
foreach my $theperm ( split /, /sm, $cntreplyperms ) {
if ( $theperm eq $grptitle ) { $theperm = $i; }
$newreplyperms .= qq~$theperm, ~;
}
$newreplyperms =~ s/, $//sm;
$newpollperms = q{};
foreach my $theperm ( split /, /sm, $cntpollperms ) {
if ( $theperm eq $grptitle ) { $theperm = $i; }
$newpollperms .= qq~$theperm, ~;
}
$newpollperms =~ s/, $//sm;
$boardcontrols[$j] =
qq~$cntcat|$cntboard|$cntpic|$cntdescription|$cntmods|$newmodgroups|$newtopicperms|$newreplyperms|$newpollperms|$cntzero|$cntmembergroups|$cntann|$cntrbin|$cntattperms|$cntminageperms|$cntmaxageperms|$cntgenderperms\n~;
}
if ( time() > $time_to_jump && ( $i + 1 ) < $totalnoposts ) {
Write_ForumMaster();
fopen( FORUMCONTROL, ">$boardsdir/forum.control" )
|| setup_fatal_error(
"$maintext_23 $boardsdir/forum.control: ", 1 );
print {FORUMCONTROL} @boardcontrols
or croak 'cannot print FORUMCONTROL';
fclose(FORUMCONTROL);
$yySetLocation =
qq~$set_cgi?action=cleanup2;st=~
. int(
$INFO{'st'} + time() - $time_to_jump + $max_process_time )
. qq~;starttime=$time_to_jump;clean=4;total_boards=$INFO{'total_boards'};total_re_tot=$INFO{'total_re_tot'};total_memb=$INFO{'total_memb'};tmp_firstforum=$INFO{'tmp_firstforum'};firstforum=$INFO{'firstforum'};total_mail_n=$INFO{'total_mail_n'};total_nopost=$totalnoposts;fix_nopost=~
. ( $i + 1 );
redirectexit();
}
}
Write_ForumMaster();
fopen( FORUMCONTROL, ">$boardsdir/forum.control" )
|| setup_fatal_error( "$maintext_23 $boardsdir/forum.control: ", 1 );
print {FORUMCONTROL} @boardcontrols
or croak 'cannot print FORUMCONTROL';
fclose(FORUMCONTROL);
}
return;
}
# / Cleanup ##
sub format_timestring {
my ($time_string) = @_;
if ( $time_string !~
m/(\d{1,2})\/(\d{1,2})\/(\d{2,4}).*?(\d{1,2})\:(\d{1,2})\:(\d{1,2})/ism
)
{
$time_string = "$forumstart";
}
if ( $time_string =~
m/(\d{1,2})\/(\d{1,2})\/(\d{2,4}).*?(\d{1,2})\:(\d{1,2})\:(\d{1,2})/ism
)
{
$dr_month = $1;
$dr_day = $2;
$dr_year = $3;
$dr_hour = $4;
$dr_minute = $5;
$dr_secund = $6;
}
if ( $dr_month > 12 ) { $dr_month = 12; }
if ( $dr_month < 1 ) { $dr_month = 1; }
if ( $dr_day > 31 ) { $dr_day = 31; }
if ( $dr_day < 1 ) { $dr_day = 1; }
if ( length($dr_year) > 2 ) {
$dr_year = substr $dr_year, length($dr_year) - 2, 2;
}
if ( $dr_year < 90 && $dr_year > 20 ) { $dr_year = 90; }
if ( $dr_year > 20 && $dr_year < 90 ) { $dr_year = 20; }
if ( $dr_hour > 23 ) { $dr_hour = 23; }
if ( $dr_minute > 59 ) { $dr_minute = 59; }
if ( $dr_secund > 59 ) { $dr_secund = 59; }
if ( $dr_month == 4 || $dr_month == 6 || $dr_month == 9 || $dr_month == 11 )
{
$max_days = 30;
}
elsif ( $dr_month == 2 && $dr_year % 4 == 0 ) {
$max_days = 29;
}
elsif ( $dr_month == 2 && $dr_year % 4 != 0 ) {
$max_days = 28;
}
else {
$max_days = 31;
}
if ( $dr_day > $max_days ) { $dr_day = $max_days; }
$dr_month = sprintf '%02d', $dr_month;
$dr_day = sprintf '%02d', $dr_day;
$dr_year = sprintf '%02d', $dr_year;
$dr_hour = sprintf '%02d', $dr_hour;
$dr_minute = sprintf '%02d', $dr_minute;
$dr_secund = sprintf '%02d', $dr_secund;
return
qq~$dr_month/$dr_day/$dr_year $maintxt{'107'} $dr_hour:$dr_minute:$dr_secund~;
}
sub conv_stringtotime {
my ($splitvar) = @_;
if ( !$splitvar ) { return 0; }
if ( $splitvar =~
m/(\d{1,2})\/(\d{1,2})\/(\d{2,4}).*?(\d{1,2})\:(\d{1,2})\:(\d{1,2})/ism
)
{
$amonth = int($1) || 1;
$aday = int($2) || 1;
$ayear = int($3) || 0;
$ahour = int($4) || 0;
$amin = int($5) || 0;
$asec = int($6) || 0;
}
if ( $ayear >= 36 && $ayear <= 99 ) { $ayear += 1900; }
elsif ( $ayear >= 00 && $ayear <= 35 ) { $ayear += 2000; }
if ( $ayear < 1904 ) { $ayear = 1904; }
elsif ( $ayear > 2036 ) { $ayear = 2036; }
if ( $amonth < 1 ) { $amonth = 0; }
elsif ( $amonth > 12 ) { $amonth = 11; }
else { --$amonth; }
if ( $amonth == 3 || $amonth == 5 || $amonth == 8 || $amonth == 10 ) {
$max_days = 30;
}
elsif ( $amonth == 1 && $ayear % 4 == 0 ) { $max_days = 29; }
elsif ( $amonth == 1 && $ayear % 4 != 0 ) { $max_days = 28; }
else { $max_days = 31; }
if ( $aday > $max_days ) { $aday = $max_days; }
if ( $ahour < 1 ) { $ahour = 0; }
elsif ( $ahour > 23 ) { $ahour = 23; }
if ( $amin < 1 ) { $amin = 0; }
elsif ( $amin > 59 ) { $amin = 59; }
if ( $asec < 1 ) { $asec = 0; }
elsif ( $asec > 59 ) { $asec = 59; }
return timelocal( $asec, $amin, $ahour, $aday, $amonth, $ayear );
}
#End Conversion#
sub tempstarter {
return if !-e "$vardir/Settings.pm";
$YaBBversion = 'YaBB 2.5.4';
# Make sure the module path is present
push @INC, './Modules';
if ( $ENV{'SERVER_SOFTWARE'} =~ /IIS/sm ) {
$yyIIS = 1;
if ( $PROGRAM_NAME =~ m{(.*)(\\|/)}xsm ) {
$yypath = $1;
}
$yypath =~ s/\\/\//gxsm;
chdir $yypath;
push @INC, $yypath;
}
# Requirements and Errors
require Variables::Settings;
if ( -e "$vardir/convSettings.txt" ) { require "$vardir/convSettings.txt"; }
else { $convertdir = './Convert'; }
LoadCookie(); # Load the user's cookie (or set to guest)
LoadUserSettings();
WhatTemplate();
WhatLanguage();
require Sources::Security;
WriteLog();
return;
}
sub CreateConvLock {
fopen( LOCKFILE, ">$vardir/Converter.lock" )
|| setup_fatal_error( "$maintext_23 $vardir/Converter.lock: ", 1 );
print {LOCKFILE} qq~This is a lockfile for the Converter.\n~
or croak 'cannot print to LOCKFILE';
print {LOCKFILE}
qq~It prevents it being run again after it has been run once.\n~
or croak 'cannot print to LOCKFILE';
print {LOCKFILE} q~Delete this file if you want to run the Converter again.~
or croak 'cannot print to LOCKFILE';
fclose(LOCKFILE);
unlink "$vardir/convSettings.txt";
return;
}
sub SetupImgLoc {
if ( !-e "$htmldir/Templates/Forum/$useimages/$_[0]" ) {
$thisimgloc = qq~img src="$yyhtml_root/Templates/Forum/default/$_[0]"~;
}
else { $thisimgloc = qq~img src="$imagesdir/$_[0]"~; }
return $thisimgloc;
}
sub tabmenushow { # used by the converter
$tabsep =
qq~<img src="$imagesdir/tabsep211.png" alt="" style="float: left" />~;
$tabfill = qq~<img src="$imagesdir/tabfill.gif" alt="" />~;
$NavLink1 = qq~<span>$tabfill Members $tabfill</span>~;
$NavLink2 = qq~$tabsep<span>$tabfill Boards & Categories $tabfill</span>~;
$NavLink3 = qq~$tabsep<span>$tabfill Messages $tabfill</span>~;
$NavLink4 = qq~$tabsep<span>$tabfill Date &amp; Time $tabfill</span>~;
$NavLink5 = qq~$tabsep<span>$tabfill Clean Up $tabfill</span>~;
$NavLink5 = qq~$tabsep<span>$tabfill Extended Profiles $tabfill</span>~;
$NavLink6 = qq~$tabsep<span>$tabfill Login $tabfill</span>$tabsep&nbsp;~;
$NavLink1a =
qq~<span class="selected"><a href="$set_cgi?action=members;st=$INFO{'st'}" style="color: #FF3333;" class="selected" onClick="PleaseWait();">$tabfill Members $tabfill</a></span>~;
$NavLink2a =
qq~$tabsep<span class="selected"><a href="$set_cgi?action=cats;st=$INFO{'st'}" style="color: #FF3333;" class="selected" onClick="PleaseWait();">$tabfill Boards & Categories $tabfill</a></span>~;
$NavLink3a =
qq~$tabsep<span class="selected"><a href="$set_cgi?action=messages;st=$INFO{'st'}" style="color: #FF3333;" class="selected" onClick="PleaseWait();">$tabfill Messages $tabfill</a></span>~;
$NavLink4a =
qq~$tabsep<span class="selected"><a href="$set_cgi?action=dates;st=$INFO{'st'}" style="color: #FF3333;" class="selected" onClick="PleaseWait();">$tabfill Date &amp; Time $tabfill</a></span>~;
$NavLink5a =
qq~$tabsep<span class="selected"><a href="$set_cgi?action=cleanup;st=$INFO{'st'}" style="color: #FF3333;" class="selected" onClick="PleaseWait();">$tabfill Clean Up $tabfill</a></span>~;
$NavLink6a =
qq~$tabsep<span class="selected"><a href="$boardurl/YaBB.$yyext?action=login" style="color: #FF3333;" class="selected">$tabfill Login $tabfill</a></span>$tabsep&nbsp;~;
$NavLink7a =
qq~$tabsep<span class="selected"><a href="$set_cgi?action=extended;st=$INFO{'st'}" style="color: #FF3333;" class="selected" onClick="PleaseWait();">$tabfill Extended Profiles $tabfill</a></span>~;
$ConvDone = q~
<div class="divvary_m">&nbsp;</div>
<div class="divvary2">100 %</div><br />
~;
$ConvNotDone = q~
<div class="divouter">&nbsp;</div>
<div class="divvary3">0 %</div><br />
~;
return;
}
sub FoundConvLock {
tempstarter();
tabmenushow();
$yytabmenu =
$NavLink1 . $NavLink2 . $NavLink3 . $NavLink4 . $NavLink5 . $NavLink6;
$formsession = cloak("$mbname$username");
$yymain = qq~
<div class="bordercolor borderbox">
<table class="cs_thin pad_4px">
<tr>
<td class="ttabtitle" colspan="2">YaBB 2.5.4 Converter</td>
</tr><tr>
<td class="windowbg center">
<img src="$imagesdir/info.png" alt="" />
</td>
<td class="windowbg2" style="font-size: 11px;">
Converter has already been run, attempting to run them again will cause damage to your files.<br />
<br />
To run Converter again, remove the file "$vardir/Converter.lock," then re-visit this page.
</td>
</tr><tr>
<td class="catbg center" colspan="2">
<form action="$boardurl/YaBB.$yyext" method="post" style="display: inline;">
<input type="submit" value="Go to your Forum" />
<input type="hidden" name="formsession" value="$formsession" />
</form>
</td>
</tr>
</table>
</div>
~;
$yyim = 'YaBB 2.5.4 Converter has already been run.';
$yytitle = 'YaBB 2.5.4 Converter';
SetupTemplate();
return;
}
sub setup_fatal_error {
my ( $e, $v ) = @_;
$e .= "\n";
if ($v) { $e .= $! . "\n"; }
$yymenu = q~Boards &amp; Categories | ~;
$yymenu .= q~Members | ~;
$yymenu .= q~Messages | ~;
$yymenu .= q~Date &amp; Time | ~;
$yymenu .= q~Clean Up | ~;
$yymenu .= q~Login~;
$yymain .= qq~
<table class="bordercolor cs_thin pad_4px" style="width:80%">
<tr>
<td class="titlebg text1"><b>An Error Has Occurred!</b></td>
</tr><tr>
<td class="windowbg text1"><br />$e<br /><br /></td>
</tr>
</table>
<p class="center"><a href="javascript:history.go(-1)">Back</a></p>
~;
$yyim = 'YaBB 2.5.4 Convertor Error.';
$yytitle = 'YaBB 2.5.4 Convertor Error.';
if ( !-e "$vardir/Settings.pm" ) { SimpleOutput(); }
tempstarter();
SetupTemplate();
return;
}
sub SimpleOutput {
$gzcomp = 0;
print_output_header();
print qq~
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>YaBB 2.5.4 Setup</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<!-- Main Content -->
<div style="height: 40px;">&nbsp;</div>
<div style="text-align:center">$yymain</div>
</body>
</html>
~ or croak 'cannot print output screen';
exit;
}
sub SetupTemplate {
$gzcomp = fileno $GZIP ? 1 : 0;
print_output_header();
$yyposition = $yytitle;
$yytitle = "$mbname - $yytitle";
$yyimages = $imagesdir;
$yydefaultimages = $defaultimagesdir;
$yystyle =
qq~<link rel="stylesheet" href="$yyhtml_root/Templates/Forum/$usestyle.css" type="text/css" />\n<link rel="stylesheet" href="$yyhtml_root/Templates/Forum/setup.css" type="text/css" />\n ~;
$yystyle =~ s/$usestyle\///gxsm;
$yytemplate = "$templatesdir/$usehead/$usehead.html";
fopen( TEMPLATE, "$yytemplate" )
|| setup_fatal_error( "$maintext_23 $yytemplate: ", 1 );
@yytemplate = <TEMPLATE>;
fclose(TEMPLATE);
my $output = q{};
$yyboardname = $mbname;
$yytime = timeformat( $date, 1 );
$yyuname =
$iamguest ? q{} : qq~$maintxt{'247'} ${$uid.$username}{'realname'}, ~;
if ($enable_news) {
fopen( NEWS, "$vardir/news.txt" );
@newsmessages = <NEWS>;
fclose(NEWS);
}
for my $i ( 0 .. ( @yytemplate - 1 ) ) {
$curline = $yytemplate[$i];
if (
!$yycopyin
&& ( $curline =~ m{<yabb\ copyright>}xsm
|| $curline =~ /{yabb\ copyright}/xsm )
)
{
$yycopyin = 1;
}
if ( $curline =~ m{<yabb\ newstitle>}xsm && $enable_news ) {
$yynewstitle = qq~<b>$maintxt{'102'}:</b> ~;
}
if ( $curline =~ m{<yabb\ news>}xsm && $enable_news ) {
srand;
if ( $shownewsfader == 1 ) {
$fadedelay = ( $maxsteps * $stepdelay );
$yynews .= qq~
<script type="text/javascript">
var maxsteps = "$maxsteps";
var stepdelay = "$stepdelay";
var fadelinks = $fadelinks;
var delay = "$fadedelay";
var bcolor = "$color{'faderbg'}";
var tcolor = "$color{'fadertext'}";
var fcontent = new Array();
var begintag = "";
~;
fopen( NEWS, "$vardir/news.txt" );
@newsmessages = <NEWS>;
fclose(NEWS);
for my $j ( 0 .. ( @newsmessages - 1 ) ) {
$newsmessages[$j] =~ s/\n|\r//gxsm;
if ( $newsmessages[$j] eq q{} ) { next; }
if ( $i != 0 ) { $yymain .= qq~\n~; }
$message = $newsmessages[$j];
if ($enable_ubbc) {
enable_yabbc();
DoUBBC();
}
$message =~ s/"/\\"/gxsm;
$yynews .= qq~
fcontent[$j] = "$message";\n
~;
}
$yynews .= q~
var closetag = '';
</script>
~;
}
else {
$message = $newsmessages[ int rand @newsmessages ];
if ($enable_ubbc) {
enable_yabbc();
DoUBBC();
}
$yynews = $message;
}
}
$yyurl = $scripturl;
$curline =~ s/{yabb\s+(\w+)}/${"yy$1"}/gxsm;
$curline =~ s/<yabb\s+(\w+)>/${"yy$1"}/gxsm;
$curline =~ s/img src\=\"$imagesdir\/(.+?)\"/SetupImgLoc($1)/eisgm;
$output .= $curline;
}
if ( $yycopyin == 0 ) {
$output =
q~<h1 style="text-align:center"><b>Sorry, the copyright tag <yabb copyright> must be in the template.<br />Please notify this forum&#39;s administrator that this site is using an ILLEGAL copy of YaBB!</b></h1>~;
}
if ( fileno $GZIP ) {
$OUTPUT_AUTOFLUSH = 1;
print {$GZIP} $output or croak 'cannot print compressed page';
close $GZIP or croak 'cannot close GZIP';
}
else {
print $output or croak 'cannot print page';
}
exit;
}
sub nicely_aligned_file {
$filler = q{ } x 50;
# Make files look nicely aligned. The comment starts after 50 Col
my $setfile = shift;
$setfile =~ s/=\s+;/= 0;/gsm;
$setfile =~
s/(.+;)[ \t]+(#.+$)/ $1 . substr($filler,(length $1 < 50 ? length $1 : 49)) . $2 /gem;
$setfile =~ s/\t+(#.+$)/$filler$1/gsm;
*cut_comment = sub { # line break of too long comments
my @x = @_;
my ( $comment, $length ) =
( q{}, 120 ); # 120 Col is the max width of page
my $var_length = length $x[0];
while ( $length < $var_length ) { $length += 120; }
foreach ( split / +/sm, $x[1] ) {
if ( ( $var_length + length($comment) + length $_ ) > $length ) {
$comment =~ s/ $//sm;
$comment .= "\n$filler# $_ ";
$length += 120;
}
else { $comment .= "$_ "; }
}
$comment =~ s/ $//sm;
return $comment;
};
$setfile =~ s/(.+)(#.+$)/ $1 . cut_comment($1,$2) /gem;
return $setfile;
}
# from Extended Profiles
# converts ALL old .ext files into the the YaBB 2 file format
sub ext_admin_convert {
my ( @contents, $filename, $old_membersdir, $old_vardir, $i );
$old_membersdir = $convmembersdir;
$old_vardir = $convvardir;
if ( !-e $old_vardir ) {
admin_fatal_error( 'extended_profiles_convert',
$lang_ext{'converter_missing_vars'} );
}
if ( !-e "$old_vardir/extended_profiles_order.txt" ) {
admin_fatal_error( 'extended_profiles_convert',
$lang_ext{'converter_missing_order'} );
}
if ( !-e "$old_vardir/extended_profiles_fields.txt" ) {
admin_fatal_error( 'extended_profiles_convert',
$lang_ext{'converter_missing_fields'} );
}
fopen( CONVERTER, "$old_vardir/extended_profiles_order.txt" )
|| admin_fatal_error( 'cannot_open',
"$old_vardir/extended_profiles_order.txt" );
@ext_prof_order = <CONVERTER>;
fclose(CONVERTER);
chomp @ext_prof_order;
# copy old extended_profiles_fields and extended_profiles_order files
fopen( CONVERTER, "$old_vardir/extended_profiles_fields.txt" )
|| admin_fatal_error( 'cannot_open',
"$old_vardir/extended_profiles_fields.txt" );
@ext_prof_fields = <CONVERTER>;
fclose(CONVERTER);
chomp @ext_prof_fields;
#check if used membergroups still exist + convert to YaBB new format
for my $i ( 0 .. ( @ext_prof_fields - 1 ) ) {
my @field = split /\|/xsm, $ext_prof_fields[$i];
$field[8] = ext_admin_convert_fixgroupnames( $field[8] );
$field[11] = ext_admin_convert_fixgroupnames( $field[11] );
$field[15] = ext_admin_convert_fixgroupnames( $field[15] );
$field[19] = ext_admin_convert_fixgroupnames( $field[19] );
$ext_prof_fields[$i] = join q{|}, @field;
}
require Admin::NewSettings;
SaveSettingsTo('Settings.pm');
opendir EXT_DIR, "$old_membersdir";
@contents = grep { /\.ext$/xsm } readdir EXT_DIR;
closedir EXT_DIR;
foreach my $filename (@contents) {
$filename =~ s/.ext$//xsm;
ext_user_convert( $filename, $old_membersdir );
}
return;
}
sub ext_user_convert {
my ( $pusername, $old_membersdir, @ext_profile, $id ) = ( shift, shift );
if ( -e "$convmembersdir/$pusername.ext" ) {
if ( -e "$memberdir/$pusername.vars" ) {
ext_get_profile($pusername);
fopen( EXT_FILE, "$convmembersdir/$pusername.ext" )
|| admin_fatal_error( 'cannot_open',
"$convmembersdir/$pusername.ext" );
@ext_profile = <EXT_FILE>;
fclose(EXT_FILE);
chomp @ext_profile;
$id = 0;
foreach (@ext_prof_fields) {
${ $uid . $pusername }{ 'ext_' . $id } = $ext_profile[$id];
$id++;
}
UserAccount( $pusername, 'update' );
# don't delete old .ext files anymore, user can do that himself now.
#unlink "$old_membersdir/$pusername.ext";
}
}
return;
}
#'ext_convert',"Settings_ExtendedProfiles.pm&ext_admin_convert",
# convert a string of usergroup names from the old YaBB format into Y2's new format
sub ext_admin_convert_fixgroupnames {
my ( $input, $done, $j, @groups, $group, $groupid, %checkdoubles ) =
( shift, 0 );
@groups = split /\s*\,\s*/xsm, $input;
for my $j ( 0 .. ( @groups - 1 ) ) {
# if groupname is in old format
if ( $groups[$j] ne 'Administrator'
&& $groups[$j] ne 'Global Moderator'
&& $groups[$j] ne 'Moderator'
&& $groups[$j] !~ m/^(?:No)?Post{\d+}$/sm )
{
# find best matching usergroup
foreach my $groupid ( sort { $a <=> $b } keys %NoPost ) {
if ( $groups[$j] eq
( split /\|/xsm, ( split /\|/xsm, $NoPost{$groupid} )[0] )
[0] )
{
$groups[$j] = "NoPost{$groupid}";
# check for doubles
if ( $checkdoubles{ $groups[$j] } == 1 ) {
splice @groups, $j, 1;
$j--;
$done = 1;
last;
}
else {
$checkdoubles{ $groups[$j] } = 1;
}
}
}
if ( $done == 1 ) { $done = 0; next; }
foreach my $groupid ( reverse sort { $a <=> $b } keys %Post ) {
if ( $groups[$j] eq
( split /\|/xsm, ( split /\|/xsm, $Post{$groupid} )[0] )[0]
)
{
$groups[$j] = "Post{$groupid}";
# check for doubles
if ( $checkdoubles{ $groups[$j] } == 1 ) {
splice @groups, $j, 1;
$done = 1;
$j--;
last;
}
else {
$checkdoubles{ $groups[$j] } = 1;
}
}
}
if ( $done == 1 ) { $done = 0; next; }
}
else {
$checkdoubles{ $groups[$j] } = 1;
}
# if still not matching, get rid of it!
if ( $groups[$j] ne 'Administrator'
&& $groups[$j] ne 'Global Moderator'
&& $groups[$j] ne 'Moderator'
&& $groups[$j] !~ m/^(?:No)?Post{\d+}$/sm )
{
#delete $groups[$j];
splice @groups, $j, 1;
$j--;
}
}
return join q{,}, @groups;
}
sub SetInstall2 {
if ( $action eq 'setinstall2' ) {
$settings_file_version = 'YaBB 2.5.4';
$yycharset = 'UTF-8';
$maintenance = 1;
$rememberbackup = 0;
$guestaccess = 1;
$mbname = $FORM{'mbname'} || 'My Perl YaBB Forum';
$mbname =~ s/\"/\'/gxsm; #'" make my syntax checker happy;
$forumstart = timetostring( int time );
$Cookie_Length = 1;
( undef,$rancook ) = split /\-/xsm, $cookieusername;
$cookietsort = qq~Y2tsort-$rancook~;
$regtype = 3;
$RegAgree = 1;
$RegReasonSymbols = 500;
$preregspan = 24;
$emailpassword = 0;
$emailnewpass = 0;
$emailwelcome = 0;
$name_cannot_be_userid = 1;
$gender_on_reg = 0;
$lang = $FORM{'defaultlanguage'} || 'English';
$default_template = 'Forum default';
$mailprog = '/usr/sbin/sendmail';
$smtp_server = '127.0.0.1';
$smtp_auth_required = 1;
$authuser = q~admin~;
$authpass = q~admin~;
$webmaster_email = $FORM{'webmaster_email'} || 'webmaster@mysite.com';
$mailtype = 0;
$maintenancetext =
'We are currently upgrading our forum again. Please check back shortly!';
$MenuType = 2;
$profilebutton = 0;
$allow_hide_email = 1;
$showlatestmember = 1;
$shownewsfader = 0;
$Show_RecentBar = 1;
$showmodify = 1;
$ShowBDescrip = 1;
$showuserpic = 1;
$showusertext = 1;
$showtopicviewers = 1;
$showtopicrepliers = 1;
$showgenderimage = 1;
$showyabbcbutt = 1;
$showsearchbox = 1;
$nestedquotes = 1;
$parseflash = 0;
$enableclicklog = 0;
$showimageinquote = 0;
$enable_ubbc = 1;
$enable_news = 1;
$allowpics = 1;
$upload_useravatar = 0;
$upload_avatargroup = q{};
$avatar_limit = 100;
$avatar_dirlimit = 10_000;
$enable_guestposting = 0;
$ML_Allowed = 1;
$enable_quickpost = 0;
$enable_quickreply = 0;
$enable_quickjump = 0;
$enable_markquote = 0;
$quick_quotelength = 1000;
$enable_quoteuser = 0;
$quoteuser_color = '#0033cc';
$guest_media_disallowed = 0;
$enable_guestlanguage = 1;
$enable_notifications = 0;
$NewNotificationAlert = 0;
$autolinkurls = 1;
$forumnumberformat = $FORM{'forumnumberformat'} || 1;
$timeselected = $FORM{'timeselect'} || 0;
$timecorrection = 0;
$timeoffset =
"$FORM{'usertimesign'}$FORM{'usertimehour'}.$FORM{'usertimemin'}";
$dstoffset = $FORM{'dstoffset'} || 0;
$dynamic_clock = 1;
$TopAmmount = 15;
$maxdisplay = 20;
$maxfavs = 20;
$maxrecentdisplay = 25;
$maxsearchdisplay = 15;
$maxmessagedisplay = 15;
$MaxMessLen = 2000;
$AdMaxMessLen = 5000;
$MaxIMMessLen = 2000;
$AdMaxIMMessLen = 3000;
$MaxCalMessLen = 200;
$AdMaxCalMessLen = 300;
$fontsizemin = 6;
$fontsizemax = 32;
$MaxSigLen = 200;
$MaxAwayLen = 200;
$ClickLogTime = 100;
$max_log_days_old = 90;
$fadertime = 1000;
$defaultusertxt = 'I Love YaBB 2.5.4!';
$timeout = 5;
$HotTopic = 10;
$VeryHotTopic = 25;
$barmaxdepend = 0;
$barmaxnumb = 500;
$defaultml = 'rgdate';
$max_avatar_width = 65;
$max_avatar_height = 65;
$fix_avatar_img_size = 0;
$max_avatarml_width = 65;
$max_avatarml_height = 65;
$fix_avatarml_img_size = 0;
$max_post_img_width = 400;
$max_post_img_height = 0;
$fix_post_img_size = 0;
$max_signat_img_width = 300;
$max_signat_img_height = 0;
$fix_signat_img_size = 0;
$max_attach_img_width = 200;
$max_attach_img_height = 0;
$fix_attach_img_size = 0;
$img_greybox = 1;
$extendedprofiles = 0;
$enable_freespace_check = 0;
$Show_EventCal = 0;
$Event_TodayColor = '#ff0000';
$Delete_EventsUntil = 0;
$bm_subcut = 50;
if ( -e '/bin/gzip' && open $GZIP, '|', 'gzip -f' ) {
$gzcomp = 1;
}
else {
eval { require Compress::Zlib; Compress::Zlib::memGzip('test'); };
$gzcomp = $@ ? 0 : 2;
}
$gzforce = 0;
$cachebehaviour = 0;
$use_flock = 1;
$faketruncation = 0;
$debug = 0;
$checkallcaps = 6;
$set_subjectMaxLength = 50;
$honeypot = 1;
$spamfruits = 0;
$speedpostdetection = 1;
$spd_detention_time = 300;
$min_post_speed = 2;
$post_speed_count = 3;
$minlinkpost = 0;
$minlinksig = 0;
$minlinkweb = 0;
$maxsteps = 40;
$stepdelay = 75;
$fadelinks = 0;
# Let's generate a masterkey at setup time.
my @chars = ( 'A' .. 'Z', 'a' .. 'z', 0 .. 9 );
for ( 1 .. 24 ) { $masterkey .= $chars[ rand @chars ]; }
}
else {
$forumstart = timetostring( $INFO{'firstforum'} );
$MaxSigLen = $siglength || 200;
$fadertime = 1000;
}
my $setfile = << "EOF";
###############################################################################
# Settings.pm #
###############################################################################
# YaBB: Yet another Bulletin Board #
# Open-Source Community Software for Webmasters #
# Version: YaBB 2.5.4 #
# Packaged: October 5, 2012 #
# Distributed by: http://www.yabbforum.com #
# =========================================================================== #
# Copyright (c) 2000-2012 YaBB (www.yabbforum.com) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
###############################################################################
########## Board Info ##########
# Note: these settings must be properly changed for YaBB to work
\$settings_file_version = "$settings_file_version"; # If not equal actual YaBBversion then the updating process is run through
\$yycharset = "$yycharset"; # character encoding (usually ISO-8859-1 for older forums)
# or 'UTF-8';
\%templateset = (
'Forum default' => "default|default|default|default|default|default|default|",
); # Forum templates settings
\$maintenance = $maintenance; # Set to 1 to enable Maintenance mode
\$rememberbackup = $rememberbackup; # seconds past since last backup until alert is displayed
\$guestaccess = $guestaccess; # Set to 0 to disallow guests from doing anything but login or register
\$mbname = q^$mbname^; # The name of your YaBB forum
\$forumstart = "$forumstart"; # The start date of your YaBB Forum
\$Cookie_Length = $Cookie_Length; # Default minutes to set login cookies to stay for
\$cookieusername = "$cookieusername"; # Name of the username cookie
\$cookiepassword = "$cookiepassword"; # Name of the password cookie
\$cookiesession_name = "$cookiesession_name"; # Name of the Session cookie
\$cookietsort = "$cookietsort"; # Name of the Topic Sort
\$cookieview = "$cookieview"; # Name of the Guest Message Limit cookie
\$regtype = $regtype; # 0 = registration closed (only admin can register),
# 1 = pre registration with admin approval,
# 2 = pre registration and email activation, 3 = open registration
\$RegAgree = $RegAgree; # Set to 1 to display the registration agreement when registering
\$RegReasonSymbols = $RegReasonSymbols; # Maximum allowed symbols in User reason(s) for registering
\$preregspan = $preregspan; # Time span in hours for users to account activation before cleanup.
\$pwstrengthmeter_scores = "10,15,30,40"; # Password-Strength-Meter Scores
\$pwstrengthmeter_common = qq~"123","123456"~; # Password-Strength-Meter common words
\$pwstrengthmeter_minchar = 5; # Password-Strength-Meter minimum characters
\$emailpassword = $emailpassword; # 0 - instant registration. 1 - password emailed to new members
\$emailnewpass = $emailnewpass; # Set to 1 to email a new password to members if
# they change their email address
\$emailwelcome = $emailwelcome; # Set to 1 to email a welcome message to users even
# when you have mail password turned off
\$name_cannot_be_userid = $name_cannot_be_userid; # Set to 1 to require users to have different user IDs and screen names
\$gender_on_reg = $gender_on_reg; # 0: do not ask for gender on registration
# 1: ask for gender, no input required
# 2: ask for gender, input required
\$lang = "$lang"; # Default Forum Language
\$default_template = "$default_template"; # Default Forum Template
\$mailprog = "$mailprog"; # Location of your sendmail program
\$smtp_server = "$smtp_server"; # Address of your SMTP-Server (for Net::SMTP::TLS, specify the port number with a ":<portnumber>" at the end)
\$smtp_auth_required = $smtp_auth_required; # Set to 1 if the SMTP server requires Authorisation
\$authuser = q^$authuser^; # Username for SMTP authorisation
\$authpass = q^$authpass^; # Password for SMTP authorisation
\$webmaster_email = q^$webmaster_email^; # Your email address. (eg: \$webmaster_email = q^admin\@host.com^;)
\$mailtype = $mailtype; # Mail program to use: 0 = sendmail, 1 = SMTP, 2 = Net::SMTP, 3 = Net::SMTP::TLS
\$UseHelp_Perms = 1; # Help Center: 1 == use permissions, 0 == do not use permissions
########## MemberGroups ##########
\$Group{'Administrator'} = 'Forum Administrator|5|staradmin.png|#FF0000|0|0|0|0|0|0|0';
\$Group{'Global Moderator'} = 'Global Moderator|5|stargmod.png|#0000FF|0|0|0|0|0|0|0';
\$Group{'Mid Moderator'} = 'Forum Moderator|5|starfmod.png|#008080|0|0|0|0|0|0|0';
\$Group{'Moderator'} = 'Board Moderator|5|starmod.png|#008000|0|0|0|0|0|0|0';
\$Post{'500'} = "God Member|5|starsilver.png||0|0|0|0|0|0";
\$Post{'250'} = "Senior Member|4|stargold.png||0|0|0|0|0|0";
\$Post{'100'} = "Full Member|3|starblue.png||0|0|0|0|0|0";
\$Post{'50'} = "Junior Member|2|stargold.png||0|0|0|0|0|0";
\$Post{'-1'} = "New Member|1|stargold.png||0|0|0|0|0|0";
########## Layout ##########
\$maintenancetext = "$maintenancetext"; # User-defined text for Maintenance mode (leave blank for default text)
\$MenuType = $MenuType; # 1 for text menu or anything else for images menu
\$profilebutton = $profilebutton; # 1 to show view profile button under post, or 0 for blank
\$allow_hide_email = $allow_hide_email; # Allow users to hide their email from public. Set 0 to disable
\$showlatestmember = $showlatestmember; # Set to 1 to display "Welcome Newest Member" on the Board Index
\$shownewsfader = $shownewsfader; # 1 to allow or 0 to disallow NewsFader javascript on the Board Index
# If 0, you'll have no news at all unless you put <yabb news> tag
# back into template.html!!!
\$Show_RecentBar = $Show_RecentBar; # Set to 1 to display the Recent Post on Board Index
\$showmodify = $showmodify; # Set to 1 to display "Last modified: Realname - Date" under each message
\$ShowBDescrip = $ShowBDescrip; # Set to 1 to display board descriptions on the topic (message) index for each board
\$showuserpic = $showuserpic; # Set to 1 to display each member's picture in the
# message view (by the ICQ.. etc.)
\$showusertext = $showusertext; # Set to 1 to display each member's personal text
# in the message view (by the ICQ.. etc.)
\$showtopicviewers = $showtopicviewers; # Set to 1 to display members viewing a topic
\$showtopicrepliers = $showtopicrepliers; # Set to 1 to display members replying to a topic
\$showgenderimage = $showgenderimage; # Set to 1 to display each member's gender in the
\$showsearchbox = $showsearchbox; # Show the Search Box on all pages
\$showsearchboxnum = $showsearchboxnum; # Maximum post age for Search Box
# message view (by the ICQ.. etc.)
\$showyabbcbutt = $showyabbcbutt; # Set to 1 to display the yabbc buttons on Posting and IM Send Pages
\$nestedquotes = $nestedquotes; # Set to 1 to allow quotes within quotes
# (0 will filter out quotes within a quoted message)
\$parseflash = $parseflash; # Set to 1 to parse the flash tag
\$enableclicklog = $enableclicklog; # Set to 1 to track stats in Clicklog (this may slow your board down)
\$showimageinquote = $showimageinquote; # Set to 1 to shows images in quotes, 0 displays a link to the image
\@pallist = ("#ff0000","#00ff00","#0000ff","#00ffff","#ff00ff","#ffff00"); # color settings of the palette
########## Feature Settings ##########
\$enable_ubbc = $enable_ubbc; # Set to 1 if you want to enable UBBC (Uniform Bulletin Board Code)
\$enable_news = $enable_news; # Set to 1 to turn news on, or 0 to set news off
\$allowpics = $allowpics; # set to 1 to allow members to choose avatars in their profile
\$upload_useravatar = $upload_useravatar; # set to 1 to allow members to upload avatars for their profile
\$upload_avatargroup = "$upload_avatargroup"; # membergroups allowed to upload avatars for their profile, '' == all members
\$avatar_limit = $avatar_limit; # set to the maximum size of the uploaded avatar, 0 == no limit
\$avatar_dirlimit = $avatar_dirlimit; # set to the maximum size of the upload avatar directory, 0 == no limit
\$enable_guestposting = $enable_guestposting; # Set to 0 if do not allow 1 is allow.
\$guest_media_disallowed = $guest_media_disallowed; # disallow browsing guests to see media files or
# have clickable auto linked urls in messages.
\$enable_guestlanguage = $enable_guestlanguage; # allow browsing guests to select their language
# - requires more than one language pack!
# - Set to 0 if do not allow 1 is allow.
\$enable_notifications = $enable_notifications; # - Allow e-mail notification for boards/threads
# listed in "My Notifications" => value == 1
# - Allow e-mail notification when new PM comes in
# => value == 2
# - value == 0 => both disabled | value == 3 => both enabled
\$NewNotificationAlert = $NewNotificationAlert; # enable notification alerts (popup) for new notifications
\$autolinkurls = $autolinkurls; # Set to 1 to turn URLs into links, or 0 for no auto-linking.
\$forumnumberformat = $forumnumberformat; # Select your preferred output Format for Numbers
\$timeselected = $timeselected; # Select your preferred output Format of Time and Date
\$timecorrection = $timecorrection; # Set time correction for server time in seconds
\$timeoffset = "$timeoffset"; # Time Offset to GMT/UTC (0 for GMT/UTC)
\$dstoffset = $dstoffset; # Time Offset (for daylight savings time, 0 to disable DST)
\$dynamic_clock = $dynamic_clock; # Set to a value enables the dynamic clock at the top of the page
\$TopAmmount = $TopAmmount; # No. of top posters to display on the top members list
\$maxdisplay = $maxdisplay; # Maximum of topics to display
\$maxfavs = $maxfavs; # Maximum of favorite topics to save in a profile
\$maxrecentdisplay = $maxrecentdisplay; # Maximum of topics to display on recent posts by a user (-1 to disable)
\$maxsearchdisplay = $maxsearchdisplay; # Maximum of messages to display in a search query (-1 to disable search)
\$maxmessagedisplay = $maxmessagedisplay; # Maximum of messages to display
\$MaxMessLen = $MaxMessLen; # Maximum Allowed Characters in a Posts
\$AdMaxMessLen = $AdMaxMessLen; # Maximum Allowed Characters in a Posts for Admins
\$AdMaxIMMessLen = $AdMaxIMMessLen; # Maximum Allowed Characters in a PM for Admins
\$MaxCalMessLen = $MaxCalMessLen; # Maximum Allowed Characters in a Cal event
\$AdMaxCalMessLen = $AdMaxCalMessLen; # Maximum Allowed Characters in a Cal Event for Admins
\$fontsizemin = $fontsizemin; # Minimum Allowed Font height in pixels
\$fontsizemax = $fontsizemax; # Maximum Allowed Font height in pixels
\$checkallcaps = $checkallcaps; # Set to 0 to allow ALL CAPS in posts (subject and message) or set to a value > 0 to open a JS-alert if more characters in ALL CAPS were there.
\$set_subjectMaxLength = $set_subjectMaxLength; # Maximum Allowed Characters in a Posts Subject
\$honeypot = $honeypot; # Set to 1 to activate Honeypot spam deterrent
\$spamfruits = $spamfruits; # Set to 1 to activate SpamFruits spam deterrent
\$speedpostdetection = $speedpostdetection; # Set to 1 to detect speedposters and delay their spam actions
\$spd_detention_time = $spd_detention_time; # Time in seconds before a speedposting ban is lifted again
\$min_post_speed = $min_post_speed; # Minimum time in seconds between entering a post form and submitting a post
\$minlinkpost = $minlinkpost; # Minimum amount of posts a member needs to post links and images
\$minlinksig = $minlinksig; # Minimum amount of posts a member needs to create links and images in signature
\$minlinkweb = $minlinkweb;
\$post_speed_count = $post_speed_count; # Maximum amount of abuses befor a user gets banned
\$MaxSigLen = $MaxSigLen; # Maximum Allowed Characters in Signatures
\$MaxAwayLen = $MaxAwayLen; # Maximum Allowed Characters in Away message
\$ClickLogTime = $ClickLogTime; # Time in minutes to log every click to your forum
# (longer time means larger log file size)
\$max_log_days_old = $max_log_days_old; # If an entry in the user's log is older than ... days remove it
\$maxsteps = $maxsteps; # Number of steps to take to change from start color to endcolor
\$stepdelay = $stepdelay; # Time in miliseconds of a single step
\$fadelinks = $fadelinks; # Fade links as well as text?
\$defaultusertxt = "$defaultusertxt"; # The dafault usertext visible in users posts
\$timeout = $timeout; # Minimum time between 2 postings from the same IP
\$HotTopic = $HotTopic; # Number of posts needed in a topic for it to be classed as "Hot"
\$VeryHotTopic = $VeryHotTopic; # Number of posts needed in a topic for it to be classed as "Very Hot"
\$barmaxdepend = $barmaxdepend; # Set to 1 to let bar-max-length depend on top poster
# or 0 to depend on a number of your choise
\$barmaxnumb = $barmaxnumb; # Select number of post for max. bar-length in memberlist
\$defaultml = "$defaultml";
\$ML_Allowed = $ML_Allowed; # allow browse MemberList
########## Quick Reply configuration ##########
\$enable_quickpost = $enable_quickpost; # Set to 1 if you want to enable the quick post box
\$enable_quickreply = $enable_quickreply; # Set to 1 if you want to enable the quick reply box
\$enable_quickjump = $enable_quickjump; # Set to 1 if you want to enable the jump to quick reply box
\$enable_markquote = $enable_markquote; # Set to 1 if you want to enable the mark&quote feature
\$quick_quotelength = $quick_quotelength; # Set the max length for Quick Quotes
\$enable_quoteuser = $enable_quoteuser; # Set to 1 if you want to enable userquote
\$quoteuser_color = "$quoteuser_color"; # Set the default color of @ in userquote
########## MemberPic Settings ##########
\$max_avatar_width = $max_avatar_width; # Set maximum pixel width to which the selfselected userpics are resized,
# 0 disables this limit
\$max_avatar_height = $max_avatar_height; # Set maximum pixel height to which the selfselected userpics are resized,
# 0 disables this limit
\$fix_avatar_img_size = $fix_avatar_img_size; # Set to 1 disable the image resize feature and sets the image size to the
# max_... values. If one of the max_... values is 0 the image is shown in its
# proportions to the other value. If both are 0 the image is shown at its original size.
\$max_post_img_width = $max_post_img_width; # Set maximum pixel width for images, 0 disables this limit
\$max_post_img_height = $max_post_img_height; # Set maximum pixel height for images, 0 disables this limit
\$fix_post_img_size = $fix_post_img_size; # Set to 1 disable the image resize feature and sets the image size to the
# max_... values. If one of the max_... values is 0 the image is shown in its
# proportions to the other value. If both are 0 the image is shown at its original size.
\$max_signat_img_width = $max_signat_img_width; # Set maximum pixel width for images in the signature, 0 disables this limit
\$max_signat_img_height = $max_signat_img_height; # Set maximum pixel height for images in the signature, 0 disables this limit
\$fix_signat_img_size = $fix_signat_img_size; # Set to 1 disable the image resize feature and sets the image size to the
# max_... values. If one of the max_... values is 0 the image is shown in its
# proportions to the other value. If both are 0 the image is shown at its original size.
\$max_attach_img_width = $max_attach_img_width; # Set maximum pixel width for attached images, 0 disables this limit
\$max_attach_img_height = $max_attach_img_height; # Set maximum pixel height for attached images, 0 disables this limit
\$fix_attach_img_size = $fix_attach_img_size; # Set to 1 disable the image resize feature and sets the image size to the
# max_... values. If one of the max_... values is 0 the image is shown in its
# proportions to the other value. If both are 0 the image is shown at its original size.
\$img_greybox = $img_greybox; # Set to 0 to disable "greybox" (each image is shown in a new window)
# Set to 1 to enable the attachment and post image "greybox" (one image/page)
# Set to 2 to enable the attachment and post image "greybox" =>
# attachment images: (all images/page), post images: (one image/page)
########## Extended Profiles ##########
\$extendedprofiles = $extendedprofiles; # Set to 1 to enabled 'Extended Profiles'. Turn it off (0) to save server load.
########## File Locking ##########
\$enable_freespace_check = $enable_freespace_check; # Enable the free disk space check on every pageview?
\$gzcomp = $gzcomp; # GZip compression: 0 = No Compression,
# 1 = External gzip, 2 = Zlib::Compress
\$gzforce = $gzforce; # Do not try to check whether browser supports GZip
\$cachebehaviour = $cachebehaviour; # Browser Cache Control: 0 = No Cache must revalidate, 1 = Allow Caching
\$use_flock = $use_flock; # Set to 0 if your server doesn't support file locking,
# 1 for Unix/Linux and WinNT, and 2 for Windows 95/98/ME
\$faketruncation = $faketruncation; # Enable this option only if YaBB fails with the error:
# "truncate() function not supported on this platform."
# 0 to disable, 1 to enable.
\$debug = $debug; # If set to 1 debug info is added to the template
# tags are <yabb fileactions> and <yabb filenames>
###############################################################################
# Advanced Settings (old AdvSettings.txt #
###############################################################################
########## New Member Notification Settings ##########
\$new_member_notification = 0; # Set to 1 to enable the new member notification
\$new_member_notification_mail = ''; # Your "New Member Notification"-email address.
\$sendtopicmail = 2; # Set to 0 for send NO topic email to friend
# Set to 1 to send topic email to friend via YaBB
# Set to 2 to send topic email to friend via user program
# Set to 3 to let user decide between 1 and 2
########## In-Thread Multi Delete ##########
\$mdadmin = 1;
\$mdglobal = 1;
\$mdfmod = 1;
\$mdmod = 1;
\$adminbin = 0; # Skip recycle bin step for admins and delete directly
########## Moderation Update ##########
\$adminview = 2; # Multi-admin settings for Administrators:
# 0=none, 1=icons 2=single checkbox 3=multiple checkboxes
\$gmodview = 2; # Multi-admin settings for Global Moderators:
# 0=none, 1=icons 2=single checkbox 3=multiple checkboxes
\$fmodview = 2; # Multi-admin settings for Forum Moderators:
# 0=none, 1=icons 2=single checkbox 3=multiple checkboxes
\$modview = 2; # Multi-admin settings for Moderators:
# 0=none, 1=icons 2=single checkbox 3=multiple checkboxes
########## Advanced Memberview Plus ##########
\$showallgroups = 1;
\$OnlineLogTime = 15; # Time in minutes before Users are removed from the Online Log
\$lastonlineinlink = 0; # Show "Last online X days and XX:XX:XX hours ago." to all members == 1
########## Polls ##########
\$numpolloptions = 8; # Number of poll options
\$maxpq = 60; # Maximum Allowed Characters in a Poll Qestion?
\$maxpo = 50; # Maximum Allowed Characters in a Poll Option?
\$maxpc = 0; # Maximum Allowed Characters in a Poll Comment?
\$useraddpoll = 1; # Allow users to add polls to existing threads? (1 = yes)
\$ubbcpolls = 1; # Allow UBBC tags and smilies in polls? (1 = yes)
########## Advanced Instant Message Box ##########
\$PM_level = 1;
\$numposts = 1; # Number of posts required to send Instant Messages
\$imspam = 0; # Percent of Users a user is a allowed to send a message at once
\$numibox = 20; # Number of maximum Messages in the IM-Inbox
\$numobox = 20; # Number of maximum Messages in the IM-Outbox
\$numstore = 20; # Number of maximum Messages in the Storage box
\$numdraft = 20; # Number of maximum Messages in the Draft box
\$enable_imlimit = 0; # Set to 1 to enable limitation of incoming and outgoing im messages
\$enable_storefolders = 0; # enable additonal store folders - in/out are default for all
# 0=no > 1 = number, max 25
\$imtext = qq~Welcome to my boards~;
\$sendname = admin;
\$imsubject = "Hey Hey :)";
\$send_welcomeim = 1;
\$PMenableBm_level = 3; # minimum level to send? 0 = off, 1 = mods, 2 = gmod, 3 = admin
########## Topic Summary Cutter ##########
\$cutamount = "15"; # Number of posts to list in topic summary
\$ttsreverse = 0; # Reverse Topic Summaries in Topic (most recent becomes first)
\$ttsureverse = 0; # Reverse Topic Summaries in Topic (most recent becomes first) allowed as user wishes? Yes == 1
\$tsreverse = 1; # Reverse Topic Summaries (So most recent is first
########## Time Lock ##########
\$tlnomodflag = 1; # Set to 1 limit time users may modify posts
\$tlnomodtime = 1; # Time limit on modifying posts (days)
\$tlnodelflag = 1; # Set to 1 limit time users may delete posts
\$tlnodeltime = 5; # Time limit on deleting posts (days)
\$tllastmodflag = 1; # Set to 1 allow users to modify posts up to
# the specified time limit w/o showing "last Edit" message
\$tllastmodtime = 60; # Time limit to modify posts w/o triggering "last Edit" message (in minutes)
########## File Attachment Settings ##########
\$limit = 250; # Set to the maximum number of kilobytes an attachment can be.
# Set to 0 to disable the file size check.
\$dirlimit = 10000; # Set to the maximum number of kilobytes the attachment directory can hold.
# Set to 0 to disable the directory size check.
\$overwrite = 0; # Set to 0 to auto rename attachments if they exist,
# 1 to overwrite them or 2 to generate an error if the file exists already.
\@ext = qw(txt doc docx psd pdf bmp jpe jpg jpeg gif png swf zip rar tar); # The allowed file extensions for file attachements.
# The variable should be set in the form of "jpg bmp gif" and so on.
\$checkext = 1; # Set to 1 to enable file extension checking,
# set to 0 to allow all file types to be uploaded
\$amdisplaypics = 1; # Set to 1 to display attached pictures in posts,
# set to 0 to only show a link to them.
\$allowattach = 1; # Set to the number of maximum files attaching a post,
# set to 0 to disable file attaching.
\$allowguestattach = 0; # Set to 1 to allow guests to upload attachments, 0 to disable guest attachment uploading.
########## Error Logger ##########
\$elmax = 50; # Max number of log entries before rotation
\$elenable = 1; # allow for error logging
\$elrotate = 1; # Allow for log rotation
########## Advanced Tabs ##########
\@AdvancedTabs = qw(home help search ml admin revalidatesession login register guestpm mycenter logout eventcal birthdaylist ); # Advanced Tabs order and infos
########## Smilies ##########
\@SmilieURL = ("exclamation.png","question.png"); # Additional Smilies URL
\@SmilieCode = (":exclamation",":question"); # Additional Smilies Code
\@SmilieDescription = ("Exclaim","Questioning"); # Additional Smilies Description
\@SmilieLinebreak = ("",""); # Additional Smilies Linebreak
\$smiliestyle = "1"; # smiliestyle
\$showadded = "2"; # showadded
\$showsmdir = "2"; # showsmdir
\$detachblock = "1"; # detachblock
\$winwidth = "400"; # winwidth
\$winheight = "400"; # winheight
\$popback = "FFFFFF"; # popback
\$poptext = "000000"; # poptext
###############################################################################
# Security Settings (old SecSettings.txt) #
###############################################################################
\$regcheck = 0; # Set to 1 if you want to enable automatic flood protection enabled
\$codemaxchars = 6; # Set max length of validation code (15 is max)
\$rgb_foreground = "\#0000EE"; # Set hex RGB value for validation image foreground color
\$rgb_shade = "\#999999"; # Set hex RGB value for validation image shade color
\$rgb_background = "\#FFFFFF"; # Set hex RGB value for validation image background color
\$translayer = 0; # Set to 1 background for validation image should be transparent
\$randomizer = 0; # Set 0 to 3 to create background random noise
# based on foreground or shade color or both
\$stealthurl = 0; # Set to 1 to mask referer url to hosts if a hyperlink is clicked.
\$referersecurity = 0; # Set to 1 to activate referer security checking.
\$do_scramble_id = 1; # Set to 1 scambles all visible links containing user ID's
\$sessions = 1; # Set to 1 to activate session id protection.
\$show_online_ip_admin = 1; # Set to 1 to show online IP's to admins.
\$show_online_ip_gmod = 1; # Set to 1 to show online IP's to global moderators.
\$show_online_ip_fmod = 1; # Set to 1 to show online IP's to forum moderators.
\$masterkey = "$masterkey"; # Seed for encryption of captcha's
###############################################################################
# Guardian Settings (old Guardian.banned and Guardian.settings) #
###############################################################################
\$banned_harvesters = qq~alexibot|asterias|backdoorbot|black.hole|blackwidow|blowfish|botalot|builtbottough|bullseye|bunnyslippers|cegbfeieh|cheesebot|cherrypicker|chinaclaw|copyrightcheck|cosmos |crescent|custo|disco|dittospyder|download demon|ecatch|eirgrabber|emailcollector|emailsiphon|emailwolf|erocrawler|eseek-larbin|express webpictures|extractorpro|eyenetie|fast|flashget|foobot|frontpage|fscrawler|getright|getweb|go!zilla|go-ahead-got-it|grabnet|grafula|gsa-crawler|harvest|hloader|hmview|httplib|httrack|humanlinks|ia_archiver|image stripper|image sucker|indy library|infonavirobot|interget|internet ninja|jennybot|jetcar|joc web
spider|kenjin.spider|keyword.density|larbin|leechftp|lexibot|libweb/clshttp|linkextractorpro|linkscan/8.1a.unix|linkwalker|lwp-trivial|mass downloader|mata.hari|microsoft.url|midown tool|miixpc|mister pix|moget|mozilla.*newt|mozilla/3.mozilla/2.01|navroad|nearsite|net vampire|netants|netmechanic|netspider|netzip|nicerspro|npbot|octopus|offline explorer|offline navigator|openfind|pagegrabber|papa foto|pavuk|pcbrowser|propowerbot/2.14|prowebwalker|queryn.metasearch|realdownload|reget|repomonkey|sitesnagger|slysearch|smartdownload|spankbot|spanner |spiderzilla|steeler|superbot|superhttp|surfbot|suzuran|szukacz|takeout|teleport pro|telesoft|the.intraformant|thenomad|tighttwatbot|titan|tocrawl/urldispatcher|true_robot|turingos|turnitinbot|urly.warning|vci|voideye|web image collector|web sucker|web.image.collector|webauto|webbandit|webbandit|webcopier|webemailextrac.*|webenhancer|webfetch|webgo is|webleacher|webmasterworldforumbot|webreaper|websauger|website extractor|website quester|webster.pro|webstripper|webwhacker|webzip|wget|widow|www-collector-e|wwwoffle|xaldon webspider|xenu link sleuth|zeus~;
\$banned_referers = qq~hotsex.com|porn.com~;
\$banned_requests = qq~~;
\$banned_strings = qq~pussy|cunt~;
\$whitelist = qq~~;
\$use_guardian = 1;
\$use_htaccess = 0;
\$disallow_proxy_on = 0;
\$referer_on = 1;
\$harvester_on = 0;
\$request_on = 0;
\$string_on = 1;
\$union_on = 1;
\$clike_on = 1;
\$script_on = 1;
\$disallow_proxy_notify = 1;
\$referer_notify = 0;
\$harvester_notify = 1;
\$request_notify = 0;
\$string_notify = 1;
\$union_notify = 1;
\$clike_notify = 1;
\$script_notify = 1;
###############################################################################
# Banning Settings (old ban.txt) - Moved to ban_list.txt #
###############################################################################
###############################################################################
# Backup Settings #
###############################################################################
\@backup_paths = qw();
\$backupmethod = '';
\$compressmethod = '';
\$backupprogusr = '';
\$backupprogbin = '';
\$backupdir = '';
\$lastbackup = 0;
\$backupsettingsloaded = 0;
1;
EOF
fopen( SETTING, ">$vardir/Settings.pm" )
|| setup_fatal_error( "$maintext_23 $vardir/Settings.pm: ", 1 );
print {SETTING} nicely_aligned_file($setfile)
or croak 'cannot print Settings.pm';
fclose(SETTING);
if ( $action eq 'setinstall2' ) {
LoadUser('admin');
${ $uid . 'admin' }{'email'} = $webmaster_email;
${ $uid . 'admin' }{'timeoffset'} = $timeoffset;
# must set before &timetostring($date)
${ $uid . 'admin' }{'regdate'} = timetostring($date);
${ $uid . 'admin' }{'regtime'} = $date;
${ $uid . 'admin' }{'timeselect'} = $timeselected;
${ $uid . 'admin' }{'language'} = $lang;
UserAccount( 'admin', 'update' );
ManageMemberinfo( 'update', 'admin', 'Administrator', $webmaster_email,'Forum Administrator' );
$yySetLocation = qq~$set_cgi?action=setup3~;
redirectexit();
}
return;
}
1;