smemon
Forum Replies Created
-
And just to make it a bit friendlier, here’s an updated version which displays nothing if the user hasn’t uploaded an image;
<?php $userid = get_the_author_ID(); $findimages = glob('path-to-site/wp-content/uploads/avatars/'.$userid.'/*-bpfull.jpg'); $string = $findimages[0]; // Pick one image. // Now delete the parts of the path before the site root. $pattern = "@path-to-site@"; $replacement = ""; $newString = preg_replace($pattern, $replacement, $string); if ($string != ""){ echo '<img src="'.$newString.'" />'; } ?>
Hi Gagan,
Just an update; i like your plugin so much (but i really needed to display author info in posts) so i spent literally ALL DAY yesterday working on this problem…
So for you and anyone else who may want to enhance this plugin, here’s some php code which you can insert inside the loop (e.g. in template files) which will retrieve the user’s thumbnail image which has been created by the user-avatar plugin..
<?php $userid = get_the_author_ID(); $findimages = glob('path-to-site/wp-content/uploads/avatars/'.$userid.'/*-bpfull.jpg'); $string = $findimages[0]; // Pick one image. // Now delete the parts of the path before the site root. $pattern = "@path-to-site@"; $replacement = ""; $newString = preg_replace($pattern, $replacement, $string); echo '<img src="'.$newString.'" />'; ?>
I finally got this working at about 3am last night having spent all day working on it ??
Hi Gagan,
Thanks for your help ?? i’ve tried get_avatar and had a look at it in wp-includes/pluggable.php but it’s a bit over my head to be honest!
I know that in theory it sounds simple… but it’s not as easy as i thought! Anyway, thanks for your help and keep up the good work!
Sean.
Thanks Gagan not quite the solution i was looking for though, allow me to explain my problem a bit better…
Lets say i have 100 posts by 100 different authors and i want to place the authors avatar after every post they make.
Within a theme template file i.e. single.php, how can i call the author’s avatar? Or is that currently possible?
Many Thanks!
Forum: Fixing WordPress
In reply to: [Plugin: DISQUS Comment System] Disqus breaking RSS validationhi guys, found a solution that so far has had no adverse effects for me…
just delete the closing script tag from line 47 – from what i gather it’s not needed…
</script>
You’ll find it in disqus-comment-system/disqus.php if you go in to your plugin editor in wordpress through the admin panel. About 75% of the way down the page…
Forum: Fixing WordPress
In reply to: [Plugin: DISQUS Comment System] Disqus breaking RSS validationoh no wait, back to breaking again…
still the error;
` line 47, column 3: XML parsing error: <unknown>:47:3: mismatched tag [help]
</script>
^`So it’s a problem with the script tag… any ideas on how to get rid of this? If i disable the disqus plugin there is no problem…
Forum: Fixing WordPress
In reply to: [Plugin: DISQUS Comment System] Disqus breaking RSS validationhmmm… strange… deactivating and reactivating the plugin fixed the problem for now!
Forum: Themes and Templates
In reply to: sidebar below contentno one any ideas? I know it’s a CSS issue and has something to do with padding/width in IE but i can’t pinpoint it.