]> git.mxchange.org Git - friendica.git/commitdiff
ignore suggestions
authorFriendika <info@friendika.com>
Thu, 3 Nov 2011 23:00:52 +0000 (16:00 -0700)
committerFriendika <info@friendika.com>
Thu, 3 Nov 2011 23:00:52 +0000 (16:00 -0700)
boot.php
database.sql
include/socgraph.php
mod/suggest.php
update.php
view/suggest_friends.tpl [new file with mode: 0644]

index 1c0328fb83521e6c8ab525e22dfe76bc842789e7..6b549a48a770d20402b51d2de15b6ca88b84fc33 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -11,7 +11,7 @@ require_once('include/cache.php');
 define ( 'FRIENDIKA_PLATFORM',     'Friendica');
 define ( 'FRIENDIKA_VERSION',      '2.3.1154' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.22'    );
-define ( 'DB_UPDATE_VERSION',      1101      );
+define ( 'DB_UPDATE_VERSION',      1102      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
index eeb3700ff97504853cfd9a7f7b381ab7afb1b4f8..3d11ff4b7940bd040b3392b4bfc3b1839f3b1e63 100644 (file)
@@ -667,7 +667,7 @@ CREATE TABLE IF NOT EXISTS `gcontact` (
 `url` CHAR( 255 ) NOT NULL ,
 `nurl` CHAR( 255 ) NOT NULL ,
 `photo` CHAR( 255 ) NOT NULL,
-INDEX ( `nurl` ),
+INDEX ( `nurl` )
 ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
 
 CREATE TABLE IF NOT EXISTS `glink` (
@@ -681,3 +681,12 @@ INDEX ( `uid` ),
 INDEX ( `gcid` ),
 INDEX ( `updated` )
 ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `gcign` (
+`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`uid` INT NOT NULL ,
+`gcid` INT NOT NULL,
+INDEX ( `uid` ),
+INDEX ( `gcid` )
+) ENGINE = MyISAM DEFAULT CHARSET=utf8;
+
index b9f53d6a6d0c0862d49814547d1f7d998363fdc4..84cfe4468a50223777c0e2849876f70842198837 100644 (file)
@@ -171,9 +171,11 @@ function suggestion_query($uid, $start = 0, $limit = 40) {
        $r = q("SELECT count(glink.gcid) as `total`, gcontact.* from gcontact 
                left join glink on glink.gcid = gcontact.id 
                where uid = %d and not gcontact.nurl in ( select nurl from contact where uid = %d)
+               and not gcontact.id in ( select gcid from gcign where uid = %d )
                group by glink.gcid order by total desc limit %d, %d ",
                intval($uid),
                intval($uid),
+               intval($uid),
                intval($start),
                intval($limit)
        );
index 2d2a329388ffafc0914c32ba57d984f4bf6c1c37..aedf3fd46af94386716f432692f600688323c2a6 100644 (file)
@@ -3,6 +3,24 @@
 require_once('include/socgraph.php');
 require_once('include/contact_widgets.php');
 
+
+function suggest_init(&$a) {
+       if(! local_user())
+               return;
+
+       if(x($_GET,'ignore') && intval($_GET['ignore'])) {
+               q("insert into gcign ( uid, gcid ) values ( %d, %d ) ",
+                       intval(local_user()),
+                       intval($_GET['ignore'])
+               );
+       }
+
+}
+               
+
+
+
+
 function suggest_content(&$a) {
 
        $o = '';
@@ -25,7 +43,7 @@ function suggest_content(&$a) {
                return $o;
        }
 
-       $tpl = get_markup_template('common_friends.tpl');
+       $tpl = get_markup_template('suggest_friends.tpl');
 
        foreach($r as $rr) {
                        
@@ -33,7 +51,8 @@ function suggest_content(&$a) {
                        '$url' => $rr['url'],
                        '$name' => $rr['name'],
                        '$photo' => $rr['photo'],
-                       '$tags' => ''
+                       '$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'],
+                       '$ignore' => t('Ignore/Hide')
                ));
        }
 
index cdadb2e38872d0acbaf000917e74f5c3da8a3af1..67017fa03e10ee3661ba26a7b935aca37aed4f52 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-define( 'UPDATE_VERSION' , 1101 );
+define( 'UPDATE_VERSION' , 1102 );
 
 /**
  *
@@ -864,6 +864,17 @@ function update_1100() {
 }
 
 
+function update_1101() {
+       q("CREATE TABLE IF NOT EXISTS `gcign` (
+       `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+       `uid` INT NOT NULL ,
+       `gcid` INT NOT NULL
+       ) ENGINE = MYISAM ");
+
+       q("ALTER TABLE `gcign` ADD INDEX (`uid`), ADD INDEX (`gcid`) ");
+}
+
+
 
 
 
diff --git a/view/suggest_friends.tpl b/view/suggest_friends.tpl
new file mode 100644 (file)
index 0000000..aac20aa
--- /dev/null
@@ -0,0 +1,13 @@
+<div class="profile-match-wrapper">
+       <div class="profile-match-photo">
+               <a href="$url">
+                       <img src="$photo" alt="$name" width="80" height="80" title="$name [$url]" />
+               </a>
+       </div>
+       <div class="profile-match-break"></div>
+       <div class="profile-match-name">
+               <a href="$url" title="$name">$name</a>
+       </div>
+       <a class="icon drophide profile-match-ignore" href="$ignlnk" title="$ignore" ></a>
+       <div class="profile-match-end"></div>
+</div>
\ No newline at end of file