diff --git a/images/icons/10/link.png b/images/icons/10/link.png new file mode 100644 index 000000000..0619f4511 Binary files /dev/null and b/images/icons/10/link.png differ diff --git a/images/icons/16/link.png b/images/icons/16/link.png new file mode 100644 index 000000000..afec9cc30 Binary files /dev/null and b/images/icons/16/link.png differ diff --git a/images/icons/22/link.png b/images/icons/22/link.png new file mode 100644 index 000000000..e819ad3ac Binary files /dev/null and b/images/icons/22/link.png differ diff --git a/images/icons/48/link.png b/images/icons/48/link.png new file mode 100644 index 000000000..b32eec529 Binary files /dev/null and b/images/icons/48/link.png differ diff --git a/images/icons/Makefile b/images/icons/Makefile new file mode 100644 index 000000000..39428d154 --- /dev/null +++ b/images/icons/Makefile @@ -0,0 +1,31 @@ + +IMAGES=add.png edit.png gear.png info.png menu.png \ + notify_off.png star.png delete.png feed.png group.png \ + lock.png notice.png notify_on.png user.png link.png + +DESTS=10/ 16/ 22/ 48/ \ + $(addprefix 10/, $(IMAGES)) \ + $(addprefix 16/, $(IMAGES)) \ + $(addprefix 22/, $(IMAGES)) \ + $(addprefix 48/, $(IMAGES)) + +all: $(DESTS) + +%/: + mkdir $@ + +10/%.png: %.png + convert $< -resize 10x10 $@ + +16/%.png: %.png + convert $< -resize 16x16 $@ + +22/%.png: %.png + convert $< -resize 22x22 $@ + +48/%.png: %.png + convert $< -resize 48x48 $@ + + + + diff --git a/images/icons/link.png b/images/icons/link.png new file mode 100644 index 000000000..743bdf0f9 Binary files /dev/null and b/images/icons/link.png differ diff --git a/images/icons/make.sh b/images/icons/make.sh deleted file mode 100644 index 348117411..000000000 --- a/images/icons/make.sh +++ /dev/null @@ -1,14 +0,0 @@ -sizes="10 16 22 48" - -for s in $sizes -do - echo "=[ ${s}x${s} ]====" - [ -d $s ] || mkdir $s - for f in *.png - do - convert $f -resize ${s}x${s} $s/$f - echo -n "#" - done - echo -done -echo "Ok." diff --git a/include/conversation.php b/include/conversation.php index acbbc9bd5..ebe582f4c 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -134,16 +134,17 @@ function conversation(&$a, $items, $mode, $update) { $cmnt_tpl = get_markup_template('comment_item.tpl'); - $like_tpl = get_markup_template('like.tpl'); - $noshare_tpl = get_markup_template('like_noshare.tpl'); $tpl = get_markup_template('wall_item.tpl'); $wallwall = get_markup_template('wallwall_item.tpl'); - $droptpl = get_markup_template('wall_item_drop.tpl'); - $fakedrop = get_markup_template('wall_fake_drop.tpl'); $alike = array(); $dlike = array(); + + // array with html for each thread (parent+comments) + $treads = array(); + $treadsid = -1; + if(count($items)) { if($mode === 'network-new' || $mode === 'search' || $mode === 'community') { @@ -154,6 +155,7 @@ function conversation(&$a, $items, $mode, $update) { $tpl = get_markup_template('search_item.tpl'); foreach($items as $item) { + $treadsid++; $comment = ''; $owner_url = ''; @@ -195,21 +197,30 @@ function conversation(&$a, $items, $mode, $update) { $location = '' . $coord . ''; } - $drop = ''; localize_item($item); if($mode === 'network-new') - $t = $droptpl; + $dropping = true; else - $t = $fakedrop; + $dropping = false; - $drop = replace_macros($t,array('$id' => $item['id'])); - $lock = '
'; - $star = ''; + + $drop = array( + 'dropping' => $dropping, + 'select' => t('Select'), + 'delete' => t('Delete'), + ); + + $star = false; + $isstarred = "unstarred"; + + $lock = false; + $likebuttons = false; + $shareable = false; $body = prepare_body($item,true); - $o .= replace_macros($tpl,array( + $treads[$treadsid] .= replace_macros($tpl,array( '$id' => $item['item_id'], '$linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])), '$profile_url' => $profile_link, @@ -221,346 +232,349 @@ function conversation(&$a, $items, $mode, $update) { '$title' => template_escape($item['title']), '$body' => template_escape($body), '$ago' => (($item['app']) ? sprintf( t('%s from %s'),relative_date($item['created']),$item['app']) : relative_date($item['created'])), + '$lock' => $lock, '$location' => template_escape($location), '$indent' => '', + '$owner_name' => template_escape($owner_name), '$owner_url' => $owner_url, '$owner_photo' => $owner_photo, - '$owner_name' => template_escape($owner_name), + '$plink' => get_plink($item), + '$edpost' => false, + '$isstarred' => $isstarred, '$star' => $star, '$drop' => $drop, - '$conv' => '' . t('View in context') . '' + '$vote' => $likebuttons, + '$like' => '', + '$dislike' => '', + '$comment' => '', + '$conv' => array('href'=> $a->get_baseurl() . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context')), + '$wait' => t('Please wait'), )); } - return $o; } + else + { + // Normal View + // Figure out how many comments each parent has + // (Comments all have gravity of 6) + // Store the result in the $comments array - - // Normal View - - - // Figure out how many comments each parent has - // (Comments all have gravity of 6) - // Store the result in the $comments array - - $comments = array(); - foreach($items as $item) { - if((intval($item['gravity']) == 6) && ($item['id'] != $item['parent'])) { - if(! x($comments,$item['parent'])) - $comments[$item['parent']] = 1; - else - $comments[$item['parent']] += 1; + $comments = array(); + foreach($items as $item) { + if((intval($item['gravity']) == 6) && ($item['id'] != $item['parent'])) { + if(! x($comments,$item['parent'])) + $comments[$item['parent']] = 1; + else + $comments[$item['parent']] += 1; + } } - } - // map all the like/dislike activities for each parent item - // Store these in the $alike and $dlike arrays + // map all the like/dislike activities for each parent item + // Store these in the $alike and $dlike arrays - foreach($items as $item) { - like_puller($a,$item,$alike,'like'); - like_puller($a,$item,$dlike,'dislike'); - } + foreach($items as $item) { + like_puller($a,$item,$alike,'like'); + like_puller($a,$item,$dlike,'dislike'); + } - $comments_collapsed = false; - $blowhard = 0; - $blowhard_count = 0; + $comments_collapsed = false; + $blowhard = 0; + $blowhard_count = 0; - // array with html for each thread (parent+comments) - $treads = array(); - $treadsid = -1; - foreach($items as $item) { + foreach($items as $item) { - $comment = ''; - $template = $tpl; - $commentww = ''; - $sparkle = ''; - $owner_url = $owner_photo = $owner_name = ''; + $comment = ''; + $template = $tpl; + $commentww = ''; + $sparkle = ''; + $owner_url = $owner_photo = $owner_name = ''; - // 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)) - || (activity_match($item['verb'],ACTIVITY_DISLIKE))) - && ($item['id'] != $item['parent'])) - continue; + if(((activity_match($item['verb'],ACTIVITY_LIKE)) + || (activity_match($item['verb'],ACTIVITY_DISLIKE))) + && ($item['id'] != $item['parent'])) + continue; - $toplevelpost = (($item['id'] == $item['parent']) ? true : false); - $toplevelprivate = false; + $toplevelpost = (($item['id'] == $item['parent']) ? true : false); + $toplevelprivate = false; - // Take care of author collapsing and comment collapsing - // If a single author has more than 3 consecutive top-level posts, squash the remaining ones. - // If there are more than two comments, squash all but the last 2. - - if($toplevelpost) { - $toplevelprivate = (($toplevelpost && $item['private']) ? true : false); - $item_writeable = (($item['writable'] || $item['self']) ? true : false); + // Take care of author collapsing and comment collapsing + // If a single author has more than 3 consecutive top-level posts, squash the remaining ones. + // If there are more than two comments, squash all but the last 2. + + if($toplevelpost) { + $toplevelprivate = (($toplevelpost && $item['private']) ? true : false); + $item_writeable = (($item['writable'] || $item['self']) ? true : false); - /*if($blowhard == $item['cid'] && (! $item['self']) && ($mode != 'profile') && ($mode != 'notes')) { - $blowhard_count ++; - if($blowhard_count == 3) { - $o .= '