TinyPortal

Development => Support => Topic started by: alhaudhie on February 15, 2009, 02:39:29 AM

Title: PM link in useronline
Post by: alhaudhie on February 15, 2009, 02:39:29 AM
How can we put image like (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Ftbn1.google.com%2Fimages%3Fq%3Dtbn%3AnayJoi3qrn6WiM%3Ahttp%3A%2F%2Ffarm2.static.flickr.com%2F1073%2F1448112898_2c91734ad9.jpg%253Fv%253D0&hash=c3c28dc4621d0faa388ec1291b22bcd12d0c3728) besides every useronline name that can we make PM to them?
Title: Re: PM link in useronline
Post by: IchBin on February 15, 2009, 02:54:20 AM
Take the code that has the PM icon from Display.template.php, and copy it to the TPortalBlocks.template.php where the stats function is. If you can't figure out the code, let us know I'm sure someone can help.

Please post in the correct section too. Feedback is for your suggestions about TP in what you like or don't like.
Title: Re: PM link in useronline
Post by: alhaudhie on February 15, 2009, 08:23:05 AM
i have try like this... but not success

foreach($online['users'] as $user)

{

echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];

echo '<br />';

}

echo '

</li>

</ul>';

}

echo '

</div>';

}



and this in display.php sample:
if ($context['can_send_pm'])
echo '
<a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['label'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . $message['member']['online']['label'] . '" border="0" />' : $message['member']['online']['label'], '</a>';



then i make this:

 foreach($online['users'] as $user)

{
echo '
<a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['label'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.gif" alt="' . $message['member']['online']['label'] . '" border="0" />' : $message['member']['online']['label'], '</a>';
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];

echo '<br />';

}

echo '

</li>

</ul>';

}

echo '

</div>';

}


but it give me the link like : /index.php?action=pm;sa=send;u=(dosnt go to their profile.)
Title: Re: PM link in useronline
Post by: alhaudhie on February 19, 2009, 06:30:52 PM
anybody can help for this.. ?
Title: Re: PM link in useronline
Post by: JPDeni on February 19, 2009, 09:58:03 PM
I'm not sure which block you're talking about, or what exactly you have in mind. I'll need more information.

You have some code there, but it's the end of a list and I need to know what the first part of it is, for one thing. Where did you get the code?
Title: Re: PM link in useronline
Post by: JPDeni on February 19, 2009, 10:15:06 PM
Try this:


if(isset($context['TPortal']['userbox']['online']))
{
// add online users
echo '
<h5 class="online"><a href="'.$scripturl.'?action=who">'.$txt[158].'</a></h5>
<div>';

$online = ssi_whosOnline('array');
echo $txt['tp-users'].': '.$online['num_users']. '<br />
'.$txt['tp-guests'].': '.$online['guests'].'<br />
'.$txt['tp-total'].': '.$online['total_users'].'<br />
<div ' , $online['num_users']>14 ? ' style="height: 23ex; overflow: auto;"' : '' ,'>';

foreach($online['users'] as $user)
{
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo ' <a href="' . $scripturl. ' ?action=pm;sa=send;u=' . $user['id'] . '"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[148] . '" /></a>';
echo '<br />';
}
echo '
</div></div>';
}
Title: Re: PM link in useronline
Post by: alhaudhie on February 20, 2009, 07:26:40 AM
Quote from: JPDeni on February 19, 2009, 10:15:06 PM
Try this:


if(isset($context['TPortal']['userbox']['online']))
{
// add online users
echo '
<h5 class="online"><a href="'.$scripturl.'?action=who">'.$txt[158].'</a></h5>
<div>';

$online = ssi_whosOnline('array');
echo $txt['tp-users'].': '.$online['num_users']. '<br />
'.$txt['tp-guests'].': '.$online['guests'].'<br />
'.$txt['tp-total'].': '.$online['total_users'].'<br />
<div ' , $online['num_users']>14 ? ' style="height: 23ex; overflow: auto;"' : '' ,'>';

foreach($online['users'] as $user)
{
echo $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo ' <a href="' . $scripturl. ' ?action=pm;sa=send;u=' . $user['id'] . '"><img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt[148] . '" /></a>';
echo '<br />';
}
echo '
</div></div>';
}


yes.. this work.. tq..
(with the little tweak)
echo ' <a href="' . $scripturl. ' ?action=pm;sa=send;u=' . $user['id'] .

to

echo ' <a href="' . $scripturl. '?action=pm;sa=send;u=' . $user['id'] .
Title: Re: PM link in useronline
Post by: JPDeni on February 20, 2009, 03:22:03 PM
Cool! I'm not sure why the space was there. Glad you caught it. :)
Title: Re: PM link in useronline
Post by: cepsi on February 20, 2009, 04:58:46 PM
this is a great idea, i added this to the enhanced stats block and looks great