Below is a hack that Im using on my site to display the latest discussion topics on every page of my site. Now this page is included via SSI into all my pages.
Now it is using a seperate style sheet from the rest of the site because Im having problems in trying to apply a class to this page. It is currently using Forum.css. Id like it to use the main style sheet, stablewars.css. Now stablewars.css is a class defined called forum, id like to apply this class to this page. I know I can apply the sheet to this page by simply changing the style sheet link file from forum.css to stablewars.css, but how and where do I apply the class forum? Ive had a go a few times and can't get it to work, get errors. Anyone have ideas?
PHP Code:<font color="#CCCCCC"></font>
<?php
define('IN_PHPBB', true);
//$css ="http://www.stablewars.com/phpBB2/templates/subSilver/subSilver.css"; //path and name to your css_sheet - optional
$css ="http://www.stablewars.com/forum.css"; //path and name to your css_sheet - optional
$limit = "5"; // how many topics?
$phpbb_root_path = "../phpBB2/"; //path to below files
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
echo "<link rel=\"stylesheet\" href=\"$css\" type=\"text/css\">"; // - optional
$recent_sql = "SELECT topic_id,topic_title,topic_last_post_id,forum_id FROM " . TOPICS_TABLE . " WHERE forum_id !='14' and forum_id !='12' ORDER BY topic_last_post_id DESC LIMIT $limit";
$recent = $db->sql_query($recent_sql);
echo "<table width=\"90%\" align=\"center\"><tr><td colspan=\"2\" align=\"left\"><span class=\"gen\"></span></td></tr>";
while ($line = mysql_fetch_array($recent)) {
$security=FALSE;
if($forum_auth == 2 && $userdata['user_level'] == ADMIN) {
$security=TRUE;
}
if($forum_auth == 3 && ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == 2)) {
$security=TRUE;
}
if($forum_auth == 0) {
$security=TRUE;
}
if($security == TRUE)
{
$lastpost_array=$db->sql_query("SELECT post_time FROM " . POSTS_TABLE . " WHERE post_id =" . $line['topic_last_post_id']);
$lastpost=mysql_fetch_array($lastpost_array);
$lastpost=$lastpost['post_time'];
$lastpost=create_date($board_config['default_dateformat'], $lastpost, $board_config['board_timezone']);
$j = stripslashes($line['topic_title']);
$k = substr($j, 0, 25) . "...";
echo "<tr><td align=\"left\"><span class=\"gensmall\">»» </span> <a href=\"$phpbb_root_path/viewtopic.php?t=" . $line['topic_id'] . "\" class=\"genmed\">" . $k . "</a></td></tr>"; }};
echo "</table>";
?>






Bookmarks