 |
 |
 |
 |
#247128 - 05/20/03 07:56 PM
Beta-[6.0-6.1-6.2-6.3] Generic Threads Page
|
I type Like navaho
Registered: 11/29/01
Posts: 11330
Loc: Charlotte, NC
Add to del.icio.us
Digg it
|
Mod Name / Version: Generic Threads Page <br /> <br /> 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. <br /> <br /> Working Under: UBB.Threads 6.0-6.1-6.2-6.3 <br /> <br /> Mod Status: Beta <br /> <br /> Any pre-requisites: none <br /> <br /> Author(s): JoshPet <br /> <br /> Date: 05/20/03 <br /> <br /> Credits: I think Wrath posted the first "basic page" here long ago. <br /> <br /> Files Altered: none <br /> <br /> New Files: generic.php (you can rename this to anything you like - and duplicate it for as many pages as you wish.) <br /> <br /> Database Altered: none <br /> <br /> 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. <br /> <br /> 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. <br />Paste your HTML where indicated - near the center of the file. <img src="/forum/images/graemlins/smile.gif" alt="" /> <br /> <br /> If you would prefer a templated version - it's attached here. <img src="/forum/images/graemlins/smile.gif" alt="" /> <br /> <br /> Disclaimer: Please backup every file that you intend to modify. <br />If the modification modifies the database, it's a good idea to backup your database before doing so. <br /> <br />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. <br /> <br />
Attachments
81311-generic.php.zip (215 downloads)
Edited by JoshPet (05/20/03 08:36 PM)
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#247158 - 10/15/03 07:16 AM
Re: Beta-[6.0-6.1-6.2-6.3] Generic Threads Page
[Re: Daine]
|
Member
Registered: 04/23/01
Posts: 184
Loc: Denmark, the country vith all ...
|
hmm<br /><br />i got a little error ??<br /><br />see it here, something vith the table colors ??<br /><br /> http://www.4701.dk/ubbthreads/pigelisten.php<br /><br />any ideas what i did wrong ??<br /><br /> <?<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 />?>
|
|
Top
|
|
|
|
 |
 |
 |
 |
 |
 |
 |
 |
#247160 - 10/15/03 09:50 PM
Re: Beta-[6.0-6.1-6.2-6.3] Generic Threads Page
[Re: Daine]
|
Junior Member
Registered: 03/11/03
Posts: 231
Loc: Canada
|
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. <br /> <br />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. <br />Directions. <br /> <br />I'm assuming the generic.php for the template version is being used. It has to appear between the authenticate() and send_header() basically. <br /> <br />[/code] <br /> <br />Find: <br /> <br />$user = $userob -> authenticate(); <br /> <br />Add the following under this, changing 'MyBoard' to the forum's keyword the page should look like: <br /> <br />// ------ START Generic Page with forum look ------ <br /> <br /> $Board = "MyBoard"; //** Set to the keyword for the forum's style/header to use <br /> <br />// ------------------ <br />// Get the board info <br /> $Board_q = addslashes($Board); <br /> $query = " <br /> SELECT Bo_Title,Bo_HTML,Bo_Markup,Bo_SpecialHeader,Bo_StyleSheet <br /> FROM {$config['tbprefix']}Boards <br /> WHERE Bo_Keyword = '$Board_q' <br /> $groupquery <br /> "; <br /> $sth = $dbh -> do_query($query); <br /> <br />// ---------------- <br />// Assign the stuff <br /> list($Title,$HTML,$Markup,$fheader,$fstyle) = $dbh -> fetch_array($sth); <br /> $dbh -> finish_sth($sth); <br /> <br />// ------------------------------------------------- <br />// Here we need to figure out what stylesheet to use <br /> $mystyle = ""; <br /> isset($user['U_StyleSheet']) && $mystyle = $user['U_StyleSheet']; <br /> if (!$mystyle) { $mystyle = "usedefault"; } <br /> if ($mystyle == "usedefault") { <br /> $mystyle = $fstyle; <br /> if ($mystyle == "usedefault") { <br /> $mystyle = $theme['stylesheet']; <br /> } <br /> } <br /> $fstyle = $mystyle; <br /> // fstyle will now be set when used by send_header <br />// ------ END Generic Page with forum look ------ <br />[/code]
Edited by RandyJG (10/15/03 10:13 PM)
|
|
Top
|
|
|
|
 |
 |
 |
 |
| |