TinyPortal

Development => Support => Topic started by: Joshsux on August 31, 2006, 05:58:29 AM

Title: Admin Viewing and front page
Post by: Joshsux on August 31, 2006, 05:58:29 AM
Hey guys
---------------------
if you click www.flash.mrcrash.net you will see a block thats HTML that i just made, all i want this to do is be viewable to guests not administrators, all this does is have a block that follows them throughout the site untill they register, i was just wondering how i make it so even admins cannot view it, it is VERY annoying me seeing the welcome guest's message all the time i only want guests to be able to see it. thanks in advance
---------------------------------------------
Thank you in advance, Joshua.
Title: Re: Admin Viewing and front page
Post by: IchBin on August 31, 2006, 06:39:33 AM
By default Admins can view EVERYTHING. Its made this way. If you don't want to view it, make another user account that you're not admin on. :)
Title: Re: Admin Viewing and front page
Post by: RoarinRow on August 31, 2006, 06:47:01 AM
Not me, I want to see everything   :knuppel2:      :2funny:
Title: Re: Admin Viewing and front page
Post by: IchBin on August 31, 2006, 06:48:28 AM
That makes two of us. :)
Title: Re: Admin Viewing and front page
Post by: Nokonium on August 31, 2006, 06:53:28 AM
Quote from: Joshsux on August 31, 2006, 05:58:29 AM
Hey guys
---------------------
if you click www.flash.mrcrash.net you will see a block thats HTML that i just made, all i want this to do is be viewable to guests not administrators, all this does is have a block that follows them throughout the site untill they register, i was just wondering how i make it so even admins cannot view it, it is VERY annoying me seeing the welcome guest's message all the time i only want guests to be able to see it. thanks in advance
---------------------------------------------
Thank you in advance, Joshua.

In 0.86 you don't have that many options, but in 0.95 (which has entered the final alpha test phase) you will be able to have an article in a block that is viewable by only guests (and admins  >:D ) but you have the option to collapse the block.
Title: Re: Admin Viewing and front page
Post by: Joshsux on August 31, 2006, 07:47:54 AM
yeah all i did was collapse it, and why do you want to see a "guests sign up" block when you are an admin =P... i'll just collapse it so they can see it.

I also may make a new account and set it as a Global Mod for me to use as i don't always like seeing all the admin things.
Title: Re: Admin Viewing and front page
Post by: Thurnok on September 01, 2006, 01:43:58 AM
Actually, you can do exactly what you want in 0.8.6.

In fact, I have a site where I set up a friend of mine as an Admin so he could manage the site for the most part.  He added a block to list various links of his that he liked to visit from time to time, and I of course did not want to see them.  So I "fixed" it - so to speak. ;)

Ok, so what you have is a center block at the top of your page (looking at your site).  Change the block to a phpblock.  Uncheck the frame and title display.  Surround your html with an echo statement that you put into a bit of code that checks if the user is a guest.  Here's an example using your actual info:


global $context;
if ($context['user']['is_guest']){
echo '
<p align="center"><font color="#ff0000"><b>Welcome Guests</b></font><br /><br />
<font color="#00ff00">Hello guest\'s, welcome to Sneaky-Shits. the home to<br />
special classic games and much much more!.<br /><br />
There is "a lot" of stuff that isn\'t Like the special classics.<br />
By registering you will have access to posting, many many more boards, and the<br />
ability to download. Click <a href="http://flash.mrcrash.net/index.php?PHPSESSID=fd3acf92b3ed5e9b188494fe35a6b2d6&amp;action=register">here</a><br />
to register</font></p>
';
}
Title: Re: Admin Viewing and front page
Post by: IchBin on September 01, 2006, 03:39:06 AM
Thats a great way to do it Thurnok. But what I was referring to is that you can't really do this to any of the built in TP blocks without modifying the code quite a bit.
Title: Re: Admin Viewing and front page
Post by: Thurnok on September 01, 2006, 04:08:34 AM
Absolutely true Ich.  For the built-in TP Blocks, you are pretty much stuck.  And I wasn't trying to discount anything you or anyone else here was saying.

When I looked at his site however, and saw what he was doing, I figured I'd let him know how to do what he wanted.  Was hoping to show him he didn't need to create a new user and double log all the time to not display some things.

Cool looking site btw Josh.
Title: Re: Admin Viewing and front page
Post by: IchBin on September 01, 2006, 04:37:55 AM
My toes are officially OK Thurnok. :) Was just trying to be informative like you. ;)
Title: Re: Admin Viewing and front page
Post by: Joshsux on September 01, 2006, 05:01:39 AM
thanlks thurn, i'll be very busy this weekend but ill be sure to check on that asap thanks big time