aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/directory.php2
-rw-r--r--mod/display.php7
-rw-r--r--mod/editpost.php91
-rw-r--r--mod/item.php122
-rw-r--r--mod/network.php10
-rw-r--r--mod/photos.php41
-rw-r--r--mod/profile.php18
-rw-r--r--mod/profile_photo.php2
-rw-r--r--mod/profiles.php12
-rw-r--r--mod/register.php4
-rw-r--r--mod/search.php9
-rw-r--r--mod/settings.php6
-rw-r--r--mod/share.php23
13 files changed, 290 insertions, 57 deletions
diff --git a/mod/directory.php b/mod/directory.php
index 0504ac321..825e2a375 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -40,7 +40,7 @@ function directory_content(&$a) {
if($search)
$search = dbesc($search);
- $sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `pdesc`, `locality`,`region`,`country-name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : "");
+ $sql_extra = ((strlen($search)) ? " AND MATCH (`profile`.`name`, `user`.`nickname`, `pdesc`, `locality`,`region`,`country-name`,`gender`,`marital`,`sexual`,`about`,`romance`,`work`,`education`,`pub_keywords`,`prv_keywords` ) AGAINST ('$search' IN BOOLEAN MODE) " : "");
$publish = ((get_config('system','publish_all')) ? '' : " AND `publish` = 1 " );
diff --git a/mod/display.php b/mod/display.php
index 096ea16c9..eddaf8aaf 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -104,7 +104,7 @@ function display_content(&$a) {
$cmnt_tpl = load_view_file('view/comment_item.tpl');
- $like_tpl = load_view_file('view/like.tpl');
+ $like_tpl = load_view_file('view/like_noshare.tpl');
$tpl = load_view_file('view/wall_item.tpl');
$wallwall = load_view_file('view/wallwall_item.tpl');
@@ -155,6 +155,7 @@ function display_content(&$a) {
'$id' => $item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
'$nolike' => t("I don't like this \x28toggle\x29"),
+ '$share' => t('Share'),
'$wait' => t('Please wait')
));
}
@@ -216,6 +217,9 @@ function display_content(&$a) {
$profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
$profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $item['thumb']);
+ $edpost = '';
+ if((local_user()) && ($item['uid'] == local_user()) && ($item['id'] == $item['parent']) && (intval($item['wall']) == 1))
+ $edpost = '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id'] . '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>';
// Can we use our special contact URL for this author?
if(strlen($item['author-link'])) {
@@ -275,6 +279,7 @@ function display_content(&$a) {
'$owner_photo' => $owner_photo,
'$owner_name' => $owner_name,
'$plink' => get_plink($item),
+ '$edpost' => $edpost,
'$drop' => $drop,
'$vote' => $likebuttons,
'$like' => $like,
diff --git a/mod/editpost.php b/mod/editpost.php
new file mode 100644
index 000000000..862ba937f
--- /dev/null
+++ b/mod/editpost.php
@@ -0,0 +1,91 @@
+<?php
+
+require_once('acl_selectors.php');
+
+function editpost_content(&$a) {
+
+ $o = '';
+
+ if(! local_user()) {
+ notice( t('Permission denied.') . EOL);
+ return;
+ }
+
+ $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
+
+ if(! $post_id) {
+ notice( t('Item not found') . EOL);
+ return;
+ }
+
+ $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
+ intval($post_id),
+ intval(local_user())
+ );
+
+ if(! count($r)) {
+ notice( t('Item not found') . EOL);
+ return;
+ }
+
+
+ $o .= '<h2>' . t('Edit post') . '</h2>';
+
+ $tpl = load_view_file('view/jot-header.tpl');
+
+ $a->page['htmlhead'] .= replace_macros($tpl, array(
+ '$baseurl' => $a->get_baseurl(),
+ '$geotag' => $geotag,
+ '$nickname' => $a->user['nickname']
+ ));
+
+
+ $tpl = load_view_file("view/jot.tpl");
+
+ if(($group) || (is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid'])))))
+ $lockstate = 'lock';
+ else
+ $lockstate = 'unlock';
+
+ $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
+
+ $jotplugins = '';
+ $jotnets = '';
+ call_hooks('jot_tool', $jotplugins);
+ call_hooks('jot_networks', $jotnets);
+
+ $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins));
+
+ $o .= replace_macros($tpl,array(
+ '$return_path' => $_SESSION['return_url'],
+ '$action' => 'item',
+ '$share' => t('Edit'),
+ '$upload' => t('Upload photo'),
+ '$weblink' => t('Insert web link'),
+ '$youtube' => t('Insert YouTube video'),
+ '$video' => t('Insert Vorbis [.ogg] video'),
+ '$audio' => t('Insert Vorbis [.ogg] audio'),
+ '$setloc' => t('Set your location'),
+ '$noloc' => t('Clear browser location'),
+ '$wait' => t('Please wait'),
+ '$permset' => t('Permission settings'),
+ '$content' => $r[0]['body'],
+ '$post_id' => $post_id,
+ '$baseurl' => $a->get_baseurl(),
+ '$defloc' => $a->user['default-location'],
+ '$visitor' => 'none',
+ '$emailcc' => t('CC: email addresses'),
+ '$jotnets' => $jotnets,
+ '$emtitle' => t('Example: bob@example.com, mary@example.com'),
+ '$lockstate' => $lockstate,
+ '$acl' => '', // populate_acl((($group) ? $group_acl : $a->user), $celeb),
+ '$bang' => (($group) ? '!' : ''),
+ '$profile_uid' => $_SESSION['uid']
+ ));
+
+
+ return $o;
+
+}
+
+
diff --git a/mod/item.php b/mod/item.php
index da317a8c0..5cefb3be3 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -51,7 +51,7 @@ function item_post(&$a) {
}
$profile_uid = ((x($_POST,'profile_uid')) ? intval($_POST['profile_uid']) : 0);
-
+ $post_id = ((x($_POST['post_id'])) ? intval($_POST['post_id']) : 0);
if(! can_write_wall($a,$profile_uid)) {
notice( t('Permission denied.') . EOL) ;
@@ -60,6 +60,21 @@ function item_post(&$a) {
killme();
}
+
+ // is this an edited post?
+
+ $orig_post = null;
+
+ if($post_id) {
+ $i = q("SELECT * FROM `item` WHERE `uid` = %d AND `id` = %d LIMIT 1",
+ intval($profile_uid),
+ intval($post_id)
+ );
+ if(! count($i))
+ killme();
+ $orig_post = $i[0];
+ }
+
$user = null;
$r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
@@ -68,37 +83,51 @@ function item_post(&$a) {
if(count($r))
$user = $r[0];
-
- $str_group_allow = perms2str($_POST['group_allow']);
- $str_contact_allow = perms2str($_POST['contact_allow']);
- $str_group_deny = perms2str($_POST['group_deny']);
- $str_contact_deny = perms2str($_POST['contact_deny']);
-
- $private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0);
-
- if(($parent_item) &&
- (($parent_item['private'])
- || strlen($parent_item['allow_cid'])
- || strlen($parent_item['allow_gid'])
- || strlen($parent_item['deny_cid'])
- || strlen($parent_item['deny_gid'])
- )
- ) {
- $private = 1;
+ if($orig_post) {
+ $str_group_allow = $orig_post['allow_gid'];
+ $str_contact_allow = $orig_post['allow_cid'];
+ $str_group_deny = $orig_post['deny_gid'];
+ $str_contact_deny = $orig_post['deny_cid'];
+ $title = $orig_post['title'];
+ $location = $orig_post['location'];
+ $coord = $orig_post['coord'];
+ $verb = $orig_post['verb'];
+ $emailcc = $orig_post['emailcc'];
+
+ $body = escape_tags(trim($_POST['body']));
+ $private = $orig_post['private'];
}
+ else {
+ $str_group_allow = perms2str($_POST['group_allow']);
+ $str_contact_allow = perms2str($_POST['contact_allow']);
+ $str_group_deny = perms2str($_POST['group_deny']);
+ $str_contact_deny = perms2str($_POST['contact_deny']);
+ $title = notags(trim($_POST['title']));
+ $location = notags(trim($_POST['location']));
+ $coord = notags(trim($_POST['coord']));
+ $verb = notags(trim($_POST['verb']));
+ $emailcc = notags(trim($_POST['emailcc']));
+
+ $body = escape_tags(trim($_POST['body']));
+ $private = ((strlen($str_group_allow) || strlen($str_contact_allow) || strlen($str_group_deny) || strlen($str_contact_deny)) ? 1 : 0);
+
+ if(($parent_item) &&
+ (($parent_item['private'])
+ || strlen($parent_item['allow_cid'])
+ || strlen($parent_item['allow_gid'])
+ || strlen($parent_item['deny_cid'])
+ || strlen($parent_item['deny_gid'])
+ )) {
+ $private = 1;
+ }
+
- $title = notags(trim($_POST['title']));
- $body = escape_tags(trim($_POST['body']));
- $location = notags(trim($_POST['location']));
- $coord = notags(trim($_POST['coord']));
- $verb = notags(trim($_POST['verb']));
- $emailcc = notags(trim($_POST['emailcc']));
-
- if(! strlen($body)) {
- notice( t('Empty post discarded.') . EOL );
- if(x($_POST,'return'))
- goaway($a->get_baseurl() . "/" . $_POST['return'] );
- killme();
+ if(! strlen($body)) {
+ notice( t('Empty post discarded.') . EOL );
+ if(x($_POST,'return'))
+ goaway($a->get_baseurl() . "/" . $_POST['return'] );
+ killme();
+ }
}
// get contact info for poster
@@ -151,7 +180,6 @@ function item_post(&$a) {
}
}
-
/**
*
* When a photo was uploaded into the message using the (profile wall) ajax
@@ -212,6 +240,8 @@ function item_post(&$a) {
if(count($tags)) {
foreach($tags as $tag) {
if(strpos($tag,'#') === 0) {
+ if(strpos($tag,'[url='))
+ continue;
$basetag = str_replace('_',' ',substr($tag,1));
$body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
if(strlen($str_tags))
@@ -220,6 +250,8 @@ function item_post(&$a) {
continue;
}
if(strpos($tag,'@') === 0) {
+ if(strpos($tag,'[url='))
+ continue;
$stat = false;
$name = substr($tag,1);
if((strpos($name,'@')) || (strpos($name,'http://'))) {
@@ -283,15 +315,13 @@ function item_post(&$a) {
$str_tags .= ',';
$str_tags .= '@[url=' . $alias . ']' . $newname . '[/url]';
}
-
}
}
}
}
-
-
$wall = 0;
+
if($post_type === 'wall' || $post_type === 'wall-comment')
$wall = 1;
@@ -342,9 +372,31 @@ function item_post(&$a) {
$datarray['parent'] = $parent;
$datarray['self'] = $self;
+ if($orig_post)
+ $datarray['edit'] = true;
call_hooks('post_local',$datarray);
+
+ if($orig_post) {
+ $r = q("UPDATE `item` SET `body` = '%s', `edited` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
+ dbesc($body),
+ dbesc(datetime_convert()),
+ intval($post_id),
+ intval($profile_uid)
+ );
+
+ proc_run('php', "include/notifier.php", 'edit_post', "$post_id");
+ if((x($_POST,'return')) && strlen($_POST['return'])) {
+ logger('return: ' . $_POST['return']);
+ goaway($a->get_baseurl() . "/" . $_POST['return'] );
+ }
+ killme();
+ }
+ else
+ $post_id = 0;
+
+
$r = q("INSERT INTO `item` (`uid`,`type`,`wall`,`gravity`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
`author-name`, `author-link`, `author-avatar`, `created`, `edited`, `changed`, `uri`, `title`, `body`, `location`, `coord`,
`tag`, `inform`, `verb`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `private` )
@@ -532,7 +584,7 @@ function item_content(&$a) {
require_once('include/security.php');
- $uid = $_SESSION['uid'];
+ $uid = local_user();
if(($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
diff --git a/mod/network.php b/mod/network.php
index 32c7216d4..81c85f0ff 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -92,6 +92,8 @@ function network_content(&$a, $update = 0) {
'$upload' => t('Upload photo'),
'$weblink' => t('Insert web link'),
'$youtube' => t('Insert YouTube video'),
+ '$video' => t('Insert Vorbis [.ogg] video'),
+ '$audio' => t('Insert Vorbis [.ogg] audio'),
'$setloc' => t('Set your location'),
'$noloc' => t('Clear browser location'),
'$wait' => t('Please wait'),
@@ -217,6 +219,7 @@ function network_content(&$a, $update = 0) {
$cmnt_tpl = load_view_file('view/comment_item.tpl');
$like_tpl = load_view_file('view/like.tpl');
+ $noshare_tpl = load_view_file('view/like_noshare.tpl');
$tpl = load_view_file('view/wall_item.tpl');
$wallwall = load_view_file('view/wallwall_item.tpl');
@@ -360,10 +363,11 @@ function network_content(&$a, $update = 0) {
$likebuttons = '';
if($item['id'] == $item['parent']) {
- $likebuttons = replace_macros($like_tpl,array(
+ $likebuttons = replace_macros((($item['private']) ? $noshare_tpl : $like_tpl),array(
'$id' => $item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
'$nolike' => t("I don't like this \x28toggle\x29"),
+ '$share' => t('Share'),
'$wait' => t('Please wait')
));
}
@@ -383,6 +387,9 @@ function network_content(&$a, $update = 0) {
));
}
+ $edpost = '';
+ if(($item['id'] == $item['parent']) && (intval($item['wall']) == 1))
+ $edpost = '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id'] . '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>';
$drop = replace_macros(load_view_file('view/wall_item_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete')));
$photo = $item['photo'];
@@ -451,6 +458,7 @@ function network_content(&$a, $update = 0) {
'$owner_photo' => $owner_photo,
'$owner_name' => $owner_name,
'$plink' => get_plink($item),
+ '$edpost' => $edpost,
'$drop' => $drop,
'$vote' => $likebuttons,
'$like' => $like,
diff --git a/mod/photos.php b/mod/photos.php
index 854c6ee14..8298d0d3f 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -310,6 +310,7 @@ foreach($_FILES AS $key => $val) {
$arr['deny_gid'] = $p[0]['deny_gid'];
$arr['last-child'] = 1;
$arr['visible'] = $visibility;
+
$arr['body'] = '[url=' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $p[0]['resource-id'] . ']'
. '[img]' . $a->get_baseurl() . '/photo/' . $p[0]['resource-id'] . '-' . $p[0]['scale'] . '.jpg' . '[/img]'
. '[/url]';
@@ -909,6 +910,32 @@ function photos_content(&$a) {
return;
}
+ $prevlink = '';
+ $nextlink = '';
+
+ $prvnxt = q("SELECT `resource-id` FROM `photo` WHERE `album` = '%s' AND `uid` = %d AND `scale` = 0
+ $sql_extra ORDER BY `created` DESC ",
+ dbesc($ph[0]['album']),
+ intval($owner_uid)
+ );
+
+ if(count($prvnxt)) {
+ for($z = 0; $z < count($prvnxt); $z++) {
+ if($prvnxt[$z]['resource-id'] == $ph[0]['resource-id']) {
+ $prv = $z - 1;
+ $nxt = $z + 1;
+ if($prv < 0)
+ $prv = count($prvnxt) - 1;
+ if($nxt >= count($prvnxt))
+ $nxt = 0;
+ break;
+ }
+ }
+ $prevlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$prv]['resource-id'] ;
+ $nextlink = $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $prvnxt[$nxt]['resource-id'] ;
+ }
+
+
if(count($ph) == 1)
$hires = $lores = $ph[0];
if(count($ph) > 1) {
@@ -938,11 +965,18 @@ function photos_content(&$a) {
$o .= '</div>';
}
+ if($prevlink)
+ $o .= '<div id="photo-prev-link"><a href="' . $prevlink .'">' . t('<< Prev') . '</a></div>' ;
- $o .= '<a href="' . $a->get_baseurl() . '/photo/'
+ $o .= '<div id="photo-photo"><a href="' . $a->get_baseurl() . '/photo/'
. $hires['resource-id'] . '-' . $hires['scale'] . '.jpg" title="'
. t('View Full Size') . '" ><img src="' . $a->get_baseurl() . '/photo/'
- . $lores['resource-id'] . '-' . $lores['scale'] . '.jpg' . '" /></a>';
+ . $lores['resource-id'] . '-' . $lores['scale'] . '.jpg' . '" /></a></div>';
+
+ if($nextlink)
+ $o .= '<div id="photo-next-link"><a href="' . $nextlink .'">' . t('Next >>') . '</a></div>';
+
+ $o .= '<div id="photo-photo-end"></div>';
// Do we have an item for this photo?
@@ -1040,7 +1074,7 @@ function photos_content(&$a) {
$tpl = load_view_file('view/photo_item.tpl');
$return_url = $a->cmd;
- $like_tpl = load_view_file('view/like.tpl');
+ $like_tpl = load_view_file('view/lik_noshare.tpl');
$likebuttons = '';
@@ -1049,6 +1083,7 @@ function photos_content(&$a) {
'$id' => $item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
'$nolike' => t("I don't like this \x28toggle\x29"),
+ '$share' => t('Share'),
'$wait' => t('Please wait')
));
}
diff --git a/mod/profile.php b/mod/profile.php
index 5615573b9..1053e4a1e 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -28,6 +28,11 @@ function profile_init(&$a) {
$a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $delegate . '" />' . "\r\n";
}
+ $keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : '');
+ $keywords = str_replace(array(',',' ',',,'),array(' ',',',','),$keywords);
+ if(strlen($keywords))
+ $a->page['htmlhead'] .= '<meta name="keywords" content="' . $keywords . '" />' . "\r\n" ;
+
$a->page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . (($a->profile['net-publish']) ? 'true' : 'false') . '" />' . "\r\n" ;
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/dfrn_poll/' . $which .'" />' . "\r\n" ;
$uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : ''));
@@ -152,6 +157,8 @@ function profile_content(&$a, $update = 0) {
'$upload' => t('Upload photo'),
'$weblink' => t('Insert web link'),
'$youtube' => t('Insert YouTube video'),
+ '$video' => t('Insert Vorbis [.ogg] video'),
+ '$audio' => t('Insert Vorbis [.ogg] audio'),
'$setloc' => t('Set your location'),
'$noloc' => t('Clear browser location'),
'$wait' => t('Please wait'),
@@ -260,6 +267,7 @@ function profile_content(&$a, $update = 0) {
$cmnt_tpl = load_view_file('view/comment_item.tpl');
$like_tpl = load_view_file('view/like.tpl');
+ $noshare_tpl = load_view_file('view/like_noshare.tpl');
$tpl = load_view_file('view/wall_item.tpl');
@@ -302,10 +310,11 @@ function profile_content(&$a, $update = 0) {
if(can_write_wall($a,$a->profile['profile_uid'])) {
if($item['id'] == $item['parent']) {
- $likebuttons = replace_macros($like_tpl,array(
+ $likebuttons = replace_macros((($item['private']) ? $noshare_tpl : $like_tpl),array(
'$id' => $item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
'$nolike' => t("I don't like this \x28toggle\x29"),
+ '$share' => t('Share'),
'$wait' => t('Please wait')
));
}
@@ -339,6 +348,12 @@ function profile_content(&$a, $update = 0) {
else
$sparkle = '';
+
+ $edpost = '';
+ if((local_user()) && ($a->profile['profile_uid'] == local_user()) && ($item['id'] == $item['parent']) && (intval($item['wall']) == 1))
+ $edpost = '<a class="editpost" href="' . $a->get_baseurl() . '/editpost/' . $item['id'] . '" title="' . t('Edit') . '"><img src="images/pencil.gif" /></a>';
+
+
// We would prefer to use our own avatar link for this item because the one in the author-avatar might reference a
// remote site (which could be down). We will use author-avatar if we haven't got something stored locally.
// We use this same logic block in mod/network.php to determine it this is a third party post and we don't have any
@@ -391,6 +406,7 @@ function profile_content(&$a, $update = 0) {
'$location' => $location,
'$indent' => $indent,
'$plink' => get_plink($item),
+ '$edpost' => $edpost,
'$drop' => $drop,
'$like' => $like,
'$vote' => $likebuttons,
diff --git a/mod/profile_photo.php b/mod/profile_photo.php
index 748adc438..68c05625b 100644
--- a/mod/profile_photo.php
+++ b/mod/profile_photo.php
@@ -87,7 +87,7 @@ function profile_photo_post(&$a) {
);
// Update global directory in background
- $url = $_SESSION['my_url'];
+ $url = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
if($url && strlen(get_config('system','directory_submit_url')))
proc_run('php',"include/directory.php","$url");
}
diff --git a/mod/profiles.php b/mod/profiles.php
index 409999a3e..434f58adf 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -55,7 +55,8 @@ function profiles_post(&$a) {
$region = notags(trim($_POST['region']));
$postal_code = notags(trim($_POST['postal_code']));
$country_name = notags(trim($_POST['country_name']));
- $keywords = notags(trim($_POST['keywords']));
+ $pub_keywords = notags(trim($_POST['pub_keywords']));
+ $prv_keywords = notags(trim($_POST['prv_keywords']));
$marital = notags(trim($_POST['marital']));
if($marital != $orig[0]['marital'])
$maritalchanged = true;
@@ -147,7 +148,8 @@ function profiles_post(&$a) {
`homepage` = '%s',
`politic` = '%s',
`religion` = '%s',
- `keywords` = '%s',
+ `pub_keywords` = '%s',
+ `prv_keywords` = '%s',
`about` = '%s',
`interest` = '%s',
`contact` = '%s',
@@ -176,7 +178,8 @@ function profiles_post(&$a) {
dbesc($homepage),
dbesc($politic),
dbesc($religion),
- dbesc($keywords),
+ dbesc($pub_keywords),
+ dbesc($prv_keywords),
dbesc($about),
dbesc($interest),
dbesc($contact),
@@ -383,7 +386,8 @@ function profiles_content(&$a) {
'$homepage' => $r[0]['homepage'],
'$politic' => $r[0]['politic'],
'$religion' => $r[0]['religion'],
- '$keywords' => $r[0]['keywords'],
+ '$pub_keywords' => $r[0]['pub_keywords'],
+ '$prv_keywords' => $r[0]['prv_keywords'],
'$music' => $r[0]['music'],
'$book' => $r[0]['book'],
'$tv' => $r[0]['tv'],
diff --git a/mod/register.php b/mod/register.php
index 3530ef588..95e9d581f 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -401,7 +401,9 @@ 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.');
+ // I set this and got even more fake names than before...
+
+ $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" />';
diff --git a/mod/search.php b/mod/search.php
index 561bb6c62..db7279fb5 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -51,7 +51,7 @@ function search_content(&$a) {
$a->set_pager_total($r[0]['total']);
if(! $r[0]['total']) {
- notice('No results.');
+ notice( t('No results.') . EOL);
return $o;
}
@@ -134,13 +134,6 @@ function search_content(&$a) {
}
}
-
- if(! $r[0]['total']) {
- notice('No results.');
- return $o;
- }
-
-
$o .= paginate($a);
return $o;
diff --git a/mod/settings.php b/mod/settings.php
index ebe07612e..85029b3d7 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -63,6 +63,7 @@ function settings_post(&$a) {
$defloc = ((x($_POST,'defloc')) ? notags(trim($_POST['defloc'])) : '');
$openid = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url'])) : '');
$maxreq = ((x($_POST,'maxreq')) ? intval($_POST['maxreq']) : 0);
+ $expire = ((x($_POST,'expire')) ? intval($_POST['expire']) : 0);
$allow_location = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
$publish = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0);
@@ -139,7 +140,7 @@ function settings_post(&$a) {
$openidserver = '';
}
- $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `openidserver` = '%s' WHERE `uid` = %d LIMIT 1",
+ $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `expire` = %d, `openidserver` = '%s' WHERE `uid` = %d LIMIT 1",
dbesc($username),
dbesc($email),
dbesc($openid),
@@ -154,6 +155,7 @@ function settings_post(&$a) {
intval($allow_location),
dbesc($theme),
intval($maxreq),
+ intval($expire),
dbesc($openidserver),
intval(local_user())
);
@@ -238,6 +240,7 @@ function settings_content(&$a) {
$defloc = $a->user['default-location'];
$openid = $a->user['openid'];
$maxreq = $a->user['maxreq'];
+ $expire = ((intval($a->user['expire'])) ? $a->user['expire'] : '');
if(! strlen($a->user['timezone']))
$timezone = date_default_timezone_get();
@@ -358,6 +361,7 @@ function settings_content(&$a) {
'$sel_notify4' => (($notify & NOTIFY_COMMENT) ? ' checked="checked" ' : ''),
'$sel_notify5' => (($notify & NOTIFY_MAIL) ? ' checked="checked" ' : ''),
'$maxreq' => $maxreq,
+ '$expire' => $expire,
'$theme' => $theme_selector,
'$pagetype' => $pagetype
));
diff --git a/mod/share.php b/mod/share.php
new file mode 100644
index 000000000..8a8229e8a
--- /dev/null
+++ b/mod/share.php
@@ -0,0 +1,23 @@
+<?php
+
+require_once('bbcode.php');
+
+function share_init(&$a) {
+
+ $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
+ if((! $post_id) || (! local_user()))
+ killme();
+
+ $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
+ intval($post_id)
+ );
+ if(! count($r) || $r[0]['private'])
+ killme();
+
+ $o = '';
+
+ $o .= '&#x2672; <a href="' . $r[0]['author-link'] . '">' . $r[0]['author-name'] . '</a><br />';
+ $o .= prepare_body($r[0]);
+ echo $o . '<br />';
+ killme();
+} \ No newline at end of file