| Support: http://www.visiblesoul.net/resources/forum/ +-------------------------------------------------------------------------- Want to show your appreciation for this block? Link to me on your website using the link code below: Get free MKPortal modules, blocks, hacks, and skins at Visible Soul Web Design - Corpus Christi, Texas! --------------------------------------------------------------------------- Config: --------------------------------------------------------------------------*/ $prefix = "ibf_"; // Database prefix $limit = 10; // Number of forum posts to show in block $cutoff = 40; // Number of characters to display in title $startformat = "long"; // Formats the start date. //Options are short, time, small, normal, long or leave blank for default. $lastformat = "short"; // Formats the last post date. //Options are short, time, small, normal, long or leave blank for default. /*------------------------------------------------------------------------*/ $content = " "; $DB->query("SELECT id, password, permission_array FROM ".$prefix."forums"); while( $f = $DB->fetch_row() ) { $perms = unserialize(stripslashes($f['permission_array'])); if ($mklib_board->check_permissions($perms['read_perms']) != TRUE or ($f['password'] != "" ) ) { $bad[] = $f['id']; } else { $good[] = $f['id']; } } if ( count($bad) > 0 ) { $qe = " AND forum_id NOT IN(".implode(',', $bad ).") "; } $DB->query("SELECT t.last_post, t.tid, t.title, t.views, t.posts, t.start_date, t.starter_name, t.last_poster_name, t.last_poster_id, t.forum_id FROM ".$prefix."topics t LEFT JOIN ".$prefix."forums f ON (t.forum_id = f.id) WHERE state!='closed' AND approved=1 AND (moved_to IS NULL or moved_to='') $qe GROUP BY t.title ORDER BY t.last_post DESC LIMIT 0,$limit"); while ( $post = $DB->fetch_row() ) { $post['title'] = strip_tags($post['title']); $post['title'] = str_replace( "!" , "!" , $post['title'] ); $post['title'] = str_replace( """, "\"", $post['title'] ); if (strlen($post['title']) > $cutoff) { $post['title'] = substr( $post['title'],0,($cutoff - 3) ) . "..."; $post['title'] = preg_replace( '/&(#(\d+;?)?)?(\.\.\.)?$/', '...',$post['title'] ); } $title = $post['title']; $tid = $post['tid']; $views = $post['views']; $posts = $post['posts']; $starter = $post['starter_name']; $lastname = $post['last_poster_name']; $lastid = $post['last_poster_id']; $forum_id = $post['forum_id']; $startdate = $this->create_date($post['start_date'], $startformat); $lastdate = $this->create_date($post['last_post'], $lastformat); $content .= " "; } $content .= "
Topic Title Last Post Last Post Date Views Replies
forum_url/index.php?act=ST&f=$forum_id&t=$tid\" title=\"Topic started by $starter on $startdate\">$title forum_url/index.php?act=ST&f=$forum_id&t=$tid&view=getlastpost\" title=\"Go to last post...\">Last Post by forum_url/index.php?showuser=$lastid\" title=\"Last poster: $lastname\">$lastname $lastdate $views $posts
"; unset($prefix); unset($limit); unset($cutoff); unset($startformat); unset($lastformat); unset($perms); unset($good); unset($bad); unset($qe); unset($post); unset($tid); unset($title); unset($views); unset($posts); unset($startdate); unset($lastdate); unset($starter); unset($lastname); unset($lastid); unset($forum_id); ?>