aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mod/item.php5
-rw-r--r--mod/match.php17
-rw-r--r--mod/search.php2
-rw-r--r--mod/tagmatch.php54
-rw-r--r--view/match.tpl12
-rw-r--r--view/theme/testbubble/match.tpl10
-rw-r--r--view/theme/testbubble/style.css63
7 files changed, 108 insertions, 55 deletions
diff --git a/mod/item.php b/mod/item.php
index e5d4eea82..b8c0683aa 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -779,6 +779,11 @@ function item_post(&$a) {
}
}
+ // fallback so that parent always gets set to non-zero.
+
+ if(! $parent)
+ $parent = $post_id;
+
$r = q("UPDATE `item` SET `parent` = %d, `parent-uri` = '%s', `plink` = '%s', `changed` = '%s', `last-child` = 1, `visible` = 1
WHERE `id` = %d LIMIT 1",
intval($parent),
diff --git a/mod/match.php b/mod/match.php
index 5dd80fe3e..eea2dad4f 100644
--- a/mod/match.php
+++ b/mod/match.php
@@ -22,6 +22,7 @@ function match_content(&$a) {
$params = array();
$tags = trim($r[0]['pub_keywords'] . ' ' . $r[0]['prv_keywords']);
+
if($tags) {
$params['s'] = $tags;
if($a->pager['page'] != 1)
@@ -40,15 +41,17 @@ function match_content(&$a) {
}
if(count($j->results)) {
+
+ $tpl = get_markup_template('match.tpl');
foreach($j->results as $jj) {
-
- $o .= '<div class="profile-match-wrapper"><div class="profile-match-photo">';
- $o .= '<a href="' . $jj->url . '">' . '<img src="' . $jj->photo . '" alt="' . $jj->name . '" title="' . $jj->name . '[' . $jj->tags . ']' . '" /></a></div>';
- $o .= '<div class="profile-match-break"></div>';
- $o .= '<div class="profile-match-name"><a href="' . $jj->url . '" title="' . $jj->name . '[' . $jj->url .']' . '">' . $jj->name . '</a></div>';
- $o .= '<div class="profile-match-end"></div></div>';
+
+ $o .= replace_macros($tpl,array(
+ '$url' => $jj->url,
+ '$name' => $jj->name,
+ '$photo' => $jj->photo,
+ '$tags' => $jj->tags
+ ));
}
- $o .= '<div id="profile-match-wrapper-end"></div>';
}
else {
info( t('No matches') . EOL);
diff --git a/mod/search.php b/mod/search.php
index 396b50738..034794e17 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -13,7 +13,7 @@ function search_saved_searches() {
$o .= '<h3>' . t('Saved Searches') . '</h3>' . "\r\n";
$o .= '<ul id="saved-search-ul">' . "\r\n";
foreach($r as $rr) {
- $o .= '<li class="saved-search-li clear"><a href="search/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="search/?f&search=' . $rr['term'] . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
+ $o .= '<li class="saved-search-li clear"><a href="search/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="search/?f=&search=' . $rr['term'] . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
}
$o .= '</ul></div>' . "\r\n";
}
diff --git a/mod/tagmatch.php b/mod/tagmatch.php
new file mode 100644
index 000000000..b2313694b
--- /dev/null
+++ b/mod/tagmatch.php
@@ -0,0 +1,54 @@
+<?php
+
+
+function tagmatch_content(&$a) {
+
+ $search = $_REQUEST['search'];
+
+ $o = '';
+ if(! local_user())
+ return;
+
+ $o .= '<h2>' . t('Tag Match') . ' - ' . notags($search) . '</h2>';
+
+
+ if($search) {
+ $params['s'] = $search;
+ if($a->pager['page'] != 1)
+ $params['p'] = $a->pager['page'];
+
+ if(strlen(get_config('system','directory_submit_url')))
+ $x = fetch_url('http://dir.friendika.com/lsearch?f=&search=' . urlencode($search));
+// else
+// $x = post_url($a->get_baseurl() . '/msearch', $params);
+
+ $j = json_decode($x);
+
+ if($j->total) {
+ $a->set_pager_total($j->total);
+ $a->set_pager_itemspage($j->items_page);
+ }
+
+ if(count($j->results)) {
+
+ $tpl = get_markup_template('match.tpl');
+ foreach($j->results as $jj) {
+
+ $o .= replace_macros($tpl,array(
+ '$url' => $jj->url,
+ '$name' => $jj->name,
+ '$photo' => $jj->photo,
+ '$tags' => $jj->tags
+ ));
+ }
+ }
+ else {
+ info( t('No matches') . EOL);
+ }
+
+ }
+
+ $o .= '<div class="clear"></div>';
+ $o .= paginate($a);
+ return $o;
+}
diff --git a/view/match.tpl b/view/match.tpl
new file mode 100644
index 000000000..330245a2a
--- /dev/null
+++ b/view/match.tpl
@@ -0,0 +1,12 @@
+<div class="profile-match-wrapper">
+ <div class="profile-match-photo">
+ <a href="$url">
+ <img src="$photo" alt="$name" title="$name[$tags]" />
+ </a>
+ </div>
+ <div class="profile-match-break"></div>
+ <div class="profile-match-name">
+ <a href="$url" title="$name[$tags]">$name</a>
+ </div>
+ <div class="profile-match-end"></div>
+</div> \ No newline at end of file
diff --git a/view/theme/testbubble/match.tpl b/view/theme/testbubble/match.tpl
new file mode 100644
index 000000000..49c3c81e4
--- /dev/null
+++ b/view/theme/testbubble/match.tpl
@@ -0,0 +1,10 @@
+<div class="profile-match-wrapper">
+ <div class="profile-match-photo">
+ <a href="$url">
+ <img src="$photo" alt="$name" />
+ </a>
+ </div>
+ <span><a href="$url">$name</a> is interested in:<br />$tags</span>
+ <div class="profile-match-break"></div>
+ <div class="profile-match-end"></div>
+</div> \ No newline at end of file
diff --git a/view/theme/testbubble/style.css b/view/theme/testbubble/style.css
index 8ef2b6619..a468296fb 100644
--- a/view/theme/testbubble/style.css
+++ b/view/theme/testbubble/style.css
@@ -841,11 +841,10 @@ profile-jot-banner-wrapper {
/* ========= */
.wall-item-outside-wrapper {
- max-width: 85%;
+ max-width: 83%;
border-bottom: 1px solid #dedede;
margin-top: 20px;
padding-right: 10px;
- overflow: hidden;
}
.wall-item-outside-wrapper-end { clear: both;}
@@ -1251,14 +1250,26 @@ div[id$="wrapper"] br { clear: left; }
}
.profile-match-wrapper {
- width: 300px;
- padding: 5px;
+ width: 80%;
+ padding: 15px;
margin-bottom:10px;
+ margin-left: 20px;
background-color: #f6f6f6;
border: 1px solid #dddddd;
-moz-box-shadow: 3px 3px 4px #959494;
-webkit-box-shadow: 3px 3px 4px #959494;
- box-shadow: 3px 3px 4px #959494;
+ box-shadow: 3px 3px 4px #959494;
+ clear: both;
+}
+
+.profile-match-end {
+ clear: both;
+}
+
+.profile-match-photo {
+ float: left;
+ margin-right: 10px;
+ margin-bottom: 5px;
}
/* ========== */
@@ -1717,48 +1728,6 @@ margin-left: 0px;
border: 1px solid #dddddd;
}
-/* ================= */
-/* = Notifications = */
-/* ================= */
-
-/*#notification-show-hide-wrapper {
- width: 160px;
- -moz-box-shadow:inset 0px 1px 0px 0px #cfcfcf;
- -webkit-box-shadow:inset 0px 1px 0px 0px #cfcfcf;
- box-shadow:inset 0px 1px 0px 0px #cfcfcf;
- background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #bdbdbd), color-stop(1, #a2a2a2) );
- background:-moz-linear-gradient( center top, #bdbdbd 5%, #a2a2a2 100% );
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bdbdbd', endColorstr='#a2a2a2');
- background-color:#bdbdbd;
- -moz-border-radius:5px;
- -webkit-border-radius:5px;
- border-radius:5px;
- padding: 5px 10px 5px 10px;
- margin-right: 5px;
- margin-top: 10px;
- font-style: bold;
- color: #efefef;
- text-align: center;
-}
-
-#notification-show-hide-wrapper:hover {
- color: #efefef;
- background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #b20202), color-stop(1, #d60808) );
- background:-moz-linear-gradient( center top, #b20202 5%, #d60808 100% );
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#b20202', endColorstr='#d60808');
- background-color:#b20202;
-}
-
-#notification-show-hide-wrapper:active {
- background-color: #b20202;
- position:relative;
- top:1px;
-}
-
-#notification-show-hide-wrapper a {
- color: #efefef;
-}*/
-
/* ============ */
/* = Contacts = */
/* ============ */