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

这里的技术是共享的

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 的头像

wdcp apache php mysql 各种配置文件及启动

3)mysql
mysql配置文件的位置
/www/wdlinux/etc/my.cnf
mysql 重启
/etc/rc.d/init.d/mysqld restart

//apache 重启
service httpd restart
service httpd restart
//nignxd 重启
service nginxd restart

/www/wdlinux/httpd-2.2.22/conf/httpd.conf   这是httpd.conf 文件
/www/wdlinux/httpd-2.2.22/conf/vhost/  各个虚拟机在这个目录里面




普通分类: 
shiping1 的头像

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

shiping1 的头像

Javascript-setInterval setTimeout 判断是否取消 是否已清除

Javascript-setInterval定时触发与取消

setInterval 定时触发

用法:timerID = setInterval(codeStr, milliSeconds);

  • timerID 是 setInterval 的返回值,返回定时器的 ID,当然也可以不要返回值。
  • codeStr 是要执行的代码。
  • milliSeconds 是触发的间隔时间,单位为毫秒。

示例

setInterval("alert('您好!');", 2000); //每 2 秒钟弹出一个对话框。

第一个参数也可以是函数,比如:

setInterval(function () { alert("您好!"); }, 2000); //每 2 秒钟弹出一个对话框。function () 是个匿名函数。

clearInterval 取消定时器

用法:clearInterval(timerID);

普通分类: 
shiping1 的头像

Red5 学习

Red5 学习

Red5的初次安装与配置

http://yaofeng911.iteye.com/blog/1059851  (测试可用)

Red5 plugin for Eclipse V0.2的安装及配置

http://xlh1221it.blog.163.com/blog/static/129587224201032871841814/

Red5的官方网站(下载)

普通分类: 
shiping1 的头像

花生壳的作用 只要花生壳启动 通过firefox就可以知道我的ip地址

普通分类: 
shiping1 的头像

SecurePages Secure Pages 的使用方法

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

settimeout cleartimeout

//循环执行
function loopTabulli(currI,size)
{
        
         $('.tabul li').eq(currI).addClass('highlight');
         $('.tabul li').eq(currI).siblings('li').removeClass('highlight');
         var currId = currI+1;
         $('#showcontent'+currId).css('display','block');
        $('#showcontent'+currId).siblings('.showcontent').css('display','none');
        
        
        currI =currI+1;
        if(currI>=size){
            currI = 0;
        }
普通分类: 
shiping1 的头像

滚动效果

//就业去向滚动    
$(document).ready(function(){
    
    if(document.getElementById('marquePic22')!=null)
    {
        var marquePic22=document.getElementById('marquePic22');
        var marquePic21=document.getElementById('marquePic21');
        var demo2=document.getElementById('demo2');
        var speed2=30;
        marquePic22.innerHTML=marquePic21.innerHTML;
        function Marquee2(){
         if(demo2.scrollTop>=marquePic21.scrollHeight){//demo向上滚动的距离,, 如果大于marquePic1的高度
             demo2.scrollTop=0;
普通分类: 
shiping1 的头像

jQuery DOM 元素方法 - size() 方法 元素的个数大小长度

jQuery DOM 元素方法 - size() 方法

实例

输出被 jQuery 选择器匹配的元素的数量:

$("button").click(function(){
  alert($("li").size());
});

亲自试一试

定义和用法

size() 方法返回被 jQuery 选择器匹配的元素的数量。

普通分类: 
shiping1 的头像

Apache 配置HTTPS协议搭载SSL配置 平忠自己亲自做的方法有大用

1)可能443端口有冲突,不能改成其它端口,(比如改成447就不行)
1)不需要按下面做成生成
server.crt
server.csr
server.key 这三个文件因为 xampp本来就有,如果是生成的 还有可能有问题
2)在 httpd.conf 中
找到下列行
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
去掉前面的#
3)在 httpd_ssl.conf 中 相应的地方 应改成如下
<VirtualHost _default_:443>
    #   General setup for the virtual host
    DocumentRoot "D:/xampputf8/htdocs/wangruoban"
    ServerName my.wangruoban.com:447
普通分类: 
shiping1 的头像

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

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

普通分类: 
shiping1 的头像

drupal 网银模块

shiping1 的头像

red5 服务器上要禁用的端口 443 5080 还有其它端口看看

普通分类: 
shiping1 的头像

red5 的安全 考虑 google red5 安全

普通分类: 
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 的头像

Red5流媒体服务基于域的安全策略

[原创]Red5流媒体服务基于域的安全策略

公司出于业务扩展的考虑,准备把原先基于FMS为后台的程序,改为用开源的Red5作为视频音频服务,而由Socket作为数据交换服务。
公司服务端的人忙着处理其他事情,于是公司安排我做Red5的架设工作。在网上找了些资料,Red5配置起来还是比较简单的。网上的教程有一堆,这里就不累述了。
因为flash客户端用NetConnection连接Red5的时候,是不需要像连接socket或者是http那样要提交一个<request-policy-file/>的请求去请求一个crossdomain的字符串。
而视频,音频服务在我们整个服务中所占的IO是最大的。如果Red5服务没有做任何连接的验证,其他人通过反编我们的swf文件,得到我们的red5服务的地址后,就很容易让其他人来使用我们的服务器。
对于这种问题,通常可以使用连接Red5时,要求客户端提交一个由服务端生成的密钥来做验证,但是这样就涉及到Red5和Socket直接的通信问题(或者是通过查询临时表等方法),无疑会给本来已经事情很多的服务端的同事们增加麻烦。
于是我采取通过检测flash客户端的swf文件URL这种基于域的检测方式。
普通分类: 
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 的头像

red5 安装ofmaDemo 然后要从网站复制过去的注意事项

1)apache的conf文件中要加入ofmaDemo/stream为当前文件夹 才能复制过去
2)ofmaDemo/stream文件夹的权限要为777
普通分类: 
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 的头像

php 数组 array

PHP如何获取数组的键与值

服务器君一共花费了16.553 ms进行了6次数据库查询,努力地为您提供了提供了这个页面。
 

使用数组的过程中经常要遍历数组。通常需要遍历数组并获得各个键或值(或者同时获得键和值),所以毫不奇怪,PHP为此提供了一些函数来满足需求。许多函数能完成两项任务,不仅能获取当前指针位置的键或值,还能将指针移向下一个适当的位置。

获取当前数组键 key()

key()函数返回input_array中当前指针所在位置的键。其形式如下:

普通分类: 
shiping1 的头像

jquery设置元素的readonly和disabled

jquery设置元素的readonly和disabled

Jquery的api中提供了对元素应用disabled和readonly属性的方法,在这里记录下。如下:
 1.readonly
    $('input').attr("readonly","readonly")//将input元素设置为readonly
    $('input').removeAttr("readonly");//去除input元素的readonly属性
  
    if($('input').attr("readonly")==true)//判断input元素是否已经设置了readonly属性

 

普通分类: 
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 个人技术网_前端_后台_php_div_css_linux_javascript_seo RSS