Advertisement:

Author Topic: Guests and Views  (Read 4596 times)

Offline tmlfever

  • Jr. Member
  • **
  • Posts: 190
  • Gender: Male
  • I take baby Steps!
    • Toronto Maple Leafs Disscussion Boards
Guests and Views
« on: June 03, 2004, 09:51:22 AM »
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.
« Last Edit: June 06, 2004, 10:23:16 PM by 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.

Offline Tomer

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,652
  • Gender: Male
    • Aromazing
Re: Guests and Views
« Reply #1 on: June 03, 2004, 10:15:53 AM »
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.

Offline tmlfever

  • Jr. Member
  • **
  • Posts: 190
  • Gender: Male
  • I take baby Steps!
    • Toronto Maple Leafs Disscussion Boards
Re: Guests and Views
« Reply #2 on: June 03, 2004, 10:23:39 AM »
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.

Offline Ben_S

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,725
  • xxx
Re: Guests and Views
« Reply #3 on: June 03, 2004, 10:32:33 AM »
You would have to modify the code to enable such a feature.
Liverpool FC Forum with 14 million+ posts.

Offline tmlfever

  • Jr. Member
  • **
  • Posts: 190
  • Gender: Male
  • I take baby Steps!
    • Toronto Maple Leafs Disscussion Boards
Re: Guests and Views
« Reply #4 on: June 03, 2004, 10:37:04 AM »
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 />
« Last Edit: June 06, 2004, 08:39:38 PM by 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.

Offline tmlfever

  • Jr. Member
  • **
  • Posts: 190
  • Gender: Male
  • I take baby Steps!
    • Toronto Maple Leafs Disscussion Boards
Re: Guests and Views -- PLease HELP...Please...
« Reply #5 on: June 06, 2004, 10:19:19 PM »
Is this a difficult option to implement?



"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.

Offline Jeff Lewis

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,431
  • Gender: Male
Re: Guests and Views
« Reply #6 on: June 07, 2004, 12:44:48 PM »
Moved this to the more appropriate area...

Offline Oldiesmann

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,868
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • https://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Guests and Views
« Reply #7 on: June 10, 2004, 02:07:22 PM »
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
Code: [Select]
// 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
Code: [Select]
// 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
Code: [Select]
// "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
Code: [Select]
// "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
Code: [Select]
// 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
Code: [Select]
// 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
Cincy Space - now open!

Offline tmlfever

  • Jr. Member
  • **
  • Posts: 190
  • Gender: Male
  • I take baby Steps!
    • Toronto Maple Leafs Disscussion Boards
Re: Guests and Views
« Reply #8 on: June 10, 2004, 02:19:42 PM »
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.