diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/contacts.php | 3 | ||||
-rw-r--r-- | mod/display.php | 1 | ||||
-rw-r--r-- | mod/follow.php | 3 | ||||
-rw-r--r-- | mod/home.php | 3 | ||||
-rw-r--r-- | mod/item.php | 44 | ||||
-rw-r--r-- | mod/network.php | 14 | ||||
-rw-r--r-- | mod/photos.php | 13 | ||||
-rw-r--r-- | mod/profile.php | 1 | ||||
-rw-r--r-- | mod/settings.php | 7 |
9 files changed, 78 insertions, 11 deletions
diff --git a/mod/contacts.php b/mod/contacts.php index 33d1955a5..92bce0a73 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -165,7 +165,8 @@ function contacts_content(&$a) { '$type' => 'text', '$content' => t('stopped following'), '$nick' => $a->user['nickname'], - '$verb' => ACTIVITY_UNFOLLOW + '$verb' => ACTIVITY_UNFOLLOW, + '$ostat_follow' => '<as:verb>http://ostatus.org/schema/1.0/unfollow</as:verb>' . "\r\n" )); if((x($orig_record[0],'notify')) && (strlen($orig_record[0]['notify']))) { diff --git a/mod/display.php b/mod/display.php index fd845e608..cad60d275 100644 --- a/mod/display.php +++ b/mod/display.php @@ -243,6 +243,7 @@ function display_content(&$a) { $tmp_item = replace_macros($template,array( '$id' => $item['item_id'], + '$title' => t('View $name\'s profile'), '$profile_url' => $profile_link, '$name' => $profile_name, '$sparkle' => $sparkle, diff --git a/mod/follow.php b/mod/follow.php index 5f0f3f7e3..3c9d77657 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -173,7 +173,8 @@ function follow_post(&$a) { '$type' => 'text', '$content' => t('following'), '$nick' => $a->user['nickname'], - '$verb' => ACTIVITY_FOLLOW + '$verb' => ACTIVITY_FOLLOW, + '$ostat_follow' => '' )); $r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid` diff --git a/mod/home.php b/mod/home.php index 53b111bdf..2d646f8dd 100644 --- a/mod/home.php +++ b/mod/home.php @@ -24,6 +24,9 @@ function home_content(&$a) { $o .= file_get_contents('home.html'); $o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1); + + call_hooks("home_content",$o); + return $o; diff --git a/mod/item.php b/mod/item.php index 0a97cdc47..36b51a537 100644 --- a/mod/item.php +++ b/mod/item.php @@ -128,6 +128,50 @@ function item_post(&$a) { } } + + /** + * + * If a photo was uploaded into the message using the ajax uploader, + * it can be seen by anybody. Set the permissions to match the message. + * Ideally this should be done when the photo was uploaded, but the permissions + * may not have been set at that time, and passing the permission arrays via + * javascript to the ajax upload is going to be a challenge. + * This is a compromise. Granted there is a window of time when the photo + * is public. You are welcome to suggest other ways to fix this. + * + */ + + $match = null; + + if($private) { + if(preg_match_all("/\[img\](.+?)\[\/img\]/",$body,$match)) { + $images = $match[1]; + if(count($images)) { + foreach($images as $image) { + if(! stristr($image,$a->get_baseurl() . '/photo/')) + continue; + $image_uri = substr($image,strrpos($image,'/') + 1); + $image_uri = substr($image_uri,0, strpos($image_uri,'-')); + $r = q("UPDATE `photo` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s' + WHERE `resource-id` = '%s' AND `album` = '%s' ", + dbesc($str_contact_allow), + dbesc($str_group_allow), + dbesc($str_contact_deny), + dbesc($str_group_deny), + dbesc($image_uri), + dbesc( t('Wall Photos')) + ); + + } + } + } + } + + + /** + * Look for any tags and linkify them + */ + $str_tags = ''; $inform = ''; diff --git a/mod/network.php b/mod/network.php index ad6db2d1e..08607fa18 100644 --- a/mod/network.php +++ b/mod/network.php @@ -104,10 +104,15 @@ function network_content(&$a, $update = 0) { } $contacts = expand_groups(array($group)); - $contact_str = implode(',',$contacts); - $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `contact-id` IN ( $contact_str )) "; - $o = '<h4>' . t('Group: ') . $r[0]['name'] . '</h4>' . $o; - + if((is_array($contacts)) && count($contacts)) { + $contact_str = implode(',',$contacts); + } + else { + $contact_str = ' 0 '; + notice( t('Group is empty')); + } + $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `contact-id` IN ( $contact_str )) "; + $o = '<h4>' . t('Group: ') . $r[0]['name'] . '</h4>' . $o; } $r = q("SELECT COUNT(*) AS `total` @@ -286,6 +291,7 @@ function network_content(&$a, $update = 0) { $tmp_item = replace_macros($template,array( '$id' => $item['item_id'], + '$title' => t('View $name\'s profile'), '$profile_url' => $profile_link, '$name' => $profile_name, '$thumb' => $profile_avatar, diff --git a/mod/photos.php b/mod/photos.php index f29c39386..e811ca395 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -766,9 +766,10 @@ function photos_content(&$a) { intval($owner_uid), dbesc($album) ); - if(count($r)) + if(count($r)) { $a->set_pager_total(count($r)); - + $a->set_pager_itemspage(20); + } $r = q("SELECT `resource-id`, `id`, `filename`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s' $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d", @@ -817,6 +818,8 @@ function photos_content(&$a) { } $o .= '<div id="photo-album-end"></div>'; + $o .= paginate($a); + return $o; } @@ -1107,9 +1110,10 @@ function photos_content(&$a) { intval($a->data['user']['uid']), dbesc( t('Contact Photos')) ); - if(count($r)) + if(count($r)) { $a->set_pager_total(count($r)); - + $a->set_pager_itemspage(20); + } $r = q("SELECT `resource-id`, `id`, `filename`, `album`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` != '%s' @@ -1147,5 +1151,6 @@ function photos_content(&$a) { } $o .= '<div id="photo-top-end"></div>'; } + $o .= paginate($a); return $o; } diff --git a/mod/profile.php b/mod/profile.php index cc0debd99..5479f2806 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -344,6 +344,7 @@ function profile_content(&$a, $update = 0) { $tmp_item = replace_macros($template,array( '$id' => $item['item_id'], + '$title' => t('View $name\'s profile'), '$profile_url' => $profile_link, '$name' => $profile_name, '$thumb' => $profile_avatar, diff --git a/mod/settings.php b/mod/settings.php index 0f01807a2..a40883f35 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -291,10 +291,15 @@ function settings_content(&$a) { $theme_selector = '<select name="theme" id="theme-select" >'; $files = glob('view/theme/*'); + + $default_theme = get_config('system','theme'); + if(! $default_theme) + $default_theme = 'default'; + if($files) { foreach($files as $file) { $f = basename($file); - $selected = (($f == $_SESSION['theme']) || ($f === 'default' && (! x($_SESSION,'theme'))) + $selected = (($f == $_SESSION['theme']) || ($f === $default_theme && (! x($_SESSION,'theme'))) ? ' selected="selected" ' : '' ); $theme_selector .= '<option val="' . basename($file) . '"' . $selected . '>' . basename($file) . '</option>'; } |