SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
-
Aug 24, 2008, 04:59 #1
- Join Date
- Mar 2005
- Posts
- 144
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
wordpress 2.5 how users upload their own avatars?
i want my users to use their own avatars in post comments
how do they do that? i allready enabled gravatar...is it something they can do allready?
-
Aug 24, 2008, 07:28 #2
- Join Date
- May 2006
- Location
- Aurora, Illinois
- Posts
- 15,476
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If you're using Gravatars, then the users need to create a Gravatar account in order for their avatars to show up.
Save the Internet - Use Opera | May my mother rest in peace: 1943-2009
Dan Schulz - Design Team Advisor | Follow me on Twitter
SitePoint References: HTML CSS JavaScript | Become A Guru
WordPress SEO Checklist | What WordPress Plugins Do You Use?
Web Standards Curriculum | Image Free Equal Height Columns
-
Aug 24, 2008, 07:48 #3
- Join Date
- Mar 2005
- Posts
- 144
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Aug 24, 2008, 07:58 #4
- Join Date
- May 2006
- Location
- Aurora, Illinois
- Posts
- 15,476
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ah, the code that goes into the Theme. Okay, here's the code I use for my comments.php file. (Yes, I know - it could be better, but I just don't have the time to perfect the HTML output at the moment.)
Code PHP:<ol id="comments"> <?php foreach ($comments as $comment) : ?> <?php // Michael Martin's comment/trackback separation script ?> <?php $comment_type = get_comment_type(); ?> <?php if($comment_type == 'comment') { ?> <li class="<?php if($comment->user_id == '1') echo 'author-comment'; else echo $oddcomment; ?>" id="comment-<?php comment_ID(); ?>"> <?php echo get_avatar( $comment, 48 ); ?> <cite><?php comment_author_link(); ?> Says:</cite> <?php if ($comment->comment_approved == '0') : ?> <em>Your comment is awaiting moderation.</em> <?php endif; ?> <br /> <span class="commentmetadata">Posted on <a href="#comment-<?php comment_ID() ?>"><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('<br />Edit this comment','',''); ?></span> <?php comment_text() ?> </li> <?php /* Changes every other comment to a different class */ if ('alt' == $oddcomment) $oddcomment = ''; else $oddcomment = 'alt'; ?> <?php } else { $trackback = true; } /* End of is_comment statement */ ?> <?php endforeach; /* end for each comment */ ?> </ol>
Notice the part that looks like this:
Code PHP:<?php echo get_avatar( $comment, 48 ); ?>
That is what you use to call the Gravatar. The number is the size of the avatar (base 8, 16, 32...). You'll see I chose 48 since that's "just right" for the design I'm working on at the moment.Save the Internet - Use Opera | May my mother rest in peace: 1943-2009
Dan Schulz - Design Team Advisor | Follow me on Twitter
SitePoint References: HTML CSS JavaScript | Become A Guru
WordPress SEO Checklist | What WordPress Plugins Do You Use?
Web Standards Curriculum | Image Free Equal Height Columns
-
Aug 24, 2008, 08:15 #5
- Join Date
- Mar 2005
- Posts
- 144
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
hi, what should the above code u posted do? i tried it but it just screwed up my layout and still i cannot choose my own avatar
-
Aug 24, 2008, 08:25 #6
- Join Date
- May 2006
- Location
- Aurora, Illinois
- Posts
- 15,476
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You need to put the <?php echo get_avatar( $comment, 48 ); ?> in the list item that has your comment data.
What does your comments.php file look like?Save the Internet - Use Opera | May my mother rest in peace: 1943-2009
Dan Schulz - Design Team Advisor | Follow me on Twitter
SitePoint References: HTML CSS JavaScript | Become A Guru
WordPress SEO Checklist | What WordPress Plugins Do You Use?
Web Standards Curriculum | Image Free Equal Height Columns
-
Aug 24, 2008, 08:31 #7
- Join Date
- Mar 2005
- Posts
- 144
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
and what does this do?
anyway my comments.php:
PHP Code:<?php // Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thanks!');
if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
?>
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
<?php return;
}
}
/* This variable is for alternating comment background */ $oddcomment = 'class="alt" ';
?>
<!-- You can start editing here. -->
<?php if ($comments) : ?>
<div style="text-align: center; color: #E1DFDF;"><h3 id="comments"><?php comments_number(__('0 Commenti', 'kubrick'), __('1 Commento', 'kubrick'), __('% Commenti', 'kubrick'));?></h3></div>
<ol class="commentlist">
<?php foreach ($comments as $comment) : ?>
<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
<?php echo get_avatar( $comment, 48 ); ?>
<font style="color: #FFD600; weight: bold; font-size: 12px;"><?php printf(__('<cite>%s</cite>', 'kubrick'), get_comment_author_link()); ?></font> - <a href="#comment-<?php comment_ID() ?>" title=""><font style="color: #FFD600;"><?php printf(__('%1$s ; %2$s', 'kubrick'), get_comment_date(__('j F Y', 'kubrick')), get_comment_time()); ?></font></a>
<?php if ($comment->comment_approved == '0') : ?>
<em><?php _e('Your comment is awaiting moderation.', 'kubrick'); ?></em>
<?php endif; ?>
<font style="color: #fff;"><?php comment_text() ?></font>
</li>
<?php
/* Changes every other comment to a different class */
$oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
?>
<?php endforeach; /* end for each comment */ ?>
</ol>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments"><?php _e('Comments are closed.', 'kubrick'); ?></p>
<?php endif; ?>
<?php endif; ?>
<?php if ('open' == $post->comment_status) : ?>
<h3 id="respond"><?php _e('Inserisci un commento', 'kubrick'); ?></h3>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.', 'kubrick'), get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode(get_permalink())); ?></p>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>.', 'kubrick'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account', 'kubrick'); ?>"><?php _e('Log out »', 'kubrick'); ?></a></p>
<?php else : ?>
<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
<label for="author"><small><?php _e('Name', 'kubrick'); ?> <?php if ($req) _e("(required)", "kubrick"); ?></small></label></p>
<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<label for="email"><small><?php _e('Mail (will not be published)', 'kubrick'); ?> <?php if ($req) _e("(required)", "kubrick"); ?></small></label></p>
<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small><?php _e('Website', 'kubrick'); ?></small></label></p>
<?php endif; ?>
<!--<p><small><?php printf(__('<strong>XHTML:</strong> You can use these tags: <code>%s</code>', 'kubrick'), allowed_tags()); ?></small></p>-->
<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Invia commento', 'kubrick'); ?>" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>
<?php endif; ?>
<?php endif; ?>
-
Aug 24, 2008, 08:56 #8
- Join Date
- May 2006
- Location
- Aurora, Illinois
- Posts
- 15,476
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
That bit of code fetches the Gravatar. When you say it's messed up, does it look like a layout issue, or is it just not there, throwing a PHP errror, or what?
And as I said, you have to select your avatar from the Gravatar service in order for it to be used on your blog. (It'll also use the same avatar on other blogs as well.)Save the Internet - Use Opera | May my mother rest in peace: 1943-2009
Dan Schulz - Design Team Advisor | Follow me on Twitter
SitePoint References: HTML CSS JavaScript | Become A Guru
WordPress SEO Checklist | What WordPress Plugins Do You Use?
Web Standards Curriculum | Image Free Equal Height Columns
-
Aug 24, 2008, 08:59 #9
- Join Date
- Mar 2005
- Posts
- 144
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Aug 24, 2008, 09:30 #10
- Join Date
- May 2006
- Location
- Aurora, Illinois
- Posts
- 15,476
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Not off the top of my head, no.
Save the Internet - Use Opera | May my mother rest in peace: 1943-2009
Dan Schulz - Design Team Advisor | Follow me on Twitter
SitePoint References: HTML CSS JavaScript | Become A Guru
WordPress SEO Checklist | What WordPress Plugins Do You Use?
Web Standards Curriculum | Image Free Equal Height Columns
Bookmarks