Hey all. Quick question. Is there a way to edit the original "forum stats" box to include a PM button beside the users name? The forum stats that I am talking about is called "Some Stats" here on the left side. I liked in the box on my site but it doesn't have anywhere to edit or change the code.. Thanks.
In the Themes\default\TPortalBlocks.template.php file, find this:
Quote
foreach($online['users'] as $user){
echo $bullet2 , $user['hidden'] ? '' . $user['link'] . '' : $user['link'];
echo '
';
}
echo '</div>';
}
echo '
</td></tr></table>';
change it to this:
Quote
foreach($online['users'] as $user){
echo $bullet2 , $user['hidden'] ? '' . $user['link'] . '' : $user['link'];
echo ' <a href="', $scripturl, '?action=pm;sa=send;u=', $context['user']['id'], '"> (PM)</a>';
echo '
';
}
echo '</div>';
}
echo '
</td></tr></table>';
That didn't work. It did however put PM/URL next to each users nameand they weren't lined up right.. Thanks though.. I appreciate it.
i tried it with this
foreach($online['users'] as $user){
echo $bullet2 , $user['hidden'] ? '' . $user['link'] . '' : $user['link'];
echo ' <a href="', $scripturl, '?action=pm;sa=send;u=', $context['user']['id'], '"> PM';
echo '
';
}
echo '</div>';
}
echo '
</td></tr></table>';
and that worked
Let's try this again. The link isn't being closed off.
foreach($online['users'] as $user){
echo $bullet2 , $user['hidden'] ? '' . $user['link'] . '' : $user['link'];
echo ' <a href="', $scripturl, '?action=pm;sa=send;u=', $context['user']['id'], '"> (PM)</a>';
echo '
';
}
echo '</div>';
}
echo '
</td></tr></table>';
That will put a link by the name, with the text PM, which, when clicked will take the clicker to a place where they can send a PM to the user with that name. You asked for a "button." I'm not sure there's room for a button, if I understand where you intend to put it.
What is the 'hidden' check doing in that code? Shouldn't hiding be applied to this link?
Quote from: keith021773 on October 20, 2006, 02:48:10 AM
That didn't work. It did however put PM/URL next to each users nameand they weren't lined up right.. Thanks though.. I appreciate it.
The code is good, but i posted it in a QUOTE , instead of CODE , which
alters what you will actually see on screen. Sry..
foreach($online['users'] as $user){
echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo ' <a href="', $scripturl, '?action=pm;sa=send;u=', $context['user']['id'], '"> (PM)</a>';
echo '<br />';
}
echo '</div>';
}
echo '<br /></td></tr></table>';
It is actually just 1 line that i've added, but showing a general area
of the script for your reference.
Maybe a button isn't what I wanted.. How can I get the greeen online/pm icon beside their name. :) I'm not very good with words. LOL
Oh! :)
Give this a try:
foreach($online['users'] as $user){
echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];
echo ' <a href="', $scripturl, '?action=pm;sa=send;u=', $user['id'], '"> <img src="' . $settings['images_url'] . '/useron" /></a>';
echo '<br />';
}
J. A., you'd think that the hidden folks should be able to remain hidden, but that's how it is in the original code.
Right. I see now that 'hidden's won't be in the list if they're not shown to the viewer at all. The hidden check is only to italicize for those who ARE allowed to view hidden users.