From f36be066af66e4e21913de3e8b4da0c7a05349b1 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 29 Dec 2013 00:51:27 -0800 Subject: display_thing: it ain't much, but it's implemented. --- include/taxonomy.php | 1 - mod/thing.php | 16 +++++++++++++--- version.inc | 2 +- view/tpl/show_thing.tpl | 8 ++++++++ 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 view/tpl/show_thing.tpl diff --git a/include/taxonomy.php b/include/taxonomy.php index 065f904fc..67263100f 100644 --- a/include/taxonomy.php +++ b/include/taxonomy.php @@ -281,7 +281,6 @@ function get_things($profile_hash,$uid) { intval(TERM_OBJ_THING) ); - $things = $sorted_things = null; $profile_hashes = array(); diff --git a/mod/thing.php b/mod/thing.php index 955a6c173..3e2612c68 100644 --- a/mod/thing.php +++ b/mod/thing.php @@ -180,10 +180,20 @@ function thing_init(&$a) { function thing_content(&$a) { - /* placeholders */ - if(argc() > 1) { - return t('not yet implemented.'); + + $r = q("select * from obj left join term on obj_obj = term_hash where term_hash != '' and obj_type = %d and term_hash = '%s' limit 1", + intval(TERM_OBJ_THING), + dbesc(argv(1)) + ); + + if($r) { + return replace_macros(get_markup_template('show_thing.tpl'), array( '$header' => t('Show Thing'), '$thing' => $r[0] )); + } + else { + notice( t('item not found.') . EOL); + return; + } } require_once('include/contact_selectors.php'); diff --git a/version.inc b/version.inc index e4679339c..ad14d79b1 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2013-12-28.540 +2013-12-29.541 diff --git a/view/tpl/show_thing.tpl b/view/tpl/show_thing.tpl new file mode 100644 index 000000000..d37c9bb1a --- /dev/null +++ b/view/tpl/show_thing.tpl @@ -0,0 +1,8 @@ +

{{$header}}

+{{if $thing}} +
+{{if $thing.imgurl}}{{$thing.term}}{{/if}} +{{$thing.term}} +
+{{/if}} + -- cgit v1.2.3