Description: This is a templated Generic Page - which will allow you to wrap your other site pages with a threads header/footer and stylesheet.
Working Under: UBB.Threads 6.5
Mod Status: Beta
Any pre-requisites: 6.5
Author(s): JoshPet
Date: 07/04/04
Credits: Wraith originally helped me with this in the version 5 days
Files Altered: none
New Files: generic.php, generic.tmpl
Database Altered: none
Info/Instructions: Rename and duplicate files as needed.
Disclaimer: Please backup every file that you intend to modify. If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Control Panel - > Primary Settings Advanced Options Tab
If the page you created isn't in your ubbthreads direcotry then set the cookie path to /
Also don't use http://www.yourdomain.com and http://yourdomain.com (no www) interchangably as the cookies are different between the two. You can be logged in at www. but not at the domain without the www.
This is great, an extremely useful little thing that I'm getting a lot of use out of.
However, there are a few additional info pages that I'd like only to be visible to members of the forum that are logged in. How would I go about doing that?
Further restriction by group (if they're not in a specific group, they can't see it) would be nice as well. Is that a lot of extra stuff that would require more than just the generic page stuff?
To restrict a page to logged in users only, just below the authenticate function, add this
Code
<br />if(!$user['U_Username']) {<br /> $html = new html;<br /> $html -> not_right("You must be logged in to view this page.",$Cat);<br />}<br />
To restrict a page to a specific usergroup, first:
Find this:
Code
<br /> $user = $userob -> authenticate();<br />
Change to this: [/code] $user = $userob -> authenticate("U_Groups"); [/code]
Below that, let's assume that you only want to allow access to usergroup #5, and if they aren't in the #5 group, we block them Add this:
Code
<br />if (!strstr($user['U_Groups'],"-5-")) {<br /> $html = new html;<br /> $html -> not_right("You are not authorized to view this page.",$Cat);<br />}<br />
To account for allowing multiple usergroups, example admins, moderators and group 5 are allowed:
Code
<br />if ((!strstr($user['U_Groups'],"-5-")) && (!strstr($user['U_Groups'],"-1-")) && (!strstr($user['U_Groups'],"-2-"))) {<br /> $html = new html;<br /> $html -> not_right("You are not authorized to view this page.",$Cat);<br />}<br />
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.