/**
* Generate a guaranteed unique photo ID.
* safe from birthday paradox
- *
+ *
* @return string
- */
+ */
function photo_new_resource() {
do {
* @deprecated
* wrapper to load a view template, checking for alternate
* languages before falling back to the default
- *
+ *
* @global string $lang
* @global App $a
* @param string $s view name
* @param string $s
*/
function linkify($s) {
- $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\'\%\$\!\+]*)/", ' <a href="$1" target="external-link">$1</a>', $s);
+ $s = preg_replace("/(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\'\%\$\!\+]*)/", ' <a href="$1" target="_blank">$1</a>', $s);
$s = preg_replace("/\<(.*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$s);
return($s);
}}
$tag["url"] = $searchpath.strtolower($tag["term"]);
if ($tag["type"] == TERM_HASHTAG) {
- $hashtags[] = "#<a href=\"".$tag["url"]."\" target=\"external-link\">".$tag["term"]."</a>";
+ $hashtags[] = "#<a href=\"".$tag["url"]."\" target=\"_blank\">".$tag["term"]."</a>";
$prefix = "#";
} elseif ($tag["type"] == TERM_MENTION) {
- $mentions[] = "@<a href=\"".$tag["url"]."\" target=\"external-link\">".$tag["term"]."</a>";
+ $mentions[] = "@<a href=\"".$tag["url"]."\" target=\"_blank\">".$tag["term"]."</a>";
$prefix = "@";
}
- $tags[] = $prefix."<a href=\"".$tag["url"]."\" target=\"external-link\">".$tag["term"]."</a>";
+ $tags[] = $prefix."<a href=\"".$tag["url"]."\" target=\"_blank\">".$tag["term"]."</a>";
}
}
$title = ((strlen(trim($mtch[4]))) ? escape_tags(trim($mtch[4])) : escape_tags($mtch[1]));
$title .= ' ' . $mtch[2] . ' ' . t('bytes');
- $as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="external-link" >' . $icon . '</a>';
+ $as .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="_blank" >' . $icon . '</a>';
}
}
}
* @return boolean|array False if item has not plink, otherwise array('href'=>plink url, 'title'=>translated title)
*/
function get_plink($item) {
- $a = get_app();
- if (x($item,'plink') && ($item['private'] != 1)) {
- return array(
- 'href' => $item['plink'],
+ $a = get_app();
+ $ret = array(
+ 'href' => $a->get_baseurl()."/display/".$a->user['nickname']."/".$item['id'],
'title' => t('link to source'),
);
- }
- else {
- return false;
- }
+
+ $ret["orig"] = $ret["href"];
+
+ //if (x($item,'plink') && ($item['private'] != 1))
+ if (x($item,'plink'))
+ $ret["href"] = $item['plink'];
+
+ return($ret);
}}
if(! function_exists('unamp')) {
);
if(count($r)) {
if(! stristr($r[0]['file'],'[' . file_tag_encode($file) . ']'))
- q("update item set file = '%s' where id = %d and uid = %d limit 1",
+ q("update item set file = '%s' where id = %d and uid = %d",
dbesc($r[0]['file'] . '[' . file_tag_encode($file) . ']'),
intval($item),
intval($uid)
if(! count($r))
return false;
- q("update item set file = '%s' where id = %d and uid = %d limit 1",
+ q("update item set file = '%s' where id = %d and uid = %d",
dbesc(str_replace($pattern,'',$r[0]['file'])),
intval($item),
intval($uid)