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
<?php
if ( function_exists('register_sidebar') )
    register_sidebar(array(
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h2 class="widgettitle">',
        'after_title' => '</h2>',
    ));

//Add WordPress 3.0 Menu Support
add_theme_support( 'menus' );

function ct_nav() {
    if ( function_exists( 'wp_nav_menu' ) )
        wp_nav_menu( 'menu_id=nav&fallback_cb=ct_nav_fallback' );
    else
        ct_nav_fallback();
}
function ct_nav_fallback() { ?>
    <ul id="nav">
        <li<?php if (is_home()){ echo " class=\"current_page_item\"";}?>><a href="<?php bloginfo('url'); ?>">Home</a></li>
        <?php wp_list_categories('&show_count=0&title_li=&exclude='.$featuredcategory); ?>
        <?php wp_list_pages('sort_column=menu_order&title_li=&exclude='); ?>
    </ul>
<?php }
	
$includes_path = TEMPLATEPATH . '/includes/';

// Widgets
require_once ($includes_path . '/widgets.php');

//////////////////////////////////////////////Add Custom Fields to Write Post panel//////////////////////////////////////////////

$new_meta_boxes = 
array(

"image1" => array(
"name" => "image1",
"type" => "input",
"std" => "",
"title" => "Main Image URL",
"description" => "Paste the main image URL here."),

"image1alt" => array(
"name" => "image1alt",
"type" => "input",
"std" => "",
"title" => "Main Image ALT",
"description" => "Insert your image alternative text here."),

"image2" => array(
"name" => "image2",
"type" => "input",
"std" => "",
"title" => "Image Two URL",
"description" => "Paste the URL to your second image here."),

"image2alt" => array(
"name" => "image2alt",
"type" => "input",
"std" => "",
"title" => "Image Two ALT",
"description" => "Insert your image alternative text here."),

"image3" => array(
"name" => "image3",
"type" => "input",
"std" => "",
"title" => "Image Three URL",
"description" => "Paste the URL to your third image here."),

"image3alt" => array(
"name" => "image3alt",
"type" => "input",
"std" => "",
"title" => "Image Three ALT",
"description" => "Insert your image alternative text here."),

"image4" => array(
"name" => "image4",
"type" => "input",
"std" => "",
"title" => "Image Four URL",
"description" => "Paste the URL to your fourth image here."),

"image4alt" => array(
"name" => "image4alt",
"type" => "input",
"std" => "",
"title" => "Image Four ALT",
"description" => "Insert your image alternative text here."),
);

function new_meta_boxes() {
global $post, $new_meta_boxes;
	
	foreach($new_meta_boxes as $meta_box) {
		
		echo'<input type="hidden" name="'.$meta_box['name'].'_noncename" id="'.$meta_box['name'].'_noncename" value="'.wp_create_nonce( plugin_basename(__FILE__) ).'" />';
		
		echo'<h2>'.$meta_box['title'].'</h2>';
		
		if( $meta_box['type'] == "input" ) { 
		
			$meta_box_value = get_post_meta($post->ID, $meta_box['name'].'_value', true);
		
			if($meta_box_value == "")
				$meta_box_value = $meta_box['std'];
		
			echo'<input type="text" name="'.$meta_box['name'].'_value" value="'.$meta_box_value.'" size="55" /><br />';
			
		} elseif ( $meta_box['type'] == "select" ) {
			
			echo'<select name="'.$meta_box['name'].'_value">';
			
			foreach ($meta_box['options'] as $option) {

				echo'<option';
				if ( get_post_meta($post->ID, $meta_box['name'].'_value', true) == $option ) { 
					echo ' selected="selected"'; 
				} elseif ( $option == $meta_box['std'] ) { 
					echo ' selected="selected"'; 
				} 
				echo'>'. $option .'</option>';
			
			}
			
			echo'</select>';
			
		}
		
		echo'<p><label for="'.$meta_box['name'].'_value">'.$meta_box['description'].'</label></p>';
	}

}

function create_meta_box() {
global $theme_name, $new_meta_boxes;
	if (function_exists('add_meta_box') ) {
	add_meta_box( 'new-meta-boxes', 'Images', 'new_meta_boxes', 'post', 'normal', 'high' );
	}
}

function save_postdata( $post_id ) {
	global $post, $new_meta_boxes;  
		foreach($new_meta_boxes as $meta_box) {  
		
		// Verify  
		if ( !wp_verify_nonce( $_POST[$meta_box['name'].'_noncename'], plugin_basename(__FILE__) )) {  
		return $post_id;  
		}  
	
	if ( 'page' == $_POST['post_type'] ) {  
	if ( !current_user_can( 'edit_page', $post_id ))  
	return $post_id;  
	} else {  
	if ( !current_user_can( 'edit_post', $post_id ))  
	return $post_id;  
	}  
	
	$data = $_POST[$meta_box['name'].'_value'];  
	
	if(get_post_meta($post_id, $meta_box['name'].'_value') == "")  
	add_post_meta($post_id, $meta_box['name'].'_value', $data, true);  
	elseif($data != get_post_meta($post_id, $meta_box['name'].'_value', true))  
	update_post_meta($post_id, $meta_box['name'].'_value', $data);  
	elseif($data == "")  
	delete_post_meta($post_id, $meta_box['name'].'_value', get_post_meta($post_id, $meta_box['name'].'_value', true));  
	}

}

add_action('admin_menu', 'create_meta_box');
add_action('save_post', 'save_postdata');

//////////////////////////////////////////////Theme Customization Admin Panel//////////////////////////////////////////////

function customise_add_theme_page() {
	add_theme_page(__('Paramount Theme Customization'), __('Paramount Theme Customization'), 'edit_themes', basename(__FILE__), 'customise_theme_page');
}


function customise_theme_page() {
	if ($_POST['save_changes'] == "true") {
		update_option("ct_custom_logo_url", $_POST['ct_custom_logo_url']);
		update_option("ct_custom_logo_alt", $_POST['ct_custom_logo_alt']);
		update_option("ct_custom_footer_logo_url", $_POST['ct_custom_footer_logo_url']);
		update_option("ct_custom_footer_logo_alt", $_POST['ct_custom_footer_logo_alt']);
		update_option("ct_featured_category", $_POST['ct_featured_category']);
		update_option("ct_portfolio_category", $_POST['ct_portfolio_category']);
		update_option("ct_blog_category", $_POST['ct_blog_category']);
		update_option("ct_custom_aboutimg_url", $_POST['ct_custom_aboutimg_url']);
		update_option("ct_custom_aboutimg_alt", $_POST['ct_custom_aboutimg_alt']);
		update_option("ct_custom_about_title", $_POST['ct_custom_about_title']);
		update_option("ct_custom_about_text", $_POST['ct_custom_about_text']);
		update_option("ct_custom_about_link", $_POST['ct_custom_about_link']);
		update_option("ct_custom_testimonial_quote", $_POST['ct_custom_testimonial_quote']);
		update_option("ct_custom_testimonial_person", $_POST['ct_custom_testimonial_person']);
		update_option("ct_custom_testimonial_company", $_POST['ct_custom_testimonial_company']);
		update_option("ct_custom_ad1_url", $_POST['ct_custom_ad1_url']);
		update_option("ct_custom_ad1_imgurl", $_POST['ct_custom_ad1_imgurl']);
		update_option("ct_custom_ad1_alt", $_POST['ct_custom_ad1_alt']);
		update_option("ct_custom_ad2_url", $_POST['ct_custom_ad2_url']);
		update_option("ct_custom_ad2_imgurl", $_POST['ct_custom_ad2_imgurl']);
		update_option("ct_custom_ad2_alt", $_POST['ct_custom_ad2_alt']);
		update_option("ct_custom_ad3_url", $_POST['ct_custom_ad3_url']);
		update_option("ct_custom_ad3_imgurl", $_POST['ct_custom_ad3_imgurl']);
		update_option("ct_custom_ad3_alt", $_POST['ct_custom_ad3_alt']);
		update_option("ct_custom_ad4_url", $_POST['ct_custom_ad4_url']);
		update_option("ct_custom_ad4_imgurl", $_POST['ct_custom_ad4_imgurl']);
		update_option("ct_custom_ad4_alt", $_POST['ct_custom_ad4_alt']);
		update_option("ct_custom_advertise_url", $_POST['ct_custom_advertise_url']);
		update_option("ct_google_analytics", $_POST['ct_google_analytics']);
	}


	$ct_custom_logo_url = get_option("ct_custom_logo_url");
	$ct_custom_logo_alt = get_option("ct_custom_logo_alt");
	$ct_custom_footer_logo_url = get_option("ct_custom_footer_logo_url");
	$ct_custom_footer_logo_alt = get_option("ct_custom_footer_logo_alt");
	$ct_featured_category = get_option("ct_featured_category");
	$ct_portfolio_category = get_option("ct_portfolio_category");
	$ct_blog_category = get_option("ct_blog_category");
	$ct_custom_aboutimg_url = get_option("ct_custom_aboutimg_url");
	$ct_custom_aboutimg_alt = get_option("ct_custom_aboutimg_alt");
	$ct_custom_about_title = get_option("ct_custom_about_title");
	$ct_custom_about_text = get_option("ct_custom_about_text");
	$ct_custom_about_link = get_option("ct_custom_about_link");
	$ct_custom_testimonial_quote = get_option("ct_custom_testimonial_quote");
	$ct_custom_testimonial_person = get_option("ct_custom_testimonial_person");
	$ct_custom_testimonial_company = get_option("ct_custom_testimonial_company");
	$ct_custom_ad1_url = get_option("ct_custom_ad1_url");
	$ct_custom_ad1_imgurl = get_option("ct_custom_ad1_imgurl");
	$ct_custom_ad1_alt = get_option("ct_custom_ad1_alt");
	$ct_custom_ad2_url = get_option("ct_custom_ad2_url");
	$ct_custom_ad2_imgurl = get_option("ct_custom_ad2_imgurl");
	$ct_custom_ad2_alt = get_option("ct_custom_ad2_alt");
	$ct_custom_ad3_url = get_option("ct_custom_ad3_url");
	$ct_custom_ad3_imgurl = get_option("ct_custom_ad3_imgurl");
	$ct_custom_ad3_alt = get_option("ct_custom_ad3_alt");
	$ct_custom_ad4_url = get_option("ct_custom_ad4_url");
	$ct_custom_ad4_imgurl = get_option("ct_custom_ad4_imgurl");
	$ct_custom_ad4_alt = get_option("ct_custom_ad4_alt");
	$ct_custom_advertise_url = get_option("ct_custom_advertise_url");
	$ct_google_analytics = get_option("ct_google_analytics");

	if ( isset( $_REQUEST['saved'] ) ) echo '<div id="message" class="updated fade"><p><strong>'.__('Options saved.').'</strong></p></div>';
?>
	<style type="text/css">

		.inside input {
			width: 90%;
		}

		.inside th {
			width: 20%;
			text-align: left;
		}

		em {
			width: 90%;
			font-size: 10px;
		}

		.info {
			width: 90%;
			padding: 10px;
			background-color: #efefef;
		}
	</style>
	
	<div class='wrap'>
		<h2><?php _e('Paramount Theme Customization Options'); ?></h2>
		<form name="frm_ct_options" method="post" action="">
		
		<div id="poststuff" class="ui-sortable">

			<div class="postbox">

				<h3>General</h3>

				<div class="inside">

                	<table width="100%" cellpadding="10" cellspacing="10">							

                        <tr>

                            <th>Custom Logo Image URL</th>

                            <td>

                                <input name="ct_custom_logo_url" type="text" size="100" value="<?php echo $ct_custom_logo_url ?>" /><br />

                                <em>Paste the full URL <em>(beginning with http://)</em> and alt text of your custom logo image here. This image must be 161px wide by 33px tall, if your new logo shows up below your file path is correct.</em><br /><br />

								<?php if(get_option("ct_custom_logo_url", "ct_custom_logo_alt", $single = true) !="") { ?>
									<img src="<?php echo get_option("ct_custom_logo_url", $single = true); ?>" alt="<?php echo get_option("ct_custom_logo_alt", $single = true); ?>" />
								<?php } else { ?>
									<img src="<?php bloginfo('url'); ?>/wp-content/themes/paramount/images/paramount_logo.png" alt="Paramount" />
								<?php } ?>

                            </td>

                        </tr>

                        <tr>

                            <th>Custom Logo Image ALT</th>

                            <td><input name="ct_custom_logo_alt" type="text" size="100" value="<?php echo $ct_custom_logo_alt ?>" /></td>

                        </tr>

                        <tr>

                            <th>Custom Footer Logo Image URL</th>

                            <td>

                                <input name="ct_custom_footer_logo_url" type="text" size="100" value="<?php echo $ct_custom_footer_logo_url ?>" /><br />

                                <em>Paste the full URL <em>(beginning with http://)</em> and alt text of your custom footer logo image here. This image must be 161px wide by 33px tall, if your new logo shows up below your file path is correct.</em><br /><br />

                                <?php if(get_option("ct_custom_footer_logo_url", "ct_custom_footer_logo_alt", $single = true) !="") { ?>

                                    <img src="<?php echo get_option("ct_custom_footer_logo_url", $single = true); ?>" alt="<?php echo get_option("ct_custom_footer_logo_alt", $single = true); ?>" />

                                <?php } else { ?>

                                    <img src="<?php bloginfo('url'); ?>/wp-content/themes/paramount/images/paramount_logo.png" alt="Paramount" />

                                <?php } ?>

                            </td>

                        </tr>

                        <tr>

                            <th>Custom Footer Logo Image ALT</th>

                            <td><input name="ct_custom_footer_logo_alt" type="text" size="100" value="<?php echo $ct_custom_footer_logo_alt ?>" /></td>

                        </tr>


					</table>

				</div>

			</div>

		</div>
		
		
		<div id="poststuff" class="ui-sortable">

			<div class="postbox">

				<h3>Categories</h3>

				<div class="inside">

                	<table width="100%" cellpadding="10" cellspacing="10">							

                        <tr>

                            <th>Featured Category</th>
                            <td>

                                <select name="ct_featured_category">
									<?php $categories = get_categories();
									foreach ($categories as $category) { ?>					
									<option value="<?php echo $category->term_id; ?>" <?php if($ct_featured_category == $category->term_id){echo "selected";} ?>><?php echo $category->name; ?></option>
									<?php } ?>
								</select><br />

                                <em>Select the category for the featured post to display on the home page.</em><br /><br />

                            </td>
                        </tr>
						
						<tr>
							<th>Portfolio Category Name:</th>
							<td>
								<select name="ct_portfolio_category">
									<?php $categories = get_categories();
									foreach ($categories as $category) { ?>					
									<option value="<?php echo $category->term_id; ?>" <?php if($ct_portfolio_category == $category->term_id){echo "selected";} ?>><?php echo $category->name; ?></option>
									<?php } ?>
								</select><br />
								
								<em>Select the category for the portfolio posts.</em><br /><br />
							</td>
						</tr>
						
						<tr>
							<th>Blog Category Name:</th>
							<td>
								<select name="ct_blog_category">
									<?php $categories = get_categories();
									foreach ($categories as $category) { ?>					
									<option value="<?php echo $category->term_id; ?>" <?php if($ct_blog_category == $category->term_id){echo "selected";} ?>><?php echo $category->name; ?></option>
									<?php } ?>
								</select><br />
								
								<em>Select the category for the blog posts.</em><br /><br />
							</td>
						</tr>                   
									
					</table>

				</div>

			</div>

		</div>
		
		<div id="poststuff" class="ui-sortable">

			<div class="postbox">

				<h3>About Me Widget</h3>

				<div class="inside">

                	<table width="100%" cellpadding="10" cellspacing="10">							

                        <tr>
							<th>Image URL</th>
							<td>
								<input name="ct_custom_aboutimg_url" type="text" size="100" value="<?php echo $ct_custom_aboutimg_url ?>" /><br />
								<em>This image must be 63px wide by 85px tall, if your new image shows up below your file path is correct.</em><br /><br />
								<?php if(get_option("ct_custom_aboutimg_url", "ct_custom_aboutimg_alt", $single = true) !="") { ?>
									<img src="<?php echo get_option("ct_custom_aboutimg_url", $single = true); ?>" alt="<?php echo get_option("ct_custom_aboutimg_alt", $single = true); ?>" />
								<?php } else { ?>
									<img src="<?php bloginfo('url'); ?>/wp-content/themes/paramount/images/headshot.jpg" alt="Headshot" />
								<?php } ?>
							</td>
						</tr>
						<tr>
							<th>Image ALT</th>
							<td><input name="ct_custom_aboutimg_alt" type="text" size="100" value="<?php echo $ct_custom_aboutimg_alt ?>" /></td>
						</tr>
						<tr>
							<th>Title</th>
							<td>
								<input name="ct_custom_about_title" type="text" size="100" value="<?php echo $ct_custom_about_title ?>" /><br />
								<em>No HTML</em>
							</td>
						</tr>
						<tr>
							<th>Text</th>
							<td>
								<textarea name="ct_custom_about_text" cols="70" rows="10"><?php echo stripslashes($ct_custom_about_text); ?></textarea><br />
								<em>HTML Ok</em>
							</td>
						</tr>
						<tr>
							<th>Read More Link</th>
							<td>
								<input name="ct_custom_about_link" type="text" size="100" value="<?php echo $ct_custom_about_link ?>" /><br />
							</td>
						</tr>              
									
					</table>

				</div>

			</div>

		</div>
		
		<div id="poststuff" class="ui-sortable">

			<div class="postbox">

				<h3>Testimonial Widget</h3>

				<div class="inside">

                	<table width="100%" cellpadding="10" cellspacing="10">							

					   <tr>
							<th>Quote</th>
							<td>
								<textarea name="ct_custom_testimonial_quote" cols="70" rows="10"><?php echo stripslashes($ct_custom_testimonial_quote); ?></textarea><br />
								<em>HTML Ok</em>
							</td>
						</tr>
						<tr>
							<th>Persons Name</th>
							<td>
								<input name="ct_custom_testimonial_person" type="text" size="100" value="<?php echo $ct_custom_testimonial_person ?>" /><br />
								<em>No HTML</em>
							</td>
						</tr>
						<tr>
							<th>Company Name</th>
							<td>
								<input name="ct_custom_testimonial_company" type="text" size="100" value="<?php echo $ct_custom_testimonial_company ?>" /><br />
								<em>No HTML</em>
							</td>
						</tr>      
									
					</table>

				</div>

			</div>

		</div>
		
		<div id="poststuff" class="ui-sortable">

			<div class="postbox">

				<h3>125x125 Banner Ads Widget</h3>

				<div class="inside">

                	<table width="100%" cellpadding="10" cellspacing="10">							

					   <tr>
							<th>Banner 1 Clickthrough URL</th>
							<td>
								<input name="ct_custom_ad1_url" type="text" size="100" value="<?php echo $ct_custom_ad1_url ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 1 Image URL</th>
							<td>
								<input name="ct_custom_ad1_imgurl" type="text" size="100" value="<?php echo $ct_custom_ad1_imgurl ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 1 Image ALT</th>
							<td>
								<input name="ct_custom_ad1_alt" type="text" size="100" value="<?php echo $ct_custom_ad1_alt ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 2 Clickthrough URL</th>
							<td>
								<input name="ct_custom_ad2_url" type="text" size="100" value="<?php echo $ct_custom_ad2_url ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 2 Image URL</th>
							<td>
								<input name="ct_custom_ad2_imgurl" type="text" size="100" value="<?php echo $ct_custom_ad2_imgurl ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 2 Image ALT</th>
							<td>
								<input name="ct_custom_ad2_alt" type="text" size="100" value="<?php echo $ct_custom_ad2_alt ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 3 Clickthrough URL</th>
							<td>
								<input name="ct_custom_ad3_url" type="text" size="100" value="<?php echo $ct_custom_ad3_url ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 3 Image URL</th>
							<td>
								<input name="ct_custom_ad3_imgurl" type="text" size="100" value="<?php echo $ct_custom_ad3_imgurl ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 3 Image ALT</th>
							<td>
								<input name="ct_custom_ad3_alt" type="text" size="100" value="<?php echo $ct_custom_ad3_alt ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 4 Clickthrough URL</th>
							<td>
								<input name="ct_custom_ad4_url" type="text" size="100" value="<?php echo $ct_custom_ad4_url ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 4 Image URL</th>
							<td>
								<input name="ct_custom_ad4_imgurl" type="text" size="100" value="<?php echo $ct_custom_ad4_imgurl ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 4 Image ALT</th>
							<td>
								<input name="ct_custom_ad4_alt" type="text" size="100" value="<?php echo $ct_custom_ad4_alt ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Advertise Here URL</th>
							<td>
								<input name="ct_custom_advertise_url" type="text" size="100" value="<?php echo $ct_custom_advertise_url ?>" /><br />
                                <em>Link to your advertise information page.</em>
							</td>
						</tr>      
									
					</table>

				</div>

			</div>

		</div>
		
		<div id="poststuff" class="ui-sortable">

			<div class="postbox">

				<h3>125x125 Banner Ads Widget</h3>

				<div class="inside">

                	<table width="100%" cellpadding="10" cellspacing="10">							

					   <tr>
							<th>Banner 1 Clickthrough URL</th>
							<td>
								<input name="ct_custom_ad1_url" type="text" size="100" value="<?php echo $ct_custom_ad1_url ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 1 Image URL</th>
							<td>
								<input name="ct_custom_ad1_imgurl" type="text" size="100" value="<?php echo $ct_custom_ad1_imgurl ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 1 Image ALT</th>
							<td>
								<input name="ct_custom_ad1_alt" type="text" size="100" value="<?php echo $ct_custom_ad1_alt ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 2 Clickthrough URL</th>
							<td>
								<input name="ct_custom_ad2_url" type="text" size="100" value="<?php echo $ct_custom_ad2_url ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 2 Image URL</th>
							<td>
								<input name="ct_custom_ad2_imgurl" type="text" size="100" value="<?php echo $ct_custom_ad2_imgurl ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 2 Image ALT</th>
							<td>
								<input name="ct_custom_ad2_alt" type="text" size="100" value="<?php echo $ct_custom_ad2_alt ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 3 Clickthrough URL</th>
							<td>
								<input name="ct_custom_ad3_url" type="text" size="100" value="<?php echo $ct_custom_ad3_url ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 3 Image URL</th>
							<td>
								<input name="ct_custom_ad3_imgurl" type="text" size="100" value="<?php echo $ct_custom_ad3_imgurl ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 3 Image ALT</th>
							<td>
								<input name="ct_custom_ad3_alt" type="text" size="100" value="<?php echo $ct_custom_ad3_alt ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 4 Clickthrough URL</th>
							<td>
								<input name="ct_custom_ad4_url" type="text" size="100" value="<?php echo $ct_custom_ad4_url ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 4 Image URL</th>
							<td>
								<input name="ct_custom_ad4_imgurl" type="text" size="100" value="<?php echo $ct_custom_ad4_imgurl ?>" /><br />
							</td>
						</tr>
						<tr>
							<th>Banner 4 Image ALT</th>
							<td>
								<input name="ct_custom_ad4_alt" type="text" size="100" value="<?php echo $ct_custom_ad4_alt ?>" /><br />
							</td>
						</tr>
						<tr>
							<td colspan="2" class="whiterow">
								<span class="fieldtitle">Advertise Here</span><br />
								link to your advertise information page.
							</td>
						</tr>
						<tr>
							<th>Advertise Here URL</th>
							<td>
								<input name="ct_custom_advertise_url" type="text" size="100" value="<?php echo $ct_custom_advertise_url ?>" /><br />
							</td>
						</tr>      
									
					</table>

				</div>

			</div>

		</div>
		
		<div id="poststuff" class="ui-sortable">

            <div class="postbox">

                <h3>Google Analytics</h3>

                <div class="inside">

                    <table width="100%" cellpadding="10" cellspacing="10">

                        <tr>

                            <th>Google Analytics Code</th>

                            <td>

                                <textarea name="ct_google_analytics" cols="70" rows="10"><?php echo stripslashes($ct_google_analytics); ?></textarea><br />
                                <em>If you have a Google Analytics account paste the tracking code here.</em>

                            </td>

                        </tr>

                    </table>

                </div>

            </div>

        </div>

		<p class="submit">
			<input type="hidden" name="save_changes" value="true" />
			<input type="submit" name="Submit" value="Save Changes" />
		</p>

		</form>
	</div>
<?php
}

add_action('admin_menu', 'customise_add_theme_page');

//////////////////////////////////////////////Add Rewrite Post Panel Titles JS to Admin Header//////////////////////////////////////////////

function admin_js() { ?>
	<script type='text/javascript' src='<?php bloginfo ( 'template_url' );?>/js/admin.js'></script>
	<?php }
			add_action(admin_head, admin_js);
	?>