* **like_no_comment** (Boolean) - Don't update the "commented" value of an item when it is liked.
* **local_block** (Boolean) - Used in conjunction with "block_public".
* **local_search** (Boolean) - Blocks search for users who are not logged in to prevent crawlers from blocking your system.
+* **local_tags** (Boolean) - If activated, all hashtags will point to the local server.
* **max_connections** - The maximum number of database connections which can be in use before the poller process is deferred to it's next interval. When the system can't detect the maximum numbers of connection then this value can be used.
* **max_connections_level** - The maximum level of connections that are allowed to let the poller start. It is a percentage value. Default value is 75.
* **max_contact_queue** - Default value is 500.
$x = stristr($item['plink'],'/display/');
if ($x) {
$sparkle = false;
- $y = best_link_url($item, $sparkle, true);
+ $y = best_link_url($item, $sparkle);
if (strstr($y, '/redir/')) {
$item['plink'] = $y . '?f=&url=' . $item['plink'];
$hashtags = array();
$mentions = array();
+ $searchpath = App::get_baseurl()."/search?tag=";
+
$taglist = dba::select('term', array('type', 'term', 'url'),
array("`otype` = ? AND `oid` = ? AND `type` IN (?, ?)", TERM_OBJ_POST, $item['id'], TERM_HASHTAG, TERM_MENTION),
array('order' => array('tid')));
$tag["url"] = $searchpath . strtolower($tag["term"]);
}
+ $tag["url"] = best_link_url($item, $sp, $tag["url"]);
+
if ($tag["type"] == TERM_HASHTAG) {
$hashtags[] = "#<a href=\"" . $tag["url"] . "\" target=\"_blank\">" . $tag["term"] . "</a>";
$prefix = "#";
dba::close($taglist);
$sp = false;
- $profile_link = best_link_url($item,$sp);
+ $profile_link = best_link_url($item, $sp);
if ($profile_link === 'mailbox') {
$profile_link = '';
}
return $o;
}}
-function best_link_url($item, &$sparkle, $ssl_state = false) {
+function best_link_url($item, &$sparkle, $url = '') {
$best_url = '';
$sparkle = false;
if (dbm::is_result($r)) {
$best_url = 'redir/' . $r['id'];
$sparkle = true;
+ if ($url != '') {
+ $hostname = get_app()->get_hostname();
+ if (!strstr($url, $hostname)) {
+ $best_url .= "?url=".$url;
+ } else {
+ $best_url = $url;
+ }
+ }
}
}
if (! $best_url) {
- if (strlen($item['author-link'])) {
+ if ($url != '') {
+ $best_url = $url;
+ } elseif (strlen($item['author-link'])) {
$best_url = $item['author-link'];
} else {
$best_url = $item['url'];
function item_photo_menu($item) {
- $ssl_state = false;
-
- if (local_user()) {
- $ssl_state = true;
- }
-
$sub_link = '';
$poke_link = '';
$contact_url = '';
}
$sparkle = false;
- $profile_link = best_link_url($item, $sparkle, $ssl_state);
+ $profile_link = best_link_url($item, $sparkle);
if ($profile_link === 'mailbox') {
$profile_link = '';
}
$URLSearchString = "^\[\]";
- // All hashtags should point to the home server if "local_search" is activated
- if (Config::get('system', 'local_search')) {
+ // All hashtags should point to the home server if "local_tags" is activated
+ if (Config::get('system', 'local_tags')) {
$item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
"#[url=".App::get_baseurl()."/search?tag=$2]$2[/url]", $item["body"]);
$tag["url"] = $searchpath.strtolower($tag["term"]);
}
+ $orig_tag = $tag["url"];
+
+ $tag["url"] = best_link_url($item, $sp, $tag["url"]);
+
+ if ($orig_tag != $tag["url"]) {
+ $item['body'] = str_replace($orig_tag, $tag["url"], $item['body']);
+ }
+
if ($tag["type"] == TERM_HASHTAG) {
$hashtags[] = "#<a href=\"".$tag["url"]."\" target=\"_blank\">".$tag["term"]."</a>";
$prefix = "#";