aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-28 14:30:23 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-28 14:30:23 +0000
commit4711091be04584cdab4060a6ff4e0bea03bc00e9 (patch)
tree2c5c659547c0ffa32175480559e0b36c7d5f0687
parent52dd8afa5be3dabcb49cd2a404acb57d6fefb98b (diff)
downloadelgg-4711091be04584cdab4060a6ff4e0bea03bc00e9.tar.gz
elgg-4711091be04584cdab4060a6ff4e0bea03bc00e9.tar.bz2
Subtypes and object types for search.
git-svn-id: https://code.elgg.org/elgg/trunk@742 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--search/index.php4
-rw-r--r--views/default/output/tagcloud.php13
-rw-r--r--views/default/output/tags.php15
3 files changed, 28 insertions, 4 deletions
diff --git a/search/index.php b/search/index.php
index cd5511b8b..36916b0d5 100644
--- a/search/index.php
+++ b/search/index.php
@@ -18,10 +18,12 @@
// Get input
$tag = get_input('tag');
$offset = get_input('offset',0);
+ $subtype = get_input('subtype');
+ $objecttype = get_input('object');
$body = "";
- if ($entities = get_entities_from_metadata("",$tag,"","",15,$offset)) {
+ if ($entities = get_entities_from_metadata("",$tag,"",$subtype,15,$offset)) {
foreach($entities as $entity) {
$body .= elgg_view_entity($entity);
diff --git a/views/default/output/tagcloud.php b/views/default/output/tagcloud.php
index 89b6f0371..8abdd715d 100644
--- a/views/default/output/tagcloud.php
+++ b/views/default/output/tagcloud.php
@@ -15,6 +15,17 @@
*
*/
+ if (!empty($vars['subtype'])) {
+ $subtype = "&subtype=" . urlencode($vars['subtype']);
+ } else {
+ $subtype = "";
+ }
+ if (!empty($vars['object'])) {
+ $object = "&object=" . urlencode($vars['object']);
+ } else {
+ $object = "";
+ }
+
if (!empty($vars['tagcloud']) && is_array($vars['tagcloud'])) {
$counter = 0;
@@ -29,7 +40,7 @@
if (!empty($cloud)) $cloud .= ", ";
$size = round((log($tag->total) / log($max)) * 100) + 30;
if ($size < 60) $size = 60;
- $cloud .= "<a href=\"" . $vars['url'] . "search/?tag=". urlencode($tag->tag) . "\" style=\"font-size: {$size}%\" title=\"".addslashes($tag->tag)." ({$tag->total})\" style=\"text-decoration:none;\">" .$tag->tag . "</a>";
+ $cloud .= "<a href=\"" . $vars['url'] . "search/?tag=". urlencode($tag->tag) . $object . $subtype . "\" style=\"font-size: {$size}%\" title=\"".addslashes($tag->tag)." ({$tag->total})\" style=\"text-decoration:none;\">" .$tag->tag . "</a>";
}
echo $cloud;
diff --git a/views/default/output/tags.php b/views/default/output/tags.php
index d559e10b3..30edffe1f 100644
--- a/views/default/output/tags.php
+++ b/views/default/output/tags.php
@@ -14,9 +14,20 @@
* @link http://elgg.org/
*
* @uses $vars['tags'] The tags to display
- *
+ * @uses $vars['tagtype'] The tagtype, optionally
*/
+ if (!empty($vars['subtype'])) {
+ $subtype = "&subtype=" . urlencode($vars['subtype']);
+ } else {
+ $subtype = "";
+ }
+ if (!empty($vars['object'])) {
+ $object = "&object=" . urlencode($vars['object']);
+ } else {
+ $object = "";
+ }
+
if (empty($vars['tags']) && !empty($vars['value']))
$vars['tags'] = $vars['value'];
if (!empty($vars['tags'])) {
@@ -35,7 +46,7 @@
$type = "";
}
if (is_string($tag)) {
- $tagstr .= "<a href=\"{$vars['url']}search/?tag=".urlencode($tag) . "{$type}\">{$tag}</a>";
+ $tagstr .= "<a href=\"{$vars['url']}search/?tag=".urlencode($tag) . "{$type}{$tagtype}{$object}\">{$tag}</a>";
}
}
echo $tagstr;