Ok, i changed this around a bit cause i didn't work for me. Some ppl couldn't see the images in the forum.
PHP Code:
if (!$GLOBALS[HTTP_REFERER]) {
$HTTPREFERER = "http://www.7thgencivic.com/";
} else {
$HTTPREFERER = $GLOBALS[HTTP_REFERER];
}
$c_url = parse_url($HTTPREFERER);
if (!substr_count($c_url[host], "www.7thgencivic.com") || !substr_count($c_url[host], "7thgencivic.com")) {
$redirectquery = $DB_site->query_first("SELECT postid,threadid FROM post WHERE attachmentid='".$attachmentid."'");
$url = $bburl . "/showthread.php?s=".$session[sessionhash]."&threadid=".$redirectquery[threadid]."#post".$redirectquery[postid];
$redirecttype = "post";
eval("standardredirect(\"".gettemplate("redirect_wrongreferrer")."\",\"\$url\");");
}