I made a Skype status button with the Computed field module:

1. First, I made a text cck field, name: field_skype

2. Second, I made an "Computed field" cck field, with this codes and setting:

Computed Code:
$node_field[0]['value'] = $node->field_skype[0]['value'];

Display Format:

if ($node_field_item['value']) {
$display = '<a href="skype:'. $node_field_item['value'] .'?call"><img src="http://mystatus.skype.com/bigclassic/'. $node_field_item['value'] .'" style="border: none;" width="90" height="25" />
</a>';
}

- varchar, 50, sortable

Comments

botris’s picture

1. I only created the first cck field.
2. PHP input filter in a new block with the following code.

$content_profile = content_profile_load('social_media', arg(1));
print '<a href="skype:'. $content_profile->field_socmed_skype[0]['value'] .'?call"><img src="http://mystatus.skype.com/bigclassic/'. $content_profile->field_socmed_skype[0]['value'] .'" style="border: none;" width="90" height="25" />
</a>';

Where 'social_media' is the content type and 'field_socmed_skype' the cck text field.

This will only work when viewing users on other pages you'd have to load the user, instead of using arg(1).

manuel.adan’s picture

This approach is better, icon image is served from same website (same domain name) useful in https websites and use module theme format.

if ($node_field_item['value']) {
  $buttonstyle = variable_get('skype_status_buttonstyle', 'bigclassic');
  $status = skype_status_getstatus(rawurlencode(check_plain($node_field_item['value'])));
  $display = theme('skype_status', check_plain($node_field_item['value']), $buttonstyle, $status);
}