]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
added the framework to get a list of photos tagged with a user
authorCash Costello <cash.costello@gmail.com>
Thu, 18 Jun 2009 01:54:52 +0000 (01:54 +0000)
committerCash Costello <cash.costello@gmail.com>
Thu, 18 Jun 2009 01:54:52 +0000 (01:54 +0000)
search.php [new file with mode: 0644]
start.php
views/default/object/image.php

diff --git a/search.php b/search.php
new file mode 100644 (file)
index 0000000..2899d2c
--- /dev/null
@@ -0,0 +1,24 @@
+<?php\r
+\r
+       include_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");\r
+       \r
+       // Set context\r
+       set_context('search');\r
+       \r
+       // Get user guid\r
+       $guid = get_input('guid');\r
+       \r
+       $user = get_entity($guid);\r
+//     if ($user)\r
+//             $user->name;\r
+               \r
+       $title = $user->name;\r
+       \r
+       \r
+       $body = elgg_view_title($title); \r
+       $body .= list_entities_from_relationship('phototag', $guid, false, 'object', 'image'); \r
+       $body = elgg_view_layout('two_column_left_sidebar','',$body);\r
+\r
+       page_draw($title,$body);\r
+\r
+?>
\ No newline at end of file
index 9c59fd8e6788761be5638339ed906e8fb6b8ebd0..6318a3da1d6e3d744e9d87348aef89ca9675a07f 100644 (file)
--- a/start.php
+++ b/start.php
                                        include($CONFIG->pluginspath . "tidypics/world.php");\r
                                break;\r
                                \r
+                               case "search": //view an image individually\r
+                                       if (isset($page[1])) set_input('guid',$page[1]);\r
+                                       include($CONFIG->pluginspath . "tidypics/search.php");\r
+                               break;\r
+\r
                                case "rate": //rate image\r
                                        if (isset($page[1])) set_input('guid',$page[1]);\r
                                        include($CONFIG->pluginspath . "tidypics/actions/rate.php");\r
index d86f3ca462c5c97d88f55ae31d1988635c5a5262..d7b791a7885bdab83f18b0233d4182b3340ce910 100644 (file)
@@ -30,7 +30,7 @@ if ($photo_tags) {
                
 
                $phototag_text = $photo_tag->value;
-               $phototag_link = $vars['url'] . "word";
+               $phototag_link = $vars['url'] . 'search/?tag=' . $phototag_text . '&amp;subtype=image&amp;object=object';
                if ($photo_tag->type === 'user') {
                        $user = get_entity($photo_tag->value);
                        if ($user)
@@ -38,7 +38,7 @@ if ($photo_tags) {
                        else
                                $phototag_text = "unknown user";
                        
-                       $phototag_link = $vars['url'] . "user";
+                       $phototag_link = $vars['url'] . "pg/photos/search/" . $photo_tag->value;
                }
 
                // hack to handle format of Pedro Prez's tags - ugh