Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
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
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
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....)
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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, My UBB Scripts
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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://ubbdev.com

thumbsup


- Allen wavey
- What Drives You?
Joined: Jan 2007
Posts: 70
Power User
Power User
Joined: Jan 2007
Posts: 70
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 ?

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
Yes, very simple to do smile


- 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
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
Attachments
2340-index.txt (619 Bytes, 162 downloads)


- Allen wavey
- What Drives You?
Joined: Jan 2007
Posts: 70
Power User
Power User
Joined: Jan 2007
Posts: 70
Thank You

smile

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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, My UBB Scripts
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
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
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
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....)
Joined: Jan 2007
Posts: 1
Lurker
Lurker
Joined: Jan 2007
Posts: 1
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

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Thank you for the headsup, post edited to include above mentioned fix smile


- Allen wavey
- What Drives You?
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Doah, a bit isdexlic I guess. tipsy

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
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

Joined: Dec 2002
Posts: 67
Power User
Power User
Joined: Dec 2002
Posts: 67
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!"

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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, My UBB Scripts
Joined: Dec 2002
Posts: 67
Power User
Power User
Joined: Dec 2002
Posts: 67
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}

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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, My UBB Scripts
Joined: Dec 2002
Posts: 67
Power User
Power User
Joined: Dec 2002
Posts: 67
Was there any response to how to disable portal boxes/side bars on these pages? =)

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
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....)
Joined: Jan 2007
Posts: 70
Power User
Power User
Joined: Jan 2007
Posts: 70
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?

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
should work fine, check to make sure you have cookies set to be used site-wide

/


- Allen wavey
- What Drives You?
Joined: Jan 2007
Posts: 70
Power User
Power User
Joined: Jan 2007
Posts: 70
Hmmmm

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

Hmmmm

Thanks anyway Allen

smile

Joined: Oct 2004
Posts: 14
User
User
Offline
Joined: Oct 2004
Posts: 14
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.

Joined: Nov 2003
Posts: 329
Beta Tester
Beta Tester
Offline
Joined: Nov 2003
Posts: 329
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....
Joined: Aug 2007
Posts: 2
Lurker
Lurker
Offline
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.
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
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....)
Joined: Aug 2007
Posts: 2
Lurker
Lurker
Offline
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

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
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....)
Joined: Sep 1999
Posts: 76
Power User
Power User
Offline
Joined: Sep 1999
Posts: 76
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?

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
It would follow what you have set in the control panel.


- Allen wavey
- What Drives You?
Joined: Aug 2008
Posts: 1
Lurker
Lurker
Offline
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.
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
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, My UBB Scripts

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
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 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
Morgan 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)