allow both http: and mailto: contact links
This commit is contained in:
parent
dc8efcb680
commit
aeeaabb22e
11 changed files with 42 additions and 17 deletions
|
@ -591,6 +591,31 @@ function zglob($pattern) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets contact link as mailto: or http:
|
||||
*/
|
||||
function contact_link() {
|
||||
global $config;
|
||||
$text = $config->get_string('contact_link');
|
||||
if(
|
||||
startsWith($text, "http:") ||
|
||||
startsWith($text, "https:") ||
|
||||
startsWith($text, "mailto:")
|
||||
) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
if(strpos($text, "@")) {
|
||||
return "mailto:$text";
|
||||
}
|
||||
|
||||
if(strpos($text, "/")) {
|
||||
return "http://$text";
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
|
||||
* CAPTCHA abstraction *
|
||||
|
|
|
@ -49,7 +49,7 @@ class Home extends Extension {
|
|||
global $config;
|
||||
$base_href = get_base_href();
|
||||
$sitename = $config->get_string('title');
|
||||
$contact_link = $config->get_string('contact_link');
|
||||
$contact_link = contact_link();
|
||||
$counter_dir = $config->get_string('home_counter', 'default');
|
||||
|
||||
$total = Image::count_images();
|
||||
|
|
|
@ -37,7 +37,7 @@ EOD
|
|||
$main_links_html = empty($main_links) ? "" : "<div class='space' id='links'>$main_links</div>";
|
||||
$message_html = empty($main_text) ? "" : "<div class='space' id='message'>$main_text</div>";
|
||||
$counter_html = empty($counter_text) ? "" : "<div class='space' id='counter'>$counter_text</div>";
|
||||
$contact_link = empty($contact_link) ? "" : "<br><a href='mailto:$contact_link'>Contact</a> –";
|
||||
$contact_link = empty($contact_link) ? "" : "<br><a href='$contact_link'>Contact</a> –";
|
||||
$search_html = "
|
||||
<div class='space' id='search'>
|
||||
<form action='".make_link("post/list")."' method='GET'>
|
||||
|
|
|
@ -222,7 +222,7 @@ class IPBan extends Extension {
|
|||
print "IP <b>$ip</b> has been banned until <b>$date</b> by <b>{$admin->name}</b> because of <b>$reason</b>\n";
|
||||
print "<p>If you couldn't possibly be guilty of what you're banned for, the person we banned probably had a dynamic IP address and so do you. See <a href='http://whatismyipaddress.com/dynamic-static'>http://whatismyipaddress.com/dynamic-static</a> for more information.\n";
|
||||
|
||||
$contact_link = $config->get_string("contact_link");
|
||||
$contact_link = contact_link();
|
||||
if(!empty($contact_link)) {
|
||||
print "<p><a href='$contact_link'>Contact The Admin</a>";
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ class Layout {
|
|||
$theme_name = $config->get_string('theme');
|
||||
//$base_href = $config->get_string('base_href');
|
||||
$data_href = get_base_href();
|
||||
$contact_link = $config->get_string('contact_link');
|
||||
$contact_link = contact_link();
|
||||
|
||||
|
||||
$header_html = "";
|
||||
|
@ -88,7 +88,7 @@ class Layout {
|
|||
|
||||
$debug = get_debug_info();
|
||||
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='mailto:$contact_link'>Contact</a>";
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='$contact_link'>Contact</a>";
|
||||
|
||||
if(empty($this->subheading)) {
|
||||
$subheading = "";
|
||||
|
|
|
@ -49,7 +49,7 @@ class Layout {
|
|||
//$theme_name = $config->get_string('theme');
|
||||
//$base_href = $config->get_string('base_href');
|
||||
//$data_href = get_base_href();
|
||||
$contact_link = $config->get_string('contact_link');
|
||||
$contact_link = contact_link();
|
||||
|
||||
|
||||
$header_html = "";
|
||||
|
@ -88,7 +88,7 @@ class Layout {
|
|||
|
||||
$debug = get_debug_info();
|
||||
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='mailto:$contact_link'>Contact</a>";
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='$contact_link'>Contact</a>";
|
||||
|
||||
if(empty($this->subheading)) {
|
||||
$subheading = "";
|
||||
|
|
|
@ -13,7 +13,7 @@ class Layout {
|
|||
|
||||
//$theme_name = $config->get_string('theme', 'default');
|
||||
//$data_href = get_base_href();
|
||||
$contact_link = $config->get_string('contact_link');
|
||||
$contact_link = contact_link();
|
||||
|
||||
$header_html = "";
|
||||
ksort($page->html_headers);
|
||||
|
@ -44,7 +44,7 @@ class Layout {
|
|||
|
||||
$debug = get_debug_info();
|
||||
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='mailto:$contact_link'>Contact</a>";
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='$contact_link'>Contact</a>";
|
||||
|
||||
$wrapper = "";
|
||||
if(strlen($page->heading) > 100) {
|
||||
|
|
|
@ -6,7 +6,7 @@ class Layout {
|
|||
|
||||
$theme_name = $config->get_string('theme', 'default');
|
||||
$data_href = get_base_href();
|
||||
$contact_link = $config->get_string('contact_link');
|
||||
$contact_link = contact_link();
|
||||
|
||||
$header_html = "";
|
||||
ksort($page->html_headers);
|
||||
|
@ -37,7 +37,7 @@ class Layout {
|
|||
|
||||
$debug = get_debug_info();
|
||||
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='mailto:$contact_link'>Contact</a>";
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='$contact_link'>Contact</a>";
|
||||
|
||||
if(empty($page->subheading)) {
|
||||
$subheading = "";
|
||||
|
|
|
@ -20,7 +20,7 @@ class Layout {
|
|||
$theme_name = $config->get_string('theme', 'lite');
|
||||
$site_name = $config->get_string('title');
|
||||
$data_href = get_base_href();
|
||||
$contact_link = $config->get_string('contact_link');
|
||||
$contact_link = contact_link();
|
||||
|
||||
$header_html = "";
|
||||
ksort($page->html_headers);
|
||||
|
@ -152,7 +152,7 @@ class Layout {
|
|||
|
||||
$debug = get_debug_info();
|
||||
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='mailto:{$contact_link}'>Contact</a>";
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='{$contact_link}'>Contact</a>";
|
||||
//$subheading = empty($page->subheading) ? "" : "<div id='subtitle'>{$page->subheading}</div>";
|
||||
|
||||
/*$wrapper = "";
|
||||
|
|
|
@ -13,7 +13,7 @@ class Layout {
|
|||
$site_name = $config->get_string('title');
|
||||
$data_href = get_base_href();
|
||||
$main_page = $config->get_string('main_page');
|
||||
$contact_link = $config->get_string('contact_link');
|
||||
$contact_link = contact_link();
|
||||
$site_link = make_link();
|
||||
|
||||
$header_html = "";
|
||||
|
@ -86,7 +86,7 @@ class Layout {
|
|||
|
||||
$debug = get_debug_info();
|
||||
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='mailto:$contact_link'>Contact</a>";
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='$contact_link'>Contact</a>";
|
||||
/*$subheading = empty($page->subheading) ? "" : "<div id='subtitle'>{$page->subheading}</div>";
|
||||
|
||||
$wrapper = "";
|
||||
|
|
|
@ -15,7 +15,7 @@ class Layout {
|
|||
$site_name = $config->get_string('title');
|
||||
$data_href = get_base_href();
|
||||
$main_page = $config->get_string('main_page');
|
||||
$contact_link = $config->get_string('contact_link');
|
||||
$contact_link = contact_link();
|
||||
|
||||
$header_html = "";
|
||||
ksort($page->html_headers);
|
||||
|
@ -50,7 +50,7 @@ class Layout {
|
|||
|
||||
$debug = get_debug_info();
|
||||
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='mailto:$contact_link'>Contact</a>";
|
||||
$contact = empty($contact_link) ? "" : "<br><a href='$contact_link'>Contact</a>";
|
||||
/*$subheading = empty($page->subheading) ? "" : "<div id='subtitle'>{$page->subheading}</div>";
|
||||
|
||||
$wrapper = "";
|
||||
|
|
Reference in a new issue