Planning page support?

seutje - July 26, 2009 - 10:55
Project:Drupal vB
Version:6.x-2.0
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hey there, awesome module, but my use-case required it to have the news & announcements forum to be exposed on the frontpage

so I made a quick (and rather dirty) module to do that
so I just made a page callback like this

<?php
  $fid
= 72; // hardcoded forum id for news & announcements forum
 
require_once drupal_get_path('module', 'drupalvb') .'/drupalvb.inc';
  if (!
drupalvb_db_is_valid() || !is_numeric($fid)) {
    return
t('Forum not found.');
  }
 
$result = drupalvb_db_query("SELECT t.*, p.* FROM {thread} t INNER JOIN {post} p ON p.postid = t.firstpostid WHERE t.forumid = %d ORDER BY t.threadid DESC LIMIT 10", $fid);
 
$threads = array();
  while (
$thread = db_fetch_array($result)) {
   
$threads[] = drupalvb_theme_thread($thread);
  }
  if (
count($threads)) {
    return
implode('', $threads);
  }
  return
t('No threads found');
?>

drupalvb_theme_thread is just a temporary theming function I made to put the data in div's and stuff, of course this would need a proper theming function
also, another problem is the output format of the body text, which is usually bbcode or something, is there a way to trick drupal into thinking this was entered with a certain input format? so I can use an existing bbcode input format

so I was wondering if you've considered implementing something like this (but then generic) or would you consider this 'by design', as this module isn't really an integration, but more a linking module

if not, still many thanks for making it this easy

 
 

Drupal is a registered trademark of Dries Buytaert.