Example #1
0
    function form($user_data, $depth = 4)
    {
        global $thesis_design, $post;
        if (comments_open()) {
            #wp
            $tab = str_repeat("\t", $depth);
            if (get_option('comment_registration') && !$user_data['user_ID']) {
                #wp
                echo "{$tab}<div class=\"login_alert\">\n";
                echo "{$tab}\t<p>" . sprintf(__('You must <a href="%s" rel="nofollow">log in</a> to post a comment.', 'thesis'), wp_login_url(get_permalink())) . "</p>\n";
                #wp
                echo "{$tab}</div>\n";
            } else {
                echo "{$tab}<div id=\"respond\">\n";
                echo "{$tab}\t<div id=\"respond_intro\">\n";
                if (get_option('thread_comments')) {
                    cancel_comment_reply_link(__('Cancel reply', 'thesis'));
                }
                #wp
                echo "{$tab}\t\t<p>" . apply_filters('thesis_comment_form_title', __('Leave a Comment', 'thesis')) . "</p>\n";
                #filter
                echo "{$tab}\t</div>\n";
                echo "{$tab}\t<form action=\"" . get_option('siteurl') . "/wp-comments-post.php\" method=\"post\" id=\"commentform\">\n";
                #wp
                thesis_hook_comment_form_top();
                #hook
                if ($user_data['user_ID']) {
                    // #wp
                    echo "{$tab}\t\t<p>" . sprintf(__('Logged in as <a href="%1$s" rel="nofollow">%2$s</a>.', 'thesis'), get_option('siteurl') . '/wp-admin/profile.php', $user_data['user_identity']) . ' ' . sprintf(__('<a href="%s" title="Log out of this account" rel="nofollow">Logout &rarr;</a>', 'thesis'), wp_logout_url(get_permalink())) . "</p>\n";
                } else {
                    ?>
						<p><input class="text_input" type="text" name="author" id="author" value="<?php 
                    echo $user_data['comment_author'];
                    ?>
" tabindex="1"<?php 
                    if ($user_data['req']) {
                        echo ' aria-required="true"';
                    }
                    ?>
 /><label for="author"><?php 
                    _e('Name', 'thesis');
                    if ($user_data['req']) {
                        _e(' <span class="required" title="Required">*</span>', 'thesis');
                    }
                    ?>
</label></p>
						<p><input class="text_input" type="text" name="email" id="email" value="<?php 
                    echo $user_data['comment_author_email'];
                    ?>
" tabindex="2"<?php 
                    if ($user_data['req']) {
                        echo ' aria-required="true"';
                    }
                    ?>
 /><label for="email"><?php 
                    _e('E-mail', 'thesis');
                    if ($user_data['req']) {
                        _e(' <span class="required" title="Required">*</span>', 'thesis');
                    }
                    ?>
</label></p>
						<p><input class="text_input" type="text" name="url" id="url" value="<?php 
                    echo $user_data['comment_author_url'];
                    ?>
" tabindex="3" /><label for="url"><?php 
                    _e('Website', 'thesis');
                    ?>
</label></p>
<?php 
                }
                thesis_hook_comment_field();
                #hook
                echo "{$tab}\t\t<p class=\"comment_box\">\n";
                echo "{$tab}\t\t\t<textarea name=\"comment\" id=\"comment\" tabindex=\"4\" cols=\"40\" rows=\"8\"></textarea>\n";
                echo "{$tab}\t\t</p>\n";
                thesis_hook_after_comment_box();
                #hook
                echo "{$tab}\t\t<p class=\"remove_bottom_margin\">\n";
                echo "{$tab}\t\t\t<input name=\"submit\" class=\"form_submit\" type=\"submit\" id=\"submit\" tabindex=\"5\" value=\"" . __('Submit', 'thesis') . "\" />\n";
                comment_id_fields();
                #wp
                echo "{$tab}\t\t</p>\n";
                thesis_hook_comment_form_bottom();
                #hook
                do_action('comment_form', $post->ID);
                #wp
                echo "{$tab}\t</form>\n";
                echo "{$tab}</div>\n";
            }
        } elseif ($thesis_design->display['comments']['show_closed']) {
            echo "{$tab}<div class=\"comments_closed\">\n";
            echo "{$tab}\t<p>" . apply_filters('thesis_comments_closed', __('Comments on this entry are closed.', 'thesis')) . "</p>\n";
            #filter
            echo "{$tab}</div>\n";
        }
    }
Example #2
0
    function form()
    {
        global $thesis_site;
        if (comments_open()) {
            #wp
            global $user_ID, $user_identity;
            if (get_option('comment_registration') && !$user_ID) {
                // If registration is required and the user is NOT logged in... #wp
                echo "\t\t\t\t<div class=\"login_alert\">\n";
                echo "\t\t\t\t\t<p>" . sprintf(__('You must <a href="%s" rel="nofollow">log in</a> to post a comment.', 'thesis'), get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode(get_permalink())) . "</p>\n";
                #wp
                echo "\t\t\t\t</div>\n";
            } else {
                // Otherwise, show the user the stinkin' comment form already!
                echo "\t\t\t\t<div id=\"respond\">\n";
                echo "\t\t\t\t\t<div id=\"respond_intro\">\n";
                if (get_option('thread_comments')) {
                    cancel_comment_reply_link(__('Cancel reply', 'thesis'));
                }
                #wp
                echo "\t\t\t\t\t\t<p>" . apply_filters('thesis_comment_form_title', __('Leave a Comment', 'thesis')) . "</p>\n";
                #filter
                echo "\t\t\t\t\t</div>\n";
                echo "\t\t\t\t\t<form action=\"" . get_option('siteurl') . "/wp-comments-post.php\" method=\"post\" id=\"commentform\">\n";
                #wp
                thesis_hook_comment_form_top();
                if ($user_ID) {
                    // If the user is logged in... #wp
                    echo "\t\t\t\t\t\t<p>" . sprintf(__('Logged in as <a href="%1$s" rel="nofollow">%2$s</a>.', 'thesis'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity) . ' ' . sprintf(__('<a href="%s" title="Log out of this account" rel="nofollow">Logout &rarr;</a>', 'thesis'), thesis_logout_url()) . "</p>\n";
                } else {
                    // Otherwise, give your name to the doorman
                    $req = (bool) get_option('require_name_email');
                    ?>
						<p><input class="text_input" type="text" name="author" id="author" value="<?php 
                    echo $comment_author;
                    ?>
" tabindex="1"<?php 
                    if ($req) {
                        echo ' aria-required="true"';
                    }
                    ?>
 /><label for="author"><?php 
                    _e('Name', 'thesis');
                    if ($req) {
                        _e(' <span class="required" title="Required">*</span>', 'thesis');
                    }
                    ?>
</label></p>
						<p><input class="text_input" type="text" name="email" id="email" value="<?php 
                    echo $comment_author_email;
                    ?>
" tabindex="2"<?php 
                    if ($req) {
                        echo ' aria-required="true"';
                    }
                    ?>
 /><label for="email"><?php 
                    _e('E-mail', 'thesis');
                    if ($req) {
                        _e(' <span class="required" title="Required">*</span>', 'thesis');
                    }
                    ?>
</label></p>
						<p><input class="text_input" type="text" name="url" id="url" value="<?php 
                    echo $comment_author_url;
                    ?>
" tabindex="3" /><label for="url"><?php 
                    _e('Website', 'thesis');
                    ?>
</label></p>
<?php 
                }
                thesis_hook_comment_field();
                echo "\t\t\t\t\t\t<p class=\"comment_box\">\n";
                echo "\t\t\t\t\t\t\t<textarea name=\"comment\" id=\"comment\" tabindex=\"4\" cols=\"40\" rows=\"8\"></textarea>\n";
                echo "\t\t\t\t\t\t</p>\n";
                thesis_hook_after_comment_box();
                echo "\t\t\t\t\t\t<p class=\"remove_bottom_margin\">\n";
                echo "\t\t\t\t\t\t\t<input name=\"submit\" class=\"form_submit\" type=\"submit\" id=\"submit\" tabindex=\"5\" value=\"" . __('Submit', 'thesis') . "\" />\n";
                comment_id_fields();
                #wp
                echo "\t\t\t\t\t\t</p>\n";
                thesis_hook_comment_form_bottom();
                do_action('comment_form', $post->ID);
                #wp
                echo "\t\t\t\t\t</form>\n";
                echo "\t\t\t\t</div>\n";
            }
        } elseif ($thesis_site->comments['show_closed']) {
            echo "\t\t\t\t<div class=\"comments_closed\">\n";
            echo "\t\t\t\t\t<p>" . apply_filters('thesis_comments_closed', __('Comments on this entry are closed.', 'thesis')) . "</p>\n";
            echo "\t\t\t\t</div>\n";
        }
    }