Injader
Forum > Help Forum > Is there a function for getting the CONTENT author profile link?

< Contact Form issue : Is there a function for the site URL? >

ginkgo100
Permalink

Created: May 19, 2009 22:43

Is there a function for getting the CONTENT author profile link?

I see on the theme function reference, there is a function GetCommentAuthorProfileLink.  That's great for comments, but I would like to link to the profile of the author of an article, too.  There is no GetContentAuthorProfileLink that I can find — is there a way to do this?  Using "GetCommentAuthorProfileLink" is not working, but I cannot guarantee that my PHP code is correct.

This code:

Posted by
<?php
  $strCommentAuthorProfileLink = $CMS->TH->GetCommentAuthorProfileLink();
  if ($strCommentAuthorProfileLink) {
?>
<a href="<?php print($strCommentAuthorProfileLink); ?>"><?php $CMS->TH->GetContentAuthorName() ?></a>
<?php
  } else
    $CMS->TH->GetContentAuthorName()
?>

returns this:

Posted by
Notice: Undefined offset: -1 in [snip]/sys/includes/html/Theme.php on line 661

... which I assume is because I'm trying to call a comment author profile in the wrong section? 

(Also, I didn't define a variable $strContentAuthorName even though I'm repeating things because I don't want to mess with figuring out how to do user-defined variables until I get this part right.)

Tags: None.

Ben's avatar

Ben
Permalink


1

Created: May 20, 2009 09:05

GetContentAuthorProfileLink does not exist. I can add it as part of the next version.

If you're trying to use the GetComment... functions in a section of the code that does not handle comments, there will be no comment from which to load the author data.

If you look at page.php in the default theme, there should be some comment display code. The most important part is that the comment display code appears within a loop, which cycles through all of the comments.

If you get stuck, feel free to zip up your theme and email it to sitemail at injader dot com. I'll have a look at it for you.

You do not have access to post comments in this area.