Hi,
this is my first MOD i do alone, so please excuse any errors or any complications with other MOD's.
What?This little addon to 4images let your users put their skype-name into their profile, and shows automaticly the status (online,offline, etc) of the member in his profile.
Your users have to install skype 2.x in order to show the actual status. If a user is using a lower version will show status "unknown" (thx 2 v@no)
Files to edit/includes/db_field_definitions.php
/lang/main.php
/member.php
/templates/yourtemplate/member_editprofile.html
/templates/yourtemplate/member_profile.html
Time / Difficulty10 minutes / easy
Demo:here:
http://www.ggrec.com/zapomnime2/member.php?user_id=44&action=showprofileScreenshot:
********************
Step 1add a new field into your 4images_users (using PhpMyAdmin)
user_skype varchar(255) cp1251_general_ci <-- (only for cyrillic suport)
Step 2open /includes/
db_field_definitions.phpfind:
?>
add
above:
$additional_user_fields['user_skype'] = array($lang['user_skype'], "text", 0);
save & close
Step 3open /lang/english/
main.phpfind:
$lang['icq'] = "ICQ:";
add
below$lang['skype'] = "Skype";
$lang['skype_status'] = "Status";
save & close
Step 4open
member.phpfind:
$sql = "UPDATE ".USERS_TABLE."
SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'".$additional_sql."
WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id'];
replace with:
$sql = "UPDATE ".USERS_TABLE."
SET ".get_user_table_field("", "user_email")." = '$user_email', ".get_user_table_field("", "user_showemail")." = $user_showemail, ".get_user_table_field("", "user_allowemails")." = $user_allowemails, ".get_user_table_field("", "user_invisible")." = $user_invisible, ".get_user_table_field("", "user_homepage")." = '$user_homepage', ".get_user_table_field("", "user_icq")." = '$user_icq'".$additional_sql." ".get_user_table_field("", "user_skype")." = '$user_skype'".$additional_sql."
WHERE ".get_user_table_field("", "user_id")." = ".$user_info['user_id'];
find:
$user_icq = (isset($HTTP_POST_VARS['user_icq'])) ? ((intval(trim($HTTP_POST_VARS['user_icq']))) ? intval(trim($HTTP_POST_VARS['user_icq'])) : "") : "";
add
below$user_skype = (isset($HTTP_POST_VARS['user_skype'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['user_skype'])) : "";
find:
"user_icq_button" => $user_icq_button,
add
below
"user_skype" => $user_skype,
find:
"lang_icq" => $lang['icq'],
add
below"lang_skype" => $lang['skype'],
find:
$user_icq = (isset($user_row['user_icq'])) ? $user_row['user_icq'] : REPLACE_EMPTY;
if (!empty($user_icq) && $user_icq != REPLACE_EMPTY) {
$user_icq_button = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=".$user_icq."\" target=\"_blank\"><img src=\"http://web.icq.com/whitepages/online?icq=".$user_icq."&img=5\" width=\"18\" height=\"18\" border=\"0\" alt=\"".$user_icq."\" /></a>";
}
else {
$user_icq_button = REPLACE_EMPTY;
}
add
below$user_skype = (isset($user_row['user_skype'])) ? $user_row['user_skype'] : REPLACE_EMPTY;
Step 5open /templetaes/yourtemplate/
member_editprofile.htmlfind
<TR>
<TD class="row2"><B>{lang_icq}</B></TD>
<TD class="row2"><INPUT type="text" name="user_icq" size="30" value="{user_icq}" class="input" /></TD>
</TR>
add
below <TR>
<TD class="row2"><B>{lang_skype}</B></TD>
<TD class="row2"><INPUT type="text" name="user_skype" size="30" value="{user_skype}" class="input" /></TD>
</TR>
Step 6open /templates/yourtemplate/
member_profile.htmlfind:
<tr>
<td class="row2"><b>{lang_icq}</b></td>
<td class="row2">{if user_icq}<a href="http://wwp.icq.com/scripts/search.dll?to={user_icq}">{user_icq}</a> (<b>{user_icq_status}</b>){endif user_icq}</td>
</tr>
add
below {if user_skype}<TR>
<TD class="row2"><B>SKYPE</B></TD>
<TD class="row2"><a href="callto://{user_skype}">call me!</a> my current status: <img src="http://mystatus.skype.com/smallclassic/{user_skype}.png"></TD>
</TR>{endif user_skype}
******************************
Of course you have to edit your templates to your design. You can also use additional language tags for "call me" etc., just register them in your main language file and use them in your templates.
You can also link the status button to the "call me" function when you past in step 6 this code:
<TR>
<TD class="row2">{lang_skype}</TD>
<TD class="row2"><a href="callto://{user_skype}"> <img src="http://mystatus.skype.com/smallclassic/{user_skype}.png" border=0></a> </TD>
</TR>
In order to use the status, the user has to enabled "show status on web" , FAQ here: http://www.skype.com/share/buttons/status.html and Skype 2.x has to been installed!
For
custom status icons check V@no's answer right below (5)
MOD has ben coded and tested oin a fresh 4images 1.7.1 installation. More expirienced members, please post any bugfixes for that MOD, its my first one so i maybe made a mistake - at least it works