Mod Name / Version User List Add to Address Book 1.0
Description This hack adds a 'Add to Address book' on the user list
Working under UBB.threads 6.1
Any pre-requisites None
Author(s) dimopoulos
Credits ubbdev.com who taught me how to do things in php and ubb threads
Demo None.
Files Altered showmembers.php, /templates/default/showmembers.tmpl
Database Altered No
New Files None
Any other info Please report any problems you might have and I'll try to fix them as soon as possible. Sorry but I have tested this only in version 6.1.
INSTALL
STEP 1
Open the file showmembers.php
STEP 1.1 find this:
code:
$userrow[$i]['Posts'] = $Posts;
$userrow[$i]['ICQ'] = $ICQ;
$userrow[$i]['Reged'] = $Reged;
BELOW it, add this:
code:
// 20020929 Member List Add To Address Book 1.0 New Start
$encoded = rawurlencode($Username);
$userrow[$i]['AddToAddressbook'] = "<a href="{$config['phpurl']}/addaddress.php?Cat=$Cat&User=$encoded"><img src="{$config['images']}/addtobook.gif" alt="{$ubbt_lang['ADD_BOOK']}" border="0"></a>";
// 20020929 Member List Add To Address Book 1.0 New End
STEP 2
In your /templates/default/showmembers.tmpl file
STEP 2.1 find this:
code:
<td align="left" width="15%" nowrap="nowrap">
<a href="{$config['phpurl']}/showmembers.php?Cat=$Cat&sb=$sortuser&page=$page">
{$ubbt_lang['USERNAME_TEXT']} $UserS
</a>
</td>
BELOW it, add this (the comments are optional. I personally find them usefull but you can remove them if you wish):
code:
<!-- 20020929 Member List Add To Address Book 1.0 New Start -->
<td align="left" width="3%" nowrap="nowrap">
+ AB
</td>
<!-- 20020929 Member List Add To Address Book 1.0 New End -->
STEP 2.1 find this:
Find this:
code:
{$userrow[$i]['Username']}
</a>
</td>
BELOW it, add this (the comments are optional. I personally find them usefull but you can remove them if you wish):
code:
<!-- 20020929 Member List Add To Address Book 1.0 New Start -->
<td>
{$userrow[$i]['AddToAddressbook']}
</td>
<!-- 20020929 Member List Add To Address Book 1.0 New End -->
STEP 2.3 find this:
Find this:
code:
<td align="center" colspan="6" class="cleartable">
<font class="onbody">
{$ubbt_lang['PAGE_TEXT']}:
CHANGE it, to this (the comments are optional. I personally find them usefull but you can remove them if you wish):
code:
<!-- 20020929 Member List Add To Address Book 1.0 New Start -->
<td align="center" colspan="7" class="cleartable">
<!-- 20020929 Member List Add To Address Book 1.0 New End -->
<font class="onbody">
{$ubbt_lang['PAGE_TEXT']}:
That's it.
There is something that I don't like here. When you click the 'Add to Addressbook' link the user profile is shown. Since I did this very late at night I am too tired to find an alternative, say navigate again to the user list or show the address book. Any suggestions will be more than welcome.
Warm regards
Nikos