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

这里的技术是共享的

You are here

drupal

shiping1 的头像

ubercart 加入购物车不跳转

Store Administration >> Configuration >> Cart Settings

and set:

Add to cart redirect: to <none>

I don't know about the AJAX but this works pretty well.

Rich

来自 http://www.ubercart.org/forum/support/527/how_do_you_make_add_cart_button_not_redirect_checkout_just...

普通分类: 
shiping1 的头像

node_save后 得到保存的nid (得到保存的node对象)

<?php
$node
= new stdClass();
$node->title = 'Whatever';
// ...
普通分类: 
shiping1 的头像

page.tpl.php中的变量是hook_preprocess_page中的$var 的 class_array键

普通分类: 
shiping1 的头像

ubercart 的购物车本来是checkbox来删除的 现在用button删除

shiping1 的头像

ubercart 只能购买的数量只能为1 的模块 限制购买数量 Ubercart Restrict Qty

shiping1 的头像

ubercart 设置货币符号 美元符号 改成 人民币符号

admin/store/settings/store/edit/format 
普通分类: 
shiping1 的头像

drupal 学习资料

shiping1 的头像

drupal ubercart网店设置路径

drupal ubercart网店设置路径
admin/store/settings/store/edit
admin/store/settings/store/edit/format
普通分类: 
shiping1 的头像

修复Drupal的cache表

今天Drupal遇到了cache表崩溃问题,错误信息如下:

user warning: Table './tilt_db/cache' is marked as crashed and should be repaired query

这个问题似乎很多人都遇到了,参见 http://drupal.org/node/73297
解决方法也比较简单,参见"Repairing a MySQL Database with phpMyAdmin"

详细步骤如下:

普通分类: 
shiping1 的头像

theme_links theme_item_list l 函数

普通分类: 
shiping1 的头像

drupal 覆写 区块 内容

区块覆写 其实还是用 devel themer看到的函数 对函数进行覆写比较方便
drupal 覆写 区块 内容  使用预处理函数

function shipingzhong_preprocess_block(&$vars, $hook) {
    //dpr($vars);
     
    dpr($vars['block']->bid);//这里是各个区块不同的
    dpr($vars['block_id']);//这里是各个区块 有可能相同
   dpr($vars['block_html_id']);//这里是各个区块不同的

  根据不同的区块 进行不同的覆写 这里用得到
}
普通分类: 
shiping1 的头像

drupal6 hook form validate 验证的几种方法 有大用 有大大用 有大大大用

1)hook_validate
2)hook_nodeapi时验证
2)下面的方法是比较好的


function mymodule_form_alter(&$form, &$form_state, $form_id) {
	switch($form_id) {
		case 'artist_node_form':
			$form['#after_build'][] = 'mymodule_custom_after_build';
			break;
	}
}

function mymodule_custom_after_build($form, &$form_state) {
	$form['#validate'][] = 'mymodule_custom_validation';					
	
	return($form);
}

function mymodule_custom_validation($form, &$form_state) {
	//My custom validations went here.
}



普通分类: 
shiping1 的头像

处理节点表单提交之后的页面跳转

处理节点表单提交之后的页面跳转

  在普通情况下,当用户提交节点表单后会被重定向到对应的节点页面,如果在 URL 中传入了 ?destination=path/xxx 这样的参数,提交表单后用户就会被重定向到 destination 设置的页面。

  除此之外,开发人员还可以通过为节点表单设置重定向属性,来控制表单提交后的重定向路径。

  下面的代码通过应用 hook_form_alter(),判断当表单ID为"story_node_form"时,设置表单的重定向属性(#redirect

普通分类: 
shiping1 的头像

WYSIWYG 字段 禁用富文本编辑器

下面的方法 应该是好的
<?php
function my_module_form_alter($form_id, &$form) {
普通分类: 
shiping1 的头像

清理处理垃圾节点和评论模块

1)本来后台 就可 内容管理 和垃圾管理功能
2)有第三方模块 Antispam,Mollom,Spam可以自动对垃圾文件进行判断,
Mollom 与 CAPCHA 验证码模块一起使用,可以防止机器人登录
普通分类: 
shiping1 的头像

通过PEAR安装Drupal命令行工具Drush

通过PEAR安装Drupal命令行工具Drush

Drupal命令行工具Drush

普通分类: 
shiping1 的头像

Windows linux 上面安装Drush

shiping1 的头像

Drush 原理与应用





普通分类: 
shiping1 的头像

安装DRUSH 遇到的问题以及解决办法

安装DRUSH 遇到的问题以及解决办法

今天在本机安装drush-6.x-3.3,遇到了一些问题,还好搜出了解决方法。

本机 Ubuntu 10.04

下载安装drush-6.x-3.3

普通分类: 
shiping1 的头像

drush 下载的地方

shiping1 的头像

drupal 自定义的方法 一般放在模块的module文件里 不要放在主题的template.php

普通分类: 
shiping1 的头像

牵移到服务器 后要注意的事项

1)要到数据库里修改一下网站的名称 ....当然这里在数据库db中修改的
2)清空缓存 同时cron
2)admin/build/themes 最下面保存下配置 (最下面提交一下)
   admin/build/themes/settings/lanyulu 下面提交一下


牵移到服务器上 哎 不知道怎么搞的 用lanyulu子主题不行 但是用shipingzhong子主题却是好的(难道是lanyulu的子主题不行里面的info,template.php文件还是其它文件有问题 )(它们都是zen的子主题)
普通分类: 
shiping1 的头像

备份和迁移网站

备份和迁移网站

普通分类: 
shiping1 的头像

如果主题不起作用 清空注册表缓存

如果主题不起作用 清空注册表缓存
普通分类: 
shiping1 的头像

drupal 得到当前模板

global $theme;
echo $theme;
普通分类: 
shiping1 的头像

为什么filefieldpath 这个模块禁用之后 也可以设置子路径 用了它之后 设置的子路径却不起作用

普通分类: 
shiping1 的头像

jwplayer module 的使用方法 jw player

jmplayermodule的使用方法
1)当然是开启模块
2)把下载的jwplayer 播放器压缩包中的 player.swf 和 yt.swf
复制到 jwplayermodule 目录下
(从同目录下的   "Drupal 视频播放功能   Lugir.htm"可以下载)
2)另建一个文本字段
内容是 [jwplayer|config=myplayer|file=test_video|image=test_image]
(myplayer是admin/settings/jwplayermodule 产生的名字 一般我们用sample)
test_video 是视频文件名
test_image 是视频播放前的显示的图像
见同目录下的
(Embed the JW Player Using The Drupal Module   LongTail Video   Home of the JW Player.htm)
里的配置
3)在模板文件中放 <div id="jwplayer-1" class='jwplayer'></div>
普通分类: 
shiping1 的头像

drupal主题化常用函数集锦

drupal主题化常用函数集锦

所在分类: php   Tags:主题化 函数

 

普通分类: 
shiping1 的头像

在Windows安装PECL uploadprogress 自己亲自做的有大用

到这里http://pecl.php.net/package/uploadprogress

http://downloads.php.net/pierre/ 下载 php_uploadprogress.dll

但是我试了都不行

我的xampp是1.7.3好像没有自带
PECL uploadprogress,好像自带了 apc

即 php_apc.dll

普通分类: 
shiping1 的头像

jwplayer (jw player)模块使用方法 有大用

可能开发模块对它有冲突 配置这个模块的时候 最好把开发模块禁用 devel theme 模块禁用 应该是与 模块 emfield冲突



1)当然是安装它  及依赖模块 emfield
1) 到后台 Administer > Site Configuration > JW Player setup (admin/settings/jwplayermodule) 设置缩略图的 宽度 高度等配置
2)到后台 Administer > Site Configuration > JW Player setup > Upgrade.  Click "Instal Latest JW Player"
3)到某个节点中上传视频
4)在另一字段 比如(body或者自定义的字段中)
普通分类: 

页面

Subscribe to RSS - drupal