Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Mod Name / Version: Generic Threads Page

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.


Attachments
81311-generic.php.zip (0 Bytes, 220 downloads)

Last edited by JoshPet; 05/20/2003 8:36 PM.
Sponsored Links
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
That's pretty nifty Josh! Will it work with the sidbarpal?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yup. It will - as it uses the threads headers and footers.

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Hmm maybe I should post the one that uses a template system

Nice work Mr. Banana. I think there are about 5 version lying around this forum for this one in various stages of development.

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK -

Here is a templated version.

Instructions: Edit the path and page title at the top of the php file. Rename the file and the template to the name of your choice.

In the php file - where it requires the .tmpl file - be sure to edit the name if you've renamed it.

Put your HTML into the tmpl file.

The php file can be anywhere on your website - the template should be in the /ubbthreads/templates/default directory.
Attachments
81320-GenericPageTemplated.zip (0 Bytes, 164 downloads)

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
LOL I knew if I said I would post the template version you would do it

Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
You must know the Jedi Mind Trick!!!

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
LOL
Wasn't trying to outdo anybody - it just was real quick and simple. Might as well have it available for people who want that as well.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
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.

Sponsored Links
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
Hmmm.... I really should post that hack for fully integrating CafePress into Threads.....

(waits for Josh to post it first)

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
LOL You can do that.

Joined: Feb 2001
Posts: 2,268
Junior Member
Junior Member
Offline
Joined: Feb 2001
Posts: 2,268
[]AKD96 said:
Hmmm.... I really should post that hack for fully integrating CafePress into Threads.....

(waits for Josh to post it first) [/]

You are not strong enough in the force young padwa to use the scriptor mind trick on a code master like JoshPet...

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
LOL Okay now stop making fun.

You know if you hint at something Josh is going to do it.

Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
Nice Josh.

Kinda wish I'd had something like this a few months back when I started making my EQ roster addon for threads.

I made it through though, and I must say, I'll use this template as I start to convert the rest of my site to a "Threads style" format.

No sense in reinventing the wheel.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Is the download in the first post the latest code?


- 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
The first post is the untemplated version - the next post where I attached the file - is a templated version.

But I link to the templated version in my first post as well.

For some simple pages - I'm fine without the template - but for more advanced stuff - it's definately nice, and more consistant with threads.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
great work on both


- Allen wavey
- What Drives You?
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Just a thought

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.

Great work, and thanks for sharing the mods.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Jul 2003
Posts: 10
Newbie
Newbie
Joined: Jul 2003
Posts: 10
Hello everyone,

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


Thanks in advance,
Robert

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

Joined: Jul 2003
Posts: 10
Newbie
Newbie
Joined: Jul 2003
Posts: 10
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.

Thanks again!

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
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?

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Actually, it's very easy. If the file is named foobar.php, edit languages/english/online.php and add

Code
$ubbt_lang['foobar'] = "Viewing the Foo Bar page";

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Thanks Dave, can you give me an idea of where to put it? I don't really see a pattern. TIA.

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
You can add it anywhere. I've been adding that stuff at the end of the file, just before the closing bracket:

Code
$ubbt_lang['foobar'] = "Viewing the Foo Bar page";<br />?>


Make a backup of the file before you change it, and be careful not to add any whitespace after the ?>.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Thanks

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
Hola! I've got a couple questions about this now!

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!

-peter

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Before the send_header function in those pages - try adding this:


$config['isclosed'] = 0;


I *think* that'll override it.

Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
thanks josh, I'll try that!

Joined: Apr 2001
Posts: 186
Member
Member
Offline
Joined: Apr 2001
Posts: 186
hmm

i got a little error ??

see it here, something vith the table colors ??

http://www.4701.dk/ubbthreads/pigelisten.php

any ideas what i did wrong ??

Code
 <?<br />// Generic UBB.Threads page by Joshua Pettit<br />// aka JoshPet of www.joshuapettit.com <br />// UBB.Threads Elements ©Infopop.com and Rick Baker<br /><br />// Variables - Edit these As Needed<br /><br />// What is the title of the page:<br />	$pagetitle = "Pigelisten";<br />	<br />// What is the PATH (not URL) to your threads install?<br />// You'll find this in your threads config file<br />// Do not include trailing slash<br />	$threadspath = "/usr/local/www/sites/4701.dk/httpdocs/ubbthreads";<br /><br /><br /><br />// DO NOT EDIT THIS SECTION<br />// Require the library<br />   require ("$threadspath/main.inc.php");<br /><br />   $userob = new user;<br />   $user = $userob -> authenticate();<br /><br /><br />   $html = new html;<br />   $html -> send_header($pagetitle,$Cat,0,$user);<br /><br />// ---------------------<br />// Grab the tablewrapper<br />   list($tbopen,$tbclose) = $html -> table_wrapper();<br /><br />// Now let's draw the table<br />	echo "$tbopen";<br />	<br />// Now let's create a header with the page title in it<br />	echo "<tr><td class=\"tdheader\">$pagetitle</td></tr>";<br />	<br />// Now let's open the next table cell for the body of your page:<br />	echo "<tr><td class=\"lighttable\">";<br />	<br /><br /><br /><br />// The rest of the page<br />// YOU CAN EDIT THIS SECTION<br /><br />// Put the HTML of your page below this<br /><br /><br /><br /><br />echo <<<PAGEHTML<br /><br /><br /><tr><br />    <td><b>Gudinde Navn</b></td><br />    <td><b>Gudindens hjemmeside</b></td><br />	</tr><br /> <br /><br /><br /><br />PAGEHTML;<br />$database = mysql_connect("localhost", "xxx", "xxxx");<br />if (!$database) die ('Kunne ikke forbinde til databasen');<br /> mysql_select_db("ubb",$database);<br />mysql_select_db("ubb",$database) or die('Kunne ikke vælge database');<br /> $foresp = mysql_query("SELECT U_Number,U_Title,U_Username,U_Email,U_Homepage,U_Approved, U_Groups FROM w3t_Users <br /> 	WHERE   U_Groups = '-6-'<br /> ORDER BY U_Username");<br />if (!$foresp) die (mysql_error()); <br />print mysql_num_rows($foresp)." fundet<BR><BR>";<br />while ($data = mysql_fetch_array($foresp)) {<br />        <br />		echo "<tr><td>$data[2]</td>";<br />		echo "<TD><A href= http://".$data[4].">".$data[4]."</A></TD>";<br />        echo "</tr>";<br />		<br />   }<br />// DO NOT EDIT BELOW THIS LINE<br /><br />// Close out the table<br />	echo "</td></tr>$tbclose";		<br /><br />// Send the footer<br />  $html -> send_footer();<br />?> 

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You need to assign the class either "lighttable" or "darktable" to each <td> cell.

Joined: Mar 2003
Posts: 215
Junior Member
Junior Member
Offline
Joined: Mar 2003
Posts: 215
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);

// ----------------
// Assign the stuff
list($Title,$HTML,$Markup,$fheader,$fstyle) = $dbh -> fetch_array($sth);
$dbh -> finish_sth($sth);

// -------------------------------------------------
// 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]

Last edited by RandyJG; 10/15/2003 10:13 PM.
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
thought I would add that this creates an issue in 6.4..

throws an error

Notice: Undefined variable: config in /your/path/to/ubbthreads/ubbt.inc.php on line 931

Joined: Jan 2003
Posts: 141
Journeyman
Journeyman
Offline
Joined: Jan 2003
Posts: 141
I didn't have a problem on my 6.4b1 board using this. I have sinced switched to the templated one though.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Hmmm... shouldn't be any problem. We're using it here and at other sites for various purposes.

It's really just a send_header and a send_footer.

Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
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...

Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Offline
Joined: Mar 2000
Posts: 528
Quick question, this may already be part of the Generic Page.

Does the Menubar up top appear when using the Generic Page? (ie Welcome Medar...Main Index, Entrance, Search, etc).

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yes.

Joined: Mar 2000
Posts: 528
Junior Member
Junior Member
Offline
Joined: Mar 2000
Posts: 528
Thanks Josh

Page 1 of 2 1 2

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
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
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)