3 require_once('include/socgraph.php');
4 require_once('include/contact_widgets.php');
7 function suggest_init(&$a) {
11 if(x($_GET,'ignore') && intval($_GET['ignore'])) {
12 // Check if we should do HTML-based delete confirmation
13 if($_REQUEST['confirm']) {
14 // <form> can't take arguments in its "action" parameter
15 // so add any arguments as hidden inputs
16 $query = explode_querystring($a->query_string);
18 foreach($query['args'] as $arg) {
19 if(strpos($arg, 'confirm=') === false) {
20 $arg_parts = explode('=', $arg);
21 $inputs[] = array('name' => $arg_parts[0], 'value' => $arg_parts[1]);
25 $a->page['content'] = replace_macros(get_markup_template('confirm.tpl'), array(
27 '$message' => t('Do you really want to delete this suggestion?'),
28 '$extra_inputs' => $inputs,
29 '$confirm' => t('Yes'),
30 '$confirm_url' => $query['base'],
31 '$confirm_name' => 'confirmed',
32 '$cancel' => t('Cancel'),
34 $a->error = 1; // Set $a->error so the other module functions don't execute
37 // Now check how the user responded to the confirmation query
38 if(!$_REQUEST['canceled']) {
39 q("insert into gcign ( uid, gcid ) values ( %d, %d ) ",
41 intval($_GET['ignore'])
52 function suggest_content(&$a) {
54 require_once("mod/proxy.php");
58 notice( t('Permission denied.') . EOL);
62 $_SESSION['return_url'] = $a->get_baseurl() . '/' . $a->cmd;
64 $a->page['aside'] .= follow_widget();
65 $a->page['aside'] .= findpeople_widget();
68 $o .= replace_macros(get_markup_template("section_title.tpl"),array(
69 '$title' => t('Friend Suggestions')
73 $r = suggestion_query(local_user());
76 $o .= t('No suggestions available. If this is a new site, please try again in 24 hours.');
80 $tpl = get_markup_template('suggest_friends.tpl');
84 $connlnk = $a->get_baseurl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
86 $o .= replace_macros($tpl,array(
87 '$url' => zrl($rr['url']),
88 '$name' => $rr['name'],
89 '$photo' => proxy_url($rr['photo']),
90 '$ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'],
91 '$ignid' => $rr['id'],
92 '$conntxt' => t('Connect'),
93 '$connlnk' => $connlnk,
94 '$ignore' => t('Ignore/Hide')
99 // $o .= paginate($a);