`
文章列表
taxonomy_get_tree($vid, $parent, $depth, $max_depth)   这个函数生成一个词汇表的层级化表示。参数$vid就是用来生成层级树的词汇表的词汇表ID。如果你不想为一个词汇表生成一个整树的话,而只想生成一个以$parent声明的词语ID为根的子树,这时你可以声明参数$parent。参数$depth是内部使用的参数,默认为-1.参数$max_depth是一个整数,用来指出返回树的层级数,它默认为NULL,这意味着所有的层级。这个函数返回了一个包含词语对象的数组,这里向词语对象添加了“depth” 和 “parents”键。“depth” 键是一个 ...
/** * Implements hook_form_alter */ function mymodule_form_alter(&$form, &$form_state, $form_id) { switch ($form_id) { case 'user_pass': // user pass page $form['name']['#title'] = t('请输入您的注册邮箱:'); $form['name']['#description'] = ''; $form['actions']['sub ...

Linux SSH命令

  rm -rf mydir /* 删除mydir目录 */cd mydir /* 进入mydir目录 */cd – /* 回上一级目录 */cd ~ /* 回根目录 */mv tools tool /* 把tools目录改名为tool */ln -s tool bac /* 给tool目录创建名为bac的符号链接,最熟悉的应该就是FTP中www链接到public_html目录了 ...
ckeditor 模块中自定义class 在ckeditor模块中,编辑内容时, 在源码中填写<div class="myclass">some content</div>,ckeditor不会帮你保存class, 成为:<div >some content</div>,解决方法如下: 在这个路径下:admin/config/content/ckeditor/edit/Full 高级选项中:Custom JavaScript configuration:填写: config.allowedContent = tru ...
function one_crawl($form, $form_state) { $link = 'http://blog.eau-thermale-avene.cn/post/536.html'; blog_crawler($link); } //save url content to node:blog. function blog_crawler($link, &$context = array(), $summary = NULL) { if (empty($link)) return; watchdog('crawler link', $l ...
  php中的 substr(string,start,length) 该函数对string进行截取操作,截取从字符串的start位置开始,到length长度结束。利用substr()函数对普通字符进行截取操作会非常方便,但对全角字符进行截取可能会造成乱码。   drupal提供了一个安全可靠,又快速的字符串截取函数,无需区分字符是全角还是半角 drupal_substr($text, $start, $length = NULL)   function drupal_substr($text, $start, $length = NULL) { global $mult ...
//file 类型:http://xieyanxy9.iteye.com/admin/blogs/1953856 function weixin_other_parameters($form, $form_state) { $form['image_example_image_regist'] = array( '#title' => '宣传图 注册登录', '#type' => 'managed_file', '#upload_location' => 'public://weixin/', '#default_value ...
https://drupal.org/node/1395184 #11works ok
转自:http://www.ggseo.cn/blog/post/cache-control.html http响应头信息与搜索引擎蜘蛛,网站速度有着密切关系。通过设置相关头信息可以提高搜索引擎蜘蛛及用户的访问速度,提升网站有效内容的抓取量.   cache-control是用于控制网页的缓存.常见的取值有private、no-cache、max-age、must- revalidate等,默认为private。 cache-control有哪些属性?   其作用根据不同的重新浏览方式分为以下几种情况:cache-control 打开新窗口(_blank)

验证手机号码

function _user_information_validate(&$form, &$form_state) { if (empty($form_state['values']['field_phone']['und'][0]['value'])) { form_set_error('account][field_phone', '您必须输入手机号码!'); } $mobile = isset($form_state['values']['field_phone']['und'][0]['value']) ? $form_state['v ...
https://drupal.org/node/1940738 https://drupal.org/files/respect_link_target-1940738-1.patch diff --git a/field_slideshow.module b/field_slideshow.module index e3eb071..cb5fc62 100644 --- a/field_slideshow.module +++ b/field_slideshow.module @@ -704,9 +704,13 @@ function field_slideshow_field_ ...
$node = node_load(7); $comments = comment_load_multiple(comment_get_thread($node, '', 100)); //print_r($comments); foreach($comments as $key=>$comment){ print $comment->registered_name?$comment->registered_name:$comment->name; }  
https://drupal.org/node/2035945 override label for "Any" value on non-required single-select exposed filters per exposed field 在配置该过滤条件时,会多出一项覆盖“any”的表单
Entity property information :https://drupal.org/node/1021466 Entity property  翻译成中文就是实体属性;   entity property   information 包括: date types;数据类型      链接:https://drupal.org/node/905580 entity metadate wrappers ; 实体元数据封装     连接:https://drupal.org/node/1021556    http://drupalcontrib.org/api/drup ...
drupal官网地址:https://drupal.org/node/594744   Drush Windows安装程序提供了一种方便的方式,运行安装下面的Drush组件就可以使用drush了, 你可以点击这里直接下载: 下载的Windows Installer 6.0 Drush ———————————————————————————————————————————————————————————————————————————————————— 也可以到这里去看它的详细介绍———— 这里详细介绍了Drush Windows安装程序:http://drush.ws/dr ...
Global site tag (gtag.js) - Google Analytics