News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Me again ^^ How to show buddy list on index page

Started by ittiphol, July 21, 2014, 02:18:41 AM

Previous topic - Next topic

ittiphol

Me again ^^ How to show buddy list on index page

i try this code


function template_editBuddies()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;

// Now loop through each buddy showing info on each.
$alternate = false;
foreach ($context['buddies'] as $buddy)
{
echo '
<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
<td>', $buddy['link'], '</td>
<td align="center"><a href="', $buddy['online']['href'], '"><img src="', $buddy['online']['image_href'], '" alt="', $buddy['online']['label'], '" title="', $buddy['online']['label'], '" /></a></td>
<td align="center">', ($buddy['show_email'] == 'no' ? '' : '<a href="' . $scripturl . '?action=emailuser;sa=email;uid=' . $buddy['id'] . '" rel="nofollow"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . ' ' . $buddy['name'] . '" /></a>'), '</td>
<td align="center">', $buddy['icq']['link'], '</td>
<td align="center">', $buddy['aim']['link'], '</td>
<td align="center">', $buddy['yim']['link'], '</td>
<td align="center">', $buddy['msn']['link'], '</td>
<td align="center"><a href="', $scripturl, '?action=profile;area=lists;sa=buddies;u=', $context['id_member'], ';remove=', $buddy['id'], ';', $context['session_var'], '=', $context['session_id'], '"><img src="', $settings['images_url'], '/icons/delete.gif" alt="', $txt['buddy_remove'], '" title="', $txt['buddy_remove'], '" /></a></td>
</tr>';

$alternate = !$alternate;
}

echo '
</table>';

}


insert to index.template.php it's not work


Hj Ahmad Rasyid Hj Ismail

There are various mods available regarding buddy/ies. Search the mod site for budd and will list them all. All you need to do is to learn how they are calling buddies to certain page and you try to do the same in index page. Note that boardindex page also call for buddy/ies in its template:


if ($context['show_buddies'])
$bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);

ittiphol

Quote from: ahrasis on July 22, 2014, 02:48:18 AM
There are various mods available regarding buddy/ies. Search the mod site for budd and will list them all. All you need to do is to learn how they are calling buddies to certain page and you try to do the same in index page. Note that boardindex page also call for buddy/ies in its template:


if ($context['show_buddies'])
$bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);


Thank you ahrasis i'll try  ;D

ittiphol

i try to search mod buddy i can't find that mod



ittiphol

now i can't find way out
how to show buddy on index page  :-\

samborabora

Quote from: ittiphol on July 24, 2014, 11:23:50 AM
now i can't find way out
how to show buddy on index page  :-\

Install simple portal and add the code I reposted on this thread:http://www.simplemachines.org/community/index.php?topic=505334.msg3725573#msg3725573

It shows only online buddies, is that what's needed?

ittiphol

Quote from: samborabora on August 04, 2014, 03:47:37 AM
Quote from: ittiphol on July 24, 2014, 11:23:50 AM
now i can't find way out
how to show buddy on index page  :-\

Install simple portal and add the code I reposted on this thread:http://www.simplemachines.org/community/index.php?topic=505334.msg3725573#msg3725573

It shows only online buddies, is that what's needed?

Thank you

What file to edit  ???

Advertisement: