Previous Thread
Next Thread
Print Thread
Rating: 5
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.
Attachments
116324-GenericPage6.5.zip (0 Bytes, 344 downloads)

Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Thanks Josh, I use this one a lot


- Allen wavey
- What Drives You?
Joined: Dec 2004
Posts: 36
Junior Member
Junior Member
Offline
Joined: Dec 2004
Posts: 36
This works fine, except the generic page show the user:

You are not logged in. [Login]

how to correct?


nosleep
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Do you have forum cookies set globally?


- Allen wavey
- What Drives You?
Joined: Dec 2004
Posts: 36
Junior Member
Junior Member
Offline
Joined: Dec 2004
Posts: 36
I can't find a setting in my cp o set them globally?


nosleep
Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Last edited by JoshPet; 12/23/2004 3:44 AM.
Joined: Dec 2004
Posts: 36
Junior Member
Junior Member
Offline
Joined: Dec 2004
Posts: 36
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.


nosleep
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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.


- Allen wavey
- What Drives You?
Joined: Dec 2004
Posts: 36
Junior Member
Junior Member
Offline
Joined: Dec 2004
Posts: 36
my cookie is set / as default, never changed that. Thanks for the tip to change at registrar - didn't think of that.


nosleep
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
[]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.

Sponsored Links
Joined: Dec 2004
Posts: 36
Junior Member
Junior Member
Offline
Joined: Dec 2004
Posts: 36
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.


nosleep
Joined: Jun 2002
Posts: 160
Member
Member
Offline
Joined: Jun 2002
Posts: 160
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?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Thanks for the updates, those are handy


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
works in 6.5.2


- Allen wavey
- What Drives You?

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)