template rework: use viewcontact_template.tpl for contact dealing pages

This commit is contained in:
rabuzarus 2015-10-18 17:12:48 +02:00
commit f9c0c1d696
21 changed files with 185 additions and 33 deletions

View file

@ -799,6 +799,7 @@ function contacts_content(&$a) {
'$cmd' => $a->cmd,
'$contacts' => $contacts,
'$contact_drop_confirm' => t('Do you really want to delete this contact?'),
'multiselect' => 1,
'$batch_actions' => array(
'contacts_batch_update' => t('Update'),
'contacts_batch_block' => t('Block')."/".t("Unblock"),

View file

@ -141,8 +141,8 @@ function dirfind_content(&$a, $prefix = "") {
$entry = array(
'url' => zrl($jj->url),
'name' => htmlentities($jj->name),
'photo' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),
'tags' => $jj->tags,
'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),
'img_hover' => $jj->tags,
'conntxt' => $conntxt,
'connlnk' => $connlnk,
'photo_menu' => $photo_menu,
@ -151,11 +151,11 @@ function dirfind_content(&$a, $prefix = "") {
$entries[] = $entry;
}
$tpl = get_markup_template('match.tpl');
$tpl = get_markup_template('viewcontact_template.tpl');
$o .= replace_macros($tpl,array(
'title' => sprintf( t('People Search - %s'), $search),
'$entries' => $entries,
'$contacts' => $entries,
'$paginate' => paginate($a),
));

View file

@ -56,32 +56,40 @@ function match_content(&$a) {
if(count($j->results)) {
$id = 0;
foreach($j->results as $jj) {
$match_nurl = normalise_link($jj->url);
$match = q("SELECT `nurl` FROM `contact` WHERE `uid` = '%d' AND nurl='%s' LIMIT 1",
intval(local_user()),
dbesc($match_nurl));
if (!count($match)) {
$jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo);
$connlnk = $a->get_baseurl() . '/follow/?url=' . $jj->url;
$photo_menu = array(array(t("View Profile"), zrl($jj->url)));
$photo_menu[] = array(t("Connect/Follow"), $connlnk);
$entry = array(
'url' => zrl($jj->url),
'name' => $jj->name,
'photo' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),
'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),
'inttxt' => ' ' . t('is interested in:'),
'conntxt' => t('Connect'),
'connlnk' => $connlnk,
'tags' => $jj->tags
'img_hover' => $jj->tags,
'photo_menu' => $photo_menu,
'id' => ++$id,
);
$entries[] = $entry;
}
$entries[] = $entry;
}
$tpl = get_markup_template('match.tpl');
$tpl = get_markup_template('viewcontact_template.tpl');
$o .= replace_macros($tpl,array(
'$title' => t('Profile Match'),
'entries' => $entries,
'$contacts' => $entries,
'$paginate' => paginate($a),
));

View file

@ -72,31 +72,41 @@ function suggest_content(&$a) {
return $o;
}
require_once 'include/contact_selectors.php';
foreach($r as $rr) {
$connlnk = $a->get_baseurl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']);
$ignlnk = $a->get_baseurl() . '/suggest?ignore=' . $rr['id'];
$photo_menu = array(array(t("View Profile"), zrl($jj->url)));
$photo_menu[] = array(t("Connect/Follow"), $connlnk);
$photo_menu[] = array(t('Ignore/Hide'), $ignlnk);
$entry = array(
'url' => zrl($rr['url']),
'url_clean' => $rr['url'],
'itemurl' => $rr['url'],
'img_hover' => $rr['url'],
'name' => $rr['name'],
'photo' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB),
'ignlnk' => $a->get_baseurl() . '/suggest?ignore=' . $rr['id'],
'thumb' => proxy_url($rr['photo'], false, PROXY_SIZE_THUMB),
'ignlnk' => $ignlnk,
'ignid' => $rr['id'],
'conntxt' => t('Connect'),
'connlnk' => $connlnk,
'ignore' => t('Ignore/Hide')
'photo_menu' => $photo_menu,
'ignore' => t('Ignore/Hide'),
'network' => network_to_name($rr['network'], $rr['url']),
'id' => ++$id,
);
$entries[] = $entry;
}
$tpl = get_markup_template('suggest_friends.tpl');
$tpl = get_markup_template('viewcontact_template.tpl');
$o .= replace_macros($tpl,array(
'$title' => t('Friend Suggestions'),
'$entries' => $entries,
'$contacts' => $entries,
));
// $o .= paginate($a);
return $o;
}

View file

@ -48,7 +48,7 @@ function viewcontacts_content(&$a) {
if($rr['self'])
continue;
$url = $rr['url'];
$url = $rr['url'];
// route DFRN profiles through the redirect