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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,970
  • Latest: bynw
Stats
  • Total Posts: 196,033
  • Total Topics: 21,335
  • Online today: 321
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online

Permissions for guests

Started by kimba, July 26, 2007, 05:03:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kimba

I have a slight problem here. I've just added TP to my SMF forum and I want guests to view the articles in TP but not the actual forum. The permissions don't seem to allow "view TinyPortal" for guests. Is there any way around it?

IchBin

TinyPortal doesn't have any of these permissions built into the article system yet.

Elrond

I would recommend you take use of the PHP articles system. You basically don't even NEED to worry about permissions if you make certain articles and categories php articles.

Just about every function in TP as well as SMF uses the context global variable, correct? Well, if you make the article a php article you could easily set the permissions through the php code you enter.

For example, I disabled guests on some of my articles by doing the following:

if(!$context['user']['is_guest'])
{
//my article's in here.
}

If you wanted only admins (those with group id = 1) to see it, that'd be just as simple, just change the variable:

if(!$context['user']['is_admin'])
* repeat same as above *

You could use the user_info global variable as well as it is available in the TPortal.php file in the sources folder as well as in the TPortal.template.php in your themes' folders.

And wolla, there's yer permissions.

(Extension of the above: you may use the $story['id'] variable along with scripturl global variable to put together url links that you may use in conjunction with your own variable to go to the same article, except with different variables, to control the conditions of the sub-article's content. You can basically do anything you want with PHP articles. It's simply fantastic!!!)

Along with having trusted staff using your articles management system (the first recommendation for any such system), being able to take use of the variables already available in SMF and TinyPortal is also useful. TinyPortal works great for everything. Just fantastic, truly fantastic! I just started using TP 3 days ago too, and already love it!

This website is proudly hosted on Crocweb Cloud Website Hosting.