aboutsummaryrefslogtreecommitdiffstats
path: root/mod/thing.php
blob: 723b069bc18434fdaa7929e32027f866e1d2b571 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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) {




}