3 require_once('include/security.php');
4 require_once('include/bbcode.php');
5 require_once('include/items.php');
6 require_once('include/like.php');
8 if(! function_exists('like_content')) {
9 function like_content(&$a) {
10 if(! local_user() && ! remote_user()) {
15 $verb = notags(trim($_GET['verb']));
20 $item_id = (($a->argc > 1) ? notags(trim($a->argv[1])) : 0);
22 $r = do_like($item_id, $verb);
25 // See if we've been passed a return path to redirect to
26 $return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');
28 like_content_return($a->get_baseurl(), $return_path);
29 killme(); // NOTREACHED
30 // return; // NOTREACHED
34 // Decide how to return. If we were called with a 'return' argument,
35 // then redirect back to the calling page. If not, just quietly end
36 if(! function_exists('like_content_return')) {
37 function like_content_return($baseurl, $return_path) {
40 $rand = '_=' . time();
41 if(strpos($return_path, '?')) $rand = "&$rand";
42 else $rand = "?$rand";
44 goaway($baseurl . "/" . $return_path . $rand);