Drupal 6 Can';面板中的t显示块

Drupal 6 Can';面板中的t显示块,drupal-6,drupal-views,drupal-modules,drupal-panels,Drupal 6,Drupal Views,Drupal Modules,Drupal Panels,我对drupal是新手,对面板也是新手。我有一个自定义模块,它根据用户分类显示rss提要项。它以块的形式显示正确的信息,但它需要位于用户的仪表板页面上,该页面使用面板。当我尝试插入它时,它总是空白的 代码插入一个我已经创建的默认视图,将所有提要项(1\u提要\默认值\提要\项)显示到一个块中。我无法在面板中编辑它。我想象有10种不同的事情我可能做错了,但我尝试了我能想到的每一种排列 <?php //.this function generates a block and calls the

我对drupal是新手,对面板也是新手。我有一个自定义模块,它根据用户分类显示rss提要项。它以块的形式显示正确的信息,但它需要位于用户的仪表板页面上,该页面使用面板。当我尝试插入它时,它总是空白的

代码插入一个我已经创建的默认视图,将所有提要项(1\u提要\默认值\提要\项)显示到一个块中。我无法在面板中编辑它。我想象有10种不同的事情我可能做错了,但我尝试了我能想到的每一种排列

<?php
//.this function generates a block and calls the second 
//function for the content of this block

function custom_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
case 'list':
  $block[0]['info'] = 'Custom View';
        $block[2]['cache'] = BLOCK_NO_CACHE;

  return $block;
   break;
case 'view':

            switch ($delta) {
      case 0:
        $block['subject'] = '';
        $block['content'] = custom_userfeeds() ;
        break;
    }

  return $block;
}
}


function custom_userfeeds() {
//finds the user id from argument on user page.  
//You can also find the user id the way the page you linked me to did, 
//but if you do it the way I am below it would allow admins 
//to view other users feeds
$uid = arg(1);
//loads the profile node -- 'profile' is the profile content type.

$node = content_profile_load('profile', $uid);
//find the terms associated with the user's profile

if ($node && $node->taxonomy) {
foreach($node->taxonomy as $term) {
  $terms[] = $term->tid;
}
}

//embeds a view with those terms passed to it.  
View display is something like block_1 or page_1
if($terms) {
$t = implode('+',$terms);
 return views_embed_view("1_feeds_defaults_feed_items","page_1", $t);
}

}

以下是我如何在视图中修复它的:
-添加参数->分类->分类术语ID
-提供默认参数
-PHP代码
-PHP参数代码:

global $user;
$query = "SELECT tid FROM {term_user} WHERE uid = %d";
$result = db_query($query, $user->uid);
if ($result) {
  $terms = array();
  while ($term = db_fetch_array($result)) {
  $terms[] = $term['tid'];
  }
if ($terms) {
   $termargs = implode("+", $terms);
   return $termargs;
  }
}
 else {
 return FALSE;
}

-选中“允许每个参数使用多个术语”。

以下是我在视图中修复它的方法: -添加参数->分类->分类术语ID -提供默认参数 -PHP代码 -PHP参数代码:

global $user;
$query = "SELECT tid FROM {term_user} WHERE uid = %d";
$result = db_query($query, $user->uid);
if ($result) {
  $terms = array();
  while ($term = db_fetch_array($result)) {
  $terms[] = $term['tid'];
  }
if ($terms) {
   $termargs = implode("+", $terms);
   return $termargs;
  }
}
 else {
 return FALSE;
}
-选中“允许每个参数使用多个术语”