TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

July 05, 2024, 05:42:23 PM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,298
  • Total Topics: 21,230
  • Online today: 120
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 66
  • Total: 67
  • @rjen

PM link in useronline

Started by alhaudhie, February 15, 2009, 02:39:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alhaudhie

How can we put image like besides every useronline name that can we make PM to them?

IchBin

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.

alhaudhie

#2
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.)

alhaudhie


JPDeni

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?

JPDeni

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>';
}

alhaudhie

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'] .

JPDeni

Cool! I'm not sure why the space was there. Glad you caught it. :)

cepsi

this is a great idea, i added this to the enhanced stats block and looks great