欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

drupal

shiping1 的头像

drupal垃圾评论处理 mollom 这个模块 比较有大用

drupal垃圾评论处理

普通分类: 
shiping1 的头像

drupal Fatal error: Out of memory

drupal Fatal error: Out of memory
我禁用了theme devel 模块 好像就好了 然后 清空缓存 运行cron
再把theme devel启用后 把themer 产生的临时文件删掉 好像还不行
把theme devel 禁用吧 
(我遇到的情况好像是cacherouter 有问题 把它禁用 ,同时在setting.php中去掉关于它的设置)



Fatal error: Out of memory (allocated 298582016) (tried to allocate 79874193 bytes) in /home/wwwroot/yc_4000512126_com/public_html/includes/database.mysql.inc on line 330
普通分类: 
shiping1 的头像

Terms of Use

Terms of Use

模块地址: http://drupal.org/project/terms_of_use
模块版本: Drupal 7.xDrupal 6.x
用户数: 6 371
依赖:
普通分类: 
shiping1 的头像

drupal7 主题 学习





普通分类: 
shiping1 的头像

防恶意注册的模块

Honeypot 防恶意注册

普通分类: 
shiping1 的头像

登录安全 my.wangruoban.com/admin/settings/login_security

进 admin/settings/login_security 里进行设置
http://drupalcode.org/project/login_security.git/blob/refs/heads/6.x-1.x:/README.txt
是帮助文档
普通分类: 
shiping1 的头像

drupal 批量上传

1) 在 https://drupal.org/project/advupload
上面下载 advupload-6.x-2.6.zip
进行安装 advupload 这个模块
普通分类: 
shiping1 的头像

node 表 sticky (置顶) 的文章 sticky是置顶的意思

普通分类: 
shiping1 的头像

$term = taxonomy_get_term($tid); 根据分类tid得到分类对象 根据分类id得到分类名字

普通分类: 
shiping1 的头像

taxonomy term 下的节点排序 自己处理下 在taxonomy.pages.inc 约45行加上排序字段 明天做理 移到服务器上

普通分类: 
shiping1 的头像

发现 对未注册用户 访问内容 的权限 居然看不到内容

最后查到  node.module 2703行左右
从数据库表 node_access 中看 好像没有值  不知道是什么原因 搞丢失了
哎 原理最重要啊 掌握原理一步步排查
普通分类: 
shiping1 的头像

drupal第三方缓存模块 cacherouter

drupal第三方缓存模块 不指定

drupal水滴 , 2012/03/05 11:59 , drupal建站 » drupal模块 ,
普通分类: 
shiping1 的头像

为什么有的字段权限查盾 要 管理节点 这个权限打开

普通分类: 
shiping1 的头像

创建Drupal Rules模块的自定义动作 如果有问题 把rules进行删除(动作或条件删除) 再进行 添加

创建Drupal Rules模块的自定义动作 如果有问题 把rules进行删除(动作或条件删除) 再进行 添加
或者把这整个规则 全删掉  再创建它

切记 这是实践得出来的结论
普通分类: 
shiping1 的头像

创建Drupal Rules模块的自定义动作 rule rules 自定义规则 有大用

具体的例子可以看rules模块里面的代码
创建Drupal Rules模块的自定义动作

普通分类: 
shiping1 的头像

根本原因是 中文路径失效 其实根本原因 是apache的中文路径失效 是由于安装了中文模块

解决问题的根本办法就是 在模块里加上下面的代码
function shipingzhongcustom_init()
{
    $_GET['q'] = mb_convert_encoding($_GET['q'],'UTF-8','GBK');
}





drupal 自动补全  autocomplete 失效 下面的方法当然可以解决 但不是根本的方法,只能解决这一个问题,不能解决所有的中文路径失效的问题
1)经查是在 userreference.module 里面
约 16 行左右 
function userreference_menu() {
  $items = array();
  $items['userreference/autocomplete'] = array(
    'title' => 'Userreference autocomplete',
普通分类: 
shiping1 的头像

drupal warning: Invalid argument supplied for foreach() in /home/wwwroot/yc_4000512126_com/public_html/includes/theme.inc on line 485.

    warning: Invalid argument supplied for foreach() in /home/wwwroot/yc_4000512126_com/public_html/includes/theme.inc on line 485.
    warning: Invalid argument supplied for foreach() in /home/wwwroot/yc_4000512126_com/public_html/includes/theme.inc on line 490.
    warning: Invalid argument supplied for foreach() in /home/wwwroot/yc_4000512126_com/public_html/includes/theme.inc on line 485.
    warning: Invalid argument supplied for foreach() in /home/wwwroot/yc_4000512126_com/public_html/includes/theme.inc on line 490.
普通分类: 
shiping1 的头像

当某个模块(比如drush 安装l10n_update )出现问题的时候 重装一下它 l10n_update

普通分类: 
shiping1 的头像

drupal MySQL server has gone away cron 失败 Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 39947189 bytes) in database.mysql.inc on line 119 有大用

1)我自己遇到的实际情况 是sessions表有问题 ,删掉 重新导一个空的好表就可以了
如何知道sessions有问题呢?
开启devel模块的在最下面显示sql执行语句的功能
看看哪个表执行的时间太长了,超过几千秒
肯定它有问题
(我发现了是sessions表有个insert语句 2千多秒)此时删掉
这个表 重建一个空的好表就可以了,以前也遇到其它出现问题的情况,也是
同样的方法解决的

2)我自己遇到第二个情况 Warning: MySQL server has gone away query: INSERT INTO watchdog
同时发现红色警告 Warning: MySQL server has gone away query: INSERT INTO cache_l10n_update

普通分类: 
shiping1 的头像

直接控制用户权限 不有角色

shiping1 的头像

SecurePages Secure Pages 的使用方法

可以看这个模块的readme.txt文件
1) 当然是启用这个模块
2)admin/build/securepages 里进行设置
3) 最好还要安装 securepages_prevent_hijack 模块,它是为了保护securepages模块 (在drupal6要安装它
drupal7中就不要安装它了)
普通分类: 
shiping1 的头像

Drupal Secure Pages模块介绍,让你的drupal站支持SSL

Drupal Secure Pages模块介绍,让你的drupal站支持SSL

普通分类: 
shiping1 的头像

drupal 网银模块

shiping1 的头像

drupal 的 cookie中 has_js 的意思 得到 cookie 有大用

/**
 * Initiate the batch processing
 */
function _batch_start() {
  // Choose between the JS and non-JS version.
  // JS-enabled users are identified through the 'has_js' cookie set in drupal.js.
  // If the user did not visit any JS enabled page during his browser session,
  // he gets the non-JS version...
  if (isset($_COOKIE['has_js']) && $_COOKIE['has_js']) {
    return _batch_progress_page_js();
  }
  else {
    return _batch_progress_page_nojs();
  }
}

普通分类: 
shiping1 的头像

根据分类得到节点

从 taxonomy 模块里面找 
12行左右function taxonomy_term_page($
46行左右$output = theme('taxonomy_term_page', $tids, taxonomy_select_nodes($tids, $terms['operator'], $depth, TRUE));

function taxonomy_select_nodes($tids = array(), 
普通分类: 
shiping1 的头像

获取用户点击量

在后台开了浏览统计,在node.tpl.php里面,怎么取到点击量?


drupal默认提供访问数统计功能,使用步骤

1、后台,启动statistics模块
2、后台,配置->系统->统计 启动浏览统计 (admin/reports/settings 至少drupal6中是如此的)
3、后台,用户权限,赋予用户组“查看内容点击数”权限
4、在note.tpl.php里:

<?php print render($content['links']); ?>
或者
<?php print $content['links']['statistics']['#links']['statistics_counter']['title']?>


来自drupalchina群分享

来自 http://www.majormoves.net/post/1982/
普通分类: 
shiping1 的头像

drupal node 节点 点击量 排序 有大用 有大大用

drupal节点按点击量排序


SELECT DISTINCT(n.nid), n.sticky, n.title, n.created, nm.totalcount FROM node n INNER JOIN term_node tn ON n.vid = tn.vid LEFT JOIN node_counter nm ON n.nid=nm.nid WHERE n.status = 1 ORDER BY n.created DESC ,nm.totalcount DESC

来自 http://hi.baidu.com/097633/item/00c9cec568d73946a8ba9454  

普通分类: 
shiping1 的头像

ubercart 已经在购物车里的商品,现在添加商品包到购物车里 而购物车里的商品 已存在于商品包中

就是我已经 添加A商品在 购物车里

现在又准 备 添加一个商品包 在 购物里 
但是这个商品包 包含A商品
我想让提交不过去 
有这个模块 实现这种功能吗

我看了一通过去 只有一个解决办法 但是我没有去实验 我觉得应该可行 
http://drupal.stackexchange.com/questions/51123/ubercart-php-message-if-a-product-is-in-cart
普通分类: 
shiping1 的头像

drupal ubercart Sku auto general 自动产生 编号 的模块

1)https://drupal.org/project/uc_product_power_tools
用法

Usage

Once installed, settings are available by product class at the url: admin/store/products/power-tools

As of version 1.10 the default product node type is supported.

Power tools settings are configured for each class by clicking the edit action next to the associated product class, and can be enabled or disabled for each class as well.

普通分类: 
shiping1 的头像

我所使用的字段的禁用

//假如是处理时 并且此人没有禁用关闭状态的权限时  也禁用转交
    if($node->field_zhuanjian_chuli[0]['value']==1 && !user_access('处理 关闭事件')){
           drupal_add_js('$("#edit-field-zhuanjian-chuli-0").attr("disabled","disabled");', 'inline', 'footer');
           //drupal_add_js('$("#edit-field-zhuanjian-chuli-0").attr("readonly","readonly");', 'inline', 'footer');
    }
普通分类: 

页面

Subscribe to RSS - drupal