By husztisanyi on
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
Used this code to display skype in block on user page
1. I only created the first cck field.
2. PHP input filter in a new block with the following code.
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).
Use of module theme function
This approach is better, icon image is served from same website (same domain name) useful in https websites and use module theme format.