Description: This is a very basic - generic page which uses threads headers and footers, stylesheet - table wrappers etc.... and allows you to paste your own HTML in the file.
Working Under: UBB.Threads 6.0-6.1-6.2-6.3
Mod Status: Beta
Any pre-requisites: none
Author(s): JoshPet
Date: 05/20/03
Credits: I think Wrath posted the first "basic page" here long ago.
Files Altered: none
New Files: generic.php (you can rename this to anything you like - and duplicate it for as many pages as you wish.)
Database Altered: none
Info/Instructions: This is really basic - doesn't use templates. But useful if you wish to quickly make a page of your own, look like UBB.Threads.
Instructions: Edit the page title and path to your UBB Threads install at the top of the generic.php file. Place anywhere on your website. Duplicate and rename the page as needed. Paste your HTML where indicated - near the center of the file.
If you would prefer a templated version - it's attached here.
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.
Nah Back when Josh first wrote this I put it into a template cause I was big on integration and keeping all my eggs in a row. I knew if I meantioned something Josh would post the template one. Threads moved into using templated systems and so should our hacks.
Why not add in $user = $userob -> authenticate("U_Groups"); or even the full range for those who use groups, or or other items, so that threads features and benefits flowed through.
I was able to use the generic page. Works really great!
Im running into a little issue though and I do have no idea what may cause that one.
When running the page with my php in it and being already at the forum and going to the link ( This Link ), then everything is ok.
However when not already browsing at the forum and opening the link at a fresh browser window, then I do get the following error message (page displays below the errro fine though - suppose he somehow tries to send the header twice):
Code
Warning: Cannot add header information - headers already sent by (output started at /home/www/web17/html/dclan/swguser/memberlist/memberlist.php:3) in /home/www/web17/html/dclan/ubbthreads/ubbt.inc.php on line 1749
In addition I do only get the error message when being looged in (cookies). When accessing the link in a fresh browser without being logged in, the error message does not display.
Uh. Does anyone have an idea where that might come from? Im left a little clueless. We are running on version 6.3
usually header already sent errors are extra spaces after the PHP closing tag ?> at the end of the file. make sure there's nothing after that closing tag.
Thanks a lot Josh. With your guidiance I was able to spot was has been wrong. I have added style information at the most top of the page. Putting them into the "add your content here" section did the trick.
I would think that this wouldn't be very easy to do but I will throw it out there anyway. Is there a way to show that a users is looking at this page from the "Who's Online" page?
I've used this for a couple of the main pages on my site, and when I close the forums for maintenance or something, those pages then get closed as well...
Is there a way to add a config option to keep these pages working while the board is closed? Any help would be muchly appreciated!
I made an attempt at making a generic page that uses the specific forum's header/footer/style that I wanted. Instead of the default header, this grabs the header/footer/stylesheet for a sepecific forum before calling send_header. This is used if the page was associated with a specific forum, that had it's own look and header for example.
Note: This works on 6.2, not tested on 6.3. This will use the header/footer/stylesheet options for a specific forum. If a user is not using the default style, the page will have the user's selected style. Directions.
I'm assuming the generic.php for the template version is being used. It has to appear between the authenticate() and send_header() basically.
[/code]
Find:
$user = $userob -> authenticate();
Add the following under this, changing 'MyBoard' to the forum's keyword the page should look like:
// ------ START Generic Page with forum look ------
$Board = "MyBoard"; //** Set to the keyword for the forum's style/header to use
// ------------------ // Get the board info $Board_q = addslashes($Board); $query = " SELECT Bo_Title,Bo_HTML,Bo_Markup,Bo_SpecialHeader,Bo_StyleSheet FROM {$config['tbprefix']}Boards WHERE Bo_Keyword = '$Board_q' $groupquery "; $sth = $dbh -> do_query($query);
// ------------------------------------------------- // Here we need to figure out what stylesheet to use $mystyle = ""; isset($user['U_StyleSheet']) && $mystyle = $user['U_StyleSheet']; if (!$mystyle) { $mystyle = "usedefault"; } if ($mystyle == "usedefault") { $mystyle = $fstyle; if ($mystyle == "usedefault") { $mystyle = $theme['stylesheet']; } } $fstyle = $mystyle; // fstyle will now be set when used by send_header // ------ END Generic Page with forum look ------ [/code]
actually didn't matter if admin or non.. what fixed my problem was using a temp variable for the $config array ala $threadsconfig=$config and then before the footer changing it back because the php script I was including inside actually changed the $config array to its own...
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.