<?php

// Call options panel
require_once TEMPLATEPATH.'/admin/cp.php';

require_once TEMPLATEPATH.'/widgets.php';

// register menus
register_nav_menus(
    array(
        'main-navigation' => 'Main Navigation'
    )
);

add_theme_support('automatic-feed-links');
add_theme_support('post-thumbnails');

// register sidebars
register_sidebar(array(
	'name' => __( 'Footer - Left Area', 'liveweb' ),
	'id' => 'footer-left',
	'description' => __( 'Place a text widget which contains an unordered list for hosting features.', 'liveweb' ),
	'before_title' => '<h2>',
	'after_title' => '</h2>',
	'before_widget' => '',
	'after_widget' => ''
));

register_sidebar(array(
	'name' => __( 'Footer Links 1', 'liveweb' ),
	'id' => 'footer-list1',
	'description' => __( 'Place a text widget which contains some of your links.', 'liveweb' ),
	'before_title' => '<h2>',
	'after_title' => '</h2>',
	'before_widget' => '',
	'after_widget' => ''
));

register_sidebar(array(
	'name' => __( 'Footer Links 2', 'liveweb' ),
	'id' => 'footer-list2',
	'description' => __( 'Place a text widget which contains some of your links.', 'liveweb' ),
	'before_title' => '<h2>',
	'after_title' => '</h2>',
	'before_widget' => '',
	'after_widget' => ''
));

register_sidebar(array(
	'name' => __( 'Footer Links 3', 'liveweb' ),
	'id' => 'footer-list3',
	'description' => __( 'Place a text widget which contains some of your links.', 'liveweb' ),
	'before_title' => '<h2>',
	'after_title' => '</h2>',
	'before_widget' => '',
	'after_widget' => ''
));

register_sidebar(array(
	'name' => __( 'Footer Links 4', 'liveweb' ),
	'id' => 'footer-list4',
	'description' => __( 'Place a text widget which contains some of your links.', 'liveweb' ),
	'before_title' => '<h2>',
	'after_title' => '</h2>',
	'before_widget' => '',
	'after_widget' => ''
));

register_sidebar(array(
	'name' => __( 'Right Sidebar', 'liveweb' ),
	'id' => 'right-sidebar',
	'description' => __( 'Widgets in this area will be shown on the right-hand side.', 'liveweb' ),
	'before_title' => '<h3>',
	'after_title' => '</h3>',
	'before_widget' => '<div class="widget">',
	'after_widget' => '</div>'
));

register_sidebar(array(
	'name' => __( 'Footer Newsletter Widget', 'liveweb' ),
	'id' => 'nl-widget',
	'description' => __( 'Place the custom newsletter widget in here.', 'liveweb' ),
	'before_title' => '<h2>',
	'after_title' => '</h2>',
	'before_widget' => '',
	'after_widget' => ''
));

// Customise the title
function vtitle() {

	if (is_home()) {
	
		echo bloginfo('name');
		
	} elseif (is_page() || is_single()) {
	
		the_title();
		echo ' - '.get_bloginfo('name');
	
	} elseif (is_archive()) {
		
		echo single_cat_title();
		echo ' - '.get_bloginfo('name');
		
	}
}

// Shortcode work is here
function domainform( $atts, $content = null ) {
extract(shortcode_atts(array(
	      'heading' => 'Find the Perfect Domain Name Today!',
	      'searchfield' => 'Enter your domain name here...',
		  'extensions' => 'com,net,org',
		  'moretext' => 'See More Domain Pricing Click Here',
		  'morelink' => '#',
		  'price1' => 9.99,
		  'price2' => 9.99,
		  'price3' => 9.99
     ), $atts));
?>
  <div class="domaincon">
    <div class="wrapper">
      <div class="domianarea">
        <div class="domianareainner">
          <div class="domianlt">
            <h2><?php echo $heading; ?></h2>
            <input type="text" name="field1" id="field1" class="field1" value="<?php echo $searchfield; ?>" onfocus='javascript: this.value = ""' onblur='javascript: if(this.value =="") this.value = "<?php echo $searchfield; ?>"' />
            <div class="drop">
              <select class="field2">
				<?php $exts = explode(',', $extensions); foreach($exts as $ext) { ?>
                <option>.<?php echo $ext; ?></option>
				<?php } ?>
              </select>
            </div>
            <input type="submit" name="submit" value="" class="field3" />
            <div class="clear"></div>
            <!--domianlt--> 
          </div>
          <div class="domainrt">
            <div class="domainrate">
              <div class="doller1">$</div>
			  <?php $splitp = explode('.', $price1); ?>
              <div class="numeric1"><?php echo $splitp[0]; ?></div>
              <div class="numericsmall1">.<?php echo $splitp[1]; ?></div>
              <div class="per1">.<?php echo $exts[0]; ?></div>
              <!--domainrate--> 
            </div>
            <div class="domainrate">
              <div class="doller1 yellow">$</div>
			  <?php $splitp = explode('.', $price2); ?>
              <div class="numeric1 yellow"><?php echo $splitp[0]; ?></div>
              <div class="numericsmall1 yellow">.<?php echo $splitp[1]; ?></div>
              <div class="per1">.<?php echo $exts[1]; ?></div>
              <!--domainrate--> 
            </div>
            <div class="domainrate">
              <div class="doller1 green">$</div>
			  <?php $splitp = explode('.', $price3); ?>
              <div class="numeric1 green"><?php echo $splitp[0]; ?></div>
              <div class="numericsmall1 green">.<?php echo $splitp[1]; ?></div>
              <div class="per1">.<?php echo $exts[2]; ?></div>
              <!--domainrate--> 
            </div>
            <div class="clear"></div>
            <a href="<?php echo $morelink; ?>"><?php echo $moretext; ?></a> 
            <!--domainrt--> 
          </div>
          <div class="clear"></div>
          <!--domianareainner--> 
        </div>
        <div class="clear"></div>
        <!--domianarea--> 
      </div>
      <div class="clear"></div>
      <!--wrapper--> 
    </div>
    <!--domaincon--> 
  </div>
 <?php
}

// homepage plans shortcode
function homeplans( $atts, $content = null ) {
extract(shortcode_atts(array(
		'title' => 'Our Plans and Pricing',
		'tabs' => '',
		'buttontext' => 'Order Now',
		'box1_title' => 'Starter #1',
		'box2_title' => 'Starter #2',
		'box3_title' => 'Starter #3',
		'box4_title' => 'Starter #4',
		'box5_title' => 'Starter #5',
		'box6_title' => 'Starter #6',
		'box7_title' => 'Starter #7',
		'box8_title' => 'Starter #8',
		'box9_title' => 'Starter #9',
		'box10_title' => 'Starter #10',
		'box11_title' => 'Starter #11',
		'box12_title' => 'Starter #12',
		'box13_title' => 'Starter #13',
		'box14_title' => 'Starter #14',
		'box15_title' => 'Starter #15',
		'box16_title' => 'Starter #16',
		'box1_price' => 49.99,
		'box2_price' => 49.99,
		'box3_price' => 49.99,
		'box4_price' => 49.99,
		'box5_price' => 49.99,
		'box6_price' => 49.99,
		'box7_price' => 49.99,
		'box8_price' => 49.99,
		'box9_price' => 49.99,
		'box10_price' => 49.99,
		'box11_price' => 49.99,
		'box12_price' => 49.99,
		'box13_price' => 49.99,
		'box14_price' => 49.99,
		'box15_price' => 49.99,
		'box16_price' => 49.99,
		'box1_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box2_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box3_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box4_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box5_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box6_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box7_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box8_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box9_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box10_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box11_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box12_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box13_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box14_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box15_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box16_features' => '10GB Storage Space,50GB Bandwidth,Unlimited FTP &amp; Email,cPanel Control Panel',
		'box1_link' => '',
		'box2_link' => '',
		'box3_link' => '',
		'box4_link' => '',
		'box5_link' => '',
		'box6_link' => '',
		'box7_link' => '',
		'box8_link' => '',
		'box9_link' => '',
		'box10_link' => '',
		'box11_link' => '',
		'box12_link' => '',
		'box13_link' => '',
		'box14_link' => '',
		'box15_link' => '',
		'box16_link' => '',
     ), $atts));
?>

	<div class="plancon">
      <h2><?php echo $title; ?></h2>
      <div id="TabbedPanels1" class="TabbedPanels">
		<?php $stabs = explode(',', $tabs); ?>
        <ul class="TabbedPanelsTabGroup">
		  <?php $i = 0; foreach($stabs as $tab) { $i++; ?>
		  <?php if ($i == count($stabs)) { ?>
		  <li class="TabbedPanelsTab noborderrt"><?php echo $tab; ?></li>
		  <?php } else { ?>
          <li class="TabbedPanelsTab"><?php echo $tab; ?></li>
		  <?php } } ?>
        </ul>
        <div class="TabbedPanelsContentGroup">
          <div class="TabbedPanelsContent">
            
			<div class="plan">
              <h3><?php echo $box1_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box1_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box1_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box1_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
			<div class="plan">
              <h3><?php echo $box2_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box2_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box2_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box2_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
			<div class="plan">
              <h3><?php echo $box3_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box3_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box3_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box3_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="plan nomarginrt">
              <h3><?php echo $box4_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box4_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box4_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box4_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="clear"></div>
            <!--TabbedPanelsContent--> 
          </div>
          <div class="TabbedPanelsContent">
		  
            <div class="plan">
              <h3><?php echo $box5_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box5_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box5_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box5_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="plan">
              <h3><?php echo $box6_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box6_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box6_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box6_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="plan">
              <h3><?php echo $box7_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box7_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box7_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box7_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="plan nomarginrt">
              <h3><?php echo $box8_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box8_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box8_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box8_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="clear"></div>
            <!--TabbedPanelsContent--> 
          </div>
          <div class="TabbedPanelsContent">
		  
            <div class="plan">
              <h3><?php echo $box9_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box9_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box9_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box9_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="plan">
              <h3><?php echo $box10_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box10_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box10_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box10_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="plan">
              <h3><?php echo $box11_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box11_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box11_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box11_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="plan nomarginrt">
              <h3><?php echo $box12_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box12_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box12_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box12_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="clear"></div>
            <!--TabbedPanelsContent--> 
          </div>
          <div class="TabbedPanelsContent">
		  
            <div class="plan">
              <h3><?php echo $box13_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box13_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box13_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box13_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan-->  
            </div>
			
            <div class="plan">
              <h3><?php echo $box14_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box14_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box14_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box14_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="plan">
              <h3><?php echo $box15_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box15_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box15_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box15_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="plan nomarginrt">
              <h3><?php echo $box16_title; ?></h3>
              <div class="planrate">Starting <span class="brown">$<?php echo $box16_price; ?></span>/mo</div>
              <ul class="liststyle2">
				<?php $pfe = explode(',', $box16_features);
				foreach ($pfe as $info ) { ?>
                <li><?php echo $info; ?></li>
				<?php } ?>
              </ul>
              <div class="order"><a href="<?php echo $box16_link; ?>"><?php echo $buttontext; ?></a></div>
              <!--plan--> 
            </div>
			
            <div class="clear"></div>
            <!--TabbedPanelsContent--> 
          </div>
        </div>
      </div>
      <div class="clear"></div>
      <!--plancon--> 
    </div>
	
<?php
}

// homepage plans shortcode
function whyus( $atts, $content = null ) {
extract(shortcode_atts(array(
		'title' => 'Why Prefer LiveWeb',
		'sections' => '24 / 7 Professional Support,100% Network and Uptime,24 / 7 Professional Support,24 / 7 Professional Support',
		'text' => ''
     ), $atts));

$splitsec = explode(',',$sections); $splitext = explode(',',$text); ?><div class="headingmid"><?php echo $title; ?></div><ul class="liststyle3">
      <li class="image1">
        <h2><?php echo $splitsec[0]; ?></h2>
        <p><?php echo $splitext[0]; ?></p>
      </li>
      <li class="floatrt clock">
        <h2 class="yellow"><?php echo $splitsec[1]; ?></h2>
        <p><?php echo $splitext[1]; ?></p>
      </li>
    </ul>
    <div class="clear"></div>
    <ul class="liststyle3">
      <li class="noborderbtm money">
        <h2 class="green"><?php echo $splitsec[2]; ?></h2>
        <p><?php echo $splitext[2]; ?></p>
      </li>
      <li class="floatrt noborderbtm backup">
        <h2 class="grey"><?php echo $splitsec[3]; ?></h2>
        <p><?php echo $splitext[3]; ?></p>
      </li>
    </ul>
    <div class="clear"></div>
<?php
}

// plan page shortcodes
function heading( $atts, $content = null ) {
	return '<div class="headingmid">'.$content.'</div>';
}

// plan page text
function showtext( $atts, $content = null ) {
	 return '<div class="text">'.$content.'</div>';
}

add_shortcode("text", "showtext");
add_shortcode("heading", "heading");
add_shortcode("plans", "homeplans");
add_shortcode("domainform", "domainform");
add_shortcode("reasons", "whyus");

?>
