News:

Wondering if this will always be free?  See why free is better.

Main Menu

Guests and Views

Started by tmlfever, June 03, 2004, 09:51:22 AM

Previous topic - Next topic

tmlfever

OK, here is another question!
I would like to have a GUEST click on the "Users Online" and "Members List" and be taken to the "Register" page. How do I do This with a message like:

Sorry - you don't have the proper permissions to view the Who's Online list.
Please login below or register an account with the TMLForum Community.


"Every time you wake up, ask yourself, "What good am I going to do today?", remember that when the sun goes down at sunset, it will take a part of your life with it."

I've seen the Leaf jersey everywhere from Kabul to Tonga. I've never seen it in a Stanley Cup final.

Tomer

Go to Admin Center >>> Premissions >>> Un-registered users >>> And deny there aceess to the Whos online list. Then they will get that message when the attempt to view it.

tmlfever

I tried both 'Disallow' (X), and 'Deny' (D),  but the link to view is not clickable when I do that..


"Every time you wake up, ask yourself, "What good am I going to do today?", remember that when the sun goes down at sunset, it will take a part of your life with it."

I've seen the Leaf jersey everywhere from Kabul to Tonga. I've never seen it in a Stanley Cup final.

Ben_S

You would have to modify the code to enable such a feature.
Liverpool FC Forum with 14 million+ posts.

tmlfever

#4
Is it the index.template.php that I modify?
What code do I use?
Where do I put it? (get your mind out of the gutter) LOL...

Is it something like

<td class="windowbg2" width="100%"><a href="http://www.tmlforum.net/index.php?action=register">?</a><br />


"Every time you wake up, ask yourself, "What good am I going to do today?", remember that when the sun goes down at sunset, it will take a part of your life with it."

I've seen the Leaf jersey everywhere from Kabul to Tonga. I've never seen it in a Stanley Cup final.

tmlfever



"Every time you wake up, ask yourself, "What good am I going to do today?", remember that when the sun goes down at sunset, it will take a part of your life with it."

I've seen the Leaf jersey everywhere from Kabul to Tonga. I've never seen it in a Stanley Cup final.

Jeff Lewis

Moved this to the more appropriate area...
Co-Founder of SMF

Oldiesmann

tmlfever and I just discussed the solution for this, but here it is anyway in case anyone else wants to use it...

In Themes/classic/Boardindex.template.php

Find
// Show a member bar.  Not heavily ornate, but functional at least.
if ($settings['show_member_bar'])
{
echo '
<tr>
<td class="catbg" colspan="2">', $txt[331], '</td>
</tr>
<tr>
<td class="windowbg" width="20" valign="middle" align="center">
', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' : '', '<img src="', $settings['images_url'], '/members.gif" border="0" width="20" alt="', $txt[332], '" />', $context['show_member_list'] ? '</a>' : '', '
</td>
<td class="windowbg2" width="100%">
<b>', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' . $txt[332] . '</a>' : $txt[332], '</b><br />
<span class="smalltext">', $txt[200], '</span>
</td>
</tr>';
}


Replace
// Show a member bar.  Not heavily ornate, but functional at least.
if ($settings['show_member_bar'] || $settings['user']['is_guest'])
{
echo '
<tr>
<td class="catbg" colspan="2">', $txt[331], '</td>
</tr>
<tr>
<td class="windowbg" width="20" valign="middle" align="center">
', $context['show_member_list'] ? '<a href="' . $scripturl . '?action=mlist">' : '', '<img src="', $settings['images_url'], '/members.gif" border="0" width="20" alt="', $txt[332], '" />', $context['show_member_list'] || $context['user']['is_guest'] ? '</a>' : '', '
</td>
<td class="windowbg2" width="100%">
<b>', $context['show_member_list'] || $context['user']['is_guest'] ? '<a href="' . $scripturl . '?action=mlist">' . $txt[332] . '</a>' : $txt[332], '</b><br />
<span class="smalltext">', $txt[200], '</span>
</td>
</tr>';
}


Find
// "Users online" - in order of activity.
echo '
<tr>
<td class="catbg" colspan="2">', $txt[158], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<img src="', $settings['images_url'], '/online.gif" alt="', $txt[158], '" border="0" />', $context['show_who'] ? '</a>' : '', '
</td>
<td class="windowbg2" width="100%">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'], $context['num_users_hidden'] > 0 ? ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')' : '', $context['show_who'] ? '</a>' : '', '<br />
<span class="smalltext">';


Replace
// "Users online" - in order of activity.
echo '
<tr>
<td class="catbg" colspan="2">', $txt[158], '</td>
</tr><tr>
<td class="windowbg" width="20" valign="middle" align="center">
', $context['show_who'] || $context['user']['is_guest'] ? '<a href="' . $scripturl . '?action=who">' : '', '<img src="', $settings['images_url'], '/online.gif" alt="', $txt[158], '" border="0" />', $context['show_who'] || $context['user']['is_guest'] ? '</a>' : '', '
</td>
<td class="windowbg2" width="100%">
', $context['show_who'] || $context['user']['is_guest'] ? '<a href="' . $scripturl . '?action=who">' : '', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'], $context['num_users_hidden'] > 0 ? ' (' . $context['num_users_hidden'] . ' ' . $txt['hidden'] . ')' : '', $context['show_who'] || $context['user']['is_guest'] ? '</a>' : '', '<br />
<span class="smalltext">';


In Themes/default/Boardindex.template.php

Find
// Show a member bar.  Not heavily ornate, but functional at least.
if ($settings['show_member_bar'])
{
echo '
<tr>
<td class="catbg" colspan="2">', $txt[331], '</td>
</tr>
<tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="', $scripturl, '?action=mlist">
<img src="', $settings['images_url'], '/members.gif" width="20" alt="', $txt[332], '" border="0" /></a>
</td>
<td class="windowbg2" width="100%">
<b><a href="', $scripturl, '?action=mlist">', $txt[332], '</a></b><br />
<span class="smalltext">', $txt[200], '</span>
</td>
</tr>';
}


Replace
// Show a member bar.  Not heavily ornate, but functional at least.
if ($settings['show_member_bar'] || $context['user']['is_guest'])
{
echo '
<tr>
<td class="catbg" colspan="2">', $txt[331], '</td>
</tr>
<tr>
<td class="windowbg" width="20" valign="middle" align="center">
<a href="', $scripturl, '?action=mlist">
<img src="', $settings['images_url'], '/members.gif" width="20" alt="', $txt[332], '" border="0" /></a>
</td>
<td class="windowbg2" width="100%">
<b><a href="', $scripturl, '?action=mlist">', $txt[332], '</a></b><br />
<span class="smalltext">', $txt[200], '</span>
</td>
</tr>';
}


The "who's online" link will always show in the default theme regardless of the permissions, so if a guest doesn't have permission to view that, they'll just get a login box with a "warning" saying they're not allowed to do that because they don't have permission to...
Michael Eshom
Christian Metal Fans

tmlfever

You are GREAT!!! Thanks. I'm sure other newbies like myself will appreciate the simple way you have laid this out..... :)


"Every time you wake up, ask yourself, "What good am I going to do today?", remember that when the sun goes down at sunset, it will take a part of your life with it."

I've seen the Leaf jersey everywhere from Kabul to Tonga. I've never seen it in a Stanley Cup final.

Advertisement: