root/afridex/theme/comments.php @ 9

Revision 4, 3.8 kB (checked in by admin, 18 years ago)
Line 
1<?php // Do not delete these lines
2        if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
3                die ('Please do not load this page directly. Thanks!');
4
5        if (!empty($post->post_password)) { // if there's a password
6                if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
7                        ?>
8                        <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
9                        <?php
10                        return;
11                }
12        }
13
14        /* This variable is for alternating comment background */
15        $oddcomment = 'class="alt"';
16?>
17
18<!-- You can start editing here. -->
19
20<?php if ($comments) : ?>
21
22        <h3 id="user-notes-title"><?php comments_number('No User Notes', 'One User Note', '% User Notes' );?></h3>
23
24        <dl class="commentlist">
25       
26        <?php $note_num = 1; //Gives each comment a number. ?>
27        <?php foreach ($comments as $comment) : ?>
28       
29                <?php
30                        $grav_size = 40;
31                        $grav_email = md5($comment->comment_author_email);
32                        $grav_url = 'http://www.gravatar.com/avatar.php?gravatar_id='.$grav_email. '&default=' .urlencode($grav_default). '&size='.$grav_size;
33                ?>
34               
35                <dt id="comment-<?php comment_ID(); ?>">
36                        <img src="<?php echo $grav_url; ?>" class="gravatar" />
37                                <span id="author-meta">
38                                <?php comment_author_link(); ?><br/>
39                                <span class="comment-meta"><?php echo $note_num; ?>. <a href="#comment-<?php comment_ID(); ?>" title=""><?php comment_date('d.m.y'); ?> at <?php comment_time(); ?></a> <?php edit_comment_link('e','',''); ?></span>
40                                </span>
41                </dt>
42                <dd>
43                        <?php comment_text(); ?>
44                </dd>
45
46        <?php
47                /* Changes every other comment to a different class - TAKEN OUT FOR NOW */
48                //$oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
49                $note_num++;
50        ?>
51
52        <?php endforeach; /* end for each comment */ ?>
53
54        </dl>
55
56 <?php else : // this is displayed if there are no comments so far ?>
57
58        <?php if ('open' == $post->comment_status) : ?>
59                <!-- If comments are open, but there are no comments. -->
60
61         <?php else : // comments are closed ?>
62                <!-- If comments are closed. -->
63                <p class="nocomments">User notes are closed.</p>
64
65        <?php endif; ?>
66<?php endif; ?>
67
68
69<?php if ('open' == $post->comment_status) : ?>
70
71<h3 id="user-notes-title">Tell Us About <?php echo get_post_meta($post->ID, "Company", true); ?>:</h3>
72
73<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
74<p class="login-note">You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
75<?php else : ?>
76
77<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
78
79<?php if ( $user_ID ) : ?>
80
81<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>.</p>
82
83<?php else : ?>
84
85<p>
86<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
87</p>
88
89<p>
90<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label>
91<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
92</p>
93
94<p>
95<label for="url"><small>Website</small></label><br/>
96<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
97</p>
98
99<?php endif; ?>
100
101<p><textarea name="comment" id="comment" cols="26" rows="10" tabindex="4"></textarea></p>
102
103<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit" />
104<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
105</p>
106<?php do_action('comment_form', $post->ID); ?>
107
108</form>
109
110<?php endif; // If registration required and not logged in ?>
111
112<?php endif; // if you delete this the sky will fall on your head ?>
Note: See TracBrowser for help on using the browser.