function ks_list_comments($comment, $args, $depth)
{
    global $ks_settings;
    $GLOBALS['comment'] = $comment;
    extract($args, EXTR_SKIP);
    ?>
	<dt><a name="comment-<?php 
    comment_ID();
    ?>
"><?php 
    if (!ks_option('ks_separate_comments')) {
        ?>
<font size="-1" color="<?php 
        echo $ks_settings['comment_color'];
        ?>
">[<?php 
        comment_type(_x('Comment', 'noun'), __('Trackback'), __('Pingback'));
        ?>
]</font><?php 
    }
    ?>
</a> <?php 
    ks_comment_content();
    $html = array();
    comment_reply_link(array_merge(array('before' => '<div>', 'after' => '</div>', 'reply_before' => '', 'reply_text' => '<img localsrc="149" alt="" />' . __('Reply'), 'login_text' => '<img localsrc="120" alt="" />' . __('Log in to Reply')), $args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
}
 function wp_supercache_ktaistyle_admin()
 {
     global $valid_nonce, $wp_cache_config_file, $cache_ktaistyle, $wp_cache_mobile_browsers, $orig_wp_cache_mobile_browsers;
     if (!isset($cache_ktaistyle)) {
         $cache_ktaistyle = 0;
     }
     $ktaistyle_browsers = 'DoCoMo/, J-PHONE/, J-EMULATOR/, Vodafone/, MOT-, MOTEMULATOR-, SoftBank/, emulator/, DDIPOCKET;, WILLCOM;, KDDI-, UP.Browser/, emobile/, Huawei/, IAC/, Nokia, Opera Mini, Opera Mobi, Palm OS, Windows CE;, PDA; SL-, PlayStation Portable, SONY/COM, Nitro, Nintendo, mixi-mobile-converter/';
     if (function_exists('ks_option') && ks_option('ks_theme_touch')) {
         $ktaistyle_browsers .= ', iPhone;, iPod;, Android';
     }
     if (isset($_POST['cache_ktaistyle']) && $valid_nonce) {
         if (!class_exists('KtaiStyle') && !class_exists('Ktai_Style')) {
             $_POST['cache_ktaistyle'] = __('Disable', 'wp-super-cache');
             $err = __('Ktai Style not found. Please check your install.', 'wp-super-cache');
         }
         $cache_ktaistyle = $_POST['cache_ktaistyle'] == __('Disable', 'wp-super-cache') ? 0 : 1;
         wp_cache_replace_line('^ *\\$cache_ktaistyle', "\$cache_ktaistyle = '{$cache_ktaistyle}';", $wp_cache_config_file);
         if ($cache_ktaistyle) {
             if (!isset($orig_wp_cache_mobile_browsers)) {
                 wp_cache_replace_line('^ *\\$orig_wp_cache_mobile_browsers', "\$orig_wp_cache_mobile_browsers = '{$wp_cache_mobile_browsers}';", $wp_cache_config_file);
             }
             wp_cache_replace_line('^ *\\$wp_cache_mobile_browsers ', "\$wp_cache_mobile_browsers = '{$ktaistyle_browsers}';", $wp_cache_config_file);
         } elseif (isset($orig_wp_cache_mobile_browsers) && $orig_wp_cache_mobile_browsers != $ktaistyle_browsers) {
             wp_cache_replace_line('^ *\\$wp_cache_mobile_browsers ', "\$wp_cache_mobile_browsers = '{$orig_wp_cache_mobile_browsers}';", $wp_cache_config_file);
             wp_cache_replace_line('^ *\\$orig_wp_cache_mobile_browsers', '', $wp_cache_config_file);
         }
     }
     echo '<form name="wp_supercache_ktaistyle_admin" action="' . $_SERVER["REQUEST_URI"] . '" method="post">';
     wp_nonce_field('wp-cache');
     if ($cache_ktaistyle == 0) {
         $ks_status = __('disabled', 'wp-super-cache');
     } else {
         $ks_status = __('enabled', 'wp-super-cache');
         wp_super_cache_disable();
     }
     echo '<strong>' . sprintf(__('Ktai Style support is %s', 'wp-super-cache'), $ks_status);
     echo '.</strong>';
     printf(__('(Changing supporting mobile devices. Requires <a href="http://wppluginsj.sourceforge.jp/ktai_style/">Ktai Style</a>.) ', 'wp-super-cache'));
     if ($cache_ktaistyle == 0) {
         echo '<input type="submit" name="cache_ktaistyle" value="' . __('Enable', 'wp-super-cache') . '" />';
     } else {
         echo '<input type="submit" name="cache_ktaistyle" value="' . __('Disable', 'wp-super-cache') . '" />';
     }
     echo "</form>\n";
     if ($err) {
         echo "<p><strong>" . __('Warning!', 'wp-super-cache') . "</strong> {$err}</p>";
     }
 }
function ks_list_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
<li><a name="comment-<?php 
    comment_ID();
    ?>
"><?php 
    if (!ks_option('ks_separate_comments')) {
        ?>
[<?php 
        comment_type(_x('Comment', 'noun'), __('Trackback'), __('Pingback'));
        ?>
]<?php 
    }
    ?>
</a> <?php 
    ks_comment_content();
    comment_reply_link(array_merge(array('before' => '[ ', 'after' => ' ]', 'reply_before' => '', 'reply_text' => __('Reply'), 'login_text' => __('Log in to Reply')), $args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
</li><?php 
}
    $comment_author_email = esc_sql($user->user_email);
    $comment_author_url = esc_sql($user->user_url);
    if (current_user_can('unfiltered_html') && wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment']) {
        kses_remove_filters();
        // start with a clean slate
        kses_init_filters();
        // set up the filters
    }
} else {
    if (get_option('comment_registration') || 'private' == $status->post_status) {
        $Ktai_Style->ks_die(__('Sorry, you must be logged in to post a comment.'));
    }
}
try {
    $comment_type = '';
    if (!$user->ID && ks_option('ks_require_term_id')) {
        if ($Ktai_Style->ktai->get('sub_ID_available') && !$Ktai_Style->ktai->get('term_ID') && !$Ktai_Style->ktai->get('sub_ID')) {
            $message = $Ktai_Style->ktai->get('require_id_msg');
            if (empty($message)) {
                $message = 'Error: please configure to send your terminal ID (serial number, EZ number etc).';
            }
            throw new Exception(__($message, 'ktai_style'));
        } else {
            if (function_exists('add_comment_meta')) {
                add_action('comment_post', array($Ktai_Style->ktai, 'store_term_id'), 20, 2);
            } else {
                add_filter('pre_comment_user_agent', array($Ktai_Style->ktai, 'add_term_id'));
            }
        }
    }
    if (get_option('require_name_email') && !$user->ID) {
 public function rewrite_link($url, $anchor, $attr)
 {
     if (preg_match($this->self_urls_regex, $url)) {
         $link_html = $this->link_element($this->base->strip_host($url), $anchor, $attr);
     } elseif (preg_match($this->leave_regex, $url) || preg_match($this->mobile_site_regex, $attr['class']) || $this->has_mobile_sites($url) || $this->base->ktai->is_search_engine()) {
         $link_html = NULL;
         // keep untouched
     } else {
         $colored_anchor = '<font color="' . ks_option('ks_external_link_color') . '">' . $anchor . '</font>';
         if (!$this->base->get('use_redir')) {
             $link_html = $this->link_element($url, $colored_anchor, $attr);
         } else {
             $icon = '<img localsrc="70" alt="' . __('[external]', 'ktai_style') . '" />';
             $nonce = $this->base->create_anon_nonce('redir_' . md5($url) . md5($_SERVER['HTTP_USER_AGENT']));
             if (preg_match($this->pconly_site_regex, $class) || $this->none_mobile_sites($url)) {
                 $pconly_html = '&amp;' . self::PCONLY_SITE_CLASS . '=true';
             } else {
                 $pconly_html = '';
             }
             $class = !empty($attr['class']) ? 'class="' . $attr['class'] . '"' : '';
             $style = !empty($attr['style']) ? 'style="' . $attr['style'] . '"' : '';
             $link_html = $icon . sprintf('<a href="%s%s/redir.php?_wpnonce=%s%s&amp;url=%s"%s%s>%s</a>', ks_plugin_url(KTAI_NOT_ECHO), KtaiStyle::INCLUDES_DIR, esc_attr($nonce), $pconly_html, rawurlencode($url), $class, $style, $colored_anchor);
         }
         $link_html = apply_filters('ktai_external_link', $link_html, $url, $anchor, $icon);
         $link_html = apply_filters('external_link/ktai_style.php', $link_html, $url, $anchor, $icon);
     }
     return $link_html;
 }
<div align="center"><?php 
$title = __('New Posts', 'ktai_style');
$url = ks_blogurl(KTAI_NOT_ECHO);
$ks_settings['need_front'] = false;
if (get_option('show_on_front') == 'page') {
    if ($post_id = get_option('page_for_posts')) {
        $url = get_permalink($post_id);
        $ks_settings['need_front'] = true;
    } else {
        $title = __('Front Page', 'ktai_style');
    }
}
if (ks_is_front()) {
    echo $title;
} else {
    ks_ordered_link(1, 10, $url, $title);
}
?>
 | <?php 
$title = ks_option('ks_separate_comments') ? __('Recent Comments/Pings', 'ktai_style') : __('Recent Comments', 'ktai_style');
if (ks_is_menu('comments')) {
    echo $title;
} else {
    ks_ordered_link(2, 10, ks_blogurl(KTAI_NOT_ECHO) . '?menu=comments', $title);
}
?>
</div>
<hr color="<?php 
echo $ks_settings['hr_color'];
?>
" />
<?php

ks_header();
global $post, $comment, $ks_settings;
$ol_count = 1;
$ol_max = isset($ks_settings['ol_max']) ? intval($ks_settings['ol_max']) : 9;
for ($loop = ks_option('ks_separate_comments') ? 0 : 1; $loop <= 2; $loop += 2) {
    if ($loop <= 1) {
        ?>
		<div<?php 
        echo $ks_settings['h2_style'];
        ?>
><h2 id="comments"><?php 
        _e('Recent Comments', 'ktai_style');
        ?>
</h2></div>
	<?php 
    } else {
        ?>
		<br /><div<?php 
        echo $ks_settings['h2_style'];
        ?>
><h2 id="pings"><?php 
        _e('Recent Pings', 'ktai_style');
        ?>
</h2></div>
	<?php 
    }
    switch ($loop) {
        case 1:
            $comments = ks_get_recent_comments();
    private function show_form($errors = array())
    {
        global $user_ID, $title, $comment, $id;
        $comment = intval($_GET['replytocom']);
        if (!($comment = get_comment($comment))) {
            $this->base->ks_die(__('Oops, no comment with this ID.'));
        }
        $title = __('Comment Reply', 'ktai_style');
        include dirname(__FILE__) . '/admin-header.php';
        $id = $comment->comment_post_ID;
        echo '<h2>' . sprintf(__('Comments for %s', 'ktai_style'), get_the_title($id)) . '</h2>';
        ?>
<img localsrc="<?php 
        comment_type(68, 112, 112);
        ?>
" alt="" /><?php 
        ks_comment_author_link();
        ?>
<img localsrc="46" alt=" @ " /><font color="<?php 
        echo ks_option('ks_date_color');
        ?>
"><?php 
        ks_comment_datetime();
        ?>
</font><br />
	<?php 
        comment_text();
        ?>
	<hr />
	<h3><?php 
        _e('Reply to the above comment', 'ktai_style');
        ?>
</h3>
	<?php 
        if ($errors) {
            ?>
<p><font color="red"><?php 
            echo implode('<br />', array_map('wp_specialchars', $errors));
            ?>
</font></p>
	<?php 
        }
        ?>
<form action="" method="post">
<input type="hidden" name="action" value="post" />
<input type="hidden" name="redirect_to" value="<?php 
        echo esc_attr($this->admin->get_referer());
        ?>
" />
<?php 
        $this->admin->sid_field();
        ks_fix_encoding_form();
        ?>
	<p><?php 
        _e('Comment', 'ktai_style');
        if (ks_option('ks_allow_pictograms')) {
            _e('(Pictograms Available)', 'ktai_style');
        }
        ?>
<br />
	<textarea name="content" cols="100%" rows="4"></textarea><br />
	<a href="<?php 
        echo esc_attr($this->admin->get_referer());
        ?>
"><?php 
        _e('Cancel reply', 'ktai_style');
        ?>
</a><br />
	<input type="submit" name="submit" value="<?php 
        _e('Say It!');
        ?>
" />
	<?php 
        if (function_exists('comment_id_fields')) {
            comment_id_fields($id);
        } else {
            ?>
		<input type="hidden" name="comment_post_ID" value="<?php 
            echo intval($id);
            ?>
" />
	<?php 
        }
        ks_do_comment_form_action();
        ?>
	</p></form>
<?php 
        include dirname(__FILE__) . '/admin-footer.php';
    }
</div>
<form method="get" action="<?php 
ks_blogurl();
?>
"><div>
<input type="text" name="ks" value="<?php 
the_search_query();
?>
" />
<input type="submit" value="<?php 
_e('Search');
?>
" />
</div></form>
<dl><dt><?php 
ks_ordered_link($count++, $max, ks_blogurl(KTAI_NOT_ECHO) . '?menu=comments', ks_option('ks_separate_comments') ? __('Recent Comments/Pings', 'ktai_style') : __('Recent Comments', 'ktai_style'));
?>
</dt>
<dt><?php 
ks_ordered_link('', $max, ks_blogurl(KTAI_NOT_ECHO) . '?menu=months', __('Archives'));
_e(' / ', 'ktai_style');
ks_ordered_link('', $max, ks_blogurl(KTAI_NOT_ECHO) . '?menu=cats', __('Categories'));
_e(' / ', 'ktai_style');
ks_ordered_link('', $max, ks_blogurl(KTAI_NOT_ECHO) . '?menu=tags', __('Tags'));
?>
</dt>
<?php 
ks_admin_link('<dt><img localsrc="152" alt="" />');
ks_login_link(array('before' => '<dt><img localsrc="120" alt="' . __('&dagger;', 'ktai_style') . '" />', 'before_logout' => '<img localsrc="120" alt="' . __('&dagger;', 'ktai_style') . '" />', 'after' => '</dt>'));
?>
</dl>
    private function comment_list_item($_comment)
    {
        global $comment;
        $comment = $_comment;
        $comment_status = wp_get_comment_status($comment->comment_ID);
        if ('unapproved' == $comment_status) {
            $gray_start = '<font color="gray">';
            $gray_end = '</font>';
        } else {
            $gray_start = '';
            $gray_end = '';
        }
        $checkbox = '';
        if (current_user_can('edit_post', $comment->comment_post_ID)) {
            $checkbox = '<input type="checkbox" name="delete_comments[]" value="' . intval($comment->comment_ID) . '" />';
        }
        echo '<dt>';
        printf(_c('%1$s%2$d:%3$s|comment-list-title', 'ktai_style'), $checkbox, $comment->comment_ID, $gray_start . mb_strcut(get_comment_excerpt(), 0, self::COMMENT_EXCERPT_SIZE) . $gray_end);
        echo '</dt><dd>';
        ?>
<img localsrc="46" alt=" @ " /><font color="<?php 
        echo ks_option('ks_date_color');
        ?>
"><?php 
        echo ks_comment_datetime();
        ?>
</font>
<img localsrc="<?php 
        comment_type(68, 112, 112);
        ?>
" alt="[<?php 
        comment_type(__('Comment', 'ktai_style'), __('Trackback'), __('Pingback'));
        ?>
] " /><?php 
        comment_author();
        ?>
<br /><?php 
        if (strlen($author_url_display) > self::COMMENT_AUTHOR_URL_LENGTH) {
            $author_url_display = substr($author_url_display, 0, self::COMMENT_AUTHOR_URL_LENGTH - 1) . '...';
        }
        if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) {
            $author_url_display = $comment->comment_author_url;
            $author_url_display = str_replace('http://www.', '', $author_url_display);
            $author_url_display = str_replace('http://', '', $author_url_display);
            if (strlen($author_url_display) > self::COMMENT_AUTHOR_URL_LENGTH) {
                $author_url_display = substr($author_url_display, 0, self::COMMENT_AUTHOR_URL_LENGTH - 1) . '...';
            }
            ?>
<img localsrc="112" alt="" /><font color="olive"><?php 
            echo esc_html($author_url_display);
            ?>
</font><br /><?php 
        }
        if ($comment->comment_author_email && current_user_can('edit_post', $comment->comment_post_ID)) {
            ?>
<img localsrc="108" alt="" /><font color="olive"><?php 
            comment_author_email();
            ?>
</font><br /><?php 
        }
        if (!$this->post_id && ($title = $this->get_post_title($comment->comment_post_ID))) {
            ?>
<font color="gray" size="-1"><img localsrc="97" /><?php 
            echo $title;
            ?>
</font><br /><?php 
        }
        $app_nonce = esc_html('&_wpnonce=' . wp_create_nonce("approve-comment_{$comment->comment_ID}"));
        $del_nonce = esc_html('&_wpnonce=' . wp_create_nonce("delete-comment_{$comment->comment_ID}"));
        $approve_url = esc_url('comment.php?action=approvecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID . $app_nonce);
        $unapprove_url = esc_url('comment.php?action=unapprovecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID . $app_nonce);
        $spam_url = esc_url('comment.php?action=spamcomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID . $del_nonce);
        $unspam_url = esc_url('comment.php?action=unspamcomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID . $del_nonce);
        $trash_url = esc_url('comment.php?action=trashcomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID . $del_nonce);
        $untrash_url = esc_url('comment.php?action=untrashcomment&c=' . $comment->comment_ID . $del_nonce);
        $delete_url = esc_url('comment.php?action=deletecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID);
        // do not add nonce
        $edit_url = esc_url('comment.php?action=editcomment&c=' . $comment->comment_ID);
        $reply_url = esc_url('comment-reply.php?replytocom=' . $comment->comment_ID);
        $action_template_color = '<a href="%s"><font color="%s">%s</font></a>';
        $action_template = '<a href="%s">%s</a>';
        if (current_user_can('edit_post', $comment->comment_post_ID)) {
            $actions = array();
            if (current_user_can('moderate_comments')) {
                if ('unapproved' == $comment_status || 'moderated' == $comment_status) {
                    $actions['approve'] = sprintf($action_template_color, $approve_url, 'green', __('Approve'));
                    $actions['spam'] = sprintf($action_template_color, $spam_url, 'red', __('Spam'));
                } elseif ('approved' == $_GET['comment_status'] && 'approved' == $comment_status) {
                    $actions['unapprove'] = sprintf($action_template_color, $unapprove_url, '#ff9900', __('Unapprove'));
                } elseif ('spam' == $comment_status) {
                    if (function_exists('wp_trash_comment') && EMPTY_TRASH_DAYS) {
                        $actions['unspam'] = sprintf($action_template_color, $unspam_url, 'orange', __('Restore'));
                        $actions['trash'] = sprintf($action_template_color, $trash_url, 'red', __('Trash'));
                    } else {
                        $actions['approve'] = sprintf($action_template_color, $approve_url, 'green', __('Approve'));
                        $actions['delete'] = sprintf($action_template_color, $delete_url, 'red', __('Delete'));
                    }
                }
            }
            if ('trash' == $comment_status) {
                $actions['restore'] = sprintf($action_template_color, $untrash_url, 'green', __('Restore'));
                $actions['delete'] = sprintf($action_template_color, $delete_url, 'red', __('Delete'));
            } elseif ('spam' != $comment_status) {
                $actions['edit'] = '<img localsrc="104" alt="" />' . sprintf($action_template, $edit_url, __('Edit'));
                if ('approved' == $comment_status && (NULL == $this->post_status || 'published' == $this->post_status)) {
                    $actions['reply'] = '<img localsrc="149" alt="" />' . sprintf($action_template, $reply_url, __('Reply', 'ktai_style'));
                }
            }
            if ($actions) {
                $actions = apply_filters('comment_row_actions', array_filter($actions), $comment);
                echo '[ ' . implode(' | ', $actions) . ' ]';
            }
        }
    }
?>
</head>
<body>
<?php 
/* <body bgcolor="" text="" link="" alink="" vlink=""> */
global $ks_settings;
$ks_settings = array();
// erase array for security
$ks_settings['h2_style'] = '';
$ks_settings['list_pages'] = 'sort_column=menu_order,post_title';
$ks_settings['ol_max'] = 9;
$ks_settings['ol_count'] = 1;
$ks_settings['date_color'] = ks_option('ks_date_color');
$ks_settings['time_color'] = ks_option('ks_time_color');
$ks_settings['author_color'] = ks_option('ks_author_color');
$ks_settings['comment_color'] = ks_option('ks_comment_color');
$ks_settings['edit_color'] = ks_option('ks_edit_color');
ks_page_title();
/* ks_page_title('logo.png'); */
?>
<div align="right"><font size="-1"><a href="#tail" accesskey="0"><img localsrc="30" alt="<?php 
_e('&darr;', 'ktai_style');
?>
" /><?php 
_e('Menu', 'ktai_style');
?>
</a><?php 
ks_pict_number(0, true);
?>
</font></div>
<hr />
            echo esc_attr($comment_author_email);
            ?>
" /><br />
			<?php 
            _e('Website');
            ?>
<br />
			<input type="text" name="url" istyle="3" mode="alphabet" value="<?php 
            echo esc_attr($comment_author_url);
            ?>
" /><br />
		<?php 
        }
        // is_user_logged_in()
        echo _x('Comment', 'noun');
        if (ks_option('ks_allow_pictograms')) {
            _e('(Pictograms Available)', 'ktai_style');
        }
        ?>
<br />
		<textarea name="comment" cols="100%" rows="4"><?php 
        echo esc_html($comment_content);
        ?>
</textarea><br />
		<?php 
        ks_inline_error_submit(__('Say It!'));
        if (function_exists('comment_id_fields')) {
            comment_id_fields();
        } else {
            ?>
			<input type="hidden" name="comment_post_ID" value="<?php 
        public function start_el(&$output, $comment, $depth, $args)
        {
            $depth++;
            $GLOBALS['comment_depth'] = $depth;
            if (!empty($args['callback'])) {
                call_user_func($args['callback'], $comment, $args, $depth);
                return;
            }
            $GLOBALS['comment'] = $comment;
            extract($args, EXTR_SKIP);
            switch ($args['style']) {
                case 'div':
                    $tag = 'div';
                    break;
                case 'ol':
                case 'ul':
                    $tag = 'li';
                    break;
                case 'dl':
                default:
                    $tag = 'dt';
                    break;
            }
            ?>
<<?php 
            echo $tag;
            ?>
><a name="comment-<?php 
            comment_ID();
            ?>
"><?php 
            if (!ks_option('ks_separate_comments')) {
                ?>
<font size="-1" color="<?php 
                echo ks_option('ks_comment_type_color');
                ?>
">[<?php 
                comment_type(__('Comment', 'ktai_style'), __('Trackback'), __('Pingback'));
                ?>
]</font><?php 
            }
            ?>
</a> <img localsrc="<?php 
            comment_type(68, 112, 112);
            ?>
" alt="" /><?php 
            ks_comment_author_link();
            ?>
<img localsrc="46" alt=" @ " /><font color="<?php 
            echo ks_option('ks_date_color');
            ?>
"><?php 
            ks_comment_datetime();
            ?>
</font>
		<?php 
            /* ks_edit_comment_link('color=' . ks_option('ks_edit_color')); */
            edit_comment_link('<font color="' . ks_option('ks_edit_color') . '">' . __('Edit') . '</font>', '<img localsrc="104" alt="" />');
            ?>
<br />
		<?php 
            if ($comment->comment_approved == '0') {
                ?>
<em><font color="red"><?php 
                _e('Your comment is awaiting moderation.');
                ?>
</font></em><br />
		<?php 
            }
            comment_text();
            comment_reply_link(array_merge(array('before' => '<div>', 'after' => '</div>', 'reply_before' => '', 'reply_text' => '<img localsrc="149" alt="" />' . __('Reply'), 'login_text' => '<img localsrc="120" alt="" />' . __('Log in to Reply')), $args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
        }
ks_wp_head(KTAI_NONE_PC_HEAD);
?>
</head>
<body link="green" vlink="olive">
<?php 
global $ks_settings, $show_on_front, $page_for_posts;
$ks_settings = array();
// erase array for security
$ks_settings['h2_style'] = '';
$ks_settings['hr_color'] = 'green';
$ks_settings['list_pages'] = 'sort_column=menu_order,post_title';
$ks_settings['title_style'] = 'color:white;background-color:#22bb11;';
$ks_settings['list_color'] = 'maroon';
$ks_settings['date_color'] = 'maroon';
$ks_settings['time_color'] = 'green';
$ks_settings['author_color'] = ks_option('ks_author_color');
$ks_settings['comment_color'] = 'gray';
$ks_settings['edit_color'] = 'teal';
$ks_settings['pagenum_style'] = 'color:olive;text-align:center;';
$show_on_front = get_option('show_on_front') == 'page';
$page_for_posts = get_option('page_for_posts');
$ks_settings['ol_max'] = $show_on_front && $page_for_posts ? 6 : 7;
if (!ks_is_redir()) {
    // other than redir.php
    $before = '<div style="color:white;background-color:#009933;margin:0;">' . (ks_is_flat_rate() ? '<h1 style="margin:0"><img src="' . ks_theme_url(KTAI_NOT_ECHO) . 'icon.gif" alt="" />' : '<h1>');
    ks_page_title(array('before' => $before, 'after' => '</h1></div>'));
    if (ks_is_front()) {
        ?>
		<p><font size="-1"><?php 
        bloginfo('description');
        ?>
    private function confirm($action)
    {
        global $comment;
        $comment_id = intval($_GET['c']);
        $formaction = $action . 'comment';
        $nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_';
        $nonce_action .= $comment_id;
        if (!($comment = get_comment_to_edit($comment_id))) {
            $this->base->ks_die(__('Oops, no comment with this ID.') . sprintf(' <a href="%s">' . __('Go back') . '</a>', 'edit-comments.php'), '', false);
        }
        if (!current_user_can('edit_post', $comment->comment_post_ID)) {
            $this->base->ks_die('delete' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.'));
        }
        include dirname(__FILE__) . '/admin-header.php';
        switch ($action) {
            case 'spam':
                $message = __('You are about to mark the following comment as spam:');
                break;
            case 'trash':
                $message = __('You are about to move the following comment to the Trash:', 'ktai_style');
                break;
            case 'delete':
                $message = __('You are about to delete the following comment:');
                break;
            default:
                $message = __('You are about to approve the following comment:');
                break;
        }
        echo '<p><img localsrc="1" alt="" /><font color="red">' . $message . '</font><br />' . __('Are you sure you want to do this?') . '</p>';
        ?>
<form action="edit-comments.php" method="get">
<?php 
        $this->admin->sid_field();
        ?>
<div><input type="submit" value="<?php 
        _e('No');
        ?>
" /></div></form>
<form action="comment.php" method="get">
<?php 
        $this->admin->sid_field();
        wp_nonce_field($nonce_action);
        ?>
<input type="hidden" name="action" value="<?php 
        echo esc_attr($formaction);
        ?>
" />
<input type="hidden" name="p" value="<?php 
        echo intval($comment->comment_post_ID);
        ?>
" />
<input type="hidden" name="c" value="<?php 
        echo intval($comment->comment_ID);
        ?>
" />
<input type="hidden" name="noredir" value="1" />
<div><input type="submit" value="<?php 
        _e('Yes');
        ?>
" /></div>
</form>
<dl><dt><img localsrc="<?php 
        comment_type(68, 112, 112);
        ?>
" alt="[<?php 
        comment_type(__('Comment', 'ktai_style'), __('Trackback'), __('Pingback'));
        ?>
] " /><?php 
        comment_author();
        ?>
<img localsrc="46" alt=" @ " /><font color="<?php 
        echo ks_option('ks_date_color');
        ?>
"><?php 
        ks_comment_datetime();
        ?>
</font></dt><dd><?php 
        if ($comment->comment_author_email) {
            ?>
<img localsrc="108" alt="" /><font color="olive"><?php 
            comment_author_email();
            ?>
</font><br /><?php 
        }
        if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) {
            ?>
<img localsrc="112" alt="" /><font color="olive"><?php 
            comment_author_url();
            ?>
</font><br /><?php 
        }
        comment_excerpt();
        ?>
</dd></dl><?php 
        include dirname(__FILE__) . '/admin-footer.php';
    }
    public function post_rows()
    {
        global $wp_query, $post;
        $columns = array('dt', 'title', '/dt', 'dd', 'author', 'date', 'comments', '/dd', 'dd-small', 'categories', '/dd-small');
        $columns = array_merge($columns, array('dd-small', 'tags', '/dd-small'));
        if ('trash' === $_GET['post_status'] && function_exists('wp_untrash_post')) {
            $columns = array_merge($columns, array('dd', 'actions', '/dd'));
        }
        $post_ids = array();
        foreach ($wp_query->posts as $a_post) {
            $post_ids[] = $a_post->ID;
        }
        $comment_pending_count = get_pending_comments_num($post_ids);
        if (empty($comment_pending_count)) {
            $comment_pending_count = array();
        }
        ?>
<dl><?php 
        while (have_posts()) {
            the_post();
            foreach ($columns as $column_name) {
                switch ($column_name) {
                    case 'dt':
                        echo '<dt>';
                        break;
                    case '/dt':
                        echo '</dt>';
                        break;
                    case 'dd':
                        echo '<dd>';
                        break;
                    case '/dd':
                        echo '</dd>';
                        break;
                    case 'dd-small':
                        echo '<dd><small>';
                        break;
                    case '/dd-small':
                        echo '</small></dd>';
                        break;
                    case 'title':
                        $title = $this->admin->draft_or_post_title();
                        if (current_user_can('edit_post', $post->ID) && $post->post_status != 'trash') {
                            $title = sprintf(__('<img localsrc="104" alt="" /><a href="%1$s">%2$s</a>', 'ktai_style'), get_edit_post_link($post->ID, 'url'), $title);
                        }
                        printf(_c('%1$5d:%2$s%3$s|post_row_title', 'ktai_style'), $post->ID, $title, $this->admin->get_post_states($post));
                        break;
                    case 'date':
                        if ('draft' === $_GET['post_status'] || 'pending' === $_GET['post_status']) {
                            if ('0000-00-00 00:00:00' == $post->post_modified) {
                                $time = __('Never');
                            } else {
                                $time = ks_get_mod_time();
                            }
                        } else {
                            if ('0000-00-00 00:00:00' == $post->post_date) {
                                $time = __('Unpublished');
                            } else {
                                $time = ks_get_time();
                            }
                        }
                        printf(__('<img localsrc="46" alt=" at " />%s', 'ktai_style'), '<font color="' . ks_option('ks_date_color') . '">' . $time . '</font>');
                        break;
                    case 'author':
                        printf(__('<img localsrc="68" alt="by " />%s', 'ktai_style'), get_the_author());
                        break;
                    case 'categories':
                        $categories = get_the_category();
                        if (!empty($categories)) {
                            $cat_links = array();
                            foreach ($categories as $c) {
                                $cat_links[] = '<a href="' . basename(__FILE__) . '?cat=' . $c->cat_ID . '"><font color="gray">' . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . '</font></a>';
                            }
                            echo sprintf(__('<img localsrc="354" alt="%1$s" />%2$s', 'ktai_style'), __('Category:'), implode(', ', $cat_links));
                        }
                        break;
                    case 'tags':
                        $tags = get_the_tags($post->ID);
                        if (!empty($tags)) {
                            $tag_links = array();
                            foreach ($tags as $t) {
                                $tag_links[] = '<a href="' . basename(__FILE__) . '?tag=' . $t->slug . '"><font color="gray">' . wp_specialchars(sanitize_term_field('name', $t->name, $t->term_id, 'post_tag', 'display')) . '</font></a>';
                            }
                            echo sprintf(__('<img localsrc="77" alt="%1$s" />%2$s', 'ktai_style'), __('Tags:'), implode(', ', $tag_links));
                        }
                        break;
                    case 'comments':
                        $link = '<a href="edit-comments.php?p=' . $post->ID . '">';
                        echo ' <img localsrc="86" alt="[' . __('Comments') . '] " />';
                        if (function_exists('_x')) {
                            comments_number($comment_pending_count[$post->ID] ? $link . _x('0', 'comment count') . '</a>' : _x('0', 'comment count'), $link . _x('1', 'comment count') . '</a>', $link . _x('%', 'comment count') . '</a>');
                        } else {
                            comments_number($comment_pending_count[$post->ID] ? $link . __('0') . '</a>' : __('0'), $link . __('1') . '</a>', $link . __('%') . '</a>');
                        }
                        if ($comment_pending_count[$post->ID]) {
                            echo '<img localsrc="2" alt="[' . sprintf(__('%s pending'), number_format($comment_pending_count[$post->ID])) . ']" />';
                        }
                        break;
                    case 'actions':
                        $delete_url = 'post.php?action=delete&post=' . $post->ID;
                        $untrash_url = 'post.php?action=untrash&post=' . $post->ID;
                        $untrash_url = wp_nonce_url($untrash_url, 'untrash-post_' . $post->ID);
                        $actions['restore'] = sprintf('<a href="%s"><font color="%s">%s</font></a>', $untrash_url, 'green', __('Restore'));
                        $actions['delete'] = sprintf('<a href="%s"><font color="%s">%s</font></a>', $delete_url, 'red', __('Delete'));
                        echo '[ ' . implode(' | ', $actions) . ' ]';
                        break;
                }
            }
        }
        ?>
</dl><?php 
    }
 function display_page_row($page, $level = 0)
 {
     global $post;
     $columns = array('dt', 'title', '/dt', 'dd', 'author', 'date', 'comments', '/dd');
     if ('trash' === $_GET['post_status'] && function_exists('wp_untrash_post')) {
         $columns = array_merge($columns, array('dd', 'actions', '/dd'));
     }
     $post = $page;
     setup_postdata($page);
     foreach ($columns as $column_name) {
         switch ($column_name) {
             case 'dt':
                 echo '<dt>';
                 break;
             case '/dt':
                 echo '</dt>';
                 break;
             case 'dd':
                 echo '<dd>';
                 break;
             case '/dd':
                 echo '</dd>';
                 break;
             case 'dd-small':
                 echo '<dd><small>';
                 break;
             case '/dd-small':
                 echo '</small></dd>';
                 break;
             case 'title':
                 $title = $this->admin->draft_or_post_title();
                 $pad = str_repeat('&#8212; ', $level);
                 if (current_user_can('edit_post', $page->ID) && $post->post_status != 'trash') {
                     $title = sprintf(__('<img localsrc="104" alt="" /><a href="%1$s">%2$s</a>', 'ktai_style'), get_edit_post_link($page->ID, 'url'), $title);
                 }
                 printf(_c('%1$5d:%2$s%3$s%4$s|page_row_title', 'ktai_style'), $post->ID, $pad, $title, $this->admin->get_post_states($page));
                 break;
             case 'date':
                 if ('draft' === $_GET['post_status'] || 'pending' === $_GET['post_status']) {
                     if ('0000-00-00 00:00:00' == $post->post_modified) {
                         $time = __('Never');
                     } else {
                         $time = ks_get_mod_time();
                     }
                 } else {
                     if ('0000-00-00 00:00:00' == $post->post_date) {
                         $time = __('Unpublished');
                     } else {
                         $time = ks_get_time();
                     }
                 }
                 printf(__('<img localsrc="46" alt=" at " />%s', 'ktai_style'), '<font color="' . ks_option('ks_date_color') . '">' . $time . '</font>');
                 break;
             case 'author':
                 printf(__('<img localsrc="68" alt="by " />%s', 'ktai_style'), get_the_author());
                 break;
             case 'comments':
                 $link = '<a href="edit-comments.php?p=' . $post->ID . '">';
                 echo ' <img localsrc="86" alt="[' . __('Comments') . '] " />';
                 if (function_exists('_x')) {
                     comments_number($comment_pending_count[$post->ID] ? $link . _x('0', 'comment count') . '</a>' : _x('0', 'comment count'), $link . _x('1', 'comment count') . '</a>', $link . _x('%', 'comment count') . '</a>');
                 } else {
                     comments_number($comment_pending_count[$post->ID] ? $link . __('0') . '</a>' : __('0'), $link . __('1') . '</a>', $link . __('%') . '</a>');
                 }
                 if ($comment_pending_count[$post->ID]) {
                     echo '<img localsrc="2" alt="[' . sprintf(__('%s pending'), number_format($comment_pending_count[$post->ID])) . ']" />';
                 }
                 break;
             case 'actions':
                 $delete_url = 'page.php?action=delete&post=' . $post->ID;
                 $untrash_url = 'page.php?action=untrash&post=' . $post->ID;
                 $untrash_url = wp_nonce_url($untrash_url, 'untrash-page_' . $post->ID);
                 $actions['restore'] = sprintf('<a href="%s"><font color="%s">%s</font></a>', $untrash_url, 'green', __('Restore'));
                 $actions['delete'] = sprintf('<a href="%s"><font color="%s">%s</font></a>', $delete_url, 'red', __('Delete'));
                 echo '[ ' . implode(' | ', $actions) . ' ]';
                 break;
         }
     }
 }
        ?>
"><?php 
        the_time();
        ?>
</font></div>
		<?php 
        ks_content(__('(more...)'));
        ks_link_pages();
        ?>
		<div><img localsrc="354" alt="" /><font size="-1"><?php 
        echo __('Categories') . ':';
        ks_category();
        ?>
</font><br /><?php 
        ks_tags('<img localsrc="77" alt="" /><font size="-1">' . __('Tags') . ':', '</font><br />');
        if (ks_option('ks_separate_comments')) {
            ks_comments_link(NULL, __('No Comments/Pings', 'ktai_style'), __('One Comment/Ping', 'ktai_style'), __('% Comments and Pings', 'ktai_style'));
        } else {
            ks_comments_link();
        }
        ks_comments_post_link(NULL, '<br />');
        edit_post_link('<font color="' . $ks_settings['edit_color'] . '">' . __('Edit post') . '</font>', '<div><img localsrc="104" alt="" />', '</div>');
        ?>
</div>
		<hr color="<?php 
        echo $ks_settings['hr_color'];
        ?>
" />
		<?php 
        ks_previous_post_link('<div align="left"><img localsrc="7" alt="&laquo; ">*.%link</div>');
        ks_next_post_link('<div align="right">#.%link<img localsrc="8" alt=" &raquo;"></div>');
</title>
<?php 
ks_wp_head(KTAI_NONE_PC_HEAD);
?>
</head>
<body link="#0066cc" vlink="#0066cc">
<?php 
global $ks_settings;
$ks_settings = array();
// erase array for security
$ks_settings['h2_style'] = '';
$ks_settings['hr_color'] = 'red';
$ks_settings['list_pages'] = 'sort_column=menu_order,post_title';
$ks_settings['ol_max'] = 4;
$ks_settings['date_color'] = 'red';
$ks_settings['comment_color'] = ks_option('ks_comment_type_color');
$ks_settings['edit_color'] = 'maroon';
ks_page_title();
/* ks_page_title('logo.png'); */
?>
<div align="right"><img localsrc="30" alt="<?php 
_e('&darr;', 'ktai_style');
?>
" /><a href="#tail"><?php 
_e('Menu', 'ktai_style');
?>
</a></div>
<?php 
if (!is_single()) {
    ?>
<hr color="<?php