随笔分类 - Drupal7
摘要:drupal7,update,expression
阅读全文
摘要:global $user; $query_single = db_select('mp_order_singlepay', 'ms') ->fields('ms', array('order_id','order_time', 'article_name','total_amount','status','payment_method')); $query_single->c...
阅读全文
摘要:$site_name=variable_get('site_name', 'Drupal');
阅读全文
摘要:file_create_url('public://xxx.png'); // 得到URL drupal_realpath('public://xxx.png'); // 得到系统路径(磁盘路径,如D:\....)
阅读全文
摘要:简单暴力的获取区块的输出内容如下,我在page里想通过上面的方法输出我自定义区块,结果报错Notice: Only variables should be passed by reference,研究一番,就用了下面的方法:
阅读全文
摘要:直接引用全局变量就行: 参考: 代码测试: 结果:
阅读全文
摘要:Count queries Count queries Any query may have a corresponding "count query". The count query returns the number of rows in the original query. To obt
阅读全文
摘要:一、问题背景: 用profile2模块,扩展个人信息,增加了“手机号”等信息,一些地方想要获取当前用户的手机号 二、解决办法: 用profile2自带的方法:profile2_load_by_user。 单步调试看到成功获取了: 接下来就直接从获取的结果里面取出想要的值就行了:
阅读全文
摘要:unserialize($event->variables)
阅读全文
摘要:1.登录页面的 $form['form_id'] 和 $form['form_build_id'],是这样输出的: 2.密码找回页面是这样的 发现哪儿不同了吗?登录是drupal_render,而找回密码是render,写错的话,提交不成功,页面会刷新,但是没有任何响应,至于原因,以后再研究吧~~~
阅读全文
摘要:通过hook_menu()设置url的权限,有两种方式: 方式一:定义函数,通过 access callback 方式二:通过在权限页面配置,通过 access arguments
阅读全文
摘要:把办公室的drupal7.54版本放到自己的笔记本(OS:Windows10 Pro,php:7.0.9,mysql 5.7.11,apache:2.4)上运行不了,查看了各项配置应该没问题啊。之前还写了一篇:新安装的Apache和php,测试可以解析phpinfo,但是无法打开drupal网站 ,
阅读全文
摘要:参考:Apache Rewrite url重定向功能的简单配置 这两天折腾死了 首先说一下我的环境: Aache2.4.25-x64-vc14-r1;php-7.0.19-Win32-VC14-x64;Drupal7.54百度的方法不行啊:http://blog.csdn.net/gaogao060
阅读全文