ITeye博客

PHP

共 11 篇文章

Drupal : Domain Access Failed to Load During Phase: Bootstrap Include

在使用Drupal的模块Domain Access是遇到错误信息:"Domain access failed to load during phase: bootstrap include. Please check your settings.php file and site configuration."。 经查资料才发现是由于需要在文件settings.php中增加下列语句: /** * Add the domain module setup routine. */ include DRUPAL_ROOT . '/sites/all/modules/domain/settings.i…

2011-10-27 17:07 · PHP

Drupal_mail()的使用

在Drupal中,发送邮件,要使用drupal_mail()的,这个函数有点特别,最主要的是,这里用到了钩子_mail()。在Drupal6中,drupal_mail()这个函数作了调整,至少是参数与5时不同了。 我写了一个模块,让用户分享drupal网站中的网址,通过电子邮件,将该地址发送给自己的朋友。当然,一个人怎么能记住自己朋友的电子邮件地址呢,我是记不住。不过确实有这样的功能需求。在drupal中,有对应的模块,比如,sharethis,addtoany,但是这些包含的功能太多,我所需要的仅仅是通过email分享。 那么就需要自己写模块了,这就用到了drupal_mail()。建议大…

2011-10-04 11:34 · PHP

Drupal配置Send mail(drupal发送邮件)

这2天一直在解决drupal发送邮件的问题,最初安装的时候是下载了Drupal的phpmailer和SMTP两个模块来安装,结果总是出现这样或者那样的错误,基本都是提示找不到class文件的Fatal error: Cannot redeclare drupal_mail_wrapper() (previously declared in C:\web\service portal\sites\all\Modules\phpmailer-6.x-2.1\phpmailer\phpmailer.module:56) in C:\web\service portal\sites\all\Modu…

2011-10-04 11:29 · PHP

How to build your own sub-theme (7.x-3.x)

The base Zen theme is designed to be easily extended by its sub-themes. You shouldn't modify any of the CSS or PHP files in the zen/ folder; but instead you should create a sub-theme of zen which is located in a folder outside of the root zen/ folder. The examples below assume zen and your sub-them…

2011-09-23 08:41 · PHP

PHP开源CMS-Drupal做视频站点(第1版)

视频网站在web2.0时代是最常见的互联网类型,国外有Youtobe,BlipTV等,国内有优酷,土豆,酷六,网易等各大门户网站都典型的视频网站。 对于某些门户网站或综合型网站都想在CMS的基础上有自己的视频浏览页面。 问题分析 视频也可以看成一篇文章,只不过内容是视频吧了,类型和CMS差不多,但是问题就在于视频的格式,大小,传输速度等就限制了我们的开发。 在开发过程中要考虑的问题如下: 是否是自己原创的视频,是否需要定制的播放还是借助第三方播放插件。 管理员操纵是否合乎他们的习惯和使用是否简单、快捷。 程序员需要系统的搭建,自己含有服务器、VPS还是虚拟主机。 再确定好系统后,分享文件如何…

2011-09-22 15:01 · PHP

Drupal .htaccess rewrite 规则分析

Drupal 默认通过 apache 的 mod_rewrite 来实现 Clean URLs 功能,大家可以打开根目录下 .htaccess 看到关于 mod_rewrite 的规则,下面我们来分析一下 Drupal 的 rewrite 规则: # Various rewrite rules. <IfModule mod_rewrite.c> RewriteEngine on # If your site can be accessed both with and without the 'www.' prefix, you # can use one of the following s…

2011-09-22 14:59 · PHP

Bluehost 主域名映射到子目录文件夹的方法 .htaccess

在bluehost上购买了空间,如何让一个主域名访问子目录呢,最简单方法是用 .htaccess 来进行限制。 在bluehost 的/public_html 新建立一个 .htaccess 文件,如果没有这个文件的话。 拷贝下面代码放到 .htaccess 文件里 # Bluehost.com # .htaccess main domain to subdirectory redirect # Copy and paste the following code into the .htaccess file # in the public_html folder of your hosti…

2011-09-11 16:15 · 操作系统 · Linux · PHP

getID3() Drupal 6 Installation

Posted by Rob Loach on September 6, 2007 at 5:55pm #D7CX : I pledge that GetID3 will have a full Drupal 7 release on the day that Drupal 7 is released. The getID3() Drupal module facilitates the installation and management of the getID3() PHP library , used to extract useful information from MP3s a…

2011-09-11 15:42 · PHP

PHP上传进度条深度解析

随着互联网的发展,越来越多的技术开始注重用户体验,以人为本才是长久之道,于是在上传的时候,大家都不再满足一个单一的“浏览”按钮,纷纷推出了带上传进度条的功能。而作为解释型语言的PHP,如何做到对上传文件的检测,如何实现上传进度条以其背后的原理,54chen将在本文中一步步展开。 一. 实现篇 一般情况,用PHP实现上传进度条就下面两种方法: 1.APC扩展(作者是PHP的创始人,5.2后PHP已经加入APC扩展) 2.PECL扩展模块 uploadprogress 不论是APC还是uploadprogress,都需要编译源码,因为原有的PHP函数根本不可能读取到临时文件夹里的东西。下面来看如…

2011-09-11 15:36 · PHP

为PHP增加模块的方法,如增加pdo_mysql

默认的PHP安装,只安装了常用默认模块,一些不常用或少用的,就没有默认安上 可通过如下方法增加,如下以增加pdo-mysql为例 wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz tar zxvf PDO_MYSQL-1.0.2.tgz cd PDO_MYSQL-1.0.2 /www/wdlinux/php/bin/phpize ./configure --with-php-config=/www/wdlinux/php/bin/php-config --with-pdo-mysql=/www/wdlinux/mysql make make i…

2011-09-11 15:02 · PHP

Windows XP 环境下安装 PHP 5.2.6.

该章节讲述如何在 Windows XP 环境下安装 PHP。 在安装 PHP 之前,首先确认已经安装 Apache HTTP Server。如何安装 Apache HTTP Server,参见 Apache HTTP Server 安装 。 下载 PHP 5.2.6 PHP 的官方网站是 http://www.php.net/ 。 PHP 的下载页面是 http://www.php.net/downloads.php ,请选择 Windows Binaries 下的 PHP 5.2.6 installer 链接,然后选择一个镜像站点 (比如cn2.php.net) 下载 PHP,你会得到一个…

2011-08-30 20:57 · PHP