 |
 |
 |
 |
#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
|
|
|
|
 |
 |
 |
 |
|
|