Whole Book in a Block with Lists

Just copy the code into a php custom block. Make sure you replace $book_top_page with the book id you wish to show.

Drupal 6.x

(This was added by user littlelloyd for Drupal 6.)

<?php
$book_top_page = 1;
$levels_deep = 3;
$emulate_book_block = true;

if (!function_exists('book_struct_recurse')){
function book_struct_recurse($nid, $levels_deep, $children, $current_lineage = array(), $emulate_book_block = true) {
$struct = '';
if ($children[$nid] && ($levels_deep > 0 || ($emulate_book_block && in_array($nid, $current_lineage)))) {
$struct = '

    ';
    foreach ($children[$nid] as $key => $node) {
    if ($tree = book_struct_recurse($node->nid, $levels_deep - 1, $children, $current_lineage, $emulate_book_block)) {
    $struct .= '
  • ';
    $struct .= l($node->title, 'node/'. $node->nid);
    $struct .= $tree;
    $struct .= '
  • ';
    }
    else {
    if ($children[$node->nid]){
    $struct .= '

  • '. l($node->title, 'node/'. $node->nid) .'
  • ';
    }
    else {
    $struct .= '

  • '. l($node->title, 'node/'. $node->nid) .'
  • ';
    }
    }
    }
    $struct .= '

';
return $struct;
}
}
}

$current_lineage = array();

$result = db_query(db_rewrite_sql('SELECT n.nid, n.title, n2.nid parent, ml.weight
FROM {node} n

Commnet setting in Drupal 6.x

I am trying to work on drupal 6.0 RC1 & 2 but I could not found setting tab for commnet as drupal 5.x. have anybody know this issue please tell me.

Thanks,

Nguyen

6.2 RC install problem

hello,
i currently try to setup 6.2 on a one.com server.
The thing is i just had joomla 1.5 installed and moved all files to a diffrent folder. Than i uploaded all 6.2 release files to the root of the server. But when i try now to access the domain i get a INTERNAL SERVER ERROR message.

Yesterday i successful installed 6.1 on a diffrent host and had no problem. Teh only diffrence was i first uploaded 6.1 release to the root and than just overwritten it with 6.2 data.

Do i need to first upload 6.1 ---> than 6.2 ?

Ideas?

Thanx,
Laura

Problems with pear (or drupal)

I run a Debian Etch server with PHP5, lighttpd and pear.
I have five virtual hosts, up and rocking. Everything works fine.

Now I have to install a brand new one on Drupal. But I get:

Warning: require_once(./includes/bootstrap.inc) [function.require-once]: failed to open stream: No such file or directory in /home/ ...path to dir ... /.index.php on line 12

Fatal error: require_once() [function.require]: Failed opening required './includes/bootstrap.inc' (include_path='.:/usr/share/php') in /home/ ... path to dir .... /index.php on line 12

Wildcard usage and core's wildcards

Making use of wildcards

(This section is a brief summary of Dynamic arguments replacement)

With Drupal 5, if you wanted to define a dynamic menu path (so that node/1, node/342, node/563, ad infinitum were all handled by the node_page_view function), then you would have to check the $may_cache flag in your hook_menu implementation and then check each piece of the path using arg, like this example from D5's node.module:

    if (arg(0) == 'node' && is_numeric(arg(1))) {
      $node = node_load(arg(1));
      if ($node->nid) {
        $items[] = array('path' => 'node/'. arg(1), 'title' => t('View'),
          'callback' => 'node_page_view',
          'callback arguments' => array($node),
          'access' => node_access('view', $node),
          'type' => MENU_CALLBACK); 

Drupal 6 changes this to a much more elegant system, the following being the equivalent code from D6's node.module:

  $items['node/%node'] = array(
    'title' => 'View',
    'page callback' => 'node_page_view',
    'page arguments' => array(1),
    'access callback' => 'node_access',
    'access arguments' => array('view', 1),
    'type' => MENU_CALLBACK); 

Howto remove whitebox from startpage?

Hello,
sorry if this is very simpel but i cannot figure out howto remove the white box on the homepage.

Do i need to modify the template or is this a setting (And if its a setting please point me to it).

Thanx :)

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x