Previous Thread
Next Thread
Print Thread
Rate Thread
[7.x] Generic Page Outside of forum directory #312683
01/14/2007 11:58 PM
01/14/2007 11:58 PM
Joined: Nov 2001
Posts: 11,330
Charlotte, NC
JoshPet Offline OP
I type Like navaho
JoshPet  Offline OP
I type Like navaho
Joined: Nov 2001
Posts: 11,330
Charlotte, NC
In UBB.Threads 7, a /scripts/sample.inc.php file is provided to help you create your own custom pages as needed.

For example, you can duplicate the /scripts/sample.inc.php file to /scripts/mypage.inc.php Then create a /templates/default/mypage.tpl template file with the HTML for your page.

Then visiting ubbthreads.php?ubb=mypage will load that page.

But if you need to have this page appear outside of your forum directory, you can create a PHP script elsewhere on your site to load this page from within UBBThreads. Here's how.

For example create a "mypage.php" script elsewhere on your site which looks like this:

Code
<?php
// Generic UBBThreads wrapper
// This allows you to access a UBBThreads 7 script from outside 
// The UBBThreads directory.
//
// Instructions: create your sample.inc.php script and sample.tmp file 
// (follow the example Groupee provided) you can rename as needed if you 
// need more pages.  Then create this script wherever you wish on your server.
// Edit the variable and full path as needed.

// Set this variable to whatever scriptname.inc.php file you have included in /scripts
 $_REQUEST['ubb'] = "mypage";

// Set the full path to your ubbthreads.php file
include("/home/threads/public_html/ubb7/ubbthreads.php");
?>



You will need to edit the variable to match the name of the thread script and template you created above, and you'll also need to edit the full path to your UBB.Threads directory.

Thanks to Allen for requesting this.

Sponsored Links
Re: [7.0.x] Generic Page Outside of forum directory [Re: JoshPet] #312691
01/15/2007 7:38 AM
01/15/2007 7:38 AM
Joined: Feb 2002
Posts: 2,575
England
Ian_W Offline
Veteran
Ian_W  Offline
Veteran
Joined: Feb 2002
Posts: 2,575
England
Thanks - will give it a try smile


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Re: [7.0.x] Generic Page Outside of forum director [Re: Ian_W] #312694
01/15/2007 7:57 AM
01/15/2007 7:57 AM
Joined: Jan 2000
Posts: 5,938
Portland, OR, USA
Gizmo Offline

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Offline

UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,938
Portland, OR, USA
I'm going to sticky this for the time being, I've gotten several requests on just this wink.

Also, since it covers UBB.T7.1 as well, I updated the subject to read 7.x vs 7.0.x.


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.Sitemaps
Re: [7.0.x] Generic Page Outside of forum director [Re: Gizmo] #312702
01/15/2007 8:57 AM
01/15/2007 8:57 AM
Joined: Mar 2000
Posts: 25,587
Texas
AllenAyres Offline
I type Like navaho
AllenAyres  Offline
I type Like navaho
Joined: Mar 2000
Posts: 25,587
Texas
Thank you Josh thumbsup

If you are wanting to make your portal page the index page for your site, just change this line:

$_REQUEST['ubb'] = "mypage";

to this:

$_REQUEST['ubb'] = "portal";


Save the page as index.php and upload it to the root of your site:

ex: https://www.ubbdev.com

thumbsup


- Allen wavey
- What Drives You?
Re: [7.0.x] Generic Page Outside of forum director [Re: AllenAyres] #312703
01/15/2007 10:26 AM
01/15/2007 10:26 AM
Joined: Jan 2007
Posts: 70
UK
Stephen G Offline
Power User
Stephen G  Offline
Power User
Joined: Jan 2007
Posts: 70
UK
I've done as suggested...but let me make sure I've done it right.

I have altered nothing but

$_REQUEST['ubb'] = "mypage"; to $_REQUEST['ubb'] = "portal";

and

("/home/threads/public_html/ubb7/ubbthreads.php"); to ("/my/path/to/thefiles/ubbthreads.php");

And my portal shows up via www.galacticempire.net, which is great but is that it, have I done it right ?


[b]Stephen G
Sponsored Links
Re: [7.0.x] Generic Page Outside of forum director [Re: Stephen G] #312705
01/15/2007 10:43 AM
01/15/2007 10:43 AM
Joined: Mar 2000
Posts: 25,587
Texas
AllenAyres Offline
I type Like navaho
AllenAyres  Offline
I type Like navaho
Joined: Mar 2000
Posts: 25,587
Texas
Yes, very simple to do smile


- Allen wavey
- What Drives You?
Re: [7.0.x] Generic Page Outside of forum director [Re: AllenAyres] #312706
01/15/2007 10:47 AM
01/15/2007 10:47 AM
Joined: Mar 2000
Posts: 25,587
Texas
AllenAyres Offline
I type Like navaho
AllenAyres  Offline
I type Like navaho
Joined: Mar 2000
Posts: 25,587
Texas
To make it a bit simpler for those wanting to use it for their portal page, I've attached a file below. Change the path toward the bottom to match your path, rename the extension to index.php and upload where you need it. smile

Attached Files
2340-index.txt (162 downloads)

- Allen wavey
- What Drives You?
Re: [7.0.x] Generic Page Outside of forum director [Re: AllenAyres] #312707
01/15/2007 10:50 AM
01/15/2007 10:50 AM
Joined: Jan 2007
Posts: 70
UK
Stephen G Offline
Power User
Stephen G  Offline
Power User
Joined: Jan 2007
Posts: 70
UK
Thank You

smile


[b]Stephen G
Re: [7.0.x] Generic Page Outside of forum director [Re: Stephen G] #312712
01/15/2007 8:01 PM
01/15/2007 8:01 PM
Joined: Jan 2000
Posts: 5,938
Portland, OR, USA
Gizmo Offline

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Offline

UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,938
Portland, OR, USA
Very nice Allen, I can think of several good uses hehe


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.Sitemaps
Re: [7.0.x] Generic Page Outside of forum director [Re: Gizmo] #312722
01/16/2007 10:42 AM
01/16/2007 10:42 AM
Joined: Feb 2002
Posts: 2,575
England
Ian_W Offline
Veteran
Ian_W  Offline
Veteran
Joined: Feb 2002
Posts: 2,575
England
I am seeing

$tbclose UBBTPRINT; /* UBBTREMARK */ ?>

At the top of the page, just beneath the header.

http://www.fansfocus.com/forums/ubbthreads.php?ubb=ryman or http://www.fansfocus.com/generic/ryman

Also both the columns are being displayed on the left.

This is fairly straight foward, so not sure where I have gone wrong - unless I should have more info in the template - I assume this just contains the raw html from the main body of the page and nothing else.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Sponsored Links
Re: [7.0.x] Generic Page Outside of forum director [Re: Ian_W] #312725
01/16/2007 11:59 AM
01/16/2007 11:59 AM
Joined: Feb 2002
Posts: 2,575
England
Ian_W Offline
Veteran
Ian_W  Offline
Veteran
Joined: Feb 2002
Posts: 2,575
England
sorry - I'm having a bad week frown

I didn't notice some odd ubbcode at the foot of my template - all is fine now smile


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Re: [7.0.x] Generic Page Outside of forum director [Re: Ian_W] #313156
02/13/2007 11:52 AM
02/13/2007 11:52 AM
Joined: Jan 2007
Posts: 2
ScriptKeeper Offline
Lurker
ScriptKeeper  Offline
Lurker
Joined: Jan 2007
Posts: 2
I struggled with this and then noticed that the code in the box begins with ? and it should be

Not too obvious for a novice like me. wink

Re: [7.0.x] Generic Page Outside of forum director [Re: ScriptKeeper] #313160
02/13/2007 12:26 PM
02/13/2007 12:26 PM
Joined: Mar 2000
Posts: 25,587
Texas
AllenAyres Offline
I type Like navaho
AllenAyres  Offline
I type Like navaho
Joined: Mar 2000
Posts: 25,587
Texas
Thank you for the headsup, post edited to include above mentioned fix smile


- Allen wavey
- What Drives You?
Re: [7.0.x] Generic Page Outside of forum director [Re: AllenAyres] #313165
02/13/2007 9:25 PM
02/13/2007 9:25 PM
Joined: Nov 2001
Posts: 11,330
Charlotte, NC
JoshPet Offline OP
I type Like navaho
JoshPet  Offline OP
I type Like navaho
Joined: Nov 2001
Posts: 11,330
Charlotte, NC
Doah, a bit isdexlic I guess. tipsy

Re: [7.0.x] Generic Page Outside of forum director [Re: JoshPet] #313401
03/05/2007 9:58 PM
03/05/2007 9:58 PM
Joined: May 2002
Posts: 378
Na
A
Allusivekudos Offline
Junior Member
Allusivekudos  Offline
Junior Member
A
Joined: May 2002
Posts: 378
Na
This may be a new request, but can we figure out a way to disable the portal boxes when the portal is enabled on these generic pages?

-peter

Re: [7.x] Generic Page Outside of forum directory [Re: JoshPet] #313757
04/01/2007 8:35 PM
04/01/2007 8:35 PM
Joined: Dec 2002
Posts: 71
Calpy Offline
Power User
Calpy  Offline
Power User
Joined: Dec 2002
Posts: 71
Hey Josh, if I wanted to use a variable in one of these pages, how would I do it? For a super-simplified example, what if I wanted the page to say:

Hello $display_name!

And it would say "Hello Calpy!"

Re: [7.x] Generic Page Outside of forum directory [Re: Calpy] #313760
04/01/2007 8:45 PM
04/01/2007 8:45 PM
Joined: Jan 2000
Posts: 5,938
Portland, OR, USA
Gizmo Offline

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Offline

UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,938
Portland, OR, USA
Well, your script file would need to referance the user data:
Code
	$smarty_data = array(
	    'user' => & $user,
	);


Then, hypothetically, you could call it as:
Code
$user.USER_DISPLAY_NAME


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.Sitemaps
Re: [7.x] Generic Page Outside of forum directory [Re: Gizmo] #313800
04/06/2007 6:38 PM
04/06/2007 6:38 PM
Joined: Dec 2002
Posts: 71
Calpy Offline
Power User
Calpy  Offline
Power User
Joined: Dec 2002
Posts: 71
Yay, thank you! For any noobs (like me) interested in the same thing, don't forget to put curly brackets around the call on your .tpl page, like:
Code
{$user.USER_DISPLAY_NAME}

Re: [7.x] Generic Page Outside of forum directory [Re: Calpy] #313802
04/06/2007 9:57 PM
04/06/2007 9:57 PM
Joined: Jan 2000
Posts: 5,938
Portland, OR, USA
Gizmo Offline

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Offline

UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,938
Portland, OR, USA
I guess I should have said that :x


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.Sitemaps
Re: [7.x] Generic Page Outside of forum directory [Re: Gizmo] #313933
04/23/2007 5:29 PM
04/23/2007 5:29 PM
Joined: Dec 2002
Posts: 71
Calpy Offline
Power User
Calpy  Offline
Power User
Joined: Dec 2002
Posts: 71
Was there any response to how to disable portal boxes/side bars on these pages? =)

Re: [7.x] Generic Page Outside of forum directory [Re: Calpy] #314395
06/12/2007 4:38 PM
06/12/2007 4:38 PM
Joined: Feb 2002
Posts: 2,575
England
Ian_W Offline
Veteran
Ian_W  Offline
Veteran
Joined: Feb 2002
Posts: 2,575
England
Originally Posted by Calpy
Was there any response to how to disable portal boxes/side bars on these pages? =)


Haven't found a way yet frown





Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Re: [7.x] Generic Page Outside of forum directory [Re: Calpy] #314648
07/06/2007 1:28 PM
07/06/2007 1:28 PM
Joined: Jan 2007
Posts: 70
UK
Stephen G Offline
Power User
Stephen G  Offline
Power User
Joined: Jan 2007
Posts: 70
UK
Quote
In UBB.Threads 7, a /scripts/sample.inc.php file is provided to help you create your own custom pages as needed.

For example, you can duplicate the /scripts/sample.inc.php file to /scripts/mypage.inc.php Then create a /templates/default/mypage.tpl template file with the HTML for your page.

Then visiting ubbthreads.php?ubb=mypage will load that page.


This works great for my custom pages.

Code
// Set this variable to whatever scriptname.inc.php file you have included in /scripts
 $_REQUEST['ubb'] = "mypage";

// Set the full path to your ubbthreads.php file
include("/home/threads/public_html/ubb7/ubbthreads.php");
?>


When I follow the instructions for that, it works BUT when visiting the generated page it shows me as logged out. What do I need to add?


[b]Stephen G
Re: [7.x] Generic Page Outside of forum directory [Re: Stephen G] #314651
07/07/2007 11:24 PM
07/07/2007 11:24 PM
Joined: Mar 2000
Posts: 25,587
Texas
AllenAyres Offline
I type Like navaho
AllenAyres  Offline
I type Like navaho
Joined: Mar 2000
Posts: 25,587
Texas
should work fine, check to make sure you have cookies set to be used site-wide

/


- Allen wavey
- What Drives You?
Re: [7.x] Generic Page Outside of forum directory [Re: AllenAyres] #314652
07/08/2007 4:14 AM
07/08/2007 4:14 AM
Joined: Jan 2007
Posts: 70
UK
Stephen G Offline
Power User
Stephen G  Offline
Power User
Joined: Jan 2007
Posts: 70
UK
Hmmmm

It works now with no changes but the other day...

Hmmmm

Thanks anyway Allen

smile


[b]Stephen G
Re: [7.x] Generic Page Outside of forum directory [Re: Calpy] #315042
07/29/2007 11:11 PM
07/29/2007 11:11 PM
Joined: Oct 2004
Posts: 30
S
swebs Offline
User
swebs  Offline
User
S
Joined: Oct 2004
Posts: 30
It was much easier on the old 6.4 boards to do everything in 1 file. Is there anyway to do that now?

How can I check to see if a user belongs to a specific group to display certain data to?

Also, I want to open a custom database table to display data from if the user belongs to a certain group.

For me this was easy with the old wrapper. Where do I put my php code for this?

Here is just a little sample of the code.

Code
if ( (ereg ("-8-", $groups)) || (ereg ("-15-",$groups)) ) {
        echo "<br>(Member access)";
} else {
        echo "<br>Public access";
}
        echo "</center><p>";

        // Get all the info
        $wowConnect = mysql_connect($config['dbserver'], $config['dbuser'], $config['dbpass']);
        if ($wowConnect){
           mysql_select_db($config['dbname'], $wowConnect);
        }


thanks in advance for any help.

Re: [7.x] Generic Page Outside of forum directory [Re: Calpy] #315074
08/03/2007 7:58 AM
08/03/2007 7:58 AM
Joined: Nov 2003
Posts: 331
UK
M
Mark_S Offline

Beta Tester
Mark_S  Offline

Beta Tester
M
Joined: Nov 2003
Posts: 331
UK
I followed AllenAyres txt file
got the paths from my control panel and works a treat.

Its easier than you think wink


BOOM 7.6.+ rocks....
Re: [7.x] Generic Page Outside of forum directory [Re: Calpy] #315076
08/03/2007 8:13 PM
08/03/2007 8:13 PM
Joined: Aug 2007
Posts: 2
J
JonMcG Offline
Lurker
JonMcG  Offline
Lurker
J
Joined: Aug 2007
Posts: 2
could someone explain to me in layman's terms what this all allows me to do? I think this is an answer i've been looking for, but i'm a little confused about it, and would like to clear it up before I start to really dig into it and get moving on it.

Thanks in advance!

Last edited by JonMcG; 08/03/2007 8:14 PM.
Re: [7.x] Generic Page Outside of forum directory [Re: JonMcG] #315078
08/04/2007 2:26 AM
08/04/2007 2:26 AM
Joined: Feb 2002
Posts: 2,575
England
Ian_W Offline
Veteran
Ian_W  Offline
Veteran
Joined: Feb 2002
Posts: 2,575
England
essentially it allows you to have one or more pages with your own content (within the template page) on your site, whilst still retaining the header, footer, sidebars, breadcrumbs etc.

We have around 100 other pages on our site.

It can be used for anything.

Of course it is simple to add further scripting into those pages.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Re: [7.x] Generic Page Outside of forum directory [Re: Ian_W] #315079
08/04/2007 2:43 PM
08/04/2007 2:43 PM
Joined: Aug 2007
Posts: 2
J
JonMcG Offline
Lurker
JonMcG  Offline
Lurker
J
Joined: Aug 2007
Posts: 2
and the pages are built into UBB? Or do I need to setup an external HTML site and link it to my UBB somehow?

Also, is this something i do through the admin panel? Or will the owner of the forums need to do it?

Thanks for responding wink

Re: [7.x] Generic Page Outside of forum directory [Re: JonMcG] #315080
08/04/2007 3:15 PM
08/04/2007 3:15 PM
Joined: Feb 2002
Posts: 2,575
England
Ian_W Offline
Veteran
Ian_W  Offline
Veteran
Joined: Feb 2002
Posts: 2,575
England
The page that the user sees is external to UBB (and can be anywhere on your domain) - however you will need to upload the script page to the scripts folder and the template page to the templates/default folder.

For the various scripts and template pages I preceded these files with ff for FansFocus.Com so that I can easily find them within the folders. They do not need to be the same name as the page the user sees on your site.

Just follow the examples shown above and you should be fine smile


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Re: [7.x] Generic Page Outside of forum directory [Re: JoshPet] #316119
10/24/2007 7:01 AM
10/24/2007 7:01 AM
Joined: Sep 1999
Posts: 97
Sydney, Australia
M
Myke Offline
Power User
Myke  Offline
Power User
M
Joined: Sep 1999
Posts: 97
Sydney, Australia
Would it be possible to have this generic page configured such that the left and/or right columns could be on or off? Or does the user's preference setting prevent this?

Re: [7.x] Generic Page Outside of forum directory [Re: Myke] #316120
10/24/2007 1:31 PM
10/24/2007 1:31 PM
Joined: Mar 2000
Posts: 25,587
Texas
AllenAyres Offline
I type Like navaho
AllenAyres  Offline
I type Like navaho
Joined: Mar 2000
Posts: 25,587
Texas
It would follow what you have set in the control panel.


- Allen wavey
- What Drives You?
Re: [7.x] Generic Page Outside of forum directory [Re: JoshPet] #317527
08/30/2008 3:34 PM
08/30/2008 3:34 PM
Joined: Aug 2008
Posts: 1
C
Claus1 Offline
Lurker
Claus1  Offline
Lurker
C
Joined: Aug 2008
Posts: 1
Originally Posted by JoshPet
In UBB.Threads 7, a /scripts/sample.inc.php file is provided to help you create your own custom pages as needed.

For example, you can duplicate the /scripts/sample.inc.php file to /scripts/mypage.inc.php Then create a /templates/default/mypage.tpl template file with the HTML for your page.

Then visiting ubbthreads.php?ubb=mypage will load that page.


I have tried unsuccessfully to make a generic page (inside of the forum directory). While there is a sample.inc.php script, there is no sample.tpl file I can use, and as a complete newbie with no real desire to learn php, I have no idea where to start.

Is this documented somewhere? I guess what I need is a step by step instruction on how to make generic pages (for dummies) - which I will use for static link collections, about-texts etc.

I am not trying to make anything complicated, just a static custom page with some plain html content.

While fiddling around with this, I got the following error when trying to view my page:

page_about_gpc not found!

Any help/pointers or links to instructions would be highly appreciated.

Last edited by Claus1; 08/30/2008 3:34 PM.
Re: [7.x] Generic Page Outside of forum directory [Re: Claus1] #317528
08/30/2008 5:43 PM
08/30/2008 5:43 PM
Joined: Jan 2000
Posts: 5,938
Portland, OR, USA
Gizmo Offline

UBB.Dev / UBB.Wiki Owner
Time Lord
Gizmo  Offline

UBB.Dev / UBB.Wiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,938
Portland, OR, USA
well, all the tpl file is would be your html code... you can use smarty code in it, which examples would be every .tpl file in the directory.


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, UBB.Sitemaps

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
· Blue Host
· Interserver.net
Visit Us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,938
Joined: January 2000
Show All Member Profiles 
Forum Statistics
Forums64
Topics37,448
Posts293,484
Members13,793
Most Online1,498
Mar 17th, 2017
Top Posters(All Time)
AllenAyres 25,587
JoshPet 11,330
Rick 8,373
LK 7,396
Lord Dexter 6,503
Gizmo 5,938
Greg Hard 5,533
Top Posters(30 Days)
isaac 4
Today's Statistics
Currently Online 724
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 20
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2018 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.6.2
(Preview build 20180611.dev)
Page Time: 0.080s Queries: 16 (0.021s) Memory: 3.5233 MB (Peak: 3.9175 MB) Zlib enabled. Server Time: 2018-06-20 21:18:10 UTC