View Full Version : How to ? showing the user's homepage in the article
zelonght
11-14-2006, 11:45 PM
I am using version 3.20. I am trying to show the homepage of the user who posted the article in that article
I added the {WWW} in the article_Full.tpl but it does not work. I think I have to make some code changed in php but I don't know how to do.
May you help me a key ? Thank you vivvo
zelonght
11-15-2006, 03:32 AM
SOLVED
I added this function in HTML_function:
function Show_Author_HOMEPAGE()
{
global $url, $tpl_folder,$lang,$article,$show_author,$show_auth or_info,$showFriendlyURL;
global $db_users, $user_connection;
if (($show_author=='Yes') and ($article->Author!=''))
{
$author = $article->Author;
$user = new Users();
$user->FindIdByName($article->Author);
$user->LoadFromDatebase();
{
$user_homepage = $user->WWW;
if ($user_homepage=='') $user_homepage='www.nohomepage.com';
}
$subject=$user_homepage;
}
return $subject;
}
And in the index.php I add
$article_author_HOMEPAGE.=Show_Author_HOMEPAGE();
And in template_script/default.php
I add
$template_manager->assign($article_author_HOMEPAGE,'/{ARTICLE_AUTHOR_HOMEPAGE}/');
And in article_Full.tpl I add
<div>{ARTICLE_AUTHOR_HOMEPAGE}</div>
And it works. But I still don't know the function Show_Author_HOMEPAGE I add is ok or there will be security risk or some hidden errors. :cool:
andy77
11-15-2006, 08:26 AM
Nice one. No security risks here from what I see (but I'm no expert, of course ;)
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.