diff options
author | friendica <info@friendica.com> | 2013-06-27 19:35:59 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-06-27 19:35:59 -0700 |
commit | cdc66da52fb985c33e27b955324dd977830a1d8c (patch) | |
tree | 6896bf8d57b224231ec2a8c9fe4b84893b883cd3 /mod/thing.php | |
parent | 230aeb782eaea85626640d14f5949606de73d502 (diff) | |
download | volse-hubzilla-cdc66da52fb985c33e27b955324dd977830a1d8c.tar.gz volse-hubzilla-cdc66da52fb985c33e27b955324dd977830a1d8c.tar.bz2 volse-hubzilla-cdc66da52fb985c33e27b955324dd977830a1d8c.zip |
Basic ability to create "things"
Diffstat (limited to 'mod/thing.php')
-rw-r--r-- | mod/thing.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/mod/thing.php b/mod/thing.php new file mode 100644 index 000000000..723b069bc --- /dev/null +++ b/mod/thing.php @@ -0,0 +1,43 @@ +<?php /** @file */ + + + +function thing_init(&$a) { + + if(! local_user()) + return; + + $account_id = $a->get_account(); + + $name = escape_tags($_REQUEST['term']); + $url = $_REQUEST['link']; + $photo = $_REQUEST['photo']; + + $hash = random_string(); + + + if(! $name) + return; + + $r = q("insert into term ( aid, uid, oid, otype, type, term, url, imgurl, term_hash ) + values( %d, %d, %d, %d, %d, '%s', '%s', '%s', '%s' ) ", + intval($account_id), + intval(local_user()), + 0, + TERM_OBJ_THING, + TERM_THING, + dbesc($name), + dbesc(($url) ? $url : z_root() . '/thing/' . $hash), + dbesc(($photo) ? $photo : ''), + dbesc($hash) + ); + +} + + +function thing_content(&$a) { + + + + +} |