欢迎各位兄弟 发布技术文章
这里的技术是共享的
This is quite straightforward with user_roles() and array_search(). Below is a function which will return the role ID if there is a role matching the name and FALSE otherwise.
xiaopang
在模板文件中 用 $is_admin 来判断是否是管理员在template.php文件中 用 $variables['is_admin'] 来判断是否是管理员在模块文件中好像不行用 好像不能用 用这个吧 if(user_access('access administration pages')){ //这个绝对可以
Drupal结合ajax可以实现很多特出的功能,ajax功能强大,客户体验效果好。因此比较流行。简单实用ajax来调用生成好的drupal form.主要使用到hook menu drupal_get_form 还有hook_form
用户注册(User Registration)
Drupal提供了几种注册用户的方法:
1、管理员的邀请
2、访客的注册,但需要管理员的审批
3、任何访客
访客可注册你的网站的会员,可以点击首页的"User Login”block中的"Create new account”,如下图所示:
Has taxonomy terms (with depth) 带深度的
我的一个内容类型添加了地址字段,用的是China_address_field, 我想在
$form['#attributes'] = array('class' => 'search-form');
drupal6 d6
$form['new_row_wrapper'] = array( '#type' => 'markup', '#value' => '<br><div id="ahah-example-new-row-wrapper" style="clear: both;"></div>', );添加链接也是用markup 见 /node-admin/1809
drupal7 d7
1)安装 启用它2)admin/build/flags 添加(有个默认的可以修改)收藏的标识admin/build/flags/add 添加shouchang后产生一个shouchang3)然后 进 admin/build/flags/manage/shouchang(admin/build/flags/manage/bookmarks)进行修改 (当然可以直接添加 不用 进admin/build/flags/manage/shouchang 修改)4)进行保存5)它会自动创建两个视图 flag_bookmarks (这个是页面)和flag_bookmarks_tab(这个是tab页面)下面是flag_bookmarks_tab进去看看就会知道怎么回事6)当然也可以按照第5)步 自动创建的视图 进行依葫芦画瓢