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 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920 9921 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9954 9955 9956 9957 9958 9959 9960 9961 9962 9963 9964 9965 9966 9967 9968 9969 9970 9971 9972 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 10522 10523 10524 10525 10526 10527 10528 10529 10530 10531 10532 10533 10534 10535 10536 10537 10538 10539 10540 10541 10542 10543 10544 10545 10546 10547 10548 10549 10550 10551 10552 10553 10554 10555 10556 10557 10558 10559 10560 10561 10562 10563 10564 10565 10566 10567 10568 10569 10570 10571 10572 10573 10574 10575 10576 10577 10578 10579 10580 10581 10582 10583 10584 10585 10586 10587 10588 10589 10590 10591 10592 10593 10594 10595 10596 10597 10598 10599 10600 10601 10602 10603 10604 10605 10606 10607 10608 10609 10610 10611 10612 10613 10614 10615 10616 10617 10618 10619 10620 10621 10622 10623 10624 10625 10626 10627 10628 10629 10630 10631 10632 10633 10634 10635 10636 10637 10638 10639 10640 10641 10642 10643 10644 10645 10646 10647 10648 10649 10650 10651 10652 10653 10654 10655 10656 10657 10658 10659 10660 10661 10662 10663 10664 10665 10666 10667 10668 10669 10670 10671 10672 10673 10674 10675 10676 10677 10678 10679 10680 10681 10682 10683 10684 10685 10686 10687 10688 10689 10690 10691 10692 10693 10694 10695 10696 10697 10698 10699 10700 10701 10702 10703 10704 10705 10706 10707 10708 10709 10710 10711 10712 10713 10714 10715 10716 10717 10718 10719 10720 10721 10722 10723 10724 10725 10726 10727 10728 10729 10730 10731 10732 10733 10734 10735 10736 10737 10738 10739 10740 10741 10742 10743 10744 10745 10746 10747 10748 10749 10750 10751 10752 10753 10754 10755 10756 10757 10758 10759 10760 10761 10762 10763 10764 10765 10766 10767 10768 10769 10770 10771 10772 10773 10774 10775 10776 10777 10778 10779 10780 10781 10782 10783 10784 10785 10786 10787 10788 10789 10790 10791 10792 10793 10794 10795 10796 10797 10798 10799 10800 10801 10802 10803 10804 10805 10806 10807 10808 10809 10810 10811 10812 10813 10814 10815 10816 10817 10818 10819 10820 10821 10822 10823 10824 10825 10826 10827 10828 10829 10830 10831 10832 10833 10834 10835 10836 10837 10838 10839 10840 10841 10842 10843 10844 10845 10846 10847 10848 10849 10850 10851 10852 10853 10854 10855 10856 10857 10858 10859 10860 10861 10862 10863 10864 10865 10866 10867 10868 10869 10870 10871 10872 10873 10874 10875 10876 10877 10878 10879 10880 10881 10882 10883 10884 10885 10886 10887 10888 10889 10890 10891 10892 10893 10894 10895 10896 10897 10898 10899 10900 10901 10902 10903 10904 10905 10906 10907 10908 10909 10910 10911 10912 10913 10914 10915 10916 10917 10918 10919 10920 10921 10922 10923 10924 10925 10926 10927 10928 10929 10930 10931 10932 10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 10946 10947 10948 10949 10950 10951 10952 10953 10954 10955 10956 10957 10958 10959 10960 10961 10962 10963 10964 10965 10966 10967 10968 10969 10970 10971 10972 10973 10974 10975 10976 10977 10978 10979 10980 10981 10982 10983 10984 10985 10986 10987 10988 10989 10990 10991 10992 10993 10994 10995 10996 10997 10998 10999 11000 11001 11002 11003 11004 11005 11006 11007 11008 11009 11010 11011 11012 11013 11014 11015 11016 11017 11018 11019 11020 11021 11022 11023 11024 11025 11026 11027 11028 11029 11030 11031 11032 11033 11034 11035 11036 11037 11038 11039 11040 11041 11042 11043 11044 11045 11046 11047 11048 11049 11050 11051 11052 11053 11054 11055 11056 11057 11058 11059 11060 11061 11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132 11133 11134 11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259 11260 11261 11262 11263 11264 11265 11266 11267 11268 11269 11270 11271 11272 11273 11274 11275 11276 11277 11278 11279 11280 11281 11282 11283 11284 11285 11286 11287 11288 11289 11290 11291 11292 11293 11294 11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 11310 11311 11312 11313 11314 11315 11316 11317 11318 11319 11320 11321 11322 11323 11324 11325 11326 11327 11328 11329 11330 11331 11332 11333 11334 11335 11336 11337 11338 11339 11340 11341 11342 11343 11344 11345 11346 11347 11348 11349 11350 11351 11352 11353 11354 11355 11356 11357 11358 11359 11360 11361 11362 11363 11364 11365 11366 11367 11368 11369 11370 11371 11372 11373 11374 11375 11376 11377 11378 11379 11380 11381 11382 11383 11384 11385 11386 11387 11388 11389 11390 11391 11392 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11492 11493 11494 11495 11496 11497 11498 11499 11500 11501 11502 11503 11504 11505 11506 11507 11508 11509 11510 11511 11512 11513 11514 11515 11516 11517 11518 11519 11520 11521 11522 11523 11524 11525 11526 11527 11528 11529 11530 11531 11532 11533 11534 11535 11536 11537 11538 11539 11540 11541 11542 11543 11544 11545 11546 11547 11548 11549 11550 11551 11552 11553 11554 11555 11556 11557 11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609 11610 11611 11612 11613 11614 11615 11616 11617 11618 11619 11620 11621 11622 11623 11624 11625 11626 11627 11628 11629 11630 11631 11632 11633 11634 11635 11636 11637 11638 11639 11640 11641 11642 11643 11644 11645 11646 11647 11648 11649 11650 11651 11652 11653 11654 11655 11656 11657 11658 11659 11660 11661 11662 11663 11664 11665 11666 11667 11668 11669 11670 11671 11672 11673 11674 11675 11676 11677 11678 11679 11680 11681 11682 11683 11684 11685 11686 11687 11688 11689 11690 11691 11692 11693 11694 11695 11696 11697 11698 11699 11700 11701 11702 11703 11704 11705 11706 11707 11708 11709 11710 11711 11712 11713 11714 11715 11716 11717 11718 11719 11720 11721 11722 11723 11724 11725 11726 11727 11728 11729 11730 11731 11732 11733 11734 11735 11736 11737 11738 11739 11740 11741 11742 11743 11744 11745 11746 11747 11748 11749 11750 11751 11752 11753 11754 11755 11756 11757 11758 11759 11760 11761 11762 11763 11764 11765 11766 11767 11768 11769 11770 11771 11772 11773 11774 11775 11776 11777 11778 11779 11780 11781 11782 11783 11784 11785 11786 11787 11788 11789 11790 11791 11792 11793 11794 11795 11796 11797 11798 11799 11800 11801 11802 11803 11804 11805 11806 11807 11808 11809 11810 11811 11812 11813 11814 11815 11816 11817 11818 11819 11820 11821 11822 11823 11824 11825 11826 11827 11828 11829 11830 11831 11832 11833 11834 11835 11836 11837 11838 11839 11840 11841 11842 11843 11844 11845 11846 11847 11848 11849 11850 11851 11852 11853 11854 11855 11856 11857 11858 11859 11860 11861 11862 11863 11864 11865 11866 11867 11868 11869 11870 11871 11872 11873 11874 11875 11876 11877 11878 11879 11880 11881 11882 11883 11884 11885 11886 11887 11888 11889 11890 11891 11892 11893 11894 11895 11896 11897 11898 11899 11900 11901 11902 11903 11904 11905 11906 11907 11908 11909 11910 11911 11912 11913 11914 11915 11916 11917 11918 11919 11920 11921 11922 11923 11924 11925 11926 11927 11928 11929 11930 11931 11932 11933 11934 11935 11936 11937 11938 11939 11940 11941 11942 11943 11944 11945 11946 11947 11948 11949 11950 11951 11952 11953 11954 11955 11956 11957 11958 11959 11960 11961 11962 11963 11964 11965 11966 11967 11968 11969 11970 11971 11972 11973 11974 11975 11976 11977 11978 11979 11980 11981 11982 11983 11984 11985 11986 11987 11988 11989 11990 11991 11992 11993 11994 11995 11996 11997 11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061 12062 12063 12064 12065 12066 12067 12068 12069 12070 12071 12072 12073 12074 12075 12076 12077 12078 12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111 12112 12113 12114 12115 12116 12117 12118 12119 12120 12121 12122 12123 12124 12125 12126 12127 12128 12129 12130 12131 12132 12133 12134 12135 12136 12137 12138 12139 12140 12141 12142 12143 12144 12145 12146 12147 12148 12149 12150 12151 12152 12153 12154 12155 12156 12157 12158 12159 12160 12161 12162 12163 12164 12165 12166 12167 12168 12169 12170 12171 12172 12173 12174 12175 12176 12177 12178 12179 12180 12181 12182 12183 12184 12185 12186 12187 12188 12189 12190 12191 12192 12193 12194 12195 12196 12197 12198 12199 12200 12201 12202 12203 12204 12205 12206 12207 12208 12209 12210 12211 12212 12213 12214 12215 12216 12217 12218 12219 12220 12221 12222 12223 12224 12225 12226 12227 12228 12229 12230 12231 12232 12233 12234 12235 12236 12237 12238 12239 12240 12241 12242 12243 12244 12245 12246 12247 12248 12249 12250 12251 12252 12253 12254 12255 12256 12257 12258 12259 12260 12261 12262 12263 12264 12265 12266 12267 12268 12269 12270 12271 12272 12273 12274 12275 12276 12277 12278 12279 12280 12281 12282 12283 12284 12285 12286 12287 12288 12289 12290 12291 12292 12293 12294 12295 12296 12297 12298 12299 12300 12301 12302 12303 12304 12305 12306 12307 12308 12309 12310
|
<?xml version="1.0"?>
<!--
-
- $Id: main.xsl,v 1.39.2.14 2011/08/01 14:12:53 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:v="http://www.openlinksw.com/vspx/" exclude-result-prefixes="v"
xmlns:vm="http://www.openlinksw.com/vspx/weblog/"
xmlns:ods="http://www.openlinksw.com/vspx/ods/"
>
<xsl:output method="xml" indent="yes" cdata-section-elements="style" encoding="UTF-8"/>
<!-- the 'chk' is used to designate what kind of code is supposed to be generated, when is true it's for vspx
when is false it's for templates interpreter
-->
<xsl:param name="chk" select="true ()"/>
<xsl:template match="vm:page">
<!-- mandatory variables -->
<v:variable name="preview_post_id" type="int" default="0" persist="temp"/>
<v:variable name="post_to_remove" type="varchar" default="null" param-name="delete_post"/>
<v:variable name="preview_post_mode" type="int" default="0" />
<v:variable name="blogid" type="varchar" default="''"/>
<v:variable name="inst_id" type="int" default="null"/>
<v:variable name="inst_name" type="varchar" default="null"/>
<v:variable name="title" type="varchar" default="''"/>
<v:variable name="posts_sort_order" type="varchar" default="'desc'" />
<v:variable name="page" type="varchar" default="''"/>
<v:variable name="oldsid" type="varchar" default="''" persist="1"/>
<v:variable name="user_name" type="varchar" default="null"/>
<v:variable name="user_pwd" type="varchar" default="null" persist="temp"/>
<v:variable name="del_user_name" type="varchar" default="null"/>
<v:variable name="user_id" type="int" default="0"/>
<v:variable name="domain" type="varchar" default="null" persist="0"/>
<v:variable name="current_domain" type="varchar" default="null" persist="0"/>
<v:variable name="current_template" type="varchar" default="null" persist="0"/>
<v:variable name="current_css" type="varchar" default="null" persist="temp"/>
<v:variable name="mail_domain" type="varchar" default="null" persist="temp"/>
<v:variable name="template_preview_mode" type="varchar" default="null" persist="session"/>
<v:variable name="preview_template_name" type="varchar" default="null" persist="session"/>
<v:variable name="preview_css_name" type="varchar" default="null" persist="session"/>
<v:variable name="blog_access" type="int" default="0"/>
<v:variable name="current_home" type="varchar" default="''"/>
<v:variable name="_new_sid" type="varchar" default="null" persist="temp" />
<v:variable name="host" type="varchar" default="''"/>
<v:variable name="chost" type="varchar" default="''"/> <!-- CNAME of the host -->
<v:variable name="base" type="varchar" default="''"/>
<v:variable name="home" type="varchar" default="''"/>
<v:variable name="ur" type="varchar" default="''"/>
<v:variable name="email" type="varchar" default="''"/>
<v:variable name="femail" type="varchar" default="''"/>
<v:variable name="owner" type="varchar" default="null" persist="temp" />
<v:variable name="address" type="varchar" default="null" persist="temp" />
<v:variable name="owner_name" type="varchar" default="null" persist="temp" />
<v:variable name="owner_kind" type="varchar" default="'person'" persist="temp" />
<v:variable name="owner_iri" type="varchar" default="null" persist="temp" />
<v:variable name="owner_u_id" type="int" default="null" persist="temp" />
<v:variable name="authors" type="varchar" default="null" persist="temp" />
<v:variable name="src_uri1" type="varchar" default="null"/>
<v:variable name="f_cat_id" type="varchar" default="null"/>
<v:variable name="f_cat_name" type="varchar" default="''"/>
<v:variable name="data1" type="any" default="null"/>
<v:variable name="pings" type="varchar" default="''"/>
<v:variable name="hpage" type="varchar" default="''"/>
<v:variable name="cnot" type="int" default="0"/>
<v:variable name="is_blog" type="int" default="0"/>
<v:variable name="inclusion" type="int" default="1"/>
<!--v:variable name="filter" type="varchar" default="'*default*'"/-->
<v:variable name="adblock" type="any" default="null" persist="temp"/>
<v:variable name="tit" type="varchar" default="''"/>
<v:variable name="aut" type="varchar" default="''"/>
<v:variable name="mail" type="varchar" default="''"/>
<v:variable name="src_tit" type="varchar" default="''"/>
<v:variable name="src_uri" type="varchar" default="''"/>
<v:variable name="rss" type="varchar" default="''"/>
<v:variable name="xfn_words" type="varchar" default="''"/>
<v:variable name="old_rss" type="varchar" default="''"/>
<v:variable name="upd_per" type="varchar" default="null"/>
<v:variable name="upd_freq" type="varchar" default="null"/>
<v:variable name="lang" type="varchar" default="''"/>
<v:variable name="format" type="varchar" default="''"/>
<v:variable name="y" type="int" default="null"/>
<v:variable name="m" type="int" default="null"/>
<v:variable name="d" type="int" default="null"/>
<v:variable name="adays" type="any" default="null"/>
<v:variable name="fordate" type="date" default="null"/>
<v:variable name="fordate_n" type="int" default="0"/>
<v:variable name="dprev" type="date" default="null"/>
<v:variable name="dnext" type="date" default="null"/>
<v:variable name="copy" type="varchar" default="''"/>
<v:variable name="disc" type="varchar" default="''"/>
<v:variable name="about" type="varchar" default="''"/>
<v:variable name="sel_cat" type="varchar" default="''"/>
<v:variable name="postid" type="varchar" default="null"/>
<v:variable name="nuid" type="int" default="null"/>
<v:variable name="tz" type="int" default="null"/>
<v:variable name="cont" type="int" default="null"/>
<v:variable name="comm" type="int" default="null"/>
<v:variable name="tb_enable" type="int" default="null" persist="temp"/>
<v:variable name="tb_notify" type="int" default="null"/>
<v:variable name="reg" type="int" default="null"/>
<v:variable name="filt" type="varchar" default="'*default*'"/>
<v:variable name="editpost" type="varchar" default="null"/>
<v:variable name="vid" type="varchar" default="null" persist="temp" />
<v:variable name="kwd" type="varchar" default="null" persist="temp" />
<v:variable name="phome" type="varchar" default="null" persist="temp" />
<v:variable name="photo" type="varchar" default="null" persist="temp" />
<v:variable name="icon" type="varchar" default="null" persist="temp" />
<v:variable name="audio" type="varchar" default="null" persist="temp" />
<v:variable name="rssver" type="varchar" default="'2.0'" persist="temp" />
<v:variable name="atomver" type="varchar" default="'1.0'" persist="temp" />
<v:variable name="rssfile" type="varchar" default="'rss.xml'" persist="temp" />
<v:variable name="opts" type="any" default="null" persist="temp" />
<v:variable name="conv" type="int" default="null" persist="temp" />
<v:variable name="mbid" type="int" default="null" />
<v:variable name="mset" type="any" default="null" />
<v:variable name="have_comunity_blog" type="any" default="null" />
<v:variable name="cat_id" type="varchar" default="null" />
<v:variable name="pop3addr" type="varchar" default="''" persist="0"/>
<v:variable name="pop3port" type="varchar" default="'110'" persist="0"/>
<v:variable name="ping_desc" type="varchar" default="null" persist="0"/>
<v:variable name="ping_end" type="varchar" default="null" persist="0"/>
<v:variable name="ping_proto" type="varchar" default="null" persist="0"/>
<v:variable name="ping_id" type="integer" default="-1" persist="0"/>
<v:variable name="rich_mode" type="integer" default="1" persist="0"/>
<v:variable persist="temp" name="r_count" type="integer" default="0"/>
<v:variable persist="0" name="autodisc" type="any" default="null"/>
<v:variable persist="0" name="autofeed" type="any" default="null"/>
<v:variable persist="0" name="posts_to_show" type="int" default="10" param-name="dataset-n-rows">
<xsl:if test=".//vm:posts[@mode='link']">
<xsl:attribute name="default">25</xsl:attribute>
</xsl:if>
</v:variable>
<v:variable name="btn_bmk" type="varchar" default="null" />
<!-- 0 - blog, 1 - linkblog, 2 summary -->
<v:variable name="blog_view" type="int" default="0" />
<v:variable name="last_date" type="date" default="null" persist="temp"/>
<v:variable name="comments_no" type="int" default="0" persist="0"/>
<v:variable name="tb_no" type="int" default="0" persist="0"/>
<v:variable name="comment_filter" type="any" default="null" persist="0"/>
<v:variable name="login_pars" type="any" default="''" persist="0"/>
<v:variable name="edit_tag" type="any" default="null" persist="0"/>
<v:variable name="comment_vrfy_qst" type="varchar" default="null" persist="temp"/>
<v:variable name="comment_vrfy_old_resp" type="varchar" default="null" persist="0"/>
<v:variable name="comment_vrfy_resp" type="varchar" default="null" persist="0"/>
<v:variable name="fttq" type="any" default="null" />
<v:variable name="cont_edit" type="int" default="null" />
<v:variable name="keywords" type="varchar" default="''" persist="temp" />
<v:variable name="search_result" type="any" default="null" persist="temp" />
<v:variable name="catid" type="varchar" default="null" param-name="cat"/>
<v:variable name="tagid" type="varchar" default="null" param-name="tag"/>
<v:variable name="stock_img_loc" type="varchar" default="'/weblog/public/images/'"/>
<v:variable name="custom_img_loc" type="varchar" default="null"/>
<v:variable name="custom_rss" type="any" default="null" />
<v:variable name="arch_sel" type="any" default="null" param-name="arch_sel"/>
<v:variable name="arch_view" type="varchar" default="'month'" param-name="arch_view"/>
<v:variable name="show_full_post" type="int" default="0" />
<v:variable name="show_comment_input" type="int" default="0" />
<v:variable name="return_url_1" type="varchar" default="null" />
<v:variable name="return_url" type="varchar" default="null" persist="session" />
<v:variable name="temp" type="any" default="null" />
<v:variable name="user_opts" type="any" default="null" persist="temp"/>
<v:variable name="user_info" type="any" default="null" persist="temp"/>
<!-- templates related -->
<v:variable name="home_children" type="any" default="null" persist="temp" />
<v:variable name="template" type="varchar" default="null" param-name="template-name" />
<v:variable name="template_xml" type="any" default="null" persist="temp" />
<v:variable name="post_template_xml" type="any" default="null" persist="temp" />
<v:variable name="user_data" type="any" default="null" persist="temp" />
<v:variable name="temp_cat_id" type="any" default="null" persist="temp" />
<v:variable name="temp_cat_name" type="any" default="null" persist="temp" />
<v:variable name="temp_tag_id" type="any" default="null" persist="temp" />
<v:variable name="cmf_open" type="int" default="0" persist="temp" param-name="cmf"/>
<v:variable name="comm_ref" type="int" default="null" param-name="cmr"/>
<v:variable name="cm_ctr" type="int" default="0" persist="temp" />
<v:variable name="official_host" type="varchar" default="null" persist="temp" />
<v:variable name="official_host_label" type="varchar" default="null" persist="temp" />
<v:variable name="openid_identity" type="varchar" default="null" persist="temp" param-name="openid.identity"/>
<v:variable name="openid_sig" type="varchar" default="null" persist="temp" param-name="openid.sig"/>
<v:variable name="openid_key" type="varchar" default="null" persist="temp" param-name="openid.assoc_handle"/>
<v:variable name="openid_mail" type="varchar" default="null" persist="temp" param-name="openid.sreg.email"/>
<v:variable name="openid_name" type="varchar" default="null" persist="temp" param-name="openid.sreg.fullname"/>
<v:variable name="blog_iri" type="varchar" default="null" persist="temp" />
<!-- eRDF data -->
<v:variable name="e_title" type="varchar" default="null" persist="temp" />
<v:variable name="e_author" type="varchar" default="null" persist="temp" />
<v:variable name="e_lat" type="real" default="null" persist="temp" />
<v:variable name="e_lng" type="real" default="null" persist="temp" />
<v:variable name="auto_tag" type="int" default="1" persist="temp" />
<!-- end -->
<xsl:choose>
<xsl:when test="//vm:keep-variable">
<v:variable name="to_restore" type="any" default="''" param-name="rtr" persist="temp"/>
<v:variable name="rtr_vars" type="any" default="null" persist="temp" />
</xsl:when>
<xsl:otherwise>
<v:variable name="to_restore" type="any" default="''" param-name="rtr"/>
</xsl:otherwise>
</xsl:choose>
<v:variable name="welcome_msg_flag" type="int" default="0" persist="session"/>
<v:before-render>
<xsl:choose>
<xsl:when test="@stock_img_loc">
self.stock_img_loc := '<xsl:value-of select="@stock_img_loc"/>';
</xsl:when>
<xsl:otherwise>
self.stock_img_loc := '/weblog/public/images/';
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="@custom_img_loc">
self.custom_img_loc := '<xsl:value-of select="@custom_img_loc"/>';
</xsl:when>
<xsl:otherwise>
self.custom_img_loc := self.stock_img_loc;
</xsl:otherwise>
</xsl:choose>
<![CDATA[
connection_set('uid', connection_get('vspx_user'));
]]>
</v:before-render>
<v:on-init>
<![CDATA[
set http_charset='UTF-8';
-- fill in mandatory variables
self.blogid := get_keyword('blog_id', params);
declare _cookie_vec, nposts, page, visb any;
_cookie_vec := vsp_ua_get_cookie_vec(lines);
if (isnull(self.oldsid) or self.oldsid = '')
self.oldsid := coalesce(get_keyword('oldsid', self.vc_event.ve_params), self.oldsid);
self.sid := coalesce(get_keyword('sid', params), get_keyword('sid', _cookie_vec));
self.realm := get_keyword('realm', params, 'wa');
self.domain := http_map_get('vhost');
self.page := get_keyword('page', params, '');
page := get_keyword('page', params, 'index');
if (not length (page))
page := 'index';
nposts := atoi(get_keyword (page || '_nrows', _cookie_vec, '0'));
--dbg_obj_print (_cookie_vec, page || '_nrows', nposts);
if (nposts is not null and nposts > 0)
self.posts_to_show := nposts;
--dbg_obj_print (self.posts_to_show);
self.posts_sort_order := get_keyword (page || '_ord', _cookie_vec, 'desc');
if (self.page = 'linkblog')
self.blog_view := 1;
else if (self.page = 'summary')
self.blog_view := 2;
if (not self.vc_event.ve_is_post)
{
self.show_full_post := atoi (get_keyword ('blog_show_full_post', _cookie_vec, '0'));
}
self.host := http_request_header (lines, 'Host');
self.chost := wa_cname ();
self.current_domain := self.host;
if (strstr (self.host, ':'))
{
declare h any;
h := split_and_decode (self.host, 0, '\0\0:');
self.current_domain := h[0];
}
self.mail_domain := (select top 1 WS_DEFAULT_MAIL_DOMAIN from WA_SETTINGS);
if (not length (self.mail_domain))
self.mail_domain := self.current_domain;
self.base := get_keyword('detected_bi_home', params);
self.ur := 'http://' || self.host || self.base;
connection_set('blogid', self.blogid);
http_header(concat(http_header_get (), 'Content-Type: text/html; charset=utf-8\r\n'));
-- check current user access rights
declare _minutes any;
_minutes := 120;
-- 0 in no access, 1 if owner, 2 if author, 3 if can read (reader or blog is public)
self.blog_access := BLOG2_GET_ACCESS (self.blogid, self.sid, self.realm, _minutes);
self._new_sid := self.sid;
-- update sid value in 'params'
declare _idx_params, _len_params any;
_idx_params := 0;
_len_params := length(params);
while(_idx_params < _len_params)
{
if(params[_idx_params] = 'sid')
{
params[_idx_params + 1] := self.sid;
goto _ready;
}
_idx_params := _idx_params + 2;
}
_ready:
-- update sid value in browser's 'cookie' if it necessary
declare _opts any;
_opts := (select
deserialize(VS_STATE)
from
VSPX_SESSION
where
VS_SID = self.sid and
VS_REALM = self.realm);
if(_opts)
{
declare _cookie_use any;
_cookie_use := get_keyword('cookie_use', _opts, 0);
if (_cookie_use)
{
declare _exp_string, _exp_date, _header, _header_line any;
_exp_date := dateadd('month', 3, now());
_exp_string := sprintf('%s, %02d-%s-%04d 00:00:01 GMT', dayname(_exp_date), dayofmonth(_exp_date), monthname(_exp_date), year(_exp_date));
_header_line := sprintf('Set-Cookie: sid=%s; expires=%s\r\n', self.sid, _exp_string);
_header := http_header_get();
if(_header is null) {
http_header(_header_line);
}
http_header(sprintf('%s%s', _header, _header_line));
}
}
if (self.blog_access = 0 and self.page not in ('errors', 'login', 'about'))
{
declare rst any;
rst := self.save_vars (params);
self.vc_redirect (sprintf('index.vspx?page=login&requested_page=%s&reason=exp&rtr=%s', self.page, rst));
return;
}
-- get current user
self.user_name := DB.DBA.BLOG2_GET_USER_BY_SESSION(self.sid, self.realm, _minutes);
if ((self.user_name is null or self.blog_access = 0) and
self.page not in ('register', 'index', 'login', '', 'about', 'linkblog', 'summary', 'archive'))
{
declare rst any;
rst := self.save_vars (params);
if (self.blog_access = 3)
self.vc_redirect (sprintf('index.vspx?page=login&requested_page=%s&reason=exp&rtr=%s', self.page, rst));
else
self.vc_redirect (sprintf('index.vspx?page=login&requested_page=%s&reason=exp2&rtr=%s', self.page, rst));
return;
}
{
declare exit handler for not found;
select U_ID, pwd_magic_calc (U_NAME, U_PASSWORD, 1) into self.user_id, self.user_pwd
from SYS_USERS where U_NAME = self.user_name;
}
-- fill-in the common blog page variables
{
whenever not found goto not_found_2;
select
BI_TITLE,
BI_HOME,
coalesce(BI_COPYRIGHTS,''),
coalesce(BI_DISCLAIMER,''),
coalesce(BI_ABOUT, ''),
coalesce (BI_E_MAIL, U_E_MAIL),
BI_TZ,
BI_SHOW_CONTACT,
BI_SHOW_REGIST,
BI_COMMENTS,
BI_INCLUSION,
BI_FILTER,
BI_P_HOME,
BI_PHOTO,
BI_ICON,
BI_AUDIO,
BI_KEYWORDS,
BI_HOME_PAGE,
BI_COMMENTS_NOTIFY,
U_FULL_NAME,
U_NAME,
coalesce (BI_RSS_VERSION, '2.0'),
BI_TB_NOTIFY,
BI_DEL_USER,
BI_TEMPLATE,
BI_CSS,
deserialize (blob_to_string (BI_OPTIONS)),
WAI_ID,
BI_WAI_NAME,
BI_OWNER,
U_OPTS,
BI_SHOW_AS_NEWS,
BI_AUTO_TAGGING
into
self.title,
self.current_home,
self.copy,
self.disc,
self.about,
self.email,
self.tz,
self.cont,
self.reg,
self.comm,
self.inclusion,
self.filt,
self.phome,
self.photo,
self.icon,
self.audio,
self.kwd,
self.hpage,
self.cnot,
self.owner,
self.owner_name,
self.rssver,
self.tb_notify,
self.del_user_name,
self.current_template,
self.current_css,
self.opts,
self.inst_id,
self.inst_name,
self.owner_u_id,
self.user_opts,
self.conv,
self.auto_tag
from
BLOG.DBA.SYS_BLOG_INFO,
SYS_USERS,
WA_INSTANCE
where
BI_BLOG_ID = self.blogid and
BI_WAI_NAME = WAI_NAME and
BI_OWNER = U_ID with (prefetch 1);
not_found_2:;
if (self.tz is null)
self.tz := 0;
if (not (length (self.current_template)))
self.current_template := '/DAV/VAD/blog2/templates/openlink';
}
self.authors := self.owner;
-- initial eRDF values
self.e_author := self.owner;
self.e_title := self.title;
self.blog_iri := sprintf ('http://%s/dataspace/%U/weblog/%U', self.chost, self.owner_name, self.inst_name);
{
declare org_kind int;
declare exit handler for not found;
select WAUI_LAT, WAUI_LNG, WAUI_IS_ORG into self.e_lat, self.e_lng, org_kind
from DB.DBA.WA_USER_INFO where WAUI_U_ID = self.owner_u_id;
if (org_kind)
self.owner_kind := 'organization';
}
for select coalesce(U_FULL_NAME, U_NAME) as author_name
from WA_MEMBER, SYS_USERS, BLOG..SYS_BLOG_INFO where BI_WAI_NAME = WAM_INST and WAM_USER = U_ID
and WAM_MEMBER_TYPE = 2 and BI_BLOG_ID = self.blogid
do
{
self.authors := self.authors || ', ' || author_name;
}
self.rssfile := 'rss.xml';
if (self.rssver = '1.1')
self.rssfile := 'rss11.xml';
self.host := http_request_header (lines, 'Host');
if ({?'date'} is not null)
{
declare dstr any;
dstr := {?'date'};
if (dstr like '%-%-0' or dstr like '%-%-00')
{
dstr := dstr||'1';
self.fordate_n := -1;
}
self.fordate := stringdate (dstr);
}
else if (self.fordate is null)
{
if (self.blog_view = 0 or self.blog_view = 2)
{
self.fordate := coalesce ((select top 1 x.B_TS
from (select B_TS
from BLOG.DBA.SYS_BLOGS
where B_STATE = 2 and B_BLOG_ID = self.blogid
union all
select B_TS
from BLOG.DBA.SYS_BLOGS, BLOG.DBA.SYS_BLOG_ATTACHES
where BA_C_BLOG_ID = B_BLOG_ID and B_STATE = 2 and BA_M_BLOG_ID = self.blogid
) x
order by B_TS desc), self.fordate);
}
else
{
self.fordate := coalesce ((select top 1 B_TS from BLOG.DBA.SYS_BLOGS
where B_STATE = 2 and B_BLOG_ID = self.blogid and
xpath_contains (B_CONTENT,
'[__quiet BuildStandalone=ENABLE] //a[starts-with (@href,"http") and not(img)]')
order by B_TS desc), self.fordate);
}
self.fordate_n := 1;
}
if (self.fordate is null)
{
self.fordate := now ();
self.fordate_n := 1;
}
self.m := month(self.fordate);
self.y := year(self.fordate);
self.d := dayofmonth(self.fordate);
if (get_keyword ('id', params, '') <> '')
self.postid := get_keyword ('id', params);
if (self.opts is null)
self.opts := vector ();
self.tb_enable := get_keyword('EnableTrackback', self.opts, 0);
if (self.custom_rss is null)
self.custom_rss := get_keyword ('AddonRSS', self.opts,
vector (
--vector ('Virtuoso Screencast Demos', 'http://support.openlinksw.com/viewlets/virtuoso_viewlets_rss.vsp'),
--vector ('Virtuoso Tutorials', 'http://demo.openlinksw.com/tutorial/rss.vsp'),
--vector ('Virtuoso Product Blog (RSS 2.0)', 'http://www.openlinksw.com/weblogs/virtuoso/gems/rss.xml'),
--vector ('Virtuoso Product Blog (Atom)', 'http://www.openlinksw.com/weblogs/virtuoso/gems/atom.xml')
));
self.adblock := get_keyword('Adblock', self.opts);
if (self.adblock is not null)
{
declare tmp, adx any;
tmp := split_and_decode (self.adblock, 0, '\0\0,');
adx := '<ads>';
foreach (any ad in tmp) do
adx := adx || sprintf ('<ad href="%s" />', ad);
adx := adx || '</ads>';
self.adblock := vector ('adblock', xtree_doc (adx));
}
if(self.user_name and length(self.user_name) > 0)
{
declare quota int;
quota := coalesce(DB.DBA.USER_GET_OPTION(self.user_name, 'DAVQuota'), 5242880);
connection_set('DAVQuota', quota);
connection_set('DAVUserID', self.user_id);
}
self.have_comunity_blog := (select 1 from BLOG.DBA.SYS_BLOG_INFO
where BI_HAVE_COMUNITY_BLOG = 1 and BI_BLOG_ID = self.blogid);
{
declare a,b,op,res any;
randomize (msec_time ());
a := rand(9);
b := rand(9);
op := rand (3);
if (op = 0)
res := a + b;
else if (op = 1)
res := a - b;
else
res := a * b;
self.comment_vrfy_qst :=
sprintf ('%d %s %d = ', a, case op when 0 then '+' when 1 then '-' else '*' end, b);
self.comment_vrfy_old_resp := self.comment_vrfy_resp ;
self.comment_vrfy_resp := res;
}
if (self.postid is not null)
{
declare keywords any;
keywords := '';
for select distinct TT_QUERY from BLOG..SYS_BLOGS_B_CONTENT_QUERY, BLOG..MTYPE_BLOG_CATEGORY
where TT_CD = self.blogid and TT_CD = MTB_BLOG_ID and MTB_POST_ID = self.postid
and TT_PREDICATE = MTB_CID and TT_XPATH is null
do
{
keywords := keywords || TT_QUERY || ' or ';
}
if (length(keywords) > 4)
keywords := substring (keywords, 1, length (keywords) - 4);
self.keywords := keywords;
}
else if (length (self.catid))
{
declare keywords any;
keywords := '';
for select distinct TT_QUERY from BLOG..SYS_BLOGS_B_CONTENT_QUERY where TT_CD = self.blogid
and TT_PREDICATE = self.catid
and TT_XPATH is null do
{
keywords := keywords || TT_QUERY || ' or ';
}
if (length(keywords) > 4)
keywords := substring (keywords, 1, length (keywords) - 4);
self.keywords := keywords;
}
if (not length (self.keywords))
self.keywords := self.kwd;
self.atomver := get_keyword ('AtomFeedVer', self.opts, '1.0');
if (self.template is not null)
{
declare t_src, dummy any;
dummy := 0;
t_src := DB.DBA.vspx_src_get (self.template, dummy, 0);
--dbg_obj_print ('self.template=',self.template);
self.template_xml := xtree_doc (t_src);
self.post_template_xml := xpath_eval ('[ xmlns:vm="http://www.openlinksw.com/vspx/weblog/" ] //vm:posts', self.template_xml);
}
self.user_data := vector ();
if (self.user_opts is not null)
self.user_opts := deserialize (self.user_opts);
else
self.user_opts := vector ();
visb := WA_USER_VISIBILITY (self.owner_name);
self.user_info := WA_GET_USER_INFO (http_nobody_uid (), self.owner_u_id, visb, 0);
BLOG..BLOG_SET_WA_OPTS (self.owner_name, self.user_opts, self.user_info, self.opts,
self.photo, self.audio, self.owner, self.address);
self.official_host := cfg_item_value (virtuoso_ini_path (), 'URIQA', 'DefaultHost');
if (self.official_host is null or not exists (select 1 from HTTP_PATH where HP_HOST = self.official_host and HP_PPATH = self.phome))
self.official_host := '*ini*';
else if (strchr (self.official_host, ':') is null)
self.official_host := self.official_host || ':80';
self.official_host_label := self.official_host;
if (not exists (select 1 from HTTP_PATH where HP_HOST = self.official_host and HP_PPATH = self.phome))
self.official_host := '*ini*';
if (self.official_host_label = '*ini*')
self.official_host_label := sys_stat ('st_host_name') || ':' || server_http_port ();
self.owner_iri := sprintf ('http://%s/dataspace/%s/%U', self.chost, self.owner_kind, self.owner_name);
self.vc_add_attribute ('xmlns', 'http://www.w3.org/1999/xhtml');
self.vc_add_attribute ('xmlns:foaf', 'http://xmlns.com/foaf/0.1/');
self.vc_add_attribute ('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
self.vc_add_attribute ('xmlns:dct', 'http://purl.org/dc/terms/');
self.vc_add_attribute ('xmlns:rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
self.vc_add_attribute ('xmlns:rdfs', 'http://www.w3.org/2000/01/rdf-schema#');
self.vc_add_attribute ('xmlns:sioct', 'http://rdfs.org/sioc/types#');
self.vc_add_attribute ('xmlns:sioc', 'http://rdfs.org/sioc/ns#');
]]>
<xsl:if test="//vm:keep-variable">
self.restore_vars ();
</xsl:if>
</v:on-init>
<v:method name="save_vars" arglist="inout pars any">
declare var_list any;
declare rst_sid varchar;
var_list := vector (
<xsl:for-each select="//vm:keep-variable">
'<xsl:value-of select="@name"/>', get_keyword ('<xsl:value-of select="@name"/>', pars),
</xsl:for-each>
null, null
);
if (length (var_list) > 2)
{
rst_sid := vspx_sid_generate ();
insert into VSPX_SESSION (VS_SID, VS_REALM, VS_STATE, VS_EXPIRY)
values (rst_sid, 'wa-rst', serialize (var_list), now ());
commit work;
return rst_sid;
}
else
return '';
</v:method>
<xsl:if test="//vm:keep-variable">
<v:method name="restore_vars" arglist="">
declare state, val any;
if (self.to_restore is null)
{
self.rtr_vars := vector ();
return;
}
state := (select deserialize (blob_to_string (VS_STATE)) from VSPX_SESSION
where VS_REALM = 'wa-rst' and VS_SID = self.to_restore);
if (state is null)
self.rtr_vars := vector ();
else
self.rtr_vars := state;
delete from VSPX_SESSION where VS_REALM = 'wa-rst' and VS_SID = self.to_restore;
</v:method>
</xsl:if>
<?vsp
BLOG.DBA.BLOG_REFFERAL_REGISTER (self.blogid, lines, params);
?>
<v:data-source name="dss" expression-type="sql" nrows="10" initial-offset="0" >
<v:expression></v:expression>
<v:param name="bid" value="--self.blogid"/>
<v:param name="bid2" value="--self.blogid"/>
<v:param name="y" value="--self.y"/>
<v:param name="m" value="--self.m"/>
<v:param name="d" value="--self.d"/>
<v:column name="B_CONTENT" label="Content" input-format="%s" output-format="%s"/>
<v:column name="B_TS" label="Date" input-format="%s" output-format="%s"/>
<v:column name="B_POST_ID" label="Post ID" input-format="%s" output-format="%s"/>
<v:column name="comments" label="Comments" input-format="%s" output-format="%s"/>
<v:column name="trackbacks" label="TrackBacks" input-format="%s" output-format="%s"/>
<v:column name="B_USER_ID" label="AuthorID" input-format="%s" output-format="%s"/>
<v:column name="B_META" label="Meta" input-format="%s" output-format="%s"/>
<v:column name="B_MODIFIED" label="Modified" input-format="%s" output-format="%s"/>
<v:column name="B_STATE" label="Status" input-format="%d" output-format="%d"/>
<v:column name="B_TITLE" label="Title" input-format="%s" output-format="%s"/>
<v:column name="B_BLOG_ID" label="BlogId" input-format="%s" output-format="%s"/>
<v:column name="B_IS_ACTIVE" label="ActiveContent" input-format="%s" output-format="%s"/>
<v:before-data-bind>
<![CDATA[
declare arch_freq integer;
declare arch_str varchar;
arch_str := '';
-- CHECK the condition
if (self.arch_view = 'month' and length (self.arch_sel) and self.page = 'archive')
{
declare d1, d2 any;
d1 := stringdate (self.arch_sel || '-01');
d2 := dateadd ('month', 1, d1);
arch_str := sprintf (' and B_TS >= \'%s\' and B_TS < \'%s\' ',
datestring (cast (d1 as date)), datestring (cast (d2 as date)));
}
else if (self.arch_view = 'year' and length (self.arch_sel) and self.page = 'archive')
{
declare d1, d2 any;
d1 := stringdate (self.arch_sel || '-01');
d2 := dateadd ('year', 1, d1);
arch_str := sprintf (' and B_TS >= \'%s\' and B_TS < \'%s\' ',
datestring (cast (d1 as date)), datestring (cast (d2 as date)));
}
--dbg_obj_print(arch_str);
control.ds_nrows := self.posts_to_show;
self.m := month (self.fordate);
self.y := year (self.fordate);
self.d := dayofmonth (self.fordate);
self.login_pars := '';
if (length (self.sid))
self.login_pars := sprintf ('&sid=%s&realm=%s', self.sid, self.realm);
control.ds_sql_type := 'sql';
if (self.blog_view = 1)
goto new_qr;
if (length (self.catid))
self.postid := null;
if (self.postid is not null)
{
control.ds_sql := 'select B_CONTENT, B_TS, B_POST_ID, B_COMMENTS_NO as comments,
B_TRACKBACK_NO as trackbacks, B_USER_ID, B_META, B_MODIFIED, B_STATE, B_TITLE, B_BLOG_ID, B_IS_ACTIVE
from BLOG.DBA.SYS_BLOGS as item
where B_POST_ID = ?
order by B_TS asc';
control.ds_parameters := null;
control.add_parameter (self.postid);
}
else
{
new_qr:
self.postid := null;
control.ds_sql_type := 'array';
BLOG2_MAIN_PAGE_DATA (e, control, self.fordate, self.blogid,
self.have_comunity_blog, self.tz, self.fordate_n,
self.posts_sort_order, equ (self.blog_view, 1), null, self.catid,
self.tagid, arch_str);
if (length (self.catid))
{
-- TBD: find category
declare catname varchar;
catname := coalesce ((select MTC_NAME from BLOG.DBA.MTYPE_CATEGORIES
where MTC_ID = self.catid and MTC_BLOG_ID = self.blogid), '');
self.sel_cat := catname;
}
return 1;
}
]]>
</v:before-data-bind>
<v:after-data-bind>
<![CDATA[
if (self.postid is not null)
{
if(self.dss.ds_rows_fetched > 0)
{
declare meta1 any;
declare rowset any;
declare meta BLOG.DBA."MTWeblogPost";
rowset := self.dss.ds_row_data[0];
meta1 := rowset[6];
if (meta1 is not null and udt_instance_of (meta1, 'BLOG.DBA.MTWeblogPost'))
{
meta := meta1;
if (length (meta.mt_keywords))
self.kwd := concat (self.kwd, ' ', meta.mt_keywords);
}
self.e_author := (select coalesce (U_FULL_NAME, U_NAME) from SYS_USERS where U_ID = rowset[5]);
self.e_title := rowset[9];
}
}
if (self.preview_post_mode)
{
delete from
BLOG.DBA.SYS_BLOGS
where
B_BLOG_ID = self.blogid and
B_STATE = 0;
}
]]>
</v:after-data-bind>
</v:data-source>
<html>
<xsl:apply-templates/>
</html>
</xsl:template>
<xsl:template match="v:page[not @style and not @on-error-redirect][@name != 'error_page']">
<xsl:copy>
<xsl:copy-of select="@*"/>
<!--xsl:attribute name="on-error-redirect">index.vspx?page=errors</xsl:attribute-->
<!--xsl:attribute name="xml-preamble">yes</xsl:attribute-->
<xsl:if test="not (@on-deadlock-retry)">
<xsl:attribute name="on-deadlock-retry">5</xsl:attribute>
</xsl:if>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
<xsl:template match="vm:header">
<head profile="http://gmpg.org/xfn/11 http://purl.org/NET/erdf/profile http://internetalchemy.org/2003/02/profile http://www.w3.org/1999/xhtml/vocab#">
<link rel="stylesheet" href="/weblog/public/css/webdav.css" type="text/css"/>
<xsl:text> </xsl:text>
<?vsp
declare icon varchar;
if (self.icon is not null and self.icon <> '')
icon := 'images/' || self.icon;
else
icon := self.stock_img_loc || 'fav.ico';
http(sprintf('<link rel=\"shortcut icon\" href=\"%s\"/>', icon));
?>
<xsl:text> </xsl:text>
<base href="<?V case when is_https_ctx () then 'https://' else 'http://' end || self.host || http_path () ?>" /><![CDATA[<!--[if IE]></base><![endif]-->]]>
<xsl:text> </xsl:text>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<xsl:text> </xsl:text>
<![CDATA[
<script type="text/javascript" src="/weblog/public/scripts/form.js"></script>
<script type="text/javascript" src="/weblog/public/scripts/plugins.js"></script>
]]>
<xsl:apply-templates/>
<link rel="search" type="application/opensearchdescription+xml" title="OpenSearch Description" href="http://<?V self.host ?>/weblog/public/search.vspx?blogid=<?V self.blogid ?><?V '&type=text&kwds=dir&OpenSearch' ?>" />
<?vsp
foreach (any f in self.custom_rss) do
{
?>
<link rel="alternate" type="application/rss+xml" title="<?V f[0] ?>" href="<?V f[1] ?>"/>
<xsl:text> </xsl:text>
<?vsp
}
declare rdf_iri varchar;
rdf_iri := null;
if (not isnull (self.editpost))
rdf_iri := SIOC..blog_post_iri (self.blogid, self.editpost);
if (not isnull (self.postid) and not isnull(self.comm_ref))
rdf_iri := SIOC..blog_comment_iri (self.blogid, self.postid, self.comm_ref);
if (not isnull (rdf_iri))
{
SIOC..rdf_links_header (rdf_iri);
SIOC..rdf_links_head (rdf_iri);
}
?>
<![CDATA[
<script type="text/javascript">
var toolkitPath="/ods/oat";
var imagePath="/ods/images/oat/";
var featureList=["ajax", "anchor", "ghostdrag", "dav"];
</script>
<script type="text/javascript" src="/ods/oat/loader.js"></script>
<script type="text/javascript" src="/ods/app.js"></script>
<script type="text/javascript">
function weblog2Init() {
OAT.Preferences.imagePath = '/ods/images/oat/';
OAT.Anchor.imagePath = OAT.Preferences.imagePath;
OAT.Anchor.zIndex = 1001;
if (<?V DB.DBA.WA_USER_APP_ENABLE (self.owner_u_id) ?> >= 1)
generateAPP('texttd',
{ title:"Related links",
width:300,
height:200,
appActivation:"<?V case when DB.DBA.WA_USER_APP_ENABLE (self.owner_u_id) = 2 then 'hover' else 'click' end ?>",
useRDFB:<?V case when wa_check_package ('OAT') then 'true' else 'false' end ?>
}
);
}
OAT.MSG.attach(OAT, OAT.MSG.OAT_LOAD, weblog2Init);
</script>
]]>
</head>
</xsl:template>
<xsl:template match="vm:body">
<body>
<xsl:if test="@class">
<xsl:attribute name="class"><xsl:value-of select="@class" /></xsl:attribute>
</xsl:if>
<xsl:if test="@onunload">
<xsl:attribute name="onunload"><xsl:value-of select="@onunload" /></xsl:attribute>
</xsl:if>
<xsl:if test="@onload">
<xsl:attribute name="onload"><xsl:value-of select="@onload" /></xsl:attribute>
</xsl:if>
<![CDATA[
<div id="quickSub" style="position:absolute; visibility:hidden; z-index:1000;" onmouseout="return timeqs();" onmousemove="return delayqs();"></div>
]]>
<?vsp
if (self.page = 'index' or length (self.page) = 0)
{
?>
<script type="text/javascript">
<![CDATA[
window.onload = function (e)
{
var cookie = readCookie ("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet (title, 0);
}
]]>
</script>
<?vsp
}
?>
<v:form xhtml_accept-charset="utf-8" type="simple" name="page_form" method="POST" xhtml_enctype="multipart/form-data" xhtml_onsubmit="sflag=true;">
<!--input type="hidden" name="sid" value="<?vsp http(coalesce(self.sid, '')); ?>"/-->
<!--input type="hidden" name="realm" value="<?vsp http(coalesce(self.realm, '')); ?>"/-->
<input type="hidden" name="page" value="<?vsp http(coalesce(self.page, '')); ?>"/>
<v:login realm="wa" mode="url" name="login_control">
<v:before-data-bind>
<![CDATA[
-- update sid value in 'params'
declare _idx_params, _len_params any;
_idx_params := 0;
_len_params := length(params);
while(_idx_params < _len_params) {
if(params[_idx_params] = 'sid') {
params[_idx_params + 1] := self._new_sid;
goto _ready;
}
_idx_params := _idx_params + 2;
}
_ready:;
]]>
</v:before-data-bind>
<v:after-data-bind><![CDATA[
declare url_pars, url_arr any;
declare inx, len, pinx int;
url_pars := http_request_get ('QUERY_STRING');
url_arr := split_and_decode (url_pars);
len := length (url_arr);
self.return_url_1 := http_path ();
self.return_url := null;
pinx := 0;
for (inx := 0; inx < len; inx := inx + 2)
{
if (url_arr[inx] in ('sid', 'realm', 'RETURL'))
goto next_par;
if (pinx = 0)
self.return_url_1 := self.return_url_1 || '?';
else
self.return_url_1 := self.return_url_1 || '&';
self.return_url_1 := self.return_url_1 || sprintf ('%U=%U', url_arr[inx], url_arr[inx+1]);
pinx := pinx + 1;
next_par:;
}
if (pinx = 0)
self.return_url_1 := self.return_url_1 || sprintf ('?page=%U', self.page);
]]></v:after-data-bind>
</v:login>
<!-- disabled as no preview currently -->
<!--v:template name="if_preview_mode_template" type="simple" condition="(cast(self.template_preview_mode as varchar) = '1')">
<div style="position:relative;visibility:visible;z-index:200;">
<font color="black">
<table style="blank" bgcolor="lightblue" border="0" width="100%">
<tr style="blank">
<td style="blank" width="100%" align="left">
<h2 style="text-align: left;">Preview mode:</h2>
</td>
</tr>
<tr style="blank">
<td style="blank" width="100%" align="left">
<pre style="blank">
Template: <?vsp http(cast(self.preview_template_name as varchar)); ?>
CSS: <?vsp http(cast(self.preview_css_name as varchar)); ?>
</pre>
</td>
</tr>
<tr style="blank">
<td style="blank" width="100%" align="left">
<v:button xhtml_style="blank" action="simple" name="cancel_templates_preview_mode" value="Cancel Preview Mode" xhtml_title="Cancel Preview Mode" xhtml_alt="Cancel Preview Mode">
<v:on-post>
<![CDATA[
http_request_status ('HTTP/1.1 302 Found');
http_header(sprintf(
'Location: index.vspx?page=templates&sid=%s&realm=%s\r\n\r\n',
self.sid ,
self.realm));
self.template_preview_mode := NULL;
self.preview_template_name := NULL;
self.preview_css_name := NULL;
]]>
</v:on-post>
</v:button>
<v:button xhtml_style="blank" action="simple" name="apply_templates_preview_mode" value="Apply Templates Settings" xhtml_title="Apply Template Settings" xhtml_alt="Apply Template Settings">
<v:on-post>
<![CDATA[
update
BLOG.DBA.SYS_BLOG_INFO
set
BI_TEMPLATE = self.preview_template_name,
BI_CSS = self.preview_css_name
where
BI_BLOG_ID = self.blogid;
commit work;
http_request_status ('HTTP/1.1 302 Found');
http_header(sprintf(
'Location: index.vspx?page=index&sid=%s&realm=%s\r\n\r\n',
self.sid ,
self.realm));
self.template_preview_mode := NULL;
self.preview_template_name := NULL;
self.preview_css_name := NULL;
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</font>
</div>
</v:template-->
<xsl:if test="not (//ods:ods-bar)">
<ods:ods-bar app_type="WEBLOG2" show_signin="false"/>
</xsl:if>
<xsl:apply-templates/>
</v:form>
</body>
</xsl:template>
<xsl:template match="vm:page-title">
<xsl:if test="count(ancestor::vm:header)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:page-title should be placed inside vm:header only
</xsl:message>
</xsl:if>
<xsl:if test="count(@title)=0">
<xsl:message terminate="yes">
Widget vm:page-title should contain mandatory attribute - TITLE
</xsl:message>
</xsl:if>
<title>
<v:label format="%s" render-only="1">
<xsl:attribute name="value"><xsl:apply-templates select="@title" mode="static_value"/></xsl:attribute>
</v:label>
</title>
</xsl:template>
<xsl:template match="vm:stylesheet-switcher">
<v:variable name="ask_text" type="varchar" default="''" persist="temp"/>
<v:before-render>
<xsl:if test="@ask-text">
self.ask_text := '<xsl:value-of select="@ask-text"/>';
</xsl:if>
<xsl:if test="not @ask-text">
self.ask_text := 'Remember my choice';
</xsl:if>
</v:before-render>
<div>
<select name="style_selector" onchange="">
<xsl:if test="@sticky = 'yes'">
<xsl:attribute name="onchange">setActiveStyleSheet(this.value, 1);return false;</xsl:attribute>
</xsl:if>
<xsl:if test="not @sticky">
<xsl:attribute name="onchange">setActiveStyleSheet(this.value, 1);return false;</xsl:attribute>
</xsl:if>
<xsl:if test="@sticky = 'no'">
<xsl:attribute name="onchange">setActiveStyleSheet(this.value, 0);return false;</xsl:attribute>
</xsl:if>
<xsl:if test="@sticky = 'ask'">
<xsl:attribute name="onchange">setActiveStyleSheet(this.value, 0);return false;</xsl:attribute>
</xsl:if>
<?vsp
declare cur_template, cur_css, cur_home varchar;
declare col_id int;
cur_template := self.current_template;
cur_css := self.current_css;
cur_home := self.current_home;
if (cur_template is null or cur_template = '')
cur_template := '/DAV/VAD/blog2/templates/openlink';
if (cur_css is null or cur_css = '')
cur_css := '/DAV/VAD/blog2/templates/openlink/default.css';
declare cur, cur_title varchar;
set isolation='committed';
col_id := DAV_SEARCH_ID (cur_template || '/', 'C');
for select RES_FULL_PATH from WS.WS.SYS_DAV_RES where RES_COL = col_id and RES_NAME like '*.css' do
{
if (RES_FULL_PATH like '/DAV/VAD/blog2/templates/%')
{
cur := subseq(RES_FULL_PATH, length('/DAV/VAD/blog2/templates/'));
cur := '/weblog/templates/' || cur;
cur_title := subseq(cur, strrchr(cur, '/') + 1, strrchr(cur, '.'));
}
else
{
cur := left(cur_template, strrchr(cur_template, '/'));
cur := replace(RES_FULL_PATH, cur, cur_home || 'templates');
cur_title := subseq(cur, strrchr(cur, '/') + 1, strrchr(cur, '.'));
}
if (cur is not null and cur_title is not null and cur <> '' and cur_title <> '')
http(sprintf('<option value="%s">%s</option>', cur_title, cur_title));
}
set isolation='uncommitted';
?>
</select>
</div>
<xsl:if test="@sticky = 'ask'">
<div>
<input type="checkbox" name="save_sticky" id="save_sticky" value="Save cookie"><label for="save_sticky"><?V self.ask_text ?></label></input>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="vm:blog-title">
<xsl:processing-instruction name="vsp">
{
declare url varchar;
url := get_keyword ('url', self.user_data, '<xsl:value-of select="@url"/>');
</xsl:processing-instruction>
<?vsp
if (length (url))
{
?>
<v:url name="url_{generate-id()}" value="--self.title" format="%s" url="--url" xhtml_class="title_link" render-only="1" xhtml_property="dc:title"/>
<?vsp
}
else
{
?>
<v:label name="label_{generate-id()}" value="--self.title" format="%s" render-only="1"/>
<?vsp
}
?>
<xsl:processing-instruction name="vsp">
}
</xsl:processing-instruction>
</xsl:template>
<xsl:template match="vm:title">
<?vsp http (self.e_title); ?>
</xsl:template>
<xsl:template match="vm:quicksub">
</xsl:template>
<xsl:template match="vm:disco-rss-link">
<xsl:if test="count(ancestor::vm:header)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:disco-rss-link should be placed inside vm:header only
</xsl:message>
</xsl:if>
<link rel="alternate" type="application/rss+xml" title="<?V BLOG..blog_utf2wide (self.title) ?> RSS" href="<?vsp http (sprintf ('http://%s%sgems/%s', self.host, self.base, self.rssfile)); ?>"/>
<xsl:text> </xsl:text>
<link rel="meta" type="application/rdf+xml" title="<?V BLOG..blog_utf2wide (self.title) ?> RDF" href="<?vsp http (sprintf ('http://%s%sgems/index.rdf', self.host, self.base)); ?>"/>
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="vm:disco-atom-link">
<link rel="alternate" type="application/atom+xml" title="<?V BLOG..blog_utf2wide (self.title) ?> Atom" href="<?vsp http (sprintf ('http://%s%sgems/atom.xml', self.host, self.base)); ?>"/>
<xsl:text> </xsl:text>
<link rel="alternate" type="application/atomserv+xml" title="<?V BLOG..blog_utf2wide (self.title) ?> Atom" href="<?vsp http (sprintf ('http://%s/Atom/%s/intro', self.host, self.blogid)); ?>"/>
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="vm:disco-pingback-link">
<xsl:if test="count(ancestor::vm:header)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:disco-pingback-link should be placed inside vm:header only
</xsl:message>
</xsl:if>
<link rel="pingback" href="<?vsp http (sprintf ('http://%s/mt-tb', self.host)); ?>"/>
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="vm:disco-comments-link">
<xsl:if test="count(ancestor::vm:header)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:disco-comments-link should be placed inside vm:header only
</xsl:message>
</xsl:if>
<?vsp if (self.postid is not null) { ?>
<link rel="service.comment" type="text/xml" href="<?vsp http (sprintf ('http://%s/mt-tb/Http/comments?id=%s', self.host, self.postid)); ?>" title="Comment Interface" />
<xsl:text> </xsl:text>
<?vsp } ?>
</xsl:template>
<xsl:template match="vm:disco-foaf-link">
<xsl:if test="count(ancestor::vm:header)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:disco-foaf-link should be placed inside vm:header only
</xsl:message>
</xsl:if>
<link rel="meta" type="application/rdf+xml" title="FOAF" href="<?vsp http (self.owner_iri || '/about.rdf'); ?>" />
<xsl:text> </xsl:text>
<link rel="meta" type="application/rdf+xml" title="FOAF" href="<?vsp http (sprintf ('http://%s%sgems/foaf%s.xml', self.host, self.base, case when self.have_comunity_blog then '-members' else '' end)); ?>" />
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="vm:disco-rsd-link">
<xsl:if test="count(ancestor::vm:header)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:disco-rsd-link should be placed inside vm:header only
</xsl:message>
</xsl:if>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="<?vsp http (sprintf ('http://%s%sgems/rsd.xml', self.host, self.base)); ?>" />
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="vm:disco-opml-link">
<xsl:if test="count(ancestor::vm:header)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:disco-opml-link should be placed inside vm:header only
</xsl:message>
</xsl:if>
<?vsp
for select BCC_ID, BCC_NAME from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY
where BCC_BLOG_ID = self.blogid
and exists (select 1 from BLOG.DBA.SYS_BLOG_CHANNELS where BC_CAT_ID = BCC_ID)
order by lower (BCC_NAME)
do {
?>
<link rel="subscriptions" type="text/x-opml" title="<?V BCC_NAME ?>" href="<?vsp http(sprintf ('http://%s%sgems/opml.xml?:c=%d', self.host, self.base, BCC_ID)); ?>"/>
<?vsp
}
?>
<xsl:text> </xsl:text>
</xsl:template>
<!-- local feed gems -->
<xsl:template name="feed-image">
<xsl:attribute name="hspace">3</xsl:attribute>
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="@image">
<?vsp
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
?>
</xsl:when>
<xsl:otherwise>
<?vsp
http(self.custom_img_loc || <xsl:value-of select="$default"/>);
?>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:template>
<xsl:template match="vm:gdata-link">
<div>
<a href="<?vsp http (sprintf ('http://%s/GData/%s', self.host, self.blogid)); ?>" class="{local-name()}">
<img border="0" alt="GData" title="GData" >
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'blue-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
</xsl:template>
<xsl:template match="vm:sioc-link">
<div>
<?vsp
{
declare id_part, suff varchar;
id_part := '';
suff := 'rdf';
if (self.postid is not null)
id_part := self.postid || '/';
?>
<xsl:if test="@format">
<xsl:processing-instruction name="vsp">
suff := '<xsl:value-of select="@format"/>';
</xsl:processing-instruction>
</xsl:if>
<a href="<?vsp http (sprintf ('http://%s/dataspace/%U/weblog/%U/%ssioc.%s', self.chost, self.owner_name, self.inst_name, id_part, suff)); ?>" class="{local-name()}">
<img border="0" alt="SIOC" title="SIOC" >
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'rdf-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
<?vsp
}
?>
</div>
</xsl:template>
<xsl:template match="vm:rss-link">
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/%s', self.host, self.base, self.rssfile)); ?>" class="{local-name()}">
<img border="0" alt="RSS" title="RSS" >
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'rss-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
</xsl:template>
<xsl:template match="vm:rss-usm-link">
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/rss-usm.xml', self.host, self.base)); ?>" class="{local-name()}">
<img border="0" alt="RSS (USM)" title="RSS (USM)" >
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'rss-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
</xsl:template>
<xsl:template match="vm:podcast-link">
<?vsp
{
declare tp, text varchar;
tp := '';
?>
<xsl:choose>
<xsl:when test="@type">
<xsl:variable name="val">get_keyword ('type', self.user_data, <xsl:apply-templates select="@type" mode="static_value"/>)</xsl:variable>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="val">''</xsl:variable>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="@text">
<xsl:variable name="txt">get_keyword ('text', self.user_data, <xsl:apply-templates select="@text" mode="static_value"/>)</xsl:variable>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="txt">''</xsl:variable>
</xsl:otherwise>
</xsl:choose>
<xsl:processing-instruction name="vsp">
text := <xsl:value-of select="$txt"/>;
tp := <xsl:value-of select="$val"/>;
if (length (tp))
tp := '?:media=' || tp;
</xsl:processing-instruction>
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/podcasts.xml%s', self.host, self.base, tp)); ?>" class="{local-name()}">
<img border="0" alt="Podcasts" title="Podcasts" >
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'rss-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<?V text ?>
</a>
</div>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:itunes-link">
<?vsp
{
declare tp varchar;
tp := '';
?>
<xsl:if test="@type">
<xsl:variable name="type">?:media=<xsl:value-of select="@type"/></xsl:variable>
<xsl:processing-instruction name="vsp">
tp := '<xsl:value-of select="$type"/>';
</xsl:processing-instruction>
</xsl:if>
<div>
<a href="<?vsp http (sprintf ('pcast://%s%sgems/podcasts.xml%s', self.host, self.base, tp)); ?>" class="{local-name()}">
<img border="0" alt="iTunes" title="iTunes" >
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'rss-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:mrss-link">
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/mrss.xml', self.host, self.base)); ?>" class="{local-name()}">
<img border="0" alt="Podcasts" title="Podcasts" >
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'rss-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
</xsl:template>
<xsl:template match="vm:atom-link">
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/atom%s.xml', self.host, self.base, '')); ?>" class="{local-name()}">
<img border="0" alt="ATOM" title="ATOM">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'atom-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
</xsl:template>
<xsl:template match="vm:geo-link">
<!--div>
<a href="http://geourl.org/near?p=<?U sprintf ('http://%s%s', self.host, self.base) ?>" class="{local-name()}">
<xsl:apply-templates />
</a>
</div-->
</xsl:template>
<xsl:template match="vm:rdf-link">
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/index.rdf', self.host, self.base)); ?>" class="{local-name()}">
<img border="0" alt="RDF" title="RDF">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'rdf-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
</xsl:template>
<xsl:template match="vm:linkblog-rss-link">
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/rss-linkblog.xml', self.host, self.base)); ?>" class="{local-name()}">
<img border="0" alt="RSS" title="RSS">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'rss-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
</xsl:template>
<xsl:template match="vm:linkblog-atom-link">
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/atom-linkblog.xml', self.host, self.base)); ?>" class="{local-name()}">
<img border="0" alt="ATOM" title="ATOM">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'atom-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
</xsl:template>
<xsl:template match="vm:linkblog-rdf-link">
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/index-linkblog.rdf', self.host, self.base)); ?>" class="{local-name()}">
<img border="0" alt="RDF" title="RDF">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'rdf-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
</xsl:template>
<xsl:template match="vm:ocs-link">
<?vsp
if (get_keyword('ShowOCS', self.opts, 1))
{
?>
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/index.ocs', self.host, self.base)); ?>" class="{local-name()}">
<img border="0" alt="OCS" title="OCS">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'blue-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:opml-link">
<?vsp
if (get_keyword('ShowOPML', self.opts, 1))
{
?>
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/index.opml', self.host, self.base)); ?>" class="{local-name()}">
<img border="0" alt="OPML" title="OPML">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'blue-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:xbel-link">
<?vsp
if (get_keyword('ShowXBEL', self.opts, 1))
{
declare d1, d2, s1, s2 any;
d1 := stringdate (sprintf ('%i-%i-%i', year (self.fordate), month (self.fordate), dayofmonth (self.fordate)));
d2 := dateadd('day', 1, d1);
s1 := sprintf ('%04d-%02d-%02d', year (d1), month (d1), dayofmonth (d1));
s2 := sprintf ('%04d-%02d-%02d', year (d2), month (d2), dayofmonth (d2));
?>
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/xbel.xml?:from=%s&amp;amp;:to=%s', self.host, self.base, s1, s2)); ?>" class="{local-name()}">
<img border="0" alt="XBEL" title="XBEL">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'blue-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:foaf-link"><!--
<?vsp if (self.have_comunity_blog is null or self.have_comunity_blog = 0) { ?>
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/blogroll.rdf', self.host, self.base)); ?>" class="{local-name()}">
<img border="0" alt="FOAF" title="FOAF">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'foaf.png'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
<?vsp } ?>
--></xsl:template>
<xsl:template match="vm:ods-foaf-link">
<div>
<?vsp
{
declare sne_id int;
sne_id := (select sne_id from sn_person where sne_name = self.owner_name);
?>
<a href="<?vsp http (self.owner_iri || '/about.rdf'); ?>" class="{local-name()}">
<img border="0" alt="FOAF" title="FOAF">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'foaf.png'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
<?vsp
}
?>
</div>
</xsl:template>
<xsl:template match="vm:disco-ods-sioc-link">
<?vsp
declare id_part varchar;
id_part := '';
if (self.postid is not null)
id_part := self.postid || '/';
?>
<link rel="meta" type="application/rdf+xml" title="SIOC" href="<?vsp http (replace (sprintf ('http://%s/dataspace/%U/weblog/%U/%ssioc.rdf', self.chost, self.owner_name, self.inst_name, id_part), '+', '%2B')); ?>" />
</xsl:template>
<xsl:template match="vm:linkblog-xbel-link">
<?vsp
if (get_keyword('ShowXBEL', self.opts, 1))
{
declare dat varchar;
dat := '';
if (self.fordate_n = 0)
{
dat := sprintf ('%i-%i-%i', year (self.fordate), month (self.fordate), dayofmonth (self.fordate));
}
?>
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/xbel-linkblog.xml?:top=%d&:offs=%d&:dat=%s&:ord=%s&:comm=%d', self.host, self.base, self.dss.ds_nrows, self.dss.ds_rows_offs, dat, self.posts_sort_order, coalesce (self.have_comunity_blog, 0))); ?>" class="{local-name()}">
<img border="0" alt="XBEL" title="XBEL">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'blue-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:summary-xbel-link">
<?vsp
if (get_keyword('ShowXBEL', self.opts, 1))
{
declare i int;
declare arr, parr any;
arr := self.dss.ds_row_data;
parr := make_array (length (arr), 'any');
i := 0;
foreach (any row in arr) do
{
parr [i] := row[2];
i := i + 1;
}
parr := encode_base64(serialize (parr));
?>
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/xbel-summary.xml?:posts=%U', self.host, self.base, parr)); ?>" class="{local-name()}">
<img border="0" alt="XBEL" title="XBEL">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'blue-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:summary-opml-link">
<?vsp
if (get_keyword('ShowOPML', self.opts, 1))
{
declare i int;
declare arr, parr any;
arr := self.dss.ds_row_data;
parr := make_array (length (arr), 'any');
i := 0;
foreach (any row in arr) do
{
parr [i] := row[2];
i := i + 1;
}
parr := encode_base64(serialize (parr));
?>
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/opml-summary.xml?:posts=%U', self.host, self.base, parr)); ?>" class="{local-name()}">
<img border="0" alt="OPML" title="OPML">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'blue-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:summary-ocs-link">
<?vsp
if (get_keyword('ShowOCS', self.opts, 1))
{
declare i int;
declare arr, parr any;
arr := self.dss.ds_row_data;
parr := make_array (length (arr), 'any');
i := 0;
foreach (any row in arr) do
{
parr [i] := row[2];
i := i + 1;
}
parr := encode_base64(serialize (parr));
?>
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/ocs-summary.xml?:posts=%U', self.host, self.base, parr)); ?>" class="{local-name()}">
<img border="0" alt="OCS" title="OCS">
<xsl:call-template name="feed-image">
<xsl:with-param name="default">'blue-icon-16.gif'</xsl:with-param>
</xsl:call-template>
</img>
<xsl:apply-templates />
</a>
</div>
<?vsp
}
?>
</xsl:template>
<!-- end feed links -->
<xsl:template match="vm:subscribe">
<v:form type="simple" method="POST" name="subscribe">
<div id="error_subscribe">
<v:error-summary match="email2" />
</div>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">
E-Mail:
</td>
</tr>
<tr>
<td width="100%">
<v:text xhtml_class="textbox" error-glyph="*" xhtml_style="width: 100%" name="email2" value="" xhtml_size="10">
<v:validator test="regexp" regexp="[^@]+@([^\.]+.)*[^\.]+" message="Invalid e-mail address" />
</v:text>
</td>
<td>
<v:button xhtml_class="real_button" action="simple" value="OK" name="bsubscribe" xhtml_title="OK" xhtml_alt="OK">
<v:on-post>
<![CDATA[
declare vid varchar;
vid := uuid ();
insert replacing BLOG.DBA.SYS_BLOG_VISITORS (BV_ID, BV_BLOG_ID, BV_E_MAIL, BV_IP, BV_NOTIFY, BV_VIA_DOMAIN)
values (vid, self.blogid, self.email2.ufl_value, http_client_ip (), 1, self.host);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:ocs|vm:opml">
<?vsp
{
?>
<xsl:choose>
<xsl:when test="local-name () = 'opml'">
<?vsp declare ty any; ty := 'OPML'; ?>
</xsl:when>
<xsl:when test="local-name () = 'ocs'">
<?vsp declare ty any; ty := 'OCS'; ?>
</xsl:when>
</xsl:choose>
<?vsp
for select coalesce(BC_TITLE, '') title, BC_RSS_URI rss from BLOG.DBA.BLOG_CHANNELS
where BC_BLOG_ID = self.blogid and length (BC_RSS_URI) and BC_HOME_URI is null and
BC_FORM = ty order by lcase(BC_TITLE) do
{
?>
<div>
<a class="button" href="<?V rss ?>">
<?vsp http(title); ?>
</a>
</div>
<div style="margin-left:1em;">
<?vsp
for select BC_TITLE, BC_HOME_URI, BC_RSS_URI from BLOG.DBA.BLOG_CHANNELS
where BC_BLOG_ID = self.blogid and BC_SOURCE = rss order by lcase(BC_TITLE) do
{
?>
<div>
<a class="smallfeedlink" href="<?V BC_RSS_URI ?>">XML</a>
<a href="<?V BC_HOME_URI ?>"><?vsp http (BC_TITLE); ?></a>
</div>
<?vsp
}
?>
</div>
<?vsp
}
}
?>
</xsl:template>
<xsl:template match="vm:categories">
<div class="roll">
<div>
<a href="<?vsp http(sprintf('index.vspx?page=%s%s', self.page, self.login_pars)); ?>">
ALL
</a>
</div>
<?vsp
if (self.have_comunity_blog is not NULL)
{
for select MTC_ID as id, MTC_NAME as name from BLOG.DBA.MTYPE_CATEGORIES as category,
(select BI_BLOG_ID as BA_C_BLOG_ID, BI_BLOG_ID as BA_M_BLOG_ID from BLOG..SYS_BLOG_INFO where BI_BLOG_ID = self.blogid
union all select BA_C_BLOG_ID, BA_M_BLOG_ID from BLOG.DBA.SYS_BLOG_ATTACHES where BA_M_BLOG_ID = self.blogid
) name2
where MTC_BLOG_ID = BA_C_BLOG_ID and (MTC_SHARED = 1 or MTC_BLOG_ID = self.blogid) order by lcase(MTC_NAME)
do
{
?>
<div>
<a href="gems/rss_cat.xml?:cid=<?V id ?>&amp;amp;:bid=<?V self.blogid ?>" class="inlinelink"><img src="/weblog/public/images/rss-icon-16.gif" border="0" alt="RSS" title="RSS"/></a> <a class="inlinelink" href="<?vsp http(sprintf('index.vspx?page=%s&amp;amp;cat=%s%s', self.page, id, self.login_pars)); ?>"><?V BLOG..blog_utf2wide(name) ?></a>
</div>
<?vsp
}
}
else
{
for select MTC_ID as id, MTC_NAME as name from BLOG.DBA.MTYPE_CATEGORIES as category
where MTC_BLOG_ID = self.blogid order by lcase(MTC_NAME)
do
{
?>
<div>
<a href="gems/rss_cat.xml?:cid=<?V id ?>&amp;amp;:bid=<?V self.blogid ?>" class="inlinelink"><img src="/weblog/public/images/rss-icon-16.gif" border="0" alt="RSS" title="RSS"/></a>
<a class="inlinelink" href="<?vsp http(sprintf('index.vspx?page=%s&amp;amp;cat=%s%s', self.page, id, self.login_pars)); ?>"><?V BLOG..blog_utf2wide(name) ?></a>
</div>
<?vsp
}
}
?>
</div>
</xsl:template>
<xsl:template match="vm:linkblog-url">
<?vsp
{
declare ent any;
ent := control.te_rowset[0];
ent := xtree_doc (ent);
xml_tree_doc_set_output (ent, 'xhtml');
xml_tree_doc_set_ns_output (ent, 1);
http_value (ent);
}
?>
</xsl:template>
<xsl:template match="vm:linkblog-cat">
<?vsp
declare categories varchar;
categories := '';
for select MTC_NAME as cat_name, MTC_ID as cat_id from BLOG..MTYPE_BLOG_CATEGORY, BLOG..MTYPE_CATEGORIES
where MTC_ID = MTB_CID and MTB_BLOG_ID = MTC_BLOG_ID and MTC_BLOG_ID = self.blogid and MTB_POST_ID =
t_post_id do
{
categories := categories || ' ' || cat_name;
}
?>
<a href="index.vspx?id=<?V t_post_id ?>"><?V categories ?></a>
</xsl:template>
<xsl:template match="vm:linkblog-categories">
<?vsp
for select MTC_NAME as cat_name, MTC_ID as cat_id from BLOG..MTYPE_BLOG_CATEGORY, BLOG..MTYPE_CATEGORIES
where MTC_ID = MTB_CID and MTB_BLOG_ID = MTC_BLOG_ID and MTC_BLOG_ID = self.blogid and MTB_POST_ID =
control.te_rowset[2] do
{
self.temp_cat_id := cat_id;
self.temp_cat_name := cat_name;
?>
<xsl:apply-templates />
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:linkblog-category">
<a href="index.vspx?page=<?V self.page ?>&cat=<?V self.temp_cat_id ?><?V self.login_pars ?>"><?V self.temp_cat_name ?></a>
</xsl:template>
<xsl:template match="vm:linkblog-tags">
<?vsp
for select BT_TAG from BLOG..BLOG_POST_TAGS_STAT where postid = control.te_rowset[2]
do
{
self.temp_tag_id := BT_TAG;
?>
<xsl:apply-templates />
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:linkblog-tag">
<a href="index.vspx?page=<?V self.page ?>&tag=<?V self.temp_tag_id ?><?V self.login_pars ?>"><?V self.temp_tag_id ?></a>
</xsl:template>
<xsl:template match="vm:linkblog-links">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="vm:group-heading|vm:summary-group-heading|vm:archive-group-heading">
<?vsp
declare curt any;
curt := control.te_rowset[1];
if (self.last_date is null or BLOG..not_same_day (self.last_date, curt))
{
self.last_date := curt;
self.temp := sprintf ('%s %d, %d', monthname (curt), dayofmonth (curt), year (curt));
?>
<xsl:apply-templates />
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:date">
<?V self.temp ?>
</xsl:template>
<xsl:template match="vm:summary-post-header">
<?vsp {
http (sprintf ('%02d:%02d ',hour (control.te_rowset[1]), minute(control.te_rowset[1])));
if (self.have_comunity_blog)
{
set isolation = 'uncommitted';
declare author, ref1, email any;
author := '';
ref1 := '';
whenever not found goto nfuser;
select coalesce (U_FULL_NAME, U_NAME), BI_E_MAIL, BI_HOME into author, email, ref1 from
BLOG.DBA.SYS_BLOG_INFO, SYS_USERS where BI_OWNER = control.te_rowset[5]
and U_ID = BI_OWNER;
nfuser:
?>
<a href="index.vspx?<?V trim(self.login_pars, '&') ?>"><?vsp http(author); ?></a>
<?vsp
http (':');
}
declare tit, url any;
tit := control.te_rowset[9];
tit := charset_recode (xpath_eval ('string(//*|.)', xtree_doc (tit, 2, '', 'UTF-8')), '_WIDE_', 'UTF-8');
url := concat(self.blog_iri, '/', control.te_rowset[2]);
?>
<v:url name="sum_post_iri" value="--tit" url="--url" render-only="1" is-local="1" format="%s"/>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:summary-post">
<?vsp
{
declare ent, ent1, txt, ses, rep any;
txt := control.te_rowset[0];
txt := blob_to_string (txt);
rep := regexp_match ('<script[^<]+playEnclosure[^<]+</script>', txt);
if (rep is not null)
txt := replace (txt, rep, '');
ent := xtree_doc (concat('<div>', txt, '</div>'), 2, '', 'UTF-8');
txt := xpath_eval ('string (.)', ent);
ses := string_output ();
http_value (txt, null, ses);
ses := string_output_string (ses);
ent := substring (ses, 1, 100);
http (ent);
if (length (ent) = 100)
http ('...');
}
?>
</xsl:template>
<xsl:template match="vm:summary-post-tags">
<div class="tags">
<?vsp
declare cinx int;
cinx := 0;
for select BT_TAG from BLOG..BLOG_POST_TAGS_STAT where postid = t_post_id
do
{
if (cinx > 0)
http ('|');
else
http ('with tags:');
http (sprintf (' <a href="index.vspx?page=summary&tag=%s%s">%s</a> ',
BT_TAG, self.login_pars, BT_TAG));
cinx := cinx + 1;
}
?>
</div>
<div class="tags" >
<?vsp
cinx := 0;
for select MTB_CID, MTC_NAME from BLOG..MTYPE_BLOG_CATEGORY, BLOG..MTYPE_CATEGORIES
where MTB_CID = MTC_ID and MTC_BLOG_ID = MTB_BLOG_ID and MTC_BLOG_ID = control.te_rowset[10] and MTB_POST_ID = t_post_id do
{
if (cinx > 0)
http ('|');
else
http ('under category:');
http (sprintf (' <a href="index.vspx?page=summary&cat=%s%s">%s</a> ',
MTB_CID, self.login_pars, MTC_NAME));
cinx := cinx + 1;
}
?>
</div>
<div class="tags" >
<?vsp
cinx := 0;
for select BT_TAG from BLOG..BLOG_POST_TAGS_STAT where postid = t_post_id
do
{
if (cinx > 0)
http ('|');
else
http ('On del.icio.us:');
http (sprintf (' <a href="http://del.icio.us/tag/%U">%s</a> ', BT_TAG, BT_TAG));
cinx := cinx + 1;
}
?>
</div>
<div class="tags">
<?vsp
cinx := 0;
for select BT_TAG from BLOG..BLOG_POST_TAGS_STAT where postid = t_post_id
do
{
if (cinx > 0)
http ('|');
else
http ('On technorati:');
http (sprintf (' <a href="http://www.technorati.com/tag/%U">%s</a> ', BT_TAG, BT_TAG));
cinx := cinx + 1;
}
?>
</div>
</xsl:template>
<!-- TODO: check if the parent is vm:posts -->
<xsl:template name="post-parts-check">
<!--xsl:if test="not ancestor::vm:posts[not (@mode)]">
<xsl:message terminate="yes">The <xsl:value-of select="local-name()" />
must be an descendant of the vm:posts widget
</xsl:message>
</xsl:if-->
</xsl:template>
<xsl:template match="vm:post-anchor">
<xsl:call-template name="post-parts-check"/>
<a id="post_anchor<?vsp http_value (control.te_rowset[2]); ?>" name="<?vsp http_value (control.te_rowset[2]); ?>" class="noapp"><xsl:value-of select="@title" /></a>
</xsl:template>
<xsl:template match="vm:post-state">
<xsl:call-template name="post-parts-check"/>
<?vsp
if(self.blog_access in (1, 2)) {
?>
<span class="state-mark"><v:label name="label36" value="--case when (control.vc_parent as vspx_row_template).te_rowset[8] = 1 then 'Draft' when (control.vc_parent as vspx_row_template).te_rowset[8] = 2 then 'Public' else 'Preview' end" render-only="1" format="{@format}"/></span>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:post-link">
<xsl:call-template name="post-parts-check"/>
<v:url name="permalink_url" value="{@title}" format="%s" url="--concat(self.blog_iri, '/', t_post_id)" render-only="1" is-local="1"/>
</xsl:template>
<xsl:template match="vm:post-link-uri">
<xsl:call-template name="post-parts-check"/>
<v:url name="permalink_url_text" value="--concat(self.blog_iri, '/', t_post_id)" format="%s" url="--concat(self.blog_iri, '/', t_post_id)" render-only="1" is-local="1"/>
</xsl:template>
<xsl:template match="vm:post-delicious-link">
<a href="http://del.icio.us/post?url=<?U self.ur ?><?U sprintf ('?id=%s', t_post_id) ?>&amp;amp;title=<?vsp http(control.te_rowset[9]); ?>" class="spread_link">
<img src="/weblog/public/images/delicious.gif" alt="{@title}" title="{@title}" border="0" hspace="1" />
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template match="vm:post-delicious-btn">
<?vsp
{
declare tags varchar;
tags := coalesce((select BT_TAGS from BLOG..BLOG_TAG where BT_BLOG_ID = control.te_rowset[10] and BT_POST_ID = t_post_id), '');
tags := replace (tags, ',', ' ');
?>
<img src="/weblog/public/images/add_delicious.jpg" onclick="<?V sprintf ('javascript:dbt_bookmark ("%V", "%V")', control.te_rowset[9], tags) ?>" alt="{@title}" title="{@title}" border="0" hspace="1" />
<xsl:apply-templates/>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:post-technorati-link">
<a href="http://technorati.com/cosmos/search.html?url=<?U self.ur ?><?U sprintf ('?id=%s', t_post_id) ?>" class="spread_link">
<img src="/weblog/public/images/technorati.gif" alt="{@title}" title="{@title}" border="0" hspace="1" />
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template match="vm:post-diggit-link">
<a href="http://www.digg.com/submit?url=<?U self.ur ?><?U sprintf ('?id=%s', t_post_id) ?>&amp;amp;phase=2" class="spread_link">
<img src="/weblog/public/images/digman.gif" alt="{@title}" title="{@title}" border="0" hspace="1" />
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template match="vm:post-reddit-link">
<a href="http://reddit.com/submit?url=<?U self.ur ?><?U sprintf ('?id=%s', t_post_id) ?>&amp;amp;title=<?vsp http(control.te_rowset[9]); ?>" class="spread_link">
<img src="/weblog/public/images/reddithead.png" alt="{@title}" title="{@title}" border="0" hspace="1" />
<xsl:apply-templates/>
</a>
</xsl:template>
<xsl:template match="vm:post-tweet-link">
<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal"
data-url="<?V self.ur ?>?id=<?V t_post_id ?>">Tweet</a>
<![CDATA[<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>]]>
</xsl:template>
<xsl:template match="vm:post-date">
<xsl:call-template name="post-parts-check"/>
<span class="dc-date" property="dct:created">
<v:label name="label6" value="--BLOG..blog_date_fmt ((control.vc_parent as vspx_row_template).te_rowset[1], self.tz)" format="%s" render-only="1"/>
</span>
</xsl:template>
<xsl:template match="vm:post-modification-date">
<xsl:call-template name="post-parts-check"/>
<xsl:variable name="val">get_keyword ('title', self.user_data, <xsl:apply-templates select="@title" mode="static_value"/>)</xsl:variable>
<?vsp
if (datediff('second', control.te_rowset[1], control.te_rowset[7]))
{ ?>
<xsl:processing-instruction name="vsp">http_value (<xsl:value-of select="$val"/>);</xsl:processing-instruction>
<span property="dct:modified">
<v:label name="label6_mod"
value="--BLOG..blog_date_fmt ((control.vc_parent as vspx_row_template).te_rowset[7], self.tz)"
format='<span class="modified-date">%s</span>'
render-only="1"/>
</span>
<xsl:call-template name="apply-or-return" />
<?vsp } ?>
</xsl:template>
<xsl:template match="vm:post-author">
<xsl:call-template name="post-parts-check"/>
<span class="dc-creator" property="dc:creator">
<?vsp
{
declare title_val any;
declare author, ref1, email any;
set isolation = 'uncommitted';
author := '';
email := '';
ref1 := '';
title_val := '';
if (1 or self.have_comunity_blog)
{
declare auth_name, auth_iri, auth_pers_iri any;
declare exit handler for not found;
select U_FULL_NAME, BI_E_MAIL, BI_HOME, U_NAME into author, email, ref1, auth_name from
BLOG.DBA.SYS_BLOG_INFO, SYS_USERS where BI_OWNER = control.te_rowset[5] and U_ID = BI_OWNER;
if (author = '' or author is null)
author := email;
if (author <> '')
{
auth_iri := sioc.DBA.user_obj_iri (auth_name);
auth_pers_iri := sioc.DBA.person_iri (auth_iri);
title_val := charset_recode ('<a rel="foaf:maker" rev="foaf:made" href="' || auth_pers_iri || '">' ||
sprintf('%V', author) || '</a>', 'UTF-8', '');
}
}
if (title_val <> '')
http (title_val);
}
?>
</span>
</xsl:template>
<xsl:template match="vm:post-author-nick">
<xsl:call-template name="post-parts-check"/>
<span class="dc-creator" property="dc:creator">
<?vsp
{
declare title_val any;
set isolation = 'uncommitted';
declare auth_name, auth_iri, auth_pers_iri any;
declare exit handler for not found;
select U_NAME into auth_name from BLOG.DBA.SYS_BLOG_INFO, SYS_USERS where BI_OWNER = control.te_rowset[5] and U_ID = BI_OWNER;
auth_iri := sioc.DBA.user_obj_iri (auth_name);
auth_pers_iri := sioc.DBA.person_iri (auth_iri);
title_val := charset_recode ('<a rel="foaf:maker" rev="foaf:made" href="' || auth_pers_iri || '">' ||
sprintf('%V', auth_name) || '</a>', 'UTF-8', '');
http (title_val);
}
?>
</span>
</xsl:template>
<xsl:template match="vm:post-body">
<xsl:call-template name="post-parts-check"/>
<?vsp
if (self.blog_view = 0)
http(BLOG..BLOG2_POST_RENDER (control.te_rowset[0], self.filt, control.te_rowset[5],
self.adblock, control.te_rowset[11], 1));
?>
</xsl:template>
<xsl:template match="vm:enclosure">
<?vsp
declare meta BLOG..MWeblogPost;
meta := control.te_rowset[6];
if (meta is not null and meta.enclosure is not null)
{
declare encl BLOG.DBA."MWeblogEnclosure";
encl := meta.enclosure;
?>
<script type="text/javascript">
playEnclosure ("<?V encl.url ?>", "<?V t_post_id ?>", 320, 240, "");
</script>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:trackback-discovery">
<?vsp http (BLOG..MT_TRACKBACK_DISCO (t_post_id,
self.current_home, control.te_rowset[1], control.te_rowset[9])); ?>
</xsl:template>
<xsl:template name="apply-or-return">
<xsl:choose>
<xsl:when test="$chk">
<xsl:apply-templates />
</xsl:when>
<xsl:otherwise>
<?vsp
return 1;
?>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="apply-or-call">
<xsl:choose>
<xsl:when test="$chk">
<xsl:apply-templates />
</xsl:when>
<xsl:otherwise>
<xsl:processing-instruction name="vsp">
BLOG.DBA.template_repeater_render (self, control, t_post_id, t_comm, t_tb, '<xsl:value-of select="local-name()"/>');
</xsl:processing-instruction>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="vm:post-enclosure">
<xsl:call-template name="post-parts-check"/>
<xsl:variable name="val">get_keyword ('title', self.user_data, <xsl:apply-templates select="@title" mode="static_value"/>)</xsl:variable>
<?vsp
declare meta BLOG..MWeblogPost;
meta := control.te_rowset[6];
if (meta is not null and meta.enclosure is not null)
{
declare encl BLOG.DBA."MWeblogEnclosure";
encl := meta.enclosure;
?>
<xsl:processing-instruction name="vsp">http_value (<xsl:value-of select="$val"/>);</xsl:processing-instruction>
<a href="<?V encl.url ?>" target="_blank"><img border="0" src="/weblog/public/images/enclosure.gif" title="Enclosure" alt="Enclosure" /></a>
<xsl:call-template name="apply-or-return" />
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:post-title">
<xsl:call-template name="post-parts-check"/>
<span class="dc-title" property="dc:title">
<?vsp
http (control.te_rowset[9]);
?>
</span>
</xsl:template>
<xsl:template match="vm:post-comments">
<xsl:call-template name="post-parts-check"/>
<xsl:variable name="val">get_keyword ('title', self.user_data, <xsl:apply-templates select="@title" mode="static_value"/>)</xsl:variable>
<xsl:variable name="fmt">--cast(get_keyword ('format', self.user_data, <xsl:apply-templates select="@format" mode="static_value"/>) as varchar)</xsl:variable>
<?vsp if (self.comm or gt(t_comm, 0)) { ?>
<xsl:processing-instruction name="vsp">http_value (<xsl:value-of select="$val"/>);</xsl:processing-instruction>
<v:url name="comment_url" value="--t_comm" format="{$fmt}" url="--concat('index.vspx?page=', self.page, '&id=', t_post_id, '&cmf=1#comments')" render-only="1" />
<xsl:call-template name="apply-or-return" />
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:post-trackbacks">
<xsl:call-template name="post-parts-check"/>
<xsl:variable name="val">get_keyword ('title', self.user_data, <xsl:apply-templates select="@title" mode="static_value"/>)</xsl:variable>
<xsl:variable name="fmt">--cast(get_keyword ('format', self.user_data, <xsl:apply-templates select="@format" mode="static_value"/>) as varchar)</xsl:variable>
<?vsp
if (self.tb_enable or gt (t_tb, 0))
{
?>
<xsl:processing-instruction name="vsp">http_value (<xsl:value-of select="$val"/>);</xsl:processing-instruction>
<v:url name="trackback_url" value="--t_tb" format="{$fmt}" url="--concat('index.vspx?page=', self.page, '&id=', t_post_id, '#trackback')" render-only="1" />
<xsl:call-template name="apply-or-return" />
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:post-actions">
<xsl:call-template name="post-parts-check"/>
<?vsp
if (BLOG2_GET_ACCESS (t_blog_id, self.sid, self.realm, 120) in (1, 2))
{
?>
<v:url name="edit1" value="Edit" url="--concat('index.vspx?page=edit_post&editid=', t_post_id)" render-only="1" />
<xsl:text> </xsl:text>
<v:url name="delete1" value="Delete" url="--concat('index.vspx?delete_post=', t_post_id)" render-only="1" />
<xsl:text> </xsl:text>
<v:url name="show_log1" value="Log" url="--concat('index.vspx?page=routing_queue&post_id=', t_post_id)" render-only="1" />
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:micropost-actions">
<xsl:call-template name="post-parts-check"/>
<?vsp
if (BLOG2_GET_ACCESS (t_blog_id, self.sid, self.realm, 120) in (1, 2))
{
?>
<v:url name="delete1" value="Delete" url="--concat('index.vspx?delete_post=', t_post_id)" render-only="1" />
<xsl:text> </xsl:text>
<v:url name="show_log1" value="Log" url="--concat('index.vspx?page=routing_queue&post_id=', t_post_id)" render-only="1" />
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:post-categories">
<xsl:variable name="val">get_keyword ('title', self.user_data, <xsl:apply-templates select="@title" mode="static_value"/>)</xsl:variable>
<xsl:variable name="delm">get_keyword ('delimiter', self.user_data, <xsl:apply-templates select="@delimiter" mode="static_value"/>)</xsl:variable>
<?vsp {
declare cinx int;
cinx := 0;
for select MTC_NAME, MTC_ID from BLOG.DBA.MTYPE_CATEGORIES, BLOG.DBA.MTYPE_BLOG_CATEGORY
where MTB_BLOG_ID = MTC_BLOG_ID and MTB_CID = MTC_ID and MTC_BLOG_ID = control.te_rowset[10]
and MTB_POST_ID = t_post_id
do
{
if (cinx = 0)
{
?><xsl:processing-instruction name="vsp">http_value (<xsl:value-of select="$val"/>);</xsl:processing-instruction><?vsp
}
else
{ ?><xsl:processing-instruction name="vsp">http_value (<xsl:value-of select="$delm"/>);</xsl:processing-instruction><?vsp
}
?>
<span class="dc-subject" property="dc:subject">
<a href="index.vspx?cat=<?vsp http (MTC_ID); ?><?V self.login_pars ?>" rel="category"><?vsp http (MTC_NAME); ?></a>
</span>
<?vsp
cinx := cinx + 1;
}
if (cinx)
{
?>
<xsl:call-template name="apply-or-return" />
<?vsp
}
} ?>
</xsl:template>
<xsl:template match="vm:post-tags">
<xsl:call-template name="post-parts-check"/>
<xsl:variable name="val">get_keyword ('title', self.user_data, <xsl:apply-templates select="@title" mode="static_value"/>)</xsl:variable>
<xsl:variable name="delm">get_keyword ('delimiter', self.user_data, <xsl:apply-templates select="@delimiter" mode="static_value"/>)</xsl:variable>
<?vsp {
declare cinx, mode, this_url int;
cinx := 0;
this_url := BLOG.DBA.EXPAND_URL ('index.vspx');
for select BT_TAG from BLOG..BLOG_POST_TAGS_STAT_2 where
postid = t_post_id and blogid = control.te_rowset[10] do
{
if (cinx = 0)
{
?><xsl:processing-instruction name="vsp">http_value (<xsl:value-of select="$val"/>);</xsl:processing-instruction><?vsp
}
else
{ ?><xsl:processing-instruction name="vsp">http_value (<xsl:value-of select="$delm"/>);</xsl:processing-instruction><?vsp }
?>
<span class="dc-subject" property="dc:subject">
<a href="<?V self.blog_iri ?>/tag/<?vsp http (BT_TAG); ?><?V case when length (self.login_pars) then concat ('?', ltrim (self.login_pars, '&')) else '' end ?>" rel="tag"><?vsp http (BT_TAG); ?></a>
</span>
<!--a href="http://technorati.com/tag/<?vsp http (BT_TAG); ?>" rel="tag"><?vsp http (BT_TAG); ?></a-->
<?vsp
cinx := cinx + 1;
}
if (cinx)
{
?>
<xsl:call-template name="apply-or-return" />
<?vsp
}
} ?>
</xsl:template>
<xsl:template match="vm:archive-post">
<div class="<?V case when self.show_full_post then 'message' else 'post-excerpt' end ?>" >
<?vsp
{
if (self.show_full_post)
{
http(BLOG..BLOG2_POST_RENDER (control.te_rowset[0], self.filt, control.te_rowset[5], self.adblock,
control.te_rowset[11], 1));
}
else
{
declare ent, ent1, txt, ses, rep any;
txt := blob_to_string (control.te_rowset[0]);
rep := regexp_match ('<script[^<]+playEnclosure[^<]+</script>', txt);
if (rep is not null)
txt := replace (txt, rep, '');
ent := xtree_doc (concat('<div>', txt, '</div>'), 2, '', 'UTF-8');
txt := xpath_eval ('string (.)', ent);
ses := string_output ();
http_value (txt, null, ses);
ses := string_output_string (ses);
ent := substring (ses, 1, 100);
http (ent);
if (length (ent) = 100)
http ('...');
}
}
?>
</div>
</xsl:template>
<xsl:template match="vm:archive-post-title">
<a name="<?V t_post_id ?>"><![CDATA[ ]]></a>
<vm:summary-post-header />
<?vsp if ((t_comm + t_tb) > 0) { ?>
(<v:label name="cm_l" value="--t_comm" format="%d comments" render-only="1"/>,
<v:label name="tb_l" value="--t_tb" format="%d trackbacks" render-only="1"/>)
<?vsp } ?>
</xsl:template>
<!-- end of posts properties -->
<xsl:template match="vm:posts">
<v:data-set name="posts" scrollable="1" edit="1" data-source="self.dss" nrows="10" enabled="--isnull (self.post_to_remove)">
<!--v:template name="template1" type="simple" condition="self.sel_cat is not null">
<div class="posts-title">
<?vsp
if (self.page <> 'archive')
{
if (self.blog_view = 0)
{
http(case when self.sel_cat <> '' then sprintf('Showing posts in category %V', self.sel_cat) else 'Showing posts in all categories' end);
}
?>
<?vsp
}
if (self.page <> 'archive') {
http (' ');
?>
<v:button name="refr1" style="image" action="simple" url="--sprintf ('index.vspx?page=%U%s', self.page, case when self.postid is not null then sprintf ('&amp;amp;id=%s', self.postid) else '' end)" value="/weblog/public/images/ref_16.png" xhtml_hspace="1" xhtml_alt="Refresh" xhtml_title="Refresh" text="Refresh" />
<?vsp
}
?>
</div>
</v:template-->
<v:template name="template2" type="repeat">
<v:template name="template7" type="if-not-exists">
<div class="widget-title">
<v:label name="nexist" value="--(case when (self.cat_id is null or length(self.cat_id) = 0) then 'No posts found' else 'No posts found within category ' || self.sel_cat || '.' end)" format="%s"/>
</div>
</v:template>
<v:template name="template4" type="browse">
<?vsp
declare t_post_id, t_comm, t_tb, t_blog_id any;
t_post_id := control.te_rowset[2];
t_comm := cast (control.te_rowset[3] as float);
t_tb := cast (control.te_rowset[4] as float);
t_blog_id := control.te_rowset[10];
if(control.te_rowset[8] = 2 or self.blog_access in (1, 2))
{
?>
<div id="post-<?V t_post_id ?>">
<xsl:choose>
<xsl:when test="//vm:body-wrapper">
<?vsp
BLOG.DBA.template_post_render (self, control, t_post_id, t_comm, t_tb);
?>
</xsl:when>
<xsl:when test="*">
<xsl:apply-templates />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="posts-default"/>
</xsl:otherwise>
</xsl:choose>
</div>
<?vsp
}
?>
</v:template>
</v:template>
<v:template type="simple" name="posts_nav" >
<!-- XXX: make dynamic -->
<xsl:choose>
<xsl:when test="@mode = 'link'">
<tr>
<td colspan="3">
<vm:ds-navigation data-set="posts"/>
</td>
</tr>
</xsl:when>
<xsl:otherwise>
<div>
<vm:ds-navigation data-set="posts"/>
</div>
</xsl:otherwise>
</xsl:choose>
</v:template>
</v:data-set>
<vm:post-remove/>
</xsl:template>
<xsl:template match="vm:post-remove">
<v:form name="post_remove" type="simple" method="POST" action="" enabled="--equ(isnull (self.post_to_remove), 0)">
<div>
<h3 style="align: left">Post remove confirmation</h3>
<table>
<tr>
<td>
<b>
<?vsp
declare title varchar;
declare comments_no int;
select B_TITLE, B_COMMENTS_NO
into title, comments_no
from BLOG.DBA.SYS_BLOGS
where (BLOG2_GET_ACCESS (B_BLOG_ID, self.sid, self.realm, 120) in (1, 2)) and B_POST_ID = self.post_to_remove;
http(sprintf('You are about to delete post titled \"%s\". The post has %d comments.<br/>
This operation will delete the post and all comments to it and cannot be undone.<br/>
Hit \"Delete\" to proceed with deletion, or \"Cancel\" to go back.', title, comments_no));
?>
</b>
</td>
</tr>
<tr>
<td>
<v:button xhtml_class="real_button" action="simple" name="rem_post" value="Delete" xhtml_title="Delete" xhtml_alt="Delete">
<v:on-post>
<![CDATA[
commit work;
declare exit handler for sqlstate '*'
{
self.vc_is_valid := 0;
self.channel_to_remove := null;
self.vc_error_message := concat(__SQL_STATE,' ',__SQL_MESSAGE);
rollback work;
return;
};
delete
from BLOG.DBA.SYS_BLOGS
where (BLOG2_GET_ACCESS (B_BLOG_ID, self.sid, self.realm, 120) in (1, 2)) and
B_POST_ID = self.post_to_remove;
self.post_to_remove := null;
self.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
<v:button xhtml_class="real_button" action="simple" name="cancel_post_remove" value="Cancel" xhtml_title="Cancel" xhtml_alt="Cancel">
<v:on-post>
<![CDATA[
self.post_to_remove := null;
self.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</div>
</v:form>
</xsl:template>
<xsl:template match="vm:sort-options">
<xsl:if test="count(//vm:posts)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:sort-options should be used together with vm:posts on the same page
</xsl:message>
</xsl:if>
<v:template name="sort_options" type="simple" enabled="1">
<v:template name="template_view_opts" type="simple" condition="self.postid is null">
<div>
<v:text name="v_n_blog_rows" value="--self.posts.ds_nrows" xhtml_size="6" xhtml_class="textbox">
<v:before-render>
if (self.vc_is_valid)
control.ufl_value := self.posts.ds_nrows;
</v:before-render>
<v:validator name="v_n_blog_rows_v1" test="regexp" regexp="[1-9][0-9]*" />
</v:text>
articles per page.
</div>
<div>
<v:select-list name="v_sort_order" xhtml_class="select" value="--self.posts_sort_order">
<v:item name="descending" value="desc" />
<v:item name="ascending" value="asc" />
</v:select-list> order.
</div>
<div>
<v:button xhtml_class="real_button" name="view_changes_post" value="Set" action="simple" xhtml_title="Set" xhtml_alt="Set">
<v:on-post>
<![CDATA[
declare _nrows, _ord, lpath any;
declare page, expires, cook_str any;
{
declare exit handler for sqlstate '*' {
_nrows := 0;
};
_nrows := cast(self.v_n_blog_rows.ufl_value as integer);
}
if(_nrows < 1 or _nrows > 1000) {
self.vc_error_message := sprintf ('The value you entered, %d, for the number of articles per page is out of the required range. Valid values are between 1 and 1000.', _nrows);
self.vc_is_valid := 0;
return;
}
_ord := self.v_sort_order.ufl_value;
self.dss.ds_nrows := _nrows;
self.posts.ds_nrows := _nrows;
self.posts_to_show := _nrows;
self.posts_sort_order := _ord;
self.dss.vc_data_bind (e);
self.posts.vc_reset ();
self.posts.vc_data_bind (e);
-- Set cookie
page := self.page;
if (not length (page))
page := 'index';
lpath := http_map_get ('domain');
expires := date_rfc1123 (dateadd ('month', 1, now()));
cook_str := sprintf ('Set-Cookie: %s_nrows=%d; path=%s; expires=%s;\r\n', page, _nrows, lpath, expires);
cook_str := cook_str||sprintf ('Set-Cookie: %s_ord=%s; path=%s; expires=%s;\r\n', page, _ord, lpath, expires);
http_header (concat (http_header_get (), cook_str));
]]>
</v:on-post>
</v:button>
<v:button xhtml_class="real_button" name="view_changes_reset" value="Reset" action="simple" xhtml_title="Reset" xhtml_alt="Reset">
<v:on-post>
<![CDATA[
declare page, expires, cook_str, _nrows, lpath any;
_nrows := case when self.page = 'linkblog' then 25 else 10 end;
self.v_n_blog_rows.ufl_value := _nrows;
self.posts_sort_order := 'desc';
self.v_sort_order.vc_data_bind (e);
self.v_n_blog_rows.vc_data_bind (e);
self.posts_to_show := _nrows;
self.dss.vc_data_bind (e);
self.posts.vc_reset ();
self.posts.vc_data_bind (e);
self.vc_data_bind (e);
-- Set cookie
page := self.page;
if (not length (page))
page := 'index';
lpath := http_map_get ('domain');
expires := date_rfc1123 (dateadd ('month', 1, now()));
cook_str := sprintf ('Set-Cookie: %s_nrows=%d; path=%s; expires=%s;\r\n', page, _nrows, lpath, expires);
cook_str := cook_str||sprintf ('Set-Cookie: %s_ord=desc; path=%s; expires=%s;\r\n', page, lpath, expires);
http_header (concat (http_header_get (), cook_str));
]]>
</v:on-post>
</v:button>
</div>
</v:template>
</v:template>
</xsl:template>
<xsl:template match="vm:babel-fish">
<?vsp
if (get_keyword('ShowFish', self.opts))
{
?>
<![CDATA[
<script type="text/javascript" language="JavaScript1.2" src="http://www.altavista.com/static/scripts/translate_engl.js"></script>
]]>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:powered-by">
<a href="http://www.openlinksw.com/virtuoso/">
<img alt="Powered by OpenLink Virtuoso Universal Server" border="0">
<xsl:if test="@image">
<xsl:attribute name="src"><?vsp
if (self.custom_img_loc)
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
else
http(self.stock_img_loc || 'PoweredByVirtuoso.gif');
?></xsl:attribute>
</xsl:if>
<xsl:if test="not @image">
<xsl:attribute name="src"><?vsp http(self.stock_img_loc || 'PoweredByVirtuoso.gif'); ?></xsl:attribute>
</xsl:if>
</img>
</a>
<?vsp
http(sprintf('<br/>Running on %s platform<br/>', sys_stat('st_build_opsys_id')));
?>
</xsl:template>
<xsl:template match="vm:custom-style">
<xsl:if test="count(ancestor::vm:header)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:custom-style should be placed inside vm:header only
</xsl:message>
</xsl:if>
<link href="<?vsp http(sprintf('%s', get_keyword('css_name', params))); ?>" rel="stylesheet" type="text/css" media="screen" title="<?vsp declare cur varchar; cur := get_keyword('css_name', params); http(subseq(cur, strrchr(cur, '/') + 1, strrchr(cur, '.'))); ?>"/>
<?vsp
declare cur_template, cur_css, cur_home varchar;
declare col_id int;
cur_template := self.current_template;
cur_css := self.current_css;
cur_home := self.current_home;
if (cur_template is null or cur_template = '')
cur_template := '/DAV/VAD/blog2/templates/openlink';
if (cur_css is null or cur_css = '')
cur_css := '/DAV/VAD/blog2/templates/openlink/default.css';
declare cur, cur_title varchar;
set isolation='committed';
col_id := DAV_SEARCH_ID (cur_template || '/', 'C');
for select RES_FULL_PATH from WS.WS.SYS_DAV_RES where RES_COL = col_id and RES_NAME like '*.css' do
{
if (RES_FULL_PATH <> cur_css)
{
if (RES_FULL_PATH like '/DAV/VAD/blog2/templates/%')
{
cur := subseq(RES_FULL_PATH, length('/DAV/VAD/blog2/templates/'));
cur := '/weblog/templates/' || cur;
cur_title := subseq(cur, strrchr(cur, '/') + 1, strrchr(cur, '.'));
}
else
{
cur := left(cur_template, strrchr(cur_template, '/'));
cur := replace(RES_FULL_PATH, cur, cur_home || 'templates');
cur_title := subseq(cur, strrchr(cur, '/') + 1, strrchr(cur, '.'));;
}
if (cur is not null and cur_title is not null and cur <> '' and cur_title <> '')
http(sprintf('<link rel="alternate stylesheet" title="%s" href="%s" type="text/css" media="screen" />',
cur_title, cur));
}
}
set isolation='uncommitted';
?>
</xsl:template>
<xsl:template match="vm:style">
<xsl:if test="count(ancestor::vm:header)=0">
<xsl:message terminate="yes">
Widget vm:style should be placed inside vm:header only
</xsl:message>
</xsl:if>
<xsl:choose>
<xsl:when test="@url">
<link rel="stylesheet" type="text/css" media="screen" title="default">
<xsl:attribute name="href">
<xsl:value-of select="@url"/>
</xsl:attribute>
</link>
</xsl:when>
<xsl:otherwise>
<style>
<xsl:value-of select="."/>
</style>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="vm:disclaimer">
<v:label value="--self.disc" format="%s"/>
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="vm:copyright">
<v:label value="--self.copy" format="%s"/>
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="vm:blog-about">
<v:label value="--self.about" format="%s" />
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="vm:e-mail">
<vm:if test="email">
<a rel="foaf:mbox" href="mailto:<?V self.email ?>">
<img border="0" alt="E-mail">
<xsl:if test="@image">
<xsl:attribute name="src"><?vsp
if (self.custom_img_loc)
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
else
http(self.stock_img_loc || 'email2.gif');
?></xsl:attribute>
</xsl:if>
<xsl:if test="not @image">
<xsl:attribute name="src"><?vsp http(self.stock_img_loc || 'email2.gif'); ?></xsl:attribute>
</xsl:if>
</img>
</a>
</vm:if>
</xsl:template>
<xsl:template match="vm:amazon-wishlist-display">
<?vsp if (get_keyword('AmazonID', self.opts, '') <> '') { ?>
<vm:if test="amazon">
<![CDATA[
<script src="http://kalsey.com/tools/amazon/wishlist/<?V concat('http://www.amazon.com/exec/obidos/registry/', get_keyword('AmazonID', self.opts, '')) ?>" language="JavaScript" type="text/javascript"></script>
]]>
</vm:if>
<?vsp } ?>
</xsl:template>
<xsl:template match="vm:etray-ads">
<vm:if test="ebay">
<?vsp
if (get_keyword('EbayID', self.opts, '') <> '' and get_keyword('EbayID', self.opts) is not null)
{
?>
<![CDATA[
<script src='http://etrays.net/cgi-bin/etray.py?site=.com&category=51148&min-price=50&max-price=100&max=7&enable-style=on&font=Tahoma%2C%20sans-serif&time-color=red&title-color=lightblue&border-color=%23555555&background=%23eeeeee÷r-color=lightblue&width=170&pid=<?V get_keyword('EbayID', self.opts) ?>&build=Build%20It...'></script>
]]>
<?vsp
}
?>
</vm:if>
</xsl:template>
<xsl:template match="vm:google-ads">
<vm:if test="google">
<?vsp
if (get_keyword('GoogleAdsenseID', self.opts, '') <> '')
{
?>
<![CDATA[
<script type="text/javascript">
<!--
google_ad_client = "<?V get_keyword('GoogleAdsenseID', self.opts) ?>";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
google_ad_channel = "";
google_color_border = "B4D0DC";
google_color_bg = "ECF8FF";
google_color_link = "0000CC";
google_color_url = "008000";
google_color_text = "6F6F6F";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
]]>
<?vsp
}
?>
</vm:if>
</xsl:template>
<xsl:template match="vm:about-me">
<div typeof="foaf:Person" about="<?V self.owner_iri ?>#this">
<div>
<vm:photo width="64"/>
</div>
<div property="foaf:name">
<vm:if test="name">
<?vsp
http_value (self.owner);
?>
</vm:if>
</div>
<div>
<vm:if test="loc">
<?vsp
http_value (self.address);
?>
</vm:if>
</div>
<div>
<vm:e-mail/>
</div>
<div>
<vm:amazon-wishlist/>
</div>
<!--div>
<vm:if test="bio">
<?vsp
http(get_keyword('Biography', self.opts));
?>
</vm:if>
</div-->
<div>
<vm:audio/>
</div>
<vm:ods-foaf-link>FOAF</vm:ods-foaf-link>
<?vsp
if (self.e_lat is not null and self.e_lng is not null and exists (select 1 from ODS..SVC_HOST, ODS..APP_PING_REG where SH_NAME = 'GeoURL' and AP_HOST_ID = SH_ID and AP_WAI_ID = self.inst_id)) {
?>
<vm:geo-link><img src="http://i.geourl.org/geourl.png" border="0"/></vm:geo-link>
<?vsp } ?>
<div>
<v:url name="full_profile" value="Full profile"
url="--self.owner_iri"
render-only="1"
is-local="1"
xhtml_rel="rdfs:seeAlso"
/>
</div>
</div>
</xsl:template>
<xsl:template match="vm:amazon-wishlist">
<vm:if test="amazon">
<a class="button" href="<?V concat('http://www.amazon.com/exec/obidos/registry/', get_keyword('AmazonID', self.opts, '')) ?>">
<img border="0" alt="Amazon Wish List">
<xsl:if test="@image">
<xsl:attribute name="src"><?vsp
if (self.custom_img_loc)
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
else
http(self.stock_img_loc || 'amazon21.gif');
?></xsl:attribute>
</xsl:if>
<xsl:if test="not @image">
<xsl:attribute name="src"><?vsp http(self.stock_img_loc || 'amazon21.gif'); ?></xsl:attribute>
</xsl:if>
</img>
</a>
</vm:if>
</xsl:template>
<xsl:template match="vm:entry-list">
<?vsp
declare arr any;
declare i, l int;
arr := self.dss.ds_row_data;
l := self.dss.ds_rows_fetched;
i := 1;
while (i <= l)
{
http (sprintf ('<a href="#%s">%d</a>', arr[i-1][2], i));
if (i < l)
http (' | ');
i := i + 1;
}
?>
</xsl:template>
<xsl:template match="vm:last-messages">
<xsl:if test="not @rows">
<xsl:variable name="rows_count">15</xsl:variable>
</xsl:if>
<xsl:if test="@rows">
<xsl:variable name="rows_count" select="@rows"/>
</xsl:if>
<xsl:variable name="redirect">self.page</xsl:variable>
<ul class="last-messages">
<xsl:processing-instruction name="vsp">
if (self.have_comunity_blog is null)
{
for select top <xsl:value-of select="$rows_count"/> B_POST_ID id, B_TITLE title from BLOG.DBA.SYS_BLOGS message where B_STATE = 2 and B_BLOG_ID = self.blogid order by B_TS desc do
{
declare tit any;
tit := title;
if (title is not null)
tit := xpath_eval('string(//*|.)', xml_tree_doc(xml_tree(tit, 2, '', 'UTF-8')), 1);
</xsl:processing-instruction>
<li>
<v:url name="lm1" value="--tit" url="--concat (self.blog_iri, '/', id)" render-only="1" format="%V" is-local="1"
xhtml_rel="sioc:container_of"
/>
</li>
<?vsp
}
}
else
{
?>
<xsl:processing-instruction name="vsp">
for select top <xsl:value-of select="$rows_count"/> B_POST_ID id, B_TITLE title from BLOG.DBA.SYS_BLOGS , (select BI_BLOG_ID as BA_C_BLOG_ID, BI_BLOG_ID as BA_M_BLOG_ID from BLOG..SYS_BLOG_INFO where BI_BLOG_ID = self.blogid union all select * from (select top <xsl:value-of select="$rows_count"/> BA_C_BLOG_ID, BA_M_BLOG_ID from BLOG.DBA.SYS_BLOG_ATTACHES where BA_M_BLOG_ID = self.blogid order by BA_LAST_UPDATE desc) name1) name2 where B_BLOG_ID = BA_C_BLOG_ID and B_STATE = 2 order by B_TS desc do
{
declare tit any;
tit := title;
if (title is not null)
tit := xpath_eval ('string(//*|.)', xml_tree_doc (xml_tree (tit, 2, '', 'UTF-8')), 1);
</xsl:processing-instruction>
<li>
<v:url name="lm2" value="--tit" url="--concat (self.blog_iri, '/', id)" render-only="1" format="%s" is-local="1"/>
</li>
<?vsp
}
}
?>
</ul>
</xsl:template>
<xsl:template match="vm:summary-view">
<v:template name="post_summary" type="simple" condition="self.postid is null">
<xsl:apply-templates />
</v:template>
</xsl:template>
<xsl:template match="vm:technorati-search">
<v:form type="simple" method="POST" name="find_technocrati" action="http://www.technorati.com/cosmos/search.html">
<v:text xhtml_size="10" name="url" value="" xhtml_maxlength="255"/>
<v:button name="techno_Submit" action="simple" value="Submit">
<v:on-post>
<![CDATA[
http_request_status ('HTTP/1.1 302 Found');
http_header (sprintf ('Location: http://www.technorati.com/cosmos/search.html?sub=searchlet&url=%U&\r\n\r\n', self.url.ufl_value));
]]>
</v:on-post>
</v:button>
</v:form>
</xsl:template>
<xsl:template match="vm:amazon-search">
<v:form type="simple" method="POST" name="amazon_search" enabled="--get_keyword('ShowAmazonSearch', self.opts, 0)">
<table class="normal" border="0" cellpadding="0" cellspacing="0">
<tr>
<td style="background-color:#fff;">
<table border="0" cellpadding="0" cellspacing="0" align="top" height="90" width="120" style="border: 1px solid #000000 !important;">
<tr>
<td style="background-color:#fff;" height="20" valign="bottom" align="center">
<span style="font-family: verdana,arial,helvetica,sans-serif; font-size:10px !important; font-weight:bold !important;">Search Now:</span>
</td>
<td style="background-color:#fff;">
</td>
</tr>
<tr>
<td style="background-color:#fff;" align="center" height="30" valign="top">
<v:text xhtml_size="10" name="keyword" value=""/>
</td>
<td style="background-color:#fff;" height="20" valign="top" align="left">
<v:button name="Submit" action="simple" style="image"
value="http://g-images.amazon.com/images/G/01/associates/build-links/ap-search-go-btn.gif"
xhtml_alt="Go"
xhtml_title="Go" xhtml_width="21" xhtml_height="21" xhtml_align="absmiddle" xhtml_border="0">
<v:on-post>
<![CDATA[
http_request_status ('HTTP/1.1 302 Found');
http_header (sprintf ('Location: http://www.amazon.com/exec/obidos/external-search?mode=blended&tag=blog02-20&keyword=%U\r\n\r\n', self.keyword.ufl_value));
]]>
</v:on-post>
</v:button>
</td>
</tr>
<tr>
<td colspan="2" style="background-color:#000;" height="40">
<a href="http://www.amazon.com/exec/obidos/redirect-home/blog02-20">
<img src="http://g-images.amazon.com/images/G/01/associates/build-links/ap-search-logo-126x32.gif" height="36" border="0" width="126" />
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:if">
<v:template type="simple">
<xsl:attribute name="name">if_<xsl:value-of select="generate-id()" /></xsl:attribute>
<xsl:choose>
<xsl:when test="starts-with (@test, 'not-')">
<xsl:variable name="modifier">not </xsl:variable>
<xsl:variable name="test"><xsl:value-of select="substring-after (@test, 'not-')"/></xsl:variable>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="modifier"></xsl:variable>
<xsl:variable name="test"><xsl:value-of select="@test"/></xsl:variable>
</xsl:otherwise>
</xsl:choose>
<xsl:attribute name="condition"><xsl:value-of select="$modifier"/>
<xsl:choose>
<xsl:when test="$test = 'blog'">exists (select 1 from BLOG.DBA.BLOG_CHANNELS, BLOG.DBA.SYS_BLOG_CHANNEL_INFO where BC_BLOG_ID = self.blogid and length (BC_RSS_URI) and BC_HOME_URI is not null and BC_RSS_URI = BCD_CHANNEL_URI and BCD_IS_BLOG = 1)</xsl:when>
<xsl:when test="$test = 'channels'"> exists (select 1 from BLOG.DBA.BLOG_CHANNELS, BLOG.DBA.SYS_BLOG_CHANNEL_INFO where BC_BLOG_ID = self.blogid and length (BC_RSS_URI) and BC_HOME_URI is not null and BC_RSS_URI = BCD_CHANNEL_URI and BCD_IS_BLOG = 0)</xsl:when>
<xsl:when test="$test = 'ocs'"> exists (select 1 from BLOG.DBA.BLOG_CHANNELS where BC_BLOG_ID = self.blogid and length (BC_RSS_URI) and BC_HOME_URI is null and BC_FORM = 'OCS')</xsl:when>
<xsl:when test="$test = 'opml'"> exists (select 1 from BLOG.DBA.BLOG_CHANNELS where BC_BLOG_ID = self.blogid and length (BC_RSS_URI) and BC_HOME_URI is null and BC_FORM = 'OPML')</xsl:when>
<xsl:when test="$test = 'comments'"> self.comm</xsl:when>
<xsl:when test="$test = 'comments-or-enabled'"> self.comm or length (self.comments_list.ds_row_data)</xsl:when>
<xsl:when test="$test = 'register'"> self.reg</xsl:when>
<xsl:when test="$test = 'contact'"> self.cont</xsl:when>
<xsl:when test="$test = 'subscribe'"> exists (select 1 from BLOG.DBA.SYS_ROUTING where R_ITEM_ID = self.blogid and R_TYPE_ID = 2 and R_PROTOCOL_ID = 4)</xsl:when>
<xsl:when test="$test = 'blog_owner'"> self.blog_access = 1</xsl:when>
<xsl:when test="$test = 'blog_author'"> self.blog_access = 2 or self.blog_access = 1</xsl:when>
<xsl:when test="$test = 'blog_reader'"> self.blog_access = 3</xsl:when>
<xsl:when test="$test = 'browse_posts'"> self.postid is null</xsl:when>
<xsl:when test="$test = 'have_community'"> self.have_comunity_blog is not null</xsl:when>
<xsl:when test="$test = 'name'"> get_keyword('ShowName', self.opts)</xsl:when>
<xsl:when test="$test = 'photo'"> length(self.photo) and get_keyword('ShowPhoto', self.opts)</xsl:when>
<xsl:when test="$test = 'audio'"> length(self.audio) and get_keyword('ShowAudio', self.opts)</xsl:when>
<xsl:when test="$test = 'email'"> get_keyword('ShowEmail', self.opts)</xsl:when>
<xsl:when test="$test = 'aim'"> get_keyword('ShowAim', self.opts)</xsl:when>
<xsl:when test="$test = 'icq'"> get_keyword('ShowIcq', self.opts)</xsl:when>
<xsl:when test="$test = 'yahoo'"> get_keyword('ShowYahoo', self.opts)</xsl:when>
<xsl:when test="$test = 'msn'"> get_keyword('ShowMsn', self.opts)</xsl:when>
<xsl:when test="$test = 'web'"> get_keyword('ShowWeb', self.opts)</xsl:when>
<xsl:when test="$test = 'loc'"> get_keyword('ShowLoc', self.opts)</xsl:when>
<xsl:when test="$test = 'bio'"> get_keyword('ShowBio', self.opts) and get_keyword('Biography', self.opts)</xsl:when>
<xsl:when test="$test = 'int'"> get_keyword('ShowInt', self.opts)</xsl:when>
<xsl:when test="$test = 'fav'"> get_keyword('ShowFav', self.opts)</xsl:when>
<xsl:when test="$test = 'amazon'"> get_keyword('ShowAmazon', self.opts) and get_keyword('AmazonID', self.opts)</xsl:when>
<xsl:when test="$test = 'ebay'"> get_keyword('ShowEbay', self.opts)</xsl:when>
<xsl:when test="$test = 'ass'"> get_keyword('ShowAss', self.opts)</xsl:when>
<xsl:when test="$test = 'fish'"> get_keyword('ShowFish', self.opts)</xsl:when>
<xsl:when test="$test = 'google'"> get_keyword('ShowGoogle', self.opts)</xsl:when>
<xsl:when test="$test = 'tagid'"> self.tagid is not null</xsl:when>
<xsl:when test="$test = 'trackbacks'">get_keyword ('EnableTrackback', self.opts, 0)</xsl:when>
<xsl:when test="$test = 'referral'">get_keyword ('EnableReferral', self.opts, 1)</xsl:when>
<xsl:when test="$test = 'related'">get_keyword ('EnableRelated', self.opts, 1)</xsl:when>
<xsl:when test="$test = 'login'"> length (self.sid) </xsl:when>
<xsl:when test="$test = 'have_tags'"> exists (select top 1 1 from BLOG..BLOG_POST_TAGS_STAT_2 where postid = t_post_id and blogid = control.te_rowset[10]) </xsl:when>
<xsl:when test="$test = 'have_categories'"> exists (select top 1 1 from BLOG..MTYPE_BLOG_CATEGORY where MTB_POST_ID = t_post_id and MTB_BLOG_ID = control.te_rowset[10]) </xsl:when>
<xsl:when test="$test = 'post-view'"> length (self.postid) </xsl:when>
<xsl:when test="$test = 'summary-post-view'"> length (self.postid) = 0 </xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates />
</v:template>
</xsl:template>
<xsl:template match="vm:comments-tree">
<v:tree name="comments_list" multi-branch="1" orientation="vertical"
start-path="--self.postid" open-at="--'//*'"
root="BLOG..cm_root_node"
child-function="BLOG..cm_child_node"
>
<v:node-template name="node_tmpl">
<div class="<?V case when control.tn_level = 0 then 'cm_node_top' else 'cm_node' end ?>">
<!--v:label name="cm_node_id" value="-#-(control.vc_parent as vspx_tree_node).tn_value" /-->
<!-- render the comment -->
<?vsp
{
declare _bm_ts, _bm_comment, _bm_home_page, _bm_id, _bm_name, _bm_subj any;
declare cm_id int;
cm_id := cast (control.tn_value as integer);
--dbg_printf ('cm_id=[%d]', cm_id);
declare exit handler for not found;
_bm_id := null;
select BM_NAME, BM_ID, BM_HOME_PAGE, BLOG..blog_date_fmt (BM_TS, self.tz) as BM_TS, BM_COMMENT, BM_TITLE
into _bm_name, _bm_id, _bm_home_page, _bm_ts, _bm_comment, _bm_subj
from BLOG.DBA.BLOG_COMMENTS where BM_POST_ID = self.postid and BM_ID = cm_id and BM_IS_PUB = 1;
if (_bm_id is not null and isstring (_bm_home_page) and length (_bm_home_page) = 0)
_bm_home_page := '#';
self.cm_ctr := self.cm_ctr + 1;
if (_bm_id is not null and isstring (_bm_home_page))
{
?>
<!--a class="comment-no" name="<?V _bm_id ?>" onclick="javascript: toggle_comment ('<?V _bm_id ?>'); return flase"><img src="/weblog/public/images/minus.gif" border="0" id="img_<?V _bm_id ?>" /></a-->
<div class="comment" id="msg_<?V _bm_id ?>">
<div class="comment-header">
<span class="comment-subj"><?V _bm_subj ?></span> <br />
</div>
<div class="comment-msg">
<?vsp
http (BLOG.DBA.BLOG_TIDY_HTML (_bm_comment, self.filt));
?>
</div>
<div class="comment-footer">
<span class="comment-user">
<?vsp if (_bm_home_page <> '#') { ?>
Posted by <a href="<?V _bm_home_page ?>" rel="nofollow"><?V BLOG..blog_utf2wide (_bm_name) ?></a>
<?vsp } else { ?>
Posted by <?V BLOG..blog_utf2wide (_bm_name) ?>
<?vsp } ?>
</span>
<span class="comment-date"> on <?V _bm_ts ?></span>
</div>
<div class="comment-actions">
<?vsp
if(self.blog_access = 1 or self.blog_access = 2)
{
?>
<v:button xhtml_class="cmd" action="simple" style="url" name="delete_btn_2" value="Delete"
xhtml_title="Delete" xhtml_alt="Delete">
<v:on-post>
<![CDATA[
declare cm_id int;
cm_id := cast ((control.vc_parent as vspx_tree_node).tn_value as integer);
delete from
BLOG.DBA.BLOG_COMMENTS
where
BM_ID = cm_id and
BM_POST_ID = self.postid and
BM_BLOG_ID = self.blogid;
self.comments_list.vc_data_bind(e);
declare cu vspx_field;
cu := self.posts.vc_find_descendant_control ('comment_url');
if (cu is not null)
{
cu.ufl_value := cu.ufl_value - 1;
}
]]>
</v:on-post>
</v:button>
<![CDATA[ ]]>
<?vsp
}
?>
<v:url xhtml_class="cmd" name="cm_reply_btn_2" value="Reply"
xhtml_title="Reply" render-only="1"
url="--sprintf ('index.vspx?id=%s&cmf=1&cmr=%d#comment_input_st', self.postid, cm_id)" />
</div>
</div>
<?vsp
}
}
?>
<v:node />
</div>
</v:node-template>
</v:tree>
</xsl:template>
<xsl:template match="vm:comments-list">
<v:data-set name="comments_list" sql="select BM_NAME, BM_ID, BM_HOME_PAGE, BLOG..blog_date_fmt (BM_TS, :tz) as BM_TS, BM_COMMENT from BLOG.DBA.BLOG_COMMENTS where BM_POST_ID = :postid and BM_IS_PUB = 1" scrollable="0" edit="0" nrows="10" >
<v:param name="postid" value="--self.postid" />
<v:param name="blogid" value="--self.blogid" />
<v:param name="tz" value="--self.tz" />
<v:template name="template_comments_rep" type="repeat">
<v:template name="template_comments_rep_template" type="browse">
<div class="comment">
<div class="comment-header">
<span class="comment-no">
<v:label name="comm_ctr" value="--((control.vc_parent as vspx_row_template).te_ctr + 1)" format="[%d]" />
</span>
<span class="comment-date">
<v:label name="ts_label" value="--(control.vc_parent as vspx_row_template).te_rowset[3]" />
</span>
</div>
<div class="comment-msg">
<?vsp
http (BLOG.DBA.BLOG_TIDY_HTML ((control as vspx_row_template).te_rowset[4], self.filt));
?>
</div>
<div class="comment-footer">
<span class="comment-user">
<v:url name="comment_view_det" value="--(control.vc_parent as vspx_row_template).te_rowset[0]"
url="--(control.vc_parent as vspx_row_template).te_rowset[2]"
xhtml_rel="nofollow"
active="--after:length (control.vu_url)"/>
</span>
</div>
<div class="comment-actions">
<?vsp
if(self.blog_access = 1 or self.blog_access = 2)
{
?>
<v:button xhtml_class="cmd" action="simple" style="url" name="delete_btn" value="Delete" xhtml_title="Delete" xhtml_alt="Delete">
<v:on-post>
<![CDATA[
delete from
BLOG.DBA.BLOG_COMMENTS
where
BM_ID = (control.vc_parent as vspx_row_template).te_rowset[1] and
BM_POST_ID = self.postid and
BM_BLOG_ID = self.blogid;
self.comments_list.vc_data_bind(e);
declare cu vspx_field;
cu := self.posts.vc_find_descendant_control ('comment_url');
if (cu is not null)
{
cu.ufl_value := cu.ufl_value - 1;
}
]]>
</v:on-post>
</v:button>
<?vsp
}
?>
<![CDATA[ ]]>
<v:url xhtml_class="cmd" name="cm_reply_btn" value="Reply"
xhtml_title="Reply" xhtml_alt="Reply"
url="--sprintf ('index.vspx?id=%s&cmf=1&cmr=%d#comment_input_st', self.postid,
(control.vc_parent as vspx_row_template).te_rowset[1])" />
</div>
<!--div class="pubdate">
<v:label name="ts_label" value="-#-(control.vc_parent as vspx_row_template).te_rowset[3]" /> |
<v:url name="comment_view_det" value="-#-(control.vc_parent as vspx_row_template).te_rowset[0]"
url="-#-(control.vc_parent as vspx_row_template).te_rowset[2]"
xhtml_rel="nofollow"/>
</div-->
</div>
</v:template>
</v:template>
</v:data-set>
</xsl:template>
<xsl:template match="vm:referrals-list">
<div class="referrals-contents">
<?vsp
for select BR_URI from BLOG.DBA.SYS_BLOG_REFFERALS where BR_BLOG_ID = self.blogid and BR_POST_ID = self.postid do
{
?>
<div class="tb-url">
<a href="<?V BR_URI ?>">
<?V BR_URI ?>
</a>
</div>
<?vsp
}
?>
</div>
</xsl:template>
<xsl:template match="vm:related-list">
<div class="related-contents">
<?vsp
declare title, N, S, st, msg, pars, meta, data, vt, hits, words, S any;
data := vector ();
title := (select B_TITLE from BLOG..SYS_BLOGS where B_POST_ID = self.postid);
if (length (title))
{
vt := vt_batch ();
vt_batch_feed (vt, title, 0, 0, 'x-any');
S := FTI_MAKE_SEARCH_STRING (title);
{
declare exit handler for sqlstate '*'
{
goto _skip;
};
vt_parse ('[__lang \'x-ViDoc\' __enc \'UTF-8\'] ' || S);
}
pars := vector (self.postid, concat ('[__lang \'x-ViDoc\' __enc \'UTF-8\'] ', S));
S :=
' select top 10 B.B_BLOG_ID, B.B_POST_ID, B.B_TITLE, B.SCORE ' ||
' from BLOG..SYS_BLOGS B, ' ||
' BLOG..SYS_BLOG_INFO BI, ' ||
' DB.DBA.WA_INSTANCE WAI ' ||
' where B.B_BLOG_ID = BI.BI_BLOG_ID ' ||
' and BI.BI_WAI_NAME = WAI.WAI_NAME ' ||
' and WAI.WAI_IS_PUBLIC = 1 ' ||
' and B.B_POST_ID <> ? ' ||
' and contains (B.B_CONTENT, ?) ' ||
' order by B.SCORE desc';
st := '00000';
exec (S, st, msg, pars, 0, meta, data);
if (st <> '00000')
data := vector ();
}
_skip:;
if (length (data) = 0)
{
?>
<div class="tb-url">
No Related Posts
</div>
<?vsp
}
else
{
for (N := 0; N < length (data); N := N + 1)
{
?>
<div class="tb-url">
<a href="<?V SIOC..blog_post_iri (data[N][0], data[N][1]) ?>">
<?V data[N][2] ?>
</a>
</div>
<?vsp
}
}
?>
</div>
</xsl:template>
<xsl:template match="vm:trackback-url|vm:pingback-url|vm:comment-url">
<xsl:choose>
<xsl:when test="local-name()='trackback-url'">
<xsl:variable name="link">--sprintf('http://%s/mt-tb/Http/trackback?id=%s', self.host, self.postid)</xsl:variable>
</xsl:when>
<xsl:when test="local-name()='pingback-url'">
<xsl:variable name="link">--sprintf('http://%s/mt-tb', self.host)</xsl:variable>
</xsl:when>
<xsl:when test="local-name()='comment-url'">
<xsl:variable name="link">--sprintf ('http://%s/mt-tb/Http/comments?id=%s', self.host, self.postid)</xsl:variable>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="@type='anchor'">
<v:url name="url_{generate-id()}" url="{$link}"
render-only="1"
xhtml_title="This link is not meant to be clicked. It contains the trackback URI for this entry. You can use this URI to send ping- & trackbacks from your own blog to this entry. To copy the link, right click and select "Copy Shortcut" in Internet Explorer or "Copy Link Location" in Mozilla."
xhtml_onclick="alert (\'This link is not meant to be clicked. It contains the trackback URI for this entry. You can use this URI to send ping- & trackbacks from your own blog to this entry. To copy the link, right click and select "Copy Shortcut" in Internet Explorer or "Copy Link Location" in Mozilla.\'); return false;"
>
<xsl:attribute name="value"><xsl:apply-templates select="text()" mode="static_value"/></xsl:attribute>
</v:url>
</xsl:when>
<xsl:otherwise>
<v:label name="url_{generate-id()}" value="{$link}"
render-only="1">
</v:label>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="vm:trackbacks-list">
<?vsp
for select
MP_URL,
MP_TITLE,
MP_EXCERPT,
MP_BLOG_NAME,
BLOG..blog_date_fmt (MP_TS, self.tz) MP_TS
from
BLOG.DBA.MTYPE_TRACKBACK_PINGS
where
MP_POST_ID = self.postid and (MP_IS_PUB = 1 or MP_IS_PUB is null) do {
?>
<div class="message">
<div><a href="<?V MP_URL ?>"><?V MP_BLOG_NAME ?></a></div>
<div class="post-title">
<?V BLOG..blog_utf2wide (MP_TITLE) ?>
</div>
<div class="post-content" property="sioc:content">
<?V BLOG..blog_utf2wide (BLOG.DBA.BLOG_TIDY_HTML (MP_EXCERPT, self.filt)) ?>
</div>
<div class="pubdate"><?V MP_TS ?></div>
</div>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:cmds-menu">
<ul class="cmds-menu">
<vm:if test="blog_author">
<li>
<a href="<?V sprintf('index.vspx?page=edit_post&sid=%s&realm=wa', self.sid) ?>">New Post</a>
</li>
</vm:if>
<vm:if test="blog_owner">
<li>
<a href="<?V sprintf('index.vspx?page=channels&sid=%s&realm=wa', self.sid) ?>">Home Page Links</a>
</li>
<li>
<a href="<?V sprintf('index.vspx?page=bridge&sid=%s&realm=wa', self.sid) ?>">Upstreams</a>
</li>
<li>
<a href="<?V sprintf('index.vspx?page=import&sid=%s&realm=wa', self.sid) ?>">Downstream (Import)</a>
</li>
<li>
<a href="<?V sprintf('index.vspx?page=routing_queue&sid=%s&realm=wa', self.sid) ?>">Upstreaming Log</a>
</li>
<li>
<a href="<?V sprintf('%s/inst_ping.vspx?sid=%s&realm=wa&RETURL=%U', wa_link (1), self.sid, self.return_url_1) ?>">Ping Services</a>
</li>
<li>
<a href="<?V sprintf('%s/ping_log.vspx?sid=%s&realm=wa&RETURL=%U', wa_link (1), self.sid, self.return_url_1) ?>">Ping Log</a>
</li>
<li>
<a href="<?V sprintf('index.vspx?page=ping&sid=%s&realm=wa', self.sid) ?>">Preferences</a>
</li>
<li>
<a href="<?V sprintf('index.vspx?page=community&sid=%s&realm=wa', self.sid) ?>">Related Blogs</a>
</li>
<?vsp
if (__proc_exists ('DB.DBA.WA_NEW_BLOG_IN') is null)
{
?>
<li>
<a href="<?V sprintf('index.vspx?page=membership&sid=%s&realm=wa', self.sid) ?>">Membership</a>
</li>
<?vsp
}
else
{
?>
<li>
<a href="<?V sprintf('%s/edit_inst.vspx?wai_id=%d&sid=%s&realm=wa&RETURL=%U', wa_link (1), self.inst_id, self.sid, self.return_url_1) ?>">Membership and Visibility Settings</a>
</li>
<li>
<a href="<?V sprintf('%s/members.vspx?wai_id=%d&sid=%s&realm=wa&RETURL=%U', wa_link (1), self.inst_id, self.sid, self.return_url_1) ?>">Members of this blog</a>
</li>
<li>
<a href="<?V sprintf('%s/delete_inst.vspx?wai_id=%d&sid=%s&realm=wa&RETURL=%U', wa_link (1), self.inst_id, self.sid, self.return_url_1) ?>">Delete this blog</a>
</li>
<?vsp
}
?>
<li>
<a href="<?V sprintf('index.vspx?page=templates&sid=%s&realm=wa', self.sid) ?>">Templates</a>
</li>
</vm:if>
<vm:if test="blog_author">
<li>
<a href="<?V sprintf('index.vspx?page=category&sid=%s&realm=wa', self.sid) ?>">Categories</a>
</li>
<li>
<a href="<?V sprintf('index.vspx?page=tags&sid=%s&realm=wa', self.sid) ?>">Tagging Settings</a>
</li>
</vm:if>
</ul>
</xsl:template>
<xsl:include href="calendar.xsl"/>
<xsl:include href="compat.xsl"/>
<xsl:include href="dav_browser.xsl"/>
<xsl:include href="../../wa/comp/ods_bar.xsl"/>
<xsl:template match="vm:comments-view">
<xsl:call-template name="comments-view"/>
</xsl:template>
<xsl:template match="vm:trackbacks">
<xsl:call-template name="trackbacks"/>
</xsl:template>
<xsl:template match="vm:referrals">
<xsl:call-template name="referrals"/>
</xsl:template>
<xsl:template match="vm:related">
<xsl:call-template name="related"/>
</xsl:template>
<xsl:template match="vm:comments">
<xsl:call-template name="comments"/>
</xsl:template>
<xsl:template match="vm:meta-keywords">
<xsl:if test="count(ancestor::vm:header)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:meta-keywords should be placed inside vm:header only
</xsl:message>
</xsl:if>
<?vsp if (length (self.kwd)) { ?>
<meta name="keywords" content="<?V BLOG.DBA.BLOG_META_KWD_NORMALIZE (self.kwd) ?>" />
<?vsp } ?>
</xsl:template>
<xsl:template match="vm:meta-owner">
<xsl:if test="count(ancestor::vm:header)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:meta-owner should be placed inside vm:header only
</xsl:message>
</xsl:if>
<?vsp if (length (self.owner)) { ?>
<meta name="owner" content="<?V BLOG..blog_utf2wide (self.owner) ?>" />
<?vsp } ?>
</xsl:template>
<xsl:template match="vm:meta-authors">
<xsl:if test="count(ancestor::vm:header)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:meta-authors should be placed inside vm:header only
</xsl:message>
</xsl:if>
<?vsp
if (length (self.authors)) { ?>
<meta name="authors" content="<?V BLOG..blog_utf2wide (self.authors) ?>" />
<?vsp } ?>
</xsl:template>
<xsl:template match="vm:meta-description">
<xsl:if test="count(ancestor::vm:header)=0 and $chk">
<xsl:message terminate="yes">
Widget vm:meta-description should be placed inside vm:header only
</xsl:message>
</xsl:if>
<?vsp if (length (self.about)) { ?>
<meta name="description" content="<?V BLOG..blog_utf2wide (self.about) ?>" />
<?vsp } ?>
</xsl:template>
<xsl:template match="vm:photo">
<vm:if test="photo">
<a class="button" href="<?V self.photo ?>">
<img src="<?V self.photo ?>" border="0" alt="Owner photo">
<xsl:attribute name="width">
<xsl:value-of select="@width"/>
</xsl:attribute>
</img>
</a>
</vm:if>
</xsl:template>
<xsl:template match="vm:audio">
<vm:if test="audio">
<a href="<?V self.audio ?>">
<img border="0" alt="Owner audio">
<xsl:if test="@image">
<xsl:attribute name="src"><?vsp
if (self.custom_img_loc)
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
else
http(self.stock_img_loc || 'audio_16.GIF');
?></xsl:attribute>
</xsl:if>
<xsl:if test="not @image">
<xsl:attribute name="src"><?vsp http(self.stock_img_loc || 'audio_16.GIF'); ?></xsl:attribute>
</xsl:if>
</img>
</a>
</vm:if>
</xsl:template>
<xsl:template match="vm:home-url">
<v:url name="home_url" value="Home" url="'index.vspx?page=index'"/>
</xsl:template>
<xsl:template match="vm:archive-url">
<v:url name="archive_url" value="Archive" url="index.vspx?page=archive"
xhtml_class="--case when self.page = 'archive' then 'blog_selected' else '' end"
render-only="1">
</v:url>
</xsl:template>
<xsl:template match="vm:settings-link">
<xsl:variable name="val">--get_keyword ('title', self.user_data, <xsl:apply-templates select="@title" mode="static_value"/>)</xsl:variable>
<?vsp
if (self.blog_access = 1 or self.blog_access = 2)
{
?>
<v:url name="settings_link" url="index.vspx?page=ping" value="{$val}"
xhtml_class="--case when self.page not in ('index', 'linkblog', 'summary', 'archive', 'search', 'edit_post', 'moblog_msg') and length (self.page) then 'blog_selected' else '' end"
render-only="1">
</v:url>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:new-post-link">
<xsl:variable name="val">--get_keyword ('title', self.user_data, <xsl:apply-templates select="@title" mode="static_value"/>)</xsl:variable>
<?vsp
if (self.blog_access = 1 or self.blog_access = 2)
{
?>
<v:url name="new_post_link" url="index.vspx?page=edit_post" value="{$val}" xhtml_class="--case when self.page in ('edit_post', 'moblog_msg') and length (self.page) then 'blog_selected' else '' end" render-only="1">
</v:url>
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:ds-navigation">
<?vsp
{
declare _prev, _next, _last, _first vspx_button;
declare d_prev, d_next, d_last, d_first, index_arr int;
d_prev := d_next := d_last := d_first := index_arr := 0;
_first := control.vc_find_control ('<xsl:value-of select="@data-set"/>_first');
_last := control.vc_find_control ('<xsl:value-of select="@data-set"/>_last');
_next := control.vc_find_control ('<xsl:value-of select="@data-set"/>_next');
_prev := control.vc_find_control ('<xsl:value-of select="@data-set"/>_prev');
if (_next is not null and not _next.vc_enabled and _prev is not null and not _prev.vc_enabled)
goto skipit;
index_arr := 1;
if (_first is not null and not _first.vc_enabled)
{
d_first := 1;
}
if (_next is not null and not _next.vc_enabled)
{
d_next := 1;
}
if (_prev is not null and not _prev.vc_enabled)
{
d_prev := 1;
}
if (_last is not null and not _last.vc_enabled)
{
d_last := 1;
}
skipit:;
?>
<!--
<xsl:if test="not(@type) or @type = 'set'">
<?vsp
if (d_first)
{
http ('<a href="#">first</a>');
}
?>
<v:button name="{@data-set}_first" action="simple" style="url" value="first"
xhtml_alt="First" xhtml_title="First" text=" First">
</v:button>
</xsl:if>
-->
<?vsp
http(' ');
if (d_prev)
{
http ('<a href="#"><<</a>');
}
?>
<v:button name="{@data-set}_prev" action="simple" style="url" value="&lt;&lt;"
xhtml_alt="Previous" xhtml_title="Previous" text=" Previous">
</v:button>
<![CDATA[ ]]>
<![CDATA[ ]]>
<!-- an version of page numbering -->
<xsl:if test="not(@type) or @type = 'set'">
<v:text name="{@data-set}_offs" type="hidden" value="0" />
<?vsp
if (index_arr)
{
declare dsname, idx_offs, frm_name any;
declare frm vspx_control;
frm := control.vc_find_parent_form (control);
frm_name := '';
if (frm is not null)
frm_name := frm.vc_name;
-- this button is just to trigger the post, no render at all
if (0)
{
?>
<v:button name="{@data-set}_idx" action="simple" style="url" value="Submit">
<v:on-post><![CDATA[
declare ds vspx_data_set;
declare dss vspx_data_source;
declare offs int;
offs := atoi(get_keyword (replace (control.vc_name, '_idx', '_offs'), e.ve_params, '0'));
ds := control.vc_find_parent (control, 'vspx_data_set');
if (ds.ds_data_source is not null)
{
ds.ds_rows_offs := ds.ds_nrows * offs;
ds.vc_data_bind (e);
}
]]></v:on-post>
</v:button>
<?vsp
}
?>
<xsl:processing-instruction name="vsp">
dsname := '<xsl:value-of select="@data-set"/>';
</xsl:processing-instruction>
<?vsp
declare i, n, t, c integer;
declare _class varchar;
declare dss vspx_data_source;
declare ds vspx_data_set;
ds := control.vc_parent;
dss := null;
if (ds.ds_data_source is not null)
dss := ds.ds_data_source;
i := 0;
n := ds.ds_nrows;
t := 0;
if (dss is not null)
t := dss.ds_total_rows;
c := ds.ds_rows_offs/10;
--dbg_obj_print ('n=',n, ' t=',t,' c=', c);
if ((t/n) > 20)
i := (t/n) - 20;
while (t and i < (t/n)+1)
{
?>
| <a href="#" onclick="javascript: document.forms['<?V frm_name ?>'].<?V dsname ?>_offs.value = <?V i ?>; doPost ('<?V frm_name ?>', '<?V dsname ?>_idx'); return false"><?vsp http_value (i + 1, case when c = i then 'b' else null end); ?></a>
<?vsp
i := i + 1;
}
if (i > 0)
http (' | ');
}
?>
</xsl:if>
<![CDATA[ ]]>
<![CDATA[ ]]>
<?vsp
if (d_next)
{
http ('<a href="#">>></a>');
}
?>
<v:button name="{@data-set}_next" action="simple" style="url" value="&gt;&gt;"
xhtml_title="Next" text=" Next">
</v:button>
<!--
<xsl:if test="not(@type) or @type = 'set'">
<?vsp
http(' ');
if (d_last)
{
http ('<a href="#">last</a>');
}
?>
<v:button name="{@data-set}_last" action="simple" style="url" value="last"
xhtml_alt="Last" xhtml_title="Last" text=" Last">
</v:button>
</xsl:if>
-->
<?vsp
}
?>
</xsl:template>
<xsl:template match="vm:category-widget">
<v:method name="del_qry" arglist="inout ttid any">
delete from BLOG.DBA.SYS_BLOGS_B_CONTENT_QUERY where TT_ID = ttid;
delete from BLOG.DBA.SYS_BLOGS_B_CONTENT_USER where TTU_T_ID = ttid;
delete from BLOG.DBA.SYS_BLOGS_B_CONTENT_HIT where TTH_T_ID = ttid;
</v:method>
<v:method name="def_cat" arglist="">
declare cat varchar;
cat := trim(self.cat.ufl_value);
if (cat is null or cat = '')
{
self.cat.ufl_value := '';
self.vc_error_message := 'Please enter correct description.';
self.vc_is_valid := 0;
return;
}
if (self.cat_id is null and exists(select 1 from BLOG.DBA.MTYPE_CATEGORIES where MTC_NAME = cat and MTC_BLOG_ID = self.blogid))
{
self.cat.ufl_value := '';
self.vc_error_message := 'Category with the same description already exists. Please choose another description.';
self.vc_is_valid := 0;
return;
}
if (self.cat_id is null)
{
self.cat_id := cast(sequence_next ('category.'|| self.blogid) as varchar);
insert into BLOG.DBA.MTYPE_CATEGORIES
(MTC_ID, MTC_BLOG_ID, MTC_NAME, MTC_ROUTING, MTC_DEFAULT, MTC_KEYWORDS, MTC_SHARED)
values
(self.cat_id, self.blogid, cat, 1,
self.is_def.ufl_selected, self.kwds.ufl_value, self.is_shared.ufl_selected);
}
else
{
update BLOG.DBA.MTYPE_CATEGORIES set
MTC_NAME = cat,
MTC_ROUTING = 1,
MTC_DEFAULT = self.is_def.ufl_selected,
MTC_SHARED = self.is_shared.ufl_selected,
MTC_KEYWORDS = self.kwds.ufl_value
where
MTC_ID = self.cat_id and MTC_BLOG_ID = self.blogid;
}
</v:method>
<v:method name="tt_set_qry" arglist="in tp any, inout qry any">
declare exit handler for sqlstate '*' {
-- rollback work;
self.vc_is_valid := 0;
if (tp = '1')
-- self.ctgs_ds.vc_error_message := concat (__SQL_STATE,' ',__SQL_MESSAGE);
self.ctgs_ds.vc_error_message := 'Incorrect free-text trigger. Please enter the word (only letters without blanks and special symbols).';
else
self.ctgs_ds.vc_error_message := concat (__SQL_STATE,' ',__SQL_MESSAGE);
return;
};
if(tp = '1')
{
exec('vt_parse (?)', null, null, vector (qry));
BLOG.DBA.TT_QUERY_SYS_BLOGS(qry, self.user_id, '', '', self.blogid, self.cat_id);
}
else
{
exec ('xpath_text (?)', null, null, vector (qry));
BLOG.DBA.TT_XPATH_QUERY_SYS_BLOGS(qry, self.user_id, '', '', self.blogid, self.cat_id);
}
</v:method>
<h3>Categories</h3>
<div id="text">
<v:form name="form1" type="simple" method="POST">
<v:before-data-bind>
<![CDATA[
declare stat, msg, dta, mdta any;
if(get_keyword('delete', self.vc_event.ve_params, '') <> '') {
delete from BLOG.DBA.MTYPE_CATEGORIES where MTC_ID = get_keyword ('delete', self.vc_event.ve_params, '') and
MTC_BLOG_ID = self.blogid;
self.fttq := null;
}
else if(get_keyword ('edit', self.vc_event.ve_params, '') <> '') {
self.cat_id := get_keyword ('edit', self.vc_event.ve_params, '');
self.fttq := null;
}
stat := '00000';
if (self.fttq is null)
{
exec ('select distinct TT_ID, coalesce (TT_XPATH, TT_QUERY) from BLOG.DBA.SYS_BLOGS_B_CONTENT_QUERY where TT_CD = ? and TT_PREDICATE = ? order by 2', stat, msg, vector (self.blogid, self.cat_id), 0, mdta, dta);
if (stat = '00000')
self.fttq := dta;
}
if (self.fttq is null)
self.fttq := vector ();
--dbg_obj_print (self.fttq);
]]>
</v:before-data-bind>
<input type="hidden" name="page" value="category"/>
<table>
<tr>
<th>
<label for="cat">Description</label>
</th>
<td>
<v:text xhtml_class="textbox" xhtml_style="width: 220px" error-glyph="*" xhtml_id="cat" name="cat" value="">
<v:after-data-bind>
if(self.cat_id is not null) {
select MTC_NAME into control.ufl_value from BLOG.DBA.MTYPE_CATEGORIES
where MTC_ID = self.cat_id and MTC_BLOG_ID = self.blogid;
}
</v:after-data-bind>
<v:validator test="length" min="1" max="512" message="The description can not be empty." />
</v:text>
</td>
</tr>
<tr>
<th>
<label for="tquery">Keywords</label>
</th>
<td>
<table cellpadding="0" cellspacing="0" width="100%">
<v:data-set name="ctgs_ds" nrows="10" scrollable="1" data="--self.fttq" meta="--null" edit="1" width="80">
<v:column name="TT_ID"/>
<v:column name="QUERY"/>
<v:template name="ctgs_template2" type="repeat">
<v:template name="ctgs_template7" type="if-not-exists">
<tr>
<td colspan="2">
No automatic category expression associated
</td>
</tr>
</v:template>
<v:template name="ctgs_template4" type="browse">
<tr>
<td nowrap="1">
<v:text xhtml_class="textbox" name="category_id"
value="--(control.vc_parent as vspx_row_template).te_rowset[0]"
type="hidden" />
<v:text xhtml_class="textbox" name="tquery" xhtml_id="tquery"
xhtml_style="width: 120px"
value="--(control.vc_parent as vspx_row_template).te_rowset[1]">
<v:validator test="sql" message="The expression is not valid text query"><![CDATA[
declare exit handler for sqlstate '*' {
return 1;
};
vt_parse ((control as vspx_field).ufl_value);
return 0;
]]></v:validator>
</v:text>
</td>
<td nowrap="1" align="left">
<v:button xhtml_class="button" name="ctgs_ds_update" action="simple" value="Update" style="url" xhtml_title="Update" xhtml_alt="Update">
<v:on-post>
<![CDATA[
declare qry, id vspx_field;
declare tmpl vspx_row_template;
declare newa any;
if (not self.vc_is_valid)
return;
tmpl := control.vc_parent;
qry := tmpl.vc_find_control ('tquery');
if (qry.ufl_value is null or trim(qry.ufl_value) = '')
{
self.vc_error_message := 'Expression could not be empty';
self.vc_is_valid := 0;
return;
}
id := tmpl.vc_find_control ('category_id');
if (self.cat_id is null)
return;
--dbg_obj_print (tmpl.te_ctr);
--self.del_qry (id.ufl_value);
--self.tt_set_qry ('1', qry.ufl_value);
newa := self.fttq;
newa[tmpl.te_ctr][1] := qry.ufl_value;
self.fttq := newa;
self.ctgs_ds.vc_data_bind (e);
]]>
</v:on-post>
</v:button>
<![CDATA[ ]]>
<v:button xhtml_class="button" name="ctgs_ds_delete" action="simple" value="Delete" style="url" xhtml_title="Delete" xhtml_alt="Delete">
<v:on-post>
<![CDATA[
declare tmpl vspx_row_template;
declare newa, i, pos any;
tmpl := control.vc_parent;
--dbg_obj_print (tmpl.te_ctr);
--self.del_qry (self.ctgs_ds.ds_current_row.te_rowset[0]);
newa := make_array (length (self.fttq) - 1, 'any');
i := 0; pos := 0;
foreach (any r in self.fttq) do
{
if (i <> tmpl.te_ctr)
{
newa[pos] := r;
pos := pos + 1;
}
i := i + 1;
}
self.fttq := newa;
self.ctgs_ds.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</v:template>
</v:template>
<v:template name="ctgs_template3" type="simple">
<tr>
<td nowrap="1">
<v:text xhtml_class="textbox" xhtml_style="width:120px" name="tquery1" value="">
<v:validator test="sql" message="The expression is not valid text query"><![CDATA[
declare exit handler for sqlstate '*' {
return 1;
};
vt_parse ((control as vspx_field).ufl_value);
return 0;
]]></v:validator>
</v:text>
</td>
<td nowrap="1" align="left">
<v:button xhtml_class="button" name="ctgs_ds_add" action="simple" value="Add" style="url" xhtml_title="Add" xhtml_alt="Add">
<v:on-post>
<![CDATA[
declare n any;
if (not self.vc_is_valid)
return;
if (self.tquery1.ufl_value is null or trim(self.tquery1.ufl_value) = '')
{
self.vc_error_message := 'Expression could not be empty';
self.vc_is_valid := 0;
return;
}
--if (self.cat_id is null)
-- self.def_cat ();
--self.tt_set_qry('1', trim(self.tquery1.ufl_value));
n := length (self.fttq) + 1;
self.fttq := vector_concat (self.fttq, vector (vector (-1, self.tquery1.ufl_value)));
self.tquery1.ufl_value := '';
self.ctgs_ds.vc_data_bind (e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<vm:ds-navigation data-set="ctgs_ds"/>
</td>
</tr>
</v:template>
</v:data-set>
</table>
</td>
</tr>
<tr>
<th>
</th>
<td>
<v:text xhtml_class="textbox" name="kwds" value="" type="hidden">
</v:text>
</td>
</tr>
<!--tr>
<th>
<label for="ups">Upstreaming</label>
</th>
<td>
<v:select-list xhtml_class="select" name="ups" xhtml_id="ups">
<v:item name="enabled" value="1"/>
<v:item name="disabled" value="0"/>
<v:after-data-bind>
<![CDATA[
if (self.cat_id is not null)
{
declare flag int;
select MTC_ROUTING into flag from BLOG.DBA.MTYPE_CATEGORIES
where MTC_ID = self.cat_id and MTC_BLOG_ID = self.blogid;
if (flag)
control.vsl_selected_inx := 0;
else
control.vsl_selected_inx := 1;
}
]]>
</v:after-data-bind>
</v:select-list>
</td>
</tr-->
<tr>
<td>
<v:check-box xhtml_id="is_def" name="is_def" value="1" initial-checked="--coalesce ((select MTC_DEFAULT from BLOG.DBA.MTYPE_CATEGORIES where MTC_ID = self.cat_id and MTC_BLOG_ID = self.blogid), 0)"/>
</td>
<th>
<label for="is_def">Is default</label>
</th>
</tr>
<tr>
<td>
<v:check-box xhtml_id="is_shared" name="is_shared" value="1" initial-checked="--coalesce ((select MTC_SHARED from BLOG.DBA.MTYPE_CATEGORIES where MTC_ID = self.cat_id and MTC_BLOG_ID = self.blogid), 0)"/>
</td>
<th>
<label for="is_shared">Share</label>
</th>
</tr>
<tr>
<td colspan="2" >
<v:button xhtml_class="real_button" action="simple" name="post" value="Save" xhtml_title="Save" xhtml_alt="Save">
<v:on-post>
<![CDATA[
if (not self.vc_is_valid)
return;
if (self.is_def.ufl_selected)
{
update BLOG.DBA.MTYPE_CATEGORIES set MTC_DEFAULT = 0 where MTC_BLOG_ID = self.blogid;
}
self.def_cat ();
--dbg_obj_print ('self.fttq=', self.fttq);
delete from BLOG.DBA.SYS_BLOGS_B_CONTENT_HIT where TTH_T_ID in (select distinct TT_ID from BLOG.DBA.SYS_BLOGS_B_CONTENT_QUERY where TT_CD = self.blogid and TT_PREDICATE = self.cat_id);
delete from BLOG.DBA.SYS_BLOGS_B_CONTENT_USER where TTU_T_ID in (select distinct TT_ID from BLOG.DBA.SYS_BLOGS_B_CONTENT_QUERY where TT_CD = self.blogid and TT_PREDICATE = self.cat_id);
delete from BLOG.DBA.SYS_BLOGS_B_CONTENT_QUERY where TT_CD = self.blogid and TT_PREDICATE = self.cat_id;
foreach (any qr in self.fttq) do
{
self.tt_set_qry('1', qr[1]);
}
self.cat_id := null;
--self.ups.vsl_selected_inx := 0;
self.cat.ufl_value := '';
self.kwds.ufl_value := '';
self.is_def.ufl_selected := 0;
self.is_shared.ufl_selected := 0;
self.fttq := null;
self.ctgs_ds.vc_data_bind (e);
self.data_set13.vc_data_bind (e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</v:form>
<v:form name="form222" type="simple" method="POST">
<table>
<tr>
<td>
<v:button xhtml_class="real_button" name="genb" action="simple" value="Auto Categorize Uncategorized Posts" xhtml_title="Auto Categorize Uncategorized Posts" xhtml_alt="Auto Categorize Uncategorized Posts">
<v:on-post>
<![CDATA[
declare res BLOG.DBA."MTWeblogPost";
declare categs, cur_cat varchar;
categs := '';
declare username, dpassword, res1, error_msg, urlstr, cur_time, d_url, descr varchar;
declare hdr any;
declare tag_count, i integer;
whenever not found goto end_search;
select BI_DEL_USER, BI_DEL_PASS into username, dpassword from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID=self.blogid;
end_search:;
for
select distinct TT_QUERY, TT_PREDICATE, TT_ID
from BLOG.DBA.SYS_BLOGS_B_CONTENT_QUERY
where TT_CD = self.blogid and TT_XPATH is null
do
{
for
select B_POST_ID, B_BLOG_ID, B_USER_ID, B_CONTENT_ID, B_META, B_CONTENT, B_TITLE
from BLOG.DBA.SYS_BLOGS
where B_STATE = 2 and B_BLOG_ID = self.blogid and contains (B_CONTENT, TT_QUERY)
do
{
insert soft BLOG.DBA.SYS_BLOGS_B_CONTENT_HIT (TTH_U_ID, TTH_T_ID, TTH_D_ID)
values (B_USER_ID, TT_ID, B_CONTENT_ID);
}
}
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</v:form>
<h3>Categories</h3>
<v:data-set name="data_set13" sql="select MTC_NAME, MTC_DEFAULT, MTC_ROUTING, MTC_ID from BLOG.DBA.MTYPE_CATEGORIES where MTC_BLOG_ID = self.blogid" nrows="10" scrollable="1" cursor-type="dynamic" edit="0">
<input type="hidden" name="page" value="5"/>
<v:column name="MTC_NAME" />
<v:column name="MTC_DEFAULT" />
<v:column name="MTC_ROUTING" />
<v:column name="MTC_ID" />
<v:template type="simple" name-to-remove="table" set-to-remove="bottom" name="data_set13_header_template">
<table class="listing">
<tr class="listing_header_row">
<th>Description</th>
<!--th>Upstreaming</th-->
<th>Action</th>
</tr>
</table>
</v:template>
<v:template type="repeat" name-to-remove="" set-to-remove="" name="data_set13_repeat_template">
<v:template type="if-not-exists" name-to-remove="table" set-to-remove="both" name="data_set13_if_not_exists_template">
<table> <!-- dummy -->
<tr class="listing_count">
<td class="listing_count" colspan="6">
No rows selected
</td>
</tr>
</table>
</v:template>
<v:template type="browse" name-to-remove="table" set-to-remove="both" name="data_set13_browse_template">
<table>
<?vsp
self.r_count := self.r_count + 1;
http (sprintf ('<tr class="%s">', case when mod (self.r_count, 2) then 'listing_row_odd' else 'listing_row_even' end));
?>
<!-- tr -->
<td class="listing_col">
<?V ((control as vspx_row_template).te_rowset[0]) ?><?vsp if (((control as vspx_row_template).te_rowset[1])) http ('<small> (default)</small>'); ?>
</td>
<!--td class="listing_col">
<?V case when ((control as vspx_row_template).te_rowset[2]) is null or ((control as vspx_row_template).te_rowset[2]) = 0 then 'disabled' else 'enabled' end ?>
</td-->
<td class="listing_col_action">
<a class="button" href="index.vspx?page=<?=self.page?>&edit=<?=((control as vspx_row_template).te_rowset[3])?>&realm=wa&sid=<?V self.sid ?>">Edit</a>
<![CDATA[ ]]>
<a class="button" href="index.vspx?page=<?=self.page?>&delete=<?=((control as vspx_row_template).te_rowset[3])?>&realm=wa&sid=<?V self.sid ?>">Delete</a>
</td>
<?vsp
http ('</tr>');
?>
<!-- /tr-->
</table>
</v:template>
</v:template>
<v:template type="simple" name-to-remove="table" set-to-remove="top" name="data_set13_footer_template">
<table>
<tr class="browse_button_row">
<td colspan="3" align="center">
<vm:ds-navigation data-set="data_set13"/>
</td>
</tr>
</table>
</v:template>
</v:data-set>
</div>
</xsl:template>
<xsl:template match="vm:moblog-settings">
<v:form name="moblog_msg_form" type="simple" method="POST">
<input name="page" type="hidden" value="moblog_msg" />
<input type="hidden" name="ping_tab" value="<?V get_keyword('ping_tab', control.vc_page.vc_event.ve_params) ?>"/>
<!--input type="hidden" name="profile_tab" value="<?V get_keyword('profile_tab', control.vc_page.vc_event.ve_params) ?>"/-->
<table>
<tr><th colspan="2"><h2>Posting Control</h2></th></tr>
<tr>
<td nowrap="nowrap"><label for="moblog_sec1">Post-to Email Address</label></td>
<td>
<v:label name="bid_l1" value="--self.blogid" format="%s."/>
<v:text xhtml_class="textbox" xhtml_size="12" name="moblog_sec1" xhtml_id="moblog_sec1" value="">
<v:before-render>
<![CDATA[
if(self.opts and length(self.opts) > 1)
{
control.ufl_value := get_keyword ('MoblogSecret', self.opts, '');
}
]]>
</v:before-render>
</v:text>
<v:label name="bid_l2" value="--self.mail_domain" format="@%s"/> (note that '<v:label name="bid_l3" value="--self.blogid" format="%s"/>' is your blog ID)
<!--v:data-list name="wa_domains1"
key-column="WD_DOMAIN" value-column="WD_DOMAIN"
sql="select WD_DOMAIN from WA_DOMAINS"
>
</v:data-list-->
</td>
</tr>
<tr><td colspan="2">
You should use this email address when sending images for blog publication
from a mobile phone or similar mobile devices.<br />
Alternatively, you can configure a POP3 proxy that fetches email from a
designated personal mailbox hosted on an external mail server.
</td></tr>
<tr><th colspan="2"><h2>POP3 Server Settings</h2></th></tr>
<tr>
<td nowrap="nowrap"><label for="pop_addr1">Server Address and Port</label></td>
<td>
<v:text xhtml_class="textbox" xhtml_style="width: 170px;" name="pop_addr1" xhtml_id="pop_addr1" value="">
<v:before-render>
<![CDATA[
declare pop3srv any;
if(self.opts and length(self.opts) > 1)
{
pop3srv := get_keyword('POP3Server', self.opts);
if(pop3srv)
{
control.ufl_value := split_and_decode(pop3srv, 0, '\0\0:')[0];
}
}
]]>
</v:before-render>
</v:text>
:
<v:text xhtml_class="textbox" name="pop_port1" value="" xhtml_size="4" error-glyph="*">
<v:validator test="regexp" regexp="^[0-9]+$" message="Invalid port number" />
<v:before-render>
<![CDATA[
declare pop3srv any;
if(self.opts and length(self.opts) > 1)
{
pop3srv := get_keyword('POP3Server', self.opts);
if (pop3srv)
control.ufl_value := split_and_decode(pop3srv, 0, '\0\0:')[1];
else
control.ufl_value := '110';
}
else
control.ufl_value := '110';
]]>
</v:before-render>
</v:text>
</td>
</tr>
<tr>
<td nowrap="nowrap"><label for="nam1">Account Name</label></td>
<td>
<v:text xhtml_class="textbox" xhtml_style="width: 220px;" xhtml_id="nam1" name="nam1" value="--get_keyword ('POP3Account', self.opts, '')"/>
</td>
</tr>
<tr>
<td nowrap="nowrap"><label for="pwd1">Account Password</label></td>
<td>
<v:text xhtml_class="textbox" xhtml_style="width: 220px;" xhtml_id="pwd1" name="pwd1" value="--get_keyword ('POP3Passwd', self.opts, '')" type="password"/>
</td>
</tr>
<tr>
<td colspan="2">
<div><small>Note: No mail will be deleted from your POP Server after retrieval</small></div>
<br />
</td>
</tr>
<tr><th colspan="2"><h2>Content Control</h2></th></tr>
<tr>
<td/>
<td>
<v:check-box xhtml_id="mob1" name="mob1" value="1" initial-checked="--get_keyword ('MoblogAutoPublish', self.opts, 0)"/>
<label for="mob1">Automatic Moblogging enabled</label>
</td>
</tr>
<tr>
<td>
Secret word
</td>
<td>
<v:text xhtml_id="mobsec1" name="mobsec1" value="--get_keyword ('MoblogAutoSecret', self.opts, '')" xhtml_class="textbox" xhtml_style="width: 220px;"/>
</td>
</tr>
<tr>
<td nowrap="nowrap"><label for="meme1">Allowed MIME Types<br/><small>(comma separated list)</small></label></td>
<td>
<v:text xhtml_class="textbox" xhtml_style="width: 220px;" xhtml_id="mime1" name="mime1" value="--get_keyword ('MoblogMIMETypes', self.opts, 'image/%')"/>
<v:button
xhtml_class="real_button"
action="browse"
value=".."
selector="index.vspx?page=moblog_mime_select"
child-window-options="scrollbars=yes, menubar=no, height=200, width=300" xhtml_title="Browse" xhtml_alt="Browse">
<v:field name="mime1" />
</v:button>
</td>
</tr>
<tr>
<td colspan="2">
<v:button xhtml_class="real_button" name="set1" value="Save" action="simple" xhtml_title="Save" xhtml_alt="Save">
<v:on-post>
declare opts any;
declare pop3s varchar;
declare pop3port varchar;
pop3port := trim(self.pop_port1.ufl_value);
if (pop3port = '' or atoi(pop3port) = 0)
pop3port := '110';
pop3s := trim(self.pop_addr1.ufl_value) || ':' || pop3port;
opts := self.opts;
opts := BLOG.DBA.BLOG2_SET_OPTION('POP3Server', opts, pop3s);
opts := BLOG.DBA.BLOG2_SET_OPTION('POP3Account', opts, self.nam1.ufl_value);
opts := BLOG.DBA.BLOG2_SET_OPTION('POP3Passwd', opts, self.pwd1.ufl_value);
opts := BLOG.DBA.BLOG2_SET_OPTION('MoblogAutoPublish', opts, self.mob1.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('MoblogMIMETypes', opts, self.mime1.ufl_value);
opts := BLOG.DBA.BLOG2_SET_OPTION('MoblogSecret', opts, self.moblog_sec1.ufl_value);
opts := BLOG.DBA.BLOG2_SET_OPTION('MoblogAutoSecret', opts, self.mobsec1.ufl_value);
self.opts := opts;
update BLOG.DBA.SYS_BLOG_INFO set BI_OPTIONS = serialize (self.opts) where BI_BLOG_ID = self.blogid;
--self.fet1.vc_enabled := 1;
</v:on-post>
</v:button>
</td>
</tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:moblog-msg">
<h3>Moblog messages</h3>
<v:form name="moblog_posts_form" type="simple" method="POST">
<table>
<tr>
<td colspan="2">
<v:button xhtml_class="real_button" name="fet1" value="Fetch" action="simple" xhtml_title="Fetch" xhtml_alt="Fetch">
<v:after-data-bind><![CDATA[
if (get_keyword ('POP3Account', self.opts, '') <> ''
and get_keyword ('POP3Server', self.opts, '') <> ''
and get_keyword ('POP3Passwd', self.opts, '') <> '')
control.vc_enabled := 1;
else
control.vc_enabled := 0;
]]></v:after-data-bind>
<v:on-post>
<![CDATA[
declare pop3s, nam, pwd1 varchar;
declare res any;
declare exit handler for sqlstate '*'
{
rollback work;
self.vc_is_valid := 0;
control.vc_error_message := __SQL_MESSAGE;
return;
};
commit work;
declare mess, elm, __uid any;
pop3s := get_keyword ('POP3Server', self.opts);
nam := get_keyword ('POP3Account', self.opts);
pwd1 := get_keyword ('POP3Passwd', self.opts);
__uid := (select VS_UID from VSPX_SESSION where VS_SID = self.sid and VS_REALM = self.realm);
BLOG..BLOG_GET_MAIL_VIA_POP3 (pop3s, nam, pwd1, __uid);
self.moblog_ds.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
<?vsp if (self.fet1.vc_enabled) { ?>
<span><small>Note: No mail will be deleted from your POP Server after retrieval</small></span>
<?vsp } ?>
</td>
</tr>
<tr>
<td colspan="2">
<table class="listing">
<v:data-set name="moblog_ds" nrows="10" scrollable="1" cursor-type="keyset" sql="select MM_FROM, MM_SUBJ, MM_SND_TIME, MA_ID, MA_NAME, MA_MIME, MA_PUBLISHED from DB.DBA.MAIL_MESSAGE, DB.DBA.MAIL_ATTACHMENT where MA_BLOG_ID = :bid and MM_MOBLOG like 'mob-%' and MA_M_ID = MM_ID and MA_M_OWN = MM_OWN and MA_M_FLD = MM_FLD">
<v:param name="bid" value="--self.blogid"/>
<v:template name="t1" type="simple">
<tr class="listing_header_row">
<th>
<input
type="checkbox"
name="selectall" value="Select All"
onclick="selectAllCheckboxes(this.form, this, ':sel')" />
</th>
<th>Sender</th>
<th>Subject</th>
<th>Image</th>
<th>Date</th>
<th>Action</th>
</tr>
</v:template>
<v:template name="t2" type="repeat">
<v:template name="t21" type="if-not-exists">
<tr>
<td colspan="6" align="center">No moblog messages found</td>
</tr>
</v:template>
<v:template name="t22" type="browse">
<tr class="<?V case when mod (control.te_ctr,2) then 'listing_row_odd' else 'listing_row_even' end ?>">
<td>
<v:check-box name="sel1"
value="--(control.vc_parent as vspx_row_template).te_rowset[3]" initial-checked="0"
/>
</td>
<td nowrap="nowrap">
<v:label name="l1" value="--DB.DBA.adm_mailaddr_pretty ((control.vc_parent as vspx_row_template).te_rowset[0])"/>
</td>
<td >
<v:label name="l2" value="--(control.vc_parent as vspx_row_template).te_rowset[1]" format="%V"/>
</td>
<td>
<?vsp
{
declare file, mime any;
declare mid int;
mid := (control as vspx_row_template).te_rowset[3];
file := (control as vspx_row_template).te_rowset[4];
mime := (control as vspx_row_template).te_rowset[5];
?>
<a href="index.vspx?page=moblogimage&blogid=<?V self.blogid ?>&sid=<?V self.sid ?>&realm=<?V self.realm ?>&mid=<?V mid ?>&mime=<?V mime ?>" target="_blank">
<?vsp
if (mime like 'image/%') {
?>
<img src="index.vspx?page=moblogimage&blogid=<?V self.blogid ?>&sid=<?V self.sid ?>&realm=<?V self.realm ?>&mid=<?V mid ?>&mime=<?V mime ?>&scale=100" height="64" border="0" alt="Image" />
<?vsp
}
else {
http (file);
}
?>
</a>
<?vsp
}
?>
</td>
<td >
<small>
<v:label name="l3" value="--(control.vc_parent as vspx_row_template).te_rowset[2]"/>
</small>
</td>
<td align="right">
<v:button xhtml_class="button" action="simple" name="u1" style="url" value="BlogThis!" xhtml_title="BlogThis!" xhtml_alt="BlogThis!">
<v:on-post>
<![CDATA[
declare _subj, _msg any;
_subj := (control.vc_parent as vspx_row_template).te_rowset[1];
_msg := (control.vc_parent as vspx_row_template).te_rowset[3];
BLOG.DBA.BLOG2_BLOG_IT(self.blogid,
self.sid,
self.realm,
self.user_id,
_subj,
_msg);
http_request_status('HTTP/1.1 302 Found');
http_header(sprintf('Location: index.vspx?sid=%s&realm=%s&subj=%V&msg=%d\r\n', self.sid, self.realm, _subj, _msg));
]]>
</v:on-post>
<v:after-data-bind>
if ((control.vc_parent as vspx_row_template).te_rowset[6] = 1) {
control.ufl_value := 'Published';
control.ufl_active := 0;
}
</v:after-data-bind>
</v:button>
<!--v:button xhtml_class="button" action="simple" name="del1" value="Delete" style="url" xhtml_title="Delete" xhtml_alt="Delete">
<v:on-post>
<![CDATA[
delete from
MAIL_ATTACHMENT
where
MA_ID = (control.vc_parent as vspx_row_template).te_rowset[3] and
MA_BLOG_ID = self.blogid;
self.moblog_ds.vc_data_bind (e);
]]>
</v:on-post>
</v:button-->
</td>
</tr>
</v:template>
</v:template>
<v:template name="t3" type="simple">
<tr>
<td colspan="3" align="right">
<vm:ds-navigation data-set="moblog_ds"/>
</td>
</tr>
</v:template>
</v:data-set>
</table>
<div>
<v:button xhtml_class="real_button" name="bt1" value="Blog Selected" action="simple" xhtml_title="Blog Selected" xhtml_alt="Blog Selected"
xhtml_onclick='javascript: return checkSelected(this.form, "sel1", "No messages were selected to be blogged.");'
>
<v:on-post>
<![CDATA[
declare pars, mset, tmp any;
declare i, l int;
pars := e.ve_params;
mset := vector ();
l := length (pars);
while (i < l)
{
if (pars[i] like '%:sel1$%' and pars[i] not like 'attr-%')
{
mset := vector_concat (mset, vector (atoi(pars[i+1])));
}
i := i + 2;
}
tmp := encode_base64 (serialize (mset));
if (length (mset) > 0)
{
BLOG.DBA.BLOG2_BLOG_IT(self.blogid,
self.sid,
self.realm,
self.user_id,
'[enter a title]',
mset[0],
tmp
);
http_request_status('HTTP/1.1 302 Found');
http_header(sprintf('Location: index.vspx?msg=%d&subj=%V&mset=%s&sid=%s&realm=%s\r\n',
mset[0],
'[enter a title]',
tmp,
self.sid,
self.realm));
}
]]>
</v:on-post>
</v:button>
<v:button xhtml_class="real_button" name="delete_selected" value="Delete Selected" action="simple" xhtml_title="Delete Selected" xhtml_alt="Delete Selected"
xhtml_onclick='javascript: return checkSelected(this.form, "sel1", "No messages were selected for deletion.");'
>
<v:on-post>
<![CDATA[
declare pars any;
declare i, l int;
pars := e.ve_params;
l := length (pars);
while (i < l)
{
if (pars[i] like '%:sel1$%' and pars[i] not like 'attr-%')
{
delete from MAIL_ATTACHMENT
where MA_BLOG_ID = self.blogid and MA_ID = pars[i+1];
}
i := i + 2;
}
self.moblog_ds.vc_data_bind (e);
]]>
</v:on-post>
</v:button>
</div>
</td>
</tr>
<tr>
<td>
<v:url name="moblog_url" value="Moblog Settings" url="'index.vspx?page=ping&ping_tab=6'"/>
</td>
</tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:channels-list-widget">
<v:variable name="channel_to_remove" type="any" default="null" />
<v:variable name="sel_chan" type="any" default="null" />
<v:variable name="chan_rws" type="any" default="null" />
<v:template name="maindfdfdf" type="simple" condition="self.channel_to_remove is null">
<div>
<v:data-set name="channels_ds"
sql="select BCD_TITLE, BCD_HOME_URI, BC_CHANNEL_URI, BC_CAT_ID, BCD_FORMAT
from BLOG.DBA.SYS_BLOG_CHANNELS, BLOG.DBA.SYS_BLOG_CHANNEL_INFO
where BC_BLOG_ID = :bid and BCD_CHANNEL_URI = BC_CHANNEL_URI"
nrows="10"
scrollable="1"
cursor-type="keyset"
edit="1"
width="80">
<v:param name="bid" value="--self.blogid"/>
<v:on-init>
<![CDATA[
if (self.sel_chan is null)
self.sel_chan := vector ();
]]>
</v:on-init>
<v:before-render>
<![CDATA[
self.chan_rws := control.ds_row_data;
]]>
</v:before-render>
<v:on-post>
<![CDATA[
declare rows, pars, sel, i, l any;
pars := e.ve_params;
rows := self.chan_rws;
l := length (rows);
sel := self.sel_chan;
for (i := 0; i < l; i := i + 1)
{
declare elm, pos, lef, rig any;
elm := rows[i];
pos := position (elm[2], sel);
if (pos)
{
lef := subseq (sel, 0, pos - 1);
rig := subseq (sel, pos, length (sel));
sel := vector_concat (lef, rig);
}
}
l := length (pars);
for (i := 0; i < l; i := i + 2)
{
if (pars[i] = 'chan_cb')
sel := vector_concat (sel, vector (pars[i+1]));
}
self.sel_chan := sel;
if (e.ve_button is not null)
self.btn_bmk := 'btn_' || e.ve_button.vc_get_name ();
]]>
</v:on-post>
<v:template name="channels_template1" type="simple" name-to-remove="table" set-to-remove="bottom">
<h3>Links</h3>
<table class="listing">
<tr class="listing_header_row">
<th><input type="checkbox" name="selectall" value="Select All" onclick="selectAllCheckboxes (this.form, this, 'chan_cb')"/></th>
<th>Title</th>
<th>Category</th>
<th>RSS file</th>
<!--th>Cached</th-->
<th>Action</th>
</tr>
</table>
</v:template>
<v:template name="channels_template2" type="repeat" name-to-remove="" set-to-remove="">
<v:template name="channels_template7" type="if-not-exists" name-to-remove="table" set-to-remove="both">
<table>
<tr class="listing_count">
<td class="listing_count" colspan="6">
No channel data
</td>
</tr>
</table>
</v:template>
<v:template name="channels_template4" type="browse" name-to-remove="table" set-to-remove="both">
<table>
<?vsp
self.r_count := self.r_count + 1;
http (sprintf ('<tr class="%s">', case when mod (self.r_count, 2) then 'listing_row_odd' else 'listing_row_even' end));
?>
<td>
<?vsp
declare chk varchar;
chk := '';
if (position (control.te_rowset[2], self.sel_chan))
chk := ' checked="1"';
http (sprintf ('<input type="checkbox" name="chan_cb" value="%s" %s />', control.te_rowset[2], chk));
?>
</td>
<td class="listing_col" nowrap="1">
<v:url xhtml_class="button" name="label5"
value="--(control.vc_parent as vspx_row_template).te_rowset[0]"
format="%s"
url="--(control.vc_parent as vspx_row_template).te_rowset[1]"/>
</td>
<td class="listing_col">
<v:label name="channels_label52" value="">
<v:after-data-bind>
<![CDATA[
control.ufl_value := (control.vc_parent as vspx_row_template).te_rowset[4];
if (control.ufl_value not in ('OCS', 'OPML'))
control.ufl_value := coalesce ((select BCC_NAME from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY where BCC_BLOG_ID = self.blogid and BCC_ID = (control.vc_parent as vspx_row_template).te_rowset[3]), 'not listed');
]]>
</v:after-data-bind>
</v:label>
</td>
<td class="listing_col" nowrap="1">
<v:url xhtml_class="button" name="channels_label6"
value="--substring ((control.vc_parent as vspx_row_template).te_rowset[2], 1 , 50)"
format="%s"
url="--(control.vc_parent as vspx_row_template).te_rowset[2]"/>
</td>
<!--td class="listing_col_num">
<v:label name="channels_label7" value="" format="%d" width="80">
<v:after-data-bind>
declare cnt any;
select count(*) into cnt from BLOG.DBA.SYS_BLOG_CHANNEL_FEEDS where CF_CHANNEL_URI = (control.vc_parent as vspx_row_template).te_rowset[2];
control.ufl_value := cnt;
</v:after-data-bind>
</v:label>
</td-->
<td class="listing_col_action" nowrap="1">
<v:button xhtml_class="button" name="channels_edit1" value="Edit" style="url" action="simple">
<v:after-data-bind>
<![CDATA[
control.ufl_value := '<img src="/weblog/public/images/edit_16.png" border="0" alt="Edit" title="Edit"/> Edit';
]]>
</v:after-data-bind>
<v:on-post>
<![CDATA[
http_request_status ('HTTP/1.1 302 Found');
http_header(sprintf(
'Location: index.vspx?page=channels&sid=%s&realm=%s&uri=%s\r\n\r\n',
self.sid ,
self.realm,
(control.vc_parent as vspx_row_template).te_rowset[2]));
return;
]]>
</v:on-post>
</v:button>
<v:button xhtml_class="button" name="channels_ds_delete" value="Delete" style="url" action="simple">
<v:after-data-bind>
<![CDATA[
control.ufl_value := '<img src="/weblog/public/images/trash_16.png" border="0" alt="Delete" title="Delete"/> Delete';
]]>
</v:after-data-bind>
<v:on-post>
<![CDATA[
self.channel_to_remove := vector();
self.channel_to_remove := vector((control.vc_parent as vspx_row_template).te_rowset[2]);
self.vc_data_bind (e);
]]>
</v:on-post>
</v:button>
</td>
<?vsp
http ('</tr>');
?>
</table>
</v:template>
</v:template>
<v:template name="channels_template3" type="simple" name-to-remove="table" set-to-remove="top">
<table>
<tr class="browse_button_row">
<td colspan="4" align="center">
<vm:ds-navigation data-set="channels_ds"/>
</td>
<td class="listing_col_action">
<?vsp
if (exists(select 1 from BLOG.DBA.SYS_BLOG_CHANNELS, BLOG.DBA.SYS_BLOG_CHANNEL_INFO where BC_BLOG_ID = self.blogid and BCD_CHANNEL_URI = BC_CHANNEL_URI))
{
?>
<table>
<tr>
<td>
<!-- old behaviour -->
<v:button name="add_cont_sel" action="simple" value="Add to contacts" style="button" xhtml_class="real_button" instantiate="0">
<v:on-post>
<![CDATA[
declare pars any;
declare i, l int;
pars := e.ve_params;
l := length(pars);
for (i := 0; i < l; i := i + 2)
{
if (pars[i] = 'chan_cb')
{
BLOG..ADD_CONTACT_FROM_FEED (pars[i + 1], self.blogid);
}
nextf:;
}
]]>
</v:on-post>
</v:button>
<a href="javascript: void(0)"
onclick="javascript: if (checkSelected(document.forms['page_form'], 'chan_cb', 'No links were selected for deletion.')) doPost ('page_form', 'delete_sel'); return false;"
><img src="/weblog/public/images/trash_16.png" border="0" hspace="3" />Delete selected</a>
<?vsp if (0) { ?>
<v:button name="delete_sel" action="simple" value="Delete selected" style="url"
>
<v:after-data-bind>
<![CDATA[
control.ufl_value := '<img src="/weblog/public/images/trash_16.png" border="0" alt="Delete selected" title="Delete selected"/> Delete selected';
]]>
</v:after-data-bind>
<v:on-post>
<![CDATA[
self.channel_to_remove := vector();
declare pars any;
declare i, l int;
pars := e.ve_params;
l := length(pars);
for (i := 0; i < l; i := i + 2)
{
if (pars[i] = 'chan_cb')
self.channel_to_remove := vector_concat(self.channel_to_remove, vector(pars[i + 1]));
nextf:;
}
if (length(self.channel_to_remove) = 0)
self.channel_to_remove := null;
self.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
<?vsp } ?>
<v:button name="delete_all" action="simple" value="Delete all" style="url">
<v:after-data-bind>
<![CDATA[
control.ufl_value := '<img src="/weblog/public/images/trash_16.png" border="0" alt="Delete all" title="Delete all"/> Delete all';
]]>
</v:after-data-bind>
<v:on-post>
<![CDATA[
self.channel_to_remove := vector();
for select BC_CHANNEL_URI
from BLOG.DBA.SYS_BLOG_CHANNELS, BLOG.DBA.SYS_BLOG_CHANNEL_INFO
where BC_BLOG_ID = self.blogid and BCD_CHANNEL_URI = BC_CHANNEL_URI do
{
self.channel_to_remove := vector_concat(self.channel_to_remove, vector(BC_CHANNEL_URI));
}
self.vc_data_bind (e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
<?vsp
}
?>
</td>
</tr>
</table>
</v:template>
</v:data-set>
<?vsp
if (self.btn_bmk is not null)
{
http ('\n<script type="text/javascript">\n');
http (sprintf ('location.hash = "%s";\n', self.btn_bmk));
http ('</script>\n');
}
?>
</div>
</v:template>
<v:template name="main2" type="simple" condition="self.channel_to_remove is not null">
<div>
<v:form name="event_form2" type="simple" method="POST" action="">
<div class="box_noscroll" id="accesspoints">
<h3 style="align: left">Channel(s) remove confirmation</h3>
<table border="0">
<tr>
<td>Are you sure you want to remove the following channels?
<b>
<?vsp
declare len, i int;
i := 0;
len := length(self.channel_to_remove);
while (i < len)
{
http(sprintf('<br/>%s', self.channel_to_remove[i]));
i := i + 1;
}
?>
</b>
</td>
</tr>
<tr>
<td align="center">
<v:button xhtml_class="real_button" action="simple" name="cancel1" value="Cancel" xhtml_title="Cancel" xhtml_alt="Cancel">
<v:on-post>
<![CDATA[
self.channel_to_remove := null;
self.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
<v:button xhtml_class="real_button" action="simple" name="rem" value="Remove" xhtml_title="Remove" xhtml_alt="Remove">
<v:on-post>
<![CDATA[
commit work;
declare exit handler for sqlstate '*'
{
self.vc_is_valid := 0;
self.channel_to_remove := null;
self.vc_error_message := concat (__SQL_STATE,' ',__SQL_MESSAGE);
rollback work;
return;
};
declare len, i int;
i := 0;
len := length(self.channel_to_remove);
while (i < len)
{
delete from BLOG.DBA.SYS_BLOG_CHANNELS
where BC_BLOG_ID = self.blogid and BC_CHANNEL_URI = self.channel_to_remove[i];
i := i + 1;
}
self.channel_to_remove := null;
self.channels_ds.vc_data_bind (e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</div>
</v:form>
</div>
</v:template>
<div>
<v:url xhtml_class="" name="cats1" url="index.vspx?page=channels_ctgs" value="Edit Link Categories"/>
</div>
<div>
<v:url xhtml_class="" name="feed_sub1" url="index.vspx?page=channels" value="New Link"/>
</div>
</xsl:template>
<xsl:template match="vm:channels-widget">
<!--![CDATA[
<script type="text/javascript">
function reloadIframe1()
{
if (window.top.frames['ifrm'])
window.top.frames['ifrm'].location = 'index.vspx?page=wa_left&mode=feed&mode2=edit&sid=' + '<?V self.sid ?>' + '&realm=' + '<?V self.realm ?>';
}
window.onload = reloadIframe1;
</script>
]]-->
<script type="text/javascript"><![CDATA[
function GetElementsWithClassName(elementName, className) {
var allElements = document.getElementsByTagName(elementName);
var elemColl = new Array();
for (i = 0; i < allElements.length; i++) {
if (allElements[i].className == className) {
elemColl[elemColl.length] = allElements[i];
}
}
return elemColl;
}
function meChecked()
{
var undefined;
var eMe = document.getElementById('me');
if (eMe == undefined) return false;
else return eMe.checked;
}
function upit() {
var isMe = meChecked();
var inputColl = GetElementsWithClassName('input', 'valinp');
var results = document.getElementById('xfnResult');
var linkText, linkUrl, inputs = '';
linkText = '';
linkUrl = '';
for (i = 0; i < inputColl.length; i++) {
inputColl[i].disabled = isMe;
inputColl[i].parentNode.className = isMe ? 'disabled' : '';
if (!isMe && inputColl[i].checked && inputColl[i].value != '') {
inputs += inputColl[i].value + ' ';
}
}
inputs = inputs.substr(0,inputs.length - 1);
if (isMe) inputs='me';
results.value = inputs;
}
function blurry() {
if (!document.getElementById) return;
var aInputs = GetElementsWithClassName('input', 'valinp');
var eMe = document.getElementById('me');
var xfnResult = document.getElementById ('xfnResult');
if (eMe == null)
return;
eMe.onclick = eMe.onkeyup = upit;
if (xfnResult.value.indexOf (eMe.value) != -1)
{
eMe.checked = true;
}
for (var i = 0; i < aInputs.length; i++) {
aInputs[i].onclick = aInputs[i].onkeyup = upit;
aInputs[i].disabled = eMe.checked;
if (aInputs[i].value.length > 0 && xfnResult.value.indexOf (aInputs[i].value) != -1)
{
aInputs[i].checked = true;
}
}
}
function resetstuff() {
if (meChecked()) document.getElementById('me').checked='';
upit();
document.getElementById('xfnResult').childNodes[0].nodeValue = '<a href="" rel=""><\/a>';
}
window.onload = blurry;
]]></script>
<v:before-data-bind>
<![CDATA[
if (get_keyword('uri', self.vc_event.ve_params) is not null)
{
self.step1.vc_enabled := 0;
self.step2_rss.vc_enabled := 1;
select BCD_TITLE, BCD_HOME_URI, BCD_CHANNEL_URI,
BCD_IS_BLOG, BCD_FORMAT, BCD_UPDATE_PERIOD
, BCD_LANG, BCD_UPDATE_FREQ, BCD_SOURCE_URI, BC_CAT_ID, coalesce (BC_SHARED, 0),
BCD_AUTHOR_NAME, BCD_AUTHOR_EMAIL, BC_REL
into self.tit, self.home, self.rss, self.is_blog, self.format,
self.upd_per, self.lang, self.upd_freq, self.src_uri1,
self.f_cat_id,self.is_cshared.ufl_selected, self.aut, self.mail, self.xfn_words
from BLOG.DBA.SYS_BLOG_CHANNEL_INFO, BLOG.DBA.SYS_BLOG_CHANNELS
where BCD_CHANNEL_URI = get_keyword('uri', self.vc_event.ve_params)
and BC_CHANNEL_URI = BCD_CHANNEL_URI and BC_BLOG_ID = self.blogid;
self.f_cat_name := (select BCC_NAME from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY
where BCC_ID = self.f_cat_id and BCC_BLOG_ID = self.blogid);
self.new_chan_cat.ufl_value := '';
self.old_rss := self.rss;
self.tit := BLOG..blog_utf2wide(self.tit);
}
]]>
</v:before-data-bind>
<input name="page" value="channels" type="hidden"/>
<div style="align: left">
<v:template type="simple" name="step1">
<v:method name="subscribe_routine1" arglist="in url varchar, inout xt any">
<![CDATA[
declare cont varchar;
declare ct any;
if (exists(select 1 from BLOG.DBA.SYS_BLOG_CHANNELS where BC_CHANNEL_URI = url and BC_BLOG_ID = self.blogid))
{
self.vc_is_valid := 0;
self.vc_error_message := 'You already have subscription to this channel';
return 0;
}
declare exit handler for sqlstate '*'
{
self.vc_is_valid := 0;
self.vc_error_message := __SQL_MESSAGE;
return 0;
};
declare hp, proto any;
hp := WS.WS.PARSE_URI (url);
proto := lower(hp[0]);
if (proto <> 'http')
{
cont := DB.DBA.XML_URI_GET(url, '');
}
else
{
declare ur, ou, hdr varchar;
declare tries int;
tries := 0;
ur := url;
ou := ur;
try_again:
if (tries > 15)
{
signal ('42000', 'Too many redirects or redirect loops back, please specify the correct URL.');
return 0;
}
cont := http_get (ur, hdr);
if (hdr[0] like 'HTTP/1._ 30_ %')
{
ur := http_request_header (hdr, 'Location');
ur := WS.WS.EXPAND_URL (ou, ur);
if (ur <> ou)
{
ou := ur;
tries := tries + 1;
goto try_again;
}
}
if (hdr[0] like 'HTTP/1._ 4__ %' or hdr[0] like 'HTTP/1._ 5__ %')
{
signal ('22023', hdr[0]);
return 0;
}
}
ct := http_mime_type(url);
declare exit handler for sqlstate '*'
{
goto htmlp;
};
xt := xml_tree_doc(xml_tree(cont, 0));
goto donep;
htmlp:;
xt := xml_tree_doc(xml_tree(cont, 2, '', 'UTF-8'));
donep:;
return 1;
]]>
</v:method>
<h3>Home Page Links</h3>
<table>
<tr>
<td colspan="2">
<p>
Enter the URL of the blog you wish to subscribe to, and MyOpenLink will
attempt to locate the appropriate feed.
<!--An easier way to subscribe to blogs and newsfeeds is to use the Easy
Subscribe Button, which makes subscribing to a blog you're viewing just
one click way. -->
</p>
</td>
</tr>
<tr>
<th align="right">
<label for="channels_widget_url1">Blog or Feed URL</label>
</th>
<td class="input">
<v:text xhtml_class="textbox" xhtml_id="channels_widget_url1" name="channels_widget_url1" value="" xhtml_size="30"/>
<v:button xhtml_class="real_button" action="simple" name="get" value="Subscribe" xhtml_title="Subscribe" xhtml_alt="Subscribe">
<v:on-post>
<![CDATA[
declare tit, rss, home varchar;
declare format, upd_per, upd_freq, lang, src_uri, src_tit, email varchar;
declare channels, links any;
declare cont varchar;
declare xt, ct any;
declare url varchar;
url := trim(self.channels_widget_url1.ufl_value);
if (url is null or url = '')
{
self.vc_is_valid := 0;
self.channels_widget_url1.vc_error_message := 'Please enter correct channel URL';
return;
}
channels := null;
links := null;
if (self.subscribe_routine1(url, xt) = 0)
return;
-- HTML, do auto discovery of the feeds
if (xpath_eval('/html', xt, 1) is not null)
{
declare rss_f, atom, ocs, opml any;
tit := cast(xpath_eval('//title[1]/text()', xt, 1) as varchar);
rss_f := xpath_eval('//head/link[ @rel="alternate" and @type="application/rss+xml" ]/@href', xt, 0);
atom := xpath_eval('//head/link[ @rel="alternate" and @type="application/atom+xml" ]/@href', xt, 0);
opml := xpath_eval('//head/link[ @rel="subscriptions" and @type="text/x-opml" ]/@href', xt, 0);
format := '';
rss := '';
if (length(rss_f) = 1 and length(atom) = 0 and length(opml) = 0)
{
rss := cast (rss_f[0] as varchar);
format := 'http://my.netscape.com/rdf/simple/0.9/';
}
else if (length(atom) = 1 and length(rss_f) = 0 and length(opml) = 0)
{
rss := cast (atom[0] as varchar);
format := 'http://purl.org/atom/ns#';
}
else if (length(atom) >= 1 or length(rss_f) >= 1 or length(opml) >= 1)
{
rss_f := xpath_eval('//head/link[ @rel="alternate" and @type="application/rss+xml" ]', xt, 0);
atom := xpath_eval('//head/link[ @rel="alternate" and @type="application/atom+xml" ]', xt, 0);
opml := xpath_eval('//head/link[ @rel="subscriptions" and @type="text/x-opml" ]', xt, 0);
self.autodisc := vector (rss_f, atom, opml);
}
home := url;
lang := '';
upd_per := '';
upd_freq := 1;
}
-- RSS feed
else if (xpath_eval('/rss|/RDF/channel', xt, 1) is not null)
{
xt := xml_cut(xpath_eval('/rss/channel[1]|/RDF/channel[1]', xt, 1));
tit := xpath_eval('/channel/title/text()', xt, 1);
home := cast(xpath_eval('/channel/link/text()', xt, 1) as varchar);
email := cast(xpath_eval('/channel/managingEditor/text()', xt, 1) as varchar);
rss := url;
format := 'http://my.netscape.com/rdf/simple/0.9/';
lang := cast(xpath_eval('/channel/language/text()', xt, 1) as varchar);
upd_per := 'hourly';
upd_freq := 1;
}
-- ATOM feed
else if (xpath_eval('/feed', xt, 1) is not null)
{
tit := cast(xpath_eval('/feed/title/text()', xt, 1) as varchar);
home := cast(xpath_eval('/feed/link[@rel="alternate"]/@href', xt, 1) as varchar);
email := cast(xpath_eval('/feed/author/email/text()', xt, 1) as varchar);
rss := url;
format := 'http://purl.org/atom/ns#';
lang := cast(xpath_eval('/feed/@lang', xt, 1) as varchar);
upd_per := 'hourly';
upd_freq := 1;
}
-- OCS directory
else if (xpath_eval('[ xmlns:ocs="http://alchemy.openjava.org/ocs/directory#" xmlns:ocs1="http://InternetAlchemy.org/ocs/directory#" ] /RDF//ocs:format|/RDF//ocs1:format', xt, 1) is not null)
{
tit := '';
declare cnls any;
declare ns varchar;
declare i, l int;
ns := '[ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" ' ||
' xmlns:ocs="http://alchemy.openjava.org/ocs/directory#" ' ||
' xmlns:ocs1="http://InternetAlchemy.org/ocs/directory#" ' ||
' xmlns:dc="http://purl.org/metadata/dublin_core#" ] ';
cnls := xpath_eval (ns || '/rdf:RDF/rdf:description[1]/rdf:description', xt, 0);
src_tit := xpath_eval (ns || '/rdf:RDF/rdf:description[1]/dc:title/text()', xt, 1);
i := 0;
l := length(cnls);
channels := vector();
while (i < l)
{
declare title, about varchar;
declare formats any;
tit := xpath_eval(ns||'/rdf:description/dc:title/text()', xml_cut(cnls[i]), 1);
about := xpath_eval(ns||'/rdf:description/@about', xml_cut(cnls[i]), 1);
formats := xpath_eval(ns||'/rdf:description/rdf:description[ocs:format or ocs1:format]', xml_cut(cnls[i]), 0);
channels := vector_concat(channels, vector(tit, about, formats));
i := i + 1;
}
}
-- OPML file
else if (xpath_eval('/opml', xt, 1) is not null)
{
tit := '';
src_tit := coalesce(xpath_eval('/opml/head/title/text()', xt, 1), 'Title n/a');
links := xpath_eval('/opml/body/outline[ @htmlUrl and @xmlUrl ]', xt, 0);
}
else
{
self.vc_is_valid := 0;
self.vc_error_message := 'Unknown format';
return;
}
self.step1.vc_enabled := 0;
declare template vspx_template;
if (self.autodisc is not null)
template := self.step2_autodisc;
else if (channels is not null)
{
template := self.step2_ocs;
self.data1 := channels;
}
else if (links is not null)
{
template := self.step2_opml;
self.data1 := links;
}
else
{
self.tit := tit;
self.rss := rss;
self.home := home;
self.lang := lang;
self.femail := email;
self.format := format;
self.upd_per := upd_per;
self.upd_freq := upd_freq;
template := self.step2_rss;
}
self.src_tit := src_tit;
self.src_uri := url;
template.vc_enabled := 1;
template.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
<tr>
<td class="description" colspan="2">
<p>
or use one of the shortcuts below:
<!--Below are shortcuts that make it easy to subscribe to Blog Spot blogs,
Live Journals, Xangas, Google Groups and Yahoo Groups.-->
</p>
</td>
</tr>
<tr>
<td align="right">
<a href="http://www.blogspot.com">
<img border="0">
<xsl:if test="@image">
<xsl:attribute name="src"><?vsp
if (self.custom_img_loc)
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
else
http(self.stock_img_loc || 'blogspot.gif');
?></xsl:attribute>
</xsl:if>
<xsl:if test="not @image">
<xsl:attribute name="src"><?vsp http(self.stock_img_loc || 'blogspot.gif'); ?></xsl:attribute>
</xsl:if>
</img>
</a>
</td>
<td class="input">
<v:text xhtml_class="textbox" xhtml_id="bsuser" name="bsuser" value="" xhtml_size="30"/>
<v:button xhtml_class="real_button" action="simple" name="bssub" value="Blogspot User" xhtml_title="Blogspot User" xhtml_alt="Blogspot User">
<v:on-post>
<![CDATA[
declare tit, rss, home varchar;
declare format, upd_per, upd_freq, lang, src_uri, src_tit, email varchar;
declare channels, links any;
declare cont varchar;
declare xt, ct any;
declare url varchar;
channels := null;
links := null;
url := trim(self.bsuser.ufl_value);
if (url is null or url = '')
{
self.vc_is_valid := 0;
self.vc_error_message := 'Please enter correct Blogspot User';
return;
}
url := sprintf('http://%s.blogspot.com/atom.xml', url);
if (self.subscribe_routine1(url, xt) = 0)
return;
if (xpath_eval('/feed', xt, 1) is not null)
{
tit := xpath_eval('/feed/title/text()', xt, 1);
home := cast(xpath_eval('/feed/link[@rel="alternate"]/@href', xt, 1) as varchar);
email := cast (xpath_eval ('/feed/author/email/text()', xt, 1) as varchar);
rss := url;
format := 'http://purl.org/atom/ns#';
lang := cast(xpath_eval('/feed/@lang', xt, 1) as varchar);
upd_per := 'hourly';
upd_freq := 1;
}
else
{
self.vc_is_valid := 0;
self.vc_error_message := 'Unknown Blogspot User';
return;
}
self.step1.vc_enabled := 0;
declare template vspx_template;
if (self.autodisc is not null)
{
template := self.step2_autodisc;
}
else if (channels is not null)
{
template := self.step2_ocs;
self.data1 := channels;
}
else if (links is not null)
{
template := self.step2_opml;
self.data1 := links;
}
else
{
self.tit := tit;
self.rss := rss;
self.home := home;
self.lang := lang;
self.femail := email;
self.format := format;
self.upd_per := upd_per;
self.upd_freq := upd_freq;
template := self.step2_rss;
}
self.src_tit := src_tit;
self.src_uri := url;
template.vc_enabled := 1;
template.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
<tr>
<td align="right">
<a href="http://www.livejournal.com">
<img border="0">
<xsl:if test="@image">
<xsl:attribute name="src"><?vsp
if (self.custom_img_loc)
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
else
http(self.stock_img_loc || 'livejournal.gif');
?></xsl:attribute>
</xsl:if>
<xsl:if test="not @image">
<xsl:attribute name="src"><?vsp http(self.stock_img_loc || 'livejournal.gif'); ?></xsl:attribute>
</xsl:if>
</img>
</a>
</td>
<td class="input">
<v:text xhtml_class="textbox" xhtml_id="ljuser" name="ljuser" value="" xhtml_size="30"/>
<v:button xhtml_class="real_button" action="simple" name="ljsub" value="LiveJournal User" xhtml_title="LiveJournal User" xhtml_alt="LiveJournal User">
<v:on-post>
<![CDATA[
declare tit, rss, home varchar;
declare format, upd_per, upd_freq, lang, src_uri, src_tit, email varchar;
declare channels, links any;
declare cont varchar;
declare xt, ct any;
declare url varchar;
channels := null;
links := null;
url := trim(self.ljuser.ufl_value);
if (url is null or url = '')
{
self.vc_is_valid := 0;
self.vc_error_message := 'Please enter correct LiveJournal User';
return;
}
url := sprintf('http://www.livejournal.com/users/%s/data/rss', url);
if (self.subscribe_routine1(url, xt) = 0)
return;
-- RSS feed
if (xpath_eval ('/rss|/RDF/channel', xt, 1) is not null)
{
xt := xml_cut (xpath_eval ('/rss/channel[1]|/RDF/channel[1]', xt, 1));
--tit := cast (xpath_eval ('/channel/title/text()', xt, 1) as varchar);
tit := xpath_eval ('/channel/title/text()', xt, 1);
home := cast (xpath_eval ('/channel/link/text()', xt, 1) as varchar);
email := cast (xpath_eval ('/channel/managingEditor/text()', xt, 1) as varchar);
rss := url;
format := 'http://my.netscape.com/rdf/simple/0.9/';
lang := cast(xpath_eval('/channel/language/text()', xt, 1) as varchar);
upd_per := 'hourly';
upd_freq := 1;
}
else
{
self.vc_is_valid := 0;
self.vc_error_message := 'Unknown LiveJournal User';
return;
}
self.step1.vc_enabled := 0;
declare template vspx_template;
if (self.autodisc is not null)
{
template := self.step2_autodisc;
}
else if (channels is not null)
{
template := self.step2_ocs;
self.data1 := channels;
}
else if (links is not null)
{
template := self.step2_opml;
self.data1 := links;
}
else
{
self.tit := tit;
self.rss := rss;
self.home := home;
self.lang := lang;
self.femail := email;
self.format := format;
self.upd_per := upd_per;
self.upd_freq := upd_freq;
template := self.step2_rss;
}
self.src_tit := src_tit;
self.src_uri := url;
template.vc_enabled := 1;
template.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
<tr>
<td align="right">
<a href="http://www.xanga.com">
<img border="0">
<xsl:if test="@image">
<xsl:attribute name="src"><?vsp
if (self.custom_img_loc)
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
else
http(self.stock_img_loc || 'xangalogo.gif');
?></xsl:attribute>
</xsl:if>
<xsl:if test="not @image">
<xsl:attribute name="src"><?vsp http(self.stock_img_loc || 'xangalogo.gif'); ?></xsl:attribute>
</xsl:if>
</img>
</a>
</td>
<td class="input">
<v:text xhtml_class="textbox" xhtml_id="xuser" name="xuser" value="" xhtml_size="30"/>
<v:button xhtml_class="real_button" action="simple" name="xsub" value="Xanga User" xhtml_title="Xanga User" xhtml_alt="Xanga User">
<v:on-post>
<![CDATA[
declare tit, rss, home varchar;
declare format, upd_per, upd_freq, lang, src_uri, src_tit, email varchar;
declare channels, links any;
declare cont varchar;
declare xt, ct any;
declare url varchar;
channels := null;
links := null;
url := trim(self.xuser.ufl_value);
if (url is null or url = '')
{
self.vc_is_valid := 0;
self.vc_error_message := 'Please enter correct Xanga User';
return;
}
url := sprintf('http://www.xanga.com/rss.aspx?user=%s', url);
if (self.subscribe_routine1(url, xt) = 0)
return;
if (xpath_eval ('/rss|/RDF/channel', xt, 1) is not null)
{
xt := xml_cut (xpath_eval ('/rss/channel[1]|/RDF/channel[1]', xt, 1));
--tit := cast (xpath_eval ('/channel/title/text()', xt, 1) as varchar);
tit := xpath_eval ('/channel/title/text()', xt, 1);
home := cast (xpath_eval ('/channel/link/text()', xt, 1) as varchar);
email := cast (xpath_eval ('/channel/managingEditor/text()', xt, 1) as varchar);
rss := url;
format := 'http://my.netscape.com/rdf/simple/0.9/';
lang := cast(xpath_eval('/channel/language/text()', xt, 1) as varchar);
upd_per := 'hourly';
upd_freq := 1;
}
else
{
self.vc_is_valid := 0;
self.vc_error_message := 'Unknown Xanga User';
return;
}
self.step1.vc_enabled := 0;
declare template vspx_template;
if (self.autodisc is not null)
{
template := self.step2_autodisc;
}
else if (channels is not null)
{
template := self.step2_ocs;
self.data1 := channels;
}
else if (links is not null)
{
template := self.step2_opml;
self.data1 := links;
}
else
{
self.tit := tit;
self.rss := rss;
self.home := home;
self.lang := lang;
self.femail := email;
self.format := format;
self.upd_per := upd_per;
self.upd_freq := upd_freq;
template := self.step2_rss;
}
self.src_tit := src_tit;
self.src_uri := url;
template.vc_enabled := 1;
template.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</v:template>
<v:template type="simple" name="step2_rss" initial-enable="0">
<h2>RSS Feed</h2>
<table>
<tr>
<th>Title</th>
<td>
<v:text xhtml_class="textbox" name="tit1" xhtml_size="70%" value="--BLOG..blog_utf2wide(self.tit)" error-glyph="*">
</v:text>
</td>
</tr>
<tr>
<th>Author</th>
<td>
<v:text xhtml_class="textbox" name="aut1" xhtml_size="70%" value="--BLOG..blog_utf2wide(self.aut)" error-glyph="*">
</v:text>
</td>
</tr>
<tr>
<th>Author E-mail</th>
<td>
<v:text xhtml_class="textbox" name="mail1" xhtml_size="70%" value="--self.mail" error-glyph="*">
</v:text>
</td>
</tr>
<tr>
<th>Home</th>
<td>
<v:text xhtml_class="textbox" name="home1" xhtml_size="70%" value="--self.home" error-glyph="*"/>
<label for="me"><input type="checkbox" name="identity" value="me" id="me" />another web address of mine</label>
</td>
</tr>
<tr><th colspan="2"><h2>Relationship Category</h2></th></tr>
<tr>
<th scope="row">
friendship
</th>
<td>
<label for="friendship-contact"><input class="valinp" type="radio" name="friendship" value="contact" id="friendship-contact" />contact </label>
<label for="friendship-acquaintance"><input class="valinp" type="radio" name="friendship" value="acquaintance" id="friendship-acquaintance" />acquaintance </label>
<label for="friendship-friend"><input class="valinp" type="radio" name="friendship" value="friend" id="friendship-friend" />friend </label>
<label for="friendship-none"><input class="valinp" type="radio" name="friendship" value="" id="friendship-none" />none</label>
</td>
</tr>
<tr>
<th scope="row">
physical
</th>
<td>
<label for="met"><input class="valinp" type="checkbox" name="physical" value="met" id="met" />met</label>
</td>
</tr>
<tr>
<th scope="row">
professional
</th>
<td>
<label for="co-worker"><input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" />co-worker </label>
<label for="colleague"><input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" />colleague</label>
</td>
</tr>
<tr>
<th scope="row">
geographical
</th>
<td>
<label for="co-resident"><input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" />co-resident </label>
<label for="neighbor"><input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" />neighbor </label>
<label for="geographical-none"><input class="valinp" type="radio" name="geographical" value="" id="geographical-none" />none</label>
</td>
</tr>
<tr>
<th scope="row">
family
</th>
<td>
<label for="family-child"><input class="valinp" type="radio" name="family" value="child" id="family-child" />child </label>
<label for="family-parent"><input class="valinp" type="radio" name="family" value="parent" id="family-parent" />parent </label>
<label for="family-sibling"><input class="valinp" type="radio" name="family" value="sibling" id="family-sibling" />sibling </label>
<label for="family-spouse"><input class="valinp" type="radio" name="family" value="spouse" id="family-spouse" />spouse </label>
<label for="family-kin"><input class="valinp" type="radio" name="family" value="kin" id="family-kin" />kin </label>
<label for="family-none"><input class="valinp" type="radio" name="family" value="" id="family-none" />none</label>
</td>
</tr>
<tr>
<th scope="row">
romantic
</th>
<td>
<label for="muse"><input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" />muse </label>
<label for="crush"><input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" />crush </label>
<label for="date"><input class="valinp" type="checkbox" name="romantic" value="date" id="date" />date </label>
<label for="sweetheart"><input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="sweetheart" />sweetheart</label>
</td>
</tr>
<v:text type="hidden" name="xfnResult" xhtml_id="xfnResult" value="--self.xfn_words" />
<tr><th colspan="2"><h2>Link Details</h2></th></tr>
<tr>
<th>RSS</th>
<td>
<v:text xhtml_class="textbox" name="rss1" xhtml_size="70%" value="--self.rss" error-glyph="*">
</v:text>
</td>
</tr>
<tr>
<th>Format</th>
<td>
<v:text xhtml_class="textbox" name="format1" xhtml_size="70%" value="--self.format" error-glyph="*">
</v:text>
</td>
</tr>
<tr>
<th>Language</th>
<td>
<v:text xhtml_class="textbox" name="lang1" xhtml_size="70%" value="--self.lang"/>
</td>
</tr>
<tr>
<th>Update Period</th>
<td>
<v:select-list xhtml_class="select" name="upd_per1" xhtml_id="ups" value="--cast(self.upd_per as varchar)">
<v:item name="hourly" value="hourly"/>
<v:item name="daily" value="daily"/>
<v:item name="weekly" value="weekly"/>
<v:item name="monthly" value="monthly"/>
<v:item name="yearly" value="yearly"/>
</v:select-list>
</td>
</tr>
<tr>
<th>Update Frequency</th>
<td>
<v:text xhtml_class="textbox" name="upd_freq1" xhtml_size="70%" value="--self.upd_freq" error-glyph="->">
<v:validator test="regexp" regexp="^[0-9]+$" message="Number is expected" runat='client'/>
<v:validator test="regexp" regexp="^[^0]" message="Number must be > 0" runat='client'/>
</v:text>
<div style="display:inline; color:red;"><v:field-error field="upd_freq1"/></div>
</td>
</tr>
<tr>
<th>Select Channel Category</th>
<td>
<v:data-list xhtml_class="select" name="chan_cat" enabled="--case when self.format in ('OCS', 'OPML') then 0 else 1 end"
sql="select BCC_NAME from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY where BCC_BLOG_ID = self.blogid
union select 'Blog Roll' BCC_NAME from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid
union select 'Channel Roll' BCC_NAME from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid
order by 1" key-column="BCC_NAME" value-column="BCC_NAME">
<v:after-data-bind>
control.ufl_value := self.f_cat_name;
control.vs_set_selected ();
</v:after-data-bind>
</v:data-list>
</td>
</tr>
<tr>
<th>
or Define New Channel Category
</th>
<td>
<v:text xhtml_class="textbox" name="new_chan_cat" xhtml_size="40%" value="--''"
enabled="--case when self.format in ('OCS', 'OPML') then 0 else 1 end" />
<v:check-box xhtml_id="is_blog_roll" name="is_blog_roll" value="1" >
<v:before-render>
control.ufl_selected := self.is_blog;
</v:before-render>
</v:check-box>
<label for="is_blog_roll">Is Blog Roll</label>
</td>
</tr>
<tr>
<td>
<v:check-box xhtml_id="is_cshared" name="is_cshared" value="1" />
</td>
<th>
<label for="is_cshared">Share</label>
</th>
</tr>
</table>
<p>
<v:button xhtml_class="real_button" action="simple" name="sav1" value="Save" xhtml_title="Save" xhtml_alt="Save">
<v:on-post>
<![CDATA[
declare hom, xfn_rel varchar;
declare freq integer;
declare f_is_blog int;
xfn_rel := get_keyword ('xfnResult', e.ve_params, '');
if (trim(self.home1.ufl_value) = '')
hom := null;
else
hom := trim(self.home1.ufl_value);
freq := atoi(trim(self.upd_freq1.ufl_value));
if (freq is null or freq <= 0)
{
self.upd_freq1.ufl_value := '1';
self.vc_error_message := 'Please enter correct update frequency.';
self.vc_is_valid := 0;
self.step1.vc_enabled := 0;
self.step2_rss.vc_enabled := 1;
self.step2_rss.vc_data_bind(e);
return;
}
declare tit, rss, form varchar;
tit := trim(self.tit1.ufl_value);
rss := trim(self.rss1.ufl_value);
form := trim(self.format1.ufl_value);
if (tit = '' or rss = '' or form = '' or freq = 0)
{
if (freq = 0)
self.vc_error_message := 'Please enter correct Update Frequency value';
if (tit = '')
self.vc_error_message := 'Please enter correct Title value';
if (rss = '')
self.vc_error_message := 'Please enter correct RSS value';
if (form = '')
self.vc_error_message := 'Please enter correct Form value';
{
self.vc_is_valid := 0;
self.step1.vc_enabled := 0;
self.step2_rss.vc_enabled := 1;
self.step2_rss.vc_data_bind(e);
return;
}
}
if (lower(self.rss1.ufl_value) not like 'http://%')
{
self.vc_is_valid := 0;
self.channels_widget_url1.vc_error_message := 'RSS Url is not valid';
self.step1.vc_enabled := 0;
self.step2_rss.vc_enabled := 1;
self.step2_rss.vc_data_bind(e);
return;
}
if (self.new_chan_cat.ufl_value = '' and not self.format in ('OCS', 'OPML'))
self.new_chan_cat.ufl_value := self.chan_cat.ufl_value;
f_is_blog := 0;
if (strstr (lower (self.new_chan_cat.ufl_value), 'blog roll') is not null)
f_is_blog := 1;
if (self.new_chan_cat.ufl_value <> '' and
not exists (select 1 from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY
where BCC_NAME = self.new_chan_cat.ufl_value and BCC_BLOG_ID = self.blogid))
{
insert into BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY (BCC_BLOG_ID, BCC_NAME, BCC_IS_BLOG)
values (self.blogid, self.new_chan_cat.ufl_value, self.is_blog_roll.ufl_selected);
self.chan_cat.ufl_value := self.new_chan_cat.ufl_value;
}
self.f_cat_id := (select BCC_ID from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY
where BCC_NAME = self.chan_cat.ufl_value and BCC_BLOG_ID = self.blogid);
if (self.old_rss is not null and length(self.old_rss) > 0)
{
update BLOG.DBA.SYS_BLOG_CHANNELS
set BC_CHANNEL_URI = self.rss1.ufl_value,
BC_CAT_ID = self.f_cat_id,
BC_SHARED = self.is_cshared.ufl_selected,
BC_REL = xfn_rel
where BC_CHANNEL_URI = self.old_rss and BC_BLOG_ID = self.blogid;
}
else
{
insert replacing BLOG.DBA.SYS_BLOG_CHANNELS (BC_CHANNEL_URI, BC_BLOG_ID, BC_CAT_ID, BC_SHARED, BC_REL)
values (self.rss1.ufl_value, self.blogid, self.f_cat_id, self.is_cshared.ufl_selected, xfn_rel);
}
insert replacing BLOG.DBA.SYS_BLOG_CHANNEL_INFO
(BCD_TITLE, BCD_HOME_URI, BCD_CHANNEL_URI, BCD_SOURCE_URI,
BCD_FORMAT, BCD_UPDATE_PERIOD, BCD_LANG, BCD_UPDATE_FREQ, BCD_IS_BLOG, BCD_AUTHOR_NAME, BCD_AUTHOR_EMAIL)
values (self.tit1.ufl_value, hom, self.rss1.ufl_value, self.src_uri1,
self.format1.ufl_value, self.upd_per1.ufl_value,self.lang1.ufl_value,
freq, -3, self.aut1.ufl_value, self.mail1.ufl_value);
self.new_chan_cat.ufl_value := '';
self.channels_widget_url1.ufl_value := '';
self.old_rss := null;
if (0 and f_is_blog and 0 = length (self.old_rss))
{
self.step1.vc_enabled := 0;
self.step3_foaf.vc_enabled := 1;
self.step3_foaf.vc_data_bind (e);
}
else
{
http_request_status ('HTTP/1.1 302 Found');
http_header(sprintf(
'Location: index.vspx?page=channel_list&sid=%s&realm=%s\r\n\r\n',
self.sid ,
self.realm));
}
]]>
</v:on-post>
</v:button>
<v:button xhtml_class="real_button" action="simple" name="canc1" value="Cancel" xhtml_title="Cancel" xhtml_alt="Cancel">
<v:on-post>
<![CDATA[
self.vc_redirect ('index.vspx?page=channel_list');
]]>
</v:on-post>
</v:button>
</p>
</v:template>
<v:template type="simple" name="step2_ocs" initial-enable="0">
<h2>OCS Directory</h2>
<table>
<tr>
<th>Item</th>
<th>Category</th>
</tr>
<?vsp
{
declare channels any;
channels := self.data1;
declare i, l int;
declare j, k int;
i := 0;
l := length (channels);
while (i < l)
{
declare elm any;
declare formats any;
declare title varchar;
title := channels[i];
elm := channels[i+2];
?>
<tr>
<td>
<a class="button" href="<?=channels[i+1]?>">
<?V title ?>
</a>
</td>
<td>
<select class="select" name="cb_<?=i?>_is_blog">
<?vsp
for select BCC_NAME from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY where BCC_BLOG_ID = self.blogid
union select 'Blog Roll' BCC_NAME from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid
union select 'Channel Roll' BCC_NAME from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid
order by 1 do
{
?>
<option class="option" value="<?V BCC_NAME ?>"><?V BCC_NAME ?></option>
<?vsp
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<table>
<?vsp
j := 0;
k := length (elm);
while (j < k)
{
declare f, u, xu varchar;
f := xpath_eval ('/description/format/text()', xml_cut (elm[j]), 1);
xu := xpath_eval ('/description/@about', xml_cut (elm[j]), 1);
u := channels[i+1];
?>
<tr>
<td>
<input type="checkbox" name="cb_<?V i ?>_<?V j ?>"/>
</td>
<td>format<?V j ?>
<small>(<?V f ?>)</small>
</td>
</tr>
<?vsp
j := j + 1;
}
?>
</table>
</td>
</tr>
<?vsp
i := i + 3;
}
}
?>
</table>
<p>
<v:button xhtml_class="real_button" action="simple" name="sav2" value="Save" xhtml_title="Save" xhtml_alt="Save">
<v:on-post>
<![CDATA[
declare channels, bid any;
declare src_uri , src_tit varchar;
declare f_is_blog int;
src_uri := self.src_uri;
src_tit := self.src_tit;
bid := self.blogid;
channels := self.data1;
{
declare i, l int;
i := 0;
l := length (channels);
while (i < l)
{
declare j, k int;
declare xmluri, htmluri, title, format, upd_per, upd_freq, lang any;
declare elm, f_cat_name, f_cat_id any;
title := channels[i];
htmluri := channels[i+1];
elm := channels[i+2];
j := 0;
k := length (elm);
f_cat_name := get_keyword (sprintf ('cb_%d_is_blog', i), params, '');
f_is_blog := 0;
if (strstr (lower (f_cat_name), 'blog roll') is not null)
f_is_blog := 1;
if (not exists (select 1 from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY where
BCC_BLOG_ID = bid and BCC_NAME = f_cat_name))
{
insert into BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY (BCC_BLOG_ID, BCC_NAME, BCC_IS_BLOG)
values (bid, f_cat_name, f_is_blog);
}
f_cat_id := (select BCC_ID from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY where BCC_BLOG_ID = bid
and BCC_NAME = f_cat_name);
while (j < k)
{
if (get_keyword (sprintf ('cb_%d_%d', i, j), params) is not null)
{
declare xt any;
xt := xml_tree_doc (elm[j]);
xmluri := xpath_eval ('/description/@about', xt, 1);
format := xpath_eval ('/description/format/text()', xt, 1);
lang := xpath_eval ('/description/language/text()', xt, 1);
upd_per := xpath_eval ('/description/updatePeriod/text()', xt, 1);
upd_freq := coalesce (xpath_eval ('/description/updateFrequency/text()', xt, 1), '1');
upd_freq := atoi (cast (upd_freq as varchar));
insert replacing BLOG.DBA.SYS_BLOG_CHANNELS (BC_CHANNEL_URI, BC_BLOG_ID, BC_CAT_ID)
values (xmluri, bid, f_cat_id);
insert replacing BLOG.DBA.SYS_BLOG_CHANNEL_INFO
(BCD_TITLE, BCD_HOME_URI, BCD_CHANNEL_URI, BCD_FORMAT, BCD_UPDATE_PERIOD,
BCD_LANG, BCD_UPDATE_FREQ, BCD_SOURCE_URI)
values (title, htmluri, cast (xmluri as varchar), cast (format as varchar),
cast(upd_per as varchar), cast (lang as varchar), upd_freq, src_uri);
}
j := j + 1;
}
i := i + 3;
}
-- source itself
insert replacing BLOG.DBA.SYS_BLOG_CHANNELS (BC_CHANNEL_URI, BC_BLOG_ID, BC_CAT_ID)
values (src_uri, bid, -3);
insert replacing BLOG.DBA.SYS_BLOG_CHANNEL_INFO (BCD_TITLE, BCD_CHANNEL_URI, BCD_FORMAT)
values (src_tit, src_uri, 'OCS');
}
]]>
</v:on-post>
</v:button>
</p>
</v:template>
<v:template type="simple" name="step2_opml" initial-enable="0">
<h2>OPML Directory</h2>
<table>
<tr>
<th>
<input type="checkbox" name="selectall1" value="Select All"
onclick="selectAllCheckboxes(this.form, this, 'cb_')" />
</th>
<th>Feed</th>
<th>Category</th>
</tr>
<?vsp
{
declare links any;
links := self.data1;
declare i, l int;
declare u, xu, lang, title varchar;
i := 0;
l := length (links);
while (i < l)
{
u := xpath_eval('/outline/@htmlUrl|/outline/@htmlurl', xml_cut(links[i]), 1);
xu := xpath_eval('/outline/@xmlUrl|/outline/@xmlurl', xml_cut(links[i]), 1);
lang := xpath_eval('/outline/@language', xml_cut(links[i]), 1);
title := xpath_eval('/outline/@(!text!)|/outline/@title', xml_cut(links[i]), 1);
?>
<tr>
<td>
<input type="checkbox" name="cb_<?V i ?>"/>
</td>
<td>
<a class="button" href="<?V u ?>"><?V title ?></a>
</td>
<td>
<select class="select" name="cb_<?V i ?>_is_blog">
<?vsp
for select BCC_NAME from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY where BCC_BLOG_ID = self.blogid
union select 'Blog Roll' BCC_NAME from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid
union select 'Channel Roll' BCC_NAME from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid
order by 1 do
{
?>
<option class="option" value="<?V BCC_NAME ?>"><?V BCC_NAME?></option>
<?vsp
}
?>
</select>
</td>
</tr>
<?vsp
i:=i+1;
}
}
?>
</table>
<p>
<v:button xhtml_class="real_button" action="simple" name="sav3" value="Save" xhtml_title="Save" xhtml_alt="Save">
<v:on-post>
<![CDATA[
{
declare params any;
params := self.vc_event.ve_params;
declare links, bid any;
declare src_uri , src_tit varchar;
src_uri := self.src_uri;
src_tit := self.src_tit;
bid := self.blogid;
links := self.data1;
declare i, l int;
i := 0; l := length(links);
while (i < l)
{
declare j, k int;
declare xmluri, htmluri, title, format, upd_per, upd_freq, lang, f_cat_name, f_cat_id any;
declare elm any;
f_cat_name := get_keyword (sprintf ('cb_%d_is_blog', i), params, '');
if (not exists (select 1 from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY
where BCC_BLOG_ID = bid and BCC_NAME = f_cat_name))
{
declare f_is_blog int;
f_is_blog := 0;
if (strstr (lower (f_cat_name), 'blog roll') is not null) f_is_blog := 1;
insert into BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY (BCC_BLOG_ID, BCC_NAME, BCC_IS_BLOG)
values (bid, f_cat_name, f_is_blog);
}
f_cat_id := (select BCC_ID from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY
where BCC_BLOG_ID = bid and BCC_NAME = f_cat_name);
if (get_keyword (sprintf ('cb_%d', i), params) is not null)
{
declare xt any;
xt := xml_tree_doc (links[i]);
xmluri := xpath_eval ('/outline/@xmlUrl|/outline/@xmlurl', xt, 1);
htmluri := xpath_eval ('/outline/@htmlUrl|/outline/@htmlurl', xt, 1);
lang := xpath_eval ('/outline/@language', xt, 1);
title := xpath_eval ('/outline/@(!text!)|/outline/@title', xt, 1);
format := 'http://my.netscape.com/rdf/simple/0.9/';
upd_per := 'daily';
upd_freq := 1;
insert replacing BLOG.DBA.SYS_BLOG_CHANNELS (BC_CHANNEL_URI, BC_BLOG_ID, BC_CAT_ID)
values (xmluri, bid, f_cat_id);
insert replacing BLOG.DBA.SYS_BLOG_CHANNEL_INFO
(BCD_TITLE, BCD_HOME_URI, BCD_CHANNEL_URI, BCD_FORMAT, BCD_UPDATE_PERIOD,
BCD_LANG, BCD_UPDATE_FREQ, BCD_SOURCE_URI)
values (title, htmluri, cast (xmluri as varchar), cast (format as varchar),
cast(upd_per as varchar), cast (lang as varchar), upd_freq, src_uri);
}
i := i + 1;
}
-- source itself
insert replacing BLOG.DBA.SYS_BLOG_CHANNELS (BC_CHANNEL_URI, BC_BLOG_ID, BC_CAT_ID)
values (src_uri, bid, -3);
insert replacing BLOG.DBA.SYS_BLOG_CHANNEL_INFO (BCD_TITLE, BCD_CHANNEL_URI, BCD_FORMAT)
values (src_tit, src_uri, 'OPML');
}
]]>
</v:on-post>
</v:button>
</p>
</v:template>
<v:template type="simple" name="step2_autodisc" initial-enable="0">
<h2>Autodiscovered feeds</h2>
<?vsp
declare rss_f, atom_f, opml_f, furl any;
if (self.autodisc is null)
self.autodisc := vector (vector (), vector(), vector ());
rss_f := self.autodisc[0];
atom_f := self.autodisc[1];
opml_f := self.autodisc[2];
if (length (rss_f))
{
?>
<table>
<caption>RSS Feeds</caption>
<tr><th>
<input type="checkbox" name="selectall2" value="Select All"
onclick="selectAllCheckboxes(this.form, this, 'aurss_cb')" />
</th><th>Title</th><th>Feed URL</th></tr>
<?vsp
foreach (any elm in rss_f) do
{
if (isstring (elm))
{
elm := xpath_eval ('/link', xtree_doc (elm));
}
furl := xpath_eval ('@href', elm);
?>
<tr><td><input type="checkbox" name="aurss_cb" value="<?V furl ?>"/></td><td><?V xpath_eval ('@title', elm) ?></td><td><?V furl ?></td></tr>
<?vsp
}
?>
</table>
<?vsp
}
if (length (atom_f))
{
?>
<table>
<caption>Atom Feeds</caption>
<tr><th>
<input type="checkbox" name="selectall3" value="Select All"
onclick="selectAllCheckboxes(this.form, this, 'auatom_cb')" />
</th><th>Title</th><th>Feed URL</th></tr>
<?vsp
foreach (any elm in atom_f) do
{
if (isstring (elm))
elm := xpath_eval ('/link', xtree_doc (elm));
furl := xpath_eval ('@href', elm);
?>
<tr><td><input type="checkbox" name="auatom_cb" value="<?V furl ?>"/></td><td><?V xpath_eval ('@title', elm) ?></td><td><?V furl ?></td></tr>
<?vsp
}
?>
</table>
<?vsp
}
if (length (opml_f))
{
?>
<table>
<caption>OPML Directory</caption>
<tr><th>
<input type="checkbox" name="selectall4" value="Select All"
onclick="selectAllCheckboxes(this.form, this, 'auopml_cb')" />
</th><th>Title</th><th>Feed URL</th></tr>
<?vsp
foreach (any elm in opml_f) do
{
if (isstring (elm))
elm := xpath_eval ('/link', xtree_doc (elm));
furl := xpath_eval ('@href', elm);
?>
<tr><td><input type="checkbox" name="auopml_cb" value="<?V furl ?>"/></td><td><?V xpath_eval ('@title', elm) ?></td><td><?V furl ?></td></tr>
<?vsp
}
?>
</table>
<?vsp
}
?>
<p>
<v:button xhtml_class="real_button" action="simple" name="sav4" value="Download&Verify" xhtml_title="Verify" xhtml_alt="Verify">
<v:on-post>
<![CDATA[
declare furl, pars, feeds any;
declare inx, cnt int;
declare title, home, feed_url, email, cont, xt any;
pars := e.ve_params;
feeds := vector ();
inx := 0;
cnt := 0;
while (furl := adm_next_keyword ('aurss_cb', pars, inx))
{
declare exit handler for sqlstate '*'
{
rollback work;
goto next1;
};
commit work;
cont := XML_URI_GET ('', furl);
xt := xtree_doc (cont);
xt := xpath_eval ('/rss/channel[1]|/RDF/channel[1]', xt, 1);
if (xt is not null)
{
xt := xml_cut (xt);
title := xpath_eval ('/channel/title/text()', xt, 1);
home := cast (xpath_eval ('/channel/link/text()', xt, 1) as varchar);
email := cast (xpath_eval ('/channel/managingEditor/text()', xt, 1) as varchar);
feeds := vector_concat (feeds, vector (vector (furl, home, title, 'RSS', 'OK', cnt, email)));
}
next1:;
cnt := cnt + 1;
}
inx := 0;
while (furl := adm_next_keyword ('auatom_cb', pars, inx))
{
declare exit handler for sqlstate '*'
{
rollback work;
goto next2;
};
commit work;
cont := XML_URI_GET ('', furl);
xt := xtree_doc (cont);
xt := xpath_eval ('/feed', xt, 1);
if (xt is not null)
{
title := xpath_eval ('/feed/title/text()', xt, 1);
home := cast (xpath_eval ('/feed/link[@rel="alternate"]/@href', xt, 1) as varchar);
email := cast (xpath_eval ('/channel/managingEditor/text()', xt, 1) as varchar);
feeds := vector_concat (feeds, vector (vector (furl, home, title, 'Atom', 'OK', cnt, email)));
}
next2:;
cnt := cnt + 1;
}
inx := 0;
while (furl := adm_next_keyword ('auopml_cb', pars, inx))
{
declare exit handler for sqlstate '*'
{
rollback work;
goto next3;
};
commit work;
cont := XML_URI_GET ('', furl);
xt := xtree_doc (cont);
xt := xpath_eval ('/opml', xt, 1);
if (xt is not null)
{
declare links, xp any;
links := xpath_eval ('/opml/body/outline[ @htmlUrl and @xmlUrl ]', xt, 0);
foreach (any elm in links) do
{
xp := xml_cut (elm);
home := xpath_eval('/outline/@htmlUrl|/outline/@htmlurl', xp, 1);
title := xpath_eval('/outline/@title', xp, 1);
feed_url := xpath_eval('/outline/@xmlUrl|/outline/@xmlurl', xp, 1);
feeds := vector_concat (feeds, vector (vector (feed_url, home, title, 'RSS', 'OK', cnt, '')));
}
}
next3:;
cnt := cnt + 1;
}
self.autofeed := feeds;
self.step1.vc_enabled := 0;
if (length (feeds))
{
self.autodisc := null;
self.step3_autodisc.vc_enabled := 1;
self.step3_autodisc.vc_data_bind (e);
}
else
{
self.vc_is_valid := 0;
self.vc_error_message := 'No feeds are selected';
self.step2_autodisc.vc_enabled := 1;
self.step2_autodisc.vc_data_bind (e);
}
]]>
</v:on-post>
</v:button>
<v:button xhtml_class="real_button" action="simple" name="canc6" value="Cancel" xhtml_title="Cancel" xhtml_alt="Cancel" />
</p>
</v:template>
<v:template type="simple" name="step3_autodisc" initial-enable="0">
<h2>Autodiscovered feeds</h2>
<table>
<tr>
<th>
<input type="checkbox" name="selectall4" value="Select All"
onclick="selectAllCheckboxes(this.form, this, 'autofeed_cb')" />
</th>
<th>Title</th>
<th>Feed URL</th>
<th>Type</th>
<th>Status</th>
<th>Category</th>
<th><input type="checkbox" name="selectall32" value="Select All"
onclick="selectAllCheckboxes2(this.form, this, 'cb_', '_foaf')" />Add to contacts</th>
</tr>
<?vsp
declare autofeeds any;
autofeeds := self.autofeed;
foreach (any feed in autofeeds) do
{
?>
<tr>
<td>
<input type="checkbox" name="autofeed_cb" value="<?V encode_base64 (serialize(feed)) ?>"/>
</td>
<td><a href="<?V feed[1] ?>"><?V feed[2] ?></a></td>
<td><?V feed [0] ?></td>
<td><?V feed[3] ?></td>
<td><?V feed[4] ?></td>
<td>
<select class="select" name="cb_<?=feed[5]?>_cat">
<?vsp
for select BCC_NAME from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY where BCC_BLOG_ID = self.blogid
union select 'Blog Roll' BCC_NAME from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid
union select 'Channel Roll' BCC_NAME from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid
order by 1 do
{
?>
<option class="option" value="<?V BCC_NAME ?>"><?V BCC_NAME ?></option>
<?vsp
}
?>
</select>
</td>
<td>
<input type="checkbox" name="cb_<?=feed[5]?>_foaf" value="1"/>
</td>
</tr>
<?vsp
}
?>
</table>
<p>
<v:button xhtml_class="real_button" action="simple" name="sav5" value="Save" xhtml_title="Save" xhtml_alt="Save">
<v:on-post><![CDATA[
declare pars, inx, efeed, feed any;
inx := 0;
pars := e.ve_params;
while (efeed := adm_next_keyword ('autofeed_cb', pars, inx))
{
feed := deserialize (decode_base64 (efeed));
BLOG..BLOG2_FEED_SUBSCRIBE (self.blogid,
feed[0], feed[1], feed[2], feed[3], null, 'daily', 1,
get_keyword (sprintf ('cb_%d_cat', feed[5]), pars),
get_keyword (sprintf ('cb_%d_foaf', feed[5]), pars, '0'),
feed[6]
);
}
]]></v:on-post>
</v:button><xsl:text> </xsl:text>
<v:button xhtml_class="real_button" action="simple" name="sav6" value="Cancel" xhtml_title="Cancel" xhtml_alt="Cancel" />
</p>
</v:template>
<v:template type="simple" name="step3_foaf" initial-enable="0">
<h2>Do you know this person?</h2>
<table>
<tr><td>Name</td><td>
<v:text name="f_name" value="--self.tit" xhtml_class="textbox" xhtml_style="width: 220px" error-glyph="*">
</v:text>
</td></tr>
<tr><td>Nick</td><td><v:text name="f_nick" value="" xhtml_class="textbox" xhtml_style="width: 220px"/></td></tr>
<tr><td>Mailbox</td><td><v:text name="f_mail" value="--self.femail" xhtml_class="textbox" xhtml_style="width: 220px"/></td></tr>
<tr><td>Home page</td><td><v:text name="f_home" value="--self.home" xhtml_class="textbox" xhtml_style="width: 220px"/></td></tr>
<tr><td>Weblog</td><td><v:text name="f_weblog" value="--self.home" xhtml_class="textbox" xhtml_style="width: 220px"/></td></tr>
<tr><td>RSS</td><td><v:text name="f_rss" value="--self.rss" xhtml_class="textbox" xhtml_style="width: 220px"/></td></tr>
</table>
<p>
<v:button xhtml_class="real_button" action="simple" name="sav8" value="Yes" xhtml_title="Yes" xhtml_alt="Yes">
<v:on-post><![CDATA[
if (not length (self.f_name.ufl_value))
{
self.vc_is_valid := 0;
self.f_name.vc_error_message := 'Contact Name must not be empty.';
self.step3_foaf.vc_enabled := 1;
self.step1.vc_enabled := 0;
self.step3_foaf.vc_data_bind (e);
return;
}
insert replacing BLOG..SYS_BLOG_CONTACTS (BF_BLOG_ID, BF_NAME, BF_NICK, BF_MBOX, BF_HOMEPAGE, BF_WEBLOG, BF_RSS)
values (self.blogid, self.f_name.ufl_value, self.f_nick.ufl_value, self.f_mail.ufl_value, self.f_home.ufl_value,
self.f_weblog.ufl_value, self.f_rss.ufl_value);
http_request_status ('HTTP/1.1 302 Found');
http_header(sprintf(
'Location: index.vspx?page=channel_list&sid=%s&realm=%s\r\n\r\n',
self.sid ,
self.realm));
]]></v:on-post>
</v:button>
<v:button xhtml_class="real_button" action="simple" name="sav9" value="No" xhtml_title="No" xhtml_alt="No">
<v:on-post><![CDATA[
http_request_status ('HTTP/1.1 302 Found');
http_header(sprintf(
'Location: index.vspx?page=channel_list&sid=%s&realm=%s\r\n\r\n',
self.sid ,
self.realm));
]]></v:on-post>
</v:button>
</p>
</v:template>
</div>
<div>
<v:url xhtml_class="" name="feed_list" url="index.vspx?page=channel_list" value="Edit Links"/>
</div>
<div>
<v:url xhtml_class="" name="cats1" url="index.vspx?page=channels_ctgs" value="Edit Link Categories"/>
</div>
<div>
<v:url xhtml_class="" name="feed_sub1" url="index.vspx?page=channels" value="New Link"/>
</div>
</xsl:template>
<xsl:template match="vm:channels-ctgs-widget">
<div style="align: left">
<h3>Blogroll Categories</h3>
<v:form name="channels_ctgs_form" type="simple" method="POST">
<v:on-init>
<![CDATA[
declare parms any;
parms := self.vc_event.ve_params;
if (get_keyword ('channel_category_delete', parms, '') <> '') {
delete from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY
where BCC_ID = atoi (get_keyword ('channel_category_delete', parms, '-1')) and
BCC_BLOG_ID := self.blogid;
update BLOG.DBA.SYS_BLOG_CHANNELS set BC_CAT_ID = null where BC_BLOG_ID = self.blogid
and BC_CAT_ID = atoi (get_keyword ('channel_category_delete', parms, '-1'));
}
if (get_keyword ('channel_category_edit', parms, '') <> '') {
self.f_cat_id := atoi(get_keyword ('channel_category_edit', parms, '-1'));
}
]]>
</v:on-init>
<table>
<tr>
<th><label for="channels_ctgs_cat">Description</label></th>
<td>
<v:text xhtml_class="textbox" name="channels_ctgs_cat" xhtml_id="channels_ctgs_cat" xhtml_style="width: 220px" value="">
<v:after-data-bind>
if (self.f_cat_id is not null)
select BCC_NAME, BCC_IS_BLOG into control.ufl_value,
self.is_blog_roll1.ufl_selected from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY
where BCC_ID = self.f_cat_id and BCC_BLOG_ID = self.blogid;
</v:after-data-bind>
</v:text>
</td>
</tr>
<tr>
<td>
<v:check-box xhtml_id="is_blog_roll1" name="is_blog_roll1" value="1" >
</v:check-box>
</td>
<td>
<label for="is_blog_roll1">Is Blog Roll</label>
</td>
</tr>
<tr>
<td>
<v:button xhtml_class="real_button" action="simple" name="channels_ctgs_post" value="Save" xhtml_title="Save" xhtml_alt="Save">
<v:on-post>
declare cat varchar;
cat := trim(self.channels_ctgs_cat.ufl_value);
if (cat is null or cat = '')
{
self.channels_ctgs_cat.ufl_value := '';
self.vc_error_message := 'Please enter correct channel category';
self.vc_is_valid := 0;
return;
}
if (not self.vc_is_valid)
return;
if (self.f_cat_id is null)
{
if (exists(select 1 from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY
where BCC_BLOG_ID = self.blogid and BCC_NAME = cat))
{
self.vc_error_message := 'The channel category with the same description already exists';
self.vc_is_valid := 0;
return;
}
insert soft BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY (BCC_BLOG_ID, BCC_NAME, BCC_IS_BLOG)
values (self.blogid, cat, self.is_blog_roll1.ufl_selected);
}
else
{
if (exists(select 1 from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY where BCC_BLOG_ID = self.blogid
and BCC_NAME = cat and not(BCC_ID = self.f_cat_id)))
{
self.vc_error_message := 'Another channel category with the same description already exists';
self.vc_is_valid := 0;
return;
}
update BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY set BCC_NAME = cat, BCC_IS_BLOG = self.is_blog_roll1.ufl_selected
where BCC_ID = self.f_cat_id and BCC_BLOG_ID = self.blogid;
}
self.channels_ctgs_cat.ufl_value := '';
self.f_cat_id := null;
self.chcat_ds.vc_data_bind(e);
</v:on-post>
</v:button>
<v:button xhtml_class="real_button" action="simple" name="channels_ctgs_canc" value="Cancel" xhtml_title="Cancel" xhtml_alt="Cancel">
<v:on-post>
self.vc_redirect ('index.vspx?page=channels_ctgs');
</v:on-post>
</v:button>
</td>
</tr>
</table>
</v:form>
<div>
<v:data-set
name="chcat_ds"
nrows="10"
scrollable="1"
sql="select BCC_NAME, BCC_ID from BLOG.DBA.SYS_BLOG_CHANNEL_CATEGORY where BCC_BLOG_ID = self.blogid"
cursor-type="dynamic"
edit="0"
width="80">
<v:column name="BCC_NAME"/>
<v:column name="BCC_ID"/>
<v:template name="chcat_template1" type="simple" name-to-remove="table" set-to-remove="bottom">
<table class="listing">
<tr class="listing_header_row">
<th>Description</th>
<th>Action</th>
</tr>
</table>
</v:template>
<v:template name="chcat_template2" type="repeat" name-to-remove="" set-to-remove="">
<v:template name="chcat_template7" type="if-not-exists" name-to-remove="table" set-to-remove="both">
<table>
<tr class="listing_count">
<td class="listing_count" colspan="2">
No channel data
</td>
</tr>
</table>
</v:template>
<v:template name="chcat_template4" type="browse" name-to-remove="table" set-to-remove="both">
<table>
<?vsp
self.r_count := self.r_count + 1;
http (sprintf ('<tr class="%s">', case when mod (self.r_count, 2) then 'listing_row_odd' else 'listing_row_even' end));
?>
<td class="listing_col">
<v:label name="chcat_label52" value="--(control.vc_parent as vspx_row_template).te_rowset[0]"/>
</td>
<td class="listing_col_action" nowrap="1">
<a class="button" href="index.vspx?page=<?V self.page ?>&channel_category_edit=<?V (control as vspx_row_template).te_rowset[1] ?>&realm=wa&sid=<?V self.sid ?>">Edit</a>
<![CDATA[ ]]>
<a class="button" href="index.vspx?page=<?V self.page?>&channel_category_delete=<?V (control as vspx_row_template).te_rowset[1] ?>&realm=wa&sid=<?V self.sid ?>">Delete</a>
</td>
<?vsp
http ('</tr>');
?>
</table>
</v:template>
</v:template>
<v:template name="chcat_template3" type="simple" name-to-remove="table" set-to-remove="top">
<table>
<tr class="browse_button_row">
<td colspan="2" align="center">
<vm:ds-navigation data-set="chcat_ds"/>
</td>
</tr>
</table>
</v:template>
</v:data-set>
</div>
</div>
<div>
<v:url xhtml_class="" name="feed_list" url="index.vspx?page=channel_list" value="Edit Links"/>
</div>
<div>
<v:url xhtml_class="" name="feed_sub1" url="index.vspx?page=channels" value="New Link"/>
</div>
</xsl:template>
<xsl:template match="vm:site-access-widget">
<v:form name="site_access_widget_form" type="simple" method="POST" xhtml_enctype="multipart/form-data">
<input type="hidden" name="ping_tab" value="<?V get_keyword('ping_tab', control.vc_page.vc_event.ve_params, '3') ?>"/>
<input type="hidden" name="site_tab" value="<?V get_keyword('site_tab', control.vc_page.vc_event.ve_params, '2') ?>"/>
<table>
<tr><th colspan="2"><h2>Comment Settings</h2></th></tr>
<tr>
<td/>
<td><v:check-box name="comm1" value="1" initial-checked="--self.comm" xhtml_id="comm1"/><label for="comm1">Comments allowed</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="tb1" xhtml_id="tb1" value="1" initial-checked="--get_keyword('EnableTrackback', self.opts, 0)"/><label for="tb1">Trackback/Pingback enabled</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="pb1" xhtml_id="pb1" value="1" initial-checked="--get_keyword ('EnableReferral', self.opts, 0)"/><label for="pb1">Referrals enabled</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="rl1" xhtml_id="rl1" value="1" initial-checked="--get_keyword ('EnableRelated', self.opts, 0)"/><label for="pb1">Related enabled</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="sid_mutation" xhtml_id="sid_mutation" value="1" initial-checked="--get_keyword ('EnableSIDMutation', self.opts, 0)"/><label for="sid_mutation">Enhanced Security enabled (SID mutation on each page refresh)</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="oid1" xhtml_id="oid1" value="1" initial-checked="--get_keyword ('OpenID', self.opts, 0)"/><label for="oid1">Comments verification via OpenID URL</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="mb1" xhtml_id="mb1" value="1" initial-checked="--get_keyword ('CommentApproval', self.opts, 0)"/><label for="mb1">Comments are moderated</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="cc1" xhtml_id="cc1" value="1" initial-checked="--get_keyword ('CommentQuestion', self.opts, 0)"/><label for="cc1">Comment verification question</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="reg1" xhtml_id="reg1" value="1" initial-checked="--get_keyword ('CommentReg', self.opts, 0)"/><label for="reg1">Only registered users can comment</label></td>
</tr>
<tr>
<td><label for="sr1">Spam Rate Limit (1.0 means off)</label></td>
<td><v:text xhtml_class="textbox" xhtml_size="4" name="sr1" xhtml_id="sr1" value="--get_keyword ('SpamRateLimit', self.opts, '1.00')"/>
</td>
<td>
This means spam probability rate, a float number between 0 and 1.
The comments having spam probability rate below that number
will be published automatically, otherwise they will be queued for manual approval.
</td>
</tr>
<tr>
<td><label for="cnot1">Comment Post Notification via E-mail enabled</label></td>
<td>
<v:select-list name="cnot1" value="--cast (self.cnot as varchar)" xhtml_id="cnot1">
<v:item name="Disabled" value="0" />
<v:item name="Embedded HTML Form for CommentAPI" value="1" />
<v:item name="HTML format" value="2" />
<v:item name="TEXT format" value="3" />
<v:item name="HTML Form attachment" value="4" />
</v:select-list>
</td>
<td/>
</tr>
<tr>
<td/>
<td><v:check-box name="vr1" xhtml_id="vr1" value="1" initial-checked="--coalesce ((select top 1 1 from BLOG..SYS_ROUTING where R_ITEM_ID = self.blogid and R_PROTOCOL_ID = 4 and R_TYPE_ID = 2), 0)"/><label for="vr1">Visitors Comment Subscription via E-Mail allowed</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="tb_notify1" xhtml_id="tb_notify1" value="1" initial-checked="--coalesce(self.tb_notify, 0)"/><label for="tb_notify1">Notify of Trackback/Pingback Notification via E-mail</label></td>
</tr>
<tr>
<td colspan="2">
<v:button xhtml_class="real_button" action="simple" name="site_access_button" value="Save" xhtml_title="Save" xhtml_alt="Save">
<v:on-post>
<![CDATA[
declare opts, jid, njid any;
opts := self.opts;
opts := BLOG.DBA.BLOG2_SET_OPTION('EnableSIDMutation', opts, self.sid_mutation.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('EnableReferral', opts, self.pb1.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('EnableRelated', opts, self.rl1.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('EnableTrackback', opts, self.tb1.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('CommentApproval', opts, self.mb1.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('OpenID', opts, self.oid1.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('CommentQuestion', opts, self.cc1.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('CommentReg', opts, self.reg1.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('SpamRateLimit', opts, self.sr1.ufl_value);
self.tb_notify := self.tb_notify1.ufl_selected;
self.opts := opts;
update BLOG.DBA.SYS_BLOG_INFO set
BI_COMMENTS = self.comm1.ufl_selected,
BI_COMMENTS_NOTIFY = self.cnot1.ufl_value,
BI_TB_NOTIFY = self.tb_notify1.ufl_selected,
BI_OPTIONS = serialize(opts)
where BI_BLOG_ID = self.blogid;
jid := (select top 1 R_JOB_ID from BLOG..SYS_ROUTING where R_ITEM_ID = self.blogid and R_PROTOCOL_ID = 4 and R_TYPE_ID = 2);
if (jid is null and self.vr1.ufl_selected)
{
njid := coalesce((select top 1 R_JOB_ID from BLOG..SYS_ROUTING order by R_JOB_ID desc), 0)+1;
}
if (self.vr1.ufl_selected and jid is null)
{
insert into BLOG..SYS_ROUTING
(R_JOB_ID, R_TYPE_ID, R_PROTOCOL_ID, R_FREQUENCY, R_ITEM_ID, R_DESTINATION)
values (njid, 2, 4, 60, self.blogid, null);
}
else if (self.vr1.ufl_selected = 0 and jid is not null)
{
delete from BLOG..SYS_ROUTING where R_JOB_ID = jid;
}
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:blog-global-widget">
<v:form name="blog_global_widget_form" type="simple" method="POST" xhtml_enctype="multipart/form-data">
<input type="hidden" name="ping_tab" value="<?V get_keyword('ping_tab', control.vc_page.vc_event.ve_params) ?>"/>
<input type="hidden" name="blog_tab" value="<?V get_keyword('blog_tab', control.vc_page.vc_event.ve_params) ?>"/>
<table>
<tr><th colspan="2"><h2>Links</h2></th></tr>
<tr>
<td><label for="oclt">OCS Links Title</label></td>
<td><v:text xhtml_class="textbox" xhtml_style="width: 220px" name="oclt" xhtml_id="oclt" value="--get_keyword('OCSDivTilte', self.opts, 'OCS Links')"/></td>
</tr>
<tr>
<td><label for="oplt">OPML Links Title</label></td>
<td><v:text xhtml_class="textbox" xhtml_style="width: 220px" name="oplt" xhtml_id="oplt" value="--get_keyword('OPMLDivTitle', self.opts, 'OPML Links')"/></td>
</tr>
<tr>
<td/>
<td><v:check-box name="show_ocs_ckbx" xhtml_id="show_ocs_ckbx" value="1" initial-checked="--get_keyword('ShowOCS', self.opts, 1)"/><label for="show_ocs_ckbx">Show OCS</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="show_opml_ckbx" xhtml_id="show_opml_ckbx" value="1" initial-checked="--get_keyword('ShowOPML', self.opts, 1)"/><label for="show_opml_ckbx">Show OPML</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="show_xbel_ckbx" xhtml_id="show_xbel_ckbx" value="1" initial-checked="--get_keyword('ShowXBEL', self.opts, 1)"/><label for="show_xbel_ckbx">Show XBEL</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="show_tags_ckbx" xhtml_id="show_tags_ckbx" value="1" initial-checked="--get_keyword('TagGem', self.opts, 1)"/><label for="show_tags_ckbx">Show Tags</label></td>
</tr>
<tr><th colspan="2"><h2>Filters</h2></th></tr>
<tr>
<td><label for="xsl_filter">XSL-T Filter for Posts</label></td>
<td><v:text xhtml_class="textbox" xhtml_style="width: 220px" name="xsl_filter" xhtml_id="xsl_filter" value="--self.filt"/></td>
</tr>
<tr>
<td><label for="adds_filter">Adblock (comma-separated URL pattern list)</label></td>
<td><v:textarea xhtml_class="textbox" xhtml_style="width: 220px" xhtml_rows="5" name="adds_filter" xhtml_id="adds_filter" value="--get_keyword('Adblock', self.opts, 'http://imageads.googleadservices.com/*')"/></td>
</tr>
<tr>
<td><label for="rss_xsl_filter">XSL-T Filter for RSS</label></td>
<td><v:text xhtml_class="textbox" xhtml_style="width: 220px" name="rss_xsl_filter" xhtml_id="rss_xsl_filter" value="--get_keyword('RSSFilter', self.opts, '*wml-default*')"/></td>
</tr>
<tr><th colspan="2"><h2>Community and Contact Settings</h2></th></tr>
<tr>
<td/>
<td><v:check-box name="inclusion_ckbx" xhtml_id="inclusion_ckbx" value="1" initial-checked="--self.inclusion"/><label for="inclusion_ckbx">Include Community</label></td>
</tr>
<tr>
<td/>
<td><v:check-box name="cont1" xhtml_id="cont1" value="1" initial-checked="--self.cont"/><label for="cont1">Show Contacts</label></td>
</tr>
<tr><th colspan="2"><h2>Associated Icon for Blog Web Pages</h2></th></tr>
<tr>
<td><label for="upicon">Upload Icon</label></td>
<td>
<input xhtml_id="upicon" class="textbox" type="file" name="upicon" width="150px" onBlur="javascript: getFileName(this.form, this, this.form.icon1);"/>
</td>
</tr>
<tr>
<td><label for="icon1">Icon Filename</label></td>
<td>
<v:text xhtml_id="icon1" xhtml_class="textbox" xhtml_style="width: 220px" name="icon1" value="--self.icon"/>
</td>
</tr>
<tr><td colspan="2">
<v:button xhtml_class="real_button" action="simple" name="blog_global_button" value="Save" xhtml_title="Save" xhtml_alt="Save">
<v:on-post>
<![CDATA[
declare opts any;
opts := self.opts;
opts := BLOG.DBA.BLOG2_SET_OPTION('OPMLDivTitle', opts, self.oplt.ufl_value);
opts := BLOG.DBA.BLOG2_SET_OPTION('OCSDivTilte', opts, self.oclt.ufl_value);
opts := BLOG.DBA.BLOG2_SET_OPTION('RSSFilter', opts, self.rss_xsl_filter.ufl_value);
opts := BLOG.DBA.BLOG2_SET_OPTION('ShowOCS', opts, self.show_ocs_ckbx.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('ShowOPML', opts, self.show_opml_ckbx.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('ShowXBEL', opts, self.show_xbel_ckbx.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('TagGem', opts, self.show_tags_ckbx.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('Adblock', opts, self.adds_filter.ufl_value);
declare _photo, match varchar;
_photo := trim(self.icon1.ufl_value);
if (length(_photo) > 0)
{
match := REGEXP_MATCH('^[-a-zA-z0-9][ -a-zA-z0-9\.]*$', _photo);
if (match is null or length(match) = 0 or match <> _photo)
{
self.vc_error_message := 'Wrong icon filename';
self.vc_is_valid := 0;
return;
}
}
if (get_keyword('upicon', e.ve_params, '') <> '')
{
declare cnt any;
cnt := get_keyword('upicon', e.ve_params, '');
if (_photo = '' or _photo is null)
_photo := get_keyword('filename', get_keyword('attr-upicon', e.ve_params, vector('filename', 'favicon.ico')));
declare exit handler for sqlstate '*'
{
self.vc_is_valid := 0;
self.vc_error_message := __SQL_MESSAGE;
goto endu;
};
declare dav_pwd any;
dav_pwd := (select pwd_magic_calc (U_NAME, U_PWD, 1) from WS.WS.SYS_DAV_USER where U_ID = http_dav_uid ());
DAV_RES_UPLOAD(self.phome || 'images/' || _photo, cnt, 'image' , '110100100N', 'dav', null, 'dav', dav_pwd);
}
else
{
if (_photo is not null and _photo <> '')
{
if (DAV_SEARCH_ID(self.phome || 'images/' || _photo, 'r') < 0)
{
self.vc_error_message := 'System cannot find the icon file';
self.vc_is_valid := 0;
return;
}
}
}
self.icon1.ufl_value := _photo;
self.opts := opts;
update BLOG.DBA.SYS_BLOG_INFO set
BI_ICON = _photo,
BI_SHOW_CONTACT = self.cont1.ufl_selected,
BI_OPTIONS = serialize (opts),
BI_FILTER = self.xsl_filter.ufl_value,
BI_INCLUSION = self.inclusion_ckbx.ufl_selected
where BI_BLOG_ID = self.blogid;
endu:;
]]>
</v:on-post>
</v:button>
</td></tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:blog-gem-widget">
<v:form name="blog_gem_widget_form" type="simple" method="POST" xhtml_enctype="multipart/form-data">
<input type="hidden" name="ping_tab" value="<?V get_keyword('ping_tab', control.vc_page.vc_event.ve_params) ?>"/>
<input type="hidden" name="blog_tab" value="<?V get_keyword('blog_tab', control.vc_page.vc_event.ve_params) ?>"/>
<table>
<tr><th colspan="2"><h2>Blog GEM Display</h2></th></tr>
<?vsp
if (length (get_keyword ('AssociateID', self.opts)))
{
?>
<tr>
<td><v:check-box name="show_ass" xhtml_id="show_ass1" value="1" initial-checked="--get_keyword('ShowAss', self.opts)"/></td>
<td><label for="show_ass1">Associates Info (Amazon, eBay, Google)</label></td>
</tr>
<?vsp
}
?>
<tr>
<td><v:check-box name="show_fish" xhtml_id="show_fish1" value="1" initial-checked="--get_keyword('ShowFish', self.opts)"/></td>
<td><label for="show_fish1">AltaVista Babel Fish</label></td>
</tr>
<?vsp
if (length (get_keyword ('EbayID', self.opts)))
{
?>
<tr>
<td><v:check-box name="show_ebay" xhtml_id="show_ebay1" value="1" initial-checked="--get_keyword('ShowEbay', self.opts)"/></td>
<td><label for="show_ebay1">Ebay Ads</label></td>
</tr>
<?vsp
}
?>
<?vsp
if (length (get_keyword ('GoogleAdsenseID', self.opts)))
{
?>
<tr>
<td><v:check-box name="show_google" xhtml_id="show_egoogle1" value="1" initial-checked="--get_keyword('ShowGoogle', self.opts)"/></td>
<td><label for="show_google1">Google Ads</label></td>
</tr>
<?vsp
}
?>
<?vsp
if (length (get_keyword ('AmazonID', self.opts)))
{
?>
<tr>
<td><v:check-box name="show_amazon" xhtml_id="show_amazon1" value="1" initial-checked="--get_keyword('ShowAmazon', self.opts)"/></td>
<td><label for="show_amazon1">Amazon Wishlist</label></td>
</tr>
<?vsp
}
?>
<tr>
<td><v:check-box name="show_amazon_search" xhtml_id="show_amazon_search1" value="1" initial-checked="--get_keyword('ShowAmazonSearch', self.opts)"/></td>
<td><label for="show_amazon_search1">Amazon Search</label></td>
</tr>
<?vsp
if (length (get_keyword ('AmazonKey', self.opts)))
{
?>
<tr>
<td><v:check-box name="show_amazon_search_res" xhtml_id="show_amazon_search_res1" value="1" initial-checked="--get_keyword('ShowAmazonSearchRes', self.opts)"/></td>
<td><label for="show_amazon_search_res1">Amazon Search Results</label></td>
</tr>
<?vsp
}
?>
<?vsp
if (length (get_keyword ('GoogleKey', self.opts)))
{
?>
<tr>
<td><v:check-box name="show_google_search" xhtml_id="show_google_search1" value="1" initial-checked="--get_keyword('ShowGoogleSearch', self.opts)"/></td>
<td><label for="show_google_search1">Google Search Results</label></td>
</tr>
<?vsp
}
?>
<tr><td colspan="2">
<v:button xhtml_class="real_button" action="simple" name="blog_gem_button" value="Save" xhtml_title="Save" xhtml_alt="Save">
<v:on-post>
<![CDATA[
declare opts any;
declare gkey, akey any;
opts := self.opts;
gkey := get_keyword ('GoogleKey', opts);
akey := get_keyword ('AmazonKey', opts);
opts := BLOG.DBA.BLOG2_SET_OPTION('ShowAmazon', opts, self.show_amazon.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('ShowAmazonSearch', opts, self.show_amazon_search.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('ShowEbay', opts, self.show_ebay.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('ShowAss', opts, self.show_ass.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('ShowFish', opts, self.show_fish.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('ShowGoogle', opts, self.show_google.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('ShowGoogleSearch', opts, self.show_google_search.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('ShowAmazonSearchRes', opts, self.show_amazon_search_res.ufl_selected);
self.opts := opts;
update BLOG.DBA.SYS_BLOG_INFO set BI_OPTIONS = serialize (opts) where BI_BLOG_ID = self.blogid;
delete from BLOG..SYS_BLOG_SEARCH_ENGINE_SETTINGS where SS_BLOG_ID = self.blogid;
if (length (trim(gkey)) and self.show_google_search.ufl_selected)
{
insert into BLOG..SYS_BLOG_SEARCH_ENGINE_SETTINGS (SS_NAME, SS_BLOG_ID, SS_KEY, SS_MAX_ROWS)
values ('Google', self.blogid, trim(gkey), 10);
}
if (length (trim(akey)) and self.show_amazon_search_res.ufl_selected)
{
insert into BLOG..SYS_BLOG_SEARCH_ENGINE_SETTINGS (SS_NAME, SS_BLOG_ID, SS_KEY, SS_MAX_ROWS)
values ('Amazon', self.blogid, trim(akey), 10);
}
]]>
</v:on-post>
</v:button>
</td></tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:blog-feed-widget">
<v:form name="blog_feed_widget_form" type="simple" method="POST" xhtml_enctype="multipart/form-data">
<input type="hidden" name="ping_tab" value="<?V get_keyword('ping_tab', control.vc_page.vc_event.ve_params) ?>"/>
<input type="hidden" name="blog_tab" value="<?V get_keyword('blog_tab', control.vc_page.vc_event.ve_params) ?>"/>
<script type="text/javascript">
function changeArchiveControls (f, flag)
{
var x, y;
x = document.getElementById ('archfreq1');
y = document.getElementById ('archpres1');
x.disabled = (false == flag);
y.disabled = (false == flag);
}
</script>
<table>
<!--tr><th colspan="2"><h2>Archive Settings</h2></th></tr>
<tr>
<td><v:check-box name="arch1" xhtml_id="arch1" value="1" initial-checked="-#-get_keyword('EnableAutoArchive', self.opts, 1)" xhtml_onclick="javascript: changeArchiveControls(this.form,this.checked)"/><label for="arch1">Archive old posts</label>
</td>
<td>
<v:select-list xhtml_class="select" name="archfreq1" xhtml_id="archfreq1">
<v:item value="0" name="Daily"/>
<v:item value="1" name="Weekly"/>
<v:item value="2" name="Monthly"/>
<v:item value="3" name="Yearly"/>
<v:before-data-bind>
control.ufl_value := get_keyword('ArchiveFrequency', self.opts, 2);
</v:before-data-bind>
<v:before-render>
if (self.arch1.ufl_selected = 0)
control.vc_add_attribute ('disabled', '1');
</v:before-render>
</v:select-list>
</td>
</tr>
<tr>
</tr>
<tr>
<td><label for="archpres1">Arrange archives by</label></td>
<td>
<v:select-list xhtml_class="select" name="archpres1" xhtml_id="archpres1">
<v:item value="0" name="Category"/>
<v:item value="1" name="Date"/>
<v:before-data-bind>
control.ufl_value := get_keyword('ArchivePresent', self.opts, 0);
</v:before-data-bind>
<v:before-render>
if (self.arch1.ufl_selected = 0)
control.vc_add_attribute ('disabled', '1');
</v:before-render>
</v:select-list>
</td>
</tr-->
<tr><th colspan="2"><h2>Feed and Syndication Settings</h2></th></tr>
<tr>
<td><label for="rssver1">RSS File Version</label></td>
<td>
<v:select-list xhtml_class="select" name="rssver1" xhtml_id="rssver1">
<v:item value="2.0" name="2.0"/>
<v:item value="1.1" name="1.1"/>
<v:item value="0.92" name="0.92"/>
<v:item value="0.91" name="0.91"/>
<v:before-data-bind>
control.ufl_value := self.rssver;
</v:before-data-bind>
</v:select-list>
</td>
</tr>
<tr>
<td><label for="atomver1">Atom File Version</label></td>
<td>
<v:select-list xhtml_class="select" name="atomver1" xhtml_id="atomver1">
<v:item value="1.0" name="1.0"/>
<v:item value="0.3" name="0.3"/>
<v:before-data-bind>
control.ufl_value := get_keyword('AtomFeedVer', self.opts, '1.0');
</v:before-data-bind>
</v:select-list>
</td>
</tr>
<tr>
<td><label for="gemstype1">Feed Generation</label></td>
<td>
<v:select-list xhtml_class="select" name="gemstype1" xhtml_id="gemstype1">
<v:item value="SQL-XML" name="SQL-XML"/>
<v:item value="SQLX" name="SQLX"/>
<v:before-data-bind>
control.ufl_value := get_keyword('FeedGen', self.opts, 'SQL-XML');
control.vs_set_selected ();
</v:before-data-bind>
</v:select-list>
</td>
</tr>
<tr>
<td><label for="addrss1">Additional RSS links</label></td>
<td>
<table>
<tr>
<th>Feed Title</th>
<th>Feed URL</th>
<th>Action</th>
</tr>
<v:data-set name="addrss1" data="--self.custom_rss" meta="--vector()" nrows="1000" scrollable="1">
<v:template type="repeat" name="addrss1t1">
<v:template type="browse" name="addrss1t2">
<tr>
<td><v:text xhtml_size="25" xhtml_class="textbox" name="addrss1l1" value="--(control.vc_parent as vspx_row_template).te_rowset[0]" /></td>
<td><v:text xhtml_size="70" xhtml_class="textbox" name="addrss1l2" value="--(control.vc_parent as vspx_row_template).te_rowset[1]" /></td>
<td>
<v:button name="addrss1del" action="simple" style="url" value="Remove">
<v:on-post>
declare pos, x, y any;
pos := (control.vc_parent as vspx_row_template).te_ctr;
x := subseq (self.custom_rss, 0, pos);
y := subseq (self.custom_rss, pos+1, length (self.custom_rss));
self.custom_rss := vector_concat (x, y);
self.addrss1.vc_data_bind (e);
</v:on-post>
</v:button>
</td>
</tr>
</v:template>
</v:template>
</v:data-set>
<tr>
<td><v:text xhtml_size="25" xhtml_class="textbox" name="addrss1a1" value="" /></td>
<td><v:text xhtml_size="70" xhtml_class="textbox" name="addrss1a2" value="" /></td>
<td>
<v:button name="addrss1add" action="simple" style="url" value="Add">
<v:on-post>
if (not length (self.addrss1a1.ufl_value)
or not length (self.addrss1a2.ufl_value))
{
self.vc_is_valid := 0;
self.vc_error_message := 'The title and feed URL cannot be empty';
return;
}
self.custom_rss :=
vector_concat (self.custom_rss,
vector (vector (self.addrss1a1.ufl_value, self.addrss1a2.ufl_value)));
self.addrss1.vc_data_bind (e);
</v:on-post>
</v:button>
</td>
</tr>
</table>
</td>
</tr>
<tr><th colspan="2"><h2>Query Settings</h2></th></tr>
<tr>
<td/>
<td><v:check-box name="xpq1" xhtml_id="xpq1" value="1" initial-checked="--get_keyword('EnableXtendedSearch', self.opts, 1)"/><label for="xpq1">Allow XPath and XQuery Search</label></td>
</tr>
<tr>
<td><label for="xpqmax1">XPath/XQuery Search max results</label></td>
<td>
<v:text xhtml_class="textbox" xhtml_style="width: 50px" name="xpqmax1" xhtml_id="xpqmax1" value="--get_keyword('XtendedSearchMax', self.opts, 100)" xhtml_size="10">
<v:validator test="regexp" regexp="^[0-9]+$" message="Number is expected" runat='client'/>
<v:validator test="value" min="1" max="1000" message="The max results value must be between 1 and 1000" />
</v:text>
</td>
</tr>
<tr><td colspan="2">
<v:button xhtml_class="real_button" action="simple" name="blog_feed_button" value="Save" xhtml_title="Save" xhtml_alt="Save">
<v:on-post>
<![CDATA[
declare opts, oldgtype any;
opts := self.opts;
oldgtype := get_keyword('FeedGen', self.opts, 'SQL-XML');
opts := BLOG.DBA.BLOG2_SET_OPTION('EnableXtendedSearch', opts, self.xpq1.ufl_selected);
opts := BLOG.DBA.BLOG2_SET_OPTION('XtendedSearchMax', opts, atoi(self.xpqmax1.ufl_value));
opts := BLOG.DBA.BLOG2_SET_OPTION('FeedGen', opts, self.gemstype1.ufl_value);
opts := BLOG.DBA.BLOG2_SET_OPTION('AtomFeedVer', opts, self.atomver1.ufl_value);
opts := BLOG.DBA.BLOG2_SET_OPTION('AddonRSS', opts, self.custom_rss);
self.opts := opts;
update BLOG.DBA.SYS_BLOG_INFO set
BI_RSS_VERSION = self.rssver1.ufl_value,
BI_OPTIONS = serialize (opts)
where BI_BLOG_ID = self.blogid;
if (oldgtype <> self.gemstype1.ufl_value or self.atomver1.ufl_value <> self.atomver)
{
BLOG..BLOG_SET_GEMS (self.blogid, self.gemstype1.ufl_value, self.atomver1.ufl_value);
}
]]>
</v:on-post>
</v:button>
</td></tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:blog-header-widget">
<v:form name="blog_header_widget_form" type="simple" method="POST" xhtml_enctype="multipart/form-data">
<input type="hidden" name="ping_tab" value="<?V get_keyword('ping_tab', control.vc_page.vc_event.ve_params, '4') ?>"/>
<input type="hidden" name="blog_tab" value="<?V get_keyword('blog_tab', control.vc_page.vc_event.ve_params, '1') ?>"/>
<table>
<tr><th colspan="2"><h2>Blog Header</h2></th></tr>
<tr>
<td><label for="title1">Blog Title</label></td>
<td><v:text xhtml_class="textbox" xhtml_style="width: 220px" xhtml_id="title1" name="title1" value="--self.title" fmt-function="BLOG..blog_utf2wide"/></td>
</tr>
<tr>
<td><label for="about1">Description</label></td>
<td><v:text xhtml_class="textbox" xhtml_style="width: 220px" xhtml_id="about1" name="about1" value="--self.about" fmt-function="BLOG..blog_utf2wide" /></td>
</tr>
<tr>
<td><label for="welcome_msg">Welcome Message</label></td>
<td><v:textarea xhtml_style="width: 220px" name="welcome_msg" xhtml_id="welcome_msg" value="--get_keyword('WelcomeMessage', self.opts, '')" fmt-function="BLOG..blog_utf2wide"/></td>
</tr>
<tr>
<td><label for="copy1">Copyrights</label></td>
<td><v:text xhtml_class="textbox" xhtml_style="width: 220px" xhtml_id="copy1" name="copy1" value="--self.copy" fmt-function="BLOG..blog_utf2wide"/></td>
</tr>
<tr>
<td><label for="disc1">Disclaimer</label></td>
<td><v:text xhtml_class="textbox" xhtml_style="width: 220px" name="disc1" xhtml_id="disc1" value="--self.disc" fmt-function="BLOG..blog_utf2wide"/></td>
</tr>
<tr>
<td><label for="kwd1">Keywords</label></td>
<td>
<v:text xhtml_class="textbox" xhtml_style="width: 220px" name="kwd1" xhtml_id="kwd1" value="--self.kwd" fmt-function="BLOG..blog_utf2wide"/>
<v:button action="browse" name="br_authook1" value="Suggest..." selector="--sprintf('index.vspx?page=suggest_kwd&blogid=%s', self.blogid)" child-window-options="scrollbars=yes, resizable=yes, menubar=no, height=630, width=600" xhtml_class="real_button" >
<v:field name="kwd1" />
</v:button>
</td>
</tr>
<tr>
<td><label for="blog_url1">Blog URL</label></td>
<td>
<v:label name="blog_url_host1" value="--self.official_host_label" format="http://%s" />
<v:data-list
sql="select HP_LPATH from HTTP_PATH where HP_HOST = self.official_host and HP_PPATH = self.phome"
key-column="HP_LPATH"
value-column="HP_LPATH"
xhtml_class="textbox" xhtml_id="blog_url1" name="blog_url1" value="" >
<v:before-render>
control.ufl_value := rtrim (self.current_home, '/');
control.vs_set_selected ();
</v:before-render>
</v:data-list>
</td>
</tr>
<tr><td colspan="2">
<v:button xhtml_class="real_button" action="simple" name="blog_header_button" value="Save" xhtml_title="Save" xhtml_alt="Save">
<v:on-post>
<![CDATA[
declare opts any;
opts := self.opts;
opts := BLOG.DBA.BLOG2_SET_OPTION('WelcomeMessage', opts, self.welcome_msg.ufl_value);
self.opts := opts;
self.current_home := self.blog_url1.ufl_value || '/';
update BLOG.DBA.SYS_BLOG_INFO set
BI_TITLE = self.title1.ufl_value,
BI_HOME = self.current_home,
BI_ABOUT = self.about1.ufl_value,
BI_DISCLAIMER = self.disc1.ufl_value,
BI_COPYRIGHTS = self.copy1.ufl_value,
BI_KEYWORDS = self.kwd1.ufl_value,
BI_OPTIONS = serialize (opts)
where BI_BLOG_ID = self.blogid;
]]>
</v:on-post>
</v:button>
</td></tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:ping-tab">
<script type="text/javascript"><?vsp
declare pt, at, bt any;
bt := null;
if (get_keyword('ping_tab', self.vc_event.ve_params, '0') = '2')
{
pt := get_keyword ('profile_tab', self.vc_event.ve_params, '1');
at := get_keyword ('author_tab', self.vc_event.ve_params, '1');
if (pt = '1')
{
if (at = '1')
bt := 'bt';
else if (at = '2')
bt := 'bt2';
else if (at = '3')
bt := 'bt3';
else if (at = '4')
bt := 'bt4';
else if (at = '5')
bt := 'bt5';
}
else if (pt = '3')
{
bt := 'about_me_set_button';
}
else if (pt = '4')
{
bt := 'web_services_set_button';
}
}
else if (get_keyword('ping_tab', self.vc_event.ve_params, '0') = '3')
{
pt := get_keyword ('site_tab', self.vc_event.ve_params, '1');
if (pt = '1')
{
bt := 'ip_save';
}
else if (pt = '2')
{
bt := 'site_access_button';
}
else if (pt = '4')
{
bt := 'conv_save';
}
}
else if (get_keyword('ping_tab', self.vc_event.ve_params, '0') = '4')
{
pt := get_keyword ('blog_tab', self.vc_event.ve_params, '1');
if (pt = '1')
{
bt := 'blog_header_button';
}
else if (pt = '2')
{
bt := 'blog_global_button';
}
else if (pt = '3')
{
bt := 'blog_feed_button';
}
else if (pt = '4')
{
bt := 'blog_gem_button';
}
else if (pt = '5')
{
bt := 'ping_save';
}
}
else if (get_keyword('ping_tab', self.vc_event.ve_params, '0') = '6')
{
bt := 'set1';
}
if (bt is not null)
http (sprintf ('def_btn = \'%s\';', bt));
?></script>
<h3>Preferences</h3>
<v:method name="tab_1_lev" arglist="in what varchar"><![CDATA[
if (get_keyword('ping_tab', self.vc_event.ve_params, '1') = what)
return 'page_tab_selected';
return 'page_tab';
]]></v:method>
<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td>
<table cellpadding="10" cellspacing="0" border="0" width="100%">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<colgroup>
<col/>
<col/>
<col/>
<col/>
</colgroup>
<tr>
<td class="<?V self.tab_1_lev ('1') ?>" align="center" nowrap="1">
<v:url name="b_url21" value="General" format="%s" url="--'index.vspx?page=ping&ping_tab=1'" xhtml_class="button"/>
</td>
<!--td class="<?V self.tab_1_lev ('2') ?>" align="center" nowrap="1">
<v:url name="b_url12" value="Profile" format="%s" url="-#-'index.vspx?page=ping&ping_tab=2'" xhtml_class="button"/>
</td-->
<td class="<?V self.tab_1_lev ('3') ?>" align="center" nowrap="1">
<v:url name="b_url13" value="Site Access" format="%s" url="--'index.vspx?page=ping&ping_tab=3'" xhtml_class="button"/>
</td>
<td class="<?V self.tab_1_lev ('4') ?>" align="center" nowrap="1">
<v:url name="b_url14" value="Blog Settings" format="%s" url="--'index.vspx?page=ping&ping_tab=4'" xhtml_class="button"/>
</td>
<td class="<?V self.tab_1_lev ('6') ?>" align="center" nowrap="1">
<v:url name="b_url16" value="Moblog Settings" format="%s" url="--'index.vspx?page=ping&ping_tab=6'" xhtml_class="button"/>
</td>
<td class="page_tab_empty" align="center" width="100%">
<table cellpadding="0" cellspacing="0">
<tr>
<td width="100%" >
</td>
</tr>
</table>
</td>
</tr>
</table>
<table class="tab_page">
<tr>
<td valign="top">
<v:template name="template_page1" type="simple" instantiate="-- case when (get_keyword('ping_tab', control.vc_page.vc_event.ve_params) ='1' or get_keyword('ping_tab', control.vc_page.vc_event.ve_params) is null) then 1 else 0 end">
<vm:overview-widget/>
</v:template>
<v:template name="template_page3" type="simple" instantiate="-- equ(get_keyword('ping_tab', control.vc_page.vc_event.ve_params), '3')">
<vm:site-access-tab/>
</v:template>
<v:template name="template_page4" type="simple" instantiate="-- equ(get_keyword('ping_tab', control.vc_page.vc_event.ve_params), '4')">
<vm:blog-settings-tab/>
</v:template>
<v:template name="template_page6" type="simple" instantiate="-- equ(get_keyword('ping_tab', control.vc_page.vc_event.ve_params), '6')">
<vm:moblog-settings/>
</v:template>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="vm:blog-settings-tab">
<v:method name="tab_2_lev" arglist="in what varchar"><![CDATA[
if (get_keyword('blog_tab', self.vc_event.ve_params, '1') = what)
return 'page_tab_selected';
return 'page_tab';
]]></v:method>
<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td>
<table cellpadding="10" cellspacing="0" border="0" width="100%">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<colgroup>
<col/>
<col/>
<col/>
<col/>
</colgroup>
<tr>
<td class="<?V self.tab_2_lev ('1') ?>" align="center" nowrap="1">
<v:url name="b_url214" value="Blog Header" format="%s" url="--'index.vspx?page=ping&ping_tab=4&blog_tab=1'" xhtml_class="button"/>
</td>
<td class="<?V self.tab_2_lev ('2') ?>" align="center" nowrap="1">
<v:url name="b_url124" value="Global Settings" format="%s" url="--'index.vspx?page=ping&ping_tab=4&blog_tab=2'" xhtml_class="button"/>
</td>
<td class="<?V self.tab_2_lev ('3') ?>" align="center" nowrap="1">
<v:url name="b_url134" value="Feed, Archive and Query Settings" format="%s" url="--'index.vspx?page=ping&ping_tab=4&blog_tab=3'" xhtml_class="button"/>
</td>
<td class="<?V self.tab_2_lev ('4') ?>" align="center" nowrap="1">
<v:url name="b_url144" value="Blog GEM Display" format="%s" url="--'index.vspx?page=ping&ping_tab=4&blog_tab=4'" xhtml_class="button"/>
</td>
<td class="page_tab_empty" align="center" width="100%">
<table cellpadding="0" cellspacing="0">
<tr>
<td width="100%" >
</td>
</tr>
</table>
</td>
</tr>
</table>
<table class="tab_page">
<tr>
<td valign="top">
<v:template name="template_page124" type="simple" instantiate="-- case when(get_keyword('blog_tab', control.vc_page.vc_event.ve_params) ='1' or get_keyword('blog_tab', control.vc_page.vc_event.ve_params) is null) then 1 else 0 end">
<vm:blog-header-widget/>
</v:template>
<v:template name="template_page224" type="simple" instantiate="-- equ(get_keyword('blog_tab', control.vc_page.vc_event.ve_params), '2')">
<vm:blog-global-widget/>
</v:template>
<v:template name="template_page324" type="simple" instantiate="-- equ(get_keyword('blog_tab', control.vc_page.vc_event.ve_params), '3')">
<vm:blog-feed-widget/>
</v:template>
<v:template name="template_page424" type="simple" instantiate="-- equ(get_keyword('blog_tab', control.vc_page.vc_event.ve_params), '4')">
<vm:blog-gem-widget/>
</v:template>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="vm:site-access-tab">
<v:method name="tab_5_lev" arglist="in what varchar"><![CDATA[
if (get_keyword('site_tab', self.vc_event.ve_params, '1') = what)
return 'page_tab_selected';
return 'page_tab';
]]></v:method>
<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td>
<table cellpadding="10" cellspacing="0" border="0" width="100%">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<colgroup>
<col/>
<col/>
<col/>
</colgroup>
<tr>
<td class="<?V self.tab_5_lev ('1') ?>" align="center" nowrap="1">
<v:url name="b_url2122" value="Comment Banning" format="%s" url="--'index.vspx?page=ping&ping_tab=3&site_tab=1'" xhtml_class="button"/>
</td>
<td class="<?V self.tab_5_lev ('2') ?>" align="center" nowrap="1">
<v:url name="b_url1222" value="Comment Settings" format="%s" url="--'index.vspx?page=ping&ping_tab=3&site_tab=2'" xhtml_class="button"/>
</td>
<td class="<?V self.tab_5_lev ('4') ?>" align="center" nowrap="1">
<v:url name="b_url1242" value="Discussion" url="--'index.vspx?page=ping&ping_tab=3&site_tab=4'" xhtml_class="button"/>
</td>
<td class="<?V self.tab_5_lev ('3') ?>" align="center" nowrap="1">
<v:url name="b_url1232" value="Comments Management" format="%s" url="--'index.vspx?page=ping&ping_tab=3&site_tab=3'" xhtml_class="button"/>
</td>
<td class="page_tab_empty" align="center" width="100%">
<table cellpadding="0" cellspacing="0">
<tr>
<td width="100%" >
</td>
</tr>
</table>
</td>
</tr>
</table>
<table class="tab_page">
<tr>
<td valign="top">
<v:template name="template_page122" type="simple" instantiate="-- case when (get_keyword('site_tab', control.vc_page.vc_event.ve_params) ='1' or get_keyword('site_tab', control.vc_page.vc_event.ve_params) is null) then 1 else 0 end">
<vm:ip-ignore-widget/>
</v:template>
<v:template name="template_page222" type="simple" instantiate="-- equ(get_keyword('site_tab', control.vc_page.vc_event.ve_params), '2')">
<vm:site-access-widget/>
</v:template>
<v:template name="template_page322" type="simple" instantiate="-- equ(get_keyword('site_tab', control.vc_page.vc_event.ve_params), '3')">
<vm:pending-comments/>
</v:template>
<v:template name="template_page422" type="simple" instantiate="-- equ(get_keyword('site_tab', control.vc_page.vc_event.ve_params), '4')">
<input type="hidden" name="ping_tab" value="<?V get_keyword('ping_tab', control.vc_page.vc_event.ve_params, '4') ?>"/>
<input type="hidden" name="site_tab" value="<?V get_keyword('site_tab', control.vc_page.vc_event.ve_params, '1') ?>"/>
<h2>Discussion</h2>
<div>
<v:check-box name="cb_conv" value="1" xhtml_id="cb_conv" initial-checked="--self.conv"/>
<label for="cb_conv">Enable discussion on this blog</label><br />
<v:check-box name="cb_conv_init" value="1" xhtml_id="cb_conv_init" initial-checked="1"/>
<label for="cb_conv_init">Initialize the news group with existing posts</label>
<br />
<br />
<v:button xhtml_class="real_button" action="simple" name="conv_save" value="Save" xhtml_title="Save" xhtml_alt="Save">
<v:on-post>
update BLOG..SYS_BLOG_INFO set BI_SHOW_AS_NEWS = self.cb_conv.ufl_selected
where BI_BLOG_ID = self.blogid;
if (self.cb_conv_init.ufl_selected and self.cb_conv.ufl_selected and self.conv = 0)
{
BLOG..BLOG_FILL_NEWS_GROUP (self.blogid);
}
</v:on-post>
</v:button>
</div>
</v:template>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="vm:ip-ignore-widget">
<v:form name="ignore_widget_form" type="simple" method="POST" action="">
<input type="hidden" name="ping_tab" value="<?V get_keyword('ping_tab', control.vc_page.vc_event.ve_params, '3') ?>"/>
<input type="hidden" name="site_tab" value="<?V get_keyword('site_tab', control.vc_page.vc_event.ve_params, '1') ?>"/>
<table class="text" border="0">
<tr><th><h2>Comment Banning</h2></th></tr>
<tr><td><b>Add an IP address to the comment banning list</b></td></tr>
<tr>
<td>
Use the fields below to add a new IP address or mask.<br/>
When you are finished, click Add.
</td>
</tr>
<tr>
<td><b><label for="ip_ban">IP Address</label></b>
<br/>
Example: 192.168.1.104, 192.168.1.*
</td>
</tr>
<tr>
<td>
<v:text xhtml_class="textbox" name="ip_ban" value="" xhtml_id="ip_ban" xhtml_style="width: 220px;"/>
</td>
</tr>
<tr>
<td>
<v:button xhtml_class="real_button" action="simple" name="ip_save" value="Add" xhtml_title="Add" xhtml_alt="Add">
<v:on-post>
<![CDATA[
declare exit handler for sqlstate '*'
{
control.vc_parent.vc_error_message := __SQL_MESSAGE;
self.vc_is_valid := 0;
return;
};
declare match, ip_ban varchar;
ip_ban := trim(self.ip_ban.ufl_value);
if (ip_ban is null or length(ip_ban) = 0)
{
self.vc_error_message := 'Empty IP address';
self.vc_is_valid := 0;
return;
}
match := REGEXP_MATCH('[*0-9][0-9]?[0-9]?\\.[*0-9][0-9]?[0-9]?\\.[*0-9][0-9]?[0-9]?\\.[*0-9][0-9]?[0-9]?', ip_ban);
if (match is null or length(match) = 0 or match <> ip_ban)
{
self.vc_error_message := 'Wrong IP address';
self.vc_is_valid := 0;
return;
}
if (ip_ban = '127.0.0.1'
or ip_ban = '127.*'
or ip_ban = '127.*.*'
or ip_ban = '127.*.*.*'
or ip_ban = '*')
{
control.vc_parent.vc_error_message := 'You cannot ban the local IP';
self.vc_is_valid := 0;
return;
}
declare ord integer;
ord := coalesce ((select max (HA_ORDER) from DB.DBA.HTTP_ACL where HA_LIST = 'BLOG2IGNORE'), 0);
ord := ord + 1;
if (not exists (select 1
from DB.DBA.HTTP_ACL where HA_LIST = 'BLOG2IGNORE' and HA_CLIENT_IP = ip_ban))
{
insert into DB.DBA.HTTP_ACL
(HA_LIST, HA_ORDER, HA_CLIENT_IP, HA_FLAG)
values('BLOG2IGNORE', ord, trim(ip_ban), 1);
}
self.ds_ips.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
<tr><th><h2>Comment Ban List</h2></th></tr>
<tr>
<td>
<div>
Below is the list of IP addresses who you have banned<br/>
from commenting or from sending TrackBack pings to your<br/>
site. To delete a banned IP address, click the Delete<br/>
link in the table below.
</div>
</td>
</tr>
<tr><td>
<v:data-set name="ds_ips" nrows="10" scrollable="1" cursor-type="keyset" edit="1" width="80">
<v:sql>
<![CDATA[
select HA_CLIENT_IP from DB.DBA.HTTP_ACL where HA_LIST = 'BLOG2IGNORE'
]]>
</v:sql>
<v:column name="HA_CLIENT_IP" />
<v:template name="ips_template1" type="simple" name-to-remove="table" set-to-remove="bottom">
<table id="members_ip">
<tr>
<th>IP Address</th>
<th>Remove</th>
</tr>
</table>
</v:template>
<v:template name="ips_template2" type="repeat" name-to-remove="" set-to-remove="">
<v:template name="ips_template7" type="if-not-exists" name-to-remove="table" set-to-remove="both">
<table>
<tr>
<td align="center" colspan="2">
<b>No banned IP addresses</b>
</td>
</tr>
</table>
</v:template>
<v:template name="ips_template4" type="browse" name-to-remove="table" set-to-remove="both">
<table>
<tr>
<td align="left" nowrap="1">
<v:label name="ds_ips_name" value="--(control.vc_parent as vspx_row_template).te_rowset[0]" format="%s" />
</td>
<td align="right" nowrap="1">
<v:button xhtml_class="button" style="url" name="ds_ips_delete" action="simple" value="Delete">
<v:on-post>
<![CDATA[
declare exit handler for sqlstate '*'
{
control.vc_parent.vc_error_message := __SQL_MESSAGE;
self.vc_is_valid := 0;
return;
};
delete from DB.DBA.HTTP_ACL where HA_LIST = 'BLOG2IGNORE' and HA_CLIENT_IP = (control.vc_parent as vspx_row_template).te_rowset[0];
self.ds_ips.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</v:template>
</v:template>
<v:template name="ips_template3" type="simple" name-to-remove="table" set-to-remove="top">
<table>
<tr>
<td colspan="2" align="center">
<vm:ds-navigation data-set="ds_ips"/>
</td>
</tr>
</table>
</v:template>
</v:data-set>
</td></tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:overview-widget">
<v:form name="overview_widget_form" type="simple" method="POST" xhtml_enctype="multipart/form-data">
<input type="hidden" name="ping_tab" value="<?V get_keyword('ping_tab', control.vc_page.vc_event.ve_params) ?>"/>
<table>
<tr><th colspan="2"><h2>
<img border="0" alt="Author Profile Summary">
<xsl:if test="@image">
<xsl:attribute name="src"><?vsp
if (self.custom_img_loc)
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
else
http(self.stock_img_loc || 'user_32.png');
?></xsl:attribute>
</xsl:if>
<xsl:if test="not @image">
<xsl:attribute name="src"><?vsp http(self.stock_img_loc || 'user_32.png'); ?></xsl:attribute>
</xsl:if>
</img>
Author Profile Summary</h2></th></tr>
<tr>
<td>
<img border="0" alt="View Public Profile Page">
<xsl:if test="@image">
<xsl:attribute name="src"><?vsp
if (self.custom_img_loc)
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
else
http(self.stock_img_loc || 'apps_32.png');
?></xsl:attribute>
</xsl:if>
<xsl:if test="not @image">
<xsl:attribute name="src"><?vsp http(self.stock_img_loc || 'apps_32.png'); ?></xsl:attribute>
</xsl:if>
</img>
<b><v:url name="over_ref22" format="%s" value="View My Profile"
url="--self.owner_iri"
render-only="1"
is-local="1"
/>
</b>
</td>
<td>
<img border="0" alt="View Blog">
<xsl:if test="@image">
<xsl:attribute name="src"><?vsp
if (self.custom_img_loc)
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
else
http(self.stock_img_loc || 'home_32.png');
?></xsl:attribute>
</xsl:if>
<xsl:if test="not @image">
<xsl:attribute name="src"><?vsp http(self.stock_img_loc || 'home_32.png'); ?></xsl:attribute>
</xsl:if>
</img>
<b><v:url name="over_ref23" format="%s" value="--'View Blog'" url="--'index.vspx?page=index'"/></b>
</td>
</tr>
<tr><td colspan="2"><br/></td></tr>
<tr>
<td>User Name</td>
<th align="left">
<v:label value="--self.user_name"/>
</th>
</tr>
<tr>
<td>E-mail Address</td>
<th align="left">
<a href="mailto:<?V self.email ?>"><v:label value="--self.email"/></a>
</th>
</tr>
<tr>
<td>Display Name</td>
<th align="left">
<v:label value="--coalesce (USER_GET_OPTION(self.user_name, 'FULL_NAME'), '')"/>
</th>
</tr>
<tr>
<td>Personal Webpage</td>
<th align="left">
<?vsp
if (self.hpage is not null and trim(self.hpage) <> '')
{
?>
<a href="<?V case when subseq(self.hpage, 0, 7)='http://' or subseq(self.hpage, 0, 8)='https://' then self.hpage else concat('http://', self.hpage) end ?>"><v:label value="--self.hpage"/></a>
<?vsp
}
?>
</th>
</tr>
<tr>
<td>Time-Zone</td>
<th align="left">
<v:label value="--sprintf('GMT %s%02d:00', case when self.tz < 0 then '-' else '+' end, abs(self.tz))"/>
</th>
</tr>
<tr><th colspan="2"><h2>Quick Links</h2></th></tr>
<tr>
<td colspan="2">
<ul>
<li>
<v:url name="over_ref1" format="%s" value="--'Edit my author profile'" url="--sprintf ('%s/uiedit.vspx?RETURL=%U', wa_link(1), self.return_url_1)" is-local="1"/>
</li>
<li>
<v:url name="over_ref3" format="%s" value="--'Edit my mobile settings'" url="--'index.vspx?page=ping&ping_tab=6'"/>
</li>
<li>
<v:url name="over_ref4" format="%s" value="--'Block someone from commenting'" url="--'index.vspx?page=ping&ping_tab=3'"/>
</li>
</ul>
</td>
</tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:membership-widget">
<vm:if test="blog_owner">
<v:variable persist="0" name="mem_name" type="varchar" default="''"/>
<v:variable persist="0" name="mem_type" type="varchar" default="''"/>
<v:variable persist="0" name="mem_mode" type="integer" default="0"/>
<v:form type="simple" name="new_member_register" method="POST" action="">
<input type="hidden" name="page" value="membership"/>
<h3>Member registration</h3>
<table>
<tr>
<th nowrap="nowrap" align="right">
<label for="new_member_name">User name </label>
</th>
<td align="left">
<?vsp
if (self.mem_mode=1)
{
http(sprintf('<b>%s</b>', self.mem_name));
}
else
{
?>
<v:data-list xhtml_class="select"
name="member_name"
sql="select U_NAME from SYS_USERS where U_DAV_ENABLE = 1 and U_IS_ROLE = 0"
key-column="U_NAME"
xhtml_readonly="--case when self.mem_mode=1 then 'readonly' else '@@hidden@@' end"
value-column="U_NAME"
defvalue="--self.mem_name"/>
<?vsp
}
?>
</td>
<td>
<?vsp
if (self.mem_mode = 0)
{
?>
<v:button xhtml_class="real_button" action="simple" name="register_user" value="Register member" xhtml_title="Register member" xhtml_alt="Register member">
<v:on-post>
<![CDATA[
{
-- check if user exists
declare _u_id, _u_name any;
_u_name := self.member_name.ufl_value;
_u_id := (select U_ID from SYS_USERS where U_NAME = _u_name and U_DAV_ENABLE = 1 and U_IS_ROLE = 0);
if(_u_id is null) {
self.vc_is_valid := 0;
self.vc_error_message := 'Entered user doesn\'t exist.';
goto end_block;
}
-- check if user is not member
if(exists(select 1 from WA_MEMBER where WAM_USER = _u_id and WAM_INST = (select WAI_NAME from WA_INSTANCE where WAI_TYPE_NAME = 'WEBLOG2' and (WAI_INST as wa_blog2).blogid = self.blogid))) {
self.vc_is_valid := 0;
self.vc_error_message := 'Entered user already is member or awaiting for approval.';
goto end_block;
}
-- add member
declare _wam_inst any;
_wam_inst := (select WAI_NAME from WA_INSTANCE where WAI_TYPE_NAME = 'WEBLOG2' and (WAI_INST as wa_blog2).blogid = self.blogid);
insert into WA_MEMBER(WAM_USER, WAM_INST, WAM_MEMBER_TYPE, WAM_STATUS)
values(_u_id, _wam_inst, self.membership_type.ufl_value, 2);
-- refresh dataset
self.ds_members.vc_data_bind(e);
end_block:
;
}
]]>
</v:on-post>
</v:button>
<?vsp
}
else
{
?>
<v:button xhtml_class="real_button" action="simple" name="mod_user" value="Modify" xhtml_title="Modify" xhtml_alt="Modify">
<v:on-post>
<![CDATA[
-- check if user already exists
declare _u_id, _u_name any;
if (self.mem_mode =1 )
_u_name := self.mem_name;
else
_u_name := self.member_name.ufl_value;
_u_id := (select U_ID from SYS_USERS where U_NAME = _u_name and U_DAV_ENABLE = 1 and U_IS_ROLE = 0);
if(_u_id is null)
{
self.vc_is_valid := 0;
self.vc_error_message := 'Selected user does not exist';
goto end_block;
}
-- modify member
declare _wam_inst any;
declare exit handler for sqlstate '*'
{
rollback work;
self.vc_error_message :=concat (__SQL_STATE,' ',__SQL_MESSAGE);
if ('WA002' = __SQL_STATE)
self.vc_error_message := 'SMTP server is not defined. Mail verification impossible.';
self.vc_is_valid := 0;
return;
};
commit work;
_wam_inst := (select WAI_NAME from WA_INSTANCE where WAI_TYPE_NAME = 'WEBLOG2' and (WAI_INST as wa_blog2).blogid = self.blogid);
update WA_MEMBER
set WAM_MEMBER_TYPE = self.membership_type.ufl_value
where
WAM_USER = _u_id and
WAM_INST = _wam_inst and
WAM_STATUS = 2;
-- refresh dataset
end_block:;
self.mem_name := '';
self.mem_type := '';
self.mem_mode := 0;
self.mem_mode := 0;
self.vc_data_bind(e);
self.ds_members.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
<v:button xhtml_class="real_button" action="simple" name="mod_cancel" value="Cancel" xhtml_title="Cancel" xhtml_alt="Cancel">
<v:on-post>
<![CDATA[
self.mem_name := '';
self.mem_type := '';
self.mem_mode := 0;
self.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
<?vsp
}
?>
</td>
</tr>
<?vsp
if (self.mem_mode = 0)
{
?>
<tr>
<th/>
<td align="left">
<v:text xhtml_class="textbox"
name="new_member_name"
xhtml_readonly="--case when self.mem_mode=1 then 'readonly' else '@@hidden@@' end"
xhtml_id="new_member_name"
value="--self.mem_name"/>
</td>
<td>
<v:button xhtml_class="real_button" action="simple" name="create_user" value="Create and register member" xhtml_title="Create and register member" xhtml_alt="Create and register member">
<v:on-post>
<![CDATA[
{
-- check if user already exists
declare _u_id, _u_name any;
_u_name := trim(self.new_member_name.ufl_value);
if (_u_name is null or _u_name = '')
{
self.vc_is_valid := 0;
self.vc_error_message := 'User name should not be empty';
goto end_block;
}
_u_id := (select U_ID from SYS_USERS where U_NAME = _u_name and U_DAV_ENABLE = 1 and U_IS_ROLE = 0);
if(_u_id is not null) {
self.vc_is_valid := 0;
self.vc_error_message := 'Entered user already exists';
goto end_block;
}
-- create new dav user (password = name)
USER_CREATE(_u_name, _u_name,
vector('HOME', '/DAV/home/' || _u_name || '/',
'DAV_ENABLE' , 1, 'SQL_ENABLE', 0,
'maxBytesPerUser', 41943040, 'maxFileSize', 1048576,
'FULL_NAME', _u_name));
_u_id := (select U_ID from SYS_USERS where U_NAME = _u_name and U_DAV_ENABLE = 1 and U_IS_ROLE = 0);
-- add member
declare _wam_inst any;
_wam_inst := (select WAI_NAME from WA_INSTANCE where WAI_TYPE_NAME = 'WEBLOG2' and (WAI_INST as wa_blog2).blogid = self.blogid);
insert into WA_MEMBER(WAM_USER, WAM_INST, WAM_MEMBER_TYPE, WAM_STATUS)
values(_u_id, _wam_inst, self.membership_type.ufl_value, 2);
-- refresh dataset
self.ds_members.vc_data_bind(e);
end_block:
;
}
]]>
</v:on-post>
</v:button>
</td>
</tr>
<?vsp
}
?>
<tr>
<th nowrap="nowrap" align="right">
<label for="membership_type">Membership Type </label>
</th>
<td align="left">
<v:data-list xhtml_class="select"
name="membership_type"
sql="select WMT_NAME, WMT_ID from WA_MEMBER_TYPE where WMT_ID <> 1 and WMT_APP = (select WAI_TYPE_NAME from WA_INSTANCE where WAI_TYPE_NAME = 'WEBLOG2' and (WAI_INST as wa_blog2).blogid = self.blogid)"
key-column="WMT_ID"
value-column="WMT_NAME"
defvalue="--case when self.mem_name='' then '' else self.mem_type end"
/>
</td>
</tr>
<?vsp
if (self.mem_mode = 0)
{
?>
<tr>
<td colspan="3">
<p>* Note: If you select "Register new member",<br/>
you should enter the user name of existing user.<br/>
If you select "Create and register new member",<br/>
new user will be created with password equal to user name.</p>
</td>
</tr>
<?vsp
}
?>
</table>
</v:form>
<h3>List of registered members</h3>
<div>
<v:error-summary match="ds_members"/>
</div>
<v:data-set name="ds_members" nrows="10" scrollable="1" cursor-type="keyset" edit="1">
<input type="hidden" name="page" value="membership"/>
<v:sql>
<![CDATA[
select
U_NAME,
WMT_NAME
from
WA_MEMBER,
SYS_USERS,
WA_MEMBER_TYPE,
WA_TYPES
where
WMT_APP = (select
WAI_TYPE_NAME
from
WA_INSTANCE
where
WAI_TYPE_NAME = 'WEBLOG2' and
(WAI_INST as wa_blog2).blogid = self.blogid
) and
WAT_NAME = WMT_APP and
WMT_ID = WAM_MEMBER_TYPE and
U_ID = WAM_USER and
WAM_INST = (select
WAI_NAME
from
WA_INSTANCE
where
WAI_TYPE_NAME = 'WEBLOG2' and
(WAI_INST as wa_blog2).blogid = self.blogid
) and
WAM_STATUS = 2
union all
select U_NAME, 'owner'
from
BLOG.DBA.SYS_BLOG_INFO,
SYS_USERS
where
BI_BLOG_ID = self.blogid and
BI_OWNER = U_ID
]]>
</v:sql>
<v:column name="U_NAME" />
<v:column name="WMT_NAME" />
<v:template name="template1" type="simple" name-to-remove="table" set-to-remove="bottom">
<table class="listing">
<tr class="listing_header_row">
<th>User Name</th>
<th>Membership Type</th>
<th>Action</th>
</tr>
</table>
</v:template>
<v:template name="template2" type="repeat" name-to-remove="" set-to-remove="">
<v:template name="template7" type="if-not-exists" name-to-remove="table" set-to-remove="both">
<table>
<tr class="listing_count">
<td class="listing_count" colspan="3">
<b>No members registered</b>
</td>
</tr>
</table>
</v:template>
<v:template name="template4" type="browse" name-to-remove="table" set-to-remove="both">
<table>
<?vsp
self.r_count := self.r_count + 1;
http (sprintf ('<tr class="%s">', case when mod (self.r_count, 2) then 'listing_row_odd' else 'listing_row_even' end));
?>
<td class="listing_col" nowrap="1">
<v:label name="ds_members_name" value="--(control.vc_parent as vspx_row_template).te_rowset[0]" format="%s" />
</td>
<td class="listing_col" nowrap="1">
<v:label name="ds_members_type" value="--(control.vc_parent as vspx_row_template).te_rowset[1]" format="%s" />
</td>
<td class="listing_col_action" nowrap="1">
<v:button xhtml_class="button" style="url" name="ds_members_edit" action="simple" value="Edit">
<v:before-render>
<![CDATA[
if(self.blog_access <> 1 or (control.vc_parent as vspx_row_template).te_rowset[1] = 'owner')
control.vc_enabled := 0;
]]>
</v:before-render>
<v:on-post>
<![CDATA[
self.mem_name := (control.vc_parent as vspx_row_template).te_rowset[0];
self.mem_type := (control.vc_parent as vspx_row_template).te_rowset[1];
self.mem_mode := 1;
self.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
<v:button xhtml_class="button" style="url" name="ds_members_delete" action="simple" value="Delete">
<v:before-render>
<![CDATA[
if(self.blog_access <> 1 or (control.vc_parent as vspx_row_template).te_rowset[1] = 'owner')
control.vc_enabled := 0;
]]>
</v:before-render>
<v:on-post>
<![CDATA[
{
-- delete member
declare _u_id, _u_name, _wam_inst any;
_u_name := self.ds_members.ds_current_row.te_rowset[0];
declare exit handler for sqlstate '*'
{
rollback work;
self.vc_error_message :=concat (__SQL_STATE,' ',__SQL_MESSAGE);
if ('WA002' = __SQL_STATE)
self.vc_error_message := 'SMTP server is not defined. Mail verification impossible.';
self.vc_is_valid := 0;
return;
};
commit work;
_u_id := (select U_ID from SYS_USERS where U_NAME = _u_name);
_wam_inst := (select WAI_NAME from WA_INSTANCE where WAI_TYPE_NAME = 'WEBLOG2' and (WAI_INST as wa_blog2).blogid = self.blogid);
delete
from WA_MEMBER
where
WAM_USER = _u_id and
WAM_INST = _wam_inst;
-- refresh dataset
self.mem_mode := 0;
self.ds_members.vc_data_bind(e);
}
]]>
</v:on-post>
</v:button>
</td>
<?vsp
http ('</tr>');
?>
</table>
</v:template>
</v:template>
<v:template name="template3" type="simple" name-to-remove="table" set-to-remove="top">
<table>
<tr class="browse_button_row">
<td colspan="3" align="center">
<vm:ds-navigation data-set="ds_members"/>
</td>
</tr>
</table>
</v:template>
</v:data-set>
</vm:if>
</xsl:template>
<xsl:template match="vm:bridge">
<script type="text/javascript">
<![CDATA[
function check_pwd ()
{
var pwd1, pwd2;
pwd1 = document.page_form.upstr_pwd1.value;
pwd2 = document.page_form.upstr_pwd2.value;
if (pwd1 != pwd2)
{
alert ('Error: Passwords do not match');
document.page_form.upstr_pwd2.value = document.page_form.upstr_pwd2.defaultValue;
}
}
]]>
</script>
<v:variable name="upstr_endpoint" type="varchar" default="'/RPC2'" persist="session"/>
<v:variable name="upstr_host" type="varchar" default="''" persist="session"/>
<v:variable name="upstr_port" type="varchar" default="'80'" persist="session"/>
<v:variable name="upstr_epurl" type="varchar" default="''" persist="temp"/>
<v:variable name="upstr_usr" type="varchar" default="''" persist="temp"/>
<v:variable name="upstr_pwd" type="varchar" default="''" persist="temp"/>
<v:variable name="upstr_del" type="int" default="1" persist="temp"/>
<v:variable name="upstr_typ" type="varchar" default="''" persist="temp"/>
<v:variable name="upstr_freq" type="int" default="60" persist="temp"/>
<v:variable name="upstr_incl" type="varchar" default="''" persist="temp"/>
<v:variable name="upstr_excl" type="varchar" default="''" persist="temp"/>
<v:variable name="upstr_ebid" type="varchar" default="''" persist="session"/>
<v:variable name="upstr_jobid" type="int" default="null" persist="1"/>
<v:variable name="upstr_editmode" type="int" default="0" persist="pagestate"/>
<v:variable name="item_retr" type="int" default="5" />
<v:variable name="max_retr" type="int" default="-1" />
<input type="hidden" name="page" value="bridge"/>
<h3>Upstreaming</h3>
<table width="100%" border="0">
<tr>
<td>
<v:template type="simple" name="upstr_editform">
<div class="form1">
<table>
<tr>
<th>Hostname</th>
<td>
<v:text xhtml_class="textbox" name="upstr_hn1" value="--self.upstr_host" xhtml_tabindex="1" error-glyph="*">
<v:before-render>
if (self.upstr_editmode)
{
control.vc_add_attribute ('disabled', '1');
}
</v:before-render>
</v:text>
</td>
<th>Username</th>
<td><v:text xhtml_class="textbox" name="upstr_un1" value="--self.upstr_usr" xhtml_tabindex="4"/></td>
</tr>
<tr>
<th>Port</th>
<td>
<v:text xhtml_class="textbox" name="upstr_port1" value="--self.upstr_port" xhtml_tabindex="2">
<v:validator test="regexp" regexp="^[0-9]+$" message="Number is expected" runat='client'/>
<v:before-render>
if (self.upstr_editmode)
{
control.vc_add_attribute ('disabled', '1');
}
</v:before-render>
</v:text>
</td>
<th>Password</th>
<td><v:text xhtml_class="textbox" name="upstr_pwd1" value="--self.upstr_pwd" type="password" xhtml_tabindex="5"/></td>
</tr>
<tr>
<th>Endpoint</th>
<td>
<v:text xhtml_class="textbox" name="upstr_ep1" value="--self.upstr_endpoint" xhtml_tabindex="3">
<v:before-render>
if (self.upstr_editmode)
{
control.vc_add_attribute ('disabled', '1');
}
</v:before-render>
</v:text>
</td>
<th>Retype Password</th>
<td><v:text xhtml_class="textbox" name="upstr_pwd2" value="--self.upstr_pwd" type="password" xhtml_tabindex="6" xhtml_onblur="check_pwd();"/></td>
</tr>
<tr>
<th nowrap="nowrap">Select Blog</th>
<td>
<v:text xhtml_class="textbox" name="upstr_pn1" value="--self.upstr_ebid" xhtml_tabindex="7">
<v:before-render>
if (self.upstr_editmode)
{
control.vc_add_attribute ('disabled', '1');
}
</v:before-render>
</v:text>
<v:button xhtml_class="real_button" action="browse" name="upstr_get_blogs3" value="Fetch" selector="index.vspx?page=get_blogs" child-window-options="scrollbars=yes, resize=yes, menubar=no, height=200, width=600" xhtml_title="Fetch" xhtml_alt="Fetch" enabled="--equ(self.upstr_editmode,0)">
<v:field name="upstr_hn1"/>
<v:field name="upstr_port1"/>
<v:field name="upstr_ep1"/>
<v:field name="upstr_un1"/>
<v:field name="upstr_pwd1"/>
<v:field name="upstr_at1"/>
<v:field name="upstr_pn1"/>
<v:field name="aupstr_pn1" ref="upstr_pn1"/>
</v:button>
</td>
<th>API Type</th>
<td>
<v:data-list xhtml_class="select" name="upstr_at1" column="R_PROTOCOL_ID" sql="select * from BLOG.DBA.SYS_ROUTING_PROTOCOL where RP_ID in (1,2,3,5)" key-column="RP_ID" value-column="RP_NAME">
<v:after-data-bind>
control.ufl_value := self.upstr_typ;
control.vs_set_selected ();
</v:after-data-bind>
</v:data-list>
</td>
</tr>
<tr>
<th>Include</th>
<td>
<v:data-list xhtml_class="select" name="upstr_bc1"
sql="select '' MTC_ID, 'none' MTC_NAME from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid union select MTC_ID, MTC_NAME||case when MTC_ROUTING then '*' else '' end as MTC_NAME from BLOG.DBA.MTYPE_CATEGORIES where MTC_BLOG_ID = self.blogid" key-column="MTC_ID" value-column="MTC_NAME" xhtml_size="5" multiple="1">
<v:after-data-bind>
control.ufl_value := self.upstr_incl;
control.vs_set_selected ();
</v:after-data-bind>
</v:data-list>
</td>
<th>Exclude</th>
<td>
<v:data-list xhtml_class="select" name="upstr_bc2"
sql="select '' MTC_ID, 'none' MTC_NAME from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid union select MTC_ID, MTC_NAME||case when MTC_ROUTING then '*' else '' end as MTC_NAME from BLOG.DBA.MTYPE_CATEGORIES where MTC_BLOG_ID = self.blogid" key-column="MTC_ID" value-column="MTC_NAME" xhtml_size="5" multiple="1">
<v:after-data-bind>
control.ufl_value := self.upstr_excl;
control.vs_set_selected ();
</v:after-data-bind>
</v:data-list>
</td>
</tr>
<tr>
<th nowrap="nowrap">
<v:check-box name="upstr_initall" initial-checked="0" />
Start Date (YYYY-MM-DD)<sup><small>(i)</small></sup></th>
<td>
<v:text xhtml_class="textbox" error-glyph="*" name="upstr_inital_sd"/>
</td>
<th>End Date (YYYY-MM-DD)</th>
<td>
<v:text xhtml_class="textbox" name="upstr_inital_ed"/>
</td>
</tr>
<tr>
<th colspan="2">
<v:check-box name="do_delete" initial-checked="1">
<v:after-data-bind>
if (self.upstr_del)
control.ufl_selected := 1;
else
control.ufl_selected := 0;
</v:after-data-bind>
</v:check-box>
Propagate deletions
</th>
<th>Frequency</th>
<td>
<v:text xhtml_class="textbox" name="upstr_bfr1" xhtml_size="5" value="--self.upstr_freq">
<v:validator test="regexp" regexp="^[0-9]+$" message="Number is expected" runat='client'/>
</v:text>
</td>
</tr>
<tr>
<th nowrap="nowrap">
Maximum errors before to suspend job (-1 means never)
</th>
<td>
<v:text xhtml_class="textbox" error-glyph="*" name="max_retr1" value="--self.max_retr">
<v:validator test="regexp" regexp="^(-)?[0-9]+$" message="Number is expected" runat='client'/>
</v:text>
</td>
<th>Default max post retransmissions</th>
<td>
<v:text xhtml_class="textbox" name="item_retr1" value="--self.item_retr">
<v:validator test="regexp" regexp="^[0-9]+$" message="Number is expected" runat='client'/>
</v:text>
</td>
</tr>
<tr>
<td colspan="2"> </td><td>
<v:button xhtml_class="real_button" name="upstr_test1"
value="--case when self.upstr_editmode = 0 then 'Add' else 'Update' end" action="simple" xhtml_title="--case when self.upstr_editmode = 0 then 'Add' else 'Update' end" xhtml_alt="--case when self.upstr_editmode = 0 then 'Add' else 'Update' end">
<v:on-post>
<![CDATA[
declare iincl, eexcl, target, upstr_hn1, upstr_ep1, upstr_pn1 varchar;
declare jid, i, l, upstr_bfr1, keep_remote integer;
upstr_bfr1 := atoi(trim(self.upstr_bfr1.ufl_value));
keep_remote := 1;
if (self.do_delete.ufl_selected)
keep_remote := 0;
if (self.upstr_editmode = 1)
{
self.upstr_hn1.ufl_value := self.upstr_host;
self.upstr_ep1.ufl_value := self.upstr_endpoint;
self.upstr_port1.ufl_value := self.upstr_port;
self.upstr_pn1.ufl_value := self.upstr_ebid;
}
upstr_hn1 := trim(self.upstr_hn1.ufl_value);
upstr_ep1 := trim(self.upstr_ep1.ufl_value);
upstr_pn1 := trim(self.upstr_pn1.ufl_value);
if (upstr_hn1 is null or upstr_hn1 = '')
{
self.upstr_hn1.ufl_value := '';
self.vc_error_message := 'Please enter correct hostname.';
self.vc_is_valid := 0;
return;
}
if (upstr_ep1 is null or upstr_ep1 = '')
{
self.upstr_ep1.ufl_value := '';
self.vc_error_message := 'Please enter correct endpoint.';
self.vc_is_valid := 0;
return;
}
if (upstr_pn1 is null or upstr_pn1 = '')
{
self.upstr_pn1.ufl_value := '';
self.vc_error_message := 'Please enter correct blog.';
self.vc_is_valid := 0;
return;
}
if (self.upstr_pwd1.ufl_value <> self.upstr_pwd2.ufl_value)
{
self.upstr_pwd1.ufl_value := '';
self.upstr_pwd2.ufl_value := '';
self.vc_error_message := 'Passwords must be the same.';
self.vc_is_valid := 0;
return;
}
if (upstr_bfr1 is null or upstr_bfr1 <= 0)
{
self.upstr_bfr1.ufl_value := '60';
self.vc_error_message := 'Please enter correct frequency.';
self.vc_is_valid := 0;
return;
}
self.max_retr := atoi (trim (self.max_retr1.ufl_value));
self.item_retr := atoi (trim (self.item_retr1.ufl_value));
if (self.max_retr = 0 and self.max_retr1.ufl_value <> '0')
{
self.vc_error_message := 'Invalid nuber supplied';
self.vc_is_valid := 0;
return;
}
if (self.item_retr = 0 and self.item_retr1.ufl_value <> '0')
{
self.vc_error_message := 'Invalid nuber supplied';
self.vc_is_valid := 0;
return;
}
declare exit handler for sqlstate '*'
{
self.vc_is_valid := 0;
self.vc_error_message := 'Incorrect date value. YYYY-MM-DD is expected.';
return;
};
declare __ed, __sd datetime;
__ed := __sd := null;
if (length(trim(self.upstr_inital_ed.ufl_value)) > 0)
__ed := stringdate(trim(self.upstr_inital_ed.ufl_value));
else
self.upstr_inital_ed.ufl_value := '';
if (length(trim(self.upstr_inital_sd.ufl_value)) > 0)
__sd := stringdate(trim(self.upstr_inital_sd.ufl_value));
else
self.upstr_inital_sd.ufl_value := '';
target := sprintf ('http://%s:%s%s', upstr_hn1, self.upstr_port1.ufl_value, upstr_ep1);
declare exit handler for sqlstate '*'
{
self.vc_is_valid := 0;
self.vc_error_message := __SQL_MESSAGE;
return;
};
iincl := eexcl := '';
i := 0;
l := length (self.upstr_bc1.ufl_value);
while (i < l)
{
iincl := iincl || cast (self.upstr_bc1.ufl_value[i] as varchar) || ';';
i := i + 1;
}
i := 0;
l := length (self.upstr_bc2.ufl_value);
while (i < l)
{
eexcl := eexcl || cast (self.upstr_bc2.ufl_value[i] as varchar) || ';';
i := i + 1;
}
-- it's necessary to remove last ; symbol (or add it if list is empty)
if(length(eexcl) > 1)
eexcl := subseq(eexcl, 0, length(eexcl) - 1);
else
eexcl := ';';
if(length(iincl) > 1)
iincl := subseq(iincl, 0, length(iincl) - 1);
else
iincl := ';';
if (self.upstr_jobid is not null and self.upstr_editmode > 0)
{
update BLOG.DBA.SYS_ROUTING set
R_DESTINATION = target,
R_AUTH_USER = self.upstr_un1.ufl_value,
R_AUTH_PWD = self.upstr_pwd1.ufl_value,
R_ITEM_ID = self.blogid,
R_TYPE_ID = 1,
R_PROTOCOL_ID = self.upstr_at1.ufl_value,
R_DESTINATION_ID = upstr_pn1,
R_FREQUENCY = upstr_bfr1,
R_EXCEPTION_ID = eexcl,
R_INCLUSION_ID = iincl,
R_KEEP_REMOTE = keep_remote,
R_MAX_ERRORS = self.max_retr,
R_ITEM_MAX_RETRANSMITS = self.item_retr
where R_JOB_ID = self.upstr_jobid;
jid := self.upstr_jobid;
}
else
{
jid := coalesce(
(select top 1 R_JOB_ID from BLOG.DBA.SYS_ROUTING order by R_JOB_ID desc), 0)+1;
insert into BLOG.DBA.SYS_ROUTING (
R_JOB_ID,
R_DESTINATION,
R_AUTH_USER,
R_AUTH_PWD,
R_ITEM_ID,
R_TYPE_ID,
R_PROTOCOL_ID,
R_DESTINATION_ID,
R_FREQUENCY,
R_EXCEPTION_ID,
R_INCLUSION_ID,
R_KEEP_REMOTE,
R_MAX_ERRORS,
R_ITEM_MAX_RETRANSMITS
)
values (
jid,
target,
self.upstr_un1.ufl_value,
self.upstr_pwd1.ufl_value,
self.blogid,
1,
self.upstr_at1.ufl_value,
upstr_pn1,
self.upstr_bfr1.ufl_value,
eexcl,
iincl,
keep_remote,
self.max_retr,
self.item_retr
);
}
if (self.upstr_initall.ufl_selected and control.vc_focus and self.vc_is_valid)
{
for select B_POST_ID from BLOG.DBA.SYS_BLOGS
where B_STATE = 2 and B_BLOG_ID = self.blogid
and (__sd is null or B_TS >= __sd) and (__ed is null or B_TS <= __ed)
do
{
insert soft BLOG.DBA.SYS_BLOGS_ROUTING_LOG (
RL_JOB_ID,
RL_POST_ID,
RL_TYPE)
values (
jid,
B_POST_ID,
'I');
}
}
self.upstr_jobid := null;
self.upstr_host := '';
self.upstr_port := '80';
self.upstr_usr := '';
self.upstr_ebid := '';
self.upstr_pwd := '';
self.upstr_endpoint := '/RPC2';
self.upstr_freq := 60;
self.upstr_editmode := 0;
self.upstr_initall.ufl_selected := 0;
self.item_retr := 5;
self.max_retr := -1;
self.upstr_editform.vc_data_bind (e);
self.upstr_ds.vc_data_bind (e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</div>
<div>
<a name="note">
<b><i>Notes:</i></b>
</a>
<ol type="i">
<li>Initialize routing job log with existing posts</li>
<li>* Denotes upstreaming is enabled for post category</li>
</ol>
</div>
</v:template>
<br />
<table class="listing">
<v:data-set name="upstr_ds" sql="select
R_DESTINATION_ID,
R_DESTINATION,
RP_NAME,
R_AUTH_USER,
R_AUTH_PWD,
R_JOB_ID,
R_ITEM_ID,
R_FREQUENCY,
R_EXCEPTION_ID,
R_INCLUSION_ID,
RP_ID,
R_KEEP_REMOTE,
R_LAST_ROUND,
R_MAX_ERRORS,
R_ITEM_MAX_RETRANSMITS
from BLOG.DBA.SYS_ROUTING, BLOG.DBA.SYS_ROUTING_PROTOCOL
where R_ITEM_ID = :thisblogid and RP_ID = R_PROTOCOL_ID and R_TYPE_ID = 1 order by R_JOB_ID"
nrows="10" scrollable="1" cursor-type="keyset" edit="1" width="80">
<v:param name="thisblogid" value="--self.blogid"/>
<v:template name="upstr_template1" type="simple">
<tr class="listing_header_row">
<th>Endpoint</th>
<th>Type</th>
<th>BlogID</th>
<th>Frequency (minutes)</th>
<th>Last sync</th>
<th>Status</th>
<th>Except</th>
<th>Include</th>
<th>Action</th>
</tr>
</v:template>
<v:template name="upstr_template2" type="repeat">
<v:template name="upstr_template4" type="browse">
<?vsp
self.r_count := self.r_count + 1;
http (sprintf ('<tr class="%s">', case when mod (self.r_count, 2) then 'listing_row_odd' else 'listing_row_even' end));
?>
<td class="listing_col" nowrap="1">
<v:label name="upstr_label51" value="--(control.vc_parent as vspx_row_template).te_rowset[1]" format="%s" />
</td>
<td class="listing_col" nowrap="1">
<v:label name="upstr_label71" value="--(control.vc_parent as vspx_row_template).te_rowset[2]" format="%s"/>
</td>
<td class="listing_col" nowrap="1">
<v:label name="upstr_label61" value="--(control.vc_parent as vspx_row_template).te_rowset[0]" format="%s"/>
</td>
<td class="listing_col_num" nowrap="1">
<v:label name="upstr_label710" value="--(control.vc_parent as vspx_row_template).te_rowset[7]" format="%d"/>
</td>
<td class="listing_col_num" nowrap="1">
<?vsp if (control.te_rowset[12] is not null) http (BLOG..blog_date_fmt (control.te_rowset[12])); ?>
</td>
<td class="listing_col_num" nowrap="1">
<?vsp
if (control.te_rowset[13] = -1)
http ('enabled');
else if (control.te_rowset[13] = 0)
http ('on hold');
else
http (sprintf ('hold after %d error(s)', control.te_rowset[13]));
?>
</td>
<td class="listing_col" nowrap="1">
<v:label name="upstr_label711" value="" format="%s">
<v:after-data-bind>
<![CDATA[
declare txt, eids any;
txt := '';
eids := coalesce (split_and_decode ((control.vc_parent as vspx_row_template).te_rowset[8], 0, '\0\0;'), vector ());
for select MTC_NAME from BLOG.DBA.MTYPE_CATEGORIES where position (MTC_ID, eids) do
{
txt := txt || MTC_NAME || ';';
}
if (txt = '')
txt := 'none';
control.ufl_value := txt;
]]>
</v:after-data-bind>
</v:label>
</td>
<td class="listing_col" nowrap="1">
<v:label name="upstr_label711i" value="" format="%s">
<v:after-data-bind>
<![CDATA[
declare txt, eids any;
txt := '';
eids := coalesce (split_and_decode ((control.vc_parent as vspx_row_template).te_rowset[9], 0, '\0\0;'), vector ());
for select MTC_NAME from BLOG.DBA.MTYPE_CATEGORIES where position (MTC_ID, eids) do
{
txt := txt || MTC_NAME || ';';
}
if (txt = '')
txt := 'none';
control.ufl_value := txt;
]]>
</v:after-data-bind>
</v:label>
</td>
<td class="listing_col_action" nowrap="1">
<v:button xhtml_class="button" name="upstr_ds_edit" action="simple" value="Edit" style="url">
<v:on-post>
<![CDATA[
declare hinfo, hp, rows, host any;
rows := (control.vc_parent as vspx_row_template).te_rowset;
hinfo := WS.WS.PARSE_URI (rows[1]);
host := hinfo[1];
if (strchr (host, ':') is null)
host := host || ':80';
hp := split_and_decode (host,0,'\0\0:');
self.upstr_host := hp[0];
self.upstr_port := hp[1];
self.upstr_usr := rows[3];
self.upstr_pwd := rows[4];
self.upstr_endpoint := hinfo[2];
self.upstr_ebid := rows[0];
self.upstr_typ := rows[10];
self.upstr_del := equ (rows[11], 0);
self.upstr_freq := rows[7];
self.upstr_jobid := rows[5];
self.max_retr := rows[13];
self.item_retr := rows[14];
self.upstr_incl := split_and_decode (rows[9], 0, '\0\0;');
self.upstr_excl := split_and_decode (rows[8], 0, '\0\0;');
self.upstr_editmode := 1;
self.upstr_editform.vc_data_bind (e);
]]>
</v:on-post>
</v:button>
<v:button xhtml_class="button" name="upstr_ds_delete" action="simple" value="Delete" style="url">
<v:on-post>
<![CDATA[
delete from BLOG.DBA.SYS_ROUTING
where R_JOB_ID = (control.vc_parent as vspx_row_template).te_rowset[5];
self.upstr_ds.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
</td>
<?vsp
http ('</tr>');
?>
</v:template>
<v:template name="upstr_template7" type="if-not-exists">
<tr class="listing_count">
<td class="listing_count" colspan="8">
No routes defined
</td>
</tr>
</v:template>
</v:template>
<v:template name="upstr_template3" type="simple">
<tr class="browse_button_row">
<td colspan="8" align="center">
<vm:ds-navigation data-set="upstr_ds"/>
</td>
</tr>
</v:template>
</v:data-set>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="vm:popup_page_wrapper">
<xsl:element name="v:variable">
<xsl:attribute name="persist">0</xsl:attribute>
<xsl:attribute name="name">page_owner</xsl:attribute>
<xsl:attribute name="type">varchar</xsl:attribute>
<xsl:choose>
<xsl:when test="../@vm:owner">
<xsl:attribute name="default">'<xsl:value-of select="../@vm:owner"/>'</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="default">null</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:apply-templates select="node()|processing-instruction()" />
<div id="copyright_ctr">Copyright &copy; 1998-<?V "LEFT" (datestring (now()), 4) ?> OpenLink Software</div>
</xsl:template>
<xsl:template match="vm:templates">
<script type="text/javascript"><![CDATA[
var oWebDAV;
def_btn = 'save_tmpl_changes';
function weblog2DavInit ()
{
var options = { imagePath: '/ods/images/oat/',
imageExt: 'png',
path: '<?V '/DAV/home/' || self.user_name || '/' ?>',
user: '<?V self.user_name ?>',
pass: '<?V (select pwd_magic_calc (U_NAME, U_PASSWORD, 1) from DB.DBA.SYS_USERS where U_NAME = self.user_name) ?>'
};
OAT.WebDav.init(options);
oWebDAV = OAT.WebDav;
}
function davBrowseOpen (fld, fext)
{
var options = { mode: 'browser',
onConfirmClick: function(path, fname) {$(fld).value = path + fname;},
filetypes:[{ext:fext,label:" "}]
};
oWebDAV.open(options);
}
function davBrowseSave (fld, f)
{
var options = { mode: 'browser',
onConfirmClick: function(path, fname) {$(fld).value = path + f;}
};
oWebDAV.open(options);
}
OAT.MSG.attach(OAT, OAT.MSG.OAT_LOAD, weblog2DavInit);
]]></script>
<input type="hidden" name="page" >
<xsl:attribute name="value"><xsl:apply-templates select="@page" mode="static_value"/></xsl:attribute>
</input>
<div><v:label name="tmpl_msg" value="--''" render-only="0"/></div>
<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td>
<table cellpadding="10" cellspacing="0" border="0" width="100%">
<tr>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<colgroup>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
</colgroup>
<tr>
<td
class="<?V case when
get_keyword ('tmpl_tab', self.vc_event.ve_params, '1') in ('1','3','4','5','6')
then 'page_tab_selected' else 'page_tab' end ?>"
align="center" nowrap="1">
<v:url name="b_url15" value="Edit Current"
url="index.vspx?page=templates&tmpl_tab=1"
xhtml_class="button"/>
</td>
<td class="<?V case when get_keyword ('tmpl_tab', self.vc_event.ve_params, '1') = '2' then 'page_tab_selected' else 'page_tab' end ?>" align="center" nowrap="1">
<v:url name="b_url16" value="Pick New"
url="index.vspx?page=templates&tmpl_tab=2"
xhtml_class="button"/>
</td>
<!--td
class="<?V case when
get_keyword ('tmpl_tab', self.vc_event.ve_params, '1') = '3'
then 'page_tab_selected' else 'page_tab' end ?>"
align="center" nowrap="1">
<v:url name="b_url17" value="Edit LinkBlog Template"
url="index.vspx?page=templates&tmpl_tab=3"
xhtml_class="button"/>
</td>
<td
class="<?V case when
get_keyword ('tmpl_tab', self.vc_event.ve_params, '1') = '4'
then 'page_tab_selected' else 'page_tab' end ?>"
align="center" nowrap="1">
<v:url name="b_url18" value="Edit Summary Template"
url="index.vspx?page=templates&tmpl_tab=4"
xhtml_class="button"/>
</td>
<td
class="<?V case when
get_keyword ('tmpl_tab', self.vc_event.ve_params, '1') = '5'
then 'page_tab_selected' else 'page_tab' end ?>"
align="center" nowrap="1">
<v:url name="b_url19" value="Edit Style"
url="index.vspx?page=templates&tmpl_tab=5"
xhtml_class="button"/>
</td-->
<td class="page_tab_empty" align="center" width="100%">
<table cellpadding="0" cellspacing="0">
<tr>
<td width="100%" >
</td>
</tr>
</table>
</td>
</tr>
</table>
<table class="tab_page">
<tr>
<td valign="top">
<v:template type="simple" name="edit_curr_tmpl"
enabled="--position (get_keyword ('tmpl_tab', e.ve_params, '1') , vector ('1', '3', '4', '5', '6'))">
<h3>
Edit
<?vsp
declare tname, pos varchar;
pos := strrchr (self.current_template, '/');
if (pos is not null)
tname :=
subseq (self.current_template, pos+1, length (self.current_template));
else
tname := 'default';
if (self.current_template like registry_get('_blog2_path_')||'%')
{
http ('built-in ');
http (tname);
}
else
{
http ('custom');
}
?>
template
</h3>
<div class="box">
Weblog View
<v:select-list
name="tmpl_tab"
value="--get_keyword ('tmpl_tab', e.ve_params, '1')"
auto-submit="1" >
<v:item name="Current" value="1"/>
<v:item name="Linkblog" value="3"/>
<v:item name="Summary" value="4"/>
<v:item name="Archive" value="6"/>
<v:item name="Style" value="5"/>
</v:select-list>
</div>
<div>
<v:textarea name="templ_src" xhtml_rows="20" xhtml_cols="100" value="">
<v:before-render><![CDATA[
declare file varchar;
declare e vspx_event;
e := self.vc_event;
if (length (self.rtr_vars))
{
control.ufl_value := get_keyword (control.vc_name, self.rtr_vars);
self.tmpl_tab.ufl_value := get_keyword ('tmpl_tab', self.rtr_vars);
self.tmpl_tab.vs_set_selected ();
}
else if ((not e.ve_is_post or e.ve_initiator = self.tmpl_tab)
and get_keyword ('tmpl_tab', e.ve_params, '1') <> '2')
{
file := case get_keyword ('tmpl_tab', e.ve_params, '1') when '1' then 'index.vspx' when '3' then 'linkblog.vspx' when '4' then 'summary.vspx' when '5' then 'default.css' when '6' then 'archive.vspx' else signal ('22023', 'Internal error: Incorrect template item') end;
control.ufl_value := BLOG..blog_utf2wide((select blob_to_string (RES_CONTENT) from WS.WS.SYS_DAV_RES where RES_FULL_PATH = self.current_template||'/'||file));
--dbg_obj_print (self.current_template, ' ', file, ' ', length(control.ufl_value));
if (not length(control.ufl_value))
{
control.ufl_value := BLOG..blog_utf2wide((select blob_to_string (RES_CONTENT) from
WS.WS.SYS_DAV_RES where RES_FULL_PATH = '/DAV/VAD/blog2/templates/openlink/'||file));
}
}
else
{
control.ufl_value := BLOG..blog_utf2wide (control.ufl_value);
}
]]></v:before-render>
</v:textarea>
</div>
<div class="form_actions">
<v:text type="hidden" value="--concat ('/DAV/home/',self.user_name,'/')" name="tmpl_home_path" />
<label for="load_tmpl_dav">Load template from DAV</label><br/>
<v:text name="load_tmpl_dav" xhtml_id="load_tmpl_dav" xhtml_size="80" xhtml_class="textbox" />
<v:button xhtml_class="real_button" action="browse" value="Browse...">
<v:after-data-bind>
<![CDATA[
declare fext varchar;
fext := 'vspx';
if (get_keyword ('tmpl_tab', e.ve_params, '1') = '5')
fext := 'css';
control.vc_add_attribute ('onclick', sprintf ('javascript: davBrowseOpen (''load_tmpl_dav'', ''%s'');', fext));
]]>
</v:after-data-bind>
</v:button>
<v:button xhtml_class="real_button" value="Load" action="simple" name="load_tmpl_dav_bt">
<v:on-post><![CDATA[
declare cont, rc, mime, pwd any;
if (not self.vc_is_valid)
return;
self.load_tmpl_dav.ufl_value := trim (self.load_tmpl_dav.ufl_value);
if (self.load_tmpl_dav.ufl_value not like '/DAV/%.vspx')
{
self.vc_is_valid := 0;
if (length (self.load_tmpl_dav.ufl_value) = 0)
self.vc_error_message := 'The path is empty';
else
self.vc_error_message := 'Invalid path is specified';
return;
}
rc := DAV_RES_CONTENT (self.load_tmpl_dav.ufl_value, cont, mime, self.user_name, self.user_pwd);
if (rc < 0)
{
self.vc_is_valid := 0;
self.vc_error_message := 'The load operation failed: ' || DAV_PERROR (rc);
}
else
{
self.templ_src.ufl_value := blob_to_string (cont);
self.tmpl_msg.ufl_value := 'Template is loaded sucesfully.';
}
]]></v:on-post>
</v:button>
<br />
<label for="save_tmpl_dav">Save template to DAV</label><br/>
<v:text name="save_tmpl_dav" xhtml_id="save_tmpl_dav" xhtml_size="80" xhtml_class="textbox" />
<v:button xhtml_class="real_button" action="browse" value="Browse...">
<v:after-data-bind>
<![CDATA[
declare f varchar;
f := '';
if (get_keyword ('tmpl_tab', e.ve_params, '1') = '1')
f := 'index.vspx';
if (get_keyword ('tmpl_tab', e.ve_params, '1') = '3')
f := 'linkblog.vspx';
if (get_keyword ('tmpl_tab', e.ve_params, '1') = '4')
f := 'summary.vspx';
if (get_keyword ('tmpl_tab', e.ve_params, '1') = '6')
f := 'archive.vspx';
if (get_keyword ('tmpl_tab', e.ve_params, '1') = '5')
f := 'default.css';
control.vc_add_attribute ('onclick', sprintf ('javascript: davBrowseSave (''save_tmpl_dav'', ''%s'');', f));
]]>
</v:after-data-bind>
</v:button>
<v:button xhtml_class="real_button" value="Save" action="simple" name="save_tmpl_dav_bt">
<v:on-post><![CDATA[
declare cont, rc, mime, pwd any;
if (not self.vc_is_valid)
return;
self.save_tmpl_dav.ufl_value := trim (self.save_tmpl_dav.ufl_value);
if (self.save_tmpl_dav.ufl_value not like '/DAV/%.vspx')
{
self.vc_is_valid := 0;
if (length (self.save_tmpl_dav.ufl_value) = 0)
self.vc_error_message := 'The path is empty';
else
self.vc_error_message := 'Invalid path is specified';
return;
}
rc := DAV_RES_UPLOAD (self.save_tmpl_dav.ufl_value, self.templ_src.ufl_value, '', '110100000RR',
self.user_name, http_nogroup_gid (), self.user_name, self.user_pwd);
if (rc < 0)
{
self.vc_is_valid := 0;
self.vc_error_message := DAV_PERROR (rc);
}
else
self.tmpl_msg.ufl_value := 'Template is saved sucesfully.';
]]></v:on-post>
</v:button>
<br />
<v:button xhtml_class="real_button" value="Save Changes" action="simple" name="save_tmpl_changes">
<v:on-post><![CDATA[
declare custom varchar;
declare file varchar;
custom := self.phome || 'templates/custom';
if (get_keyword ('tmpl_tab', e.ve_params, '1') = '2')
{
update BLOG..SYS_BLOG_INFO set
BI_TEMPLATE = self.templates_list.ufl_value,
BI_CSS = self.templates_list.ufl_value || '/default.css'
where BI_BLOG_ID = self.blogid;
return;
}
file := case get_keyword ('tmpl_tab', e.ve_params, '1') when '1' then 'index.vspx' when '3' then 'linkblog.vspx' when '4' then 'summary.vspx' when '5' then 'default.css' when '6' then 'archive.vspx' else signal ('22023', 'Internal error: Incorrect template item') end;
if (self.current_template <> custom)
{
BLOG..WEBLOG_DAV_COPY
(self.current_template || '/',
custom || '/',
self.owner_name, 1,
'^((index.vspx)|(linkblog.vspx)|(summary.vspx)|(archive.vspx)|(.*\.css))\$'
);
update BLOG..SYS_BLOG_INFO set
BI_TEMPLATE = custom,
BI_CSS = custom || '/default.css'
where BI_BLOG_ID = self.blogid;
}
declare src any;
src := self.templ_src.ufl_value;
if (file like '%.vspx')
{
declare xt, xs any;
declare exit handler for sqlstate '*'
{
rollback work;
self.vc_is_valid := 0;
self.vc_error_message := regexp_match ('[^\r\n]*', __SQL_MESSAGE);
return;
};
xt := xtree_doc (src, 256, DB.DBA.vspx_base_url (custom||'/index.vspx'));
xslt (BLOG..BLOG2_GET_PPATH_URL ('widgets/blog_template_check.xsl'), xt);
}
DAV_RES_UPLOAD_STRSES_INT (custom || '/' || file, src, '', '110100100N',
http_dav_uid(), http_admin_gid(), null, null, 0);
]]></v:on-post>
</v:button>
</div>
</v:template>
<v:template type="simple" name="pick_new_tmpl"
enabled="--equ(get_keyword ('tmpl_tab', e.ve_params, '1') , '2')">
<input type="hidden"
name="tmpl_tab"
value="<?V get_keyword ('tmpl_tab', self.vc_event.ve_params, '1') ?>" />
<h3>Select template</h3>
<div>
<v:data-list
xhtml_style="width:100%"
name="templates_list"
sql="select rtrim (WS.WS.COL_PATH (COL_ID), '/') as KEYVAL, COL_NAME as NAME FROM WS.WS.SYS_DAV_COL
WHERE WS..COL_PATH (COL_ID) like registry_get('_blog2_path_') || 'templates/_*' and
not WS..COL_PATH (COL_ID) like registry_get('_blog2_path_') || 'templates/_*/_*'
union all select self.phome || 'templates/custom' as KEYVAL, 'custom' as NAME from BLOG..SYS_BLOG_INFO where BI_BLOG_ID = self.blogid"
key-column="KEYVAL"
value-column="NAME"
xhtml_size="10">
<v:after-data-bind>
control.ufl_value := self.current_template;
if (control.ufl_value is null)
control.ufl_value := registry_get('_blog2_path_') || 'templates/openlink/';
control.vs_set_selected ();
</v:after-data-bind>
</v:data-list>
</div>
<div>
<v:button xhtml_class="real_button" value="Use Selected Template" action="simple" name="use_selected_tmpl">
<v:on-post><![CDATA[
update BLOG..SYS_BLOG_INFO set
BI_TEMPLATE = self.templates_list.ufl_value,
BI_CSS = self.templates_list.ufl_value || '/default.css'
where BI_BLOG_ID = self.blogid;
commit work;
self.vc_redirect ('index.vspx?page=templates&tmpl_tab=1');
]]></v:on-post>
</v:button>
</div>
</v:template>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="vm:error-message">
<v:template type="simple" name="if_error_message2" condition="length(get_keyword('error_message', self.vc_event.ve_params, '')) > 0">
<div style="text-align: left">
<pre>
<?vsp
http_value(get_keyword('error_message', self.vc_event.ve_params, ''));
?>
</pre>
</div>
</v:template>
<v:template type="simple" name="if_simple_message" condition="length(get_keyword('message', self.vc_event.ve_params, '')) > 0">
<div style="text-align: left">
<h2>
<?vsp
http_value(get_keyword('message', self.vc_event.ve_params, ''));
?>
</h2>
</div>
</v:template>
</xsl:template>
<xsl:template match="vm:reset-templates">
<v:template type="simple" name="if_error_message" condition="length(get_keyword('error_message', self.vc_event.ve_params, '')) > 0">
<v:button xhtml_class="real_button" action="simple" name="reset_templates_settings" value="Reset Template Settings" xhtml_title="Reset Template Settings" xhtml_alt="Reset Template Settings">
<v:on-post>
<![CDATA[
update
BLOG.DBA.SYS_BLOG_INFO
set
BI_TEMPLATE = NULL,
BI_CSS = NULL
where
BI_BLOG_ID = self.blogid;
http_request_status ('HTTP/1.1 302 Found');
http_header(sprintf(
'Location: index.vspx?page=index&sid=%s&realm=%s\r\n\r\n',
self.sid ,
self.realm));
self.template_preview_mode := NULL;
self.preview_template_name := NULL;
self.preview_css_name := NULL;
]]>
</v:on-post>
</v:button>
</v:template>
</xsl:template>
<xsl:template match="vm:login-form">
<v:form name="blog_login_form" method="POST" type="simple">
<v:variable name="requested_page_var" type="varchar" default="null" persist="0" />
<v:variable name="req_url" type="varchar" default="null" persist="0" param-name="URL"/>
<v:on-init>
<![CDATA[
if(self.requested_page_var is null) self.requested_page_var := get_keyword('requested_page', self.vc_event.ve_params);
]]>
</v:on-init>
<input type="hidden" name="page" value="login"/>
<v:text xhtml_class="textbox" type="hidden" name="requested_page" value="''" >
<v:before-render>
<![CDATA[
control.ufl_value := self.requested_page_var;
]]>
</v:before-render>
</v:text>
<table>
<tr>
<th colspan="2" align="right">
<?vsp
if (get_keyword('reason', self.vc_event.ve_params) = 'exp')
{
http('The session has expired. For security reasons the session expires after 2 hours of inactivity.<br/>Please enter a valid user id and password to log on.');
}
else
{
http('You need to be logged on as a user with sufficient privileges to access this feature.<br/>Please enter a valid user id and password to log on.');
}
?>
</th>
</tr>
<vm:if test="blog_reader">
<tr>
<td/>
<td>
<vm:home-url/>
</td>
</tr>
</vm:if>
<tr>
<td/>
<td>
<v:url xhtml_class="button" name="register_page2" url="--wa_link (1, '/ods/register.vspx')" value="Register">
<v:before-render>
<![CDATA[
declare _model any;
_model := (select BI_WAI_MEMBER_MODEL from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid);
control.vc_enabled := 0;
if (_model = 0 and self.have_comunity_blog = 1) control.vc_enabled := 1;
]]>
</v:before-render>
</v:url>
</td>
</tr>
<tr>
<th align="right">Name</th>
<td>
<v:text xhtml_class="textbox" name="login_username" value="" xhtml_style="width: 100px;" xhtml_tabindex="1"/>
</td>
</tr>
<tr>
<th align="right">Password</th>
<td>
<v:text xhtml_class="textbox" name="login_password" value="" type="password" xhtml_style="width: 100px;" xhtml_tabindex="2"/>
</td>
</tr>
<tr>
<th align="right">Remember my ID on this computer</th>
<td>
<v:check-box name="remember_me" />
</td>
</tr>
<tr>
<td/>
<td>
<v:button xhtml_class="real_button" action="simple" name="login_button" value="Login" xhtml_title="Login" xhtml_alt="Login" xhtml_tabindex="3">
<v:on-post>
<![CDATA[
-- check if logger is registered user
declare _role, _status, _user_name, _user_pwd, _user_id any;
_user_name := self.login_username.ufl_value;
_user_pwd := self.login_password.ufl_value;
if(not exists(select 1 from SYS_USERS
where U_NAME = _user_name and
U_DAV_ENABLE = 1 and U_IS_ROLE = 0 and
pwd_magic_calc(U_NAME, U_PASSWORD, 1) = _user_pwd and U_ACCOUNT_DISABLED = 0)) {
self.vc_error_message := 'Invalid user name or password.';
goto error_handler;
}
-- check if logger is member of application
declare _wai_name any;
_wai_name := (select WAI_NAME from WA_INSTANCE where WAI_TYPE_NAME = 'WEBLOG2' and (WAI_INST as wa_blog2).blogid = self.blogid);
if(BLOG2_GET_USER_ACCESS(self.blogid, _user_name, _user_pwd) < 1) {
self.vc_error_message := 'User is not a member of application.';
goto error_handler;
}
declare _sid any;
_sid := BLOG2_CREATE_SID();
declare _page any;
_page := get_keyword('requested_page', params, 'index');
if(length(_page) = 0) _page := 'index';
if(self.remember_me.ufl_value) {
-- session in cookie
-- create new session
insert into VSPX_SESSION(
VS_REALM,
VS_SID,
VS_UID,
VS_STATE,
VS_EXPIRY
)
values(
'wa',
_sid,
_user_name,
serialize (
vector (
'vspx_user', _user_name,
'blogid' , self.blogid,
'uid', _user_name,
'cookie_use', 1,
'last_ip', http_client_ip()
)
),
now()
);
-- redirect to front page or requested page
http_request_status ('HTTP/1.1 302 Found');
declare _exp_string, _exp_date any;
_exp_date := dateadd('month', 3, now());
_exp_string := sprintf('%s, %02d-%s-%04d 00:00:01 GMT', dayname(_exp_date), dayofmonth(_exp_date), monthname(_exp_date), year(_exp_date));
if (self.req_url is null)
http_header(sprintf('Set-Cookie: sid=%s; expires=%s\r\nLocation: index.vspx?page=%s&sid=%s&realm=wa&rtr=%s\r\n', _sid, _exp_string, _page, _sid, self.to_restore));
else
{
http_header(sprintf('Set-Cookie: sid=%s; expires=%s\r\nLocation: %s&sid=%s&realm=wa&rtr=%s\r\n',
_sid, _exp_string, self.req_url, _sid, self.to_restore));
}
}
else {
-- normal way
-- create new session
insert into VSPX_SESSION(
VS_REALM,
VS_SID,
VS_UID,
VS_STATE,
VS_EXPIRY
)
values(
'wa',
_sid,
_user_name,
serialize (
vector (
'vspx_user', _user_name,
'blogid' , self.blogid,
'uid', _user_name
)
),
now()
);
-- redirect to front page or requested page
if (self.req_url is null)
{
self.vc_redirect (sprintf('index.vspx?page=%s&sid=%s&realm=wa&rtr=%s', _page, _sid, self.to_restore));
}
else
{
self.vc_redirect (self.req_url||sprintf ('&sid=%s&realm=wa&rtr=%s', _sid, self.to_restore));
}
}
goto finish;
-- handle errors
error_handler:
self.vc_is_valid := 0;
finish:;
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:login-info">
<v:template type="simple" name="login_info" enabled="1">
<?vsp if (self.odsbar_show_signin = 'false' and length (self.sid) = 0) { ?>
<div id="login-info-ctr">
<?vsp
if(self.user_name is null)
{
?>
<img class="title_icon" alt="Not logged in" title="Not logged in">
<xsl:if test="@image">
<xsl:attribute name="src"><?vsp
if (self.custom_img_loc)
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
else
http(self.stock_img_loc || 'lock_16.png');
?></xsl:attribute>
</xsl:if>
<xsl:if test="not @image">
<xsl:attribute name="src"><?vsp http(self.stock_img_loc || 'lock_16.png'); ?></xsl:attribute>
</xsl:if>
</img>
<?vsp
}
else
{
?>
<img class="title_icon" alt="User logged in" title="User logged in">
<xsl:if test="@image">
<xsl:attribute name="src"><?vsp
if (self.custom_img_loc)
http(self.custom_img_loc || '<xsl:value-of select="@image"/>');
else
http(self.stock_img_loc || 'user_16.png');
?></xsl:attribute>
</xsl:if>
<xsl:if test="not @image">
<xsl:attribute name="src"><?vsp http(self.stock_img_loc || 'user_16.png'); ?></xsl:attribute>
</xsl:if>
</img>
<?vsp
}
if (self.user_name is not null)
{
?>
<v:url name="login_info_label" value="--self.user_name"
url="--self.owner_iri" is-local="1">
<v:before-render>
control.vu_format := get_keyword ('format_string', self.user_data, '<xsl:value-of select="@format_string"/>');
</v:before-render>
</v:url>
<?vsp
}
else
{
?>
<v:label name="login_info_label2" value="You are not logged in" />
<?vsp
}
?>
</div>
<?vsp
if(self.user_name is null)
{
?>
<div class="login_link"><a class="button" href="index.vspx?page=login">Login</a></div>
<?vsp
}
if(self.user_name is not null)
{
?>
<div class="login_link"><v:url xhtml_class="button" name="login_info_logout" value="Logout" url="index.vspx?page=logout" /></div>
<?vsp
}
?>
<div id="login_btn">
<v:url xhtml_class="button" name="login_info_register_page" url="--wa_link (1, '/ods/register.vspx')" value="Register">
<v:after-data-bind>
<![CDATA[
declare _model any;
_model := (select BI_WAI_MEMBER_MODEL from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid);
control.vc_enabled := 0;
if (_model = 0 and self.have_comunity_blog = 1 and not (length (self.sid))) control.vc_enabled := 1;
]]>
</v:after-data-bind>
</v:url>
</div>
<?vsp } ?>
</v:template>
</xsl:template>
<xsl:template match="vm:register-form">
<v:form name="blog_register_form" method="POST" type="simple">
<input type="hidden" name="page" value="register"/>
<table border="0" width="100%">
<script type="text/javascript">
<![CDATA[
<!--
function getFirstName()
{
var F = document.forms['page_form'].regfirstname.value;
var N = document.forms['page_form'].register_fillname.value;
if (!N.length)
{
document.forms['page_form'].register_fillname.value = F;
}
}
function getLastName()
{
var F = document.forms['page_form'].regfirstname.value;
var L = document.forms['page_form'].reglastname.value;
var N = document.forms['page_form'].register_fillname.value;
if (!N.length)
document.forms['page_form'].register_fillname.value = F + ' ' + L;
else if (N.length > 0 )
{
if (N = F)
document.forms['page_form'].register_fillname.value = N + ' ' + L;
}
}
// -->
]]>
</script>
<tr>
<td/>
<td>
<vm:if test="blog_reader">
<vm:home-url/>
</vm:if>
</td>
</tr>
<tr>
<th align="right"><label for="register_username">Login Name</label></th>
<td>
<v:text xhtml_class="textbox" name="register_username" xhtml_id="register_username" value="--get_keyword('register_username', params)" xhtml_style="width: 200px;">
<v:validator test="length" min="1" max="20" message="Invalid Login Name" />
</v:text>
</td>
</tr>
<tr>
<th align="right"><label for="regfirstname">First Name</label></th>
<td>
<v:text xhtml_class="textbox" xhtml_id="regfirstname" name="regfirstname" value="--get_keyword('regfirstname', params)" xhtml_onBlur="javascript: getFirstName();" xhtml_style="width: 200px;">
<v:validator test="length" min="1" max="50" message="Invalid First Name" />
</v:text>
</td>
</tr>
<tr>
<th align="right"><label for="reglastname">Last Name</label></th>
<td>
<v:text xhtml_class="textbox" xhtml_id="reglastname" name="reglastname" value="--get_keyword('reglastname', params)" xhtml_onBlur="javascript: getLastName();" xhtml_style="width: 200px;">
<v:validator test="length" min="1" max="50" message="Invalid Last Name" />
</v:text>
</td>
</tr>
<tr>
<th align="right"><label for="register_fillname">Full (Display) Name</label></th>
<td>
<v:text xhtml_class="textbox" xhtml_id="register_fillname" name="register_fillname" value="--get_keyword('register_fillname', params)" xhtml_style="width: 200px;" >
<v:validator test="length" min="1" max="100" message="Invalid Full Name" />
</v:text>
</td>
</tr>
<tr>
<th align="right"><label for="register_password_1">Password</label></th>
<td>
<v:text xhtml_class="textbox" xhtml_id="register_password_1" name="register_password_1" value="" type="password" xhtml_style="width: 200px;">
<v:validator test="length" min="1" max="50" message="Invalid Password" />
</v:text>
</td>
</tr>
<tr>
<th align="right"><label for="register_password_2">Password (verify)</label></th>
<td>
<v:text xhtml_class="textbox" xhtml_id="register_password_2" name="register_password_2" value="" type="password" xhtml_style="width: 200px;">
<v:validator test="length" min="1" max="50" message="Invalid Password (verify)" />
</v:text>
</td>
</tr>
<tr>
<th align="right"><label for="register_mail">E-Mail</label></th>
<td>
<v:text xhtml_class="textbox" xhtml_id="register_mail" name="register_mail" value="--get_keyword('register_mail', params)" xhtml_style="width: 200px;">
<v:validator test="regexp" regexp="[^@]+@([^\.]+.)*[^\.]+" message="Invalid E-mail" />
</v:text>
</td>
</tr>
<tr>
<th align="right"><label for="membership_type2">Membership Type</label></th>
<td align="left">
<v:data-list
xhtml_id="membership_type2"
name="membership_type2"
sql="select WMT_NAME, WMT_ID from WA_MEMBER_TYPE where WMT_ID <> 1 and WMT_APP = (select WAI_TYPE_NAME from WA_INSTANCE where WAI_TYPE_NAME = 'WEBLOG2' and (WAI_INST as wa_blog2).blogid = self.blogid)"
key-column="WMT_ID"
value-column="WMT_NAME"
>
<v:after-data-bind>
declare sec_question varchar;
sec_question := get_keyword('membership_type2', params);
if (sec_question is not null)
control.vsl_selected_inx := atoi(sec_question);
</v:after-data-bind>
</v:data-list>
</td>
</tr>
<tr>
<th align="right"><label for="sec_question">Secret question</label></th>
<td nowrap="nowrap">
<v:select-list xhtml_id="sec_question" name="sec_question">
<v:item name="First Car" value="0"/>
<v:item name="Mothers Maiden Name" value="1"/>
<v:item name="Favorite Pet" value="2"/>
<v:item name="Favorite Sports Team" value="3"/>
<v:after-data-bind>
declare sec_question varchar;
sec_question := get_keyword('sec_question', params);
if (sec_question is not null)
control.vsl_selected_inx := atoi(sec_question);
</v:after-data-bind>
</v:select-list>
</td>
</tr>
<tr>
<th align="right"><label for="sec_answer">Secret answer</label></th>
<td nowrap="nowrap">
<v:text xhtml_class="textbox" xhtml_id="sec_answer" name="sec_answer" value="--get_keyword('sec_answer', params)" xhtml_style="width: 200px;">
<v:validator test="length" min="1" max="100" message="Invalid Secret answer" />
</v:text>
</td>
</tr>
<tr align="center">
<td/>
<td align="left">
<v:button xhtml_class="real_button" action="simple" name="register_button" value="Register" xhtml_title="Register" xhtml_alt="Register">
<v:on-post>
<![CDATA[
declare _wam_inst any;
declare _current_member_model integer;
_wam_inst := (select WAI_NAME from WA_INSTANCE where WAI_TYPE_NAME = 'WEBLOG2' and (WAI_INST as wa_blog2).blogid = self.blogid);
_current_member_model := (select BI_WAI_MEMBER_MODEL from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid);
if (_current_member_model = 1)
{
self.vc_error_message := 'Blog membership model (Closed) does not allow new registrations.';
self.vc_is_valid := 0;
return;
}
-- check name is not empty
if(self.register_username.ufl_value is null or self.register_username.ufl_value = '') {
self.vc_error_message := 'User name can\'t be empty.';
self.vc_is_valid := 0;
return;
}
-- check both passwords are equal
if(self.register_password_1.ufl_value <> self.register_password_2.ufl_value) {
self.vc_error_message := 'Both entered passwords should be equal.';
self.vc_is_valid := 0;
return;
}
-- check if login name already exists
declare _u_name any;
_u_name := self.register_username.ufl_value;
if(exists(select 1 from SYS_USERS where U_NAME = _u_name)) {
self.vc_error_message := 'User with this login name already exists.';
self.vc_is_valid := 0;
return;
}
if (length(self.register_fillname.ufl_value) < 1 or length(self.register_fillname.ufl_value) > 100) {
self.vc_error_message := 'Full name cannot be empty or longer then 100 chars';
self.vc_is_valid := 0;
return;
}
if (length(self.register_username.ufl_value) < 1 or length(self.register_username.ufl_value) > 20) {
self.vc_error_message := 'Login name cannot be empty or longer then 20 chars';
self.vc_is_valid := 0;
return;
}
if (length(self.regfirstname.ufl_value) < 1 or length(self.regfirstname.ufl_value) > 50) {
self.vc_error_message := 'First name cannot be empty or longer then 50 chars';
self.vc_is_valid := 0;
return;
}
if (length(self.reglastname.ufl_value) < 1 or length(self.reglastname.ufl_value) > 50) {
self.vc_error_message := 'Last name cannot be empty or longer then 50 chars';
self.vc_is_valid := 0;
return;
}
if (length(self.register_password_1.ufl_value) < 1 or length(self.register_password_1.ufl_value) > 40) {
self.vc_error_message := 'Password cannot be empty or longer then 40 chars';
self.vc_is_valid := 0;
return;
}
if (length(self.register_password_2.ufl_value) < 1 or length(self.register_password_2.ufl_value) > 40) {
self.vc_error_message := 'Password cannot be empty or longer then 40 chars';
self.vc_is_valid := 0;
return;
}
if (length(self.sec_answer.ufl_value) < 1 or length(self.sec_answer.ufl_value) > 800) {
self.vc_error_message := 'Security answer cannot be empty or longer then 800 chars';
self.vc_is_valid := 0;
return;
}
if (length(self.register_mail.ufl_value) < 1 or length(self.register_mail.ufl_value) > 100)
{
self.vc_error_message := 'E-mail address cannot be empty or longer then 100 chars';
self.vc_is_valid := 0;
return;
}
if ((select top 1 (1 - WS_MAIL_VERIFY) from DB.DBA.WA_SETTINGS) = 0)
{
declare match any;
match := regexp_match('^[^@]+\@[^@]+$', self.register_mail.ufl_value);
if(match is null or length(match) = 0) {
self.vc_error_message := 'Wrong E-mail address.';
self.vc_is_valid := 0;
return;
}
}
declare exit handler for sqlstate '*'
{
self.vc_error_message := concat (__SQL_STATE,' ',__SQL_MESSAGE);
self.vc_is_valid := 0;
rollback work;
return;
};
-- create new dav user
declare _u_id, _u_fullname, _u_pwd, _u_mail any;
_u_fullname := self.register_fillname.ufl_value;
_u_pwd := self.register_password_1.ufl_value;
_u_mail := self.register_mail.ufl_value;
USER_CREATE(_u_name, _u_pwd,
vector ('E-MAIL', _u_mail,
'FULL_NAME', _u_fullname,
'HOME', '/DAV/home/' || _u_name || '/',
'DAV_ENABLE' , 1, 'SQL_ENABLE', 0,
'maxBytesPerUser', 41943040,
'maxFileSize', 1048576));
_u_id := (select U_ID from SYS_USERS where U_NAME = _u_name and U_DAV_ENABLE = 1 and U_IS_ROLE = 0);
DAV_MAKE_DIR ('/DAV/home/' || _u_name || '/', _u_id, null, '110100100R');
USER_SET_OPTION (_u_name, 'SEC_QUESTION', self.sec_question.ufl_value);
USER_SET_OPTION (_u_name, 'SEC_ANSWER', self.sec_answer.ufl_value);
USER_SET_OPTION (_u_name, 'FIRST_NAME', self.regfirstname.ufl_value);
USER_SET_OPTION (_u_name, 'LAST_NAME', self.reglastname.ufl_value);
-- add member
declare _admin_email varchar;
_admin_email := (select BI_E_MAIL from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = self.blogid);
if (_current_member_model = 2)
{
self.vc_error_message := sprintf(
'New user was registered. But membership model does not allow new member, only Administrator can invite you.
Please send e-mail with your membership request to Administrator <%s> (please provide your login name).', _admin_email);
self.vc_is_valid := 0;
return;
}
if (_current_member_model = 3)
{
insert into WA_MEMBER
(WAM_USER, WAM_INST, WAM_MEMBER_TYPE, WAM_STATUS)
values
(_u_id, _wam_inst, self.membership_type2.ufl_value, 3);
commit work;
self.vc_error_message := 'Application owner notified about your registration and join request. You will get e-mail message after approvement.';
self.vc_is_valid := 0;
return;
}
if (_current_member_model = 0)
{
insert into WA_MEMBER(WAM_USER, WAM_INST, WAM_MEMBER_TYPE, WAM_STATUS)
values(_u_id, _wam_inst, self.membership_type2.ufl_value, 2);
-- create new session
declare _sid any;
_sid := md5(concat(datestring(now()), http_client_ip (), http_path (), _u_name));
insert into VSPX_SESSION(VS_REALM, VS_SID, VS_UID, VS_STATE, VS_EXPIRY)
values ('wa', _sid, _u_name,
serialize (
vector (
'vspx_user', _u_name,
'blogid' , self.blogid,
'uid', _u_name
)
), now());
-- redirect to front page or requested page
commit work;
http_request_status ('HTTP/1.1 302 Found');
http_header(sprintf('Location: index.vspx?page=index&sid=%s&realm=wa\r\n', _sid));
}
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</v:form>
</xsl:template>
<xsl:template match="vm:blogs-attach">
<h3>Related Blogs</h3>
<table>
<tr>
<td>
<b>Your weblog is included in the following communities:</b><br/>
<table id="community">
<tr bgcolor="#F5F5F5">
<td valign="top">
<v:tree name="blogs_include_tree" show-root="0" multi-branch="0" orientation="vertical" root="BLOG2_INCLUDE_ROOT" start-path="--(self.blogid)" child-function="BLOG2_INCLUDE_CHILD">
<v:node-template name="include_node_tmpl">
<div style="margin-left:1em;">
<b>
<table>
<tr>
<td align="left">
<v:button xhtml_class="button" name="blogs_include_tree_toggle" action="simple" style="url" value="">
<v:after-data-bind>
<![CDATA[
control.ufl_value := (select BI_TITLE from BLOG.DBA.SYS_BLOG_INFO
where BI_BLOG_ID = (control.vc_parent as vspx_tree_node).tn_value);
]]>
</v:after-data-bind>
</v:button>
</td>
<td align="right">
<v:button xhtml_class="button" name="blogs_include_tree_remove" action="simple" style="url" value="Remove">
<v:before-render>
<![CDATA[
if((control.vc_parent as vspx_tree_node).tn_level > 0) {
control.vc_enabled := 0;
}
]]>
</v:before-render>
<v:on-post>
<![CDATA[
declare _blogid any;
_blogid := (control.vc_parent as vspx_tree_node).tn_value;
delete from
BLOG.DBA.SYS_BLOG_ATTACHES
where
BA_C_BLOG_ID = self.blogid and
BA_M_BLOG_ID = _blogid;
commit work;
self.vc_data_bind(e);
--http_request_status ('HTTP/1.1 302 Found');
--http_header(sprintf('Location: index.vspx?page=community&sid=%s&realm=%s\r\n', self.sid, self.realm));
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</b>
<v:node />
</div>
</v:node-template>
<v:leaf-template name="include_leaf_tmpl">
<div style="margin-left:1em;">
<table>
<tr>
<td align="left">
<v:label name="blogs_include_tree_toggle_leaf" value="">
<v:after-data-bind>
<![CDATA[
control.ufl_value := (select BI_TITLE from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = (control.vc_parent as vspx_tree_node).tn_value);
]]>
</v:after-data-bind>
</v:label>
</td>
<td align="right">
<v:button xhtml_class="button" name="blogs_include_tree_leaf_remove" action="simple" style="url" value="Remove">
<v:before-render>
<![CDATA[
if((control.vc_parent as vspx_tree_node).tn_level > 0) {
control.vc_enabled := 0;
}
]]>
</v:before-render>
<v:on-post>
<![CDATA[
declare _blogid any;
_blogid := (control.vc_parent as vspx_tree_node).tn_value;
delete from
BLOG.DBA.SYS_BLOG_ATTACHES
where
BA_C_BLOG_ID = self.blogid and
BA_M_BLOG_ID = _blogid;
commit work;
self.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</div>
</v:leaf-template>
</v:tree>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<b>Your weblog includes:</b><br/>
<table id="community_include">
<tr bgcolor="#F5F5F5">
<td valign="top">
<v:tree name="blogs_attach_tree" show-root="0" multi-branch="0" orientation="vertical" root="BLOG2_ATTACHED_ROOT" start-path="--(self.blogid)" child-function="BLOG2_ATTACHED_CHILD">
<v:node-template name="attach_node_tmpl">
<div style="margin-left:1em;">
<b>
<table>
<tr>
<td align="left">
<v:button xhtml_class="button" name="blogs_attach_tree_toggle" action="simple" style="url" value="">
<v:after-data-bind>
<![CDATA[
control.ufl_value := (select BI_TITLE from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = (control.vc_parent as vspx_tree_node).tn_value);
]]>
</v:after-data-bind>
</v:button>
</td>
<td align="right">
<v:button xhtml_class="button" name="blogs_attach_tree_remove" action="simple" style="url" value="Remove">
<v:before-render>
<![CDATA[
if((control.vc_parent as vspx_tree_node).tn_level > 0) {
control.vc_enabled := 0;
}
]]>
</v:before-render>
<v:on-post>
<![CDATA[
declare _blogid any;
_blogid := (control.vc_parent as vspx_tree_node).tn_value;
delete from
BLOG.DBA.SYS_BLOG_ATTACHES
where
BA_M_BLOG_ID = self.blogid and
BA_C_BLOG_ID = _blogid;
commit work;
self.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</b>
<v:node />
</div>
</v:node-template>
<v:leaf-template name="attach_leaf_tmpl">
<div style="margin-left:1em;">
<table>
<tr>
<td align="left">
<v:label name="blogs_attach_tree_toggle_leaf" value="">
<v:after-data-bind>
<![CDATA[
control.ufl_value := (select BI_TITLE from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID = (control.vc_parent as vspx_tree_node).tn_value);
]]>
</v:after-data-bind>
</v:label>
</td>
<td align="right">
<v:button xhtml_class="button" name="blogs_attach_tree_leaf_remove" action="simple" style="url" value="Remove">
<v:before-render>
<![CDATA[
if((control.vc_parent as vspx_tree_node).tn_level > 0) {
control.vc_enabled := 0;
}
]]>
</v:before-render>
<v:on-post>
<![CDATA[
declare _blogid any;
_blogid := (control.vc_parent as vspx_tree_node).tn_value;
delete from
BLOG.DBA.SYS_BLOG_ATTACHES
where
BA_M_BLOG_ID = self.blogid and
BA_C_BLOG_ID = _blogid;
commit work;
self.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</div>
</v:leaf-template>
</v:tree>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<v:form name="blogs_attach_form2" action="" type="simple" method="POST" xhtml_enctype="multipart/form-data">
<input type="hidden" name="page" >
<xsl:attribute name="value"><xsl:apply-templates select="@page" mode="static_value"/></xsl:attribute>
</input>
<table id="community_attach">
<tr>
<td colspan="2" align="left">
<strong>Public blogs attach:</strong>
</td>
</tr>
<tr>
<td colspan="2" align="left">Available domain's public blogs:</td>
</tr>
<tr>
<td colspan="2">
<div style="width: 100%">
<v:data-list
name="public_blogs2"
multiple="1"
xhtml_size="8"
xhtml_style="width:100%"
key-column="BI_BLOG_ID"
value-column="BI_TITLE"
sql="select BI_BLOG_ID, BI_TITLE, BI_WAI_NAME from BLOG.DBA.SYS_BLOG_INFO where BI_INCLUSION = 1 and BI_BLOG_ID not in (select BA_C_BLOG_ID from BLOG.DBA.SYS_BLOG_ATTACHES where BA_M_BLOG_ID = self.blogid) and ((select WAI_IS_PUBLIC from WA_INSTANCE where WAI_NAME = BI_WAI_NAME) > 0) and BI_BLOG_ID <> self.blogid" >
</v:data-list>
</div>
</td>
</tr>
<tr>
<td colspan="2" align="right" valign="middle" nowrap="nowrap">
<p>
<xsl:value-of select="string('')"/>
<v:button xhtml_class="real_button" name="attach_blog2" action="simple" value="Include" xhtml_title="Include" xhtml_alt="Include">
<v:on-post>
<![CDATA[
declare _values, _idx, _blog_id, _blog_name any;
_values:= self.public_blogs2.ufl_value;
_idx := 0;
while(_idx < length(_values)) {
_blog_id := _values[_idx];
if(not BLOG.DBA.BLOG2_BLOG_ATTACH(self.blogid, _blog_id)) {
_blog_name := (select BI_TITLE from BLOG.DBA.SYS_BLOG_INFO
where BI_BLOG_ID = _blog_id);
_blog_name := replace(_blog_name, ''', '''');
self.blogs_attach_form2.vc_error_message := 'Attach operation with "' || _blog_name || '" canceled to avoid circular reference.';
self.vc_is_valid := 0;
rollback work;
return;
}
_idx := _idx + 1;
}
commit work;
self.vc_data_bind(e);
]]>
</v:on-post>
</v:button>
<xsl:value-of select="string('')"/>
</p>
</td>
</tr>
</table>
<br />
</v:form>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="vm:bloggers">
<?vsp
if (self.have_comunity_blog)
{
?>
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/opml-members.xml', self.host, self.base)); ?>">
<img border="0" alt="OPML" title="OPML" src="/weblog/public/images/opml.gif" />
</a>
</div>
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/ocs-members.xml', self.host, self.base)); ?>">
<img border="0" alt="OCS" title="OCS" src="/weblog/public/images/ocs.gif" />
</a>
</div>
<div>
<a href="<?vsp http (sprintf ('http://%s%sgems/foaf-members.xml', self.host, self.base)); ?>">
<img border="0" alt="FOAF" title="FOAF" src="/weblog/public/images/foaf.png" />
</a>
</div>
<?vsp
for
select BI_HOME, BI_TITLE
from BLOG.DBA.SYS_BLOG_INFO, BLOG.DBA.SYS_BLOG_ATTACHES
where BI_BLOG_ID = BA_C_BLOG_ID and BA_M_BLOG_ID = self.blogid and
((select WAI_IS_PUBLIC
from WA_INSTANCE
where WAI_TYPE_NAME = 'WEBLOG2' and
(WAI_INST as wa_blog2).blogid = BI_BLOG_ID OPTION (LOOP)) > 0) order by lcase(BI_TITLE) do
{
?>
<div class="smallfeedlink">
<a href="<?V BI_HOME ?>gems/rss.xml"><img src="/weblog/public/images/rss-icon-16.gif" border="0" alt="RSS" title="RSS"/></a>
<a id="inline" href="<?V BI_HOME ?>index.vspx?page=index">
<?vsp
http(BI_TITLE);
?>
</a>
</div>
<?vsp
}
}
?>
</xsl:template>
<xsl:template match="vm:member-data">
<?vsp
declare _member_id, _member_name any;
_member_id := get_keyword('member_id', self.vc_event.ve_params);
if(_member_id is not null) {
_member_name := (select U_NAME from SYS_USERS where U_ID = _member_id);
}
else {
_member_name := self.user_name;
}
http('N/A');
?>
</xsl:template>
<xsl:template match="vm:posts-widget">
<v:variable name="ch" type="varchar" default="null"/>
<v:variable name="ch_name" type="varchar" default="'External Blog'"/>
<v:variable name="ch_home" type="varchar" default="''"/>
<h3>
<v:url name="cn_url" value="--self.ch_name" url="--self.ch_home" />
</h3>
<v:data-set name="posts_widget_ds" nrows="10" scrollable="1" cursor-type="static" edit="0">
<v:on-init>
<![CDATA[
declare _ch, ch_name, ch_home any;
_ch := get_keyword('ch', self.vc_event.ve_params);
if(_ch is not null)
{
self.ch := _ch;
self.ch_home := _ch;
select BCD_TITLE, BCD_HOME_URI into ch_name, ch_home from BLOG.DBA.SYS_BLOG_CHANNEL_INFO
where BCD_CHANNEL_URI= _ch;
if (ch_name is not null)
self.ch_name := ch_name;
if (ch_home is not null)
self.ch_home := ch_home;
}
]]>
</v:on-init>
<v:sql>
<![CDATA[
select
CF_ID,
coalesce (CF_TITLE, '') as CF_TITLE,
coalesce (CF_DESCRIPTION, '') as CF_DESCRIPTION,
CF_LINK,
CF_GUID,
CF_COMMENT_API
from
BLOG.DBA.SYS_BLOG_CHANNEL_FEEDS
where
CF_CHANNEL_URI = self.ch order by CF_PUBDATE desc
]]>
</v:sql>
<v:column name="CF_ID"/>
<v:column name="CF_TITLE"/>
<v:column name="CF_DESCRIPTION"/>
<v:column name="CF_LINK"/>
<v:column name="CF_GUID"/>
<v:column name="CF_COMMENT_API"/>
<v:template name="template2" type="repeat">
<v:template name="template7" type="if-not-exists" name-to-remove="table">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<hr/>
<th colspan="2">
No fetched posts
</th>
</tr>
</table>
</v:template>
<v:template name="template4" type="browse" name-to-remove="table" set-to-remove="bottom">
<table>
<hr/>
<tr>
<th colspan="2">
<v:url name="url1"
value="--case when ((control.vc_parent as vspx_row_template).te_rowset[1] is null or
(control.vc_parent as vspx_row_template).te_rowset[1] = '') then 'Link' else (control.vc_parent as vspx_row_template).te_rowset[1] end"
url="--coalesce((control.vc_parent as vspx_row_template).te_rowset[3], '')" />
<v:url name="url2"
xhtml_class="button"
value="[BlogThis!]"
url="--sprintf ('index.vspx?page=edit_post&pf_active=1&cf_id=%d&ch_id=%U&sid=%s', (control.vc_parent as vspx_row_template).te_rowset[0], self.ch, self.sid)" />
<v:url name="comment_this"
xhtml_class="button"
value="[Add Comment]"
xhtml_target="_blank"
url="--sprintf('index.vspx?page=comments&ctit=Re:%V&capi=%U&cn=%V&ce=%V&cu=%U', (control.vc_parent as vspx_row_template).te_rowset[1], (control.vc_parent as vspx_row_template).te_rowset[5], self.user_name, self.email, self.ur)"
enabled="--length ((control.vc_parent as vspx_row_template).te_rowset[5])" />
</th>
</tr>
<tr>
<td colspan="2">
<v:label name="desc1" value="--blob_to_string((control.vc_parent as vspx_row_template).te_rowset[2])" format="%s"/>
</td>
</tr>
</table>
</v:template>
</v:template>
<v:template name="template3" type="simple" name-to-remove="table" set-to-remove="top">
<table id="channel-posts" width="400" border="1" cellspacing="2" cellpadding="0">
<tr>
<td colspan="2" align="center">
<vm:ds-navigation data-set="posts_widget_ds"/>
</td>
</tr>
</table>
</v:template>
</v:data-set>
</xsl:template>
<xsl:template match="vm:comments-widget">
<v:variable name="mode" type="int" default="0"/>
<v:template name="step2" type="simple">
<div style="color:red;">
<v:label name="err" value="--''" />
</div>
<div>
<v:label name="msg" value="--''" />
</div>
</v:template>
<v:template name="step1" type="simple">
<v:form name="form1" type="simple" method="POST">
<h2>Post a comment</h2>
<input name="page" type="hidden" value="comments"/>
<table width="70%">
<tr>
<th width="20%">URL</th>
<td>
<v:text xhtml_class="textbox" xhtml_style="width:100%;" name="url" value="--get_keyword ('capi', e.ve_params, '')">
<v:after-data-bind>
control.ufl_value := trim (control.ufl_value);
</v:after-data-bind>
</v:text>
</td>
</tr>
<tr>
<th>Name</th>
<td>
<v:text xhtml_class="textbox" xhtml_style="width:100%;" name="name1" value="--get_keyword ('cn', e.ve_params, '')" />
</td>
</tr>
<tr>
<th>Email</th>
<td>
<v:text xhtml_class="textbox" xhtml_style="width:100%;" name="email1" value="--get_keyword ('ce', e.ve_params, '')"/>
</td>
</tr>
<tr>
<th>Web Site</th>
<td>
<v:text xhtml_class="textbox" xhtml_style="width:100%;" name="url1" value="--get_keyword ('cu', e.ve_params, '')"/>
</td>
</tr>
<tr>
<th>Title</th>
<td>
<v:text xhtml_class="textbox" xhtml_style="width:100%;" name="tit3" value="--get_keyword ('ctit', e.ve_params, '')"/>
</td>
</tr>
<tr>
<th colspan="2">Comment</th>
</tr>
<tr>
<td colspan="2">
<v:template name="t1" condition="self.mode = 0" type="simple">
<v:textarea name="comment1" xhtml_rows="15" xhtml_style="width:100%;"></v:textarea>
</v:template>
<v:template name="t2" condition="self.mode = 1" type="simple">
<div style="background-color:white; ">
<v:label name="pre1" value="" format="%s" />
</div>
<input type="hidden" name="comment1" value="<?V self.comment1.ufl_value ?>" />
</v:template>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<v:button xhtml_class="real_button" action="simple" name="submit1" value="Post" xhtml_title="Submit" xhtml_alt="Submit">
<v:on-post>
<![CDATA[
declare resp, hdr, url any;
declare rss varchar;
if (trim(self.url.ufl_value) not like 'http://%' )
self.err.ufl_value := 'Not valid URL';
if (length (trim(self.comment1.ufl_value)) = 0)
self.err.ufl_value := 'Message cannot be empty';
if (length (self.err.ufl_value))
return;
url := trim(self.url.ufl_value);
hdr := vector ();
{
declare exit handler for sqlstate '*' { goto endr; };
{
declare x, u any;
commit work;
resp := http_get (url);
x := xml_tree_doc (xml_tree (resp, 2));
u := xpath_eval ('/html/head/link[@rel = "service.comment"]/@href', x, 1);
u := cast (u as varchar);
if (length (u) > 0)
url := u;
resp := null;
}
}
rss := sprintf (
'<?xml version="1.0" encoding="%s"?><item><title>%V</title><author>%V (%V)</author><link>%V</link><description>%V</description></item>',
current_charset (),
self.tit3.ufl_value,
self.name1.ufl_value,
self.email1.ufl_value,
self.url1.ufl_value,
self.comment1.ufl_value);
{
declare exit handler for sqlstate '*' { self.err.ufl_value := __SQL_MESSAGE; return; };
commit work;
resp := http_get (url, hdr, 'GET', 'Content-Type: text/xml', rss);
}
endr:;
declare len int;
len := -2;
if (length (hdr) > 0 and (hdr[0] like 'HTTP/1._ 200 %' or hdr[0] like 'HTTP/1._ 3__ %')) {
self.msg.ufl_value := 'Comment is posted successfully';
self.comment1.ufl_value := '';
self.mode := 0;
self.submit2.vc_data_bind (e);
}
else {
self.pre1.ufl_value := self.comment1.ufl_value;
self.err.ufl_value := 'Comment is NOT posted successfully, please verify URL.';
}
]]>
</v:on-post>
</v:button>
<v:button xhtml_class="real_button" action="simple" name="submit2" value="--case when self.mode = 0 then 'Preview' else 'Edit' end" xhtml_title="--case when self.mode = 0 then 'Preview' else 'Edit' end" xhtml_alt="--case when self.mode = 0 then 'Preview' else 'Edit' end" >
<v:on-post>
<![CDATA[
if (self.mode = 0)
{
self.mode := 1;
self.pre1.ufl_value := self.comment1.ufl_value;
}
else
self.mode := 0;
control.vc_data_bind (e);
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
</v:form>
</v:template>
</xsl:template>
<xsl:template match="vm:version-info">
<?vsp
http(sprintf('Server version: %s<br/>', sys_stat('st_dbms_ver')));
http(sprintf('Server build date: %s<br/>', sys_stat('st_build_date')));
http(sprintf('Weblog version: %s<br/>', registry_get('_blog2_version_')));
http(sprintf('Weblog build date: %s<br/>', registry_get('_blog2_build_')));
?>
</xsl:template>
<xsl:template match="vm:welcome-message">
<xsl:processing-instruction name="vsp">
if (get_keyword ('show-once', self.user_data, '<xsl:value-of select="@show-once"/>') = 'yes')
{
if (self.welcome_msg_flag = 0)
{
http (sprintf ('%s', get_keyword ('WelcomeMessage', self.opts, '')));
self.welcome_msg_flag := 1;
}
}
else
{
http (sprintf ('%s', get_keyword ('WelcomeMessage', self.opts, '')));
}
</xsl:processing-instruction>
</xsl:template>
<xsl:template match="vm:weblog-button">
<v:url name="weblog_button" value="Weblog"
url="--case when self.fordate_n = 0 then sprintf ('index.vspx?date=%d-%d-%d', self.y, self.m, self.d) else 'index.vspx' end"
xhtml_class="--case when self.blog_view = 0 and (self.page = 'index' or length (self.page) = 0) then 'blog_selected' else '' end"
render-only="1"
/>
</xsl:template>
<xsl:template match="vm:linkblog-button">
<v:url name="linkblog_button" value="LinkBlog"
url="--case when self.fordate_n = 0 then sprintf ('index.vspx?page=linkblog&date=%d-%d-%d', self.y, self.m, self.d) else 'index.vspx?page=linkblog' end"
xhtml_class="--case when self.blog_view = 1 then 'blog_selected' else '' end"
render-only="1"
/>
</xsl:template>
<xsl:template match="vm:summary-button">
<v:url name="summary_button" value="Summary"
url="--case when self.fordate_n = 0 then sprintf ('index.vspx?page=summary&date=%d-%d-%d', self.y, self.m, self.d) else 'index.vspx?page=summary' end"
xhtml_class="--case when self.blog_view = 2 then 'blog_selected' else '' end"
render-only="1"
/>
</xsl:template>
<xsl:template match="vm:wa-link">
<v:url name="wa_home_link"
value="--registry_get ('wa_home_title')"
url="--wa_link ()" is-local="1"/>
</xsl:template>
<xsl:template match="vm:blog-view-switch">
<vm:weblog-button/> | <vm:linkblog-button/> | <vm:summary-button/>
</xsl:template>
<xsl:template match="vm:blog-comments">
<div>Filter selection
<v:text type="hidden" name="editid" value="--self.editpost"/>
<v:select-list name="comm_filter">
<v:item name="All Comments" value="1" />
<v:item name="Waiting Approval" value="0" />
<v:before-data-bind>
if (not e.ve_is_post and get_keyword ('appr', e.ve_params, '1') = '0')
{
control.ufl_value := '0';
self.comment_filter := vector (0);
}
</v:before-data-bind>
</v:select-list>
<v:button name="appl_comm_filter" value="Apply" action="simple">
<v:on-post>
if (self.comm_filter.ufl_value = '1')
self.comment_filter := vector (0,1);
else if (self.comm_filter.ufl_value = '0')
self.comment_filter := vector (0);
self.comments_list.vc_data_bind (e);
</v:on-post>
</v:button>
<![CDATA[ ]]>
<v:url name="ubk_comm1" value="Back to Comments Management" url="index.vspx?page=ping&ping_tab=3&site_tab=3" />
</div>
<table class="listing">
<tr class="listing_header_row">
<th>Date</th>
<th>Excerpt</th>
<th>From</th>
<th>URL</th>
<th>From IP</th>
<th>Rate</th>
<th>Status</th>
<th>Action</th>
</tr>
<v:data-set name="comments_list" nrows="10" scrollable="1" edit="1">
<v:sql><![CDATA[
select BM_ID, BM_COMMENT, BM_NAME, BM_E_MAIL, BM_HOME_PAGE, BM_ADDRESS, BM_TS, BM_IS_PUB, BM_IS_SPAM
from BLOG..BLOG_COMMENTS where BM_BLOG_ID = :blog_id and BM_POST_ID = :post_id
and position (BM_IS_PUB, :comment_filter)
]]></v:sql>
<v:before-data-bind><![CDATA[
declare _del, _spam, _ham, _editid, _pub, cf, params any;
params := self.vc_event.ve_params;
_editid := get_keyword('editid', params);
cf := get_keyword('cf', params, null);
if (self.comment_filter is null)
{
if (cf is not null)
{
self.comment_filter := deserialize (decode_base64 (cf));
if (length (self.comment_filter) = 1 and self.comment_filter[0] = 0)
self.comm_filter.ufl_value := '0';
}
else
self.comment_filter := vector (0,1);
}
if (_editid is not null)
{
self.editpost := _editid;
self.editid.ufl_value := _editid;
_del := atoi (get_keyword('del', params, '-1'));
_pub := atoi (get_keyword('publ', params, '-1'));
_spam := atoi (get_keyword('spam', params, '-1'));
_ham := atoi (get_keyword('ham', params, '-1'));
if (_del >= 0)
{
delete from BLOG..BLOG_COMMENTS where BM_BLOG_ID = self.blogid
and BM_POST_ID = self.editpost and BM_ID = _del;
commit work;
}
if (_spam >=0 or _ham >= 0)
{
declare dummy, id, flag any;
flag := atoi (get_keyword('f', params, '0'));
if (_spam >=0)
id := _spam;
else
id := _ham;
whenever not found goto nfc;
if (flag)
{
select filter_remove_message (blob_to_string (BM_COMMENT), self.user_id, case when _spam >=0 then 1 else 0 end)
into dummy
from BLOG..BLOG_COMMENTS where BM_BLOG_ID = self.blogid and
BM_POST_ID = self.editpost and BM_ID = id;
}
else
{
select filter_add_message (blob_to_string (BM_COMMENT), self.user_id, case when _spam >=0 then 1 else 0 end)
into dummy
from BLOG..BLOG_COMMENTS where BM_BLOG_ID = self.blogid and
BM_POST_ID = self.editpost and BM_ID = id;
}
nfc:
commit work;
}
if (_pub >= 0)
{
update BLOG..BLOG_COMMENTS set BM_IS_PUB = 1, BM_IS_SPAM = 0 where BM_BLOG_ID = self.blogid
and BM_POST_ID = self.editpost and BM_ID = _pub;
commit work;
}
}
]]></v:before-data-bind>
<v:param name="blog_id" value="--self.blogid"/>
<v:param name="post_id" value="--self.editpost"/>
<v:param name="comment_filter" value="--self.comment_filter"/>
<v:template type="repeat" name="rpt1">
<v:template type="browse" name="brws1">
<tr class="<?V case when mod(control.te_ctr, 2) then 'listing_row_odd' else 'listing_row_even' end ?>">
<td nowrap="1"><v:label name="lab1" value="--BLOG..blog_date_fmt ((control.vc_parent as vspx_row_template).te_rowset[6],self.tz)" /></td>
<td>
<v:label name="slab2" value="[SPAM]" enabled="--(control.vc_parent as vspx_row_template).te_rowset[8]"/>
<v:label name="lab2" format="%V" value="--subseq (BLOG..blog_utf2wide ((control.vc_parent as vspx_row_template).te_rowset[1]), 0, 35)"/><a href="#"
onmouseover="javascript: displayComment (<?V control.te_rowset[0] ?>); return false;"
onmouseout="javascript: hideComment (<?V control.te_rowset[0] ?>); return false;"
>...</a>
<div style="position:absolute; background-color: white; color: black; padding: 1px 3px 2px 2px; border: 2px solid #000000; visibility:hidden; z-index:1000; width:400; height: 400; overflow: auto;"
id="ct_<?V control.te_rowset[0] ?>">
<v:label name="lab2_h" value="--blob_to_string ((control.vc_parent as vspx_row_template).te_rowset[1])"/>
</div>
</td>
<td>
<v:url name="lab3" value="--(control.vc_parent as vspx_row_template).te_rowset[2]"
url="--sprintf ('mailto:%s', (control.vc_parent as vspx_row_template).te_rowset[3])"/>
</td>
<td>
<v:url name="lab4" value="--(control.vc_parent as vspx_row_template).te_rowset[4]"
url="--(control.vc_parent as vspx_row_template).te_rowset[4]"
/>
</td>
<td>
<v:label name="lab5" value="--(control.vc_parent as vspx_row_template).te_rowset[5]" />
</td>
<td>
<v:label name="lab6" value="--spam_filter_message(
blob_to_string ((control.vc_parent as vspx_row_template).te_rowset[1]), self.user_id)"
format="%s"/>
</td>
<td>
<v:label name="lab7" value="--case when (control.vc_parent as vspx_row_template).te_rowset[7] then 'published' else 'waiting approval' end" format="%s"/>
</td>
<td class="listing_col_action">
<v:url name="del_com1" value="Delete"
url="--sprintf ('index.vspx?page=edit_comments&editid=%s&del=%d&cf=%s',
self.editpost, (control.vc_parent as vspx_row_template).te_rowset[0],
encode_base64 (serialize (self.comment_filter)))"
/>
&#160;
<v:url name="spam_com1" value="Spam"
url="--sprintf ('index.vspx?page=edit_comments&editid=%s&spam=%d&f=0&cf=%s',
self.editpost, (control.vc_parent as vspx_row_template).te_rowset[0],
encode_base64 (serialize (self.comment_filter)) )
"
/>
&#160;
<!--
<v:url name="spam_com2" value="Spam-"
url="-#-sprintf ('index.vspx?page=edit_comments&editid=%s&spam=%d&f=1',
self.editpost, (control.vc_parent as vspx_row_template).te_rowset[0])"
/>
&#160; -->
<v:url name="ham_com1" value="Ham"
url="--sprintf ('index.vspx?page=edit_comments&editid=%s&ham=%d&f=0&cf=%s',
self.editpost, (control.vc_parent as vspx_row_template).te_rowset[0],
encode_base64 (serialize (self.comment_filter)) )"
/>
<!--
&#160;
<v:url name="ham_com2" value="Ham-"
url="-#-sprintf ('index.vspx?page=edit_comments&editid=%s&ham=%d&f=1',
self.editpost, (control.vc_parent as vspx_row_template).te_rowset[0])"
/> -->
&#160;
<v:url name="pub_com1" value="Publish"
url="--sprintf ('index.vspx?page=edit_comments&editid=%s&publ=%d&f=0&cf=%s',
self.editpost, (control.vc_parent as vspx_row_template).te_rowset[0],
encode_base64 (serialize (self.comment_filter)) )"
enabled="--equ((control.vc_parent as vspx_row_template).te_rowset[7], 0)"
/>
</td>
</tr>
</v:template>
</v:template>
<v:template type="simple" name="footer_comm">
<tr>
<td colspan="7">
<vm:ds-navigation data-set="comments_list"/>
</td>
</tr>
</v:template>
</v:data-set>
</table>
</xsl:template>
<xsl:template match="vm:bridge-queue">
<v:variable name="post_id_filt" type="varchar" default="null" param-name="post_id" />
<h3>Upstreaming log</h3>
<div>
<label for="log_filt">Show </label>
<v:select-list name="log_filt" xhtml_id="log_filt" auto-submit="1">
<v:item name="all" value="all"/>
<v:item name="pending" value="pending"/>
<v:item name="sent" value="sent"/>
<v:item name="skipped" value="skipped"/>
<v:item name="error" value="error"/>
</v:select-list>
<![CDATA[ ]]>
<label for="post_id_filt1">Post ID</label>
<v:text name="post_id_filt1" value="--coalesce(self.post_id_filt, '')" xhtml_class="textbox" />
<v:button action="simple" name="filt_bt" value="Apply" xhtml_class="real_button"/>
</div>
<div class="scroll_area">
<table class="listing">
<tr class="listing_header_row">
<th>Post #</th>
<th>Title</th>
<th>Protocol</th>
<th>Flag</th>
<th>Last change</th>
<th>State</th>
<th>Action</th>
</tr>
<?vsp
{
declare params, j, p, c, pfilt any;
params := self.vc_event.ve_params;
j := atoi (get_keyword ('j', params, '0'));
p := get_keyword ('p', params, '0');
c := atoi (get_keyword ('c', params, '0'));
pfilt := get_keyword ('post_id_filt1', params);
if (pfilt is not null)
self.post_id_filt := case when length (pfilt) then pfilt else null end;
if ({?'reset'} is not null)
{
if (exists (select 1 from BLOG..SYS_BLOGS_ROUTING_LOG where RL_JOB_ID = j and RL_POST_ID = p and RL_COMMENT_ID = c and
RL_F_POST_ID is not null and RL_TYPE = 'I'))
{
update BLOG..SYS_BLOGS_ROUTING_LOG set
RL_PROCESSED = 0, RL_TYPE = 'U' where RL_JOB_ID = j and RL_POST_ID = p and RL_COMMENT_ID = c;
}
else
{
update BLOG..SYS_BLOGS_ROUTING_LOG set
RL_PROCESSED = 0 where RL_JOB_ID = j and RL_POST_ID = p and RL_COMMENT_ID = c;
}
commit work;
}
else
{
delete from BLOG..SYS_BLOGS_ROUTING_LOG where RL_JOB_ID = j and RL_POST_ID = p and RL_COMMENT_ID = c;
commit work;
}
declare i int;
declare login_pars any;
login_pars := '';
i := 0;
if (length (self.sid))
login_pars := sprintf ('&sid=%s&realm=%s', self.sid, self.realm);
set isolation='committed';
for select RL_JOB_ID, RL_F_POST_ID, RL_POST_ID, RL_TYPE, RL_COMMENT_ID, RL_PROCESSED, RL_ERROR, RT_NAME, RL_TS
from BLOG..SYS_BLOGS_ROUTING_LOG, BLOG..SYS_ROUTING, BLOG..SYS_ROUTING_TYPE
where R_JOB_ID = RL_JOB_ID and RT_ID = R_TYPE_ID and
R_ITEM_ID = self.blogid and (self.post_id_filt is null or RL_POST_ID = self.post_id_filt)
do
{
declare err, url, _b_title any;
_b_title := coalesce ((select B_TITLE from BLOG..SYS_BLOGS where B_POST_ID = RL_POST_ID and B_BLOG_ID = self.blogid),
'~deleted~');
err := coalesce (RL_ERROR, '');
err := regexp_match ('[^\r\n]*', err);
if (RL_PROCESSED = 0 or RL_PROCESSED is null)
err := 'pending';
else if (RL_PROCESSED = 1 and RL_F_POST_ID is not null)
err := 'sent';
else if (RL_PROCESSED = 1 and RL_F_POST_ID is null)
err := 'skipped';
if (self.log_filt.ufl_value = 'error' and RL_ERROR is null)
goto skipentry;
else if (self.log_filt.ufl_value not in ('all', 'error') and self.log_filt.ufl_value <> err)
goto skipentry;
?>
<tr class="<?V case when mod(i, 2) then 'listing_row_odd' else 'listing_row_even' end ?>">
<td><?V RL_POST_ID ?></td>
<td><?V BLOG..blog_utf2wide(_b_title) ?></td>
<td><?V RT_NAME ?></td>
<td><?V case RL_TYPE when 'I' then 'add' when 'U' then 'update' when 'D' then 'remove' else '' end ?></td>
<td><?V case when RL_TS is not null then BLOG..blog_date_fmt (RL_TS) else '' end ?></td>
<td><?V err ?></td>
<td><![CDATA[
<?vsp url := sprintf ('index.vspx?page=routing_queue&j=%d&p=%U&c=%d%s',
RL_JOB_ID, RL_POST_ID, RL_COMMENT_ID, login_pars); ?>
<a href="<?vsp http (url); ?>&reset">Reset</a>
<a href="<?vsp http (url); ?>&delete">Delete</a>
]]></td>
</tr>
<?vsp
i := i + 1;
skipentry:;
}
if (i = 0)
{
http ('<tr><td colspan="7">No upstreaming entries</td></tr>');
}
}
?>
</table>
</div>
</xsl:template>
<xsl:template match="vm:blog-trackbacks">
<div>
Filter selection
<v:text type="hidden" name="editid" value="--self.editpost"/>
<v:select-list name="comm_filter">
<v:item name="All Trackbacks" value="1" />
<v:item name="Waiting Approval" value="0" />
<v:before-data-bind>
if (not e.ve_is_post and get_keyword ('appr', e.ve_params, '1') = '0')
{
control.ufl_value := '0';
self.comment_filter := vector (0);
}
</v:before-data-bind>
</v:select-list>
<v:button name="appl_comm_filter" value="Apply" action="simple">
<v:on-post>
<![CDATA[
if (self.comm_filter.ufl_value = '1')
self.comment_filter := vector (0,1);
else if (self.comm_filter.ufl_value = '0')
self.comment_filter := vector (0);
self.ds_tb.vc_data_bind (e);
]]>
</v:on-post>
</v:button>
</div>
<table class="listing">
<tr class="listing_header_row">
<th>Date</th>
<th>Excerpt</th>
<th>From</th>
<th>Title</th>
<th>From IP</th>
<th>Rate</th>
<th>Status</th>
<th>Action</th>
</tr>
<v:data-set name="ds_tb" nrows="10" scrollable="1" edit="1">
<v:sql>
<![CDATA[
select MP_ID, MP_EXCERPT, MP_BLOG_NAME, MP_TITLE, MP_URL, MP_IP, MP_TS, MP_IS_PUB, MP_IS_SPAM
from BLOG..MTYPE_TRACKBACK_PINGS where MP_POST_ID = :post_id
and position (MP_IS_PUB, :comment_filter)
]]>
</v:sql>
<v:before-data-bind>
<![CDATA[
declare _del, _spam, _ham, _editid, _pub, cf, params any;
params := self.vc_event.ve_params;
_editid := get_keyword('editid', params);
cf := get_keyword('cf', params, null);
if (self.comment_filter is null)
{
if (cf is not null)
{
self.comment_filter := deserialize (decode_base64 (cf));
if (length (self.comment_filter) = 1 and self.comment_filter[0] = 0)
self.comm_filter.ufl_value := '0';
}
else
self.comment_filter := vector (0,1);
}
if (_editid is not null)
{
self.editpost := _editid;
self.editid.ufl_value := _editid;
_del := atoi (get_keyword('del', params, '-1'));
_pub := atoi (get_keyword('publ', params, '-1'));
_spam := atoi (get_keyword('spam', params, '-1'));
_ham := atoi (get_keyword('ham', params, '-1'));
if (_del >= 0)
{
delete from BLOG..MTYPE_TRACKBACK_PINGS where MP_POST_ID = self.editpost and MP_ID = _del;
commit work;
}
if (_spam >=0 or _ham >= 0)
{
declare dummy, id, flag any;
flag := atoi (get_keyword('f', params, '0'));
if (_spam >=0)
id := _spam;
else
id := _ham;
whenever not found goto nfc;
if (flag)
{
select filter_remove_message (blob_to_string (MP_EXCERPT)||' '||MP_TITLE,
self.user_id, case when _spam >=0 then 1 else 0 end)
into dummy
from BLOG..MTYPE_TRACKBACK_PINGS where MP_POST_ID = self.editpost and MP_ID = id;
}
else
{
select filter_add_message (blob_to_string (MP_EXCERPT)||' '||MP_TITLE, self.user_id, case when _spam >=0 then 1 else 0 end)
into dummy
from BLOG..MTYPE_TRACKBACK_PINGS where MP_POST_ID = self.editpost and MP_ID = id;
}
nfc:
commit work;
}
if (_pub >= 0)
{
update BLOG..MTYPE_TRACKBACK_PINGS set MP_IS_PUB = 1, MP_IS_SPAM = 0 where MP_POST_ID = self.editpost and MP_ID = _pub;
commit work;
}
}
]]>
</v:before-data-bind>
<v:param name="post_id" value="--self.editpost"/>
<v:param name="comment_filter" value="--self.comment_filter"/>
<v:template type="repeat" name="rpt1">
<v:template type="browse" name="brws1">
<tr class="<?V case when mod(control.te_ctr, 2) then 'listing_row_odd' else 'listing_row_even' end ?>">
<td nowrap="1">
<v:label name="lab1" value="--BLOG..blog_date_fmt ((control.vc_parent as vspx_row_template).te_rowset[6],self.tz)" />
</td>
<td>
<v:label name="slab2" value="[SPAM]" enabled="--(control.vc_parent as vspx_row_template).te_rowset[8]"/>
<v:label name="lab2" format="%V" value="--subseq ((control.vc_parent as vspx_row_template).te_rowset[1], 0, 35)"/>
<a href="#" onmouseover="javascript: displayComment (<?V control.te_rowset[0] ?>); return false;"
onmouseout="javascript: hideComment (<?V control.te_rowset[0] ?>); return false;">...</a>
<div style="position:absolute; background-color: white; color: black; padding: 1px 3px 2px 2px; border: 2px solid #000000; visibility:hidden; z-index:1000; width:400; height: 400; overflow: auto;"
id="ct_<?V control.te_rowset[0] ?>">
<v:label name="lab2_h" value="--blob_to_string ((control.vc_parent as vspx_row_template).te_rowset[1])"/>
</div>
</td>
<td>
<v:url name="lab3" value="--(control.vc_parent as vspx_row_template).te_rowset[2]"
url="--sprintf ('mailto:%s', (control.vc_parent as vspx_row_template).te_rowset[3])"/>
</td>
<td>
<v:url name="lab4" value="--(control.vc_parent as vspx_row_template).te_rowset[4]"
url="--(control.vc_parent as vspx_row_template).te_rowset[4]"
/>
</td>
<td>
<v:label name="lab5" value="--(control.vc_parent as vspx_row_template).te_rowset[5]" />
</td>
<td>
<v:label name="lab6" value="--spam_filter_message(
blob_to_string ((control.vc_parent as vspx_row_template).te_rowset[1]), self.user_id)"
format="%s"/>
</td>
<td>
<v:label name="lab7" value="--case when (control.vc_parent as vspx_row_template).te_rowset[7] then 'published' else 'waiting approval' end" format="%s"/>
</td>
<td class="listing_col_action">
<v:url name="del_com1" value="Delete"
url="--sprintf ('index.vspx?page=edit_tb&editid=%s&del=%d&cf=%s',
self.editpost, (control.vc_parent as vspx_row_template).te_rowset[0],
encode_base64 (serialize (self.comment_filter)))"
/>
&#160;
<v:url name="spam_com1" value="Spam"
url="--sprintf ('index.vspx?page=edit_tb&editid=%s&spam=%d&f=0&cf=%s',
self.editpost, (control.vc_parent as vspx_row_template).te_rowset[0],
encode_base64 (serialize (self.comment_filter)) )
"
/>
&#160;
<!--
<v:url name="spam_com2" value="Spam-"
url="-#-sprintf ('index.vspx?page=edit_tb&editid=%s&spam=%d&f=1',
self.editpost, (control.vc_parent as vspx_row_template).te_rowset[0])"
/>
&#160; -->
<v:url name="ham_com1" value="Ham"
url="--sprintf ('index.vspx?page=edit_tb&editid=%s&ham=%d&f=0&cf=%s',
self.editpost, (control.vc_parent as vspx_row_template).te_rowset[0],
encode_base64 (serialize (self.comment_filter)) )"
/>
<!--
&#160;
<v:url name="ham_com2" value="Ham-"
url="-#-sprintf ('index.vspx?page=edit_tb&editid=%s&ham=%d&f=1',
self.editpost, (control.vc_parent as vspx_row_template).te_rowset[0])"
/> -->
&#160;
<v:url name="pub_com1" value="Publish"
url="--sprintf ('index.vspx?page=edit_tb&editid=%s&publ=%d&f=0&cf=%s',
self.editpost, (control.vc_parent as vspx_row_template).te_rowset[0],
encode_base64 (serialize (self.comment_filter)) )"
enabled="--equ((control.vc_parent as vspx_row_template).te_rowset[7], 0)"
/>
</td>
</tr>
</v:template>
</v:template>
<v:template type="simple" name="footer_comm">
<tr>
<td colspan="7">
<vm:ds-navigation data-set="ds_tb"/>
</td>
</tr>
</v:template>
</v:data-set>
</table>
</xsl:template>
<!-- TAGS -->
<xsl:template match="vm:tags-widget">
<v:method name="import_tags" arglist="in username any, in dpassword any, inout e vspx_event"><![CDATA[
declare res, cur_tag, cat_id, error_msg, tags varchar;
declare hdr any;
declare exit handler for sqlstate '*'
{
self.vc_error_message := 'Cannot connect to del.icio.us server';
self.vc_is_valid := 0;
return;
};
commit work;
res := http_get('http://del.icio.us/api/tags/get?', hdr, 'POST', sprintf ('Content-Type: text/xml\r\nDepth: 1\r\nAuthorization: Basic %s', encode_base64 (concat(username, ':', dpassword))));
res:=xtree_doc (res, 2);
error_msg := xpath_eval('string(//title)', res);
if (error_msg is not null and error_msg <> '')
{
self.vc_error_message := error_msg;
self.vc_is_valid := 0;
return;
}
tags := xpath_eval('//@tag', res, 0);
-- TBD: make a rule
]]></v:method>
<v:method name="tag2str" arglist="inout tags any"><![CDATA[
declare s any;
declare i int;
s := string_output ();
for (i := 0; i < length (tags); i := i + 2)
{
http (sprintf ('%s,', tags[i]), s);
}
return rtrim(string_output_string (s), ', ');
]]></v:method>
<v:form name="form2" type="simple" method="POST">
<h2>del.icio.us linking</h2>
<?vsp
declare username varchar;
whenever not found goto enddel;
select BI_DEL_USER into username from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID=self.blogid;
if (username = '' or username is null)
http(concat('<table><tr><th>This blog is not linked to del.icio.us</th></tr></table>'));
else
{
http(sprintf('<table><tr><th>This blog is linked to del.icio.us by user <a href="http://del.icio.us/%s">%s</a>', username, username));
?>
<v:button xhtml_class="real_button" action="simple" name="unlink_del" value="Unlink" xhtml_title="Unlink" xhtml_alt="Unlink">
<v:on-post>
<![CDATA[
update BLOG.DBA.SYS_BLOG_INFO set BI_DEL_USER='', BI_DEL_PASS='' where BI_BLOG_ID=self.blogid;
delete from BLOG.DBA.SYS_ROUTING where R_ITEM_ID = self.blogid and R_TYPE_ID = 3 and R_PROTOCOL_ID = 6;
]]>
</v:on-post>
</v:button>
<!--v:button xhtml_class="real_button" action="simple" name="import_del" value="Import Tags" xhtml_title="Import" xhtml_alt="Import">
<v:on-post>
<![CDATA[
declare username, dpassword varchar;
whenever not found goto nfu;
select BI_DEL_USER, BI_DEL_PASS into username, dpassword from BLOG.DBA.SYS_BLOG_INFO where BI_BLOG_ID=self.blogid;
self.import_tags (username, dpassword, e);
nfu:;
]]>
</v:on-post>
</v:button-->
<?vsp
http('</th></tr></table>');
}
enddel:;
if (not length (username)) {
?>
<table id="del_icio_us">
<tr>
<th nowrap="nowrap">
<label for="del_username">Username</label>
</th>
<td>
<v:text xhtml_class="textbox" xhtml_id="del_username" name="del_username" value="">
</v:text>
</td>
</tr>
<tr>
<th nowrap="nowrap">
<label for="del_password">Password</label>
</th>
<td>
<v:text xhtml_class="textbox" xhtml_id="del_password" name="del_password" value="" type="password">
</v:text>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<!--v:button xhtml_class="real_button" action="simple" name="import_del1" value="Import Tags" xhtml_title="Import" xhtml_alt="Import">
<v:on-post>
<![CDATA[
self.import_tags (self.del_username.ufl_value, self.del_password.ufl_value, e);
]]>
</v:on-post>
</v:button-->
<v:button xhtml_class="real_button" action="simple" name="link_del" value="Link" xhtml_title="Link" xhtml_alt="Link">
<v:on-post>
<![CDATA[
declare username, dpassword, res, cur_tag, cat_id, error_msg varchar;
declare hdr any;
declare tag_count, i integer;
username := self.del_username.ufl_value;
dpassword := self.del_password.ufl_value;
declare exit handler for sqlstate '*'
{
self.vc_error_message := 'Cannot connect to del.icio.us server';
self.vc_is_valid := 0;
return;
};
commit work;
res := http_get('http://del.icio.us/api/tags/get?', hdr, 'POST', sprintf ('Content-Type: text/xml\r\nDepth: 1\r\nAuthorization: Basic %s', encode_base64 (concat(username, ':', dpassword))));
res:=xml_tree_doc (xml_tree (res, 2));
error_msg := xpath_eval('string(//title)', res);
if (error_msg is not null and error_msg <> '')
{
self.vc_error_message := error_msg;
self.vc_is_valid := 0;
return;
}
update BLOG.DBA.SYS_BLOG_INFO set BI_DEL_USER=username, BI_DEL_PASS=dpassword where BI_BLOG_ID=self.blogid;
declare jid, d_base int;
d_base := sprintf ('http://%s%s', self.host, self.base);
if (not exists (select 1 from BLOG.DBA.SYS_ROUTING where R_ITEM_ID = self.blogid and R_TYPE_ID = 3 and R_PROTOCOL_ID = 6))
{
jid := coalesce((select top 1 R_JOB_ID from BLOG.DBA.SYS_ROUTING order by R_JOB_ID desc), 0)+1;
insert into BLOG.DBA.SYS_ROUTING (R_JOB_ID,R_DESTINATION,R_AUTH_USER,R_AUTH_PWD,R_ITEM_ID,R_TYPE_ID,R_PROTOCOL_ID,R_DESTINATION_ID,R_FREQUENCY,R_KEEP_REMOTE) values (jid, '', username, dpassword, self.blogid, 3, 6, d_base, 1, 0);
}
]]>
</v:on-post>
</v:button>
</td>
</tr>
</table>
<?vsp } ?>
<br />
<br />
<h2>Tagging Settings</h2>
<v:check-box name="atagcb" xhtml_id="atagcb" value="1" auto-submit="1">
<v:after-data-bind>
if (e.ve_is_post and equ (e.ve_initiator, control))
{
if (get_keyword (control.vc_get_name (), e.ve_params) = '1')
self.auto_tag := 1;
else
self.auto_tag := 0;
update BLOG..SYS_BLOG_INFO set BI_AUTO_TAGGING = self.auto_tag where BI_BLOG_ID = self.blogid;
}
control.ufl_selected := self.auto_tag;
</v:after-data-bind>
</v:check-box>
<label for="atagcb">Automatic Tagging</label><br/><br/>
<div><a href="<?V wa_link (1) ?>/tags.vspx?sid=<?V self.sid ?>&realm=<?V self.realm ?>&RETURL=<?U self.return_url_1 ?>">Content Tagging Settings</a></div>
<br/>
<div>
<v:check-box name="cb_app_tags" value="1" initial-checked="1" xhtml_id="cb_add_tags" />
<label for="cb_add_tags">Keep existing tags</label>
</div>
<div>
<v:button xhtml_class="real_button" name="genb1" action="simple" value="Re-tag existing posts" xhtml_title="Auto Tagging" xhtml_alt="Auto Tagging">
<v:on-post><![CDATA[
declare ruls, flag, job, dummy any;
job := null; dummy := null;
job := (select top 1 R_JOB_ID from BLOG..SYS_ROUTING where
R_ITEM_ID = self.blogid and R_TYPE_ID = 3 and R_PROTOCOL_ID = 6);
ruls := user_tag_rules (self.user_id);
for select B_TITLE, B_CONTENT, B_POST_ID from BLOG..SYS_BLOGS where B_BLOG_ID = self.blogid do
{
flag := BLOG.DBA.RE_TAG_POST (self.blogid, B_POST_ID, self.user_id, self.inst_id,
B_CONTENT, self.cb_app_tags.ufl_selected, dummy, job, ruls, 1);
if (job is not null and length (flag))
{
insert replacing BLOG..SYS_BLOGS_ROUTING_LOG (RL_JOB_ID, RL_POST_ID, RL_TYPE) values (job, B_POST_ID, flag);
}
}
]]></v:on-post>
</v:button>
</div>
</v:form>
</xsl:template>
<xsl:template match="vm:contacts-edit">
<h3>Contact Network</h3>
<div id="text">
<h4>Contact Import</h4>
<table>
<tr>
<td>
<v:radio-button name="rb_impc1" xhtml_id="rb_impc1" value="1" group-name="impc1"
auto-submit="1"
initial-checked="1"/>
<label for="rb_impc1">FOAF</label>
</td>
<td rowspan="3">
<v:text xhtml_size="70" name="tx_impc1" xhtml_class="textbox" />
<?vsp
if (self.rb_impc1.ufl_selected or self.rb_impc3.ufl_selected)
{
?>
<vm:dav_browser
ses_type="yacutia"
render="popup"
list_type="details"
flt="yes"
flt_pat=""
path="DAV/home"
browse_type="res"
w_title="DAV Browser"
title="DAV Browser"
lang="en"
return_box="tx_impc1"/>
<?vsp
}
?>
</td>
</tr>
<tr>
<td>
<v:radio-button name="rb_impc2" xhtml_id="rb_impc2" value="2" group-name="impc1"
auto-submit="1"
/>
<label for="rb_impc2">Feed</label>
</td>
<td>
</td>
</tr>
<tr>
<td>
<v:radio-button name="rb_impc3" xhtml_id="rb_impc3" value="3" group-name="impc1"
auto-submit="1"
/>
<label for="rb_impc3">vCard</label>
</td>
<td>
</td>
</tr>
<tr>
<td colspan="2">
<v:button name="cimpbt1" action="submit" value="Import" xhtml_class="real_button">
<v:on-post><![CDATA[
declare cnt, xt, xp, arr any;
if (not length (self.tx_impc1.ufl_value))
{
self.vc_is_valid := 0;
self.vc_error_message := 'No path or URL specified.';
return;
}
declare exit handler for sqlstate '*'
{
self.vc_is_valid := 0;
self.vc_error_message := __SQL_MESSAGE;
return;
};
if (self.rb_impc1.ufl_selected)
{
cnt := XML_URI_GET ('', 'http://local.virt' || self.tx_impc1.ufl_value);
xt := xtree_doc (cnt, 0, '');
xp := xpath_eval ('//Person', xt, 0);
foreach (any x in xp) do
{
declare name, nick, mail, weblog, homepage, rss any;
name := xpath_eval ('name', x);
nick := xpath_eval ('nick', x);
mail := xpath_eval ('mbox/@resource', x);
homepage := xpath_eval ('homepage/@resource', x);
weblog := xpath_eval ('weblog/@resource', x);
rss := xpath_eval ('seeAlso/@resource', x);
insert soft BLOG.DBA.SYS_BLOG_CONTACTS
(BF_BLOG_ID, BF_NAME, BF_NICK, BF_MBOX, BF_HOMEPAGE, BF_WEBLOG, BF_RSS) values
(self.blogid, name, nick, mail, homepage, weblog, rss);
}
}
else if (self.rb_impc2.ufl_selected)
{
declare res, url, hdr, home, tit any;
declare xt, xp, mail, author any;
declare exit handler for sqlstate '*'
{
rollback work;
return;
};
url := self.tx_impc1.ufl_value;
commit work;
res := BLOG..GET_URL_AND_REDIRECTS (url, hdr);
xt := xtree_doc (res, 2, '', 'UTF-8');
if (xpath_eval ('/feed', xt) is not null)
{
mail := xpath_eval ('/feed/author/email/text()', xt);
author := xpath_eval ('/feed/author/name/text()', xt);
if (author is null)
{
declare cnt any;
cnt := (select count (*) from BLOG.DBA.SYS_BLOG_CONTACTS where BF_BLOG_ID = self.blogid and BF_NAME like 'contact %') + 1;
author := sprintf ('contact (%d)', cnt);
}
home := xpath_eval ('/feed/link[@rel="alternate"]/@href', xt);
tit := xpath_eval ('/feed/title/text()', xt);
if (not length (author))
author := tit;
}
else if (xpath_eval ('/rss', xt) is not null)
{
mail := xpath_eval ('/channel/managingEditor/text()', xt);
tit := xpath_eval ('/channel/title/text()', xt);
author := tit;
home := '';
if (author is null)
{
declare cnt any;
cnt := (select count (*) from BLOG.DBA.SYS_BLOG_CONTACTS where BF_BLOG_ID = self.blogid and BF_NAME like 'contact %') + 1;
author := sprintf ('contact (%d)', cnt);
}
}
else
{
self.vc_is_valid := 0;
self.vc_error_message := 'The URL is not a valid feed.';
return;
}
insert soft BLOG.DBA.SYS_BLOG_CONTACTS
(BF_BLOG_ID, BF_NAME, BF_MBOX, BF_HOMEPAGE, BF_WEBLOG, BF_RSS) values
(self.blogid, author, mail, home, home, self.tx_impc1.ufl_value);
}
else if (self.rb_impc3.ufl_selected)
{
declare ses any;
declare name, nick, mail, weblog, homepage, rss, done any;
cnt := XML_URI_GET ('', 'http://local.virt' || self.tx_impc1.ufl_value);
ses := string_output ();
http (cnt, ses);
done := -1;
name := nick := mail := weblog := homepage := '';
while (1)
{
declare line any;
line := ses_read_line (ses, 0, 0, 1);
line := trim (line, ' \r\n');
if (not isstring (line))
goto ef;
if (lower (line) = 'begin:vcard')
done := 0;
else if (lower (line) = 'end:vcard')
{
if (done = 1)
done := 2;
goto ef;
}
if (done >= 0 and done < 2)
{
if (lower (line) like 'fn:%')
{
name := substring (line, 4, length (line));
done := 1;
}
else if (lower (line) like 'email:%')
{
mail := substring (line, 7, length (line));
done := 1;
}
else if (lower (line) like 'nickname:%')
{
nick := substring (line, 10, length (line));
done := 1;
}
else if (lower (line) like 'email;%:%')
{
declare pos any;
line := substring (line, 7, length (line));
pos := strchr (line, ':');
mail := substring (line, pos + 2, length (line));
done := 1;
}
else if (lower (line) like 'url:%')
{
homepage := substring (line, 5, length (line));
done := 1;
}
else if (lower (line) like 'url;%:%')
{
declare pos any;
line := substring (line, 7, length (line));
pos := strchr (line, ':');
homepage := substring (line, pos + 2, length (line));
done := 1;
}
}
}
ef:;
if (done = 2)
{
insert soft BLOG.DBA.SYS_BLOG_CONTACTS
(BF_BLOG_ID, BF_NAME, BF_NICK, BF_MBOX, BF_HOMEPAGE) values
(self.blogid, name, nick, mail, homepage);
}
}
]]></v:on-post>
</v:button>
</td>
</tr>
</table>
<h4>Enter Details</h4>
<v:form name="contf1" type="update" table="BLOG.DBA.SYS_BLOG_CONTACTS" if-not-exists="insert">
<v:key column="BF_ID" value="self.cont_edit" />
<v:key column="BF_BLOG_ID" value="self.blogid" />
<v:before-data-bind>
if (not e.ve_is_post)
self.cont_edit := get_keyword('edit', e.ve_params, '-1');
</v:before-data-bind>
<v:before-render>
if (control.vc_focus and self.vc_is_valid)
{
self.cont_edit := -1;
self.cname1.ufl_value := '';
self.cnick1.ufl_value := '';
self.cmbox1.ufl_value := '';
self.chpage1.ufl_value := '';
self.cwpage1.ufl_value := '';
self.cwrss1.ufl_value := '';
}
</v:before-render>
<v:template name="cupdt1" type="if-exists">
<table>
<tr>
<th>Name</th>
<td>
<v:text xhtml_class="textbox" name="cname1" column="BF_NAME" error-glyph="*" xhtml_style="width: 220px">
<v:validator test="regexp" regexp="^[^ ]+.*$" message="The name is empty" >
</v:validator>
</v:text>
<v:text type="hidden" name="cbid1" column="BF_BLOG_ID" value="--self.blogid"/>
</td>
</tr>
<tr>
<th>Nick</th>
<td>
<v:text name="cnick1" column="BF_NICK" xhtml_class="textbox" xhtml_style="width: 220px" />
</td>
</tr>
<tr>
<th>Mailbox</th>
<td>
<v:text name="cmbox1" column="BF_MBOX" xhtml_class="textbox" xhtml_style="width: 220px" />
</td>
</tr>
<tr>
<th>Home page</th>
<td>
<v:text name="chpage1" column="BF_HOMEPAGE" xhtml_class="textbox" xhtml_style="width: 220px" />
</td>
</tr>
<tr>
<th>Weblog</th>
<td>
<v:text name="cwpage1" column="BF_WEBLOG" xhtml_class="textbox" xhtml_style="width: 220px" />
</td>
</tr>
<tr>
<th>RSS</th>
<td>
<v:text name="cwrss1" column="BF_RSS" xhtml_class="textbox" xhtml_style="width: 220px" />
</td>
</tr>
<tr>
<td colspan="2">
<v:button name="cbutton1" action="submit" value="Save" xhtml_class="real_button"/>
</td>
</tr>
</table>
</v:template>
</v:form>
</div>
<br />
<div class="scroll_area">
<table class="listing">
<tr class="listing_header_row">
<th>Name</th>
<th>Action</th>
</tr>
<?vsp
declare params any;
params := self.vc_event.ve_params;
if ({?'delete'} is not null and {?'page'} = 'contacts')
{
delete from BLOG..SYS_BLOG_CONTACTS where BF_BLOG_ID = self.blogid
and BF_ID = {?'delete'};
}
for select BF_ID, BF_NICK, BF_NAME, BF_HOMEPAGE
from BLOG..SYS_BLOG_CONTACTS where BF_BLOG_ID = self.blogid
order by BF_ID do
{
declare nick any;
if (length (BF_NICK))
nick := sprintf ('(%s)', BF_NICK);
else
nick := '';
?>
<tr>
<td><a href="<?V BF_HOMEPAGE ?>"><?V BF_NAME ?> <?V nick ?></a></td>
<td>
<a href="?page=contacts&edit=<?V BF_ID ?>&realm=wa&sid=<?V self.sid ?>">Edit</a>
<![CDATA[ ]]>
<a href="?page=contacts&delete=<?V BF_ID ?>&realm=wa&sid=<?V self.sid ?>">Delete</a>
</td>
</tr>
<?vsp
}
?>
</table>
</div>
</xsl:template>
<xsl:template match="vm:tags">
<?vsp if (get_keyword ('TagGem', self.opts, 1)) { ?>
<div id="tags_cloud">
<xsl:processing-instruction name="vsp">
declare nmax int;
<xsl:choose>
<xsl:when test="@top">
nmax := <xsl:value-of select="@top" />;
</xsl:when>
<xsl:otherwise>
nmax := 100;
</xsl:otherwise>
</xsl:choose>
</xsl:processing-instruction>
<?vsp
{
declare mx, mx2, inx int;
declare style any;
declare h, pars, sql, dta, mdta any;
inx := 0;
mx := (select top 1 cnt from (select distinct bt_tag, count (*) cnt from BLOG..BLOG_TAGS_STAT_EXT where blogid = self.blogid and community = self.have_comunity_blog group by 1 order by 2 asc) sub);
if (mx is null)
mx := 1;
mx2 := (select top 1 cnt from (select distinct bt_tag, count (*) cnt from BLOG..BLOG_TAGS_STAT_EXT where blogid = self.blogid and community = self.have_comunity_blog group by 1 order by 2 desc) sub);
if (mx is null)
mx2 := 1;
sql := sprintf ('select BT_TAG, cnt from (select top %d BT_TAG, count(*) as cnt from BLOG..BLOG_TAGS_STAT_EXT where blogid = ? and community = ? group by BT_TAG order by 2 desc) sub order by 1', nmax);
pars := vector (self.blogid, self.have_comunity_blog);
exec (sql, null, null, pars, 0, null, null, h);
while (0 = exec_next (h, null, null, dta))
{
style := ODS.WA.tag_style (dta[1], mx, mx2);
http (sprintf ('<a href="%s/tag/%s"><span style="%s">%s</span></a> ', self.blog_iri, dta[0], style, dta[0]));
inx := inx + 1;
}
exec_close (h);
}
?>
</div>
<?vsp } ?>
</xsl:template>
<xsl:template match="vm:pending-comments">
<h3>Posts with pending comments</h3>
<div class="scroll-area">
<table class="listing">
<tr class="listing_header_row">
<th>Title</th>
<th>Date</th>
<th>SPAM Rate</th>
<th>Action</th>
</tr>
<?vsp {
declare login_pars any;
declare params, postid any;
declare _del, _spam, _ham, _pub, _kind any;
params := self.vc_event.ve_params;
postid := get_keyword ('editid', params, null);
if (postid is not null)
{
_del := atoi (get_keyword('del', params, '-1'));
_pub := atoi (get_keyword('pub', params, '-1'));
_spam := atoi (get_keyword('spam', params, '-1'));
_ham := atoi (get_keyword('ham', params, '-1'));
_kind := atoi (get_keyword('kind', params, '-1'));
-- dbg_obj_print (_del,_pub,_spam,_ham,_kind,postid);
if (_del >= 0)
{
if (_kind = 0)
{
delete from BLOG..BLOG_COMMENTS where BM_BLOG_ID = self.blogid
and BM_POST_ID = postid and BM_ID = _del;
}
else
{
delete from BLOG..MTYPE_TRACKBACK_PINGS where MP_POST_ID = postid and MP_ID = _del;
}
commit work;
}
if (_spam >=0 or _ham >= 0)
{
declare dummy, id, flag any;
if (_spam >=0)
id := _spam;
else
id := _ham;
whenever not found goto nfc;
{
if (_kind = 0)
{
select filter_add_message (blob_to_string (BM_COMMENT), self.user_id, case when _spam >=0 then 1 else 0 end)
into dummy
from BLOG..BLOG_COMMENTS where BM_BLOG_ID = self.blogid and
BM_POST_ID = postid and BM_ID = id;
}
else
{
select filter_add_message (blob_to_string (MP_EXCERPT)||' '||MP_TITLE, self.user_id, case when _spam >=0 then 1 else 0 end)
into dummy
from BLOG..MTYPE_TRACKBACK_PINGS where MP_POST_ID = postid and MP_ID = id;
}
}
nfc:
commit work;
}
if (_pub >= 0)
{
if (_kind = 0)
{
update BLOG..BLOG_COMMENTS set BM_IS_PUB = 1, BM_IS_SPAM = 0 where BM_BLOG_ID = self.blogid
and BM_POST_ID = postid and BM_ID = _pub;
}
else
{
update BLOG..MTYPE_TRACKBACK_PINGS set MP_IS_PUB = 1, MP_IS_SPAM = 0 where MP_POST_ID = postid and MP_ID = _pub;
}
commit work;
}
}
login_pars := '';
if (length (self.sid))
login_pars := sprintf ('&sid=%s&realm=%s', self.sid, self.realm);
declare ix int;
ix := 0;
for select BM_ID, BM_POST_ID, BM_TITLE, BM_TS, kind, BM_COMMENT, BM_IS_SPAM from (
select BM_ID, BM_POST_ID, BM_TITLE, BM_TS, 0 as kind, BM_COMMENT, BM_IS_SPAM from BLOG..BLOG_COMMENTS
where BM_IS_PUB = 0 and BM_BLOG_ID = self.blogid union all
select MP_ID, MP_POST_ID, MP_TITLE, MP_TS, 1 as kind, MP_EXCERPT, MP_IS_SPAM from BLOG..MTYPE_TRACKBACK_PINGS, BLOG..SYS_BLOGS
where MP_IS_PUB = 0 and MP_POST_ID = B_POST_ID and B_BLOG_ID = self.blogid ) sub order by BM_TS desc do
{
?>
<tr class="<?V case when mod(ix,2) then 'listing_row_odd' else 'listing_row_even' end ?>">
<td>
<a href="#"
onmouseover="javascript: displayComment ('<?V BM_ID ?>_<?V kind ?>'); return false;"
onmouseout="javascript: hideComment ('<?V BM_ID ?>_<?V kind ?>'); return false;"
>
<?vsp http (case when BM_IS_SPAM then '[SPAM]'else '' end); ?>
<?V BLOG..blog_utf2wide (BM_TITLE) ?>
</a>
<div style="position:absolute; background-color: white; color: black; padding: 1px 3px 2px 2px; border: 2px solid #000000; visibility:hidden; z-index:1000; width:400; height: 400; overflow: auto;"
id="ct_<?V BM_ID ?>_<?V kind ?>">
<?vsp http (blob_to_string (BM_COMMENT)) ; ?>
</div>
(<?vsp
http (case when kind then 'trackback'else 'comment' end);
?>)
</td>
<td><?V BLOG..blog_date_fmt (BM_TS, self.tz) ?></td>
<td>
<?V spam_filter_message(BM_COMMENT, self.user_id) ?>
</td>
<td>
<a href="index.vspx?page=ping&ping_tab=3&site_tab=3<?V login_pars ?>&editid=<?V BM_POST_ID ?>&del=<?V BM_ID ?>&kind=<?V kind ?>">Delete</a>
&#160;
<a href="index.vspx?page=ping&ping_tab=3&site_tab=3<?V login_pars ?>&editid=<?V BM_POST_ID ?>&spam=<?V BM_ID ?>&kind=<?V kind ?>">Spam</a>
&#160;
<a href="index.vspx?page=ping&ping_tab=3&site_tab=3<?V login_pars ?>&editid=<?V BM_POST_ID ?>&ham=<?V BM_ID ?>&kind=<?V kind ?>">Ham</a>
&#160;
<a href="index.vspx?page=ping&ping_tab=3&site_tab=3<?V login_pars ?>&editid=<?V BM_POST_ID ?>&pub=<?V BM_ID ?>&kind=<?V kind ?>">Publish</a>
</td>
</tr>
<?vsp
ix := ix + 1;
}
if (ix = 0)
{
?>
<tr class="listing_row_even">
<td colspan="4">No posts found with comments/trackbacks waiting approval</td>
</tr>
<?vsp
}
} ?>
</table>
</div>
</xsl:template>
<!-- CHECK: community mode -->
<xsl:template match="vm:archive">
<v:template name="archive" type="simple" enabled="1">
<div id="archive_view_sel">
<h2><label for="arch_view1">Archive by: </label>
<v:select-list name="arch_view1" xhtml_id="arch_view1" xhtml_class="select" auto-submit="1" value="--self.arch_view">
<v:item name="month" value="month" />
<v:item name="year" value="year" />
<v:item name="category" value="category" />
<!--v:item name="tag" value="tag" /-->
<v:item name="all" value="all" />
<v:after-data-bind>
if (not e.ve_is_post and control.ufl_value is null)
{
control.ufl_value := 'month';
control.vs_set_selected ();
}
</v:after-data-bind>
</v:select-list>
<![CDATA[ ]]>
<v:button name="arch_bt1" value="Show Archives" action="simple" style="url" />
<![CDATA[ ]]>
<v:check-box name="show_full_article" value="1" xhtml_id="show_full_article" auto-submit="1">
<v:before-render>
control.ufl_selected := self.show_full_post;
</v:before-render>
</v:check-box>
<label for="show_full_article">Show full article</label>
</h2>
<v:on-post>
if (e.ve_initiator = self.arch_view1 or e.ve_button = self.arch_bt1)
{
self.arch_view := self.arch_view1.ufl_value;
if (self.arch_view = 'all')
{
self.posts.vc_enabled := 1;
self.arch_view := 'month';
self.arch_sel := null;
self.tagid := null;
self.catid := null;
self.dss.vc_data_bind (e);
self.posts.vc_data_bind (e);
}
else
{
self.posts.vc_enabled := 0;
}
self.arch_view_month.vc_data_bind (e);
self.arch_view_year.vc_data_bind (e);
self.arch_view_cat.vc_data_bind (e);
self.arch_view_tag.vc_data_bind (e);
}
if (e.ve_initiator = self.show_full_article)
{
declare expires, cook_str any;
self.show_full_post := self.show_full_article.ufl_selected;
expires := date_rfc1123 (dateadd ('month', 1, now()));
cook_str := sprintf ('Set-Cookie: blog_show_full_post=%d; path=%s; expires=%s;\r\n',
self.show_full_post, http_path (), expires);
http_header (concat (http_header_get (), cook_str));
}
</v:on-post>
</div>
<v:template name="arch_view_month" type="simple" enabled="--bit_and (equ (self.arch_view, 'month'), equ(self.posts.vc_enabled, 0))">
<div id="arch_gems">
<a href="gems/opml_date_arch.xml?:bid=<?V self.blogid ?>"><img src="/weblog/public/images/blue-icon-16.gif" border="0" alt="OPML" hspace="3"/>OPML</a>
<a href="gems/ocs_date_arch.xml?:bid=<?V self.blogid ?>"><img src="/weblog/public/images/blue-icon-16.gif" border="0" alt="OPML" hspace="3"/>OCS</a>
</div>
<ul id="arch_view_sel">
<?vsp
for select distinct year (B_TS) as year, month (B_TS) as month, monthname(B_TS) as monthname, count(1) as cnt
from BLOG..BLOG_ARCH_DATE_POSTS where blogid = self.blogid and community = self.have_comunity_blog
group by 1,2,3 order by 1 desc,2 desc do
{
?>
<li>
<a href="gems/rss_date_arch.xml?:sel=<?V year ?>-<?V month ?>&amp;:bid=<?V self.blogid ?>"><img src="/weblog/public/images/rss-icon-16.gif" border="0" alt="RSS" title="RSS"/></a>
<a href="gems/atom_date_arch.xml?:sel=<?V year ?>-<?V month ?>&amp;:bid=<?V self.blogid ?>"><img src="/weblog/public/images/atom-icon-16.gif" border="0" alt="Atom" title="Atom"/></a>
<a href="gems/rdf_date_arch.xml?:sel=<?V year ?>-<?V month ?>&amp;:bid=<?V self.blogid ?>"><img src="/weblog/public/images/rdf-icon-16.gif" border="0" alt="RDF" title="RDF"/></a>
<![CDATA[ ]]>
<a href="index.vspx?page=archive&arch_sel=<?V year ?>-<?V month ?>&arch_view=month<?V self.login_pars?>"><?V monthname ?>, <?V year ?> (<?V cnt ?> entries)</a></li>
<?vsp
}
?>
</ul>
</v:template>
<!-- archives by Year -->
<v:template name="arch_view_year" type="simple" enabled="--bit_and (equ (self.arch_view, 'year'), equ(self.posts.vc_enabled, 0))">
<div id="arch_gems">
<a href="gems/opml_year_arch.xml?:bid=<?V self.blogid ?>"><img src="/weblog/public/images/blue-icon-16.gif" border="0" alt="OPML" hspace="3"/>OPML</a>
<a href="gems/ocs_year_arch.xml?:bid=<?V self.blogid ?>"><img src="/weblog/public/images/blue-icon-16.gif" border="0" alt="OPML" hspace="3"/>OCS</a>
</div>
<ul id="arch_view_sel">
<?vsp
for select distinct year (B_TS) as year, count(1) as cnt
from BLOG..BLOG_ARCH_DATE_POSTS where blogid = self.blogid and community = self.have_comunity_blog
group by 1 order by 1 desc do
{
?>
<li>
<a href="gems/rss_date_arch.xml?:sel=<?V year ?>&amp;:bid=<?V self.blogid ?>"><img src="/weblog/public/images/rss-icon-16.gif" border="0" alt="RSS" title="RSS"/></a>
<a href="gems/atom_date_arch.xml?:sel=<?V year ?>&amp;:bid=<?V self.blogid ?>"><img src="/weblog/public/images/atom-icon-16.gif" border="0" alt="Atom" title="Atom"/></a>
<a href="gems/rdf_date_arch.xml?:sel=<?V year ?>&amp;:bid=<?V self.blogid ?>"><img src="/weblog/public/images/rdf-icon-16.gif" border="0" alt="RDF" title="RDF"/></a>
<![CDATA[ ]]>
<a href="index.vspx?page=archive&arch_sel=<?V year ?>-01&arch_view=year<?V self.login_pars?>"><?V year ?> (<?V cnt ?> entries)</a></li>
<?vsp
}
?>
</ul>
</v:template>
<v:template name="arch_view_cat" type="simple" enabled="--bit_and (equ (self.arch_view, 'category'), equ(self.posts.vc_enabled, 0))">
<div id="arch_gems">
<a href="gems/opml_cat_arch.xml?:bid=<?V self.blogid ?>"><img src="/weblog/public/images/blue-icon-16.gif" border="0" alt="OPML" hspace="3"/>OPML</a>
<a href="gems/ocs_cat_arch.xml?:bid=<?V self.blogid ?>"><img src="/weblog/public/images/blue-icon-16.gif" border="0" alt="OPML" hspace="3"/>OCS</a>
</div>
<ul id="arch_view_sel">
<?vsp
for select MTC_ID as cid, MTC_NAME as cname, count(1) as cnt
from BLOG..SYS_BLOGS,
(select BI_BLOG_ID as BA_C_BLOG_ID, BI_BLOG_ID as BA_M_BLOG_ID from BLOG..SYS_BLOG_INFO where BI_BLOG_ID = self.blogid
union all
select * from (select BA_C_BLOG_ID, BA_M_BLOG_ID from BLOG.DBA.SYS_BLOG_ATTACHES where BA_M_BLOG_ID = self.blogid
) name1) name2,
BLOG..MTYPE_CATEGORIES, BLOG..MTYPE_BLOG_CATEGORY where B_BLOG_ID = BA_C_BLOG_ID and
MTB_BLOG_ID = B_BLOG_ID and MTB_POST_ID = B_POST_ID and MTB_CID = MTC_ID and MTC_BLOG_ID = MTB_BLOG_ID
group by 1,2 order by 2
do
{
?>
<li>
<a href="gems/rss_cat_arch.xml?:cid=<?V cid ?>&amp;:bid=<?V self.blogid ?>"><img src="/weblog/public/images/rss-icon-16.gif" border="0" alt="RSS" title="RSS"/></a>
<a href="gems/atom_cat_arch.xml?:cid=<?V cid ?>&amp;:bid=<?V self.blogid ?>"><img src="/weblog/public/images/atom-icon-16.gif" border="0" alt="Atom" title="Atom"/></a>
<a href="gems/rdf_cat_arch.xml?:cid=<?V cid ?>&amp;:bid=<?V self.blogid ?>"><img src="/weblog/public/images/rdf-icon-16.gif" border="0" alt="RDF" title="RDF"/></a>
<![CDATA[ ]]>
<a href="index.vspx?page=archive&cat=<?V cid ?>&arch_view=category<?V self.login_pars?>"><?V cname ?> (<?V cnt ?> entries)</a></li>
<?vsp
}
?>
</ul>
</v:template>
<v:template name="arch_view_tag" type="simple" enabled="--bit_and(equ (self.arch_view, 'tag'), equ(self.posts.vc_enabled,0))">
<div id="arch_gems">
<a href="gems/opml_tag_arch.xml?:bid=<?V self.blogid ?>"><img src="/weblog/public/images/blue-icon-16.gif" border="0" alt="OPML" hspace="3"/>OPML</a>
<a href="gems/ocs_tag_arch.xml?:bid=<?V self.blogid ?>"><img src="/weblog/public/images/blue-icon-16.gif" border="0" alt="OPML" hspace="3"/>OCS</a>
</div>
<ul id="arch_view_sel">
<?vsp
for select BT_TAG as tagname, count(1) as cnt
from BLOG..BLOG_TAGS_STAT_EXT where blogid = self.blogid and community = self.have_comunity_blog group by 1 order by 1
do
{
?>
<li>
<a href="gems/rss_tag_arch.xml?:tag=<?V BLOG..blog_utf2wide (tagname) ?>&amp;:bid=<?V self.blogid ?>"><img src="/weblog/public/images/rss-icon-16.gif" border="0" alt="RSS" title="RSS"/></a>
<a href="gems/atom_tag_arch.xml?:tag=<?V BLOG..blog_utf2wide (tagname) ?>&amp;:bid=<?V self.blogid ?>"><img src="/weblog/public/images/atom-icon-16.gif" border="0" alt="Atom" title="Atom"/></a>
<a href="gems/rdf_tag_arch.xml?:tag=<?V BLOG..blog_utf2wide (tagname) ?>&amp;:bid=<?V self.blogid ?>"><img src="/weblog/public/images/rdf-icon-16.gif" border="0" alt="RDF" title="RDF"/></a>
<![CDATA[ ]]>
<a href="index.vspx?page=archive&tag=<?V BLOG..blog_utf2wide (tagname) ?>&arch_view=tag<?V self.login_pars?>"><?V BLOG..blog_utf2wide (tagname) ?> (<?V cnt ?> entries)</a></li>
<?vsp
}
?>
</ul>
</v:template>
<div class="posts-title">
<?vsp
if (self.posts.vc_enabled and self.arch_view is not null and self.page = 'archive')
{
if (self.arch_view = 'month')
{
declare dat any;
if (length (self.arch_sel))
{
dat := stringdate (self.arch_sel || '-01');
http (sprintf ('%s, %d', monthname (dat), year (dat)));
}
else
{
http ('All posts');
?>
<a href="gems/rss_date_arch.xml?:sel=&amp;:bid=<?V self.blogid ?>">
<img border="0" alt="RSS" title="RSS" src="/weblog/public/images/rss-icon-16.gif" />
</a>
<a href="gems/atom_date_arch.xml?:sel=&amp;:bid=<?V self.blogid ?>">
<img border="0" alt="Atom" title="Atom" src="/weblog/public/images/atom-icon-16.gif" />
</a>
<a href="gems/rdf_date_arch.xml?:sel=&amp;:bid=<?V self.blogid ?>">
<img border="0" alt="RDF" title="RDF" src="/weblog/public/images/rdf-icon-16.gif" />
</a>
<?vsp
}
}
else if (self.arch_view = 'category')
http (self.sel_cat);
else if (self.arch_view = 'tag')
http (self.tagid);
else if (self.arch_view = 'year')
{
declare dat any;
if (length (self.arch_sel))
{
dat := stringdate (self.arch_sel || '-01');
http (sprintf ('%d', year (dat)));
}
}
}
?>
</div>
<div id="arch_crumbs">
<?vsp
if (self.posts.vc_enabled = 1)
{
if (self.arch_view = 'month')
{
declare prev, prev_y, prev_m, curr, next, is_curr any;
is_curr := 0;
prev := null;
for select distinct year (B_TS) as year, month (B_TS) as month, monthname(B_TS) as monthname
from BLOG..BLOG_ARCH_DATE_POSTS where blogid = self.blogid and community = self.have_comunity_blog
order by 1,2
do
{
curr := sprintf ('%d-%d', year, month);
if (curr = self.arch_sel)
{
if (prev is not null)
{
?>
<a href="index.vspx?page=archive&arch_sel=<?V prev ?>&arch_view=month<?V self.login_pars?>">< <?V prev_m ?>, <?V prev_y ?></a>
<?vsp
}
?>
<a href="index.vspx?page=archive&arch_sel=<?V curr ?>&arch_view=month<?V self.login_pars?>"><?V monthname ?>, <?V year ?></a>
<?vsp
is_curr := 1;
}
else if (is_curr)
{
?>
<a href="index.vspx?page=archive&arch_sel=<?V curr ?>&arch_view=month<?V self.login_pars?>"><?V monthname ?>, <?V year ?> ></a>
<?vsp
goto fin1;
}
prev := curr;
prev_y := year;
prev_m := monthname;
}
fin1:;
}
else if (self.arch_view = 'category')
{
declare prev, is_curr, prevc any;
prev := null;
for select distinct MTC_ID as cid, MTC_NAME as cname
from BLOG..SYS_BLOGS, BLOG..MTYPE_CATEGORIES, BLOG..MTYPE_BLOG_CATEGORY where B_BLOG_ID = self.blogid and
MTB_BLOG_ID = B_BLOG_ID and MTB_POST_ID = B_POST_ID and MTB_CID = MTC_ID and MTC_BLOG_ID = MTB_BLOG_ID
order by 2
do
{
if (cid = self.catid)
{
if (prev is not null)
{
?>
<a href="index.vspx?page=archive&cat=<?V prev ?>&arch_view=category<?V self.login_pars?>">< <?V prevc ?></a>
<?vsp
}
?>
<a href="index.vspx?page=archive&cat=<?V cid ?>&arch_view=category<?V self.login_pars?>"><?V cname ?></a>
<?vsp
is_curr := 1;
}
else if (is_curr)
{
?>
<a href="index.vspx?page=archive&cat=<?V cid ?>&arch_view=category<?V self.login_pars?>"><?V cname ?> ></a>
<?vsp
goto fin2;
}
prev := cid;
prevc := cname;
}
fin2:;
}
else if (self.arch_view = 'tag')
{
declare prev, is_curr any;
prev := null;
for select distinct BT_TAG as tagname
from BLOG..BLOG_TAGS_STAT where blogid = self.blogid
order by 1
do
{
tagname := BLOG..blog_utf2wide (tagname);
if (tagname = self.tagid)
{
if (prev is not null)
{
?>
<a href="index.vspx?page=archive&tag=<?V prev ?>&arch_view=tag<?V self.login_pars ?>">< <?V prev ?></a>
<?vsp
}
?>
<a href="index.vspx?page=archive&tag=<?V tagname ?>&arch_view=tag<?V self.login_pars ?>"><?V tagname ?></a>
<?vsp
is_curr := 1;
}
else if (is_curr)
{
?>
<a href="index.vspx?page=archive&tag=<?V tagname ?>&arch_view=tag<?V self.login_pars ?>"><?V tagname ?> ></a>
<?vsp
goto fin3;
}
prev := tagname;
}
fin3:;
}
else if (self.arch_view = 'year')
{
declare prev, prev_y, curr, next, is_curr any;
is_curr := 0;
prev := null;
for select distinct year (B_TS) as year
from BLOG..BLOG_ARCH_DATE_POSTS where blogid = self.blogid and community = self.have_comunity_blog
order by 1
do
{
curr := sprintf ('%d-01', year);
if (curr = self.arch_sel)
{
if (prev is not null)
{
?>
<a href="index.vspx?page=archive&arch_sel=<?V prev ?>&arch_view=year<?V self.login_pars?>">< <?V prev_y ?></a>
<?vsp
}
?>
<a href="index.vspx?page=archive&arch_sel=<?V curr ?>&arch_view=year<?V self.login_pars?>"><?V year ?></a>
<?vsp
is_curr := 1;
}
else if (is_curr)
{
?>
<a href="index.vspx?page=archive&arch_sel=<?V curr ?>&arch_view=year<?V self.login_pars?>"><?V year ?> ></a>
<?vsp
goto fin4;
}
prev := curr;
prev_y := year;
}
fin4:;
}
}
?>
</div>
</v:template>
</xsl:template>
<xsl:template match="v:label[not @render-only and not(*) and not (@enabled)]
|v:url[not @render-only and not(*) and not(@enabled) and not(@active)]">
<!--xsl:message terminate="no"><xsl:copy-of select="."/></xsl:message-->
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:attribute name="render-only">1</xsl:attribute>
<xsl:if test="not @format">
<xsl:attribute name="format">%s</xsl:attribute>
</xsl:if>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
<xsl:template match="v:template[@condition]">
<xsl:processing-instruction name="vsp"> if (<xsl:value-of select="@condition"/>) { </xsl:processing-instruction>
<xsl:apply-templates />
<xsl:processing-instruction name="vsp"> } </xsl:processing-instruction>
</xsl:template>
<xsl:template match="@*|text()" mode="static_value">
<xsl:choose>
<xsl:when test=". like '--%' or . = ''">''</xsl:when>
<xsl:when test=". like '\'%\''"><xsl:value-of select="." /></xsl:when>
<xsl:otherwise>'<xsl:value-of select="." />'</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="vm:header-wrapper">
<?vsp
BLOG.DBA.template_header_render (self);
?>
</xsl:template>
<xsl:template match="vm:body-wrapper">
<?vsp
BLOG.DBA.template_body_render (self);
?>
</xsl:template>
<xsl:template match="vm:atom-version">
<?V self.atomver ?>
</xsl:template>
<xsl:template match="vm:rss-version">
<?V self.rssver ?>
</xsl:template>
<xsl:template match="vm:erdf-data">
<link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
<xsl:text> </xsl:text>
<link rel="schema.foaf" href="http://xmlns.com/foaf/0.1/" />
<xsl:text> </xsl:text>
<link rel="schema.rss" href="http://purl.org/rss/1.0/" />
<xsl:text> </xsl:text>
<link rel="schema.geo" href="http://www.w3.org/2003/01/geo/wgs84_pos#" />
<xsl:text> </xsl:text>
<link rel="schema.rdfs" href="http://www.w3.org/2000/01/rdf-schema#" />
<xsl:text> </xsl:text>
<meta name="dc.creator" content="<?V BLOG..blog_utf2wide (self.e_author) ?>" />
<xsl:text> </xsl:text>
<meta name="dc.title" content="<?V BLOG..blog_utf2wide (self.e_title) ?>" />
<xsl:text> </xsl:text>
<meta name="dc.rights" content="<?V BLOG..blog_utf2wide (self.copy) ?>" />
<xsl:text> </xsl:text>
<?vsp
if (self.e_lat is not null and self.e_lng is not null) {
?>
<meta name="geo.position" content="<?V sprintf ('%.06f', self.e_lat) ?>;<?V sprintf ('%.06f', self.e_lng) ?>" />
<xsl:text> </xsl:text>
<meta name="ICBM" content="<?V sprintf ('%.06f', self.e_lat) ?>, <?V sprintf ('%.06f', self.e_lng) ?>" />
<xsl:text> </xsl:text>
<?vsp } ?>
</xsl:template>
<xsl:template match="vm:attr">
<xsl:attribute name="{@name}">
<xsl:choose>
<xsl:when test="@value = 'permalink-iri'"><![CDATA[<?V concat(self.blog_iri, '/', t_post_id) ?>]]></xsl:when>
<xsl:when test="@value = 'blog-iri'"><![CDATA[<?V self.blog_iri ?>]]></xsl:when>
</xsl:choose>
</xsl:attribute>
</xsl:template>
<xsl:template match="vm:external-link">
<xsl:attribute name="{@name}">
<xsl:choose>
<xsl:when test="@value = 'permalink-iri'"><xsl:value-of select="@url"/><![CDATA[<?U concat(self.blog_iri, '/', t_post_id) ?>]]></xsl:when>
<xsl:when test="@value = 'blog-iri'"><xsl:value-of select="@url"/><![CDATA[<?U self.blog_iri ?>]]></xsl:when>
</xsl:choose>
</xsl:attribute>
</xsl:template>
<xsl:template match="vm:post-uri"><![CDATA[<?vsp http (concat(self.blog_iri, '/', t_post_id)); ?>]]></xsl:template>
<xsl:template match="vm:keep-variable"/>
<xsl:template match="vm:*">
Unknown Weblog component "<xsl:value-of select="local-name()" />"
</xsl:template>
</xsl:stylesheet>
|