Welcome to my blog

FVANtom with staffMy name is Tom Vergult (a.k.a. FVANtom). I live in Belgium, near Brussels. My big ambition is to create a successful game development studio that is able to bring a more meaningful experience to gaming in general.

 

On this blog I will post useful information about various technical and non-technical subjects.

 

 

Recent comments

Code highlighting

A quick test to test code highlighting so I can post code snippets. I'm using the geshifilter for Drupal. Here is a code snippet that prevents search indexing for a certain node type. Just add it to a custom made module for your website.

/**
* Implementation of hook_db_rewrite_sql()
*/
function tnvgeneral_db_rewrite_sql($query, $primary_table, $primary_field, $args) {
  $exclude_node_type = 'image';
  // Exclude blockcontent nodes from the search results
  if ($query == '' && $primary_table == 'n' && $primary_field = 'nid' && empty($args)) {
    $where = " n.type != '$exclude_node_type' ";
    return array('where' => $where);
  }
}

In order to get it working together with WYSIWYG and TinyMCE I had to adjust the geshi.php according to this post:

Hi. I finally found a simple way to deal with the < and > problem.
Just add a few lines into geshi.php at around line 2016.

// Replace all newlines to a common form.
$code = str_replace("\r\n", "\n", $this->source);
$code = str_replace("\r", "\n", $code);

after this, add the following (take out the space between & and gt, lt

$code = str_replace("& gt;", ">", $code);
$code = str_replace("& lt;", "<", $code);

$code = str_replace("& amp;", "&", $code);

I'm using Drupal 6 and it worked as I intended.