Merge pull request #2830 from annando/1610-account_type

The account type is now read and displayed
This commit is contained in:
rabuzarus 2016-10-02 14:55:52 +02:00 committed by GitHub
commit fa33f94b29
16 changed files with 85 additions and 59 deletions

View file

@ -76,7 +76,7 @@ function allfriends_content(&$a) {
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],
'about' => $contact_details['about'],
'account_type' => (($contact_details['community']) ? t('Forum') : ''),
'account_type' => account_type($contact_details),
'network' => network_to_name($contact_details['network'], $contact_details['url']),
'photo_menu' => $photo_menu,
'conntxt' => t('Connect'),

View file

@ -40,10 +40,7 @@ function cal_init(&$a) {
$profile = get_profiledata_by_nick($nick, $a->profile_uid);
if((intval($profile['page-flags']) == PAGE_COMMUNITY) || (intval($profile['page-flags']) == PAGE_PRVGROUP))
$account_type = t('Forum');
else
$account_type = "";
$account_type = account_type($profile);
$tpl = get_markup_template("vcard-widget.tpl");

View file

@ -120,7 +120,7 @@ function common_content(&$a) {
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],
'about' => $contact_details['about'],
'account_type' => (($contact_details['community']) ? t('Forum') : ''),
'account_type' => account_type($contact_details),
'network' => network_to_name($contact_details['network'], $contact_details['url']),
'photo_menu' => $photo_menu,
'id' => ++$id,

View file

@ -38,7 +38,7 @@ function contacts_init(&$a) {
if (($a->data['contact']['network'] != "") AND ($a->data['contact']['network'] != NETWORK_DFRN)) {
$networkname = format_network_name($a->data['contact']['network'],$a->data['contact']['url']);
} else
} else
$networkname = '';
$vcard_widget = replace_macros(get_markup_template("vcard-widget.tpl"),array(
@ -48,7 +48,7 @@ function contacts_init(&$a) {
'$addr' => (($a->data['contact']['addr'] != "") ? ($a->data['contact']['addr']) : ""),
'$network_name' => $networkname,
'$network' => t('Network:'),
'account_type' => (($a->data['contact']['forum'] || $a->data['contact']['prv']) ? t('Forum') : '')
'$account_type' => account_type($a->data['contact'])
));
$finpeople_widget = '';
$follow_widget = '';
@ -623,7 +623,7 @@ function contacts_content(&$a) {
'$url' => $url,
'$profileurllabel' => t('Profile URL'),
'$profileurl' => $contact['url'],
'account_type' => (($contact['forum'] || $contact['prv']) ? t('Forum') : ''),
'$account_type' => account_type($contact),
'$location' => bbcode($contact["location"]),
'$location_label' => t("Location:"),
'$xmpp' => bbcode($contact["xmpp"]),
@ -910,8 +910,6 @@ function contact_posts($a, $contact_id) {
function _contact_detail_for_template($rr){
$community = '';
switch($rr['rel']) {
case CONTACT_IS_FRIEND:
$dir_icon = 'images/lrarrow.gif';
@ -937,11 +935,6 @@ function _contact_detail_for_template($rr){
$sparkle = '';
}
//test if contact is a forum page
if (isset($rr['forum']) OR isset($rr['prv']))
$community = ($rr['forum'] OR $rr['prv']);
return array(
'img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']),
'edit_hover' => t('Edit contact'),
@ -952,7 +945,7 @@ function _contact_detail_for_template($rr){
'thumb' => proxy_url($rr['thumb'], false, PROXY_SIZE_THUMB),
'name' => htmlentities($rr['name']),
'username' => htmlentities($rr['name']),
'account_type' => ($community ? t('Forum') : ''),
'account_type' => account_type($rr),
'sparkle' => $sparkle,
'itemurl' => (($rr['addr'] != "") ? $rr['addr'] : $rr['url']),
'url' => $url,

View file

@ -99,7 +99,6 @@ function directory_content(&$a) {
foreach($r as $rr) {
$community = '';
$itemurl= '';
$itemurl = (($rr['addr'] != "") ? $rr['addr'] : $rr['profile_url']);
@ -128,13 +127,6 @@ function directory_content(&$a) {
// if(strlen($rr['gender']))
// $details .= '<br />' . t('Gender: ') . $rr['gender'];
// show if account is a community account
/// @TODO The other page types should be also respected, but first we need a good
/// translatiion and systemwide consistency for displaying the page type
if((intval($rr['page-flags']) == PAGE_COMMUNITY) OR (intval($rr['page-flags']) == PAGE_PRVGROUP))
$community = true;
$profile = $rr;
if((x($profile,'address') == 1)
@ -171,7 +163,7 @@ function directory_content(&$a) {
'img_hover' => $rr['name'],
'name' => $rr['name'],
'details' => $details,
'account_type' => ($community ? t('Forum') : ''),
'account_type' => account_type($rr),
'profile' => $profile,
'location' => $location_e,
'tags' => $rr['pub_keywords'],

View file

@ -220,7 +220,7 @@ function dirfind_content(&$a, $prefix = "") {
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],
'about' => $contact_details['about'],
'account_type' => (($contact_details['community']) ? t('Forum') : ''),
'account_type' => account_type($contact_details),
'network' => network_to_name($jj->network, $jj->url),
'id' => ++$id,
);

View file

@ -77,10 +77,9 @@ function hovercard_content() {
// 'server_url' => $contact["server_url"],
'bd' => (($contact["birthday"] == "0000-00-00") ? "" : $contact["birthday"]),
// 'generation' => $contact["generation"],
'account_type' => ($contact['community'] ? t("Forum") : ""),
'account_type' => account_type($contact),
'actions' => $actions,
);
if($datatype == "html") {
$t = get_markup_template("hovercard.tpl");

View file

@ -81,7 +81,7 @@ function match_content(&$a) {
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],
'about' => $contact_details['about'],
'account_type' => (($contact_details['community']) ? t('Forum') : ''),
'account_type' => account_type($contact_details),
'thumb' => proxy_url($jj->photo, false, PROXY_SIZE_THUMB),
'inttxt' => ' ' . t('is interested in:'),
'conntxt' => t('Connect'),

View file

@ -502,7 +502,7 @@ function network_content(&$a, $update = 0) {
}
elseif($cid) {
$r = q("SELECT `id`,`name`,`network`,`writable`,`nurl`, `forum`, `prv`, `addr`, `thumb`, `location` FROM `contact` WHERE `id` = %d
$r = q("SELECT `id`,`name`,`network`,`writable`,`nurl`, `forum`, `prv`, `contact-type`, `addr`, `thumb`, `location` FROM `contact` WHERE `id` = %d
AND `blocked` = 0 AND `pending` = 0 LIMIT 1",
intval($cid)
);
@ -514,10 +514,11 @@ function network_content(&$a, $update = 0) {
'name' => htmlentities($r[0]['name']),
'itemurl' => (($r[0]['addr']) ? ($r[0]['addr']) : ($r[0]['nurl'])),
'thumb' => proxy_url($r[0]['thumb'], false, PROXY_SIZE_THUMB),
'account_type' => (($r[0]['forum']) || ($r[0]['prv']) ? t('Forum') : ''),
'details' => $r[0]['location'],
);
$entries[0]["account_type"] = account_type($r[0]);
$o = replace_macros(get_markup_template("viewcontact_template.tpl"),array(
'contacts' => $entries,
'id' => 'network',

View file

@ -38,10 +38,7 @@ function photos_init(&$a) {
$profile = get_profiledata_by_nick($nick, $a->profile_uid);
if((intval($profile['page-flags']) == PAGE_COMMUNITY) || (intval($profile['page-flags']) == PAGE_PRVGROUP))
$account_type = t('Forum');
else
$account_type = "";
$account_type = account_type($profile);
$tpl = get_markup_template("vcard-widget.tpl");

View file

@ -95,7 +95,7 @@ function suggest_content(&$a) {
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],
'about' => $contact_details['about'],
'account_type' => (($contact_details['community']) ? t('Forum') : ''),
'account_type' => account_type($contact_details),
'ignlnk' => $ignlnk,
'ignid' => $rr['id'],
'conntxt' => t('Connect'),
@ -113,7 +113,6 @@ function suggest_content(&$a) {
$o .= replace_macros($tpl,array(
'$title' => t('Friend Suggestions'),
'$contacts' => $entries,
));
return $o;

View file

@ -33,10 +33,7 @@ function videos_init(&$a) {
$profile = get_profiledata_by_nick($nick, $a->profile_uid);
if((intval($profile['page-flags']) == PAGE_COMMUNITY) || (intval($profile['page-flags']) == PAGE_PRVGROUP))
$account_type = t('Forum');
else
$account_type = "";
$account_type = account_type($profile);
$tpl = get_markup_template("vcard-widget.tpl");

View file

@ -102,7 +102,7 @@ function viewcontacts_content(&$a) {
'details' => $contact_details['location'],
'tags' => $contact_details['keywords'],
'about' => $contact_details['about'],
'account_type' => (($contact_details['community']) ? t('Forum') : ''),
'account_type' => account_type($contact_details),
'url' => $url,
'sparkle' => '',
'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']),