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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 488
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 427
  • Total: 427

PM button on forum stats

Started by keith021773, October 18, 2006, 04:43:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

keith021773

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.

fb

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


keith021773

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.

rbh

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

JPDeni

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.

jacortina

What is the 'hidden' check doing in that code? Shouldn't hiding be applied to this link?

fb

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.
 

keith021773

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

JPDeni

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.

jacortina

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.

This website is proudly hosted on Crocweb Cloud Website Hosting.