UBB.Dev
Posted By: JoshPet Beta-[6.5] Generic Page for 6.5 - 07/04/2004 9:03 AM
Mod Name / Version: Generic Page for 6.5

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.


Attached File
116324-GenericPage6.5.zip  (344 downloads)
Posted By: AllenAyres Re: Beta-[6.5] Generic Page for 6.5 - 12/08/2004 5:49 AM
Thanks Josh, I use this one a lot
Posted By: nosleep Re: Beta-[6.5] Generic Page for 6.5 - 12/22/2004 5:18 PM
This works fine, except the generic page show the user:

You are not logged in. [Login]

how to correct?
Posted By: AllenAyres Re: Beta-[6.5] Generic Page for 6.5 - 12/23/2004 6:47 AM
Do you have forum cookies set globally?
Posted By: nosleep Re: Beta-[6.5] Generic Page for 6.5 - 12/23/2004 7:39 AM
I can't find a setting in my cp o set them globally?
Posted By: JoshPet Re: Beta-[6.5] Generic Page for 6.5 - 12/23/2004 10:43 AM
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.
Posted By: nosleep Re: Beta-[6.5] Generic Page for 6.5 - 12/23/2004 12:23 PM
hmmm, if I take the www out all users get this on submit:

The host you are trying to send the input from is not a valid host.
Please use your back button to return to the previous page.
Posted By: AllenAyres Re: Beta-[6.5] Generic Page for 6.5 - 12/23/2004 7:48 PM
You can also set that part at whatever name registration service you use (register.com, joker.com, etc.). Set the http://yourdomain.com as an alias for http://www.yourdomain.com.

You'll need to set the cookie globally like Josh explained to / (the root of your site), that way it will be available to your whole site.
Posted By: nosleep Re: Beta-[6.5] Generic Page for 6.5 - 12/24/2004 12:17 PM
my cookie is set / as default, never changed that. Thanks for the tip to change at registrar - didn't think of that.
Posted By: JoshPet Re: Beta-[6.5] Generic Page for 6.5 - 12/24/2004 9:40 PM
[]nosleep said:
hmmm, if I take the www out all users get this on submit:

The host you are trying to send the input from is not a valid host.
Please use your back button to return to the previous page. [/]

Use whatever one you use normally - that error you get is the referral check, which you can either turn off in your admin area.

You also should list both domains for the referral check:

Control Panel -> Primary Settings -> Advanced Options

In the box that says "Domains for HTTP Refer check" separate them with a | per the example.com domain shown there.
Posted By: nosleep Re: Beta-[6.5] Generic Page for 6.5 - 12/28/2004 8:41 PM
Even after following your advice to the minute it still shows "you are not logged in".

I have done http://www.nobody.com|http://nobody.com

and have also tried with referrer enabled and disabled.

Make no difference. The not logged it won't go away.
Posted By: ZealotOnAStick_dup1 Re: Beta-[6.5] Generic Page for 6.5 - 02/22/2005 12:17 AM
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?
Posted By: JoshPet Re: Beta-[6.5] Generic Page for 6.5 - 03/01/2005 9:46 AM
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 />


That should do it.
Posted By: AllenAyres Re: Beta-[6.5] Generic Page for 6.5 - 03/02/2005 5:46 AM
Thanks for the updates, those are handy
Posted By: AllenAyres Re: Beta-[6.5] Generic Page for 6.5 - 01/08/2006 5:57 AM
works in 6.5.2
© UBB.Developers