1
1
Fork 0

sort out some "like" issues

This commit is contained in:
friendica 2012-06-23 21:11:18 -07:00
parent 098c74a12a
commit 1574396d04
4 changed files with 73 additions and 78 deletions

View file

@ -10,7 +10,7 @@ require_once('include/nav.php');
require_once('include/cache.php'); require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '3.0.1382' ); define ( 'FRIENDICA_VERSION', '3.0.1383' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1149 ); define ( 'DB_UPDATE_VERSION', 1149 );

View file

@ -427,8 +427,8 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
// We've already parsed out like/dislike for special treatment. We can ignore them now // We've already parsed out like/dislike for special treatment. We can ignore them now
if(((activity_match($item['verb'],ACTIVITY_LIKE)) if(((activity_match($item['verb'],ACTIVITY_LIKE))
|| (activity_match($item['verb'],ACTIVITY_DISLIKE))) || (activity_match($item['verb'],ACTIVITY_DISLIKE))))
&& ($item['id'] != $item['parent'])) // && ($item['id'] != $item['parent']))
continue; continue;
$toplevelpost = (($item['id'] == $item['parent']) ? true : false); $toplevelpost = (($item['id'] == $item['parent']) ? true : false);
@ -549,13 +549,13 @@ function conversation(&$a, $items, $mode, $update, $preview = false) {
$shareable = ((($profile_owner == local_user()) && ((! $item['private']) || $item['network'] === NETWORK_FEED)) ? true : false); $shareable = ((($profile_owner == local_user()) && ((! $item['private']) || $item['network'] === NETWORK_FEED)) ? true : false);
if($page_writeable) { if($page_writeable) {
if($toplevelpost) { /* if($toplevelpost) { */
$likebuttons = array( $likebuttons = array(
'like' => array( t("I like this \x28toggle\x29"), t("like")), 'like' => array( t("I like this \x28toggle\x29"), t("like")),
'dislike' => array( t("I don't like this \x28toggle\x29"), t("dislike")), 'dislike' => array( t("I don't like this \x28toggle\x29"), t("dislike")),
); );
if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share')); if ($shareable) $likebuttons['share'] = array( t('Share this'), t('share'));
} /* } */
$qc = $qcomment = null; $qc = $qcomment = null;

View file

@ -1726,10 +1726,12 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
$datarray['type'] = 'activity'; $datarray['type'] = 'activity';
$datarray['gravity'] = GRAVITY_LIKE; $datarray['gravity'] = GRAVITY_LIKE;
// only one like or dislike per person // only one like or dislike per person
$r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1", $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent-uri` = '%s' OR `thr_parent` = '%s') limit 1",
intval($datarray['uid']), intval($datarray['uid']),
intval($datarray['contact-id']), intval($datarray['contact-id']),
dbesc($datarray['verb']) dbesc($datarray['verb']),
dbesc($parent_uri),
dbesc($parent_uri)
); );
if($r && count($r)) if($r && count($r))
continue; continue;
@ -2363,7 +2365,7 @@ function local_delivery($importer,$data) {
$datarray['gravity'] = GRAVITY_LIKE; $datarray['gravity'] = GRAVITY_LIKE;
$datarray['last-child'] = 0; $datarray['last-child'] = 0;
// only one like or dislike per person // only one like or dislike per person
$r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and (`thr-parent` = '%s' or `parent-uri` = '%s') and deleted = 0 limit 1", $r = q("select id from item where uid = %d and `contact-id` = %d and verb = '%s' and (`thr-parent` = '%s' or `parent-uri` = '%s') and deleted = 0 limit 1",
intval($datarray['uid']), intval($datarray['uid']),
intval($datarray['contact-id']), intval($datarray['contact-id']),
dbesc($datarray['verb']), dbesc($datarray['verb']),
@ -2537,10 +2539,12 @@ function local_delivery($importer,$data) {
$datarray['type'] = 'activity'; $datarray['type'] = 'activity';
$datarray['gravity'] = GRAVITY_LIKE; $datarray['gravity'] = GRAVITY_LIKE;
// only one like or dislike per person // only one like or dislike per person
$r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1", $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent-uri` = '%s' OR `thr-parent` = '%s') limit 1",
intval($datarray['uid']), intval($datarray['uid']),
intval($datarray['contact-id']), intval($datarray['contact-id']),
dbesc($datarray['verb']) dbesc($datarray['verb']),
dbesc($parent_uri),
dbesc($parent_uri)
); );
if($r && count($r)) if($r && count($r))
continue; continue;

View file

@ -6,9 +6,9 @@
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 3.0.1382\n" "Project-Id-Version: 3.0.1383\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-06-22 10:00-0700\n" "POT-Creation-Date: 2012-06-23 10:00-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -55,7 +55,7 @@ msgstr ""
#: ../../mod/profiles.php:385 ../../mod/delegate.php:6 #: ../../mod/profiles.php:385 ../../mod/delegate.php:6
#: ../../mod/suggest.php:28 ../../mod/invite.php:13 ../../mod/invite.php:81 #: ../../mod/suggest.php:28 ../../mod/invite.php:13 ../../mod/invite.php:81
#: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:507 #: ../../mod/dfrn_confirm.php:53 ../../addon/facebook/facebook.php:507
#: ../../addon/dav/layout.fnk.php:353 ../../include/items.php:3401 #: ../../addon/dav/layout.fnk.php:353 ../../include/items.php:3407
#: ../../index.php:309 #: ../../index.php:309
msgid "Permission denied." msgid "Permission denied."
msgstr "" msgstr ""
@ -278,7 +278,7 @@ msgid "Description:"
msgstr "" msgstr ""
#: ../../mod/events.php:423 ../../include/event.php:37 #: ../../mod/events.php:423 ../../include/event.php:37
#: ../../include/bb2diaspora.php:265 ../../boot.php:1126 #: ../../include/bb2diaspora.php:311 ../../boot.php:1126
msgid "Location:" msgid "Location:"
msgstr "" msgstr ""
@ -546,14 +546,14 @@ msgstr ""
msgid "I don't like this (toggle)" msgid "I don't like this (toggle)"
msgstr "" msgstr ""
#: ../../mod/photos.php:1290 ../../include/conversation.php:989 #: ../../mod/photos.php:1290 ../../include/conversation.php:993
msgid "Share" msgid "Share"
msgstr "" msgstr ""
#: ../../mod/photos.php:1291 ../../mod/editpost.php:104 #: ../../mod/photos.php:1291 ../../mod/editpost.php:104
#: ../../mod/wallmessage.php:145 ../../mod/message.php:215 #: ../../mod/wallmessage.php:145 ../../mod/message.php:215
#: ../../mod/message.php:411 ../../include/conversation.php:371 #: ../../mod/message.php:411 ../../include/conversation.php:371
#: ../../include/conversation.php:731 ../../include/conversation.php:1008 #: ../../include/conversation.php:731 ../../include/conversation.php:1012
msgid "Please wait" msgid "Please wait"
msgstr "" msgstr ""
@ -569,7 +569,7 @@ msgid "Comment"
msgstr "" msgstr ""
#: ../../mod/photos.php:1311 ../../mod/editpost.php:125 #: ../../mod/photos.php:1311 ../../mod/editpost.php:125
#: ../../include/conversation.php:589 ../../include/conversation.php:1026 #: ../../include/conversation.php:589 ../../include/conversation.php:1030
msgid "Preview" msgid "Preview"
msgstr "" msgstr ""
@ -640,7 +640,7 @@ msgstr ""
msgid "Edit post" msgid "Edit post"
msgstr "" msgstr ""
#: ../../mod/editpost.php:80 ../../include/conversation.php:975 #: ../../mod/editpost.php:80 ../../include/conversation.php:979
msgid "Post to Email" msgid "Post to Email"
msgstr "" msgstr ""
@ -651,17 +651,17 @@ msgstr ""
#: ../../mod/editpost.php:96 ../../mod/wallmessage.php:143 #: ../../mod/editpost.php:96 ../../mod/wallmessage.php:143
#: ../../mod/message.php:213 ../../mod/message.php:408 #: ../../mod/message.php:213 ../../mod/message.php:408
#: ../../include/conversation.php:990 #: ../../include/conversation.php:994
msgid "Upload photo" msgid "Upload photo"
msgstr "" msgstr ""
#: ../../mod/editpost.php:97 ../../include/conversation.php:992 #: ../../mod/editpost.php:97 ../../include/conversation.php:996
msgid "Attach file" msgid "Attach file"
msgstr "" msgstr ""
#: ../../mod/editpost.php:98 ../../mod/wallmessage.php:144 #: ../../mod/editpost.php:98 ../../mod/wallmessage.php:144
#: ../../mod/message.php:214 ../../mod/message.php:409 #: ../../mod/message.php:214 ../../mod/message.php:409
#: ../../include/conversation.php:994 #: ../../include/conversation.php:998
msgid "Insert web link" msgid "Insert web link"
msgstr "" msgstr ""
@ -677,35 +677,35 @@ msgstr ""
msgid "Insert Vorbis [.ogg] audio" msgid "Insert Vorbis [.ogg] audio"
msgstr "" msgstr ""
#: ../../mod/editpost.php:102 ../../include/conversation.php:1000 #: ../../mod/editpost.php:102 ../../include/conversation.php:1004
msgid "Set your location" msgid "Set your location"
msgstr "" msgstr ""
#: ../../mod/editpost.php:103 ../../include/conversation.php:1002 #: ../../mod/editpost.php:103 ../../include/conversation.php:1006
msgid "Clear browser location" msgid "Clear browser location"
msgstr "" msgstr ""
#: ../../mod/editpost.php:105 ../../include/conversation.php:1009 #: ../../mod/editpost.php:105 ../../include/conversation.php:1013
msgid "Permission settings" msgid "Permission settings"
msgstr "" msgstr ""
#: ../../mod/editpost.php:113 ../../include/conversation.php:1018 #: ../../mod/editpost.php:113 ../../include/conversation.php:1022
msgid "CC: email addresses" msgid "CC: email addresses"
msgstr "" msgstr ""
#: ../../mod/editpost.php:114 ../../include/conversation.php:1019 #: ../../mod/editpost.php:114 ../../include/conversation.php:1023
msgid "Public post" msgid "Public post"
msgstr "" msgstr ""
#: ../../mod/editpost.php:117 ../../include/conversation.php:1005 #: ../../mod/editpost.php:117 ../../include/conversation.php:1009
msgid "Set title" msgid "Set title"
msgstr "" msgstr ""
#: ../../mod/editpost.php:119 ../../include/conversation.php:1007 #: ../../mod/editpost.php:119 ../../include/conversation.php:1011
msgid "Categories (comma-separated list)" msgid "Categories (comma-separated list)"
msgstr "" msgstr ""
#: ../../mod/editpost.php:120 ../../include/conversation.php:1021 #: ../../mod/editpost.php:120 ../../include/conversation.php:1025
msgid "Example: bob@example.com, mary@example.com" msgid "Example: bob@example.com, mary@example.com"
msgstr "" msgstr ""
@ -826,7 +826,7 @@ msgstr ""
msgid "Confirm" msgid "Confirm"
msgstr "" msgstr ""
#: ../../mod/dfrn_request.php:715 ../../include/items.php:2797 #: ../../mod/dfrn_request.php:715 ../../include/items.php:2801
msgid "[Name Withheld]" msgid "[Name Withheld]"
msgstr "" msgstr ""
@ -1152,7 +1152,7 @@ msgid ""
msgstr "" msgstr ""
#: ../../mod/localtime.php:12 ../../include/event.php:11 #: ../../mod/localtime.php:12 ../../include/event.php:11
#: ../../include/bb2diaspora.php:243 #: ../../include/bb2diaspora.php:289
msgid "l F d, Y \\@ g:i A" msgid "l F d, Y \\@ g:i A"
msgstr "" msgstr ""
@ -1728,7 +1728,7 @@ msgstr ""
#: ../../addon/facebook/facebook.php:692 #: ../../addon/facebook/facebook.php:692
#: ../../addon/facebook/facebook.php:1182 #: ../../addon/facebook/facebook.php:1182
#: ../../addon/public_server/public_server.php:62 #: ../../addon/public_server/public_server.php:62
#: ../../addon/testdrive/testdrive.php:67 ../../include/items.php:2806 #: ../../addon/testdrive/testdrive.php:67 ../../include/items.php:2810
#: ../../boot.php:720 #: ../../boot.php:720
msgid "Administrator" msgid "Administrator"
msgstr "" msgstr ""
@ -2455,7 +2455,7 @@ msgid "No recipient."
msgstr "" msgstr ""
#: ../../mod/wallmessage.php:124 ../../mod/message.php:172 #: ../../mod/wallmessage.php:124 ../../mod/message.php:172
#: ../../include/conversation.php:943 #: ../../include/conversation.php:947
msgid "Please enter a link URL:" msgid "Please enter a link URL:"
msgstr "" msgstr ""
@ -2777,7 +2777,7 @@ msgstr ""
msgid "People Search" msgid "People Search"
msgstr "" msgstr ""
#: ../../mod/like.php:185 ../../mod/like.php:259 ../../mod/tagger.php:70 #: ../../mod/like.php:185 ../../mod/like.php:260 ../../mod/tagger.php:70
#: ../../addon/facebook/facebook.php:1576 #: ../../addon/facebook/facebook.php:1576
#: ../../addon/communityhome/communityhome.php:158 #: ../../addon/communityhome/communityhome.php:158
#: ../../addon/communityhome/communityhome.php:167 #: ../../addon/communityhome/communityhome.php:167
@ -2803,7 +2803,7 @@ msgstr ""
#: ../../mod/notice.php:15 ../../mod/viewsrc.php:15 ../../mod/admin.php:159 #: ../../mod/notice.php:15 ../../mod/viewsrc.php:15 ../../mod/admin.php:159
#: ../../mod/admin.php:700 ../../mod/admin.php:899 ../../mod/display.php:37 #: ../../mod/admin.php:700 ../../mod/admin.php:899 ../../mod/display.php:37
#: ../../mod/display.php:142 ../../include/items.php:3248 #: ../../mod/display.php:142 ../../include/items.php:3254
msgid "Item not found." msgid "Item not found."
msgstr "" msgstr ""
@ -4010,7 +4010,7 @@ msgstr ""
msgid "Edit visibility" msgid "Edit visibility"
msgstr "" msgstr ""
#: ../../mod/filer.php:29 ../../include/conversation.php:947 #: ../../mod/filer.php:29 ../../include/conversation.php:951
msgid "Save to Folder:" msgid "Save to Folder:"
msgstr "" msgstr ""
@ -6458,11 +6458,11 @@ msgstr ""
msgid "Ask me" msgid "Ask me"
msgstr "" msgstr ""
#: ../../include/event.php:17 ../../include/bb2diaspora.php:249 #: ../../include/event.php:17 ../../include/bb2diaspora.php:295
msgid "Starts:" msgid "Starts:"
msgstr "" msgstr ""
#: ../../include/event.php:27 ../../include/bb2diaspora.php:257 #: ../../include/event.php:27 ../../include/bb2diaspora.php:303
msgid "Finishes:" msgid "Finishes:"
msgstr "" msgstr ""
@ -6634,7 +6634,7 @@ msgstr ""
msgid "Sharing notification from Diaspora network" msgid "Sharing notification from Diaspora network"
msgstr "" msgstr ""
#: ../../include/diaspora.php:2074 #: ../../include/diaspora.php:2084
msgid "Attachments:" msgid "Attachments:"
msgstr "" msgstr ""
@ -6642,11 +6642,11 @@ msgstr ""
msgid "view full size" msgid "view full size"
msgstr "" msgstr ""
#: ../../include/oembed.php:134 #: ../../include/oembed.php:135
msgid "Embedded content" msgid "Embedded content"
msgstr "" msgstr ""
#: ../../include/oembed.php:143 #: ../../include/oembed.php:144
msgid "Embedding disabled" msgid "Embedding disabled"
msgstr "" msgstr ""
@ -6943,11 +6943,11 @@ msgstr ""
msgid "From: " msgid "From: "
msgstr "" msgstr ""
#: ../../include/bbcode.php:210 ../../include/bbcode.php:230 #: ../../include/bbcode.php:214 ../../include/bbcode.php:234
msgid "$1 wrote:" msgid "$1 wrote:"
msgstr "" msgstr ""
#: ../../include/bbcode.php:245 ../../include/bbcode.php:314 #: ../../include/bbcode.php:249 ../../include/bbcode.php:322
msgid "Image/photo" msgid "Image/photo"
msgstr "" msgstr ""
@ -7188,27 +7188,18 @@ msgstr ""
msgid "following" msgid "following"
msgstr "" msgstr ""
#: ../../include/items.php:2804 #: ../../include/items.php:2808
msgid "A new person is sharing with you at " msgid "A new person is sharing with you at "
msgstr "" msgstr ""
#: ../../include/items.php:2804 #: ../../include/items.php:2808
msgid "You have a new follower at " msgid "You have a new follower at "
msgstr "" msgstr ""
#: ../../include/items.php:3466 #: ../../include/items.php:3472
msgid "Archives" msgid "Archives"
msgstr "" msgstr ""
#: ../../include/bb2diaspora.php:102 ../../include/bb2diaspora.php:112
#: ../../include/bb2diaspora.php:113
msgid "image/photo"
msgstr ""
#: ../../include/bb2diaspora.php:102
msgid "link"
msgstr ""
#: ../../include/user.php:38 #: ../../include/user.php:38
msgid "An invitation is required." msgid "An invitation is required."
msgstr "" msgstr ""
@ -7449,102 +7440,102 @@ msgstr ""
msgid "Delete Selected Items" msgid "Delete Selected Items"
msgstr "" msgstr ""
#: ../../include/conversation.php:901 #: ../../include/conversation.php:905
#, php-format #, php-format
msgid "%s likes this." msgid "%s likes this."
msgstr "" msgstr ""
#: ../../include/conversation.php:901 #: ../../include/conversation.php:905
#, php-format #, php-format
msgid "%s doesn't like this." msgid "%s doesn't like this."
msgstr "" msgstr ""
#: ../../include/conversation.php:905 #: ../../include/conversation.php:909
#, php-format #, php-format
msgid "<span %1$s>%2$d people</span> like this." msgid "<span %1$s>%2$d people</span> like this."
msgstr "" msgstr ""
#: ../../include/conversation.php:907 #: ../../include/conversation.php:911
#, php-format #, php-format
msgid "<span %1$s>%2$d people</span> don't like this." msgid "<span %1$s>%2$d people</span> don't like this."
msgstr "" msgstr ""
#: ../../include/conversation.php:913 #: ../../include/conversation.php:917
msgid "and" msgid "and"
msgstr "" msgstr ""
#: ../../include/conversation.php:916 #: ../../include/conversation.php:920
#, php-format #, php-format
msgid ", and %d other people" msgid ", and %d other people"
msgstr "" msgstr ""
#: ../../include/conversation.php:917 #: ../../include/conversation.php:921
#, php-format #, php-format
msgid "%s like this." msgid "%s like this."
msgstr "" msgstr ""
#: ../../include/conversation.php:917 #: ../../include/conversation.php:921
#, php-format #, php-format
msgid "%s don't like this." msgid "%s don't like this."
msgstr "" msgstr ""
#: ../../include/conversation.php:942 #: ../../include/conversation.php:946
msgid "Visible to <strong>everybody</strong>" msgid "Visible to <strong>everybody</strong>"
msgstr "" msgstr ""
#: ../../include/conversation.php:944 #: ../../include/conversation.php:948
msgid "Please enter a video link/URL:" msgid "Please enter a video link/URL:"
msgstr "" msgstr ""
#: ../../include/conversation.php:945 #: ../../include/conversation.php:949
msgid "Please enter an audio link/URL:" msgid "Please enter an audio link/URL:"
msgstr "" msgstr ""
#: ../../include/conversation.php:946 #: ../../include/conversation.php:950
msgid "Tag term:" msgid "Tag term:"
msgstr "" msgstr ""
#: ../../include/conversation.php:948 #: ../../include/conversation.php:952
msgid "Where are you right now?" msgid "Where are you right now?"
msgstr "" msgstr ""
#: ../../include/conversation.php:991 #: ../../include/conversation.php:995
msgid "upload photo" msgid "upload photo"
msgstr "" msgstr ""
#: ../../include/conversation.php:993 #: ../../include/conversation.php:997
msgid "attach file" msgid "attach file"
msgstr "" msgstr ""
#: ../../include/conversation.php:995 #: ../../include/conversation.php:999
msgid "web link" msgid "web link"
msgstr "" msgstr ""
#: ../../include/conversation.php:996 #: ../../include/conversation.php:1000
msgid "Insert video link" msgid "Insert video link"
msgstr "" msgstr ""
#: ../../include/conversation.php:997 #: ../../include/conversation.php:1001
msgid "video link" msgid "video link"
msgstr "" msgstr ""
#: ../../include/conversation.php:998 #: ../../include/conversation.php:1002
msgid "Insert audio link" msgid "Insert audio link"
msgstr "" msgstr ""
#: ../../include/conversation.php:999 #: ../../include/conversation.php:1003
msgid "audio link" msgid "audio link"
msgstr "" msgstr ""
#: ../../include/conversation.php:1001 #: ../../include/conversation.php:1005
msgid "set location" msgid "set location"
msgstr "" msgstr ""
#: ../../include/conversation.php:1003 #: ../../include/conversation.php:1007
msgid "clear location" msgid "clear location"
msgstr "" msgstr ""
#: ../../include/conversation.php:1010 #: ../../include/conversation.php:1014
msgid "permissions" msgid "permissions"
msgstr "" msgstr ""