the code I used
PHP Code:
$rightlink_host = parse_url($rightlink, PHP_URL_HOST);
$forum_baseurl = vB::getDatastore()->getOption('frontendurl');
$forum_host = parse_url($forum_baseurl, PHP_URL_HOST);
// if same host, then use the link directly
if (vB5_String::stripos($rightlink_host, $forum_host) !== false) {
$myhtml = "<a href="$rightlink" target="_blank"" . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
}
else { // link to your redirect page and pass the encoded external link
// specify path of the redirect URL (exclude forum base url) including the querystring parameter name
// this is the path you used when you created the redirect page in Sitebuilder
$redirect_path = "/redirect?url=";
$myhtml = '<a href="' . $forum_baseurl . $redirect_path . urlencode($rightlink) . '" target="_blank"' . ($is_external ? ' rel="nofollow"' : '') . ">$text</a>";
}
Comment