verbalbrew /wordpress/wp-content/plugins/podpress/podpress_admin_class.php

Language PHP Lines 1894
MD5 Hash 810b719e166281858d41ab21b423f9da
Repository https://github.com/bill742/verbalbrew.git View Raw File
   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
<?php
/*
License:
 ==============================================================================

    Copyright 2006  Dan Kuykendall  (email : dan@kuykendall.org)

    This program 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; either version 2 of the License, or
    (at your option) any later version.

    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., 59 Temple Place, Suite 330, Boston, MA  02111-107  USA
*/
	class podPressAdmin_class extends podPress_class
	{
		function podPressAdmin_class() {
			parent::cleanup_itunes_keywords();
			$this->podPress_class();
			return;
		}

		/*************************************************************/
		/* Functions for editing and saving posts                    */
		/*************************************************************/

		function page_form() {
			return $this->post_form('page');
		}

		function post_form($entryType = 'post') {
		
			if(!is_object($GLOBALS['post']) && isset($GLOBALS['post_cache'][$GLOBALS['post']])) {
				$post = $GLOBALS['post_cache'][$GLOBALS['post']];
			} else {
				$post = $GLOBALS['post'];
			}

			$post = $this->addPostData($post, true);
			
			if(($_GET['action'] == 'edit')) {
				$post_id = $_GET['post'];

				if(!is_array($post->podPressMedia)) {
					$post->podPressMedia = array();
				}
			}

			$files = array();
			$mediaFilePath = stripslashes($this->settings['mediaFilePath']);
			if(@is_dir($mediaFilePath)) {
				$dh  = opendir($mediaFilePath);
				while (false !== ($filename = readdir($dh))) {
					if($filename != '.' && $filename != '..' && !is_dir($mediaFilePath.'/'.$filename) && !in_array(podPress_getFileExt($filename), array('php', 'html'))) {
						$files[] = $filename;
					}
				}
				natcasesort($files);
			}

			if($this->settings['enablePodangoIntegration']) {
				if(!empty($post->podPressPostSpecific['PodangoEpisodeID'])) {
					if(empty($post->podPressPostSpecific['PodangoMediaFileID'])) {
						$x = $this->podangoapi->GetEpisode($post->podPressPostSpecific['PodangoEpisodeID']);
						$post->podPressPostSpecific['PodangoMediaFileID'] = $x['MediaFileId'];
						unset($x);
					}
					$podangoMediaFiles = $this->podangoapi->GetMediaFile($post->podPressPostSpecific['PodangoMediaFileID']);
				} else {
					$podangoMediaFiles = $this->podangoapi->GetMediaFiles();
				}
			}

			//echo '<script type="text/javascript" src="'.podPress_url().'js/podpress_admin_postedit.js"></script>'."\n";
			echo '<script type="text/javascript">'."\n";
			echo "var podPressMaxMediaFiles = ".$this->settings['maxMediaFiles'].";\n";
			$newMediaDefaults = array();
			echo "var newMediaDefaults = new Array();\n";
			$newMediaDefaults['URI'] = '';
			echo "newMediaDefaults['URI'] = '".$newMediaDefaults['URI']."';\n";
			$newMediaDefaults['title'] = '';
			echo "newMediaDefaults['title'] = '".$newMediaDefaults['title']."';\n";
			$newMediaDefaults['type'] = 'audio_mp3';
			echo "newMediaDefaults['type'] = '".$newMediaDefaults['type']."';\n";
			$newMediaDefaults['size'] = '';
			echo "newMediaDefaults['size'] = '".$newMediaDefaults['size']."';\n";
			$newMediaDefaults['duration'] = '';
			echo "newMediaDefaults['duration'] = '".$newMediaDefaults['duration']."';\n";
			$newMediaDefaults['dimensionW'] = '320';
			echo "newMediaDefaults['dimensionW'] = '".$newMediaDefaults['dimensionW']."';\n";
			$newMediaDefaults['dimensionH'] = '240';
			echo "newMediaDefaults['dimensionH'] = '".$newMediaDefaults['dimensionH']."';\n";
			$newMediaDefaults['previewImage'] = podPress_url().'images/vpreview_center.png';
			echo "newMediaDefaults['previewImage'] = '".$newMediaDefaults['previewImage']."';\n";
			$newMediaDefaults['rss'] = 'false';
			echo "newMediaDefaults['rss'] = ".$newMediaDefaults['rss'].";\n";
			$newMediaDefaults['atom'] = 'true';
			echo "newMediaDefaults['atom'] = ".$newMediaDefaults['atom'].";\n";
			$newMediaDefaults['feedonly'] = 'true';
			echo "newMediaDefaults['feedonly'] = ".$newMediaDefaults['feedonly'].";\n";
			$newMediaDefaults['disablePlayer'] = 'false';
			echo "newMediaDefaults['disablePlayer'] = ".$newMediaDefaults['disablePlayer'].";\n";
			$newMediaDefaults['disablePreview'] = 'false';
			echo "newMediaDefaults['disablePreview'] = ".$newMediaDefaults['disablePreview'].";\n";
			$newMediaDefaults['content_level'] = 'free';
			echo "newMediaDefaults['content_level'] = '".$newMediaDefaults['content_level']."';\n";
			$newMediaDefaults['showme'] = 'false';
			echo "newMediaDefaults['showme'] = ".$newMediaDefaults['showme'].";\n";

			if(empty($post->podPressMedia)) {
				$num = 0;
			} else {
				$num = count($post->podPressMedia);
			}

			while ($num < $this->settings['maxMediaFiles']) {
				$post->podPressMedia[$num] = $newMediaDefaults;
				$num++;
			}

			$num = 0;
			while ($num < $this->settings['maxMediaFiles']) {
				if(!isset($post->podPressMedia[$num]['showme'])) {
					$post->podPressMedia[$num]['showme'] = 'true';
				}
				if($post->podPressMedia[$num]['showme'] == 'false') {
					$num++;
					continue;
				}

				if($this->settings['enablePodangoIntegration']) {
					if($podangoMediaFiles[$post->podPressPostSpecific['PodangoMediaFileID']]['Filename'] == basename($post->podPressMedia[$num]['URI'])) {
						$post->podPressMedia[$num]['URI'] = 'Podango:'.$podangoMediaFiles[$post->podPressPostSpecific['PodangoMediaFileID']]['Podcast'].':'.$podangoMediaFiles[$post->podPressPostSpecific['PodangoMediaFileID']]['ID'].':'.$podangoMediaFiles[$post->podPressPostSpecific['PodangoMediaFileID']]['EpisodeID'].':'.$podangoMediaFiles[$post->podPressPostSpecific['PodangoMediaFileID']]['Filename'];
					}
				}

				if($post->podPressMedia[$num]['rss'] == 'on') {
					$post->podPressMedia[$num]['rss'] = 'true';
				} else {
					$post->podPressMedia[$num]['rss'] = 'false';
				}
				if($post->podPressMedia[$num]['atom'] == 'on') {
					$post->podPressMedia[$num]['atom'] = 'true';
				} else {
					$post->podPressMedia[$num]['atom'] = 'false';
				}
				if($post->podPressMedia[$num]['feedonly'] == 'on') {
					$post->podPressMedia[$num]['feedonly'] = 'true';
				} else {
					$post->podPressMedia[$num]['feedonly'] = 'false';
				}
				if(!isset($post->podPressMedia[$num]['disablePlayer']) || $post->podPressMedia[$num]['disablePlayer'] == false || $post->podPressMedia[$num]['disablePlayer'] == 'false') {
					$post->podPressMedia[$num]['disablePlayer'] = 'false';
				} else {
					$post->podPressMedia[$num]['disablePlayer'] = 'true';
				}

				if(!isset($post->podPressMedia[$num]['disablePreview']) || $post->podPressMedia[$num]['disablePreview'] == false || $post->podPressMedia[$num]['disablePreview'] == 'false') {
					$post->podPressMedia[$num]['disablePreview'] = 'false';
				} else {
					$post->podPressMedia[$num]['disablePreview'] = 'true';
				}

				if($post->podPressMedia[$num]['premium_only'] == 'on' || $post->podPressMedia[$num]['premium_only'] == true) {
					$post->podPressMedia[$num]['content_level'] = 'premium_content';
				}
				if(!isset($post->podPressMedia[$num]['content_level'])) {
					$post->podPressMedia[$num]['content_level'] = 'free';
				}
				echo "\n";
				echo "podPressAddMediaFile(".$post->podPressMedia[$num]['showme'].", '".js_escape($post->podPressMedia[$num]['URI'])."', '".js_escape($post->podPressMedia[$num]['URI_torrent'])."', '".js_escape($post->podPressMedia[$num]['title'])."', '".$post->podPressMedia[$num]['type']."', '".$post->podPressMedia[$num]['size']."', '".$post->podPressMedia[$num]['duration']."', '".$post->podPressMedia[$num]['dimensionW']."', '".$post->podPressMedia[$num]['dimensionH']."', '".$post->podPressMedia[$num]['previewImage']."', ".$post->podPressMedia[$num]['rss'].", ".$post->podPressMedia[$num]['atom'].", ".$post->podPressMedia[$num]['feedonly'].", ".$post->podPressMedia[$num]['disablePlayer'].", '".$post->podPressMedia[$num]['content_level']."');\n";
				$num++;
			}
			echo '</script>'."\n";

			echo '<input type="hidden" id="podPressMedia_defaultpreviewImage" value="'.PODPRESS_URL.'/images/vpreview_center.png" />'."\n";
			// NONCE_KEY has been introduced in WP 2.7 the first time
			echo '<input type="hidden" id="podPress_AJAX_sec" value="' . wp_create_nonce('Af|F07*wC7g-+OX$;|Z5;R@Pi]ZgoU|Zex8=`?mO-Mdvu+WC6l=6<O^2d~+~U3MM') . '" />'."\n";

			echo '<div id="podPressstuff" class="dbx-group">'."\n";
			echo '	<fieldset id="podpresscontent" class="dbx-box">'."\n";
			if ( 'page' == $entryType ) {
				echo '		<h3 class="dbx-handle">'.__('podPress - podcasting settings of this page', 'podpress').'</h3> '."\n";
			} else {
				echo '		<h3 class="dbx-handle">'.__('podPress - podcasting settings of this post', 'podpress').'</h3> '."\n";
			}
			
			echo '		<div class="dbx-content" id="podPress_mediaFileList">'."\n";
			echo '			<strong>'.__('Podcasting Files:', 'podpress').'</strong><br/>'."\n";
			
			// debug start
			$num = 0;
			while ($num < $this->settings['maxMediaFiles']) {
				if(!isset($post->podPressMedia[$num])) {
					$num++;
					continue;
				}
				$thisMedia = $post->podPressMedia[$num];
				if($thisMedia['showme'] == 'true') {
					$display_text = 'block';
				}	else {
					$display_text = 'none';
				}
				
				echo '     	<div id="podPressMediaFileContainer_'.$num.'" class="wrap" style="visibility: visible; display: '.$display_text.';">'."\n";

				echo '				<table border="0" style="width: 100%;"><tr><td style="border-right-style: none; text-align: left;"><label><strong>'.__('Media File:', 'podpress').'</strong> </label></td>';
				echo '				<td style="border-left-style: none; text-align: right;">';
				echo '						<input type="button" value="'.__('Move Up', 'podpress').'" onclick="podPressMoveFile('.$num.', \'up\'); podPressDisplayMediaFiles();"/>'."\n";
				echo '						<input type="button" value="'.__('Move Down', 'podpress').'" onclick="podPressMoveFile('.$num.', \'down\'); podPressDisplayMediaFiles();"/>'."\n";
				echo '						<input type="button" name="podPressAddAnother" value="'.__('Remove File', 'podpress').'" onclick="podPressRemoveFile('.$num.'); podPressDisplayMediaFiles();"/>';
				echo '				</td></tr></table>'."\n";
				echo '				<table border="0">'."\n";
				echo '					<tr>'."\n";
				echo '						<td>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_URI">'.__('Location', 'podpress').': </label>'."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				if(!empty($files) || $this->settings['enablePodangoIntegration']) {
					$fileOptionList = '';
					echo '						<select name="podPressMedia['.$num.'][URI]" id="podPressMedia_'.$num.'_URI" width="35" onchange="javascript: if(this.value==\'!\') { podPress_customSelectVal(this, \'Specifiy URL.\'); } podPressMediaFiles['.$num.'][\'URI\'] = this.value; podPressDetectType('.$num.');">'."\n";
					echo '							<option value="!">'.__('Specify URL ...', 'podpress').'</option>'."\n";
					$fileSelected = false;
					if($this->settings['enablePodangoIntegration']) {
						$podangoOptGroup = '';
						$podangoFirstOptGroup = true;
						foreach($podangoMediaFiles as $podangoMediaFile) {
							if(!empty($podangoMediaFile['EpisodeID']) && $podangoMediaFile['EpisodeID'] != $post->podPressPostSpecific['PodangoEpisodeID'] && $post->post_title != $podangoMediaFile['EpisodeTitle']) {
								continue;
							}
							if($podangoOptGroup != $podangoMediaFile['Podcast']) {
								$podangoOptGroup = $podangoMediaFile['Podcast'];
								if(!$podangoFirstOptGroup) {
									echo "							</optgroup>\n";
								}
								$x = $this->podangoapi->GetPodcast($podangoMediaFile['Podcast'], true);
								echo '							<optgroup name="PodangoOptGroup'.$podangoMediaFile['Podcast'].'" label="Podango Podcast: '.$x['Title'].'">'."\n";
								unset($x);
							}
							$key = 'Podango:'.$podangoMediaFile['Podcast'].':'.$podangoMediaFile['ID'].':'.$podangoMediaFile['EpisodeID'].':'.$podangoMediaFile['Filename'];
							if($key == $thisMedia['URI']) {
								$xSelected = ' selected="selected"';
								$fileSelected = true;
							} else {
								$xSelected = '';
							}
							echo '								<option value="'.$key.'"'.$xSelected.'>'.$podangoMediaFile['Filename'].'</option>'."\n";
						}
						echo "							</optgroup>\n";
						echo '							<optgroup name="LocallyHosted" label="Locally Hosted">'."\n";

					}
					foreach ($files as $key=>$val) {
						if(is_numeric($key)) {
							$key = $val;
						}
						if($key == $thisMedia['URI']) {
							$xSelected = ' selected="selected"';
							$fileSelected = true;
						} else {
							$xSelected = '';
						}
						if ( TRUE == version_compare(PHP_VERSION, '5.0', '<') ) { // html_entity_decode can not handle the charset UTF-8 in most of the PHP 4 version
							$fileOptionList .= '							<option value="'.attribute_escape(htmlentities($key)).'"'.$xSelected.'>'.htmlentities(podPress_stringLimiter($val, 100, true)).'</option>'."\n";
						} else {
							if ( FALSE === stristr(PHP_OS, 'WIN') ) { 
								$fileOptionList .= '							<option value="'.attribute_escape(htmlentities($key, ENT_COMPAT, $blog_charset)).'"'.$xSelected.'>'.htmlentities(podPress_stringLimiter($val, 100, true), ENT_COMPAT, $blog_charset).'</option>'."\n";
							} else {
								$fileOptionList .= '							<option value="'.attribute_escape(htmlentities($key)).'"'.$xSelected.'>'.htmlentities(podPress_stringLimiter($val, 100, true)).'</option>'."\n";
							}
						}
					}
					if ( !$fileSelected ) {
						if ( TRUE == version_compare(PHP_VERSION, '5.0', '<') ) { // html_entity_decode can not handle the charset UTF-8 in most of the PHP 4 version
							echo '							<option value="'.attribute_escape(htmlentities($thisMedia['URI'])).'" selected="selected">'.htmlentities(podPress_stringLimiter($thisMedia['URI'], 100, true)).'</option>'."\n";
						} else {
							if ( FALSE === stristr(PHP_OS, 'WIN') ) { 
								echo '							<option value="'.attribute_escape(htmlentities($thisMedia['URI']), ENT_COMPAT, $blog_charset).'" selected="selected">'.htmlentities(podPress_stringLimiter($thisMedia['URI'], 100, true), ENT_COMPAT, $blog_charset).'</option>'."\n";
							} else {
								echo '							<option value="'.attribute_escape($thisMedia['URI']).'" selected="selected">'.htmlentities(podPress_stringLimiter($thisMedia['URI'], 100, true), ENT_COMPAT, $blog_charset).'</option>'."\n";
							}
						}
					}
					echo $fileOptionList;
					unset($fileOptionList);
					if($this->settings['enablePodangoIntegration']) {
						echo "							</optgroup>\n";
					}

					echo '						</select>'."\n";
					echo '							<input type="hidden" id="podPressMedia_'.$num.'_cleanURI" value="no" />'."\n";
				} else {
					echo '							<input type="text" id="podPressMedia_'.$num.'_URI" name="podPressMedia['.$num.'][URI]" size="40" value="'.attribute_escape($thisMedia['URI']).'" onchange="javascript: podPressMediaFiles['.$num.'][\'URI\'] = this.value; podPressDetectType('.$num.');" />'."\n";
					echo '							<span id="podPressMedia_'.$num.'_URI_chrWarning" class="podpress_notice podPressMedia_URI_chrWarning"> '.sprintf(__('<strong>Notice:</strong> It is not recommended to use other than these characters: %1$s or whitespaces in file and folder names.', 'podpress'), 'abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 .:/_-\ ').'</span>'."\n";
					echo '							<input type="hidden" id="podPressMedia_'.$num.'_cleanURI" value="yes" />'."\n";
				}
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				if($this->settings['enableTorrentCasting']) {
					echo '					<tr>'."\n";
					echo '						<td>'."\n";
					echo '							<label for="podPressMedia_'.$num.'_URItorrent">'.__('.torrent Location', 'podpress').'</label>: '."\n";
					echo '						</td>'."\n";
					echo '						<td>'."\n";
					echo '							<input type="text" id="podPressMedia_'.$num.'_URItorrent" name="podPressMedia['.$num.'][URI_torrent]" size="40" value="'.attribute_escape($thisMedia['URI_torrent']).'" onchange="javascript: podPressMediaFiles['.$num.'][\'URI_torrent\'] = this.value;" />'."\n";
					echo '						</td>'."\n";
					echo '					</tr>'."\n";
				}
				echo '					<tr>'."\n";
				echo '						<td>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_title">'.__('Title', 'podpress').'</label>: '."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="text" id="podPressMedia_'.$num.'_title" name="podPressMedia['.$num.'][title]" size="40" value="'.attribute_escape($thisMedia['title']).'" onchange="javascript: podPressMediaFiles['.$num.'][\'title\'] = this.value;" />'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr>'."\n";
				echo '						<td>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_type">'.__('Type', 'podpress').'</label>: '."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="podPressMedia_'.$num.'_type" name="podPressMedia['.$num.'][type]" onchange="javascript: podPressMediaFiles['.$num.'][\'type\'] = this.value; podPressAdjustMediaFieldsBasedOnType('.$num.');" >'."\n"; podPress_mediaOptions();	echo '</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="podPressMediaSizeWrapper_'.$num.'" >'."\n";
				echo '						<td>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_size">'.__('File Size', 'podpress').'</label>: '."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="text" id="podPressMedia_'.$num.'_size" name="podPressMedia['.$num.'][size]" size="10" value="'.$thisMedia['size'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'size\'] = this.value;"/> '.__('[in byte]', 'podpress').' <img src="'.PODPRESS_URL.'/images/ajax-loader.gif" id="podPressMedia_'.$num.'_size_loadimg" class="podpress_ajax_loader_img" /><input type="button" id="podPressMedia_'.$num.'_size_detectbutton" value="'.__('Auto Detect', 'podpress').'" onclick="podPress_getfileinfo(\'size\', '.$num.');"/>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="podPressMediaDurationWrapper_'.$num.'" style="display: none;">'."\n";
				echo '						<td>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_duration">'.__('Duration', 'podpress').'</label>: '."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="text" id="podPressMedia_'.$num.'_duration" name="podPressMedia['.$num.'][duration]" size="10" value="'.$thisMedia['duration'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'duration\'] = this.value;"/> <span class="podpress_abbr" title="'.__('hours:minutes:seconds - for example: 2:45:10 or 34:01 or 1:36 or 120:47 or 0:10', 'podpress').'">'.__('[hh:mm:ss]', 'podpress').'</span> <img src="'.PODPRESS_URL.'/images/ajax-loader.gif" id="podPressMedia_'.$num.'_duration_loadimg" class="podpress_ajax_loader_img" /><input type="button" id="podPressMedia_'.$num.'_duration_detectbutton" value="'.__('Auto Detect', 'podpress').'" onclick="podPress_getfileinfo(\'duration\', '.$num.');"/> ('.sprintf(__('This may take some time for remote files. %1$s', 'podpress'), '<span class="podpress_abbr" title="'.__('If the file is not on the same server as your blog then podPress will attempt to download the file in order to get this information with the help of getID3() which is only able to retrieve ID3 tags from local files. podPress removes the temporary download file at the end of this process. It is likely that this feature works only for relative small files because the download is probably limited by execution time and memory limits on the server of your blog.', 'podpress').'">'.__('Because ...', 'podpress').'</span>').')'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				if(empty($thisMedia['previewImage'])) {
					$thisMedia['previewImage'] = podPress_url().'images/vpreview_center.png';
				}
				echo '					<tr id="podPressMediaPreviewImageWrapper_'.$num.'" style="display: none;">'."\n";
				echo '						<td>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_previewImage">'.__('Preview Image URL', 'podpress').'</label>: '."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="text" id="podPressMedia_'.$num.'_previewImage" name="podPressMedia['.$num.'][previewImage]" size="40" value="'.attribute_escape($thisMedia['previewImage']).'" onchange="javascript: podPressPreviewImageOnChange('.$num.', this.value);" />'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="podPressMediaPreviewImageDisplayWrapper_'.$num.'" style="display: none;">'."\n";
				echo '						<td>'."\n";
				echo '							'.__('Preview Image', 'podpress').': '."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<div id="podPressPlayerSpace_'.$num.'"></div>'."\n";
				echo '<script type="text/javascript"><!--'."\n";
				echo "	document.getElementById('podPressPlayerSpace_".$num."').innerHTML = podPressGenerateVideoPreview (".$num.", '', ".$thisMedia['dimensionW'].", ".$thisMedia['dimensionH'].", document.getElementById('podPressMedia_".$num."_previewImage').value, true);\n";
				echo "--></script>\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";

				echo '					<tr id="podPressMediaDimensionWrapper_'.$num.'">'."\n";
				echo '						<td>'."\n";
				echo '							'.__('Dimensions', 'podpress').' (WxH): '."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="text" id="podPressMedia_'.$num.'_dimensionW" name="podPressMedia['.$num.'][dimensionW]" size="5" value="'.$thisMedia['dimensionW'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionW\'] = this.value; podPressUpdateDimensionList(\''.$num.'\');" />x<input type="text" id="podPressMedia_'.$num.'_dimensionH" name="podPressMedia['.$num.'][dimensionH]" size="5" value="'.$thisMedia['dimensionH'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionH\'] = this.value; podPressUpdateDimensionList(\''.$num.'\')" /> '."\n";
				echo '							<select id="podPressMedia_'.$num.'_dimensionList" onchange="javascript: podPressUpdateDimensions(\''.$num.'\', this.value);">'."\n"; podPress_videoDimensionOptions($thisMedia['dimensionW'].':'.$thisMedia['dimensionH']);	echo '</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";

				if($post->post_status == 'static') {
					echo '					<tr style="display: none;">'."\n";
				} else {
					echo '					<tr>'."\n";
				}
				echo '						<td nowrap="nowrap">'."\n";
				echo '							'.__('Included in', 'podpress').': '."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							&nbsp;<label for="podPressMedia_'.$num.'_rss">'.__('RSS2', 'podpress').'</label> <input type="checkbox" id="podPressMedia_'.$num.'_rss" name="podPressMedia['.$num.'][rss]" onchange="javascript: podPressMediaFiles['.$num.'][\'rss\'] = this.checked; podPressSetSingleRSS('.$num.');" />'."\n";
				echo '							&nbsp;<label for="podPressMedia_'.$num.'_atom">'.__('ATOM', 'podpress').'</label> <input type="checkbox" id="podPressMedia_'.$num.'_atom" name="podPressMedia['.$num.'][atom]" onchange="javascript: podPressMediaFiles['.$num.'][\'atom\'] = this.checked;" />'."\n";
				echo '							&nbsp;<label for="podPressMedia_'.$num.'_feedonly">'.__('Feed Only', 'podpress').'</label> <input type="checkbox" id="podPressMedia_'.$num.'_feedonly" name="podPressMedia['.$num.'][feedonly]" onchange="javascript: podPressMediaFiles['.$num.'][\'feedonly\'] = this.checked;" />'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				if($this->settings['enablePremiumContent']) {
					echo '					<tr>'."\n";
					echo '						<td nowrap="nowrap">'."\n";
					echo '							<label for="podPressMedia_'.$num.'_content_level">'.__('Subscription', 'podpress').'</label>:';
					echo '						</td>'."\n";
					echo '						<td>'."\n";
					echo '							<select id="podPressMedia_'.$num.'_content_level" name="podPressMedia['.$num.'][content_level]" onchange="javascript: podPressMediaFiles['.$num.'][\'content_level\'] = this.value;">'."\n";
					echo '								<option value="free" '; if(empty($thisMedia['content_level']) || $thisMedia['content_level'] == 'free') { echo 'selected="selected"';	}	echo '>'.__('Free', 'podpress').'</option>'."\n";
					foreach (podPress_getCapList(true) as $cap) {
						if(substr($cap, -8, 8) == '_content') {
							echo '								<option value="'.$cap.'" '; if($thisMedia['content_level'] == $cap) { echo 'selected="selected"';	}	echo '>'.__(podPress_getCapName($cap), 'podpress').'</option>'."\n";
						}
					}
					echo '							</select>'."\n";
					echo '						</td>'."\n";
					echo '					</tr>'."\n";
				}
				echo '					<tr>'."\n";
				echo '						<td nowrap="nowrap">'."\n";
				echo '							<label for="podPressMedia_'.$num.'_disablePlayer">'.__('Disable Player', 'podpress').'</label>:'."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="checkbox" id="podPressMedia_'.$num.'_disablePlayer" name="podPressMedia['.$num.'][disablePlayer]"'; if($thisMedia['disablePlayer'] != 'false') { echo 'checked="checked" '; } echo ' onchange="javascript: podPressMediaFiles['.$num.'][\'disablePlayer\'] = this.checked;" />'."\n";
				echo '							&nbsp;&nbsp; '.__('(Use if this media file is not compatible with one of the included players.)', 'podpress')."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr>'."\n";
				echo '						<td nowrap="nowrap">'."\n";
				echo '							<label for="podPressMedia_'.$num.'_disablePreview">'.__('Disable Preview Player', 'podpress').'</label>:'."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="checkbox" id="podPressMedia_'.$num.'_disablePreview" name="podPressMedia['.$num.'][disablePreview]"'; if($thisMedia['disablePreview'] != 'false') { echo 'checked="checked" '; } echo ' onchange="javascript: podPressMediaFiles['.$num.'][\'disablePreview\'] = this.checked;" />'."\n";
				echo '							&nbsp;&nbsp; '.__('(Use this to disable the "Click to Play" preview player.)', 'podpress')."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				$actionMedia = $thisMedia;
				$actionMedia['num'] = $num;
				do_action('podPress_customMediaData', array($actionMedia));
				echo '					<tr id="podPressMedia_'.$num.'_id3tags_details_row">'."\n";
				echo '						<td style="vertical-align: top;" nowrap="nowrap">'."\n";
				echo '							'.__('Tag (ID3) Info', 'podpress').":\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<img src="'.PODPRESS_URL.'/images/ajax-loader.gif" id="podPressMedia_'.$num.'_id3tags_loadimg" class="podpress_ajax_loader_img" /><input type="button" id="podPressMedia_'.$num.'_id3tags_detectbutton" value="'.__('Show','podpress').'" onclick="javascript: podPressShowHideID3Tags('.$num.');" /> ('.sprintf(__('This may take some time for remote files. %1$s', 'podpress'), '<span class="podpress_abbr" title="'.__('If the file is not on the same server as your blog then podPress will attempt to download the file in order to get this information with the help of getID3() which is only able to retrieve ID3 tags from local files. podPress removes the temporary download file at the end of this process. It is likely that this feature works only for relative small files because the download is probably limited by execution time and memory limits on the server of your blog.', 'podpress').'">'.__('Because ...', 'podpress').'</span>').')'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr>'."\n";
				echo '						<td colspan="2">'."\n";
				echo '							<div id="podPressMedia_'.$num.'_id3tags" style="display: none; vertical-align: top;">'."\n";
				echo '							</div>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '				</table>'."\n";
				
				echo '			</div>'."\n";

				$num++;
			}


			echo '	<h3>'.sprintf(__('To control player location in your post, you may put %1$s where you want it to appear. You can choose the default postion on the general settings page of podPress.', 'podpress'), $this->podcasttag).'</h3> '."\n";
			echo '			<input type="button" name="podPressAddAnother" value="'.__('Add Media File','podpress').'" onclick="javascript: podPressAddMediaFile(true, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'new\', true, false, false, \'free\'); podPressDisplayMediaFiles();"/>'."\n";
			if($entryType != 'page') {
				echo '			<br/>'."\n";
				echo '			<strong>'.__('Post specific settings for iTunes', 'podpress').': </strong>'."\n";
				echo '			<input type="button" name="iTunesSpecificSettings_button" id="iTunesSpecificSettings_button" value="Show" onclick="javascript: podPressShowHideDiv(\'iTunesSpecificSettings\');"/>'."\n";

				echo '     	<div class="wrap" id="iTunesSpecificSettings" style="display: none;">'."\n";
				echo '				<table border="0">'."\n";
				echo '					<tr>'."\n";
				echo '						<td width="1%" nowrap="nowrap">'."\n";
				echo '							<label for="iTunesSubtitleChoice">'.__('iTunes:Subtitle', 'podpress').'</label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'iTunesSubtitleHelp\');">(?)</a>:'."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="iTunesSubtitleChoice" name="iTunesSubtitleChoice" onchange="javascript: if(this.value == \'Custom\') { document.getElementById(\'iTunesSubtitleWrapper\').style.display=\'\'; } else { document.getElementById(\'iTunesSubtitleWrapper\').style.display=\'none\'; }">'."\n";
				echo '								<option value="PostExcerpt" '; if($post->podPressPostSpecific['itunes:subtitle'] == '##PostExcerpt##') { echo 'selected="selected"';	}	echo '>'.__('Use the excerpt', 'podpress').'</option>'."\n";
				echo '								<option value="Custom" '; if($post->podPressPostSpecific['itunes:subtitle'] != '##PostExcerpt##') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
				echo '							</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="iTunesSubtitleHelp" style="display: none;">'."\n";
				echo '						<td colspan="2">'.sprintf(__('"%1$s" (default) podPress takes the first 255 characters from the excerpt of the excerpt and if there is none from the blog Post text.', 'podpress'),__('Use the excerpt', 'podpress')).'</td>'."\n";
				echo '					</tr>'."\n";
				if($post->podPressPostSpecific['itunes:subtitle'] == '##PostExcerpt##') { $tempShowMe = 'style="display: none;"';$post->podPressPostSpecific['itunes:subtitle'] = ''; } else { $tempShowMe = ''; }
				echo '					<tr id="iTunesSubtitleWrapper" '.$tempShowMe.'>'."\n";
				echo '						<td width="1%" nowrap="nowrap">&nbsp;</td>'."\n";
				echo '						<td>'."\n";
				echo '							<textarea name="iTunesSubtitle" rows="4" cols="40">'.stripslashes($post->podPressPostSpecific['itunes:subtitle']).'</textarea>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr>'."\n";
				echo '						<td width="1%" nowrap="nowrap">'."\n";
				echo '							<label for="iTunesSummaryChoice">'.__('iTunes:Summary', 'podpress').'</label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'iTunesSummaryHelp\');">(?)</a>:'."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="iTunesSummaryChoice" name="iTunesSummaryChoice" onchange="javascript: if(this.value == \'Custom\') { document.getElementById(\'iTunesSummaryWrapper\').style.display=\'\'; } else { document.getElementById(\'iTunesSummaryWrapper\').style.display=\'none\'; }">'."\n";
				echo '								<option value="PostExcerpt" '; if($post->podPressPostSpecific['itunes:summary'] == '##PostExcerpt##') { echo 'selected="selected"';	}	echo '>'.__('Use the excerpt', 'podpress').'</option>'."\n";
				echo '								<option value="PostContentShortened" '; if($post->podPressPostSpecific['itunes:summary'] == '##PostContentShortened##') { echo 'selected="selected"';	}	echo '>'.__('autom. excerpt of the post content', 'podpress').'</option>'."\n";
				echo '								<option value="Global" '; if($post->podPressPostSpecific['itunes:summary'] == '##Global##') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').'</option>'."\n";
				echo '								<option value="Custom" '; if($post->podPressPostSpecific['itunes:summary'] != '##Global##' && $post->podPressPostSpecific['itunes:summary'] != '##PostExcerpt##' && $post->podPressPostSpecific['itunes:summary'] != '##PostContentShortened##') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
				echo '							</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="iTunesSummaryHelp" style="display: none;">'."\n";
				echo '						<td colspan="2">'.sprintf(__('"%1$s" (default) podPress takes the excerpt. If you have not written an excerpt then it takes a part from the blog Post text.', 'podpress'),__('Use the excerpt', 'podpress')).'</td>'."\n";
				echo '					</tr>'."\n";
				if($post->podPressPostSpecific['itunes:summary'] == '##Global##' || $post->podPressPostSpecific['itunes:summary'] == '##PostExcerpt##' || $post->podPressPostSpecific['itunes:summary'] ==  '##PostContentShortened##') { $tempShowMe = 'style="display: none;"';	$post->podPressPostSpecific['itunes:summary'] = ''; } else { $tempShowMe = ''; }
				echo '					<tr id="iTunesSummaryWrapper" '.$tempShowMe.'>'."\n";
				echo '						<td width="1%" nowrap="nowrap">&nbsp;</td>'."\n";
				echo '						<td>'."\n";
				echo '							<textarea name="iTunesSummary" rows="4" cols="40">'.stripslashes($post->podPressPostSpecific['itunes:summary']).'</textarea>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";

				echo '					<tr>'."\n";
				echo '						<td width="1%" nowrap="nowrap">'."\n";
				echo '							<label for="iTunesKeywordsChoice">'.__('iTunes:Keywords', 'podpress').'</label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'iTunesKeywordsHelp\');">(?)</a>:'."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="iTunesKeywordsChoice" name="iTunesKeywordsChoice" onchange="javascript: if(this.value == \'Custom\') { document.getElementById(\'iTunesKeywordsWrapper\').style.display=\'\'; } else { document.getElementById(\'iTunesKeywordsWrapper\').style.display=\'none\'; }">'."\n";
				echo '								<option value="WordPressCats" '; if($post->podPressPostSpecific['itunes:keywords'] == '##WordPressCats##') { echo 'selected="selected"';	}	echo '>'.__('Use WordPress Categories', 'podpress').'</option>'."\n";
				echo '								<option value="post_tags" '; if($post->podPressPostSpecific['itunes:keywords'] == '##post_tags##') { echo 'selected="selected"';	}	echo '>'.__('Use the tags of the post', 'podpress').'</option>'."\n";
				echo '								<option value="Global" '; if($post->podPressPostSpecific['itunes:keywords'] == '##Global##') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.podPress_stringLimiter(stripslashes($this->settings['iTunes']['keywords']), 40) .')</option>'."\n";
				echo '								<option value="Custom" '; if($post->podPressPostSpecific['itunes:keywords'] != '##Global##' && $post->podPressPostSpecific['itunes:keywords'] != '##WordPressCats##' && $post->podPressPostSpecific['itunes:keywords'] != '##post_tags##') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
				echo '							</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="iTunesKeywordsHelp" style="display: none;">'."\n";
				echo '						<td colspan="2">'.__('Not visible in iTunes, but used for searches.', 'podpress').'</td>'."\n";
				echo '					</tr>'."\n";
				if($post->podPressPostSpecific['itunes:keywords'] == '##Global##' || $post->podPressPostSpecific['itunes:keywords'] == '##WordPressCats##' || $post->podPressPostSpecific['itunes:keywords'] == '##post_tags##') { $tempShowMe = 'style="display: none;"';	$post->podPressPostSpecific['itunes:keywords'] = ''; } else { $tempShowMe = ''; }
				echo '					<tr id="iTunesKeywordsWrapper" '.$tempShowMe.'>'."\n";
				echo '						<td width="1%" nowrap="nowrap">&nbsp;</td>'."\n";
				echo '						<td>'."\n";
				echo '							'.__('a list of max. 12 comma separated words', 'podpress').'<br/><textarea name="iTunesKeywords" rows="4" cols="40">'.stripslashes($post->podPressPostSpecific['itunes:keywords']).'</textarea>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";

				echo '					<tr>'."\n";
				echo '						<td width="1%" nowrap="nowrap">'."\n";
				echo '							<label for="iTunesAuthorChoice">'.__('iTunes:Author', 'podpress').'</label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'iTunesAuthorHelp\');">(?)</a>:'."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="iTunesAuthorChoice" name="iTunesAuthorChoice" onchange="javascript: if(this.value == \'Custom\') { document.getElementById(\'iTunesAuthorWrapper\').style.display=\'\'; } else { document.getElementById(\'iTunesAuthorWrapper\').style.display=\'none\'; }">'."\n";
				echo '								<option value="Global" '; if($post->podPressPostSpecific['itunes:author'] == '##Global##') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.podPress_stringLimiter(ucfirst(stripslashes($this->settings['iTunes']['author'])), 40).')</option>'."\n";
				echo '								<option value="Custom" '; if($post->podPressPostSpecific['itunes:author'] != '##Global##') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
				echo '							</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";

				echo '					<tr id="iTunesAuthorHelp" style="display: none;">'."\n";
				echo '						<td colspan="2">'.__('Used if this Author is different than the feeds author.', 'podpress').'</td>'."\n";
				echo '					</tr>'."\n";
				if($post->podPressPostSpecific['itunes:author'] == '##Global##') { $tempShowMe = 'style="display: none;"';	$post->podPressPostSpecific['itunes:author'] = ''; } else { $tempShowMe = ''; }
				echo '					<tr id="iTunesAuthorWrapper" '.$tempShowMe.'>'."\n";
				echo '						<td width="1%" nowrap="nowrap">&nbsp;</td>'."\n";
				echo '						<td><input type="text" name="iTunesAuthor" size="40" value="'.attribute_escape($post->podPressPostSpecific['itunes:author']).'" /></td>'."\n";
				echo '					</tr>'."\n";

				echo '					<tr>'."\n";
				echo '						<td width="1%" nowrap="nowrap">'."\n";
				echo '							<label for="iTunesExplicit">'.__('iTunes:Explicit', 'podpress').'</label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'iTunesExplicitHelp\');">(?)</a>:'."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="iTunesExplicit" name="iTunesExplicit">'."\n";
				echo '								<option value="Default" '; if($post->podPressPostSpecific['itunes:explicit'] == 'Default') { echo 'selected="selected"';	}	echo '>'.__('Use Default', 'podpress').' ('.$this->settings['iTunes']['explicit'].')</option>'."\n";
				echo '								<option value="No" '; if($post->podPressPostSpecific['itunes:explicit'] == 'No') { echo 'selected="selected"';	}	echo '>'.__('No', 'podpress').'</option>'."\n";
				echo '								<option value="Yes" '; if($post->podPressPostSpecific['itunes:explicit'] == 'Yes') { echo 'selected="selected"';	}	echo '>'.__('Yes', 'podpress').'</option>'."\n";
				echo '								<option value="Clean" '; if($post->podPressPostSpecific['itunes:explicit'] == 'Clean') { echo 'selected="selected"';	}	echo '>'.__('Clean', 'podpress').'</option>'."\n";
				echo '							</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="iTunesExplicitHelp" style="display: none;">'."\n";
				echo '						<td colspan="2">'.__('Does your podcast contain explicit language or content which is not suitable for non-adult persons? (If you choose "Yes" or "Clean" then a corresponding notice will show up in iTunes (Explicit resp. Clean). If you choose "No" then there will be special notice.)', 'podpress').'</td>'."\n";
				echo '					</tr>'."\n";

				echo '					<tr>'."\n";
				echo '						<td width="1%" nowrap="nowrap">'."\n";
				echo '							<label for="iTunesBlock">'.__('iTunes:Block', 'podpress').'</label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'itunesBlockHelp\');">(?)</a>:'."\n";
				echo '						</td>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="iTunesBlock" name="iTunesBlock">'."\n";
				echo '								<option value="Default" '; if($post->podPressPostSpecific['itunes:block'] == 'Default') { echo 'selected="selected"';	}	echo '>'.__('Use Default', 'podpress').' ('.$this->settings['iTunes']['block'].')</option>'."\n";
				echo '								<option value="No" '; if($post->podPressPostSpecific['itunes:block'] == 'No') { echo 'selected="selected"';	}	echo '>'.__('No', 'podpress').'</option>'."\n";
				echo '								<option value="Yes" '; if($post->podPressPostSpecific['itunes:block'] == 'Yes') { echo 'selected="selected"';	}	echo '>'.__('Yes', 'podpress').'</option>'."\n";
				echo '							</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="itunesBlockHelp" style="display: none;">'."\n";
				echo '						<td colspan="2">'.__('Prevent this episode or podcast from appearing in iTunes.', 'podpress').'</td>'."\n";
				echo '					</tr>'."\n";
				echo '				</table>'."\n";

				echo '			</div>'."\n";
			}
		
			if($this->settings['enablePodangoIntegration']) {
				echo "			<br/>\n";
				echo '			<strong>Podango File Uploader</strong>';
				if($this->settings['podangoDefaultPodcast'] == '##ALL##') {
					$podangoPodcastList = $this->podangoapi->GetPodcasts(true);
					echo ' <strong>for: </strong><select name="podPressPodangoPodcastID" id="podPressPodangoPodcastID" onChange="javascript: document.getElementById(\'podangoUploadFrame\').src=\''.$this->podangoapi->fileUploader.'?podcastId=\'+this.value">'."\n";
					foreach ($podangoPodcastList as $k=>$v) {
						if(!isset($podangoPodcastID)) {
							$podangoPodcastID = $k;
						}
						echo '						<option value="'.$k.'">'.$v['Title'].'</option>'."\n";
					}
					echo '					</select>'."\n";
				} else {
					$podangoPodcastID = $this->settings['podangoDefaultPodcast'];
				}
				echo '<br/>'."\n";
				echo '			<iframe src="'.$this->podangoapi->fileUploader.'?podcastId='.$podangoPodcastID.'" id="podangoUploadFrame" title="Podango Upload" border="0" width="560" height="110"> </iframe>'."\n";
			}
			echo '		</div>'."\n";
			echo '	<h3>'.__('End of podPress. File Uploading support is not part of podPress', 'podpress').'</h3> '."\n";
			echo '	</fieldset>'."\n";
			echo '</div><br/>'."\n";
			echo '<script type="text/javascript">podPressDisplayMediaFiles(); </script>'."\n";
		}


		// ################################################################
		// ### for modern WP versions:
		// ################################################################
		function post_form_wp25plus($entryType = 'post') {
			$blog_charset = get_bloginfo('charset');
			if(!is_object($GLOBALS['post']) && isset($GLOBALS['post_cache'][$GLOBALS['post']])) {
				$post = $GLOBALS['post_cache'][$GLOBALS['post']];
			} else {
				$post = $GLOBALS['post'];
			}

			$post = $this->addPostData($post, true);
			if(($_GET['action'] == 'edit')) {
				$post_id = $_GET['post'];

				if(!is_array($post->podPressMedia)) {
					$post->podPressMedia = array();
				}
			}

			$files = array();
			$mediaFilePath = stripslashes($this->settings['mediaFilePath']);
			if(@is_dir($mediaFilePath)) {
				$dh  = opendir($mediaFilePath);
				while (false !== ($filename = readdir($dh))) {
					if($filename != '.' && $filename != '..' && !is_dir($mediaFilePath.'/'.$filename) && !in_array(podPress_getFileExt($filename), array('php', 'html'))) {
						$files[] = $filename;
					}
				}
				natcasesort($files);
			}

			if($this->settings['enablePodangoIntegration']) {
				if(!empty($post->podPressPostSpecific['PodangoEpisodeID'])) {
					if(empty($post->podPressPostSpecific['PodangoMediaFileID'])) {
						$x = $this->podangoapi->GetEpisode($post->podPressPostSpecific['PodangoEpisodeID']);
						$post->podPressPostSpecific['PodangoMediaFileID'] = $x['MediaFileId'];
						unset($x);
					}
					$podangoMediaFiles = $this->podangoapi->GetMediaFile($post->podPressPostSpecific['PodangoMediaFileID']);
				} else {
					$podangoMediaFiles = $this->podangoapi->GetMediaFiles();
				}
			}
			echo '<script type="text/javascript">'."\n";
			echo "var podPressMaxMediaFiles = ".$this->settings['maxMediaFiles'].";\n";
			$newMediaDefaults = array();
			echo "var newMediaDefaults = new Array();\n";
			$newMediaDefaults['URI'] = '';
			echo "newMediaDefaults['URI'] = '".$newMediaDefaults['URI']."';\n";
			$newMediaDefaults['title'] = '';
			echo "newMediaDefaults['title'] = '".$newMediaDefaults['title']."';\n";
			$newMediaDefaults['type'] = 'audio_mp3';
			echo "newMediaDefaults['type'] = '".$newMediaDefaults['type']."';\n";
			$newMediaDefaults['size'] = '';
			echo "newMediaDefaults['size'] = '".$newMediaDefaults['size']."';\n";
			$newMediaDefaults['duration'] = '';
			echo "newMediaDefaults['duration'] = '".$newMediaDefaults['duration']."';\n";
			$newMediaDefaults['dimensionW'] = '320';
			echo "newMediaDefaults['dimensionW'] = '".$newMediaDefaults['dimensionW']."';\n";
			$newMediaDefaults['dimensionH'] = '240';
			echo "newMediaDefaults['dimensionH'] = '".$newMediaDefaults['dimensionH']."';\n";
			$newMediaDefaults['previewImage'] = podPress_url().'images/vpreview_center.png';
			echo "newMediaDefaults['previewImage'] = '".$newMediaDefaults['previewImage']."';\n";
			$newMediaDefaults['rss'] = 'false';
			echo "newMediaDefaults['rss'] = ".$newMediaDefaults['rss'].";\n";
			$newMediaDefaults['atom'] = 'true';
			echo "newMediaDefaults['atom'] = ".$newMediaDefaults['atom'].";\n";
			$newMediaDefaults['feedonly'] = 'true';
			echo "newMediaDefaults['feedonly'] = ".$newMediaDefaults['feedonly'].";\n";
			$newMediaDefaults['disablePlayer'] = 'false';
			echo "newMediaDefaults['disablePlayer'] = ".$newMediaDefaults['disablePlayer'].";\n";
			$newMediaDefaults['disablePreview'] = 'false';
			echo "newMediaDefaults['disablePreview'] = ".$newMediaDefaults['disablePreview'].";\n";
			$newMediaDefaults['content_level'] = 'free';
			echo "newMediaDefaults['content_level'] = '".$newMediaDefaults['content_level']."';\n";
			$newMediaDefaults['showme'] = 'false';
			echo "newMediaDefaults['showme'] = ".$newMediaDefaults['showme'].";\n";

			if ( FALSE !== empty($post->podPressMedia) ) {
				$num = 0;
			} else {
				$num = count($post->podPressMedia);
				$num = intval($num);
				if ($num > $this->settings['maxMediaFiles'] ) {
					$num = $this->settings['maxMediaFiles'];
				}
			}
			while ($num < $this->settings['maxMediaFiles']) {
				$post->podPressMedia[$num] = $newMediaDefaults;
				$num++;
			}

			$num = 0;
			while ($num < $this->settings['maxMediaFiles']) {
				if(!isset($post->podPressMedia[$num]['showme'])) {
					$post->podPressMedia[$num]['showme'] = 'true';
				}
				if($post->podPressMedia[$num]['showme'] == 'false') {
					$num++;
					continue;
				}

				if($this->settings['enablePodangoIntegration']) {
					if($podangoMediaFiles[$post->podPressPostSpecific['PodangoMediaFileID']]['Filename'] == basename($post->podPressMedia[$num]['URI'])) {
						$post->podPressMedia[$num]['URI'] = 'Podango:'.$podangoMediaFiles[$post->podPressPostSpecific['PodangoMediaFileID']]['Podcast'].':'.$podangoMediaFiles[$post->podPressPostSpecific['PodangoMediaFileID']]['ID'].':'.$podangoMediaFiles[$post->podPressPostSpecific['PodangoMediaFileID']]['EpisodeID'].':'.$podangoMediaFiles[$post->podPressPostSpecific['PodangoMediaFileID']]['Filename'];
					}
				}

				if($post->podPressMedia[$num]['rss'] == 'on') {
					$post->podPressMedia[$num]['rss'] = 'true';
				} else {
					$post->podPressMedia[$num]['rss'] = 'false';
				}
				if($post->podPressMedia[$num]['atom'] == 'on') {
					$post->podPressMedia[$num]['atom'] = 'true';
				} else {
					$post->podPressMedia[$num]['atom'] = 'false';
				}
				if($post->podPressMedia[$num]['feedonly'] == 'on') {
					$post->podPressMedia[$num]['feedonly'] = 'true';
				} else {
					$post->podPressMedia[$num]['feedonly'] = 'false';
				}
				if(!isset($post->podPressMedia[$num]['disablePlayer']) || $post->podPressMedia[$num]['disablePlayer'] == false || $post->podPressMedia[$num]['disablePlayer'] == 'false') {
					$post->podPressMedia[$num]['disablePlayer'] = 'false';
				} else {
					$post->podPressMedia[$num]['disablePlayer'] = 'true';
				}

				if(!isset($post->podPressMedia[$num]['disablePreview']) || $post->podPressMedia[$num]['disablePreview'] == false || $post->podPressMedia[$num]['disablePreview'] == 'false') {
					$post->podPressMedia[$num]['disablePreview'] = 'false';
				} else {
					$post->podPressMedia[$num]['disablePreview'] = 'true';
				}

				if($post->podPressMedia[$num]['premium_only'] == 'on' || $post->podPressMedia[$num]['premium_only'] == true) {
					$post->podPressMedia[$num]['content_level'] = 'premium_content';
				}
				if(!isset($post->podPressMedia[$num]['content_level'])) {
					$post->podPressMedia[$num]['content_level'] = 'free';
				}
				echo "\n";
				echo "podPressAddMediaFile(".$post->podPressMedia[$num]['showme'].", '".js_escape($post->podPressMedia[$num]['URI'])."', '".js_escape($post->podPressMedia[$num]['URI_torrent'])."', '".js_escape($post->podPressMedia[$num]['title'])."', '".$post->podPressMedia[$num]['type']."', '".$post->podPressMedia[$num]['size']."', '".$post->podPressMedia[$num]['duration']."', '".$post->podPressMedia[$num]['dimensionW']."', '".$post->podPressMedia[$num]['dimensionH']."', '".$post->podPressMedia[$num]['previewImage']."', ".$post->podPressMedia[$num]['rss'].", ".$post->podPressMedia[$num]['atom'].", ".$post->podPressMedia[$num]['feedonly'].", ".$post->podPressMedia[$num]['disablePlayer'].", '".$post->podPressMedia[$num]['content_level']."');\n";
				$num++;
			}
			echo '</script>'."\n";

			echo '<input type="hidden" id="podPressMedia_defaultpreviewImage" value="'.PODPRESS_URL.'/images/vpreview_center.png" />'."\n";
			if ( defined('NONCE_KEY') AND is_string(constant('NONCE_KEY')) AND '' != trim(constant('NONCE_KEY')) ) {
				echo '<input type="hidden" id="podPress_AJAX_sec" value="' . wp_create_nonce(NONCE_KEY) . '" />'."\n";
			} else {
				echo '<input type="hidden" id="podPress_AJAX_sec" value="' . wp_create_nonce('Af|F07*wC7g-+OX$;|Z5;R@Pi]ZgoU|Zex8=`?mO-Mdvu+WC6l=6<O^2d~+~U3MM') . '" />'."\n";
			}
			
			echo '<p style="padding-bottom:1em;">'.sprintf(__('To control player location in your post, you may put %1$s where you want it to appear. You can choose the default postion on the general settings page of podPress.', 'podpress'), $this->podcasttag).'<br />'.__('File Uploading support is not part of podPress.', 'podpress').'</p>'."\n";
			echo '<h4>'.__('Podcasting Files:', 'podpress').'</h4>'."\n";
		
			$num = 0;
			while ($num < $this->settings['maxMediaFiles']) {
				if(!isset($post->podPressMedia[$num])) {
					$num++;
					continue;
				}
				$thisMedia = $post->podPressMedia[$num];
			
				if ( $thisMedia['showme'] == 'true' ) {
					$display_text = 'block';
				} else {
					$display_text = 'none';
				}
				
				echo '     			<div id="podPressMediaFileContainer_'.$num.'" class="wrap" style="visibility: visible; display: '.$display_text.';">'."\n";
				echo '				<table class="podpress_editor_table">'."\n";
				echo '					<tr>'."\n";
				echo '						<th id="podpress_media_file_header"><em>'.__('Media File:', 'podpress').'</em></th>';
				echo '						<td id="podpress_media_file_buttons">';
				echo '						<input type="button" value="'.__('Move Up', 'podpress').'" onclick="podPressMoveFile('.$num.', \'up\'); podPressDisplayMediaFiles();"/>'."\n";
				echo '						<input type="button" value="'.__('Move Down', 'podpress').'" onclick="podPressMoveFile('.$num.', \'down\'); podPressDisplayMediaFiles();"/>'."\n";
				echo '						<input type="button" name="podPressAddAnother" value="'.__('Remove File', 'podpress').'" onclick="podPressRemoveFile('.$num.'); podPressDisplayMediaFiles();"/>';
				echo '						</td>';
				echo '					</tr>'."\n";
				echo '					<tr>'."\n";
				echo '						<th>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_URI">'.__('Location', 'podpress').'</label>: '."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				if(!empty($files) || $this->settings['enablePodangoIntegration']) {
					$fileOptionList = '';
					echo '						<select name="podPressMedia['.$num.'][URI]" id="podPressMedia_'.$num.'_URI" width="35" onchange="javascript: if(this.value==\'!\') { podPress_customSelectVal(this, \'Specifiy URL.\'); } podPressMediaFiles['.$num.'][\'URI\'] = this.value; podPressDetectType('.$num.');">'."\n";
					echo '							<option value="!">'.__('Specify URL ...', 'podpress').'</option>'."\n";
					$fileSelected = false;
					
					if($this->settings['enablePodangoIntegration']) {
						$podangoOptGroup = '';
						$podangoFirstOptGroup = true;
						foreach($podangoMediaFiles as $podangoMediaFile) {
							if(!empty($podangoMediaFile['EpisodeID']) && $podangoMediaFile['EpisodeID'] != $post->podPressPostSpecific['PodangoEpisodeID'] && $post->post_title != $podangoMediaFile['EpisodeTitle']) {
								continue;
							}
							if($podangoOptGroup != $podangoMediaFile['Podcast']) {
								$podangoOptGroup = $podangoMediaFile['Podcast'];
								if(!$podangoFirstOptGroup) {
									echo "							</optgroup>\n";
								}
								$x = $this->podangoapi->GetPodcast($podangoMediaFile['Podcast'], true);
								echo '							<optgroup name="PodangoOptGroup'.$podangoMediaFile['Podcast'].'" label="Podango Podcast: '.$x['Title'].'">'."\n";
								unset($x);
							}
							$key = 'Podango:'.$podangoMediaFile['Podcast'].':'.$podangoMediaFile['ID'].':'.$podangoMediaFile['EpisodeID'].':'.$podangoMediaFile['Filename'];
							if($key == $thisMedia['URI']) {
								$xSelected = ' selected="selected"';
								$fileSelected = true;
							} else {
								$xSelected = '';
							}
							echo '								<option value="'.$key.'"'.$xSelected.'>'.$podangoMediaFile['Filename'].'</option>'."\n";
						}
						echo "							</optgroup>\n";
						echo '							<optgroup name="LocallyHosted" label="Locally Hosted">'."\n";

					}
					
					foreach ($files as $key=>$val) {
						if(is_numeric($key)) {
							$key = $val;
						}
						if($key == $thisMedia['URI']) {
							$xSelected = ' selected="selected"';
							$fileSelected = true;
						} else {
							$xSelected = '';
						}
						if ( TRUE == version_compare(PHP_VERSION, '5.0', '<') ) { // html_entity_decode can not handle the charset UTF-8 in most of the PHP 4 version
							$fileOptionList .= '							<option value="'.attribute_escape(htmlentities($key)).'"'.$xSelected.'>'.htmlentities(podPress_stringLimiter($val, 100, true)).'</option>'."\n";
						} else {
							if ( FALSE === stristr(PHP_OS, 'WIN') ) { 
								$fileOptionList .= '							<option value="'.attribute_escape(htmlentities($key, ENT_COMPAT, $blog_charset)).'"'.$xSelected.'>'.htmlentities(podPress_stringLimiter($val, 100, true), ENT_COMPAT, $blog_charset).'</option>'."\n";
							} else {
								$fileOptionList .= '							<option value="'.attribute_escape(htmlentities($key)).'"'.$xSelected.'>'.htmlentities(podPress_stringLimiter($val, 100, true)).'</option>'."\n";
							}
						}
					}
					if ( !$fileSelected ) {
						if ( TRUE == version_compare(PHP_VERSION, '5.0', '<') ) { // html_entity_decode can not handle the charset UTF-8 in most of the PHP 4 version
							echo '							<option value="'.attribute_escape(htmlentities($thisMedia['URI'])).'" selected="selected">'.htmlentities(podPress_stringLimiter($thisMedia['URI'], 100, true)).'</option>'."\n";
						} else {
							if ( FALSE === stristr(PHP_OS, 'WIN') ) { 
								echo '							<option value="'.attribute_escape(htmlentities($thisMedia['URI']), ENT_COMPAT, $blog_charset).'" selected="selected">'.htmlentities(podPress_stringLimiter($thisMedia['URI'], 100, true), ENT_COMPAT, $blog_charset).'</option>'."\n";
							} else {
								echo '							<option value="'.attribute_escape($thisMedia['URI']).'" selected="selected">'.htmlentities(podPress_stringLimiter($thisMedia['URI'], 100, true), ENT_COMPAT, $blog_charset).'</option>'."\n";
							}
						}
					}
					echo $fileOptionList;
					unset($fileOptionList);
					if ( $this->settings['enablePodangoIntegration'] ) {
						echo "							</optgroup>\n";
					}
					echo '						</select>'."\n";
					echo '							<input type="hidden" id="podPressMedia_'.$num.'_cleanURI" value="no" />'."\n";
				} else {
					echo '							<input type="text" id="podPressMedia_'.$num.'_URI" name="podPressMedia['.$num.'][URI]" class="podpress_wide_text_field" size="40" value="'.attribute_escape($thisMedia['URI']).'" onchange="javascript: podPressMediaFiles['.$num.'][\'URI\'] = this.value; podPressDetectType('.$num.'); podPressCheckForNotSafeFilenameChr( '.$num.', this.value );" />'."\n";
					echo '							<span id="podPressMedia_'.$num.'_URI_chrWarning" class="podpress_notice podPressMedia_URI_chrWarning">'.sprintf(__('<strong>Notice:</strong> It is not recommended to use other than these characters: %1$s or whitespaces in file and folder names.', 'podpress'), 'abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 .:/_-\ ').'</span>'."\n";
					echo '							<input type="hidden" id="podPressMedia_'.$num.'_cleanURI" value="yes" />'."\n";
				}
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				if($this->settings['enableTorrentCasting']) {
					echo '					<tr>'."\n";
					echo '						<th>'."\n";
					echo '							<label for="podPressMedia_'.$num.'_URItorrent">'.__('.torrent Location', 'podpress').'</label>: '."\n";
					echo '						</th>'."\n";
					echo '						<td>'."\n";
					echo '							<input type="text" id="podPressMedia_'.$num.'_URItorrent" name="podPressMedia['.$num.'][URI_torrent]" size="40" value="'.attribute_escape($thisMedia['URI_torrent']).'" onchange="javascript: podPressMediaFiles['.$num.'][\'URI_torrent\'] = this.value;" />'."\n";
					echo '						</td>'."\n";
					echo '					</tr>'."\n";
				}
				echo '					<tr>'."\n";
				echo '						<th>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_title">'.__('Title', 'podpress').'</label>: '."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="text" id="podPressMedia_'.$num.'_title" name="podPressMedia['.$num.'][title]" class="podpress_wide_text_field" size="40" value="'.attribute_escape($thisMedia['title']).'" onchange="javascript: podPressMediaFiles['.$num.'][\'title\'] = this.value;" />'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr>'."\n";
				echo '						<th>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_type">'.__('Type', 'podpress').'</label>: '."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="podPressMedia_'.$num.'_type" name="podPressMedia['.$num.'][type]" onchange="javascript: podPressMediaFiles['.$num.'][\'type\'] = this.value; podPressAdjustMediaFieldsBasedOnType('.$num.');" >'."\n"; podPress_mediaOptions();	echo '</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="podPressMediaSizeWrapper_'.$num.'" >'."\n";
				echo '						<th>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_size">'.__('File Size', 'podpress').'</label>: '."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="text" id="podPressMedia_'.$num.'_size" name="podPressMedia['.$num.'][size]" size="10" value="'.$thisMedia['size'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'size\'] = this.value;"/> '.__('[in byte]', 'podpress').' <img src="'.PODPRESS_URL.'/images/ajax-loader.gif" id="podPressMedia_'.$num.'_size_loadimg" class="podpress_ajax_loader_img" /><input type="button" id="podPressMedia_'.$num.'_size_detectbutton" value="'.__('Auto Detect', 'podpress').'" onclick="podPress_getfileinfo(\'size\', '.$num.');" />'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="podPressMediaDurationWrapper_'.$num.'" style="display: none;">'."\n";
				echo '						<th>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_duration">'.__('Duration', 'podpress').'</label>: '."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="text" id="podPressMedia_'.$num.'_duration" name="podPressMedia['.$num.'][duration]" size="10" value="'.$thisMedia['duration'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'duration\'] = this.value;"/> <span class="podpress_abbr" title="'.__('hours:minutes:seconds - for example: 2:45:10 or 34:01 or 1:36 or 120:47 or 0:10', 'podpress').'">'.__('[hh:mm:ss]', 'podpress').'</span> <img src="'.PODPRESS_URL.'/images/ajax-loader.gif" id="podPressMedia_'.$num.'_duration_loadimg" class="podpress_ajax_loader_img" /><input type="button" id="podPressMedia_'.$num.'_duration_detectbutton" value="'.__('Auto Detect', 'podpress').'" onclick="podPress_getfileinfo(\'duration\', '.$num.');" /> ('.sprintf(__('This may take some time for remote files. %1$s', 'podpress'), '<span class="podpress_abbr" title="'.__('If the file is not on the same server as your blog then podPress will attempt to download the file in order to get this information with the help of getID3() which is only able to retrieve ID3 tags from local files. podPress removes the temporary download file at the end of this process. It is likely that this feature works only for relative small files because the download is probably limited by execution time and memory limits on the server of your blog.', 'podpress').'">'.__('Because ...', 'podpress').'</span>').')'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				if(empty($thisMedia['previewImage'])) {
					$thisMedia['previewImage'] = podPress_url().'images/vpreview_center.png';
				}
				echo '					<tr id="podPressMediaPreviewImageWrapper_'.$num.'" style="display: none;">'."\n";
				echo '						<th>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_previewImage">'.__('Preview Image URL', 'podpress').'</label>: '."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="text" id="podPressMedia_'.$num.'_previewImage" name="podPressMedia['.$num.'][previewImage]" class="podpress_wide_text_field" size="40" value="'.attribute_escape($thisMedia['previewImage']).'" onchange="javascript: podPressPreviewImageOnChange('.$num.', this.value);" />'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="podPressMediaPreviewImageDisplayWrapper_'.$num.'" style="display: none;">'."\n";
				echo '						<th>'."\n";
				echo '							'.__('Preview Image', 'podpress').': '."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<div id="podPressPlayerSpace_'.$num.'"></div>'."\n";
				echo '<script type="text/javascript"><!--'."\n";
				//echo "	document.getElementById('podPressPlayerSpace_".$num."').innerHTML = podPressGenerateVideoPreview (".$num.", '', , , document.getElementById('podPressMedia_".$num."_previewImage').value, true);\n";
				echo "	document.getElementById('podPressPlayerSpace_".$num."').innerHTML = podPressGenerateVideoPreview (".$num.", '', ".$thisMedia['dimensionW'].", ".$thisMedia['dimensionH'].", document.getElementById('podPressMedia_".$num."_previewImage').value, true);\n";
				//echo "	document.getElementById('podPressPlayerSpace_".$num."').innerHTML = podPressGenerateVideoPreview (".$num.", '', ".intval($thisMedia['dimensionW']).", ".intval($thisMedia['dimensionH']).", document.getElementById('podPressMedia_".$num."_previewImage').value, true);\n";
				echo "--></script>\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";

				echo '					<tr id="podPressMediaDimensionWrapper_'.$num.'">'."\n";
				echo '						<th>'."\n";
				echo '							'.__('Dimensions', 'podpress').' (WxH): '."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="text" id="podPressMedia_'.$num.'_dimensionW" name="podPressMedia['.$num.'][dimensionW]" size="5" value="'.$thisMedia['dimensionW'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionW\'] = this.value; podPressUpdateDimensionList(\''.$num.'\');" />x<input type="text" id="podPressMedia_'.$num.'_dimensionH" name="podPressMedia['.$num.'][dimensionH]" size="5" value="'.$thisMedia['dimensionH'].'" onchange="javascript: podPressMediaFiles['.$num.'][\'dimensionH\'] = this.value; podPressUpdateDimensionList(\''.$num.'\')" /> '."\n";
				echo '							<select id="podPressMedia_'.$num.'_dimensionList" onchange="javascript: podPressUpdateDimensions(\''.$num.'\', this.value);">'."\n"; podPress_videoDimensionOptions($thisMedia['dimensionW'].':'.$thisMedia['dimensionH']);	echo '</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";

				if($post->post_status == 'static') {
					echo '					<tr style="display: none;">'."\n";
				} else {
					echo '					<tr>'."\n";
				}
				echo '						<th>'."\n";
				echo '							'.__('Included in', 'podpress').': '."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							&nbsp;<label for="podPressMedia_'.$num.'_rss">'.__('RSS2', 'podpress').'</label> <input type="checkbox" id="podPressMedia_'.$num.'_rss" name="podPressMedia['.$num.'][rss]" onchange="javascript: podPressMediaFiles['.$num.'][\'rss\'] = this.checked; podPressSetSingleRSS('.$num.');" />'."\n";
				echo '							&nbsp;<label for="podPressMedia_'.$num.'_atom">'.__('ATOM', 'podpress').'</label> <input type="checkbox" id="podPressMedia_'.$num.'_atom" name="podPressMedia['.$num.'][atom]" onchange="javascript: podPressMediaFiles['.$num.'][\'atom\'] = this.checked;" />'."\n";
				echo '							&nbsp;<label for="podPressMedia_'.$num.'_feedonly">'.__('Feed Only', 'podpress').'</label> <input type="checkbox" id="podPressMedia_'.$num.'_feedonly" name="podPressMedia['.$num.'][feedonly]" onchange="javascript: podPressMediaFiles['.$num.'][\'feedonly\'] = this.checked;" />'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				if($this->settings['enablePremiumContent']) {
					echo '					<tr>'."\n";
					echo '						<th>'."\n";
					echo '							<label for="podPressMedia_'.$num.'_content_level">'.__('Subscription', 'podpress').'</label>:';
					echo '						</th>'."\n";
					echo '						<td>'."\n";
					echo '							<select id="podPressMedia_'.$num.'_content_level" name="podPressMedia['.$num.'][content_level]" onchange="javascript: podPressMediaFiles['.$num.'][\'content_level\'] = this.value;">'."\n";
					echo '								<option value="free" '; if(empty($thisMedia['content_level']) || $thisMedia['content_level'] == 'free') { echo 'selected="selected"';	}	echo '>'.__('Free', 'podpress').'</option>'."\n";
					foreach (podPress_getCapList(true) as $cap) {
						if(substr($cap, -8, 8) == '_content') {
							echo '								<option value="'.$cap.'" '; if($thisMedia['content_level'] == $cap) { echo 'selected="selected"';	}	echo '>'.__(podPress_getCapName($cap), 'podpress').'</option>'."\n";
						}
					}
					echo '							</select>'."\n";
					echo '						</td>'."\n";
					echo '					</tr>'."\n";
				}
				echo '					<tr>'."\n";
				echo '						<th>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_disablePlayer">'.__('Disable Player', 'podpress').'</label>:'."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="checkbox" id="podPressMedia_'.$num.'_disablePlayer" name="podPressMedia['.$num.'][disablePlayer]"'; if($thisMedia['disablePlayer'] != 'false') { echo 'checked="checked" '; } echo ' onchange="javascript: podPressMediaFiles['.$num.'][\'disablePlayer\'] = this.checked;" />'."\n";
				echo '							&nbsp;&nbsp; '.__('(Use if this media file is not compatible with one of the included players.)', 'podpress')."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr>'."\n";
				echo '						<th>'."\n";
				echo '							<label for="podPressMedia_'.$num.'_disablePreview">'.__('Disable Preview Player', 'podpress').'</label>:'."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<input type="checkbox" id="podPressMedia_'.$num.'_disablePreview" name="podPressMedia['.$num.'][disablePreview]"'; if($thisMedia['disablePreview'] != 'false') { echo 'checked="checked" '; } echo ' onchange="javascript: podPressMediaFiles['.$num.'][\'disablePreview\'] = this.checked;" />'."\n";
				echo '							&nbsp;&nbsp; '.__('(Use this to disable the "Click to Play" preview player.)', 'podpress')."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				$actionMedia = $thisMedia;
				$actionMedia['num'] = $num;
				do_action('podPress_customMediaData', array($actionMedia));
				echo '					<tr id="podPressMedia_'.$num.'_id3tags_details_row">'."\n";
				echo '						<th>'."\n";
				echo '							'.__('ID3 Tag Info', 'podpress').":\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<img src="'.PODPRESS_URL.'/images/ajax-loader.gif" id="podPressMedia_'.$num.'_id3tags_loadimg" class="podpress_ajax_loader_img" /><input type="button" id="podPressMedia_'.$num.'_id3tags_detectbutton" value="'.__('Show','podpress').'" onclick="javascript: podPressShowHideID3Tags('.$num.');" /> ('.sprintf(__('This may take some time for remote files. %1$s', 'podpress'), '<span class="podpress_abbr" title="'.__('If the file is not on the same server as your blog then podPress will attempt to download the file in order to get this information with the help of getID3() which is only able to retrieve ID3 tags from local files. podPress removes the temporary download file at the end of this process. It is likely that this feature works only for relative small files because the download is probably limited by execution time and memory limits on the server of your blog.', 'podpress').'">'.__('Because ...', 'podpress').'</span>').')'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr>'."\n";
				echo '						<td colspan="2">'."\n";
				echo '							<div id="podPressMedia_'.$num.'_id3tags" style="display: none; vertical-align: top;">'."\n";
				echo '							</div>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '				</table>'."\n";
				echo '			</div> <!-- end: podPressMediaFileContainer_'.$num.' -->'."\n";
				$num++;
			}
			
			echo '			<input type="button" name="podPressAddAnother" value="'.__('Add Media File', 'podpress').'" onclick="javascript: podPressAddMediaFile(true, \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'\', \'new\', true, false, false, \'free\'); podPressDisplayMediaFiles();"/>'."\n";
			
			if($entryType != 'page') {
				echo '			<br/>'."\n";
				echo '			<h4>'.__('Post specific settings for iTunes:', 'podpress').'</h4>'."\n";
				//echo '			<input type="button" name="iTunesSpecificSettings_button" id="iTunesSpecificSettings_button" value="Show" onclick="javascript: podPressShowHideDiv(\'iTunesSpecificSettings\');"/>'."\n";

				echo '     			<div class="wrap" id="iTunesSpecificSettings">'."\n";
				echo '				<table class="podpress_editor_table">'."\n";
				echo '					<tr>'."\n";
				echo '						<th>'."\n";
				echo '							<label for="iTunesSubtitleChoice">'.__('iTunes:Subtitle', 'podpress').'</label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'iTunesSubtitleHelp\');">(?)</a>:'."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="iTunesSubtitleChoice" name="iTunesSubtitleChoice" onchange="javascript: if(this.value == \'Custom\') { document.getElementById(\'iTunesSubtitleWrapper\').style.display=\'\'; } else { document.getElementById(\'iTunesSubtitleWrapper\').style.display=\'none\'; }">'."\n";
				echo '								<option value="PostExcerpt" '; if($post->podPressPostSpecific['itunes:subtitle'] == '##PostExcerpt##') { echo 'selected="selected"';	}	echo '>'.__('Use the excerpt', 'podpress').'</option>'."\n";
				echo '								<option value="Custom" '; if($post->podPressPostSpecific['itunes:subtitle'] != '##PostExcerpt##') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
				echo '							</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="iTunesSubtitleHelp" style="display: none;">'."\n";
				echo '						<th>&nbsp;</th>'."\n";
				echo '						<td>'.sprintf(__('"%1$s" (default) podPress takes the first 255 characters from the excerpt of the excerpt and if there is none from the blog Post text.', 'podpress'),__('Use the excerpt', 'podpress')).'</td>'."\n";
				echo '					</tr>'."\n";
				if($post->podPressPostSpecific['itunes:subtitle'] == '##PostExcerpt##') { $tempShowMe = 'style="display: none;"';$post->podPressPostSpecific['itunes:subtitle'] = ''; } else { $tempShowMe = ''; }
				echo '					<tr id="iTunesSubtitleWrapper" '.$tempShowMe.'>'."\n";
				echo '						<th>&nbsp;</th>'."\n";
				echo '						<td>'."\n";
				echo '							<textarea name="iTunesSubtitle" class="podpress_wide_text_field" rows="4" cols="40">'.stripslashes($post->podPressPostSpecific['itunes:subtitle']).'</textarea>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				
				echo '					<tr>'."\n";
				echo '						<th>'."\n";
				echo '							<label for="iTunesSummaryChoice">'.__('iTunes:Summary', 'podpress').'</label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'iTunesSummaryHelp\');">(?)</a>:'."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="iTunesSummaryChoice" name="iTunesSummaryChoice" onchange="javascript: if(this.value == \'Custom\') { document.getElementById(\'iTunesSummaryWrapper\').style.display=\'\'; } else { document.getElementById(\'iTunesSummaryWrapper\').style.display=\'none\'; }">'."\n";
				echo '								<option value="PostExcerpt" '; if($post->podPressPostSpecific['itunes:summary'] == '##PostExcerpt##') { echo 'selected="selected"';	}	echo '>'.__('Use the excerpt', 'podpress').'</option>'."\n";
				echo '								<option value="PostContentShortened" '; if($post->podPressPostSpecific['itunes:summary'] == '##PostContentShortened##') { echo 'selected="selected"';	}	echo '>'.__('autom. excerpt of the post content', 'podpress').'</option>'."\n";
				echo '								<option value="Global" '; if($post->podPressPostSpecific['itunes:summary'] == '##Global##') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').'</option>'."\n";
				echo '								<option value="Custom" '; if($post->podPressPostSpecific['itunes:summary'] != '##Global##' && $post->podPressPostSpecific['itunes:summary'] != '##PostExcerpt##' && $post->podPressPostSpecific['itunes:summary'] != '##PostContentShortened##') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
				echo '							</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="iTunesSummaryHelp" style="display: none;">'."\n";
				echo '						<th>&nbsp;</th>'."\n";
				echo '						<td>'.sprintf(__('"%1$s" (default) podPress takes the excerpt. If you have not written an excerpt then it takes a part from the blog Post text.', 'podpress'),__('Use the excerpt', 'podpress')).'</td>'."\n";
				echo '					</tr>'."\n";
				
				if($post->podPressPostSpecific['itunes:summary'] == '##Global##' || $post->podPressPostSpecific['itunes:summary'] == '##PostExcerpt##' || $post->podPressPostSpecific['itunes:summary'] ==  '##PostContentShortened##') { $tempShowMe = 'style="display: none;"';	$post->podPressPostSpecific['itunes:summary'] = ''; } else { $tempShowMe = ''; }
				echo '					<tr id="iTunesSummaryWrapper" '.$tempShowMe.'>'."\n";
				echo '						<th>&nbsp;</th>'."\n";
				echo '						<td>'."\n";
				echo '							<textarea name="iTunesSummary" class="podpress_wide_text_field" rows="4" cols="40">'.stripslashes($post->podPressPostSpecific['itunes:summary']).'</textarea>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";

				echo '					<tr>'."\n";
				echo '						<th>'."\n";
				echo '							<label for="iTunesKeywordsChoice">'.__('iTunes:Keywords', 'podpress').'</label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'iTunesKeywordsHelp\');">(?)</a>:'."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="iTunesKeywordsChoice" name="iTunesKeywordsChoice" onchange="javascript: if(this.value == \'Custom\') { document.getElementById(\'iTunesKeywordsWrapper\').style.display=\'\'; } else { document.getElementById(\'iTunesKeywordsWrapper\').style.display=\'none\'; }">'."\n";
				echo '								<option value="WordPressCats" '; if($post->podPressPostSpecific['itunes:keywords'] == '##WordPressCats##') { echo 'selected="selected"';	}	echo '>'.__('Use WordPress Categories', 'podpress').'</option>'."\n";
				echo '								<option value="post_tags" '; if($post->podPressPostSpecific['itunes:keywords'] == '##post_tags##') { echo 'selected="selected"';	}	echo '>'.__('Use the tags of the post', 'podpress').'</option>'."\n";
				echo '								<option value="Global" '; if($post->podPressPostSpecific['itunes:keywords'] == '##Global##') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.podPress_stringLimiter(stripslashes($this->settings['iTunes']['keywords']), 40) .')</option>'."\n";
				echo '								<option value="Custom" '; if($post->podPressPostSpecific['itunes:keywords'] != '##Global##' AND $post->podPressPostSpecific['itunes:keywords'] != '##WordPressCats##' AND $post->podPressPostSpecific['itunes:keywords'] != '##post_tags##') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
				echo '							</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				
				echo '					<tr id="iTunesKeywordsHelp" style="display: none;">'."\n";
				echo '						<th>&nbsp;</th>'."\n";
				echo '						<td>'.__('Not visible in iTunes, but used for searches.', 'podpress').'</td>'."\n";
				echo '					</tr>'."\n";
				
				if ( $post->podPressPostSpecific['itunes:keywords'] == '##Global##' OR $post->podPressPostSpecific['itunes:keywords'] == '##WordPressCats##' OR $post->podPressPostSpecific['itunes:keywords'] == '##post_tags##' ) { $tempShowMe = 'style="display: none;"';	$post->podPressPostSpecific['itunes:keywords'] = ''; } else { $tempShowMe = ''; }
				echo '					<tr id="iTunesKeywordsWrapper" '.$tempShowMe.'>'."\n";
				echo '						<th>&nbsp;</th>'."\n";
				echo '						<td>'."\n";
				echo '							'.__('a list of max. 12 comma separated words', 'podpress').'<br/><textarea name="iTunesKeywords" class="podpress_wide_text_field" rows="4" cols="40">'.stripslashes($post->podPressPostSpecific['itunes:keywords']).'</textarea>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";

				echo '					<tr>'."\n";
				echo '						<th>'."\n";
				echo '							<label for="iTunesAuthorChoice">'.__('iTunes:Author', 'podpress').'</label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'iTunesAuthorHelp\');">(?)</a>:'."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="iTunesAuthorChoice" name="iTunesAuthorChoice" onchange="javascript: if(this.value == \'Custom\') { document.getElementById(\'iTunesAuthorWrapper\').style.display=\'\'; } else { document.getElementById(\'iTunesAuthorWrapper\').style.display=\'none\'; }">'."\n";
				echo '								<option value="Global" '; if($post->podPressPostSpecific['itunes:author'] == '##Global##') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.podPress_stringLimiter(ucfirst(stripslashes($this->settings['iTunes']['author'])), 40).')</option>'."\n";
				echo '								<option value="Custom" '; if($post->podPressPostSpecific['itunes:author'] != '##Global##') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
				echo '							</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";

				echo '					<tr id="iTunesAuthorHelp" style="display: none;">'."\n";
				echo '						<th>&nbsp;</th>'."\n";
				echo '						<td>'.__('Used if this Author is different than the feeds author.', 'podpress').'</td>'."\n";
				echo '					</tr>'."\n";
				if($post->podPressPostSpecific['itunes:author'] == '##Global##') { $tempShowMe = 'style="display: none;"';	$post->podPressPostSpecific['itunes:author'] = ''; } else { $tempShowMe = ''; }
				echo '					<tr id="iTunesAuthorWrapper" '.$tempShowMe.'>'."\n";
				echo '						<th>&nbsp;</th>'."\n";
				echo '						<td><input type="text" name="iTunesAuthor" class="podpress_wide_text_field" size="40" value="'.attribute_escape($post->podPressPostSpecific['itunes:author']).'" /></td>'."\n";
				echo '					</tr>'."\n";

				echo '					<tr>'."\n";
				echo '						<th>'."\n";
				echo '							<label for="iTunesExplicit">'.__('iTunes:Explicit', 'podpress').'</label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'iTunesExplicitHelp\');">(?)</a>:'."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="iTunesExplicit" name="iTunesExplicit">'."\n";
				echo '								<option value="Default" '; if($post->podPressPostSpecific['itunes:explicit'] == 'Default') { echo 'selected="selected"';	}	echo '>'.__('Use Default', 'podpress').' ('.$this->settings['iTunes']['explicit'].')</option>'."\n";
				echo '								<option value="No" '; if($post->podPressPostSpecific['itunes:explicit'] == 'No') { echo 'selected="selected"';	}	echo '>'.__('No', 'podpress').'</option>'."\n";
				echo '								<option value="Yes" '; if($post->podPressPostSpecific['itunes:explicit'] == 'Yes') { echo 'selected="selected"';	}	echo '>'.__('Yes', 'podpress').'</option>'."\n";
				echo '								<option value="Clean" '; if($post->podPressPostSpecific['itunes:explicit'] == 'Clean') { echo 'selected="selected"';	}	echo '>'.__('Clean', 'podpress').'</option>'."\n";
				echo '							</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="iTunesExplicitHelp" style="display: none;">'."\n";
				echo '						<th>&nbsp;</th>'."\n";
				echo '						<td>'.__('Does your podcast contain explicit language or adult content? (If you choose "Yes" or "Clean" then a corresponding notice will show up in iTunes (Explicit resp. Clean). If you choose "No" then there will be special notice.)', 'podpress').'</td>'."\n";
				echo '					</tr>'."\n";

				echo '					<tr>'."\n";
				echo '						<th>'."\n";
				echo '							<label for="iTunesBlock">'.__('iTunes:Block', 'podpress').'</label> <a href="javascript:void(null);" onclick="javascript: podPressShowHideRow(\'itunesBlockHelp\');">(?)</a>:'."\n";
				echo '						</th>'."\n";
				echo '						<td>'."\n";
				echo '							<select id="iTunesBlock" name="iTunesBlock">'."\n";
				echo '								<option value="Default" '; if($post->podPressPostSpecific['itunes:block'] == 'Default') { echo 'selected="selected"';	}	echo '>'.__('Use Default', 'podpress').' ('.$this->settings['iTunes']['block'].')</option>'."\n";
				echo '								<option value="No" '; if($post->podPressPostSpecific['itunes:block'] == 'No') { echo 'selected="selected"';	}	echo '>'.__('No', 'podpress').'</option>'."\n";
				echo '								<option value="Yes" '; if($post->podPressPostSpecific['itunes:block'] == 'Yes') { echo 'selected="selected"';	}	echo '>'.__('Yes', 'podpress').'</option>'."\n";
				echo '							</select>'."\n";
				echo '						</td>'."\n";
				echo '					</tr>'."\n";
				echo '					<tr id="itunesBlockHelp" style="display: none;">'."\n";
				echo '						<th>&nbsp;</th>'."\n";
				echo '						<td>'.__('Prevent this episode or podcast from appearing in iTunes.', 'podpress').'</td>'."\n";
				echo '					</tr>'."\n";
				echo '				</table>'."\n";
				echo '			</div> <!-- end: iTunesSpecificSettings -->'."\n";
			}
		
			if($this->settings['enablePodangoIntegration']) {
				echo "			<br/>\n";
				echo '			<strong>Podango File Uploader</strong>';
				if($this->settings['podangoDefaultPodcast'] == '##ALL##') {
					$podangoPodcastList = $this->podangoapi->GetPodcasts(true);
					echo ' <strong>for: </strong><select name="podPressPodangoPodcastID" id="podPressPodangoPodcastID" onChange="javascript: document.getElementById(\'podangoUploadFrame\').src=\''.$this->podangoapi->fileUploader.'?podcastId=\'+this.value">'."\n";
					foreach ($podangoPodcastList as $k=>$v) {
						if(!isset($podangoPodcastID)) {
							$podangoPodcastID = $k;
						}
						echo '						<option value="'.$k.'">'.$v['Title'].'</option>'."\n";
					}
					echo '					</select>'."\n";
				} else {
					$podangoPodcastID = $this->settings['podangoDefaultPodcast'];
				}
				echo '<br/>'."\n";
				echo '			<iframe src="'.$this->podangoapi->fileUploader.'?podcastId='.$podangoPodcastID.'" id="podangoUploadFrame" title="Podango Upload" border="0" width="560" height="110"> </iframe>'."\n";
			}
			
			echo '<script type="text/javascript">podPressDisplayMediaFiles(); </script>'."\n";
		}


		function post_edit($post_id) {
			GLOBAL $post, $pagenow;
			
			if ($this->justposted) {
				return;
			}
			
			$blog_charset = get_bloginfo('charset');
			
			// this condition make sure that the podpress settings of a post or page will be saved only via this admin pages and not "quick edit"
			if ( "post.php" === $pagenow OR "page.php" === $pagenow OR "post-new.php" === $pagenow OR "page-new.php" === $pagenow ) {
				// patch for compat with post revisions (WP 2.6+)
				if ( isset($_POST['post_ID']) && (int) $_POST['post_ID'] )
					$post_id = (int) $_POST['post_ID'];

				$this->justposted = true;
				if($this->checkWritableTempFileDir()) {
					if(!empty($this->tempfilesystempath)) {
						$dh  = opendir($this->tempfilesystempath);
						while (false !== ($filename = readdir($dh))) {
							if(substr($filename, 0, 10) == 'feedcache_' && is_file($this->tempfilesystempath.'/'.$filename)) {
								unlink($this->tempfilesystempath.'/'.$filename);
							}
						}
					}
				}
				if(isset($_POST['podPressMedia'])) {
					$i=0;
					foreach ($_POST['podPressMedia'] as $mediafiledata) {
						if ( !empty($mediafiledata['URI']) ) {
							foreach ($mediafiledata as $key => $value) {
								switch ($key) {
									case 'URI' :
										if ( isset($mediafiledata['podPressMedia_'.$i.'_cleanURI']) AND 'yes' === $mediafiledata['podPressMedia_'.$i.'_cleanURI']) {
											$verifiedMedia[$i][$key] = clean_url($value, array('http', 'https'), 'db');
										} else {
											$verifiedMedia[$i][$key] = trim($value);
										}
									break;
									case 'title' :
										$verifiedMedia[$i][$key] = htmlspecialchars(strip_tags(trim($value)), ENT_QUOTES, $blog_charset);
									break;
									case 'size' :
									case 'dimensionW' :
									case 'dimensionH' :
										$value = strip_tags(trim($value));
										$verifiedMedia[$i][$key] = intval(preg_replace('/[^0-9]/', '', $value));
									break;
									case 'duration':
										$value = strip_tags(trim($value));
										$result = preg_match('/(^([0-9]{1,3})(:([0-5][0-9])){0,1}(:([0-5][0-9])$))/', $value, $b);
										if (!empty($b) AND 0 < $result) {
											$verifiedMedia[$i][$key] = $value;
										} else {
											$verifiedMedia[$i][$key] = '';
										}
									break;
									default :
										$verifiedMedia[$i][$key] = $value;
									break;
								}
							}
						}
						$i++;
					}
					delete_post_meta($post_id, '_podPressMedia');
					if(!empty($verifiedMedia)) {
						if($this->settings['enablePodangoIntegration']) {
							foreach ($verifiedMedia as $key=>$val) {
								if(substr($val['URI'], 0, strlen('Podango:')) == 'Podango:') {
									$fileNameParts = explode(':', $val['URI']);
									$podPressPostSpecific['PodangoPodcastID'] = $fileNameParts[1];
									$podPressPostSpecific['PodangoMediaFileID'] = $fileNameParts[2];
									$podPressPostSpecific['PodangoEpisodeID'] = $fileNameParts[3];

									if(empty($podPressPostSpecific['PodangoMediaFileID'])) {
										// need to add the mediafileID lookup
									}

									if(empty($podPressPostSpecific['PodangoEpisodeID'])) {
										if($this->settings['podangoDefaultPodcast'] == '##ALL##') {
											$podangoPodcastID = (int)$_POST['podPressPodangoPodcastID'];
										} else {
											$podangoPodcastID = $this->settings['podangoDefaultPodcast'];
										}
										$podPressPostSpecific['PodangoEpisodeID'] = $this->podangoapi->CreateEpisode($podangoPodcastID, $_POST['post_title'], $_POST['content'], '', $podPressPostSpecific['PodangoMediaFileID']);
									} else {
										$this->podangoapi->UpdateEpisode($podPressPostSpecific['PodangoEpisodeID'], $_POST['post_title'], $_POST['content'], '', $podPressPostSpecific['PodangoMediaFileID']);
									}
									$val['URI'] = $this->podangoapi->mediaTrackerURL.'555/'.$podPressPostSpecific['PodangoEpisodeID'].'/'.$fileNameParts[4];
									$verifiedMedia[$key] = $val;
									unset($fileNameParts);
								}
							}
						}
						podPress_add_post_meta($post_id, '_podPressMedia', $verifiedMedia, true) ;
					}
				}
				if(isset($_POST['iTunesSubtitleChoice']) AND $_POST['iTunesSummaryChoice'] AND $_POST['iTunesKeywordsChoice'] AND $_POST['iTunesAuthorChoice'] AND $_POST['iTunesExplicit'] AND $_POST['iTunesBlock']) {
					if($_POST['iTunesSubtitleChoice'] == 'Custom' && !empty($_POST['iTunesSubtitle'])) {
						$podPressPostSpecific['itunes:subtitle'] = htmlspecialchars(strip_tags(trim($_POST['iTunesSubtitle'])), ENT_QUOTES, $blog_charset);
					} else {
						$podPressPostSpecific['itunes:subtitle'] = '##PostExcerpt##';
					}

					if ($_POST['iTunesSummaryChoice'] == 'Custom' && !empty($_POST['iTunesSummary'])) {
						$podPressPostSpecific['itunes:summary'] = htmlspecialchars(strip_tags(trim($_POST['iTunesSummary'])), ENT_QUOTES, $blog_charset);
					} elseif ($_POST['iTunesSummaryChoice'] == 'Global') {
						$podPressPostSpecific['itunes:summary'] = '##Global##';
					} elseif ($_POST['iTunesSummaryChoice'] == 'PostContentShortened') {
						$podPressPostSpecific['itunes:summary'] = '##PostContentShortened##';
					} else {
						$podPressPostSpecific['itunes:summary'] = '##PostExcerpt##';
					}

					if($_POST['iTunesKeywordsChoice'] == 'Custom' && !empty($_POST['iTunesKeywords'])) {
						$podPressPostSpecific['itunes:keywords'] = $this->cleanup_itunes_keywords($_POST['iTunesKeywords']);
					} elseif ($_POST['iTunesKeywordsChoice'] == 'Global') {
						$podPressPostSpecific['itunes:keywords'] = '##Global##';
					} elseif ($_POST['iTunesKeywordsChoice'] == 'post_tags') {
						$podPressPostSpecific['itunes:keywords'] = '##post_tags##';
					} else {
						$podPressPostSpecific['itunes:keywords'] = '##WordPressCats##';
					}

					if($_POST['iTunesAuthorChoice'] == 'Custom' && !empty($_POST['iTunesAuthor'])) {
						$podPressPostSpecific['itunes:author'] = htmlspecialchars(strip_tags(trim($_POST['iTunesAuthor'])), ENT_QUOTES, $blog_charset);
					} else {
						$podPressPostSpecific['itunes:author'] = '##Global##';
					}

					if($_POST['iTunesExplicit']) {
						$podPressPostSpecific['itunes:explicit'] = $_POST['iTunesExplicit'];
					} else {
						$podPressPostSpecific['itunes:explicit'] = 'No';
					}

					if($_POST['iTunesBlock']) {
						$podPressPostSpecific['itunes:block'] = $_POST['iTunesBlock'];
					} else {
						$podPressPostSpecific['itunes:block'] = 'No';
					}
					
					delete_post_meta($post_id, '_podPressPostSpecific');
					podPress_add_post_meta($post_id, '_podPressPostSpecific', $podPressPostSpecific, true);
				}
				$post->podPressPostSpecific = $podPressPostSpecific;
				
				
				/*
				if(class_exists(snoopy)) {
					if(!empty($this->settings['iTunes']['FeedID'])) {
						$client = new Snoopy();
						$client->_fp_timeout = 10;
						$x = $client->fetch('https://phobos.apple.com/WebObjects/MZFinance.woa/wa/pingPodcast?id='.$this->settings['iTunes']['FeedID']);
					} elseif(!empty($this->settings['iTunes']['feedURL'])) {
						$client = new Snoopy();
						$client->_fp_timeout = 10;
						$x = $client->fetch('https://phobos.apple.com/WebObjects/MZFinance.woa/wa/pingPodcast?feedURL='.$this->settings['iTunes']['feedURL']);
					}
				}
				 */
			} else {
				return;
			}
		}

		function edit_category_form($input) {
			global $wp_version, $action;
			if ( ('edit' == $_GET['action'] AND TRUE == version_compare($wp_version, '2.7', '<')) OR 'edit' == $action ) { // show the following form only when an existing category is going to be edited. 			
			if (TRUE == version_compare($wp_version, '2.9.3','>') ) { // since WP 3.0 the cat_ID isreplaced by tag_ID
				$data = podPress_get_option('podPress_category_'.$_GET['tag_ID']);
			} else {
				$data = podPress_get_option('podPress_category_'.$input->cat_ID);
			}
			$blog_charset = get_bloginfo('charset');
			if (empty($data['podcastFeedURL'])) {
				if (TRUE == version_compare($wp_version, '2.9.3','>') ) { // since WP 3.0 the cat_ID isreplaced by tag_ID
					$data['podcastFeedURL'] = get_term_feed_link($_GET['tag_ID']);
				} elseif ( TRUE == version_compare($wp_version, '2.9.3','<=') AND TRUE == version_compare($wp_version, '2.4','>') ) {
					$data['podcastFeedURL'] = get_category_feed_link($_GET['cat_ID']);
				} else {
					$data['podcastFeedURL'] = get_option('siteurl').'/?feed=rss2&cat='.$input->cat_ID;
				}
			} else {
				$url_parts = parse_url($data['podcastFeedURL']);
				if (isset($url_parts['query'])) {
					$output='';
					parse_str($url_parts['query'], $output);
					if ( TRUE === isset($output['cat']) AND FALSE !== empty($output['cat']) ) {
						if (TRUE == version_compare($wp_version, '2.9.3','>') ) { // since WP 3.0 the cat_ID isreplaced by tag_ID
							$data['podcastFeedURL'] = get_term_feed_link($_GET['tag_ID']);
						} elseif ( TRUE == version_compare($wp_version, '2.9.3','<=') AND TRUE == version_compare($wp_version, '2.4','>') ) {
							$data['podcastFeedURL'] = get_category_feed_link($_GET['cat_ID']);
						} else {
							$data['podcastFeedURL'] = get_option('siteurl').'/?feed=rss2&cat='.$input->cat_ID;
						}
					}
				}
			}
			
			// some ids of category input fields have changed with WP 3.0
			$wp_version_parts = explode('.', $wp_version);
			if (is_array($wp_version_parts)) {
				$main_wp_version = $wp_version_parts[0];
			} else {
				$main_wp_version = 0;
			}
			
			echo '<div class="wrap">'."\n";
			
			if ( TRUE == version_compare($wp_version, '2.7', '>=') ) {
				echo '<div id="podpress-icon" class="icon32"><br /></div>';
			} 

			echo '	<h2>'.__('podPress Category Casting', 'podpress').'</h2>'."\n";
			echo '	<label for="categoryCasting"><strong>'.__('Enable Category Casting', 'podpress').'</strong></label>  <a href="javascript:void(null);" onclick="javascript: podPressShowHideDiv(\'categoryCastingHelp\');">(?)</a>:';
			echo '	<input type="checkbox" name="categoryCasting" id="categoryCasting" '; if($data['categoryCasting'] == 'true') { echo 'checked="checked"'; } echo ' onclick="javascript: podPress_updateCategoryCasting('.$main_wp_version.');"/>'."\n";
			echo '	<div id="categoryCastingHelp" style="display: none;">'."\n";
			echo '		'.__('This feature is for cases in which you want to host more than one podcast in one blog or if you want to have different podcast feeds with different media files of certain file types per feed (e.g a feed which contains only .mp3 files).<br />Basically this feature gives you the opportunity to modify some of the feed elements and set them to other then as the general value from the Feed/iTunes Settings of podPress.<br/>For instance: If you organize your audio episodes in one category and the video episodes in a different category then you can modify the feed content describing values like the title or the description in the form below. This your category feeds will be more distinguishable from another.', 'podpress').'<br />'."\n";
			echo '	</div>'."\n";

			echo '  <div class="wrap" id="iTunesSpecificSettings" style="display: none; border: 0;">'."\n";
			
			podPress_DirectoriesPreview('edit_category_form');
			
			echo '		<fieldset class="options">'."\n";
			echo '		<legend>'.__('Category Feed Options', 'podpress').'</legend>'."\n";
			echo '		<h3>'.__('iTunes Settings', 'podpress').'</h3>'."\n";
			echo '		<table class="podpress_feed_gensettings">'."\n";
			echo '			<tr> '."\n";
			echo '				<th>';
			echo '					<label for="iTunesFeedID">'.__('iTunes:FeedID', 'podpress').'</label>';
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<input name="iTunesFeedID" id="iTunesFeedID" type="text" value="'.attribute_escape($data['iTunesFeedID']).'" size="10" />';
			echo '				</td>'."\n";
			echo '			</tr>'."\n";

			echo '			<tr> '."\n";
			echo '				<th>';
			echo '					<label for="iTunesNewFeedURL">'.__('iTunes:New-Feed-Url', 'podpress').'</label>';
			echo '				</th>';
			echo '				<td>';
			echo '					<select name="iTunesNewFeedURL" id="iTunesNewFeedURL">'."\n";
			echo '						<option value="##Global##" '; if($data['iTunesNewFeedURL'] == '##Global##' || empty($data['iTunesNewFeedURL'])) { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').'</option>'."\n";
			echo '						<option value="Disable" '; if($data['iTunesNewFeedURL'] == 'Disable') { echo 'selected="selected"'; } echo '>'.__('Disable', 'podpress').'</option>'."\n";
			echo '						<option value="Enable" '; if($data['iTunesNewFeedURL'] == 'Enable') { echo 'selected="selected"'; } echo '>'.__('Enable', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '				</td>';
			echo '				<td>';
			echo '					'.__('If you want to change the URL of your podcast feed which you have used in the iTunes Store then change the "Podcast Feed URL" and set this option to "Enable" until the iTunes Store recognizes the new URL. This may take several days. "Enable" will add the <code>&lt;itunes:new-feed-url&gt;</code> tag to the RSS feeds and set the "Podcast Feed URL" as the new URL. For further information about "<a href="http://www.apple.com/itunes/podcasts/specs.html#changing" title="iTunes Podcasting Resources: Changing Your Feed URL" target="_blank">Changing Your Feed URL</a>" read on in the <a href="http://www.apple.com/itunes/podcasts/specs.html" target="_blank" title="iTunes Podcasting Resources: Making a Podcast">iTunes Podcasting Resources</a>.', 'podpress')."\n";
			echo '					<p><label for="podcastFeedURL"><strong>'.__('the new Feed URL', 'podpress').'</strong></label>';
			echo '					<br/>';
			echo '					<input type="text" id="podcastFeedURL" name="podcastFeedURL" class="podpress_wide_text_field" size="40" value="'.attribute_escape($data['podcastFeedURL']).'" /><br />'.__('The URL of your Podcast Feed. If you want to register your podcast at the iTunes Store or if your podcast is already listed there then this input field should contain the same URL as in the iTunes Store settings. If you want change the URL at the iTunes Store then please read first the help text of the iTunes:New-Feed-Url option.', 'podpress');
			echo '					<br /><input type="button" value="'.__('Validate your Feed','podpress').'" onclick="javascript: if(document.getElementById(\'podcastFeedURL\').value != \'\') { window.open(\'http://www.feedvalidator.org/check.cgi?url=\'+document.getElementById(\'podcastFeedURL\').value); }"/>'."\n";
			echo '				</p></td>'."\n";
			echo '			</tr>'."\n";

			echo '			<tr>'."\n";
			echo '				<th>';
			echo '					<label for="iTunesSummaryChoice">'.__('iTunes:Summary', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="iTunesSummaryChoice" name="iTunesSummaryChoice" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="Global" '; if($data['iTunesSummaryChoice'] != 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').'</option>'."\n";
			echo '						<option value="Custom" '; if($data['iTunesSummaryChoice'] == 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<input type="hidden" id="global_iTunesSummary" value="'.attribute_escape(stripslashes($this->settings['iTunes']['summary'])).'" />'."\n";
			echo '					<div id="iTunesSummaryWrapper" style="display: none;">'."\n";
			echo '						<textarea name="iTunesSummary" id="iTunesSummary" class="podpress_wide_text_field" rows="4" cols="40" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'.stripslashes($data['iTunesSummary']).'</textarea>'."\n";
			echo '					</div>'."\n";
			echo '					<div id="iTunesSummaryHelp">'."\n";
			echo '						'.__('By default this is taken from the blog Post text.', 'podpress')."\n";
			echo '					</div>'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";

			echo '			<tr>'."\n";
			echo '				<th>';
			echo '					<label for="iTunesImageChoice">'.__('iTunes:Image', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					'.__('The iTunes image should be a square image with <a href="http://www.apple.com/itunes/podcasts/specs.html#image" target="_blank">at least 600 x 600 pixels</a> as Apple writes in "<a href="http://www.apple.com/itunes/podcasts/specs.html" target="_blank">Making a Podcast</a>" of their own Podcasting Resources. iTunes supports JPEG and PNG images (the file name extensions should ".jpg" or ".png").', 'podpress')."\n";
			echo '					<br/>';
			echo '					<select id="iTunesImageChoice" name="iTunesImageChoice" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="Global" '; if($data['iTunesImageChoice'] != 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').'</option>'."\n";
			echo '						<option value="Custom" '; if($data['iTunesImageChoice'] == 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<div id="iTunesImageWrapper" style="display: none;">'."\n";
			echo '						<br/>';
			echo '						<input id="iTunesImage" type="text" name="iTunesImage" value="'.$data['iTunesImage'].'" class="podpress_wide_text_field" size="40" onchange="podPress_updateCategoryCasting('.$main_wp_version.');"/>'."\n";
			echo '						<input id="global_iTunesImage" type="hidden" value="'.$this->settings['iTunes']['image'].'"/>'."\n";
			echo '					</div>'."\n";
			echo '					<br/>';
			echo '					<img id="itunes_image_display" style="width:300px; height:300px;" alt="Podcast Image - Big" src="" /><br />'."\n";
			echo '					<em>'.__('(This image is only a preview which is limited to 300 x 300 pixels.) ', 'podpress').'</em>';
			echo '				</td>'."\n";
			echo '			</tr>'."\n";

			echo '			<tr>'."\n";
			echo '				<th>';
			echo '					<label for="iTunesAuthorChoice">'.__('iTunes:Author/Owner', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="iTunesAuthorChoice" name="iTunesAuthorChoice" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="Global" '; if($data['iTunesAuthorChoice'] != 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.podPress_stringLimiter(ucfirst(stripslashes($this->settings['iTunes']['author'])), 40).')</option>'."\n";
			echo '						<option value="Custom" '; if($data['iTunesAuthorChoice'] == 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<div id="iTunesAuthorWrapper" style="display: none;">'."\n";
			echo '						<input type="text" name="iTunesAuthor" class="podpress_wide_text_field" size="40" id="iTunesAuthor" value="'.attribute_escape(stripslashes($data['iTunesAuthor'])).'" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');"/>';
			echo '						<input type="hidden" id="global_iTunesAuthor" value="'.attribute_escape(stripslashes($this->settings['iTunes']['author'])).'" />'."\n";
			echo '					</div>'."\n";
			echo '					<div id="iTunesAuthorHelp">'."\n";
			echo '						'.__('Used if this Author is different than the feeds author.', 'podpress')."\n";
			echo '					</div>'."\n";
			echo '				</td>'."\n";
			echo '			<tr>'."\n";
			echo '			</tr>'."\n";
			echo '				<th>';
			echo '					<label for="iTunesAuthorEmailChoice">'.__('Owner E-mail address', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="iTunesAuthorEmailChoice" name="iTunesAuthorEmailChoice" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="Global" '; if($data['iTunesAuthorEmailChoice'] != 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.podPress_stringLimiter(ucfirst(stripslashes(get_option('admin_email'))), 40).')</option>'."\n";
			echo '						<option value="Custom" '; if($data['iTunesAuthorEmailChoice'] == 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<div id="iTunesAuthorEmailWrapper" style="display: none;">'."\n";
			echo '						<input type="text" name="iTunesAuthorEmail" class="podpress_wide_text_field" size="40" id="iTunesAuthorEmail" value="'.attribute_escape(stripslashes($data['iTunesAuthorEmail'])).'" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');"/>';
			echo '						<input type="hidden" id="global_iTunesAuthorEmail" value="'.attribute_escape(stripslashes(get_option('admin_email'))).'" />'."\n";
			echo '					</div>'."\n";
			echo '					<div id="iTunesAuthorEmailHelp">'."\n";
			echo '						'.__('Used if the owner of this category is different than the feeds owner.', 'podpress')."\n";
			echo '					</div>'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";

			echo '			<tr>'."\n";
			echo '				<th>';
			echo '					<label for="iTunesSubtitleChoice">'.__('iTunes:Subtitle', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="iTunesSubtitleChoice" name="iTunesSubtitleChoice" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="Global" '; if($data['iTunesSubtitleChoice'] != 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').'</option>'."\n";
			echo '						<option value="Custom" '; if($data['iTunesSubtitleChoice'] == 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<div id="iTunesSubtitleWrapper" style="display: none;">'."\n";
			echo '						<textarea name="iTunesSubtitle" class="podpress_wide_text_field" rows="4" cols="40">'.stripslashes($data['iTunesSubtitle']).'</textarea>'."\n";
			echo '					</div>'."\n";
			echo '					<div id="iTunesSubtitleHelp">'."\n";
			echo '						'.__('By default this is taken from the first 255 characters of the blog Post text.', 'podpress')."\n";
			echo '					</div>'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";

			echo '			<tr>'."\n";
			echo '				<th>';
			echo '					<label for="iTunesKeywordsChoice">'.__('iTunes:Keywords', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="iTunesKeywordsChoice" name="iTunesKeywordsChoice" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="Global" '; if($data['iTunesKeywordsChoice'] != 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.podPress_stringLimiter(stripslashes($this->settings['iTunes']['keywords']), 40).')</option>'."\n";
			echo '						<option value="Custom" '; if($data['iTunesKeywordsChoice'] == 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<div id="iTunesKeywordsWrapper">'."\n";
			echo '						'.__('a list of max. 12 comma separated words', 'podpress').'<br/><textarea name="iTunesKeywords" rows="4" cols="40">'.stripslashes($data['iTunesKeywords']).'</textarea>'."\n";
			echo '					</div>'."\n";
			echo '					<div id="iTunesKeywordsHelp">'."\n";
			echo '						'.__('Not visible in iTunes, but used for searches.', 'podpress')."\n";
			echo '					</div>'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";

			echo '			<tr> '."\n";
			echo '				<th>';
			echo '					<label for="iTunesCategory_0">'.__('iTunes:Categories', 'podpress').'</label>';
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="iTunesCategory_0" name="iTunesCategory[0]" onchange="podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<optgroup label="'.__('Select Primary', 'podpress').'">'."\n";
			if ('' == trim($this->settings['iTunes']['category'][0])) {
				$current_global = '[ '.__('nothing', 'podpress').' ]';
			} else {
				$current_global = $this->settings['iTunes']['category'][0];
			}
			echo '						<option value="##Global##" '; if($data['iTunesCategory'][0] == '##Global##' || empty($data['iTunesCategory'][0])) { echo 'selected="selected"'; } echo '>'.__('Use Global', 'podpress').' ('.$current_global.')</option>'."\n";
			if (empty($data['iTunesCategory'][0])) {
				podPress_itunesCategoryOptions('##Global##');
			} else {
				podPress_itunesCategoryOptions(stripslashes($data['iTunesCategory'][0]));
			}
			echo '						</optgroup>'."\n";
			echo '					</select><br/>'."\n";
			echo '					<input type="hidden" id="global_iTunesCategory" value="'.attribute_escape($this->settings['iTunes']['category'][0]).'" />'."\n";
			echo '					<select name="iTunesCategory[1]">'."\n";
			echo '						<optgroup label="'.__('Select Second', 'podpress').'">'."\n";
			if ('' == trim($this->settings['iTunes']['category'][1])) {
				$current_global = '[ '.__('nothing', 'podpress').' ]';
			} else {
				$current_global = $this->settings['iTunes']['category'][1];
			}
			echo '						<option value="##Global##" '; if($data['iTunesCategory'][1] == '##Global##' || empty($data['iTunesCategory'][1])) { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.$current_global.')</option>'."\n";
			if (empty($data['iTunesCategory'][1])) {
				podPress_itunesCategoryOptions('##Global##');
			} else {
				podPress_itunesCategoryOptions(stripslashes($data['iTunesCategory'][1]));
			}
			echo '						</optgroup>'."\n";
			echo '					</select><br/>'."\n";
			echo '					<select name="iTunesCategory[2]">'."\n";
			echo '						<optgroup label="'.__('Select Third', 'podpress').'">'."\n";
			if ('' == trim($this->settings['iTunes']['category'][2])) {
				$current_global = '[ '.__('nothing', 'podpress').' ]';
			} else {
				$current_global = $this->settings['iTunes']['category'][2];
			}
			echo '						<option value="##Global##" '; if($data['iTunesCategory'][2] == '##Global##' || empty($data['iTunesCategory'][2])) { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.$current_global.')</option>'."\n";
			if (empty($data['iTunesCategory'][2])) {
				podPress_itunesCategoryOptions('##Global##');
			} else {
				podPress_itunesCategoryOptions(stripslashes($data['iTunesCategory'][2]));
			}
			echo '						</optgroup>'."\n";
			echo '					</select>'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";

			echo '			<tr>'."\n";
			echo '				<th>';
			echo '					<label for="iTunesExplicit">'.__('iTunes:Explicit', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="iTunesExplicit" name="iTunesExplicit" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="##Global##" '; if($data['iTunesExplicit'] == '##Global##' || empty($data['iTunesExplicit'])) { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.$this->settings['iTunes']['explicit'].')</option>'."\n";
			echo '						<option value="No" '; if($data['iTunesExplicit'] == 'No') { echo 'selected="selected"';	}	echo '>'.__('No', 'podpress').'</option>'."\n";
			echo '						<option value="Yes" '; if($data['iTunesExplicit'] == 'Yes') { echo 'selected="selected"';	}	echo '>'.__('Yes', 'podpress').'</option>'."\n";
			echo '						<option value="Clean" '; if($data['iTunesExplicit'] == 'Clean') { echo 'selected="selected"';	}	echo '>'.__('Clean', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<div id="iTunesExplicitHelp">'."\n";
			echo '					'.__('Setting to indicate (in iTunes) whether or not your podcast contains explicit language or adult content', 'podpress')."\n";
			echo '					<br/>'.__('"No" (default) - no indicator will show up', 'podpress')."\n";
			echo '					<br/>'.__('"Yes" - an "EXPLICIT" parental advisory graphic will appear next to your podcast artwork or name in iTunes', 'podpress')."\n";
			echo '					<br/>'.__('"Clean" - means that you are sure that no explicit language or adult content is included any of the episodes, and a "CLEAN" graphic will appear', 'podpress')."\n";
			echo '					<p>'.__('You have also the possibility to adjust this option for each post or page with at least one podcast episode (in the post/page editor).', 'podpress').'</p>'."\n";
			echo '					</div>'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";

			echo '			<tr>'."\n";
			echo '				<th>';
			echo '					<label for="iTunesBlock">'.__('iTunes:Block', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="iTunesBlock" name="iTunesBlock" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="##Global##" '; if($data['iTunesBlock'] != '##Global##' || empty($data['itunesBlock'])) { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.$this->settings['iTunes']['block'].')</option>'."\n";
			echo '						<option value="No" '; if($data['iTunesBlock'] == 'No') { echo 'selected="selected"';	}	echo '>'.__('No', 'podpress').'</option>'."\n";
			echo '						<option value="Yes" '; if($data['iTunesBlock'] == 'Yes') { echo 'selected="selected"';	}	echo '>'.__('Yes', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<div id="itunesBlockHelp">'."\n";
			echo '					'.__('Use this if you are no longer creating a podcast and you want it removed from the iTunes Store.', 'podpress')."\n";
			echo '					<br/>'.__('"No" (default) - the podcast appears in the iTunes Podcast directory', 'podpress')."\n";
			echo '					<br/>'.__('"Yes" - prevent the entire podcast from appearing in the iTunes Podcast directory', 'podpress')."\n";
			echo '					<p>'.__('You can also use such an option for each of your podcast episodes (in the post/page editor).', 'podpress').'</p>'."\n";
			echo '					</div>'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";
			echo '		</table>'."\n";
			
			
			echo '		<h3>'.__('General Feed Settings', 'podpress').'</h3>'."\n";
			echo '		<table class="podpress_feed_gensettings">'."\n";
			echo '			<tr>'."\n";
			echo '				<th>';
			echo '					<label for="blognameChoice">'.__('Podcast title / Feed title', 'podpress').'</label>';
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="blognameChoice" name="blognameChoice" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="Append" '; if ($data['blognameChoice'] == 'Append' || empty($data['blognameChoice']) ) { echo 'selected="selected"'; } echo '>'.__('Use the Site Title and append the name of the category', 'podpress').'</option>'."\n";
			echo '						<option value="Global" '; if ( $data['blognameChoice'] == 'Global' ) { echo 'selected="selected"';	} echo '>'.__('Use the Site Title', 'podpress').'</option>'."\n";
			echo '						<option value="CategoryName" '; if ( $data['blognameChoice'] == 'CategoryName' ) { echo 'selected="selected"'; } echo '>'.__('Use the name of the category', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<input type="hidden" id="global_blogname" value="'.attribute_escape(stripslashes(get_option('blogname'))).'" /></td>'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";
			echo '			<tr>'."\n";
			echo '				<th>';
			echo '					<label for="blogdescriptionChoice">'.__('Description (Tagline)', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="blogdescriptionChoice" name="blogdescriptionChoice" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="Global" '; if($data['blogdescriptionChoice'] != 'CategoryDescription') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').'</option>'."\n";
			echo '						<option value="CategoryDescription" '; if($data['blogdescriptionChoice'] == 'CategoryDescription') { echo 'selected="selected"';	}	echo '>'.__('Use Category Description', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<input type="hidden" id="global_blogdescription" value="'.attribute_escape(stripslashes(get_option('blogdescription'))).'" />'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";
			echo '			<tr>'."\n";
			echo '				<th>';
			echo '					<label for="rss_imageChoice">'.__('Blog/RSS Image (144 x 144 pixels)', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="rss_imageChoice" name="rss_imageChoice" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="Global" '; if($data['rss_imageChoice'] != 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').'</option>'."\n";
			echo '						<option value="Custom" '; if($data['rss_imageChoice'] == 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<div id="rss_imageWrapper" style="display: none;">'."\n";
			echo '						<br/>';
			echo '						<input id="rss_image" type="text" name="rss_image" value="'.$data['rss_image'].'" class="podpress_wide_text_field" size="40" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');"/>'."\n";
			echo '						<input id="global_rss_image" type="hidden" value="'.get_option('rss_image').'"/>'."\n";
			echo '					</div>'."\n";
			echo '					<br/>';
			echo '					<img id="rss_image_Display" style="width:144px; height:144px;" alt="Podcast Image - Small" src="" />'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";
			echo '			<tr>'."\n";
			echo '				<th>';
			echo '					<label for="rss_language">'.__('Language', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			$langs = podPress_itunesLanguageArray();
			echo '					<select id="rss_language" name="rss_language" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<optgroup label="'.__('Select Language', 'podpress').'">'."\n";
			echo '						<option value="##Global##" '; if($data['rss_language'] == '##Global##' || empty($data['rss_language'])) { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' - '.$langs[get_option('rss_language')].' ['.get_option('rss_language').']</option>'."\n";
			podPress_itunesLanguageOptions($data['rss_language']);
			echo '						</optgroup>'."\n";
			echo '					</select>'."\n";
			echo '					<input type="hidden" id="global_rss_language" value="'.$langs[get_option('rss_language')].'['.attribute_escape(get_option('rss_language')).']" /></td>'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";
			echo '		</table>'."\n";
			
			echo '		<h3>'.__('Further Feed Settings', 'podpress').'</h3>'."\n";
			echo '		<table class="podpress_feed_gensettings">'."\n";
			echo '			<tr>'."\n";
			echo '				<th>'."\n";
			echo '					<label for="rss_copyrightChoice">'.__('Feed Copyright / license name', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="rss_copyrightChoice" name="rss_copyrightChoice" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="Global" '; if($data['rss_copyrightChoice'] != 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.podPress_stringLimiter(ucfirst(stripslashes($this->settings['rss_copyright'])), 40).')</option>'."\n";
			echo '						<option value="Custom" '; if($data['rss_copyrightChoice'] == 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<div id="rss_copyrightWrapper" style="display: none;">'."\n";
			echo '						<input type="text" name="rss_copyright" class="podpress_wide_text_field" size="40" id="rss_copyright" value="'.attribute_escape(stripslashes($data['rss_copyright'])).'" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');"/>';
			echo '					</div>'."\n";
			echo '					<input type="hidden" id="global_rss_copyright" value="'.attribute_escape(stripslashes($this->settings['rss_copyright'])).'" />'."\n";
			echo '					<div id="rss_copyrightHelp">'."\n";
			echo '						'.__('Enter the copyright string resp. the license name. For example: Copyright &#169 by Jon Doe, 2009 OR <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" target="_blank">CreativeCommons Attribution-Noncommercial-Share Alike 2.5</a>', 'podpress')."\n";
			echo '						<p>'."\n";
			echo '						'.__('Used if this copyright phrase should be different than the global copyright phrase.', 'podpress')."\n";
			echo '						</p>'."\n";
			echo '					</div>'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";
			echo '			<tr>'."\n";
			echo '				<th>'."\n";
			echo '					<label for="rss_license_urlChoice">'.__('URL to the full Copyright / license text', 'podpress').'</label>'."\n";
			echo '				</th>';
			echo '				<td colspan="2">';
			echo '					<select id="rss_license_urlChoice" name="rss_license_urlChoice" onchange="javascript: podPress_updateCategoryCasting('.$main_wp_version.');">'."\n";
			echo '						<option value="Global" '; if($data['rss_license_urlChoice'] != 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Use Global', 'podpress').' ('.podPress_stringLimiter(ucfirst(stripslashes($this->settings['rss_license_url'])), 40).')</option>'."\n";
			echo '						<option value="Custom" '; if($data['rss_license_urlChoice'] == 'Custom') { echo 'selected="selected"';	}	echo '>'.__('Insert custom value', 'podpress').'</option>'."\n";
			echo '					</select>'."\n";
			echo '					<div id="rss_license_urlWrapper" style="display: none;">'."\n";
			echo '						<input name="rss_license_url" type="text" id="rss_license_url" class="podpress_wide_text_field" value="'.attribute_escape($data['rss_license_url']).'" size="65%" />'."\n";
			echo '					</div>'."\n";
			echo '					<input type="hidden" id="global_rss_license_url" value="'.attribute_escape($this->settings['rss_license_url']).'" />'."\n";
			echo '					<div id="rss_license_urlHelp">'."\n";
			echo '						'.__('If you use a special license like a <a href="http://creativecommons.org/licenses" target="_blank" title="Creative Commons">Creative Commons</a> License for your news feeds then enter the complete URL (e.g. <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" target="_blank">http://creativecommons.org/licenses/by-nc-sa/2.5/</a>) to the full text of this particular license here.', 'podpress')."\n";
			echo '						<p>'.__('Used if this license URL should be different than the global license URL.', 'podpress').'</p>'."\n";
			echo '					</div>'."\n";
			echo '				</td>'."\n";
			echo '			</tr>'."\n";
			echo '			<tr>'."\n";
			$filetypes = podPress_filetypes();
			$selected_types = $data['FileTypes'];
			if (FALSE === is_array($data['FileTypes'])) {
				$selected_types = array();
			}
			echo '				<th>';
			echo '				'.__('inlude only files of this(these) type(s)', 'podpress');
			echo '				</th>'."\n";
			echo '				<td>';
			echo '					<select id="filenameextensionfilter" name="FileTypes[]" size="5" multiple="multiple" style="height:15em;">'."\n";		
			echo '					<optgroup label="'.attribute_escape(__('Select file types', 'podpress')).'">'."\n";
			foreach ( $filetypes as $key => $value ) {
				if ( TRUE == in_array($key, $selected_types) ) {
					$selected = ' selected="selected"';
				} else {
					$selected = '';
				}
				if ($key !== 'audio_mp4') {
					echo '						<option value="'.$key.'"'.$selected.'>'.$value.'</option>';
				}
			}
			echo '					</optgroup>'."\n";
			echo '					</select>'."\n";
			echo '				</td>'."\n";
			echo '				<td>';
			echo '					'.__('You can select one or more media file types and limit by this choice the number of posts which will appear in the this Feed. For instance: if you select MP4 Video then this Feed will only contain posts (of this category) with MP4 files. If a post has also files of other types then only the files of the selected type will be attached in this feed. (This filter bypasses the "Included in:" selection.)', 'podpress').'</p><p>'.__('Hold the key [SHIFT] or [CTRL] and use the left mouse button to select more than one value.<br />Hold [CTRL] and use the left mouse button to deselect values.', 'podpress');		
			echo '				</td>'."\n";
			echo '			</tr>'."\n";
			
			echo '			<tr>'."\n";
			echo '				<th>';
			echo '				<label for="show_only_podPress_podcasts">'.__('Include only posts with podPress attachments in this Feed', 'podpress').'</label>'."\n";
			echo '				</th>'."\n";
			echo '				<td>';
			if ( TRUE == isset($data['show_only_podPress_podcasts']) AND FALSE === $data['show_only_podPress_podcasts'] ) {
				echo '					<input type="checkbox" name="show_only_podPress_podcasts" id="show_only_podPress_podcasts" value="yes" />'."\n";
			} else {
				echo '					<input type="checkbox" name="show_only_podPress_podcasts" id="show_only_podPress_podcasts" value="yes" checked="checked" />'."\n";
			}
			echo '				</td>'."\n";
			echo '				<td>';
			echo '					'.__('works only while the File Type Filter is not in use', 'podpress');		
			echo '				</td>'."\n";
			echo '			</tr>'."\n";
			
			echo '		</table>'."\n";
			
			echo '		</fieldset>'."\n";
			echo '	</div>'."\n";

			echo '<script type="text/javascript">podPress_updateCategoryCasting('.$main_wp_version.'); </script>';
			echo '</div>'."\n";
			}
		}

		function edit_category($cat_ID) {
			global $wp_version;
			if(!isset($_POST['iTunesFeedID'])){
				return;
			}
			$blog_charset = get_bloginfo('charset');
			$data = array();
			if($_POST['categoryCasting'] == 'on') {
				$data['categoryCasting'] = 'true';
			} else {
				$data['categoryCasting'] = 'false';
			}

			$data['podcastFeedURL'] = clean_url($_POST['podcastFeedURL'], array('http', 'https'), 'db');
			$data['iTunesFeedID'] = intval(preg_replace('/[^0-9]/', '', $_POST['iTunesFeedID']));
			$data['iTunesNewFeedURL'] = $_POST['iTunesNewFeedURL'];
			$data['blognameChoice'] = $_POST['blognameChoice'];
			//~ // Attention: $data['blogname'] is here the name of the category
			//~ if ( TRUE == version_compare($wp_version, '3.0', '<') ) {
				//~ $data['blogname'] = htmlspecialchars(strip_tags(trim($_POST['cat_name'])), ENT_QUOTES, $blog_charset);
			//~ } else {
				//~ $data['blogname'] = htmlspecialchars(strip_tags(trim($_POST['name'])), ENT_QUOTES, $blog_charset);
			//~ }
			$data['blogdescriptionChoice'] = $_POST['blogdescriptionChoice'];
			$data['iTunesSubtitleChoice'] = $_POST['iTunesSubtitleChoice'];
			$data['iTunesSubtitle'] = htmlspecialchars(strip_tags(trim($_POST['iTunesSubtitle'])), ENT_QUOTES, $blog_charset);
			$data['iTunesSummaryChoice'] = $_POST['iTunesSummaryChoice'];
			$data['iTunesSummary'] = htmlspecialchars(strip_tags(trim($_POST['iTunesSummary'])), ENT_QUOTES, $blog_charset);
			$data['iTunesKeywordsChoice'] = $_POST['iTunesKeywordsChoice'];
			$data['iTunesKeywords'] = $this->cleanup_itunes_keywords($_POST['iTunesKeywords'], $blog_charset);
			$data['iTunesAuthorChoice'] = $_POST['iTunesAuthorChoice'];
			$data['iTunesAuthor'] = htmlspecialchars(strip_tags(trim($_POST['iTunesAuthor'])), ENT_QUOTES, $blog_charset);
			$data['iTunesAuthorEmailChoice'] = $_POST['iTunesAuthorEmailChoice'];
			$data['iTunesAuthorEmail'] = htmlspecialchars(strip_tags(trim($_POST['iTunesAuthorEmail'])), ENT_QUOTES, $blog_charset);
			$data['rss_language'] = htmlspecialchars(strip_tags(trim($_POST['rss_language'])), ENT_QUOTES, $blog_charset);
			$data['iTunesExplicit'] = $_POST['iTunesExplicit'];
			$data['iTunesBlock'] = $_POST['iTunesBlock'];
			$data['iTunesImageChoice'] = $_POST['iTunesImageChoice'];
			$data['iTunesImage'] = clean_url($_POST['iTunesImage'], array('http', 'https'), 'db');
			$data['rss_imageChoice'] = $_POST['rss_imageChoice'];
			$data['rss_image'] = clean_url($_POST['rss_image'], array('http', 'https'), 'db');
			$data['rss_copyrightChoice'] = $_POST['rss_copyrightChoice'];
			$data['rss_copyright'] = htmlspecialchars(strip_tags(trim($_POST['rss_copyright'])), ENT_QUOTES, $blog_charset);
			$data['rss_license_url'] = clean_url($_POST['rss_license_url'], array('http', 'https'), 'db');
			$data['rss_license_urlChoice'] = $_POST['rss_license_urlChoice'];
			$data['iTunesCategory'] = $_POST['iTunesCategory'];
			$data['FileTypes'] = $_POST['FileTypes'];
			if ( isset($_POST['show_only_podPress_podcasts']) ) {
				$data['show_only_podPress_podcasts'] = TRUE;
			} else {
				$data['show_only_podPress_podcasts'] = FALSE;
			}
			delete_option('podPress_category_'.$cat_ID);
			podPress_add_option('podPress_category_'.$cat_ID, $data);
		}

		//~ function delete_category($cat_ID) {
			//~ //echo 'told to delete';
			//~ //delete_option('podPress_category_'.$cat_ID);
		//~ }

	}
?>
Back to Top