]> git.mxchange.org Git - friendica.git/commitdiff
like, dislike, activity streams, etc.
authorMike Macgirvin <mike@macgirvin.com>
Fri, 17 Sep 2010 10:10:19 +0000 (03:10 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Fri, 17 Sep 2010 10:10:19 +0000 (03:10 -0700)
25 files changed:
boot.php
images/dislike.gif
images/like.gif
include/items.php
include/main.js
include/notifier.php
include/poller.php
mod/dfrn_notify.php
mod/dfrn_poll.php
mod/display.php
mod/like.php [new file with mode: 0644]
mod/network.php
mod/profile.php
view/acl_selectors.php
view/comment_item.tpl
view/jot-header.tpl
view/jot.tpl
view/like.tpl [new file with mode: 0644]
view/profile_tabs.tpl
view/settings.tpl
view/theme/default/style.css
view/theme/goldenrod/style.css
view/wall_item.tpl
view/wall_item_drop.tpl
view/wallwall_item.tpl

index 1a1a054187f35473109b9bd5053111e4b77602a3..537c7d73a13033057e2613fece857f8e4ac036d4 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -47,7 +47,9 @@ define ( 'ACTIVITY_OBJ_PHOTO',   NAMESPACE_ACTIVITY_SCHEMA . 'photo' );
 define ( 'ACTIVITY_OBJ_P_PHOTO', NAMESPACE_ACTIVITY_SCHEMA . 'profile-photo' );
 define ( 'ACTIVITY_OBJ_ALBUM',   NAMESPACE_ACTIVITY_SCHEMA . 'photo-album' );
 
-
+define ( 'GRAVITY_PARENT',       0);
+define ( 'GRAVITY_LIKE',         3);
+define ( 'GRAVITY_COMMENT',      6);
 
 
 if(! class_exists('App')) {
@@ -850,3 +852,24 @@ function allowed_url($url) {
        return $found;
 }}
 
+if(! function_exists('format_like')) {
+function format_like($cnt,$arr,$type,$id) {
+       if($cnt == 1)
+               $o .= $arr[0] . (($type == 'like') ? t(' likes this.') : t(' doesn\'t like this.')) . EOL ;
+       else {
+               $o .= '<span class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');" >' 
+                       . $cnt . ' ' . t('people') . '</span> ' . (($type == 'like') ? t('like this.') : t('don\'t like this.')) . EOL ;
+               $total = count($arr);
+               if($total >= 75)
+                       $arr = array_slice($arr,0,74);
+               if($total < 75)
+                       $arr[count($arr)-1] = t('and') . ' ' . $arr[count($arr)-1];
+               $str = implode(', ', $arr);
+               if($total >= 75)
+                       $str .= t(', and ') . $total - 75 . t(' other people');
+               $str .= (($type == 'like') ? t(' like this.') : t(' don\'t like this.'));
+               $o .= '<div id="' . $type . 'list-' . $id . '" style="display: none;" >' . $str . '</div>';
+       }
+       return $o;
+}}
+
index 2b6d01e3ae3c3469dace7415fd1b8c53baf63ba2..77779423c8867509cc1f79102b31deeb7387567d 100644 (file)
Binary files a/images/dislike.gif and b/images/dislike.gif differ
index 39b1c86d241fbc2fdefab9ad0efba8f20416b33c..f71d0324d25de39c7104af77d9c63f6248420e3a 100644 (file)
Binary files a/images/like.gif and b/images/like.gif differ
index f85a0e64b4600ccd53732eaf7668157d562c48e1..8ca0eeb16f9c503890cd3e5966d42ff890997bca 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 
+require_once('bbcode.php');
 
-function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update) {
+function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
 
-       require_once('bbcode.php');
 
        // default permissions - anonymous user
 
@@ -32,13 +32,31 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update) {
        else
                killme();
 
-       if($dfrn_id != '*') {
+       if($dfrn_id && $dfrn_id != '*') {
+
+               $sql_extra = '';
+               switch($direction) {
+                       case (-1):
+                               $sql_extra = sprintf(" AND `issued-id` = '%s' ", dbesc($dfrn_id));
+                               $my_id = $dfrn_id;
+                               break;
+                       case 0:
+                               $sql_extra = sprintf(" AND `issued-id` = '%s' AND `duplex` = 1 ", dbesc($dfrn_id));
+                               $my_id = '1:' . $dfrn_id;
+                               break;
+                       case 1:
+                               $sql_extra = sprintf(" AND `dfrn-id` = '%s' AND `duplex` = 1 ", dbesc($dfrn_id));
+                               $my_id = '0:' . $dfrn_id;
+                               break;
+                       default:
+                               return false;
+                               break; // NOTREACHED
+               }
 
-               $r = q("SELECT * FROM `contact` WHERE ( `issued-id` = '%s' OR ( `duplex` = 1 AND `dfrn-id` = '%s' )) AND `uid` = %d LIMIT 1",
-                       dbesc($dfrn_id),
-                       dbesc($dfrn_id),
+               $r = q("SELECT * FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 AND `contact`.`uid` = %d $sql_extra LIMIT 1",
                        intval($owner_id)
                );
+
                if(! count($r))
                        return false;
 
@@ -82,7 +100,7 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update) {
                `contact`.`id` AS `contact-id`, `contact`.`uid` AS `contact-uid`
                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                WHERE `item`.`uid` = %d AND `item`.`visible` = 1 
-               AND NOT `item`.`type` IN ( 'remote', 'net-comment' ) AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+               AND `item`.`wall` = 1 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
                AND ( `item`.`edited` > '%s' OR `item`.`changed` > '%s' )
                $sql_extra
                ORDER BY `parent` %s, `created` ASC LIMIT 0, 300",
@@ -193,10 +211,23 @@ function construct_verb($item) {
 
 function construct_activity($item) {
 
-       if($item['type'] == 'activity') {
-
-
+       if($item['object']) {
+               $o = '<as:object>' . "\r\n";
+               $r = @simplexml_load_string($item['object']);
+               if($r->type)
+                       $o .= '<as:object-type>' . $r->type . '</as:object-type>' . "\r\n";
+               if($r->id)
+                       $o .= '<id>' . $r->id . '</id>' . "\r\n";
+               if($r->link)
+                       $o .= '<link rel="alternate" type="text/html" href="' . $r->link . '" />' . "\r\n";
+               if($r->title)
+                       $o .= '<title>' . $r->title . '</title>' . "\r\n";
+               if($r->content)
+                       $o .= '<content type="html" >' . bbcode($r->content) . '</content>' . "\r\n";
+               $o .= '</as:object>' . "\r\n";
+               return $o;
        }
+
        return '';
 } 
 
@@ -300,9 +331,42 @@ function get_atom_elements($item) {
                $res['verb'] = unxmlify($rawverb[0]['data']);
 
        $rawobj = $item->get_item_tags(NAMESPACE_ACTIVITY, 'object');
+
+
        if($rawobj) {
-               $res['object-type'] = $rawobj[0]['object-type'][0]['data'];
-               $res['object'] = $rawobj[0];
+               $res['object'] = '<object>' . "\n";
+               if($rawobj[0]['child'][NAMESPACE_ACTIVITY]['object-type'][0]['data']) {
+                       $res['object-type'] = $rawobj[0]['child'][NAMESPACE_ACTIVITY]['object-type'][0]['data'];
+                       $res['object'] .= '<type>' . $rawobj[0]['child'][NAMESPACE_ACTIVITY]['object-type'][0]['data'] . '</type>' . "\n";
+               }       
+               if($rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data'])
+                       $res['object'] .= '<id>' . $rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['id'][0]['data'] . '</id>' . "\n";
+               
+               if($rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['rel'] == 'alternate')
+                       $res['object'] .= '<link>' . $rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'][0]['attribs']['']['href'] . '</link>' . "\n";
+               if($rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['title'][0]['data'])
+                       $res['object'] .= '<title>' . $rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['title'][0]['data'] . '</title>' . "\n";
+               if($rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['content'][0]['data']) {
+                       $body = $rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['content'][0]['data'];
+                       if(! $body)
+                               $body = $rawobj[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['summary'][0]['data'];
+                       if(strpos($body,'<')) {
+
+                               $body = preg_replace('#<object[^>]+>.+?' . 'http://www.youtube.com/((?:v|cp)/[A-Za-z0-9\-_=]+).+?</object>#s',
+                                       '[youtube]$1[/youtube]', $body);
+
+                               $config = HTMLPurifier_Config::createDefault();
+                               $config->set('Core.DefinitionCache', null);
+
+                               $purifier = new HTMLPurifier($config);
+                               $body = $purifier->purify($body);
+                       }
+
+                       $body = html2bbcode($body);
+                       $res['object'] .= '<content>' . $body . '</content>' . "\n";
+               }
+
+               $res['object'] .= '</object>' . "\n";
        }
 
        return $res;
index ca6d56d8b83e542fb4317ee32dd57cf08414ea46..cc44db5d426adc020a04c25b299c87ccae16c053 100644 (file)
@@ -36,6 +36,7 @@
        var livetime = null;
        var msie = false;
        var stopped = false;
+       var timer = null;
 
        $(document).ready(function() {
                $.ajaxSetup({cache: false});
                                });
                        }) ;
                }
-               setTimeout(NavUpdate,30000);
+               timer = setTimeout(NavUpdate,30000);
 
        }
 
        function liveUpdate() {
-               if((src == null) || (stopped)) { return; }
+               if((src == null) || (stopped)) { $('.like-rotator').hide(); return; }
                if($('.comment-edit-text-full').length) {
                        livetime = setTimeout(liveUpdate, 10000);
                        return;
 
                                        $('#' + ident + ' ' + '.wall-item-ago').replaceWith($(this).find('.wall-item-ago')); 
                                        $('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper'));
+                                       $('#' + ident + ' ' + '.wall-item-like').replaceWith($(this).find('.wall-item-like'));
+                                       $('#' + ident + ' ' + '.wall-item-dislike').replaceWith($(this).find('.wall-item-dislike'));
                                         $('#' + ident + ' ' + '.my-comment-photo').each(function() {
                                                 $(this).attr('src',$(this).attr('dst'));
                                         });
                                }
                                prev = ident; 
                        });
+                       $('.like-rotator').hide();
                });
 
        }
                $(node).css('width',16);
                $(node).css('height',16);
        }
+
+       // Since ajax is asynchronous, we will give a few seconds for
+       // the first ajax call (setting like/dislike), then run the
+       // updater to pick up any changes and display on the page.
+       // The updater will turn any rotators off when it's done. 
+       // This function will have returned long before any of these
+       // events have completed and therefore there won't be any
+       // visible feedback that anything changed without all this
+       // trickery. This still could cause confusion if the "like" ajax call
+       // is delayed and NavUpdate runs before it completes.
+
+       function dolike(ident,verb) {
+               $('#like-rotator-' + ident.toString()).show();
+               $.get('like/' + ident.toString() + '?verb=' + verb );
+               if(timer) clearTimeout(timer);
+               timer = setTimeout(NavUpdate,3000);
+       }
index cc2846735f7a7682e00f67369b2fac16b6a897f4..5766747b8b08d276cc14e0e9fd055e75d4ecb585 100644 (file)
@@ -13,6 +13,7 @@
 
        require_once("session.php");
        require_once("datetime.php");
+       require_once('include/items.php');
 
        if($argc < 3)
                exit;
                        $recipients = array_diff($recipients,$deny);
        
                        $conversant_str = dbesc(implode(', ',$conversants));
+
+
                }
 
                $r = q("SELECT * FROM `contact` WHERE `id` IN ( $conversant_str ) AND `blocked` = 0 AND `pending` = 0");
        }
        else {
 
-               require_once('include/items.php');
-
-               $verb = construct_verb($item);
-               $actobj = construct_activity($item);
-
 
                if($followup) {
                        foreach($items as $item) {
+
+                               $verb = construct_verb($item);
+                               $actobj = construct_activity($item);
+
                                if($item['id'] == $item_id) {
                                        $atom .= replace_macros($cmnt_template, array(
                                                '$name'               => xmlify($owner['name']),
                                else {
                                        foreach($contacts as $contact) {
                                                if($item['contact-id'] == $contact['id']) {
+
+                                                       $verb = construct_verb($item);
+                                                       $actobj = construct_activity($item);
+
                                                        if($item['parent'] == $item['id']) {
                                                                $atom .= replace_macros($item_template, array(
                                                                        '$name'               => xmlify($contact['name']),
                                                                        '$verb'               => xmlify($verb),
                                                                        '$actobj'             => $actobj,
                                                                        '$content'            => xmlify($item['body']),
-                                                                       '$comment_allow'      => (($item['last-child'] && ($contact['rel']) && ($contact['rel'] != REL_FAN)) ? 1 : 0)
+                                                                       '$comment_allow'      => (($item['last-child']) ? 1 : 0)
                                                                ));
                                                        }
                                                        else {
index 6024b18442f2c3259d30033c0ed3c519ab1f28b4..f116a5622054c6611337d84f305d736b3ed00b7e 100644 (file)
                                $datarray['parent-uri'] = $parent_uri;
                                $datarray['uid'] = $importer['uid'];
                                $datarray['contact-id'] = $contact['id'];
+                               if(($datarray['verb'] == ACTIVITY_LIKE) || ($datarray['verb'] == ACTIVITY_DISLIKE)) {
+                                       $datarray['type'] = 'activity';
+                                       $datarray['gravity'] = GRAVITY_LIKE;
+                               }
+
                                $r = item_store($datarray);
                                continue;
                        }
index 80cd1a2fdcdeb0e201568eef1d4251f40914f668..61ea77c29ac68ba26b204263d9249c1971a8afb3 100644 (file)
@@ -208,6 +208,10 @@ function dfrn_notify_post(&$a) {
                                $datarray['parent-uri'] = $parent_uri;
                                $datarray['uid'] = $importer['importer_uid'];
                                $datarray['contact-id'] = $importer['id'];
+                               if(($datarray['verb'] == ACTIVITY_LIKE) || ($datarray['verb'] == ACTIVITY_DISLIKE)) {
+                                       $datarray['type'] = 'activity';
+                                       $datarray['gravity'] = GRAVITY_LIKE;
+                               }
                                $posted_id = item_store($datarray);
 
                                if($posted_id) {
@@ -228,26 +232,28 @@ function dfrn_notify_post(&$a) {
                                                        intval($posted_id)
                                        );
 
-                                       $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
-
-                                       proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"comment-import\" \"$posted_id\" &", 
-                                               array(),$foo));
-
-                                       if(($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) {
-                                               require_once('bbcode.php');
-                                               $from = stripslashes($datarray['author-name']);
-                                               $tpl = file_get_contents('view/cmnt_received_eml.tpl');                 
-                                               $email_tpl = replace_macros($tpl, array(
-                                                       '$sitename' => $a->config['sitename'],
-                                                       '$siteurl' =>  $a->get_baseurl(),
-                                                       '$username' => $importer['username'],
-                                                       '$email' => $importer['email'],
-                                                       '$from' => $from,
-                                               '$body' => strip_tags(bbcode(stripslashes($datarray['body'])))
-                                               ));
-
-                                               $res = mail($importer['email'], $from . t(" commented on your item at ") . $a->config['sitename'],
-                                                       $email_tpl,t("From: Administrator@") . $a->get_hostname() );
+                                       if($datarray['type'] == 'remote-comment') {
+                                               $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
+
+                                               proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"comment-import\" \"$posted_id\" &", 
+                                                       array(),$foo));
+
+                                               if(($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) {
+                                                       require_once('bbcode.php');
+                                                       $from = stripslashes($datarray['author-name']);
+                                                       $tpl = file_get_contents('view/cmnt_received_eml.tpl');                 
+                                                       $email_tpl = replace_macros($tpl, array(
+                                                               '$sitename' => $a->config['sitename'],
+                                                               '$siteurl' =>  $a->get_baseurl(),
+                                                               '$username' => $importer['username'],
+                                                               '$email' => $importer['email'],
+                                                               '$from' => $from,
+                                                       '$body' => strip_tags(bbcode(stripslashes($datarray['body'])))
+                                                       ));
+       
+                                                       $res = mail($importer['email'], $from . t(" commented on your item at ") . $a->config['sitename'],
+                                                               $email_tpl,t("From: Administrator@") . $a->get_hostname() );
+                                               }
                                        }
                                }
                                xml_status(0);
@@ -280,11 +286,16 @@ function dfrn_notify_post(&$a) {
                                $datarray['parent-uri'] = $parent_uri;
                                $datarray['uid'] = $importer['importer_uid'];
                                $datarray['contact-id'] = $importer['id'];
+                               if(($datarray['verb'] == ACTIVITY_LIKE) || ($datarray['verb'] == ACTIVITY_DISLIKE)) {
+                                       $datarray['type'] = 'activity';
+                                       $datarray['gravity'] = GRAVITY_LIKE;
+                               }
+
                                $r = item_store($datarray);
 
                                // find out if our user is involved in this conversation and wants to be notified.
                        
-                               if($importer['notify-flags'] & NOTIFY_COMMENT) {
+                               if(($datarray['type'] != 'activity') && ($importer['notify-flags'] & NOTIFY_COMMENT)) {
 
                                        $myconv = q("SELECT `author-link` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d",
                                                dbesc($parent_uri),
index 4b8a7f112cb069d02ef13e7154a1008f8bb32f8e..66e19684429a7a96974a3f0b8028d9e3f62a8498 100644 (file)
@@ -201,7 +201,7 @@ function dfrn_poll_post(&$a) {
        }
        else {
 
-               $o = get_feed_for($a,$dfrn_id, $a->argv[1], $last_update);
+               $o = get_feed_for($a,$dfrn_id, $a->argv[1], $last_update, $direction);
                echo $o;
                killme();
 
index 639a30eb7d24aed29345d2e333a9d910065a6dbb..6149c3d5b595c46b00d900f46df2d63ca57e91c0 100644 (file)
@@ -93,7 +93,7 @@ function display_content(&$a) {
                AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
                AND `item`.`parent` = ( SELECT `parent` FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s' ))
                $sql_extra
-               ORDER BY `parent` DESC, `id` ASC ",
+               ORDER BY `parent` DESC, `gravity` ASC, `id` ASC ",
                intval($a->profile['uid']),
                dbesc($item_id),
                dbesc($item_id)
@@ -101,19 +101,49 @@ function display_content(&$a) {
 
 
        $cmnt_tpl = file_get_contents('view/comment_item.tpl');
-
+       $like_tpl = file_get_contents('view/like.tpl');
        $tpl = file_get_contents('view/wall_item.tpl');
        $wallwall = file_get_contents('view/wallwall_item.tpl');
 
        $return_url = $_SESSION['return_url'] = $a->cmd;
 
+       $alike = array();
+       $dlike = array();
+
        if(count($r)) {
+
+               foreach($r as $item) {
+
+                       if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
+                               $url = $item['url'];
+                               if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) 
+                                       $url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
+                               if(! is_array($alike[$item['parent'] . '-l']))
+                                       $alike[$item['parent'] . '-l'] = array();
+                               $alike[$item['parent']] ++;
+                               $alike[$item['parent'] . '-l'][] = '<a href="'. $url . '">' . $item['name'] . '</a>';
+                       }
+                       if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
+                               $url = $item['url'];
+                               if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) 
+                                       $url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
+                               if(! is_array($dlike[$item['parent'] . '-l']))
+                                       $dlike[$item['parent'] . '-l'] = array();
+                               $dlike[$item['parent']] ++;
+                               $dlike[$item['parent'] . '-l'][] = '<a href="'. $url . '">' . $item['name'] . '</a>';
+                       }
+               }
+
+
+
                foreach($r as $item) {
                        $comment = '';
                        $template = $tpl;
                        
                        $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
                        
+                       if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent'])) 
+                               continue;
 
                        if(can_write_wall($a,$a->profile['uid'])) {
                                if($item['last-child']) {
@@ -175,6 +205,15 @@ function display_content(&$a) {
                        if(($item['contact-id'] == $_SESSION['visitor_id']) || ($item['uid'] == get_uid()))
                                $drop = replace_macros(file_get_contents('view/wall_item_drop.tpl'), array('$id' => $item['id']));
 
+                       $like    = (($alike[$item['id']]) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
+                       $dislike = (($dlike[$item['id']]) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
+
+                       $likebuttons = '';
+                       if($item['id'] == $item['parent']) {
+                               $likebuttons = replace_macros($like_tpl,array('$id' => $item['id']));
+                       }
+
+
 
                        $o .= replace_macros($template,array(
                                '$id' => $item['item_id'],
@@ -190,10 +229,32 @@ function display_content(&$a) {
                                '$owner_photo' => $owner_photo,
                                '$owner_name' => $owner_name,
                                '$drop' => $drop,
+                               '$vote' => $likebuttons,
+                               '$like' => $like,
+                               '$dislike' => $dislike,
                                '$comment' => $comment
                        ));
 
                }
        }
+       else {
+               $r = q("SELECT `id` FROM `item` WHERE `id` = '%s' OR `uri` = '%s' LIMIT 1",
+                       dbesc($item_id),
+                       dbesc($item_id)
+               );
+               if(count($r)) {
+                       if($r[0]['deleted']) {
+                               notice( t('Item has been removed.') . EOL );
+                       }
+                       else {  
+                               notice( t('Permission denied.') . EOL ); 
+                       }
+               }
+               else {
+                       notice( t('Item not found.') . EOL );
+               }
+
+       }
        return $o;
-}
\ No newline at end of file
+}
+
diff --git a/mod/like.php b/mod/like.php
new file mode 100644 (file)
index 0000000..d52b3a3
--- /dev/null
@@ -0,0 +1,171 @@
+<?php
+
+require_once('include/security.php');
+require_once('include/bbcode.php');
+require_once('include/items.php');
+
+
+function like_content(&$a) {
+
+       if(! local_user() && ! remote_user()) {
+               return;
+       }
+
+       $verb = notags(trim($_GET['verb']));
+
+       if(! $verb)
+               $verb = 'like';
+
+       switch($verb) {
+               case 'like':
+                       $activity = ACTIVITY_LIKE;
+                       break;
+               case 'dislike':
+                       $activity = ACTIVITY_DISLIKE;
+                       break;
+               case 'unlike':
+                       $activity = ACTIVITY_LIKE;
+                       break;
+               case 'undislike':
+                       $activity = ACTIVITY_DISLIKE;
+                       break;
+               default:
+                       return;
+                       break;
+       }
+
+
+       $item_id = (($a->argc > 1) ? notags(trim($a->argv[1])) : 0);
+
+       $r = q("SELECT * FROM `item` WHERE ( `id` = '%s' OR `uri` = '%s') AND `id` = `parent` LIMIT 1",
+               dbesc($item_id),
+               dbesc($item_id)
+       );
+
+       if(! $item_id || (! count($r))) {
+               return;
+       }
+
+       $item = $r[0];
+
+       $owner_uid = $item['uid'];
+
+       if(! can_write_wall($a,$owner_uid)) {
+               return;
+       }
+
+       $r = q("SELECT `contact`.*, `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
+               WHERE `contact`.`self` = 1 AND `contact`.`uid` = %d LIMIT 1",
+               intval($owner_uid)
+       );
+       if(count($r))
+               $owner = $r[0];
+
+       if(! $owner) {
+               return;
+       }
+
+
+       if((local_user()) && (get_uid() == $owner_uid)) {
+               $contact = $owner;
+       }
+       else {
+               $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
+                       intval($_SESSION['visitor_id']),
+                       intval($owner_uid)
+               );
+               if(count($r))
+                       $contact = $r[0];
+       }
+       if(! $contact) {
+               return;
+       }
+
+       $r = q("SELECT `id` FROM `item` WHERE `verb` = '%s' AND `deleted` = 0 
+               AND `contact-id` = %d AND ( `parent` = '%s' OR `parent-uri` = '%s') LIMIT 1",
+               dbesc($activity),
+               intval($contact['id']),
+               dbesc($item_id),
+               dbesc($item_id)
+       );
+       if(count($r)) {
+               // Already voted, undo it
+               $r = q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1",
+                       dbesc(datetime_convert()),
+                       intval($r[0]['id'])
+               );
+
+               $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
+
+               proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"like\" \"$post_id\" > notify.out &",
+                       array(),$foo));
+               return;
+       }
+
+       $uri = item_new_uri($a->get_hostname(),$owner_uid);
+
+       $post_type = (($item['resource-id']) ? t('photo') : t('status'));
+       $objtype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE ); 
+       $link = $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'];
+       $body = $item['body'];
+
+       $obj = <<< EOT
+
+       <object>
+               <type>$objtype</type>
+               <local>1</local>
+               <id>{$item['uri']}</id>
+               <link>$link</link>
+               <title></title>
+               <content>$body</content>
+       </object>
+EOT;
+       if($verb == 'like')
+               $bodyverb = t('likes');
+       if($verb == 'dislike')
+               $bodyverb = t('doesn\'t like');
+
+       if(! isset($bodyverb))
+                       return; 
+
+       $arr = array();
+
+       $arr['uri'] = $uri;
+       $arr['uid'] = $owner_uid;
+       $arr['contact-id'] = $contact['id'];
+       $arr['type'] = 'activity';
+       $arr['wall'] = 1;
+       $arr['gravity'] = GRAVITY_LIKE;
+       $arr['parent'] = $item['id'];
+       $arr['parent-uri'] = $item['uri'];
+       $arr['owner-name'] = $owner['name'];
+       $arr['owner-link'] = $owner['url'];
+       $arr['owner-avatar'] = $owner['thumb'];
+       $arr['author-name'] = $contact['name'];
+       $arr['author-link'] = $contact['url'];
+       $arr['author-avatar'] = $contact['thumb'];
+       $arr['body'] = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]' . ' ' .  t('likes') . ' ' 
+               . '[url=' . $owner['url'] . ']' . $owner['name'] . t('\'s') . '[/url]' . ' '
+               . '[url=' . $a->get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]' ;
+
+       $arr['verb'] = $activity;
+       $arr['object-type'] = $objtype;
+       $arr['object'] = $obj;
+       $arr['allow_cid'] = $item['allow_cid'];
+       $arr['allow_gid'] = $item['allow_gid'];
+       $arr['deny_cid'] = $item['deny_cid'];
+       $arr['deny_gid'] = $item['deny_gid'];
+       $arr['visible'] = 1;
+       $arr['unseen'] = 1;
+       $arr['last-child'] = 0;
+
+       $post_id = item_store($arr);    
+
+
+       $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
+
+       proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"like\" \"$post_id\" > notify.out &",
+               array(),$foo));
+
+       return; // NOTREACHED
+}
\ No newline at end of file
index cdd8a4976be41ac864d8f9fbd846c12306469e17..7eb93f435998a20fafbefce2a182bf0788f4000e 100644 (file)
@@ -66,7 +66,7 @@ function network_content(&$a, $update = false) {
        // that belongs to you, hence you can see all of it. We will filter by group if
        // desired. 
 
-       $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `type` IN ('wall', 'photo', 'remote' )) ";
+       $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` ) ";
 
        if($group) {
                $r = q("SELECT `name`, `id` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
@@ -81,7 +81,7 @@ function network_content(&$a, $update = false) {
 
                $contacts = expand_groups(array($group));
                $contact_str = implode(',',$contacts);
-                $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `type` IN ('wall', 'photo', 'remote') AND `contact-id` IN ( $contact_str )) ";
+                $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;
 
        }
@@ -98,14 +98,14 @@ function network_content(&$a, $update = false) {
                $a->set_pager_total($r[0]['total']);
 
        $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, 
-               `contact`.`name`, `contact`.`photo`, `contact`.`url`, 
+               `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
                `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`, 
                `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
                AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
                $sql_extra
-               ORDER BY `parent` DESC, `created` ASC LIMIT %d ,%d ",
+               ORDER BY `parent` DESC, `gravity` ASC, `created` ASC LIMIT %d ,%d ",
                intval($_SESSION['uid']),
                intval($a->pager['start']),
                intval($a->pager['itemspage'])
@@ -113,11 +113,36 @@ function network_content(&$a, $update = false) {
 
 
        $cmnt_tpl = file_get_contents('view/comment_item.tpl');
-
+       $like_tpl = file_get_contents('view/like.tpl');
        $tpl = file_get_contents('view/wall_item.tpl');
        $wallwall = file_get_contents('view/wallwall_item.tpl');
 
+       $alike = array();
+       $dlike = array();
+       
        if(count($r)) {
+               foreach($r as $item) {
+
+                       if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
+                               $url = $item['url'];
+                               if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) 
+                                       $url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
+                               if(! is_array($alike[$item['parent'] . '-l']))
+                                       $alike[$item['parent'] . '-l'] = array();
+                               $alike[$item['parent']] ++;
+                               $alike[$item['parent'] . '-l'][] = '<a href="'. $url . '">' . $item['name'] . '</a>';
+                       }
+                       if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
+                               $url = $item['url'];
+                               if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) 
+                                       $url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
+                               if(! is_array($dlike[$item['parent'] . '-l']))
+                                       $dlike[$item['parent'] . '-l'] = array();
+                               $dlike[$item['parent']] ++;
+                               $dlike[$item['parent'] . '-l'][] = '<a href="'. $url . '">' . $item['name'] . '</a>';
+                       }
+               }
+
                foreach($r as $item) {
 
                        $comment = '';
@@ -127,12 +152,14 @@ function network_content(&$a, $update = false) {
                        $profile_url = $item['url'];
                        $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
 
+                       if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent'])) 
+                               continue;
 
                        // Top-level wall post not written by the wall owner (wall-to-wall)
                        // First figure out who owns it. 
 
                        if(($item['parent'] == $item['item_id']) && (! $item['self'])) {
-                               
+
                                if($item['type'] == 'wall') {
                                        // I do. Put me on the left of the wall-to-wall notice.
                                        $owner_url = $a->contact['url'];
@@ -149,8 +176,7 @@ function network_content(&$a, $update = false) {
                                        $template = $wallwall;
                                        $commentww = 'ww';
                                        // If it is our contact, use a friendly redirect link
-                                       if(($item['owner-link'] == $item['url']) && ($item['rel'] == DIRECTION_IN || $item['rel'] == DIRECTION_BOTH))
-                                               $owner_url = $redirect_url;
+                                       if(($item['owner-link'] == $item['url']) && ($item['rel'] == REL_VIP || $item['rel'] == REL_BUD))
                                                $owner_url = $redirect_url;
 
                                }
@@ -161,6 +187,10 @@ function network_content(&$a, $update = false) {
                        else
                                $return_url = $_SESSION['return_url'] = $a->cmd;
 
+                       $likebuttons = '';
+                       if($item['id'] == $item['parent']) {
+                               $likebuttons = replace_macros($like_tpl,array('$id' => $item['id']));
+                       }
 
                        if($item['last-child']) {
                                $comment = replace_macros($cmnt_tpl,array(
@@ -181,7 +211,7 @@ function network_content(&$a, $update = false) {
 
 
        
-                       if(($item['contact-uid'] == $_SESSION['uid']) && ($item['rel'] == DIRECTION_IN || $item['rel'] == DIRECTION_BOTH) && (! $item['self'] ))
+                       if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'] ))
                                $profile_url = $redirect_url;
 
                        $photo = $item['photo'];
@@ -203,6 +233,11 @@ function network_content(&$a, $update = false) {
                                        $profile_link = $item['author-link'];
                        }
 
+
+                       $like    = (($alike[$item['id']]) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
+                       $dislike = (($dlike[$item['id']]) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
+
+
                        // Build the HTML
 
                        $o .= replace_macros($template,array(
@@ -219,6 +254,9 @@ function network_content(&$a, $update = false) {
                                '$owner_photo' => $owner_photo,
                                '$owner_name' => $owner_name,
                                '$drop' => $drop,
+                               '$vote' => $likebuttons,
+                               '$like' => $like,
+                               '$dislike' => $dislike,
                                '$comment' => $comment
                        ));
                }
index 1520afff7417e7368a8d7963415ad41b9c3709af..18201e821a6b360d1d93011923ea76a2c7e2c916 100644 (file)
@@ -203,7 +203,7 @@ function profile_content(&$a, $update = false) {
                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
                AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 
-               AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `type` != 'remote')
+               AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `wall` = 1 )
                $sql_extra ",
                intval($a->profile['profile_uid'])
 
@@ -219,9 +219,9 @@ function profile_content(&$a, $update = false) {
                FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
                WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
                AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
-               AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `type` != 'remote')
+               AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `wall` = 1 )
                $sql_extra
-               ORDER BY `parent` DESC, `id` ASC LIMIT %d ,%d ",
+               ORDER BY `parent` DESC, `gravity` ASC, `id` ASC LIMIT %d ,%d ",
                intval($a->profile['profile_uid']),
                intval($a->pager['start']),
                intval($a->pager['itemspage'])
@@ -231,6 +231,8 @@ function profile_content(&$a, $update = false) {
 
        $cmnt_tpl = file_get_contents('view/comment_item.tpl');
 
+       $like_tpl = file_get_contents('view/like.tpl');
+
        $tpl = file_get_contents('view/wall_item.tpl');
 
        if($update)
@@ -238,15 +240,50 @@ function profile_content(&$a, $update = false) {
        else
                $return_url = $_SESSION['return_url'] = $a->cmd;
 
+       $alike = array();
+       $dlike = array();
+
        if(count($r)) {
+
+               foreach($r as $item) {
+
+                       if(($item['verb'] == ACTIVITY_LIKE) && ($item['id'] != $item['parent'])) {
+                               $url = $item['url'];
+                               if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) 
+                                       $url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
+                               if(! is_array($alike[$item['parent'] . '-l']))
+                                       $alike[$item['parent'] . '-l'] = array();
+                               $alike[$item['parent']] ++;
+                               $alike[$item['parent'] . '-l'][] = '<a href="'. $url . '">' . $item['name'] . '</a>';
+                       }
+                       if(($item['verb'] == ACTIVITY_DISLIKE) && ($item['id'] != $item['parent'])) {
+                               $url = $item['url'];
+                               if(($item['rel'] == REL_VIP || $item['rel'] == REL_BUD) && (! $item['self'])) 
+                                       $url = $a->get_baseurl() . '/redir/' . $item['contact-id'];
+                               if(! is_array($dlike[$item['parent'] . '-l']))
+                                       $dlike[$item['parent'] . '-l'] = array();
+                               $dlike[$item['parent']] ++;
+                               $dlike[$item['parent'] . '-l'][] = '<a href="'. $url . '">' . $item['name'] . '</a>';
+                       }
+               }
+
                foreach($r as $item) {
+
+               
                        $comment = '';
+                       $likebuttons = '';
+
                        $template = $tpl;
                        
                        $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ;
-                       
+
+                       if((($item['verb'] == ACTIVITY_LIKE) || ($item['verb'] == ACTIVITY_DISLIKE)) && ($item['id'] != $item['parent'])) 
+                               continue;
 
                        if(can_write_wall($a,$a->profile['profile_uid'])) {
+                               if($item['id'] == $item['parent']) {
+                                       $likebuttons = replace_macros($like_tpl,array('$id' => $item['id']));
+                               }
                                if($item['last-child']) {
                                        $comment = replace_macros($cmnt_tpl,array(
                                                '$return_path' => $_SESSION['return_url'],
@@ -287,6 +324,10 @@ function profile_content(&$a, $update = false) {
                                $drop = replace_macros(file_get_contents('view/wall_item_drop.tpl'), array('$id' => $item['id']));
 
 
+                       $like    = (($alike[$item['id']]) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : '');
+                       $dislike = (($dlike[$item['id']]) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : '');
+
+
                        $o .= replace_macros($template,array(
                                '$id' => $item['item_id'],
                                '$profile_url' => $profile_link,
@@ -298,6 +339,9 @@ function profile_content(&$a, $update = false) {
                                '$location' => (($item['location']) ? '<a target="map" href="http://maps.google.com/?q=' . urlencode($item['location']) . '">' . $item['location'] . '</a>' : ''),
                                '$indent' => (($item['parent'] != $item['item_id']) ? ' comment' : ''),
                                '$drop' => $drop,
+                               '$like' => $like,
+                               '$vote' => $likebuttons,
+                               '$dislike' => $dislike,
                                '$comment' => $comment
                        ));
                        
index 42cd7a98138620cd84b350a029b10ffa155f1e11..0366ab2a17fb6ff5a9dd98a572187f1a3134ef9e 100644 (file)
@@ -5,7 +5,7 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) {
 
        $o = '';
 
-       $o .= "<select name=\"{$selname}[]\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" />\r\n";
+       $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" >\r\n";
 
        $r = q("SELECT * FROM `group` WHERE `deleted` = 0 AND `uid` = %d ORDER BY `name` ASC",
                $_SESSION['uid']
@@ -39,11 +39,11 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
 
        if($privmail) {
                $sql_extra = sprintf(" AND `rel` = %d ", intval(DIRECTION_BOTH));
-               $o .= "<select name=\"$selname\" class=\"$selclass\" size=\"$size\" />\r\n";
+               $o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"$size\" >\r\n";
        }
        else {
                $sql_extra = '';
-               $o .= "<select name=\"{$selname}[]\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" />\r\n";
+               $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" >\r\n";
        }
 
        $r = q("SELECT `id`, `name`, `url` FROM `contact` 
index 336ad3b33fe254c5fa93928eaf4e272a4a49c510..62b3ce18a75243c665978f9505e807d1bb0ec58f 100644 (file)
@@ -18,6 +18,6 @@
                        <input type="submit" id="comment-edit-submit-$id" class="comment-edit-submit" name="submit" value="Submit" />
                </div>
 
-               <div id="comment-edit-end"></div>
+               <div class="comment-edit-end"></div>
        </form>
 </div>
index 8c7cce360dc68e828bddc33cb82735ffd646d5e8..bb95cd265fe56eae40d356f2c1aa2939ad527057 100644 (file)
@@ -107,5 +107,6 @@ tinyMCE.init({
                }
        }
 
+
 </script>
 
index 586274c35ca798f5e4beceddc176f010327740d5..ec11f286113edbf71c2cc921db3c149b96812742 100644 (file)
@@ -1,19 +1,19 @@
 
 <div id="profile-jot-wrapper" >
-<div id="profile-jot-banner-wrapper">
-       <div id="profile-jot-desc" >What's on your mind?</div>
-       <div id="character-counter" class="grey"></div>
-</div>
-<div id="profile-jot-banner-end"></div>
-<form id="profile-jot-form" action="item" method="post" >
-<input type="hidden" name="type" value="wall" />
-<input type="hidden" name="profile_uid" value="$profile_uid" />
-<input type="hidden" name="return" value="$return_path" />
-<input type="hidden" name="location" id="jot-location" value="$defloc" />
+       <div id="profile-jot-banner-wrapper">
+               <div id="profile-jot-desc" >What's on your mind?</div>
+               <div id="character-counter" class="grey"></div>
+       </div>
+       <div id="profile-jot-banner-end"></div>
 
-<textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" ></textarea>
+       <form id="profile-jot-form" action="item" method="post" >
+               <input type="hidden" name="type" value="wall" />
+               <input type="hidden" name="profile_uid" value="$profile_uid" />
+               <input type="hidden" name="return" value="$return_path" />
+               <input type="hidden" name="location" id="jot-location" value="$defloc" />
+
+               <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" ></textarea>
 
-</div>
 <div id="profile-jot-submit-wrapper" >
 <input type="submit" id="profile-jot-submit" name="submit" value="Submit" />
        <div id="profile-upload-wrapper" style="display: $visitor;" >
@@ -35,6 +35,7 @@
        <div id="profile-jot-perms-end"></div>
        <div id="profile-jot-acl-wrapper" style="display: none;" >$acl</div>
 </div>
+
 <div id="profile-jot-end"></div>
 </form>
 </div>
diff --git a/view/like.tpl b/view/like.tpl
new file mode 100644 (file)
index 0000000..73cbb2d
--- /dev/null
@@ -0,0 +1,5 @@
+<div class="wall-item-like-buttons" id="wall-item-like-buttons-$id">
+<img src="images/like.gif" alt="I like this" title="I like this [toggle]" onclick="dolike($id,'like');" />
+<img src="images/dislike.gif" alt="I don't like this" title="I don't like this [toggle]" onclick="dolike($id,'dislike');" />
+<img id="like-rotator-$id" class="like-rotator" src="images/rotator.gif" alt="Please wait" title="Please wait" style="display: none;" />
+</div>
index 0877edd737b1dc073129b699d6476fdc90834160..9c6c54a1c5fa2d51c2d2a3f12f22036baa612385 100644 (file)
@@ -4,3 +4,4 @@
        <a href="$url?tab=profile" id="profile-tab-profile-link" class="profile-tabs" >Profile</a>
        <a href="$phototab" id="profile-tab-photos-link" class="profile-tabs" >Photos</a>
 <div id="profile-tabs-end"></div>
+</div>
\ No newline at end of file
index aa0bf17e032fa0e4394d716610ddca989b119f5b..84fc3892689bc8ae9871462751e2d1f24164bef3 100644 (file)
@@ -45,7 +45,7 @@ $profile_in_dir
 $profile_in_net_dir
 
 <div id="settings-default-perms" class="settings-default-perms" >
-       <div id="settings-default-perms-menu" onClick="openClose('settings-default-perms-select');" />$permissions</div>
+       <div id="settings-default-perms-menu" onClick="openClose('settings-default-perms-select');" >$permissions</div>
        <div id="settings-default-perms-menu-end"></div>
 
        <div id="settings-default-perms-select" style="display: none;" >
index 3f169905dddcc2092b25ab1b571d113ad200b708..6176f84ff61641c61cbf283a1f311b386a9f9598 100644 (file)
@@ -8,6 +8,22 @@ a:hover {
        color: #0000FF;
        text-decoration: underline;
 }
+
+.fakelink, .fakelink:visited {
+       color: #8888FF;
+       text-decoration: none;
+       cursor: pointer;
+       margin-top: 15px;
+       margin-bottom: 15px;
+}
+
+.fakelink:hover {
+       color: #0000FF;
+       text-decoration: underline;
+       cursor: pointer;
+}
+
+
 img {
        border: none;
 }
@@ -649,6 +665,9 @@ input#dfrn-url {
        font-size: 0.8em;
 }
 
+.wall-item-like-buttons img {
+       cursor: pointer;
+}
 .wall-item-delete-wrapper {
        float: right;
        margin-top: 20px;
index 4f5773a4a43be068e640a707b52517f03d4a5352..e84cf5d6472b2cedf15ee8f74cd8a4a1f1171ab0 100644 (file)
@@ -30,6 +30,17 @@ a:hover {
        color: #0000FF;
        text-decoration: underline;
 }
+
+.fakelink, .fakelink:visited {
+       color: #8888FF;
+}
+
+.fakelink:hover {
+       color: #0000FF;
+}
+
+
+
 .wall-item-content-wrapper.comment {
        background: #FFCC55;
 }
index c646bbee33baf1d905d69a14840e622b0af48efa..479a72ce275c46891a59945649e97405f1003b61 100644 (file)
@@ -9,6 +9,7 @@
                        <a href="$profile_url" title="View $name's profile" class="wall-item-name-link"><span class="wall-item-name" id="wall-item-name-$id" >$name</span></a>
                        <div class="wall-item-ago"  id="wall-item-ago-$id">$ago</div>
                        <div class="wall-item-location" id="wall-item-location-$id">$location</div>
+                       $vote
                </div>
                <div class="wall-item-content" id="wall-item-content-$id" >
                        <div class="wall-item-title" id="wall-item-title-$id">$title</div>
@@ -17,7 +18,8 @@
                $drop
        </div>
        <div class="wall-item-wrapper-end"></div>
-
+       <div class="wall-item-like" id="wall-item-like-$id">$like</div>
+       <div class="wall-item-dislike" id="wall-item-dislike-$id">$dislike</div>
        <div class="wall-item-comment-wrapper" >
        $comment
        </div>
index 9ca1ec9680be3d3a06bb05c59d7669c175659140..84a2f3a8ef3cdae2f27c4ed393c769d9a820ca0c 100644 (file)
@@ -1 +1,2 @@
-<div class="wall-item-delete-wrapper" id="wall-item-delete-wrapper-$id" ><a href="item/drop/$id" onclick="return confirmDelete();" ><img src="images/b_drophide.gif" alt="Delete" title="Delete" id="wall-item-delete-icon-$id" class="wall-item-delete-icon" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a></div><div class="wall-item-delete-end"></div>
+<div class="wall-item-delete-wrapper" id="wall-item-delete-wrapper-$id" ><a href="item/drop/$id" onclick="return confirmDelete();" ><img src="images/b_drophide.gif" alt="Delete" title="Delete" id="wall-item-delete-icon-$id" class="wall-item-delete-icon" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a></div>
+<div class="wall-item-delete-end"></div>
index 30970f6aeaef6d38efcba00d446fe5c47cf59973..f3a803543c9e278f0b3a9774d686426daec1e954 100644 (file)
@@ -12,7 +12,7 @@
                <a href="$profile_url" title="View $name's profile" class="wall-item-name-link"><span class="wall-item-name" id="wall-item-name-$id" >$name</span></a> to <a href="$owner_url" title="View $owner_name's profile" class="wall-item-name-link"><span class="wall-item-name" id="wall-item-ownername-$id">$owner_name</span></a> via Wall-To-Wall:<br />
                <div class="wall-item-ago"  id="wall-item-ago-$id">$ago</div>
                <div class="wall-item-location" id="wall-item-location-$id">$location</div>
-
+               $vote
        </div>
        <div class="wall-item-content" id="wall-item-content-$id" >
                <div class="wall-item-title" id="wall-item-title-$id">$title</div>
@@ -21,6 +21,8 @@
        $drop
        
        <div class="wall-item-wrapper-end"></div>
+       <div class="wall-item-like" id="wall-item-like-$id">$like</div>
+       <div class="wall-item-dislike" id="wall-item-dislike-$id">$dislike</div>
        <div class="wall-item-comment-separator"></div>
        <div class="wall-item-comment-wrapper" >
        $comment