View Single Post
  #1 (permalink)  
Old 05-21-2003, 12:44 PM
Virgil Virgil is offline
Junior Member
 
Join Date: Feb 2003
Location: Garland, Texas USA
Posts: 42
Forums Center Block
Have you guys ever considered using one "last 5 posts block" and css to control the appearence, instead of a different block for each theme. I don't use your block, but I took the one from saarport and changed and added classes and the one block changes with the themes. Important if you allow theme changes by users. Instead of distributing a different block with each theme, a single block could be distributed with instructions to add the classes to the style sheet if they wanted to use the block. Or, add the classes anyway and if they didn't use the block it wouldn't be that much extra baggage. Preferably the first option.

These are the classes I added to accomplish the task (this one is for Aeolus):
Code:
table.bbftbl {
	border: 2px outset #75919F;
}

td.bbfcolone {
	background-image: url(/themes/Aeolus/forums/images/post_bg.gif);
	border-bottom: 1px solid;
	border-right: 1px solid #75919F;
	color: #000000;
	font-family: Verdana, Helvetica;
	font-size: 10px;
}

td.bbfcolonetitle {
	background-image: url(/themes/Aeolus/forums/images/post_bg.gif);
	border-bottom: 1px ridge #000000;
	border-right: 1px ridge #000000;
	border-top: 1px ridge #000000;
	color: #000000;
	font-family: Verdana, Helvetica;
	font-size: 10px;
}

td.bbfcoltwo {
	background-image: url(/themes/Aeolus/images/7px.gif);
	border-bottom: 1px solid #75919F;
	border-right: 1px solid #75919F;
	color: #000000;
	font-family: Verdana, Helvetica;
	font-size: 10px;
}

td.bbfcoltwotitle {
	background-image: url(/themes/Aeolus/images/7px.gif);
	border-bottom: 1px ridge #000000;
	border-right: 1px ridge #000000;
	border-top: 1px ridge #000000;
	color: #000000;
	font-family: Verdana, Helvetica;
	font-size: 10px;
}

td.bbflastcol {
	background-image: url(/themes/Aeolus/forums/images/post_bg.gif);
	border-bottom: 1px solid #75919F;
	color: #000000;
	font-family: Verdana, Helvetica;
	font-size: 10px;
}

td.bbflastcoltitle {
	background-image: url(/themes/Aeolus/forums/images/post_bg.gif);
	border-bottom: 1px ridge #000000;
	border-top: 1px ridge #000000;
	color: #000000;
	font-family: Verdana, Helvetica;
	font-size: 10px;
}

td.bbftns {
	background-color: #75919F;
	background-image: url(/themes/Aeolus/images/hdr_bg.gif);
	color: #FAFAFA;
	font-family: Verdana, Helvetica;
	font-size: 10px;
}

td.bbftotals {
	background-image: url(/themes/Aeolus/images/cellpic.gif);
	color: #000000;
	font-family: Verdana, Helvetica;
	font-size: 10px;
	height: 20px;
}
This is the block I use with the classes added. It has totals, sitename and slogan.
Code:
<?php

/************************************************************************************/
/* PHP-NUKE: Web Portal System                                                      */
/* ===========================                                                      */
/*                                                                                  */
/* Copyright (c) 2001-2003 by Francisco Burzi (fburzi@ncc.org.ve)                   */
/* http://phpnuke.org                                                               */
/*                                                                                  */
/* CENTER BLOCK: block-bbforum.php for PHPNuke 6.5                                  */
/* v1.0  03-16-2003                                                                 */
/*                                                                                  */
/* by: Frank Wallacher (frank@saarport.dyndns.org)                                  */
/* http://www.saarport.net                                                          */
/*										    */
/* based on block-phpBB_Forums v1.0                                                 */
/* originally written by: Mat Verdonschot (mverdonschot@lycos.nl)                   */ 
/*                                                                                  */
/* This program is free software. You can redistribute it and/or modify             */
/* it under the terms of the GNU General Public License as published by             */
/* the Free Software Foundation; either version 2 of the License.                   */
/*                                                                                  */
/************************************************************************************/

if( eregi( "block-bbforum.php",$PHP_SELF ) )
{
   Header("Location: index.php");
   die();
}

if(file_exists("language/bbforum-block/lang-".$GLOBALS[currentlang].".php")) {
	include("language/bbforum-block/lang-".$GLOBALS[currentlang].".php");
}
else {
	include("language/bbforum-block/lang-$GLOBALS[language].php");
}

$last_topics = 5; // Shows the last new topics
$bbtopics = $GLOBALS['prefix'] . '_bbtopics';
$bbposts  = $GLOBALS['prefix'] . '_bbposts';
$users    = $GLOBALS['prefix'] . '_users';

/* Total Amount of Topics */
$sql = "SELECT * FROM $bbtopics";
$result = $GLOBALS['db']->sql_query($sql);
$topics_num = $GLOBALS['db']->sql_numrows($result);

/* Total Amount of Posts */
$sql = "SELECT * FROM $bbposts";
$result = $GLOBALS['db']->sql_query($sql);
$posts_num = $GLOBALS['db']->sql_numrows($result);

/* Total Amount of Topic Views and Replies */
$topic_views_num = 0;
$topic_replies_num = 0;
$sql = "SELECT topic_views,topic_replies FROM $bbtopics";
$result = $GLOBALS['db']->sql_query($sql);
while(list($topic_views,$topic_replies) = $GLOBALS['db']->sql_fetchrow($result)) {
	$topic_views_num = $topic_views_num + $topic_views;
        $topic_replies_num = $topic_replies_num + $topic_replies;
}

/* Total Amount of Members */
$sql = "SELECT * FROM $users";
$result = $GLOBALS['db']->sql_query($sql);
$users_num = $GLOBALS['db']->sql_numrows($result);

/* Last New Topics to get displayed */
$topic_buffer = "";
$sql = "SELECT 	topic_id,
		topic_title,
                topic_poster,
                topic_views,
                topic_replies,
                topic_last_post_id
	FROM $bbtopics
        ORDER BY topic_last_post_id
        DESC LIMIT $last_topics
       "; 

              
$result = $GLOBALS['db']->sql_query($sql);
while(list($topic_id,$topic_title,$topic_poster,$topic_views,$topic_replies,$topic_last_post_id) = $GLOBALS['db']->sql_fetchrow($result)) {

	$timeformat = _TIMEFORMAT;
        $sql = "SELECT topic_id,poster_id,
        	FROM_UNIXTIME(post_time,'$timeformat')
                as post_time
        	FROM $bbposts
                WHERE post_id = $topic_last_post_id
               ";
	$result2 = $GLOBALS['db']->sql_query($sql);
        list($topic_id,$poster_id,$post_time) = $GLOBALS['db']->sql_fetchrow($result2);
        // Format time 
        
        
        $sql = "SELECT user_id,username 
        	FROM $users
                WHERE user_id = $poster_id
               ";
        $result3 = $GLOBALS['db']->sql_query($sql);
        list($user_id,$username) = $GLOBALS['db']->sql_fetchrow($result3);
        $last_poster = ''.$username.'';
        
        $sql = "SELECT user_id,username 
        	FROM $users
                WHERE user_id = $topic_poster
               ";
        $result4 = $GLOBALS['db']->sql_query($sql);
        list($user_id,$username) = $GLOBALS['db']->sql_fetchrow($result4);
        $orig_poster = ''.$username.'';
       
	$topic_image = '[img]modules/Forums/templates/subSilver/images/icon_mini_message.gif[/img]';
        $topic_show_title = ''.$topic_title.'';
	$topic_buffer .= '<tr bgcolor="'.$GLOBALS[bgcolor3].'"><td class="bbfcolone" bgcolor="'.$GLOBALS[bgcolor1].'">&'.$topic_image.'&'.$topic_show_title.'</td><td class="bbfcoltwo" bgcolor="'.$GLOBALS[bgcolor1].'"><div align="center">'.$orig_poster.'</div></td><td class="bbfcolone" bgcolor="'.$GLOBALS[bgcolor1].'"><div align="center">'.$topic_views.'</div></td><td class="bbfcoltwo" bgcolor="'.$GLOBALS[bgcolor1].'"><div align="center">'.$topic_replies.'</div></td><td align="center" class="bbflastcol" bgcolor="'.$GLOBALS[bgcolor1].'">'.$last_poster.'&[img]modules/Forums/templates/subSilver/images/icon_latest_reply.gif[/img]
<font size="-2">[i]'.$post_time.'[i]</font></td></tr>';
}

/* Table Output */
$content .= '<table cellpadding="1" cellspacing="0" bgcolor="'.$GLOBALS[bgcolor2].'" width="100%" align="center" class="bbftbl">';
$content .= '<tr bgcolor="'.$GLOBALS[bgcolor2].'"><td width="100%" height="21" colspan="5" align="center" class="bbftns">'.$GLOBALS[sitename].'</td></tr>';
$content .= '<tr bgcolor="'.$GLOBALS[bgcolor3].'"><td align="center" width="40%" class="bbfcolonetitle">'._BBFORUM_NEWTOPICS.'</td><td align="center" class="bbfcoltwotitle">'._BBFORUM_POSTER.'</td><td align="center" class="bbfcolonetitle">'._BBFORUM_VIEWS.'</td><td align="center" class="bbfcoltwotitle">'._BBFORUM_REPLIES.'</td><td align="center" class="bbflastcoltitle">'._BBFORUM_LASTPOSTER.'</td></tr>';
$content .= $topic_buffer;
$content .= '<tr bgcolor="'.$GLOBALS[bgcolor3].'"><td align="center" colspan="5" class="bbftotals">'._BBFORUM_TOTTOPICS.' '.$topics_num.'&|&'._BBFORUM_TOTPOSTS.''.$posts_num.'&|&'._BBFORUM_TOTVIEWS.''.$topic_views_num.'&|&'._BBFORUM_TOTREPLIES.''.$topic_replies_num.'&|&'._BBFORUM_TOTMEMBERS.'&'.$users_num.'</center></td></tr>';
$content .= '<tr bgcolor="'.$GLOBALS[bgcolor2].'"><td width="100%" height="21" colspan="5" align="center" class="bbftns">'.$GLOBALS[slogan].'</td></tr>';
$content .= '</table>';
$content .= '<tr bgcolor="'.$GLOBALS[bgcolor2].'"><td align="center" colspan="5" class="content">[ '._BBFORUM_FORUM.' ]&&&[ '._BBFORUM_SEARCH.' ]</center></td></tr>';

?>
Reply With Quote