diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/display.php | 22 | ||||
-rw-r--r-- | mod/message.php | 7 | ||||
-rw-r--r-- | mod/network.php | 60 | ||||
-rw-r--r-- | mod/profile.php | 11 | ||||
-rw-r--r-- | mod/profiles.php | 7 | ||||
-rw-r--r-- | mod/pubsub.php | 11 | ||||
-rw-r--r-- | mod/register.php | 5 | ||||
-rw-r--r-- | mod/wall_upload.php | 4 |
8 files changed, 75 insertions, 52 deletions
diff --git a/mod/display.php b/mod/display.php index 7cefc42e6..edbadbc75 100644 --- a/mod/display.php +++ b/mod/display.php @@ -127,6 +127,8 @@ function display_content(&$a) { like_puller($a,$item,$dlike,'dislike'); } + $author_contacts = extract_item_authors($r,$a->profile['uid']); + foreach($r as $item) { $template = $tpl; @@ -172,17 +174,6 @@ function display_content(&$a) { $sparkle = ''; - $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; - - // I think this is redundant now but too chicken to remove it unless - // I've had six cups of coffee and tested it completely - - if(($item['network'] === 'dfrn') && (! $item['self'] )) { - $profile_url = $redirect_url; - $sparkle = ' sparkle'; - } - - // Top-level wall post not written by the wall owner (wall-to-wall) // First figure out who owns it. @@ -223,13 +214,14 @@ function display_content(&$a) { // Can we use our special contact URL for this author? if(strlen($item['author-link'])) { - if((link_compare($item['author-link'],$item['url'])) && ($item['network'] === 'dfrn') && (! $item['self'])) { + $profile_link = $item['author-link']; + if(link_compare($item['author-link'],$item['url']) && ($item['network'] === 'dfrn') && (! $item['self'])) { $profile_link = $redirect_url; $sparkle = ' sparkle'; } - else { - $profile_link = $item['author-link']; - $sparkle = ''; + elseif(isset($author_contacts[$item['author-link']])) { + $profile_link = $a->get_baseurl() . '/redir/' . $author_contacts[$item['author-link']]; + $sparkle = ' sparkle'; } } diff --git a/mod/message.php b/mod/message.php index 466b0befa..4821a45d2 100644 --- a/mod/message.php +++ b/mod/message.php @@ -165,9 +165,12 @@ function message_content(&$a) { if(($a->argc > 1) && ($a->argv[1] === 'new')) { $tpl = load_view_file('view/msg-header.tpl'); - - $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl())); + $a->page['htmlhead'] .= replace_macros($tpl, array( + '$baseurl' => $a->get_baseurl(), + '$nickname' => $a->user['nickname'] + )); + $select = contact_select('messageto','message-to-select', false, 4, true); $tpl = load_view_file('view/prv_message.tpl'); $o .= replace_macros($tpl,array( diff --git a/mod/network.php b/mod/network.php index 35eb0b325..1ef4ab372 100644 --- a/mod/network.php +++ b/mod/network.php @@ -87,6 +87,17 @@ function network_content(&$a, $update = 0) { $o .= replace_macros($tpl,array( '$return_path' => $a->cmd, + '$action' => 'item', + '$share' => t('Share'), + '$upload' => t('Upload photo'), + '$weblink' => t('Insert web link'), + '$youtube' => t('Insert YouTube video'), + '$setloc' => t('Set your location'), + '$noloc' => t('Clear browser location'), + '$wait' => t('Please wait'), + '$permset' => t('Permission settings'), + '$content' => '', + '$post_id' => '', '$baseurl' => $a->get_baseurl(), '$defloc' => $a->user['default-location'], '$visitor' => 'block', @@ -196,12 +207,13 @@ function network_content(&$a, $update = 0) { AND `item`.`parent` = `parentitem`.`id` $sql_extra ORDER BY `parentitem`.`created` DESC, `item`.`gravity` ASC, `item`.`created` ASC LIMIT %d ,%d ", - intval($_SESSION['uid']), + intval(local_user()), intval($a->pager['start']), intval($a->pager['itemspage']) ); } + $author_contacts = extract_item_authors($r,local_user()); $cmnt_tpl = load_view_file('view/comment_item.tpl'); $like_tpl = load_view_file('view/like.tpl'); @@ -230,10 +242,17 @@ function network_content(&$a, $update = 0) { $profile_avatar = ((strlen($item['author-avatar'])) ? $item['author-avatar'] : $item['thumb']); $profile_link = ((strlen($item['author-link'])) ? $item['author-link'] : $item['url']); - if(strlen($item['author-link']) && link_compare($item['author-link'],$item['url']) - && ($item['network'] === 'dfrn') && (! $item['self'])) { - $profile_link = $redirect_url; - $sparkle = ' sparkle'; + $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; + + if(strlen($item['author-link'])) { + if(link_compare($item['author-link'],$item['url']) && ($item['network'] === 'dfrn') && (! $item['self'])) { + $profile_link = $redirect_url; + $sparkle = ' sparkle'; + } + elseif(isset($author_contacts[$item['author-link']])) { + $profile_link = $a->get_baseurl() . '/redir/' . $author_contacts[$item['author-link']]; + $sparkle = ' sparkle'; + } } $location = (($item['location']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : ''); @@ -287,14 +306,14 @@ function network_content(&$a, $update = 0) { $comment = ''; $template = $tpl; $commentww = ''; + $sparkle = ''; $owner_url = $owner_photo = $owner_name = ''; - $profile_url = $item['url']; + if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent'])) + continue; $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; - if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) && ($item['id'] != $item['parent'])) - continue; $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) @@ -331,7 +350,6 @@ function network_content(&$a, $update = 0) { $owner_url = $redirect_url; $osparkle = ' sparkle'; } - } } @@ -362,13 +380,6 @@ function network_content(&$a, $update = 0) { $drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete'))); - - - if(($item['network'] === 'dfrn') && (! $item['self'] )) { - $profile_url = $redirect_url; - $sparkle = ' sparkle'; - } - $photo = $item['photo']; $thumb = $item['thumb']; @@ -379,22 +390,19 @@ function network_content(&$a, $update = 0) { $profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']); $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $thumb); - - $profile_link = $profile_url; - - // Can we use our special contact URL for this author? - if(strlen($item['author-link'])) { - if((link_compare($item['author-link'],$item['url'])) && ($item['network'] === 'dfrn') && (! $item['self'])) { + $profile_link = $item['author-link']; + if(link_compare($item['author-link'],$item['url']) && ($item['network'] === 'dfrn') && (! $item['self'])) { $profile_link = $redirect_url; $sparkle = ' sparkle'; } - else { - $profile_link = $item['author-link']; - $sparkle = ''; + elseif(isset($author_contacts[$item['author-link']])) { + $profile_link = $a->get_baseurl() . '/redir/' . $author_contacts[$item['author-link']]; + $sparkle = ' sparkle'; } } - + else + $profile_link = $item['url']; $like = ((x($alike,$item['id'])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : ''); $dislike = ((x($dlike,$item['id'])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : ''); diff --git a/mod/profile.php b/mod/profile.php index 827530bc8..b23af2e66 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -147,6 +147,17 @@ function profile_content(&$a, $update = 0) { $o .= replace_macros($tpl,array( '$baseurl' => $a->get_baseurl(), + '$action' => 'item', + '$share' => t('Share'), + '$upload' => t('Upload photo'), + '$weblink' => t('Insert web link'), + '$youtube' => t('Insert YouTube video'), + '$setloc' => t('Set your location'), + '$noloc' => t('Clear browser location'), + '$wait' => t('Please wait'), + '$permset' => t('Permission settings'), + '$content' => '', + '$post_id' => '', '$defloc' => (($is_owner) ? $a->user['default-location'] : ''), '$return_path' => $a->cmd, '$visitor' => (($is_owner || $commvisitor) ? 'block' : 'none'), diff --git a/mod/profiles.php b/mod/profiles.php index 9e19caa0b..409999a3e 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -226,7 +226,7 @@ function profiles_content(&$a) { } if(($a->argc > 2) && ($a->argv[1] === "drop") && intval($a->argv[2])) { - $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 AND `self` = 0 LIMIT 1", + $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 LIMIT 1", intval($a->argv[2]), intval(local_user()) ); @@ -243,8 +243,9 @@ function profiles_content(&$a) { intval($a->argv[2]), intval(local_user()) ); - $r = q("DELETE FROM `profile` WHERE `id` = %d LIMIT 1", - intval($a->argv[2]) + $r = q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval($a->argv[2]), + intval(local_user()) ); if($r) notice( t('Profile deleted.') . EOL); diff --git a/mod/pubsub.php b/mod/pubsub.php index df27c6bc2..5d8ea2ed7 100644 --- a/mod/pubsub.php +++ b/mod/pubsub.php @@ -55,7 +55,8 @@ function pubsub_init(&$a) { $sql_extra = ((strlen($hub_verify)) ? sprintf(" AND `hub-verify` = '%s' ", dbesc($hub_verify)) : ''); - $r = q("SELECT * FROM `contact` WHERE `poll` = '%s' AND `id` = %d AND `uid` = %d AND `blocked` = 0 $sql_extra LIMIT 1", + $r = q("SELECT * FROM `contact` WHERE `poll` = '%s' AND `id` = %d AND `uid` = %d + AND `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1", dbesc($hub_topic), intval($contact_id), intval($owner['uid']) @@ -101,10 +102,14 @@ function pubsub_post(&$a) { $importer = $r[0]; - $r = q("SELECT * FROM `contact` WHERE `subhub` = 1 AND `id` = %d AND `uid` = %d AND `blocked` = 0 AND `readonly` = 0 LIMIT 1", + $r = q("SELECT * FROM `contact` WHERE `subhub` = 1 AND `id` = %d AND `uid` = %d + AND ( `rel` = %d OR `rel` = %d ) AND `blocked` = 0 AND `readonly` = 0 LIMIT 1", intval($contact_id), - intval($importer['uid']) + intval($importer['uid']), + intval(REL_FAN), + intval(REL_BUD) ); + if(! count($r)) { logger('pubsub: no contact record - ignored'); hub_post_return(); diff --git a/mod/register.php b/mod/register.php index 97038def0..13d770fda 100644 --- a/mod/register.php +++ b/mod/register.php @@ -401,6 +401,8 @@ function register_content(&$a) { $oidlabel = t("Your OpenID \x28optional\x29: "); } + $realpeople = t('Members of this network prefer to communicate with real people who use their real names.'); + if(get_config('system','publish_all')) { $profile_publish_reg = '<input type="hidden" name="profile_publish_reg" value="1" />'; } @@ -423,6 +425,7 @@ function register_content(&$a) { $o = load_view_file("view/register.tpl"); $o = replace_macros($o, array( '$oidhtml' => $oidhtml, + '$realpeople' => $realpeople, '$regtitle' => t('Registration'), '$registertext' =>((x($a->config,'register_text')) ? '<div class="error-message">' . $a->config['register_text'] . '</div>' @@ -433,7 +436,7 @@ function register_content(&$a) { '$openid' => $openid_url, '$namelabel' => t('Your Full Name ' . "\x28" . 'e.g. Joe Smith' . "\x29" . ': '), '$addrlabel' => t('Your Email Address: '), - '$nickdesc' => t('Choose a profile nickname. This must begin with a text character. Your global profile locator will then be \'<strong>nickname@$sitename</strong>\'.'), + '$nickdesc' => t('Choose a profile nickname. This must begin with a text character. Your profile address on this site will then be \'<strong>nickname@$sitename</strong>\'.'), '$nicklabel' => t('Choose a nickname: '), '$photo' => $photo, '$publish' => $profile_publish, diff --git a/mod/wall_upload.php b/mod/wall_upload.php index ab06b4b2d..b5725311d 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -101,5 +101,5 @@ function wall_upload_post(&$a) { echo '<br /><br /><a href="' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '" ><img src="' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.jpg\" alt=\"$basename\" /></a><br /><br />"; killme(); - return; // NOTREACHED -}
\ No newline at end of file + // NOTREACHED +} |