hyperlink commenters name on blog!
Posted: Tue Sep 04, 2007 3:24 pm
feyd | Please use
and
I tried the following (and some variations) to no avail:[/syntax]
Thanks for any help
Andy
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I am not a PHP programmer.
I have a blog in which i dabble with code!!!!
In my blog I have a popup window for comments. The user has the option to enter a website in the form.
When you view the post with its comments each comment has the the persons name who made the comment. I would like to hyperlink the name of the person who comments with their website ONLY if they give one (i do not require it to be entered).
The input lines in the form are:
[syntax="html"]<input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />Code: Select all
<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="28" tabindex="3" />Code: Select all
<?php
$urlentered = comment_author_url();
if (!empty($urlentered))
echo '<span class="commentauthor"><a href="',comment_author_url(),'" target="_blank">', comment_author(), ' </a></span>';
else
echo '<span class="commentauthor">', comment_author(), ' </span>';
?>Andy
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]