Skip to content

Commit

Permalink
AI-46 Used logos returned by API rather than custom logos in extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Edzelopez committed May 14, 2015
1 parent d7b99b7 commit b808b90
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions CRM/Attentively/BAO/Attentively.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static public function pullMembers() {
$errors[] = $result['error'];
}
curl_close($ch);

if ($result['success'] && $result['deferred_status'] == 'complete') {
// Store members
foreach ($result['members'] as $key => $value) {
Expand Down Expand Up @@ -190,6 +190,7 @@ static public function pullMembers() {
$network[$key][$k]['name'] = $networks->name;
$network[$key][$k]['url'] = $networks->url;
$network[$key][$k]['photo'] = $networks->photo;
$network[$key][$k]['icon'] = $networks->icon;
}
}
foreach ($network as $key => $v) {
Expand All @@ -198,8 +199,8 @@ static public function pullMembers() {
$flag = CRM_Core_DAO::singleValueQuery($check);
if ($flag)
continue;
$query = "INSERT INTO civicrm_attentively_member_network (`contact_id`, `name`, `url`, `photo`)
VALUES ( '{$value['contact_id']}', '{$value['name']}', '{$value['url']}', '{$value['photo']}' )";
$query = "INSERT INTO civicrm_attentively_member_network (`contact_id`, `name`, `url`, `photo`, `icon`)
VALUES ( '{$value['contact_id']}', '{$value['name']}', '{$value['url']}', '{$value['photo']}', '{$value['icon']}' )";
$dao = CRM_Core_DAO::executeQuery($query);
}
}
Expand Down Expand Up @@ -353,6 +354,7 @@ static public function getNetworks($cid) {
elseif ($dao->name != 'klout') {
$network[$dao->name]['url'] = $dao->url;
$network[$dao->name]['image'] = '<img class="network-image" src="' .$config->extensionsURL. '/biz.jmaconsulting.attentively/images/' .$dao->name. '.png" style="width:80px !important; height:80px !important;"/>';
$network[$dao->name]['image'] = '<img class="network-image" src="' .$dao->icon. '" />';
}
if ($dao->photo != '' && $dao->name != 'gravatar') {
$network['gravatar']['image'] = '<img class="photo" src=' . $dao->photo . ' />';
Expand Down
Binary file removed images/facebook.png
Binary file not shown.
Binary file removed images/instagram.png
Binary file not shown.
Binary file removed images/linkedin.png
Binary file not shown.
Binary file removed images/myspace.png
Binary file not shown.
Binary file removed images/pinterest.png
Binary file not shown.
Binary file removed images/tumblr.png
Binary file not shown.
Binary file removed images/tungleme.png
Binary file not shown.
Binary file removed images/twitter.png
Binary file not shown.
1 change: 1 addition & 0 deletions sql/attentively_install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ CREATE TABLE IF NOT EXISTS `civicrm_attentively_member_network` (
`name` varchar(64) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
`photo` varchar(255) DEFAULT NULL,
`icon` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Expand Down
4 changes: 2 additions & 2 deletions templates/CRM/Attentively/Page/SocialMedia.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<style>
.user-avatar, .network-container {ldelim}
.user-avatar {ldelim}
background-color: #fff;
border: 1px solid #a8a8a8;
border-radius: 50%;
Expand Down Expand Up @@ -85,7 +85,7 @@
<tr>
{foreach from=$networkData item=url key=name}
{if $name neq 'gravatar'}
<td style="padding-top:14px; border:none;"><div class="network-container"><a href="{$url.url}">{$url.image}</a></div></td>
<td style="padding-top:14px; padding-bottom:14px; border:none;"><div><a href="{$url.url}">{$url.image} {$name|upper}</a></div></td>
{/if}
{/foreach}
</tr>
Expand Down

0 comments on commit b808b90

Please sign in to comment.