Ejemplo n.º 1
0
function custom_body_class()
{
    $options = get_desing_plus_option();
    echo ' class="';
    if (!is_page() && is_home()) {
        echo ' index';
    }
    if ($options['header_layout'] == 'fixed') {
        echo ' fixed_header';
    }
    if ($options['layout'] == 'right') {
        echo ' layout1';
    } elseif ($options['layout'] == 'left') {
        echo ' layout2';
    } else {
        echo ' three_column';
    }
    if ($options['layout'] == 'three_column1') {
        echo ' layout3';
    } elseif ($options['layout'] == 'three_column2') {
        echo ' layout4';
    }
    if (is_page_template('page-noside.php')) {
        echo ' no_side';
    }
    echo ' custom-background"';
}
Ejemplo n.º 2
0
    function widget($args, $instance)
    {
        extract($args);
        echo $before_widget;
        $options = get_desing_plus_option();
        if ($options['side_ad_top_image3'] || $options['side_ad_top_code3']) {
            $random2 = rand(0, 2);
        } elseif ($options['side_ad_top_image2'] || $options['side_ad_top_code2']) {
            $random2 = rand(0, 1);
        } elseif ($options['side_ad_top_image1'] || $options['side_ad_top_code1']) {
            $random2 = rand(0, 0);
        }
        ?>

<?php 
        if ($random2 == 0) {
            if ($options['side_ad_top_code1']) {
                echo $options['side_ad_top_code1'];
            } else {
                ?>
<a href="<?php 
                echo $options['side_ad_top_url1'];
                ?>
" class="target_blank"><img src="<?php 
                esc_attr_e($options['side_ad_top_image1']);
                ?>
" alt="" /></a><?php 
            }
        } elseif ($random2 == 1) {
            if ($options['side_ad_top_code2']) {
                echo $options['side_ad_top_code2'];
            } else {
                ?>
<a href="<?php 
                echo $options['side_ad_top_url2'];
                ?>
" class="target_blank"><img src="<?php 
                esc_attr_e($options['side_ad_top_image2']);
                ?>
" alt="" /></a><?php 
            }
        } elseif ($random2 == 2) {
            if ($options['side_ad_top_code3']) {
                echo $options['side_ad_top_code3'];
            } else {
                ?>
<a href="<?php 
                echo $options['side_ad_top_url3'];
                ?>
" class="target_blank"><img src="<?php 
                esc_attr_e($options['side_ad_top_image3']);
                ?>
" alt="" /></a><?php 
            }
        }
        ?>

<?php 
        echo $after_widget;
    }
Ejemplo n.º 3
0
/**
 * ロゴ画像を削除する
 * @return void
 */
function _dp_delete_image()
{
    if (isset($_REQUEST['page'], $_REQUEST['_wpnonce']) && !isset($_REQUEST['settings-updated']) && $_REQUEST['page'] == 'theme_options') {
        if (wp_verify_nonce($_REQUEST['_wpnonce'], 'dp_delete_image_' . get_current_user_id())) {
            $dir = dp_logo_basedir();
            foreach (scandir($dir) as $file) {
                if (preg_match("/logo(-resized)?\\.(png|gif|jpe?g)/i", $file)) {
                    if (!@unlink($dir . DIRECTORY_SEPARATOR . $file)) {
                        add_action('admin_notices', '_dp_delete_message_error');
                        return;
                    }
                }
            }
            add_action('admin_notices', '_dp_delete_message_sucess');
        }
        $options = get_desing_plus_option();
        if (wp_verify_nonce($_REQUEST['_wpnonce'], 'dp_delete_header_ad_image1')) {
            $file = basename($options['header_ad_image1']);
            if (file_exists(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file) && @unlink(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file)) {
                $options['header_ad_image1'] = '';
                update_option('dp_options', $options);
                add_action('admin_notices', '_dp_delete_message_sucess');
            } else {
                add_action('admin_notices', '_dp_delete_message_error');
            }
        }
        if (wp_verify_nonce($_REQUEST['_wpnonce'], 'dp_delete_single_ad_image1')) {
            $file = basename($options['single_ad_image1']);
            if (file_exists(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file) && @unlink(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file)) {
                $options['single_ad_image1'] = '';
                update_option('dp_options', $options);
                add_action('admin_notices', '_dp_delete_message_sucess');
            } else {
                add_action('admin_notices', '_dp_delete_message_error');
            }
        }
        if (wp_verify_nonce($_REQUEST['_wpnonce'], 'dp_delete_single_ad_image2')) {
            $file = basename($options['single_ad_image2']);
            if (file_exists(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file) && @unlink(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file)) {
                $options['single_ad_image2'] = '';
                update_option('dp_options', $options);
                add_action('admin_notices', '_dp_delete_message_sucess');
            } else {
                add_action('admin_notices', '_dp_delete_message_error');
            }
        }
        for ($i = 1; $i <= 3; $i++) {
            if (wp_verify_nonce($_REQUEST['_wpnonce'], 'dp_delete_side_ad_top_image' . $i)) {
                $file = basename($options['side_ad_top_image' . $i]);
                if (file_exists(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file) && @unlink(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file)) {
                    $options['side_ad_top_image' . $i] = '';
                    update_option('dp_options', $options);
                    add_action('admin_notices', '_dp_delete_message_sucess');
                } else {
                    add_action('admin_notices', '_dp_delete_message_error');
                }
            }
        }
        for ($i = 1; $i <= 3; $i++) {
            if (wp_verify_nonce($_REQUEST['_wpnonce'], 'dp_delete_side_ad_bottom_image' . $i)) {
                $file = basename($options['side_ad_bottom_image' . $i]);
                if (file_exists(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file) && @unlink(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file)) {
                    $options['side_ad_bottom_image' . $i] = '';
                    update_option('dp_options', $options);
                    add_action('admin_notices', '_dp_delete_message_sucess');
                } else {
                    add_action('admin_notices', '_dp_delete_message_error');
                }
            }
        }
        if (wp_verify_nonce($_REQUEST['_wpnonce'], 'dp_delete_mobile_ad_image1')) {
            $file = basename($options['mobile_ad_image1']);
            if (file_exists(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file) && @unlink(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file)) {
                $options['mobile_ad_image1'] = '';
                update_option('dp_options', $options);
                add_action('admin_notices', '_dp_delete_message_sucess');
            } else {
                add_action('admin_notices', '_dp_delete_message_error');
            }
        }
        if (wp_verify_nonce($_REQUEST['_wpnonce'], 'dp_delete_mobile_ad_image2')) {
            $file = basename($options['mobile_ad_image2']);
            if (file_exists(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file) && @unlink(dp_logo_basedir() . DIRECTORY_SEPARATOR . $file)) {
                $options['mobile_ad_image2'] = '';
                update_option('dp_options', $options);
                add_action('admin_notices', '_dp_delete_message_sucess');
            } else {
                add_action('admin_notices', '_dp_delete_message_error');
            }
        }
    }
}
Ejemplo n.º 4
0
<?php

$options = get_desing_plus_option();
?>

 </div><!-- END #main_content -->

 <a id="return_top" href="#header"><?php 
_e('Return Top', 'tcd-w');
?>
</a>

<?php 
if ($options['show_bookmark']) {
    ?>
<div id="fb-root"></div>
<script type="text/javascript">(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v2.0";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<?php 
}
wp_footer();
?>
</body>
</html>
Ejemplo n.º 5
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        // the widget title
        $post_num = $instance['post_num'];
        // the type of posts to show
        // Before widget //
        echo $before_widget;
        // Title of widget //
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        // Widget output //
        $args = array('post_type' => 'post', 'posts_per_page' => $post_num, 'meta_key' => 'recommend_post', 'meta_value' => 'on', 'orderby' => 'rand');
        $recommend_post = new WP_Query($args);
        if ($recommend_post->have_posts()) {
            ?>
<ol class="widget_post_list">
 <?php 
            $options = get_desing_plus_option();
            while ($recommend_post->have_posts()) {
                $recommend_post->the_post();
                ?>
 <li class="clearfix">
  <?php 
                if (has_post_thumbnail()) {
                    ?>
  <a class="image" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_post_thumbnail('size2');
                    ?>
</a>
  <?php 
                } else {
                    ?>
  <p class="post_date"><span class="date"><?php 
                    the_time('j');
                    ?>
</span><span class="month"><?php 
                    $month = get_the_date('M');
                    if (strtoupper(get_locale()) == 'JA') {
                        echo encode_date($month);
                    } else {
                        echo $month;
                    }
                    ?>
</span></p>
  <?php 
                }
                ?>
  <h4 class="title"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h4>
  <?php 
                if (has_post_thumbnail()) {
                    ?>
<p class="post_date2"><?php 
                    the_time('Y.m.d');
                    ?>
</p><?php 
                }
                ?>
 </li>
 <?php 
            }
            ?>
</ol>
<?php 
        } else {
            ?>
 <p><?php 
            _e("There is no registered post.", "tcd-w");
            ?>
</p>
<?php 
        }
        wp_reset_postdata();
        // After widget //
        echo $after_widget;
    }
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        // the widget title
        $post_num = $instance['post_num'];
        // the type of posts to show
        // Before widget //
        echo $before_widget;
        // Title of widget //
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        // Widget output //
        $args = array('post_type' => 'post', 'posts_per_page' => $post_num);
        $recent_post = new WP_Query($args);
        if ($recent_post->have_posts()) {
            ?>
<ol class="widget_post_list">
 <?php 
            $options = get_desing_plus_option();
            while ($recent_post->have_posts()) {
                $recent_post->the_post();
                ?>
 <li class="clearfix">
  <a class="image" href="<?php 
                the_permalink();
                ?>
"><?php 
                if (has_post_thumbnail()) {
                    the_post_thumbnail('size3');
                } else {
                    echo '<img src="';
                    bloginfo('template_url');
                    echo '/img/common/no_image1.gif" alt="" title="" />';
                }
                ?>
</a>
  <div class="info">
   <p class="date"><?php 
                the_time('Y.m.d');
                ?>
</p>
   <a class="title" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a>
  </div>
 </li>
 <?php 
            }
            ?>
</ol>
<?php 
        } else {
            ?>
 <p><?php 
            _e("There is no registered post.", "tcd-w");
            ?>
</p>
<?php 
        }
        wp_reset_query();
        // After widget //
        echo $after_widget;
    }
Ejemplo n.º 7
0
function theme_options_do_page()
{
    global $layout_options, $header_layout_options, $color_type_options, $dp_upload_error;
    $options = get_desing_plus_option();
    if (!isset($_REQUEST['settings-updated'])) {
        $_REQUEST['settings-updated'] = false;
    }
    ?>

<div class="wrap">
 <?php 
    screen_icon();
    echo "<h2>" . __('Theme Options', 'tcd-w') . "</h2>";
    ?>

 <?php 
    // 更新時のメッセージ
    if (false !== $_REQUEST['settings-updated']) {
        ?>
 <div class="updated fade"><p><strong><?php 
        _e('Updated', 'tcd-w');
        ?>
</strong></p></div>
 <?php 
    }
    ?>

 <?php 
    /* ファイルアップロード時のメッセージ */
    if (!empty($dp_upload_error['message'])) {
        ?>
  <?php 
        if ($dp_upload_error['error']) {
            ?>
   <div id="error" class="error"><p><?php 
            echo $dp_upload_error['message'];
            ?>
</p></div>
  <?php 
        } else {
            ?>
   <div id="message" class="updated fade"><p><?php 
            echo $dp_upload_error['message'];
            ?>
</p></div>
  <?php 
        }
        ?>
 <?php 
    }
    ?>
 
 <script type="text/javascript">
  jQuery(document).ready(function($){
   $('#my_theme_option').cookieTab({
    tabMenuElm: '#theme_tab',
    tabPanelElm: '#tab-panel'
   });
  });
 </script>

 <div id="my_theme_option">

 <div id="theme_tab_wrap">
  <ul id="theme_tab" class="cf">
   <li><a href="#tab-content1"><?php 
    _e('Basic Setup', 'tcd-w');
    ?>
</a></li>
   <li><a href="#tab-content2"><?php 
    _e('Logo', 'tcd-w');
    ?>
</a></li>
   <li><a href="#tab-content3"><?php 
    _e('Adsence widget1', 'tcd-w');
    ?>
</a></li>
   <li><a href="#tab-content4"><?php 
    _e('Adsence widget2', 'tcd-w');
    ?>
</a></li>
   <li><a href="#tab-content5"><?php 
    _e('Other Adsense', 'tcd-w');
    ?>
</a></li>
   <li><a href="#tab-content6"><?php 
    _e('Smartphone Adsense', 'tcd-w');
    ?>
</a></li>
  </ul>
 </div>

<form method="post" action="options.php" enctype="multipart/form-data">
 <?php 
    settings_fields('design_plus_options');
    ?>

 <div id="tab-panel">

  <!-- #tab-content1 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  -->
  <div id="tab-content1">

   <?php 
    // 色の設定
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Color setting', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input" id="color_type">
     <p><?php 
    _e('Select color type', 'tcd-w');
    ?>
</p>
     <fieldset class="cf"><legend class="screen-reader-text"><span><?php 
    _e('Color type', 'tcd-w');
    ?>
</span></legend>
     <ul class="cf">
     <?php 
    if (!isset($checked)) {
        $checked = '';
    }
    foreach ($color_type_options as $option) {
        $color_type_setting = $options['color_type'];
        if ('' != $color_type_setting) {
            if ($options['color_type'] == $option['value']) {
                $checked = "checked=\"checked\"";
            } else {
                $checked = '';
            }
        }
        ?>
      <li>
       <label>
       <input id="input_<?php 
        esc_attr_e($option['value']);
        ?>
" type="radio" name="dp_options[color_type]" value="<?php 
        esc_attr_e($option['value']);
        ?>
" <?php 
        echo $checked;
        ?>
 />
       <?php 
        echo $option['label'];
        ?>
       </label>
      </li>
     <?php 
    }
    ?>
     </ul>
     </fieldset>
    </div>
   </div>

 <script type="text/javascript">
  jQuery(document).ready(function($){

   if($("#input_type3:checked").val()) {
    $('#color_pattern').show();
   } else {
    $('#color_pattern').hide();
   };

   $("#input_type3").click(function () {
    $('#color_pattern').show();
   });

   $("#color_type input").not('#input_type3').click(function () {
    $('#color_pattern').hide();
   });

  });
 </script>

   <?php 
    // サイトカラー
    ?>
   <div id="color_pattern" style="display:none;">
    <div class="theme_option_field cf">
     <h3 class="theme_option_headline"><?php 
    _e('Custom color setting', 'tcd-w');
    ?>
</h3>
     <p><?php 
    _e('Set primary color.', 'tcd-w');
    ?>
</p>
     <div class="theme_option_input">
      <input type="text" class="color" name="dp_options[pickedcolor]" value="<?php 
    esc_attr_e($options['pickedcolor']);
    ?>
" />
      <input type="submit" class="button-primary" value="<?php 
    echo __('Save Color', 'tcd-w');
    ?>
" />
     </div>
     <p><?php 
    _e('Set secondary color.', 'tcd-w');
    ?>
</p>
     <div class="theme_option_input">
      <input type="text" class="color" name="dp_options[pickedcolor2]" value="<?php 
    esc_attr_e($options['pickedcolor2']);
    ?>
" />
      <input type="submit" class="button-primary" value="<?php 
    echo __('Save Color', 'tcd-w');
    ?>
" />
     </div>
     <p><?php 
    _e('Color to use for gradation.', 'tcd-w');
    ?>
</p>
     <div class="theme_option_input">
      <input type="text" class="color" name="dp_options[pickedcolor3]" value="<?php 
    esc_attr_e($options['pickedcolor3']);
    ?>
" />
      <input type="submit" class="button-primary" value="<?php 
    echo __('Save Color', 'tcd-w');
    ?>
" />
     </div>
    </div>
   </div>

   <?php 
    // フォントサイズ
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Font size', 'tcd-w');
    ?>
</h3>
    <p><?php 
    _e('Font size of single page and wp-page.', 'tcd-w');
    ?>
</p>
    <div class="theme_option_input">
     <input id="dp_options[content_font_size]" class="font_size" type="text" name="dp_options[content_font_size]" value="<?php 
    esc_attr_e($options['content_font_size']);
    ?>
" /><span>px</span>
    </div>
   </div>

   <?php 
    // 投稿者名・タグ・コメント
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Display Setup', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input">
     <ul>
      <li><label><input id="dp_options[show_author]" name="dp_options[show_author]" type="checkbox" value="1" <?php 
    checked('1', $options['show_author']);
    ?>
 /> <?php 
    _e('Display author', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_comment]" name="dp_options[show_comment]" type="checkbox" value="1" <?php 
    checked('1', $options['show_comment']);
    ?>
 /> <?php 
    _e('Display comment', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_trackback]" name="dp_options[show_trackback]" type="checkbox" value="1" <?php 
    checked('1', $options['show_trackback']);
    ?>
 /> <?php 
    _e('Display trackbacks', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_bookmark]" name="dp_options[show_bookmark]" type="checkbox" value="1" <?php 
    checked('1', $options['show_bookmark']);
    ?>
 /> <?php 
    _e('Display social bookmark', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_related_post]" name="dp_options[show_related_post]" type="checkbox" value="1" <?php 
    checked('1', $options['show_related_post']);
    ?>
 /> <?php 
    _e('Display related post at single post page', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_next_post]" name="dp_options[show_next_post]" type="checkbox" value="1" <?php 
    checked('1', $options['show_next_post']);
    ?>
 /> <?php 
    _e('Display next previous post link', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_rss]" name="dp_options[show_rss]" type="checkbox" value="1" <?php 
    checked('1', $options['show_rss']);
    ?>
 /> <?php 
    _e('Display RSS button at header', 'tcd-w');
    ?>
</label></li>
     </ul>
    </div>
   </div>

   <?php 
    // サイドコンテンツの表示位置
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Layout', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input layout_option">
     <fieldset class="cf"><legend class="screen-reader-text"><span><?php 
    _e('Layout', 'tcd-w');
    ?>
</span></legend>
     <?php 
    if (!isset($checked)) {
        $checked = '';
    }
    foreach ($layout_options as $option) {
        $layout_setting = $options['layout'];
        if ('' != $layout_setting) {
            if ($options['layout'] == $option['value']) {
                $checked = "checked=\"checked\"";
            } else {
                $checked = '';
            }
        }
        ?>
      <label class="description">
       <input type="radio" name="dp_options[layout]" value="<?php 
        esc_attr_e($option['value']);
        ?>
" <?php 
        echo $checked;
        ?>
 />
       <img src="<?php 
        bloginfo('template_url');
        ?>
/admin/<?php 
        echo $option['img'];
        ?>
.gif" alt="" title="" />
       <?php 
        echo $option['label'];
        ?>
      </label>
     <?php 
    }
    ?>
     </fieldset>
    </div>
   </div>

   <?php 
    // ヘッダーのレイアウト
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Header style', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input layout_option2">
     <fieldset class="cf"><legend class="screen-reader-text"><span><?php 
    _e('Header style', 'tcd-w');
    ?>
</span></legend>
     <?php 
    if (!isset($checked)) {
        $checked = '';
    }
    foreach ($header_layout_options as $option) {
        $header_layout_setting = $options['header_layout'];
        if ('' != $header_layout_setting) {
            if ($options['header_layout'] == $option['value']) {
                $checked = "checked=\"checked\"";
            } else {
                $checked = '';
            }
        }
        ?>
      <label class="description">
       <input type="radio" name="dp_options[header_layout]" value="<?php 
        esc_attr_e($option['value']);
        ?>
" <?php 
        echo $checked;
        ?>
 />
       <?php 
        echo $option['label'];
        ?>
      </label>
     <?php 
    }
    ?>
     </fieldset>
    </div>
   </div>

   <?php 
    // facebook twitter
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('twitter and facebook setup', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input">
     <p><?php 
    _e('When it is blank, twitter and facebook icon will not displayed on a site.', 'tcd-w');
    ?>
</p>
     <ul>
      <li>
       <label style="display:inline-block; min-width:140px;"><?php 
    _e('your twitter URL', 'tcd-w');
    ?>
</label>
       <input id="dp_options[twitter_url]" class="regular-text" type="text" name="dp_options[twitter_url]" value="<?php 
    echo esc_url($options['twitter_url']);
    ?>
" />
      </li>
      <li>
       <label style="display:inline-block; min-width:140px;"><?php 
    _e('your facebook URL', 'tcd-w');
    ?>
</label>
       <input id="dp_options[facebook_url]" class="regular-text" type="text" name="dp_options[facebook_url]" value="<?php 
    echo esc_url($options['facebook_url']);
    ?>
" />
      </li>
     </ul>
    </div>
   </div>

   <p class="submit"><input type="submit" class="button-primary" value="<?php 
    echo __('Save Changes', 'tcd-w');
    ?>
" /></p>

  </div><!-- END #tab-content1 -->




  <!-- #tab-content2 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  -->
  <div id="tab-content2">

   <?php 
    // ステップ1
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Step 1 : Upload image to use for logo.', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input">
     <p><?php 
    _e('Upload image to use for logo from your computer.<br />You can resize your logo image in step 2 and adjust position in step 3.', 'tcd-w');
    ?>
</p>
     <div class="button_area">
      <label for="dp_image"><?php 
    _e('Select image to use for logo from your computer.', 'tcd-w');
    ?>
</label>
      <input type="file" name="dp_image" id="dp_image" value="" />
      <input type="submit" class="button" value="<?php 
    _e('Upload', 'tcd-w');
    ?>
" />
     </div>
     <?php 
    if (dp_logo_exists()) {
        $info = dp_logo_info();
        ?>
     <div class="uploaded_logo">
      <h4><?php 
        _e('Uploaded image.', 'tcd-w');
        ?>
</h4>
      <div class="uploaded_logo_image" id="original_logo_size">
       <?php 
        dp_logo_img_tag(false, '', '', 9999);
        ?>
      </div>
      <p><?php 
        printf(__('Original image size : width %1$dpx, height %2$dpx', 'tcd-w'), $info['width'], $info['height']);
        ?>
</p>
     </div>
     <?php 
    } else {
        ?>
     <div class="uploaded_logo">
      <h4><?php 
        _e('The image has not been uploaded yet.<br />A normal text will be used for a site logo.', 'tcd-w');
        ?>
</h4>
     </div>
     <?php 
    }
    ?>
    </div>
   </div>

   <?php 
    // ステップ2
    ?>
   <?php 
    if (dp_logo_exists()) {
        ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
        _e('Step 2 : Resize uploaded image.', 'tcd-w');
        ?>
</h3>
    <div class="theme_option_input">
    <?php 
        if (dp_logo_exists()) {
            ?>
     <p><?php 
            _e('You can resize uploaded image.<br />If you don\'t need to resize, go to step 3.', 'tcd-w');
            ?>
</p>
     <div class="uploaded_logo">
      <h4><?php 
            _e('Please drag the range to cut off.', 'tcd-w');
            ?>
</h4>
      <div class="uploaded_logo_image">
       <?php 
            dp_logo_resize_base(9999);
            ?>
      </div>
      <div class="resize_amount">
       <label><?php 
            _e('Ratio', 'tcd-w');
            ?>
: <input type="text" name="dp_resize_ratio" id="dp_resize_ratio" value="100" />%</label>
       <label><?php 
            _e('Width', 'tcd-w');
            ?>
: <input type="text" name="dp_resized_width" id="dp_resized_width" />px</label>
       <label><?php 
            _e('Height', 'tcd-w');
            ?>
: <input type="text" name="dp_resized_height" id="dp_resized_height" />px</label>
      </div>
      <div id="resize_button_area">
       <input type="submit" class="button-primary" value="<?php 
            _e('Resize', 'tcd-w');
            ?>
" />
      </div>
     </div>
     <?php 
            if ($info = dp_logo_info(true)) {
                ?>
     <div class="uploaded_logo">
      <h4><?php 
                printf(__('Resized image : width %1$dpx, height %2$dpx', 'tcd-w'), $info['width'], $info['height']);
                ?>
</h4>
      <div class="uploaded_logo_image">
       <?php 
                dp_logo_img_tag(true, '', '', 9999);
                ?>
      </div>
     </div>
     <?php 
            }
            ?>
    <?php 
        }
        ?>
    </div>
   </div>
   <?php 
    }
    ?>

   <?php 
    // ステップ3
    ?>
   <?php 
    if (dp_logo_exists()) {
        ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
        _e('Step 3 : Adjust position of logo.', 'tcd-w');
        ?>
</h3>
    <div class="theme_option_input">
    <?php 
        if (dp_logo_exists()) {
            ?>
     <p><?php 
            _e('Drag the logo image and adjust the position.', 'tcd-w');
            ?>
</p>
     <div id="tcd-w-logo-adjuster" class="ratio-<?php 
            echo '760-760';
            ?>
">
      <?php 
            if (dp_logo_resize_tag(760, 760, $options['logotop'], $options['logoleft'])) {
                ?>
      <?php 
            } else {
                ?>
      <span><?php 
                _e('Logo size is too big. Please resize your logo image.', 'tcd-w');
                ?>
</span>
      <?php 
            }
            ?>
     </div>
     <div class="hide">
      <label><?php 
            _e('Top', 'tcd-w');
            ?>
: <input type="text" name="dp_options[logotop]" id="dp-options-logotop" value="<?php 
            esc_attr_e($options['logotop']);
            ?>
" />px </label>
      <label><?php 
            _e('Left', 'tcd-w');
            ?>
: <input type="text" name="dp_options[logoleft]" id="dp-options-logoleft" value="<?php 
            esc_attr_e($options['logoleft']);
            ?>
" />px </label>
      <input type="button" class="button" id="dp-adjust-realvalue" value="adjust" />
     </div>
     <p><input type="submit" class="button" value="<?php 
            _e('Save the position', 'tcd-w');
            ?>
" /></p>
    <?php 
        }
        ?>
    </div>
   </div>
   <?php 
    }
    ?>

   <?php 
    // 画像の削除
    ?>
   <?php 
    if (dp_logo_exists()) {
        ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
        _e('Delete logo image.', 'tcd-w');
        ?>
</h3>
    <div class="theme_option_input">
     <p><?php 
        _e('If you delete the logo image, normal text will be used for a site logo.', 'tcd-w');
        ?>
</p>
     <p><a class="button" href="<?php 
        echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_image_' . get_current_user_id());
        ?>
" onclick="if(!confirm('<?php 
        _e('Are you sure to delete logo image?', 'tcd-w');
        ?>
')) return false;"><?php 
        _e('Delete Image', 'tcd-w');
        ?>
</a></p>
    </div>
   </div>
   <?php 
    }
    ?>

  </div><!-- END #tab-content2 -->




  <!-- #tab-content3 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  -->
  <div id="tab-content3">

  <p class="tab_desc"><?php 
    _e('Adsense will be displayed at random in front page.<br />Don\'t forget to set the Adsense banner Widget1 from widget page.', 'tcd-w');
    ?>
</p>
  <p class="tab_desc"><?php 
    _e('Please read about Adsense terms of use before you use this checkbox option.', 'tcd-w');
    ?>
</p>
  <p class="tab_desc"><label><input id="dp_options[fix_ad]" name="dp_options[fix_ad]" type="checkbox" value="1" <?php 
    checked('1', $options['fix_ad']);
    ?>
 /> <?php 
    _e('Fix position of adsense', 'tcd-w');
    ?>
</label></p>

  <?php 
    // ウィジェット広告1 --------------------------------------------------------------------------------------------
    ?>
  <?php 
    for ($i = 1; $i <= 3; $i++) {
        ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
        _e('Adsense banner setup', 'tcd-w');
        echo $i;
        ?>
</h3>
   <div class="theme_option_field cf">
    <div class="theme_option_input">
     <div class="sub_box">
      <h4><?php 
        _e('Banner code', 'tcd-w');
        ?>
</h4>
      <p><?php 
        _e('If you are using google adsense, enter all code below.', 'tcd-w');
        ?>
</p>
      <div class="theme_option_input">
       <textarea id="dp_options[side_ad_top_code<?php 
        echo $i;
        ?>
]" class="large-text" cols="50" rows="10" name="dp_options[side_ad_top_code<?php 
        echo $i;
        ?>
]"><?php 
        echo esc_textarea($options['side_ad_top_code' . $i]);
        ?>
</textarea>
      </div>
     </div>
     <p><?php 
        _e('If you are not using google adsense, you can register your banner image and affiliate code individually.', 'tcd-w');
        ?>
</p>
     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
        _e('Register banner image', 'tcd-w');
        ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[side_ad_top_image<?php 
        echo $i;
        ?>
]" value="<?php 
        esc_attr_e($options['side_ad_top_image' . $i]);
        ?>
" /></div>
        <input type="file" name="side_ad_top_image_file_<?php 
        echo $i;
        ?>
" id="side_ad_top_image_file_<?php 
        echo $i;
        ?>
" />
        <input type="submit" class="button-primary" value="<?php 
        echo __('Save Image', 'tcd-w');
        ?>
" />
       </div>
       <?php 
        if ($options['side_ad_top_image' . $i]) {
            ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
            esc_attr_e($options['side_ad_top_image' . $i]);
            ?>
" alt="" title="" />
        </div>
        <?php 
            if (dp_is_uploaded_img($options['side_ad_top_image' . $i])) {
                ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
                echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_side_ad_top_image' . $i);
                ?>
" class="button" onclick="if(!confirm('<?php 
                _e('Are you sure to delete this image?', 'tcd-w');
                ?>
')) return false;"><?php 
                _e('Delete Image', 'tcd-w');
                ?>
</a>
        </div>
       <?php 
            }
            ?>
       <?php 
        }
        ?>
      </div>
     </div>
     <div class="sub_box">
      <h4><?php 
        _e('Register affiliate code', 'tcd-w');
        ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[side_ad_top_url<?php 
        echo $i;
        ?>
]" class="regular-text" type="text" name="dp_options[side_ad_top_url<?php 
        echo $i;
        ?>
]" value="<?php 
        esc_attr_e($options['side_ad_top_url' . $i]);
        ?>
" />
      </div>
     </div>
    </div>
   </div>
  </div>
  <?php 
    }
    ?>

  <p class="submit"><input type="submit" class="button-primary" value="<?php 
    echo __('Save Changes', 'tcd-w');
    ?>
" /></p>

  </div><!-- END #tab-content3 -->



  <!-- #tab-content4 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  -->
  <div id="tab-content4">

  <p class="tab_desc"><?php 
    _e('Adsense will be displayed at random in front page.<br />Don\'t forget to set the Adsense banner Widget2 from widget page.', 'tcd-w');
    ?>
</p>

  <?php 
    // ウィジェット広告2 --------------------------------------------------------------------------------------------
    ?>
  <?php 
    for ($i = 1; $i <= 3; $i++) {
        ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
        _e('Adsense banner setup', 'tcd-w');
        echo $i;
        ?>
</h3>
   <div class="theme_option_field cf">
    <div class="theme_option_input">
     <div class="sub_box">
      <h4><?php 
        _e('Banner code', 'tcd-w');
        ?>
</h4>
      <p><?php 
        _e('If you are using google adsense, enter all code below.', 'tcd-w');
        ?>
</p>
      <div class="theme_option_input">
       <textarea id="dp_options[side_ad_bottom_code<?php 
        echo $i;
        ?>
]" class="large-text" cols="50" rows="10" name="dp_options[side_ad_bottom_code<?php 
        echo $i;
        ?>
]"><?php 
        echo esc_textarea($options['side_ad_bottom_code' . $i]);
        ?>
</textarea>
      </div>
     </div>
     <p><?php 
        _e('If you are not using google adsense, you can register your banner image and affiliate code individually.', 'tcd-w');
        ?>
</p>
     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
        _e('Register banner image', 'tcd-w');
        ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[side_ad_bottom_image<?php 
        echo $i;
        ?>
]" value="<?php 
        esc_attr_e($options['side_ad_bottom_image' . $i]);
        ?>
" /></div>
        <input type="file" name="side_ad_bottom_image_file_<?php 
        echo $i;
        ?>
" id="side_ad_bottom_image_file_<?php 
        echo $i;
        ?>
" />
        <input type="submit" class="button-primary" value="<?php 
        echo __('Save Image', 'tcd-w');
        ?>
" />
       </div>
       <?php 
        if ($options['side_ad_bottom_image' . $i]) {
            ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
            esc_attr_e($options['side_ad_bottom_image' . $i]);
            ?>
" alt="" title="" />
        </div>
        <?php 
            if (dp_is_uploaded_img($options['side_ad_bottom_image' . $i])) {
                ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
                echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_side_ad_bottom_image' . $i);
                ?>
" class="button" onclick="if(!confirm('<?php 
                _e('Are you sure to delete this image?', 'tcd-w');
                ?>
')) return false;"><?php 
                _e('Delete Image', 'tcd-w');
                ?>
</a>
        </div>
       <?php 
            }
            ?>
       <?php 
        }
        ?>
      </div>
     </div>
     <div class="sub_box">
      <h4><?php 
        _e('Register affiliate code', 'tcd-w');
        ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[side_ad_bottom_url<?php 
        echo $i;
        ?>
]" class="regular-text" type="text" name="dp_options[side_ad_bottom_url<?php 
        echo $i;
        ?>
]" value="<?php 
        esc_attr_e($options['side_ad_bottom_url' . $i]);
        ?>
" />
      </div>
     </div>
    </div>
   </div>
  </div>
  <?php 
    }
    ?>

  <p class="submit"><input type="submit" class="button-primary" value="<?php 
    echo __('Save Changes', 'tcd-w');
    ?>
" /></p>

  </div><!-- END #tab-content4 -->




  <!-- #tab-content5 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  -->
  <div id="tab-content5">


  <?php 
    // ヘッダー広告の登録 --------------------------------------------------------------------------------------------
    ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
    _e('Header banner setup.', 'tcd-w');
    ?>
</h3>
   <div class="theme_option_field cf">
    <div class="theme_option_input">

     <div class="sub_box">
      <h4><?php 
    _e('Banner code', 'tcd-w');
    ?>
</h4>
      <p><?php 
    _e('If you are using google adsense, enter all code below.', 'tcd-w');
    ?>
</p>
      <div class="theme_option_input">
       <textarea id="dp_options[header_ad_code1]" class="large-text" cols="50" rows="10" name="dp_options[header_ad_code1]"><?php 
    echo esc_textarea($options['header_ad_code1']);
    ?>
</textarea>
      </div>
     </div>
     <p><?php 
    _e('If you are not using google adsense, you can register your banner image and affiliate code individually.', 'tcd-w');
    ?>
</p>

     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
    _e('Register banner image.(Size width:728px height:90px;)', 'tcd-w');
    ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[header_ad_image1]" value="<?php 
    esc_attr_e($options['header_ad_image1']);
    ?>
" /></div>
        <input type="file" name="header_ad_image_file1" id="header_ad_image_file1" />
        <input type="submit" class="button-primary" value="<?php 
    echo __('Save Image', 'tcd-w');
    ?>
" />
       </div>
       <?php 
    if ($options['header_ad_image1']) {
        ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
        esc_attr_e($options['header_ad_image1']);
        ?>
" alt="" title="" />
        </div>
        <?php 
        if (dp_is_uploaded_img($options['header_ad_image1'])) {
            ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
            echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_header_ad_image1');
            ?>
" class="button" onclick="if(!confirm('<?php 
            _e('Are you sure to delete this image?', 'tcd-w');
            ?>
')) return false;"><?php 
            _e('Delete Image', 'tcd-w');
            ?>
</a>
        </div>
       <?php 
        }
        ?>
       <?php 
    }
    ?>
      </div>
     </div>

     <div class="sub_box">
      <h4><?php 
    _e('Register affiliate code', 'tcd-w');
    ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[header_ad_url1]" class="regular-text" type="text" name="dp_options[header_ad_url1]" value="<?php 
    esc_attr_e($options['header_ad_url1']);
    ?>
" />
      </div>
     </div>

    </div>
   </div>
  </div>


  <?php 
    // 詳細ページの広告1 --------------------------------------------------------------------------------------------
    ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
    _e('Single post page banner setup1.(Show on top of the post.)', 'tcd-w');
    ?>
</h3>
   <div class="theme_option_field cf">
    <div class="theme_option_input">

     <div class="sub_box">
      <h4><?php 
    _e('Banner code', 'tcd-w');
    ?>
</h4>
      <p><?php 
    _e('If you are using google adsense, enter all code below.', 'tcd-w');
    ?>
</p>
      <div class="theme_option_input">
       <textarea id="dp_options[single_ad_code1]" class="large-text" cols="50" rows="10" name="dp_options[single_ad_code1]"><?php 
    echo esc_textarea($options['single_ad_code1']);
    ?>
</textarea>
      </div>
     </div>
     <p><?php 
    _e('If you are not using google adsense, you can register your banner image and affiliate code individually.', 'tcd-w');
    ?>
</p>

     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
    _e('Register banner image.', 'tcd-w');
    ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[single_ad_image1]" value="<?php 
    esc_attr_e($options['single_ad_image1']);
    ?>
" /></div>
        <input type="file" name="single_ad_image_file1" id="single_ad_image_file1" />
        <input type="submit" class="button-primary" value="<?php 
    echo __('Save Image', 'tcd-w');
    ?>
" />
       </div>
       <?php 
    if ($options['single_ad_image1']) {
        ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
        esc_attr_e($options['single_ad_image1']);
        ?>
" alt="" title="" />
        </div>
        <?php 
        if (dp_is_uploaded_img($options['single_ad_image1'])) {
            ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
            echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_single_ad_image1');
            ?>
" class="button" onclick="if(!confirm('<?php 
            _e('Are you sure to delete this image?', 'tcd-w');
            ?>
')) return false;"><?php 
            _e('Delete Image', 'tcd-w');
            ?>
</a>
        </div>
       <?php 
        }
        ?>
       <?php 
    }
    ?>
      </div>
     </div>

     <div class="sub_box">
      <h4><?php 
    _e('Register affiliate code', 'tcd-w');
    ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[single_ad_url1]" class="regular-text" type="text" name="dp_options[single_ad_url1]" value="<?php 
    esc_attr_e($options['single_ad_url1']);
    ?>
" />
      </div>
     </div>

    </div>
   </div>
  </div>


  <?php 
    // 詳細ページの広告2 --------------------------------------------------------------------------------------------
    ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
    _e('Single post page banner setup2.(Show on bottom of the post.)', 'tcd-w');
    ?>
</h3>
   <div class="theme_option_field cf">
    <div class="theme_option_input">

     <div class="sub_box">
      <h4><?php 
    _e('Banner code', 'tcd-w');
    ?>
</h4>
      <p><?php 
    _e('If you are using google adsense, enter all code below.', 'tcd-w');
    ?>
</p>
      <div class="theme_option_input">
       <textarea id="dp_options[single_ad_code2]" class="large-text" cols="50" rows="10" name="dp_options[single_ad_code2]"><?php 
    echo esc_textarea($options['single_ad_code2']);
    ?>
</textarea>
      </div>
     </div>
     <p><?php 
    _e('If you are not using google adsense, you can register your banner image and affiliate code individually.', 'tcd-w');
    ?>
</p>

     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
    _e('Register banner image.', 'tcd-w');
    ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[single_ad_image2]" value="<?php 
    esc_attr_e($options['single_ad_image2']);
    ?>
" /></div>
        <input type="file" name="single_ad_image_file2" id="single_ad_image_file2" />
        <input type="submit" class="button-primary" value="<?php 
    echo __('Save Image', 'tcd-w');
    ?>
" />
       </div>
       <?php 
    if ($options['single_ad_image2']) {
        ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
        esc_attr_e($options['single_ad_image2']);
        ?>
" alt="" title="" />
        </div>
        <?php 
        if (dp_is_uploaded_img($options['single_ad_image2'])) {
            ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
            echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_single_ad_image2');
            ?>
" class="button" onclick="if(!confirm('<?php 
            _e('Are you sure to delete this image?', 'tcd-w');
            ?>
')) return false;"><?php 
            _e('Delete Image', 'tcd-w');
            ?>
</a>
        </div>
       <?php 
        }
        ?>
       <?php 
    }
    ?>
      </div>
     </div>

     <div class="sub_box">
      <h4><?php 
    _e('Register affiliate code', 'tcd-w');
    ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[single_ad_url2]" class="regular-text" type="text" name="dp_options[single_ad_url2]" value="<?php 
    esc_attr_e($options['single_ad_url2']);
    ?>
" />
      </div>
     </div>

    </div>
   </div>
  </div>

  <p class="submit"><input type="submit" class="button-primary" value="<?php 
    echo __('Save Changes', 'tcd-w');
    ?>
" /></p>

  </div><!-- END #tab-content5 -->




  <!-- #tab-content6 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  -->
  <div id="tab-content6">

  <p class="tab_desc"><?php 
    _e('This Adsense is displayed only on the user who accessed the site with the smartphone.', 'tcd-w');
    ?>
</p>

  <?php 
    // モバイル広告の登録(ページ上部) --------------------------------------------------------------------------------------------
    ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
    _e('Smartphone banner setup1. (Display on the top of a page)', 'tcd-w');
    ?>
</h3>
   <div class="theme_option_field cf">
    <div class="theme_option_input">

     <div class="sub_box">
      <h4><?php 
    _e('Banner code', 'tcd-w');
    ?>
</h4>
      <p><?php 
    _e('If you are using google adsense, enter all code below.', 'tcd-w');
    ?>
</p>
      <div class="theme_option_input">
       <textarea id="dp_options[mobile_ad_code1]" class="large-text" cols="50" rows="10" name="dp_options[mobile_ad_code1]"><?php 
    echo esc_textarea($options['mobile_ad_code1']);
    ?>
</textarea>
      </div>
     </div>
     <p><?php 
    _e('If you are not using google adsense, you can register your banner image and affiliate code individually.', 'tcd-w');
    ?>
</p>

     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
    _e('Register banner image.', 'tcd-w');
    ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[mobile_ad_image1]" value="<?php 
    esc_attr_e($options['mobile_ad_image1']);
    ?>
" /></div>
        <input type="file" name="mobile_ad_image_file1" id="mobile_ad_image_file1" />
        <input type="submit" class="button-primary" value="<?php 
    echo __('Save Image', 'tcd-w');
    ?>
" />
       </div>
       <?php 
    if ($options['mobile_ad_image1']) {
        ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
        esc_attr_e($options['mobile_ad_image1']);
        ?>
" alt="" title="" />
        </div>
        <?php 
        if (dp_is_uploaded_img($options['mobile_ad_image1'])) {
            ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
            echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_mobile_ad_image1');
            ?>
" class="button" onclick="if(!confirm('<?php 
            _e('Are you sure to delete this image?', 'tcd-w');
            ?>
')) return false;"><?php 
            _e('Delete Image', 'tcd-w');
            ?>
</a>
        </div>
       <?php 
        }
        ?>
       <?php 
    }
    ?>
      </div>
     </div>

     <div class="sub_box">
      <h4><?php 
    _e('Register affiliate code', 'tcd-w');
    ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[mobile_ad_url1]" class="regular-text" type="text" name="dp_options[mobile_ad_url1]" value="<?php 
    esc_attr_e($options['mobile_ad_url1']);
    ?>
" />
      </div>
     </div>

    </div>
   </div>
  </div>

  <?php 
    // モバイル広告の登録(ページ下部) --------------------------------------------------------------------------------------------
    ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
    _e('Smartphone banner setup2. (Display on the bottom of a page)', 'tcd-w');
    ?>
</h3>
   <div class="theme_option_field cf">
    <div class="theme_option_input">

     <div class="sub_box">
      <h4><?php 
    _e('Banner code', 'tcd-w');
    ?>
</h4>
      <p><?php 
    _e('If you are using google adsense, enter all code below.', 'tcd-w');
    ?>
</p>
      <div class="theme_option_input">
       <textarea id="dp_options[mobile_ad_code2]" class="large-text" cols="50" rows="10" name="dp_options[mobile_ad_code2]"><?php 
    echo esc_textarea($options['mobile_ad_code2']);
    ?>
</textarea>
      </div>
     </div>
     <p><?php 
    _e('If you are not using google adsense, you can register your banner image and affiliate code individually.', 'tcd-w');
    ?>
</p>

     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
    _e('Register banner image.', 'tcd-w');
    ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[mobile_ad_image2]" value="<?php 
    esc_attr_e($options['mobile_ad_image2']);
    ?>
" /></div>
        <input type="file" name="mobile_ad_image_file2" id="mobile_ad_image_file2" />
        <input type="submit" class="button-primary" value="<?php 
    echo __('Save Image', 'tcd-w');
    ?>
" />
       </div>
       <?php 
    if ($options['mobile_ad_image2']) {
        ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
        esc_attr_e($options['mobile_ad_image2']);
        ?>
" alt="" title="" />
        </div>
        <?php 
        if (dp_is_uploaded_img($options['mobile_ad_image2'])) {
            ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
            echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_mobile_ad_image2');
            ?>
" class="button" onclick="if(!confirm('<?php 
            _e('Are you sure to delete this image?', 'tcd-w');
            ?>
')) return false;"><?php 
            _e('Delete Image', 'tcd-w');
            ?>
</a>
        </div>
       <?php 
        }
        ?>
       <?php 
    }
    ?>
      </div>
     </div>

     <div class="sub_box">
      <h4><?php 
    _e('Register affiliate code', 'tcd-w');
    ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[mobile_ad_url2]" class="regular-text" type="text" name="dp_options[mobile_ad_url2]" value="<?php 
    esc_attr_e($options['mobile_ad_url2']);
    ?>
" />
      </div>
     </div>

    </div>
   </div>
  </div>

  <p class="submit"><input type="submit" class="button-primary" value="<?php 
    echo __('Save Changes', 'tcd-w');
    ?>
" /></p>

  </div><!-- END #tab-content6 -->




  </div><!-- END #tab-panel -->

 </form>

</div>

</div>

<?php 
}
function theme_options_do_page()
{
    global $color_options, $single_post_list_options, $bg_type1_options, $bg_type2_options, $dp_upload_error;
    $options = get_desing_plus_option();
    if (!isset($_REQUEST['settings-updated'])) {
        $_REQUEST['settings-updated'] = false;
    }
    ?>

<div class="wrap">
 <?php 
    screen_icon();
    echo "<h2>" . __('Theme Options', 'tcd-w') . "</h2>";
    ?>

 <?php 
    // 更新時のメッセージ
    if (false !== $_REQUEST['settings-updated']) {
        ?>
 <div class="updated fade"><p><strong><?php 
        _e('Updated', 'tcd-w');
        ?>
</strong></p></div>
 <?php 
    }
    ?>

 <?php 
    /* ファイルアップロード時のメッセージ */
    if (!empty($dp_upload_error['message'])) {
        ?>
  <?php 
        if ($dp_upload_error['error']) {
            ?>
   <div id="error" class="error"><p><?php 
            echo $dp_upload_error['message'];
            ?>
</p></div>
  <?php 
        } else {
            ?>
   <div id="message" class="updated fade"><p><?php 
            echo $dp_upload_error['message'];
            ?>
</p></div>
  <?php 
        }
        ?>
 <?php 
    }
    ?>
 
 <script type="text/javascript">
  jQuery(document).ready(function($){
   $('#my_theme_option').cookieTab({
    tabMenuElm: '#theme_tab',
    tabPanelElm: '#tab-panel'
   });
  });
 </script>

 <div id="my_theme_option">

 <div id="theme_tab_wrap">
  <ul id="theme_tab" class="cf">
   <li><a href="#tab-content1"><?php 
    _e('Basic Setup', 'tcd-w');
    ?>
</a></li>
   <li><a href="#tab-content2"><?php 
    _e('Slider Setup', 'tcd-w');
    ?>
</a></li>
   <li><a href="#tab-content3"><?php 
    _e('Logo', 'tcd-w');
    ?>
</a></li>
   <li><a href="#tab-content4"><?php 
    _e('Adsence Setup', 'tcd-w');
    ?>
</a></li>
  </ul>
 </div>

<form method="post" action="options.php" enctype="multipart/form-data">
 <?php 
    settings_fields('design_plus_options');
    ?>

 <div id="tab-panel">

  <!-- #tab-content1 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  -->
  <div id="tab-content1">

   <?php 
    // フォントサイズ
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Font size', 'tcd-w');
    ?>
</h3>
    <p><?php 
    _e('Font size of single page and wp-page.', 'tcd-w');
    ?>
</p>
    <div class="theme_option_input">
     <input id="dp_options[content_font_size]" class="font_size" type="text" name="dp_options[content_font_size]" value="<?php 
    esc_attr_e($options['content_font_size']);
    ?>
" /><span>px</span>
    </div>
   </div>

   <?php 
    // 投稿者名・タグ・コメント
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Display Setup', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input">
     <ul>
      <li><label><input id="dp_options[show_author]" name="dp_options[show_author]" type="checkbox" value="1" <?php 
    checked('1', $options['show_author']);
    ?>
 /> <?php 
    _e('Display author', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_comment]" name="dp_options[show_comment]" type="checkbox" value="1" <?php 
    checked('1', $options['show_comment']);
    ?>
 /> <?php 
    _e('Display comment', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_trackback]" name="dp_options[show_trackback]" type="checkbox" value="1" <?php 
    checked('1', $options['show_trackback']);
    ?>
 /> <?php 
    _e('Display trackbacks', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_bookmark]" name="dp_options[show_bookmark]" type="checkbox" value="1" <?php 
    checked('1', $options['show_bookmark']);
    ?>
 /> <?php 
    _e('Display social bookmark', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_next_post]" name="dp_options[show_next_post]" type="checkbox" value="1" <?php 
    checked('1', $options['show_next_post']);
    ?>
 /> <?php 
    _e('Display next previous post link', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_related_post]" name="dp_options[show_related_post]" type="checkbox" value="1" <?php 
    checked('1', $options['show_related_post']);
    ?>
 /> <?php 
    _e('Display Related post', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_rss]" name="dp_options[show_rss]" type="checkbox" value="1" <?php 
    checked('1', $options['show_rss']);
    ?>
 /> <?php 
    _e('Display RSS button at left sidebar', 'tcd-w');
    ?>
</label></li>
      <li><label><input id="dp_options[show_search]" name="dp_options[show_search]" type="checkbox" value="1" <?php 
    checked('1', $options['show_search']);
    ?>
 /> <?php 
    _e('Display search box at left sidebar', 'tcd-w');
    ?>
</label></li>
     </ul>
    </div>
   </div>

   <?php 
    // 色の設定
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Basic color setting', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input layout_option color_type_list">
     <fieldset class="cf"><legend class="screen-reader-text"><span><?php 
    _e('Color type', 'tcd-w');
    ?>
</span></legend>
     <?php 
    if (!isset($checked)) {
        $checked = '';
    }
    foreach ($color_options as $option) {
        $color_setting = $options['color_type'];
        if ('' != $color_setting) {
            if ($options['color_type'] == $option['value']) {
                $checked = "checked=\"checked\"";
            } else {
                $checked = '';
            }
        }
        ?>
      <label class="description">
       <input type="radio" id="input_<?php 
        esc_attr_e($option['value']);
        ?>
" name="dp_options[color_type]" value="<?php 
        esc_attr_e($option['value']);
        ?>
" <?php 
        echo $checked;
        ?>
 />
       <img src="<?php 
        bloginfo('template_url');
        ?>
/admin/color/<?php 
        echo $option['img'];
        ?>
.gif" alt="" title="" />
       <?php 
        echo $option['label'];
        ?>
      </label>
     <?php 
    }
    ?>
     </fieldset>
    </div>
   </div>


 <script type="text/javascript">
  jQuery(document).ready(function($){

   if($("#input_type3:checked").val()) {
    $('#background_pattern').show();
   } else {
    $('#background_pattern').hide();
   };

   $("#input_type3").click(function () {
    $('#background_pattern').show();
   });

   $("#bg_type1 input").not('#input_type3').click(function () {
    $('#background_pattern').hide();
   });

   if($("#input_type4:checked").val()) {
    $('#original_pattern').show();
   } else {
    $('#original_pattern').hide();
   };

   $("#input_type4").click(function () {
    $('#original_pattern').show();
   });

   $("#bg_type1 input").not('#input_type4').click(function () {
    $('#original_pattern').hide();
   });

  });
 </script>


   <?php 
    // 背景色の設定
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Background color setting', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input" id="bg_type1">
     <p><?php 
    _e('Select background type', 'tcd-w');
    ?>
</p>
     <fieldset class="cf"><legend class="screen-reader-text"><span><?php 
    _e('Background type', 'tcd-w');
    ?>
</span></legend>
     <?php 
    if (!isset($checked)) {
        $checked = '';
    }
    foreach ($bg_type1_options as $option) {
        $bg_type1_setting = $options['bg_type1'];
        if ('' != $bg_type1_setting) {
            if ($options['bg_type1'] == $option['value']) {
                $checked = "checked=\"checked\"";
            } else {
                $checked = '';
            }
        }
        ?>
      <label class="description">
       <input id="input_<?php 
        esc_attr_e($option['value']);
        ?>
" type="radio" name="dp_options[bg_type1]" value="<?php 
        esc_attr_e($option['value']);
        ?>
" <?php 
        echo $checked;
        ?>
 />
       <?php 
        echo $option['label'];
        ?>
      </label>
     <?php 
    }
    ?>
     </fieldset>
    </div>
   </div>

   <div id="background_pattern" style="display:none;">
    <?php 
    // 背景画像の設定
    ?>
    <div class="theme_option_field cf">
     <p><?php 
    _e('Background image type', 'tcd-w');
    ?>
</p>
     <div class="theme_option_input layout_option" id="bg_type2">
      <fieldset class="cf"><legend class="screen-reader-text"><span><?php 
    _e('Background image type', 'tcd-w');
    ?>
</span></legend>
      <?php 
    if (!isset($checked)) {
        $checked = '';
    }
    foreach ($bg_type2_options as $option) {
        $bg_type2_setting = $options['bg_type2'];
        if ('' != $bg_type2_setting) {
            if ($options['bg_type2'] == $option['value']) {
                $checked = "checked=\"checked\"";
            } else {
                $checked = '';
            }
        }
        ?>
       <label class="description">
        <input type="radio" id="input_<?php 
        esc_attr_e($option['value']);
        ?>
" name="dp_options[bg_type2]" value="<?php 
        esc_attr_e($option['value']);
        ?>
" <?php 
        echo $checked;
        ?>
 />
        <img src="<?php 
        bloginfo('template_url');
        ?>
/admin/background/<?php 
        echo $option['img'];
        ?>
.gif" alt="" title="" />
        <?php 
        echo $option['label'];
        ?>
       </label>
      <?php 
    }
    ?>
      </fieldset>
     </div>
    </div>
   </div>

   <div id="original_pattern" style="display:none;">
    <div class="theme_option_field cf">
     <p><?php 
    _e('Register original pattern.', 'tcd-w');
    ?>
</p>
     <div class="image_box cf">
      <div class="upload_banner_button_area">
       <div style="display:none;"><input type="text" size="36" name="dp_options[original_pattern]" value="<?php 
    esc_attr_e($options['original_pattern']);
    ?>
" /></div>
       <input type="file" name="original_pattern_file" id="original_pattern_file" />
       <input type="submit" class="button-primary" value="<?php 
    echo __('Save Image', 'tcd-w');
    ?>
" />
      </div>
      <?php 
    if ($options['original_pattern']) {
        ?>
       <div class="uploaded_banner_image">
        <img src="<?php 
        esc_attr_e($options['original_pattern']);
        ?>
" alt="" title="" />
       </div>
       <?php 
        if (dp_is_uploaded_img($options['original_pattern'])) {
            ?>
       <div class="delete_uploaded_banner_image">
        <a href="<?php 
            echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_original_pattern');
            ?>
" class="button" onclick="if(!confirm('<?php 
            _e('Are you sure to delete this image?', 'tcd-w');
            ?>
')) return false;"><?php 
            _e('Delete Image', 'tcd-w');
            ?>
</a>
       </div>
      <?php 
        }
        ?>
      <?php 
    }
    ?>
     </div>
    </div>
   </div>

   <?php 
    // 左サイドのメニューの設定
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Side menu setup', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input">
     <ul id="side_menu_setting">
      <li>
       <label><input id="dp_options[show_side_category]" name="dp_options[show_side_category]" type="checkbox" value="1" <?php 
    checked('1', $options['show_side_category']);
    ?>
 /> <?php 
    _e('Display side category', 'tcd-w');
    ?>
</label>
       <input id="dp_options[headline_side_category]" class="regular-text" type="text" name="dp_options[headline_side_category]" value="<?php 
    esc_attr_e($options['headline_side_category']);
    ?>
" />
      </li>
      <li>
       <label><input id="dp_options[show_side_archive]" name="dp_options[show_side_archive]" type="checkbox" value="1" <?php 
    checked('1', $options['show_side_archive']);
    ?>
 /> <?php 
    _e('Display side archive', 'tcd-w');
    ?>
</label>
       <input id="dp_options[headline_side_archive]" class="regular-text" type="text" name="dp_options[headline_side_archive]" value="<?php 
    esc_attr_e($options['headline_side_archive']);
    ?>
" />
      </li>
      <li>
       <label><input id="dp_options[show_side_menu]" name="dp_options[show_side_menu]" type="checkbox" value="1" <?php 
    checked('1', $options['show_side_menu']);
    ?>
 /> <?php 
    _e('Display side menu', 'tcd-w');
    ?>
</label>
       <input id="dp_options[headline_side_menu]" class="regular-text" type="text" name="dp_options[headline_side_menu]" value="<?php 
    esc_attr_e($options['headline_side_menu']);
    ?>
" />
      </li>
     </ul>
    </div>
   </div>

   <?php 
    // 詳細記事ページの記事一覧の設定
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Single page post list setting', 'tcd-w');
    ?>
</h3>
    <div id="single_post_list_num_area" class="cf">
     <p><?php 
    _e('Number of post.', 'tcd-w');
    ?>
</p>
     <input id="dp_options[single_post_list_num]" class="font_size" type="text" name="dp_options[single_post_list_num]" value="<?php 
    esc_attr_e($options['single_post_list_num']);
    ?>
" />
    </div>
    <div class="theme_option_input" id="single_post_list_area">
     <p><?php 
    _e('Select post type', 'tcd-w');
    ?>
</p>
     <fieldset class="cf"><legend class="screen-reader-text"><span><?php 
    _e('Post list type', 'tcd-w');
    ?>
</span></legend>
     <?php 
    if (!isset($checked)) {
        $checked = '';
    }
    foreach ($single_post_list_options as $option) {
        $single_post_list_setting = $options['single_post_list'];
        if ('' != $single_post_list_setting) {
            if ($options['single_post_list'] == $option['value']) {
                $checked = "checked=\"checked\"";
            } else {
                $checked = '';
            }
        }
        ?>
      <label class="description">
       <input type="radio" name="dp_options[single_post_list]" value="<?php 
        esc_attr_e($option['value']);
        ?>
" <?php 
        echo $checked;
        ?>
 />
       <?php 
        echo $option['label'];
        ?>
      </label>
     <?php 
    }
    ?>
     </fieldset>
    </div>
   </div>

   <?php 
    // facebook twitter
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('twitter and facebook setup', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input">
     <p><?php 
    _e('When it is blank, twitter and facebook icon will not displayed on a site.', 'tcd-w');
    ?>
</p>
     <ul>
      <li>
       <label style="display:inline-block; min-width:140px;"><?php 
    _e('your twitter URL', 'tcd-w');
    ?>
</label>
       <input id="dp_options[twitter_url]" class="regular-text" type="text" name="dp_options[twitter_url]" value="<?php 
    esc_attr_e($options['twitter_url']);
    ?>
" />
      </li>
      <li>
       <label style="display:inline-block; min-width:140px;"><?php 
    _e('your facebook URL', 'tcd-w');
    ?>
</label>
       <input id="dp_options[facebook_url]" class="regular-text" type="text" name="dp_options[facebook_url]" value="<?php 
    esc_attr_e($options['facebook_url']);
    ?>
" />
      </li>
     </ul>
    </div>
   </div>

   <?php 
    // 検索の設定
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Using Google custom search', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input">
     <p><?php 
    _e('If you wan\'t to use google custom search for your wordpress, enter your google custom search ID.<br /><a href="http://www.google.com/cse/" target="_blank">Read more about Google custom search page.</a>', 'tcd-w');
    ?>
</p>
     <label style="display:inline-block; margin:0 20px 0 0;"><?php 
    _e('Google custom search ID', 'tcd-w');
    ?>
</label>
     <input id="dp_options[custom_search_id]" class="regular-text" type="text" name="dp_options[custom_search_id]" value="<?php 
    esc_attr_e($options['custom_search_id']);
    ?>
" />
    </div>
   </div>

   <p class="submit"><input type="submit" class="button-primary" value="<?php 
    echo __('Save Changes', 'tcd-w');
    ?>
" /></p>

  </div><!-- END #tab-content1 -->




  <!-- #tab-content2 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  -->
  <div id="tab-content2">

  <p><label><input id="dp_options[show_slider]" name="dp_options[show_slider]" type="checkbox" value="1" <?php 
    checked('1', $options['show_slider']);
    ?>
 /> <?php 
    _e('Display slider', 'tcd-w');
    ?>
</label></p>

  <?php 
    for ($i = 1; $i <= 10; $i++) {
        ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
        _e('Slider image setup', 'tcd-w');
        echo $i;
        ?>
</h3>
   <div class="theme_option_field cf">
    <div class="theme_option_input">
     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
        _e('Register slider image (width:616px height:300px)', 'tcd-w');
        ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[slider_image<?php 
        echo $i;
        ?>
]" value="<?php 
        esc_attr_e($options['slider_image' . $i]);
        ?>
" /></div>
        <input type="file" name="slider_image_file<?php 
        echo $i;
        ?>
" id="slider_image_file<?php 
        echo $i;
        ?>
" />
        <input type="submit" class="button-primary" value="<?php 
        echo __('Save Image', 'tcd-w');
        ?>
" />
       </div>
       <?php 
        if ($options['slider_image' . $i]) {
            ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
            esc_attr_e($options['slider_image' . $i]);
            ?>
" alt="" title="" />
        </div>
        <?php 
            if (dp_is_uploaded_img($options['slider_image' . $i])) {
                ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
                echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_slider_image' . $i);
                ?>
" class="button" onclick="if(!confirm('<?php 
                _e('Are you sure to delete this image?', 'tcd-w');
                ?>
')) return false;"><?php 
                _e('Delete Image', 'tcd-w');
                ?>
</a>
        </div>
       <?php 
            }
            ?>
       <?php 
        }
        ?>
      </div>
     </div>
     <div class="sub_box">
      <h4><?php 
        _e('Register url for this image', 'tcd-w');
        ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[slider_url<?php 
        echo $i;
        ?>
]" class="regular-text" type="text" name="dp_options[slider_url<?php 
        echo $i;
        ?>
]" value="<?php 
        esc_attr_e($options['slider_url' . $i]);
        ?>
" />
      </div>
     </div>
    </div>
   </div>
  </div>
  <?php 
    }
    ?>

  <p class="submit"><input type="submit" class="button-primary" value="<?php 
    echo __('Save Changes', 'tcd-w');
    ?>
" /></p>

  </div><!-- END #tab-content2 -->




  <!-- #tab-content3 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  -->
  <div id="tab-content3">

   <?php 
    // ステップ1
    ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
    _e('Step 1 : Upload image to use for logo.', 'tcd-w');
    ?>
</h3>
    <div class="theme_option_input">
     <p><?php 
    _e('Upload image to use for logo from your computer.<br />You can resize your logo image in step 2 and adjust position in step 3.', 'tcd-w');
    ?>
</p>
     <div class="button_area">
      <label for="dp_image"><?php 
    _e('Select image to use for logo from your computer.', 'tcd-w');
    ?>
</label>
      <input type="file" name="dp_image" id="dp_image" value="" />
      <input type="submit" class="button" value="<?php 
    _e('Upload', 'tcd-w');
    ?>
" />
     </div>
     <?php 
    if (dp_logo_exists()) {
        $info = dp_logo_info();
        ?>
     <div class="uploaded_logo">
      <h4><?php 
        _e('Uploaded image.', 'tcd-w');
        ?>
</h4>
      <div class="uploaded_logo_image" id="original_logo_size">
       <?php 
        dp_logo_img_tag(false, '', '', 9999);
        ?>
      </div>
      <p><?php 
        printf(__('Original image size : width %1$dpx, height %2$dpx', 'tcd-w'), $info['width'], $info['height']);
        ?>
</p>
     </div>
     <?php 
    } else {
        ?>
     <div class="uploaded_logo">
      <h4><?php 
        _e('The image has not been uploaded yet.<br />A normal text will be used for a site logo.', 'tcd-w');
        ?>
</h4>
     </div>
     <?php 
    }
    ?>
    </div>
   </div>

   <?php 
    // ステップ2
    ?>
   <?php 
    if (dp_logo_exists()) {
        ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
        _e('Step 2 : Resize uploaded image.', 'tcd-w');
        ?>
</h3>
    <div class="theme_option_input">
    <?php 
        if (dp_logo_exists()) {
            ?>
     <p><?php 
            _e('You can resize uploaded image.<br />If you don\'t need to resize, go to step 3.', 'tcd-w');
            ?>
</p>
     <div class="uploaded_logo">
      <h4><?php 
            _e('Please drag the range to cut off.', 'tcd-w');
            ?>
</h4>
      <div class="uploaded_logo_image">
       <?php 
            dp_logo_resize_base(9999);
            ?>
      </div>
      <div class="resize_amount">
       <label><?php 
            _e('Ratio', 'tcd-w');
            ?>
: <input type="text" name="dp_resize_ratio" id="dp_resize_ratio" value="100" />%</label>
       <label><?php 
            _e('Width', 'tcd-w');
            ?>
: <input type="text" name="dp_resized_width" id="dp_resized_width" />px</label>
       <label><?php 
            _e('Height', 'tcd-w');
            ?>
: <input type="text" name="dp_resized_height" id="dp_resized_height" />px</label>
      </div>
      <div id="resize_button_area">
       <input type="submit" class="button-primary" value="<?php 
            _e('Resize', 'tcd-w');
            ?>
" />
      </div>
     </div>
     <?php 
            if ($info = dp_logo_info(true)) {
                ?>
     <div class="uploaded_logo">
      <h4><?php 
                printf(__('Resized image : width %1$dpx, height %2$dpx', 'tcd-w'), $info['width'], $info['height']);
                ?>
</h4>
      <div class="uploaded_logo_image">
       <?php 
                dp_logo_img_tag(true, '', '', 9999);
                ?>
      </div>
     </div>
     <?php 
            }
            ?>
    <?php 
        }
        ?>
    </div>
   </div>
   <?php 
    }
    ?>

   <?php 
    // ステップ3
    ?>
   <?php 
    if (dp_logo_exists()) {
        ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
        _e('Step 3 : Adjust position of logo.', 'tcd-w');
        ?>
</h3>
    <div class="theme_option_input">
    <?php 
        if (dp_logo_exists()) {
            ?>
     <p><?php 
            _e('Drag the logo image and adjust the position.', 'tcd-w');
            ?>
</p>
     <div id="tcd-w-logo-adjuster" class="ratio-<?php 
            echo '760-760';
            ?>
">
      <?php 
            if (dp_logo_resize_tag(760, 760, $options['logotop'], $options['logoleft'])) {
                ?>
      <?php 
            } else {
                ?>
      <span><?php 
                _e('Logo size is too big. Please resize your logo image.', 'tcd-w');
                ?>
</span>
      <?php 
            }
            ?>
     </div>
     <div class="hide">
      <label><?php 
            _e('Top', 'tcd-w');
            ?>
: <input type="text" name="dp_options[logotop]" id="dp-options-logotop" value="<?php 
            esc_attr_e($options['logotop']);
            ?>
" />px </label>
      <label><?php 
            _e('Left', 'tcd-w');
            ?>
: <input type="text" name="dp_options[logoleft]" id="dp-options-logoleft" value="<?php 
            esc_attr_e($options['logoleft']);
            ?>
" />px </label>
      <input type="button" class="button" id="dp-adjust-realvalue" value="adjust" />
     </div>
     <p><input type="submit" class="button" value="<?php 
            _e('Save the position', 'tcd-w');
            ?>
" /></p>
    <?php 
        }
        ?>
    </div>
   </div>
   <?php 
    }
    ?>

   <?php 
    // 画像の削除
    ?>
   <?php 
    if (dp_logo_exists()) {
        ?>
   <div class="theme_option_field cf">
    <h3 class="theme_option_headline"><?php 
        _e('Delete logo image.', 'tcd-w');
        ?>
</h3>
    <div class="theme_option_input">
     <p><?php 
        _e('If you delete the logo image, normal text will be used for a site logo.', 'tcd-w');
        ?>
</p>
     <p><a class="button" href="<?php 
        echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_image_' . get_current_user_id());
        ?>
" onclick="if(!confirm('<?php 
        _e('Are you sure to delete logo image?', 'tcd-w');
        ?>
')) return false;"><?php 
        _e('Delete Image', 'tcd-w');
        ?>
</a></p>
    </div>
   </div>
   <?php 
    }
    ?>

  </div><!-- END #tab-content2 -->




  <!-- #tab-content4 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  -->
  <div id="tab-content4">

  <?php 
    for ($i = 1; $i <= 3; $i++) {
        ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
        _e('Adsense banner setup', 'tcd-w');
        echo $i;
        ?>
</h3>
   <?php 
        if ($i == 2) {
            ?>
   <p class="tab_desc"><?php 
            _e('<strong>This Adsense will not be displayed if you set post number less than 4 at Reading Settings page.</strong>', 'tcd-w');
            ?>
</p>
   <?php 
        } elseif ($i == 3) {
            ?>
   <p class="tab_desc"><?php 
            _e('<strong>This Adsense will not be displayed if you set post number less than 8 at Reading Settings page.</strong>', 'tcd-w');
            ?>
</p>
   <?php 
        }
        ?>
   <p class="tab_desc"><?php 
        _e('This Adsense will be displayed at front page, archive page, and search result page.', 'tcd-w');
        ?>
</p>
   <div class="theme_option_field cf">
    <div class="theme_option_input">
     <div class="sub_box">
      <h4><?php 
        _e('Banner code', 'tcd-w');
        ?>
</h4>
      <p><?php 
        _e('If you are using google adsense, enter all code below.', 'tcd-w');
        ?>
</p>
      <div class="theme_option_input">
       <textarea id="dp_options[post_ad<?php 
        echo $i;
        ?>
]" class="large-text" cols="50" rows="10" name="dp_options[post_ad<?php 
        echo $i;
        ?>
]"><?php 
        echo esc_textarea($options['post_ad' . $i]);
        ?>
</textarea>
      </div>
     </div>
     <p><?php 
        _e('If you are not using google adsense, you can register your banner image and affiliate code individually.', 'tcd-w');
        ?>
</p>
     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
        _e('Register banner image', 'tcd-w');
        ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[post_ad_image<?php 
        echo $i;
        ?>
]" value="<?php 
        esc_attr_e($options['post_ad_image' . $i]);
        ?>
" /></div>
        <input type="file" name="post_ad_image_file_<?php 
        echo $i;
        ?>
" id="post_ad_image_file_<?php 
        echo $i;
        ?>
" />
        <input type="submit" class="button-primary" value="<?php 
        echo __('Save Image', 'tcd-w');
        ?>
" />
       </div>
       <?php 
        if ($options['post_ad_image' . $i]) {
            ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
            esc_attr_e($options['post_ad_image' . $i]);
            ?>
" alt="" title="" />
        </div>
        <?php 
            if (dp_is_uploaded_img($options['post_ad_image' . $i])) {
                ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
                echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_post_ad_' . $i);
                ?>
" class="button" onclick="if(!confirm('<?php 
                _e('Are you sure to delete this image?', 'tcd-w');
                ?>
')) return false;"><?php 
                _e('Delete Image', 'tcd-w');
                ?>
</a>
        </div>
       <?php 
            }
            ?>
       <?php 
        }
        ?>
      </div>
     </div>
     <div class="sub_box">
      <h4><?php 
        _e('Register affiliate code', 'tcd-w');
        ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[post_ad_url<?php 
        echo $i;
        ?>
]" class="regular-text" type="text" name="dp_options[post_ad_url<?php 
        echo $i;
        ?>
]" value="<?php 
        esc_attr_e($options['post_ad_url' . $i]);
        ?>
" />
      </div>
     </div>
    </div>
   </div>
  </div>
  <?php 
    }
    ?>

  <?php 
    // 詳細ページの広告1 --------------------------------------------------------------------------------------------
    ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
    _e('Single post page banner setup1.', 'tcd-w');
    ?>
</h3>
   <p class="tab_desc"><?php 
    _e('This Adsense will be displayed at right column top in single post page.', 'tcd-w');
    ?>
</p>
   <div class="theme_option_field cf">
    <div class="theme_option_input">

     <div class="sub_box">
      <h4><?php 
    _e('Banner code', 'tcd-w');
    ?>
</h4>
      <p><?php 
    _e('If you are using google adsense, enter all code below.', 'tcd-w');
    ?>
</p>
      <div class="theme_option_input">
       <textarea id="dp_options[single_ad_code1]" class="large-text" cols="50" rows="10" name="dp_options[single_ad_code1]"><?php 
    echo esc_textarea($options['single_ad_code1']);
    ?>
</textarea>
      </div>
     </div>
     <p><?php 
    _e('If you are not using google adsense, you can register your banner image and affiliate code individually.', 'tcd-w');
    ?>
</p>

     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
    _e('Register banner image.', 'tcd-w');
    ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[single_ad_image1]" value="<?php 
    esc_attr_e($options['single_ad_image1']);
    ?>
" /></div>
        <input type="file" name="single_ad_image_file1" id="single_ad_image_file1" />
        <input type="submit" class="button-primary" value="<?php 
    echo __('Save Image', 'tcd-w');
    ?>
" />
       </div>
       <?php 
    if ($options['single_ad_image1']) {
        ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
        esc_attr_e($options['single_ad_image1']);
        ?>
" alt="" title="" />
        </div>
        <?php 
        if (dp_is_uploaded_img($options['single_ad_image1'])) {
            ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
            echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_single_ad_image1');
            ?>
" class="button" onclick="if(!confirm('<?php 
            _e('Are you sure to delete this image?', 'tcd-w');
            ?>
')) return false;"><?php 
            _e('Delete Image', 'tcd-w');
            ?>
</a>
        </div>
       <?php 
        }
        ?>
       <?php 
    }
    ?>
      </div>
     </div>

     <div class="sub_box">
      <h4><?php 
    _e('Register affiliate code', 'tcd-w');
    ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[single_ad_url1]" class="regular-text" type="text" name="dp_options[single_ad_url1]" value="<?php 
    esc_attr_e($options['single_ad_url1']);
    ?>
" />
      </div>
     </div>

    </div>
   </div>
  </div>

  <?php 
    // 詳細ページの広告2 --------------------------------------------------------------------------------------------
    ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
    _e('Single post page banner setup2.', 'tcd-w');
    ?>
</h3>
   <p class="tab_desc"><?php 
    _e('This Adsense will be displayed at right column bottom in single post page.', 'tcd-w');
    ?>
</p>
   <div class="theme_option_field cf">
    <div class="theme_option_input">

     <div class="sub_box">
      <h4><?php 
    _e('Banner code', 'tcd-w');
    ?>
</h4>
      <p><?php 
    _e('If you are using google adsense, enter all code below.', 'tcd-w');
    ?>
</p>
      <div class="theme_option_input">
       <textarea id="dp_options[single_ad_code2]" class="large-text" cols="50" rows="10" name="dp_options[single_ad_code2]"><?php 
    echo esc_textarea($options['single_ad_code2']);
    ?>
</textarea>
      </div>
     </div>
     <p><?php 
    _e('If you are not using google adsense, you can register your banner image and affiliate code individually.', 'tcd-w');
    ?>
</p>

     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
    _e('Register banner image.', 'tcd-w');
    ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[single_ad_image2]" value="<?php 
    esc_attr_e($options['single_ad_image2']);
    ?>
" /></div>
        <input type="file" name="single_ad_image_file2" id="single_ad_image_file2" />
        <input type="submit" class="button-primary" value="<?php 
    echo __('Save Image', 'tcd-w');
    ?>
" />
       </div>
       <?php 
    if ($options['single_ad_image2']) {
        ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
        esc_attr_e($options['single_ad_image2']);
        ?>
" alt="" title="" />
        </div>
        <?php 
        if (dp_is_uploaded_img($options['single_ad_image2'])) {
            ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
            echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_single_ad_image2');
            ?>
" class="button" onclick="if(!confirm('<?php 
            _e('Are you sure to delete this image?', 'tcd-w');
            ?>
')) return false;"><?php 
            _e('Delete Image', 'tcd-w');
            ?>
</a>
        </div>
       <?php 
        }
        ?>
       <?php 
    }
    ?>
      </div>
     </div>

     <div class="sub_box">
      <h4><?php 
    _e('Register affiliate code', 'tcd-w');
    ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[single_ad_url2]" class="regular-text" type="text" name="dp_options[single_ad_url2]" value="<?php 
    esc_attr_e($options['single_ad_url2']);
    ?>
" />
      </div>
     </div>

    </div>
   </div>
  </div>


  <?php 
    // 詳細ページの広告3 --------------------------------------------------------------------------------------------
    ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
    _e('Single post page banner setup3.', 'tcd-w');
    ?>
</h3>
   <p class="tab_desc"><?php 
    _e('This Adsense will be displayed before the post.', 'tcd-w');
    ?>
</p>
   <div class="theme_option_field cf">
    <div class="theme_option_input">

     <div class="sub_box">
      <h4><?php 
    _e('Banner code', 'tcd-w');
    ?>
</h4>
      <p><?php 
    _e('If you are using google adsense, enter all code below.', 'tcd-w');
    ?>
</p>
      <div class="theme_option_input">
       <textarea id="dp_options[single_ad_code3]" class="large-text" cols="50" rows="10" name="dp_options[single_ad_code3]"><?php 
    echo esc_textarea($options['single_ad_code3']);
    ?>
</textarea>
      </div>
     </div>
     <p><?php 
    _e('If you are not using google adsense, you can register your banner image and affiliate code individually.', 'tcd-w');
    ?>
</p>

     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
    _e('Register banner image.', 'tcd-w');
    ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[single_ad_image3]" value="<?php 
    esc_attr_e($options['single_ad_image3']);
    ?>
" /></div>
        <input type="file" name="single_ad_image_file3" id="single_ad_image_file3" />
        <input type="submit" class="button-primary" value="<?php 
    echo __('Save Image', 'tcd-w');
    ?>
" />
       </div>
       <?php 
    if ($options['single_ad_image3']) {
        ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
        esc_attr_e($options['single_ad_image3']);
        ?>
" alt="" title="" />
        </div>
        <?php 
        if (dp_is_uploaded_img($options['single_ad_image3'])) {
            ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
            echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_single_ad_image3');
            ?>
" class="button" onclick="if(!confirm('<?php 
            _e('Are you sure to delete this image?', 'tcd-w');
            ?>
')) return false;"><?php 
            _e('Delete Image', 'tcd-w');
            ?>
</a>
        </div>
       <?php 
        }
        ?>
       <?php 
    }
    ?>
      </div>
     </div>

     <div class="sub_box">
      <h4><?php 
    _e('Register affiliate code', 'tcd-w');
    ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[single_ad_url3]" class="regular-text" type="text" name="dp_options[single_ad_url3]" value="<?php 
    esc_attr_e($options['single_ad_url3']);
    ?>
" />
      </div>
     </div>

    </div>
   </div>
  </div>



  <?php 
    // 詳細ページの広告4 --------------------------------------------------------------------------------------------
    ?>
  <div class="banner_wrapper">
   <h3 class="banner_headline"><?php 
    _e('Single post page banner setup4.', 'tcd-w');
    ?>
</h3>
   <p class="tab_desc"><?php 
    _e('This Adsense will be displayed after the post.', 'tcd-w');
    ?>
</p>
   <div class="theme_option_field cf">
    <div class="theme_option_input">

     <div class="sub_box">
      <h4><?php 
    _e('Banner code', 'tcd-w');
    ?>
</h4>
      <p><?php 
    _e('If you are using google adsense, enter all code below.', 'tcd-w');
    ?>
</p>
      <div class="theme_option_input">
       <textarea id="dp_options[single_ad_code4]" class="large-text" cols="50" rows="10" name="dp_options[single_ad_code4]"><?php 
    echo esc_textarea($options['single_ad_code4']);
    ?>
</textarea>
      </div>
     </div>
     <p><?php 
    _e('If you are not using google adsense, you can register your banner image and affiliate code individually.', 'tcd-w');
    ?>
</p>

     <div class="sub_box cf" style="margin:0 0 10px 0;">
      <h4><?php 
    _e('Register banner image.', 'tcd-w');
    ?>
</h4>
      <div class="image_box cf">
       <div class="upload_banner_button_area">
        <div class="hide"><input type="text" size="36" name="dp_options[single_ad_image4]" value="<?php 
    esc_attr_e($options['single_ad_image4']);
    ?>
" /></div>
        <input type="file" name="single_ad_image_file4" id="single_ad_image_file4" />
        <input type="submit" class="button-primary" value="<?php 
    echo __('Save Image', 'tcd-w');
    ?>
" />
       </div>
       <?php 
    if ($options['single_ad_image4']) {
        ?>
        <div class="uploaded_banner_image">
         <img src="<?php 
        esc_attr_e($options['single_ad_image4']);
        ?>
" alt="" title="" />
        </div>
        <?php 
        if (dp_is_uploaded_img($options['single_ad_image4'])) {
            ?>
        <div class="delete_uploaded_banner_image">
         <a href="<?php 
            echo wp_nonce_url(admin_url('themes.php?page=theme_options'), 'dp_delete_single_ad_image4');
            ?>
" class="button" onclick="if(!confirm('<?php 
            _e('Are you sure to delete this image?', 'tcd-w');
            ?>
')) return false;"><?php 
            _e('Delete Image', 'tcd-w');
            ?>
</a>
        </div>
       <?php 
        }
        ?>
       <?php 
    }
    ?>
      </div>
     </div>

     <div class="sub_box">
      <h4><?php 
    _e('Register affiliate code', 'tcd-w');
    ?>
</h4>
      <div class="theme_option_input">
       <input id="dp_options[single_ad_url4]" class="regular-text" type="text" name="dp_options[single_ad_url4]" value="<?php 
    esc_attr_e($options['single_ad_url4']);
    ?>
" />
      </div>
     </div>

    </div>
   </div>
  </div>



  <p class="submit"><input type="submit" class="button-primary" value="<?php 
    echo __('Save Changes', 'tcd-w');
    ?>
" /></p>

  </div><!-- END #tab-content4 -->




  </div><!-- END #tab-panel -->

 </form>

</div>

</div>

<?php 
}