aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php55
1 files changed, 46 insertions, 9 deletions
diff --git a/boot.php b/boot.php
index f72f4dd7f..25c7fd14d 100644
--- a/boot.php
+++ b/boot.php
@@ -4,9 +4,9 @@ set_time_limit(0);
ini_set('pcre.backtrack_limit', 250000);
-define ( 'FRIENDIKA_VERSION', '2.2.989' );
+define ( 'FRIENDIKA_VERSION', '2.2.990' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
-define ( 'DB_UPDATE_VERSION', 1055 );
+define ( 'DB_UPDATE_VERSION', 1058 );
define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@@ -1983,15 +1983,15 @@ function get_tags($s) {
$s = preg_replace('/\[code\](.*?)\[\/code\]/sm','',$s);
if(preg_match_all('/([@#][^ \x0D\x0A,:?]+)([ \x0D\x0A,:?]|$)/',$s,$match)) {
- foreach($match[1] as $match) {
- if(strstr($match,"]")) {
+ foreach($match[1] as $mtch) {
+ if(strstr($mtch,"]")) {
// we might be inside a bbcode color tag - leave it alone
continue;
}
- if(substr($match,-1,1) === '.')
- $ret[] = substr($match,0,-1);
+ if(substr($mtch,-1,1) === '.')
+ $ret[] = substr($mtch,0,-1);
else
- $ret[] = $match;
+ $ret[] = $mtch;
}
}
@@ -2361,6 +2361,10 @@ function profile_sidebar($profile) {
$homepage = ((x($profile,'homepage') == 1) ? '<div class="homepage"><span class="homepage-label">' . t('Homepage:') . ' </span><span class="homepage-url">' . linkify($profile['homepage']) . '</span></div><div class="profile-clear"></div>' : '');
+ if($profile['hidewall'] && (! local_user()) && (! remote_user())) {
+ $location = $gender = $marital = $homepage = '';
+ }
+
$tpl = get_markup_template('profile_vcard.tpl');
$o .= replace_macros($tpl, array(
@@ -2536,8 +2540,41 @@ function link_compare($a,$b) {
if(! function_exists('prepare_body')) {
-function prepare_body($item) {
- return prepare_text($item['body']);
+function prepare_body($item,$attach = false) {
+
+ $s = prepare_text($item['body']);
+ if(! $attach)
+ return $s;
+
+ $arr = explode(',',$item['attach']);
+ $s .= '<div class="body-attach">';
+ if(count($arr)) {
+ foreach($arr as $r) {
+ $matches = false;
+ $icon = '';
+ $cnt = preg_match('|\[attach\]href=\"(.+?)\" size=\"(.+?)\" type=\"(.+?)\" title=\"(.+?)\"\[\/attach\]|',$r,$matches);
+ if($cnt) {
+ $icontype = strtolower(substr($matches[3],0,strpos($matches[3],'/')));
+ switch($icontype) {
+ case 'video':
+ case 'audio':
+ case 'image':
+ case 'text':
+ $icon = '<div class="attachtype type-' . $icontype . '"></div>';
+ break;
+ default:
+ $icon = '<div class="attachtype type-unkn"></div>';
+ break;
+ }
+ $title = ((strlen(trim($matches[4]))) ? escape_tags(trim($matches[4])) : escape_tags($matches[1]));
+ $title .= ' ' . $matches[2] . ' ' . t('bytes');
+
+ $s .= '<a href="' . strip_tags($matches[1]) . '" title="' . $title . '" class="attachlink" target="external-link" >' . $icon . '</a>';
+ }
+ }
+ }
+ $s .= '<div class="clear"></div></div>';
+ return $s;
}}
if(! function_exists('prepare_text')) {