In the file: include/inc_front/content.func.inc.php, in between the code for the {AUTHOR} and {RELATED} replacement tags, I added:
Code: Select all
// -------------------------------------------------------------
// AUTHORANDEMAIL replacement tag: by Adam Marcionek, inspired by Magnar Stav Johanssen
if( ! (strpos($content["all"],'{AUTHORANDEMAIL}')===false)) {
$authorandemail = get_author_and_email($content["articles"][$aktion[1]]["article_username"],$db);
$content["all"] = str_replace('{AUTHORANDEMAIL}', $authorandemail, $content["all"]);
}
Code: Select all
// -------------------------------------------------------------
function get_author_and_email($article_username, $dbcon) {
// find keyword for current article used for AUTHORANDEMAIL replacement tag
// prepared by Adam Marcionek, inspired by Magnar Stav Johanssen.
$author_and_email ="";
$sql = 'SELECT usr_email FROM '.DB_PREPEND.'phpwcms_user WHERE usr_name="'.$article_username.'"';
if($result = mysql_fetch_row(mysql_query($sql, $dbcon))) {
$usr_email = $result[0];
$author_and_email .= 'Email: <a class="AuthorAndEmail" href="mailto:'.$usr_email;
$author_and_email .= '">'.$article_username.'</a>';
}
return $author_and_email;
}
Additionally, I've included a separate CSS tag should you want to display that link differently than others on the page. Just add a style "AuthorAndEmail" to your frontend.css document. Eg:
Code: Select all
.AuthorAndEmail {
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 12px;
font-weight: bold;
color: #FF0000;
}
And if anyone has any suggestions on how to write it better, I'd be happy to hear them.
Oh yeah, here's an example: http://www.dogwoodpapers.com/index.php?id=13,19,0,0,1,0 Its the red The Fenlenium link at the bottom of the page.