+ if(local_user()) {
+ if(strlen($a->path)) {
+ $myaddr = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
+ }
+ else {
+ $myaddr = $a->user['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 );
+ }
+ }
+ elseif(x($_GET,'addr')) {
+ $myaddr = hex2bin($_GET['addr']);
+ }
+ else {
+ /* $_GET variables are already urldecoded */
+ $myaddr = ((x($_GET,'address')) ? $_GET['address'] : '');
+ }
+
+ $target_addr = $a->profile['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 );
+
+
+ /**
+ *
+ * The auto_request form only has the profile address
+ * because nobody is going to read the comments and
+ * it doesn't matter if they know you or not.
+ *
+ */
+
+ if($a->profile['page-flags'] == PAGE_NORMAL)
+ $tpl = get_markup_template('dfrn_request.tpl');
+ else
+ $tpl = get_markup_template('auto_request.tpl');
+
+ $page_desc = sprintf( t('Diaspora members: Please do not use this form. Instead, enter "%s" into your Diaspora search bar.'),
+ $target_addr) . EOL . EOL;
+
+ $page_desc .= t("Please enter your 'Identity Address' from one of the following supported social networks:");
+
+ $o .= replace_macros($tpl,array(
+ '$header' => t('Friend/Connection Request'),
+ '$desc' => t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@identi.ca'),
+ '$pls_answer' => t('Please answer the following:'),
+ '$does_know' => sprintf( t('Does %s know you?'),$a->profile['name']),
+ '$yes' => t('Yes'),
+ '$no' => t('No'),
+ '$add_note' => t('Add a personal note:'),
+ '$page_desc' => $page_desc,
+ '$friendika' => t('Friendica'),
+ '$statusnet' => t('StatusNet/Federated Social Web'),
+ '$diaspora' => t('Diaspora'),
+ '$diasnote' => t('- please share from your own site as noted above'),
+ '$your_address' => t('Your Identity Address:'),
+ '$submit' => t('Submit Request'),
+ '$cancel' => t('Cancel'),
+ '$nickname' => $a->argv[1],
+ '$name' => $a->profile['name'],
+ '$myaddr' => $myaddr
+ ));
+ return $o;