CentOS6.2安裝LAMP+DRUPAL網站(2)

2安裝drupal 

前提:已經安裝好mysql、php、apache2.

2.1安裝pdo_mysql

到原始安裝包目錄:

cd /usr/local/src/php-5.4.0/ext/pdo_mysql/

執行:

/usr/local/php/bin/phpize

(如果出現報錯:

Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable is set correctly and then rerun this script.

安裝這2個軟件就可以了

# cd /usr/src

# wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz

# tar -zvxf m4-1.4.9.tar.gz

# cd m4-1.4.9/

# ./configure && make && make install

# cd ../

# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz

# tar -zvxf autoconf-2.62.tar.gz

# cd autoconf-2.62/

# ./configure && make && make install)

./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql

make && make install

vi /usr/local/php/lib/php.ini,增加一行:

extension=/usr/local/php/lib/php/extensions/no-debug-zts-20100525/pdo_mysql.so

 

重啓apache2:

/etc/rc.d/init.d/httpd2 restart

爲防止httpd2還未停止就執行,加上一句sleep,另外爲分行看的清楚,將echo –n改爲echo -e。

 

在客戶端IE輸入:http://aaa.bbb.ccc.ddd/test.php,可以看到PDO支持mysql了。

 

2.2安裝drupal前準備

源文件:

drupal-7.21.tar.gz

drupal-7.21.zh-hans.po(copy到/profiles/standard/translations/以提供中文支持)

cp drupal-7.21.zh-hans.po /usr/local/apache2/htdocs/profiles/standard/translations/

(語言包版本要和安裝程序版本完全一致)

imce-7.x-1.6.tar.gz

//ckeditor-7.x-1.12.tar.gz

 

安裝:

drupal-7.21.tar.gz

tar -zxvf drupal-7.21.tar.gz

cd drupal-7.21

mv * /usr/local/apache2/htdocs/

mv .htaccess /usr/local/apache2/htdocs

(不能忘記.htaccess文件,否則會出現似乎沒有裝完的問題)

cd /usr/local/apache2/htdocs/sites/default/

cp default.settings.php settings.php

mkdir files

chmod 777 files/

chmod 777 settings.php

(準備安裝寫入)

創建數據庫:

/usr/local/mysql/bin/mysql -u root –p

(PW:幸運2013!)

mysql> create database paidb;

mysql> grant select,insert,update,delete,create,drop,index,alter

       on paidb.*

to youth@localhost identified by 'Itis3.14159';

 

查看對InnoDB的支持:show engines;

//刪除名字特別的數據庫,數據庫名用反引號括起:mysql> drop database `database`;

 

2.3core安裝

http://aaa.bbb.ccc.ddd/install.php

 

第一次安裝會出現進度條,進度條執行完畢,會退出,但並不是執行完畢了,需要重新http://aaa.bbb.ccc.ddd/install.php

(站點數據庫賬號dradmin/我58,站點維護賬號mathsea/幸運2013!)

再次執行。看到這個頁面纔是真正執行完畢了。(否則沒有安裝翻譯,或者沒有設置主頁,只有提示Drupal already installed纔是裝完了,否則還可以繼續http://aaa.bbb.ccc.ddd/install.php安裝)

 

安裝完成後,取消寫權限:

chmod go-w sites/default

chmod go-w sites/default/settings.php

(mathsea,我58)

如果還有很多英文沒有翻譯,admin/config/regional/translate/import,導入語言po文件:

 

 

Error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drdb.languages' doesn't exist

 

Solution:

登錄mysql,刪除drdb,重新創建drdb,再次執行:

mysql> grant select,insert,update,delete,create,drop,index,alter

       on drdb.*

to dradmin@localhost identified by 'Pa888888';

重新訪問http://aaa.bbb.ccc.ddd/drupal/install.php,執行OK。

原因:不明。

Error:當出現login卻出現404報錯的時候,修改httpd.conf,將

AllowOverride None改成AllowOverride All時OK。

 

2.4clean URL

簡潔鏈接,以類似 example.com/user 的鏈接地址替換類似 example.com/?q=user 的使用。使用默認鏈接方式(帶?號),url短小,但不利於搜索引擎對自己網站的爬網;使用簡潔鏈接,則目錄層次多,有利於搜索引擎對自己網站的爬網。

設置步驟:

1.編輯apache的conf文件,找到LoadModule rewrite_module modules/mod_rewrite.so,將前面的#號去掉;找到AllowOverride none,改爲AllowOverride All。(兩個地方都需要改掉)

<Directory "/">    

Options All(followsymlinks?)

AllowOverride All

</Directory>

2.

 

 

 

3.在drupal的根目錄,編輯.htaccess文件,將RewriteBase前面的#去掉,後面寫上drupal在網站的目錄,如果是在網站根目錄,則爲

RewriteBase /

如果是drupal目錄,則爲

RewriteBase /drupal

(要支持url rewrite即啓用簡易鏈接,需要允許.htaccess文件起作用,本處設置要爲:allowoverride all, options followsymlinks,不要options index,以免列出web結構給用戶看到)

默認主頁由index.html改爲index.php

在網站控制檯,admin/config/search/clean-urls,勾選啓用。(安裝OK之後)

 

2.5文件系統設置

OS:

mkdir /mathfiles

chmod 766 /mathfiles/

//應該不是必須的。

chown daemon:daemon /mathfiles/

//將此目錄owner改爲httpd的運行賬號,默認是daemon,

web admin:

admin/config/media/file-system

 

//填寫私有文件系統目錄,默認下載方式仍保持公共不變,只有將來定製的收費文件下載,才指定爲私有文件。

 

chown root:root /usr/local/apache2/htdocs/sites/all/modules -R

2.6安裝drupal wysiwyg模塊(所見即所得)

n源程序:wysiwyg-7.x-2.2.tar.gz

解壓後放到…/sites/all/modules/,在配置頁面modules中設置勾選。

n設置plain text

Conf:admin/config/content/formats/plain_text,

 

 

 

n設置Filtered HTML

admin/config/content/formats/filtered_html,

設置換行在此格式下生效:

 

在允許的HTML標籤中增加<br>

<img>,支持分行與圖片引用

 

 

n安裝editor

第一次安裝editor要手工創建libraries目錄,

/usr/local/apache2/htdocs/sites/all

mkdir libraries

 

選擇安裝tinymce,其它的根據需要安裝,

https://github.com/tinymce/tinymce/downloads

tinymce_3.5.8.zip解壓後的整個目錄,上傳到/usr/local/apache2/htdocs/sites/all/libraries,

nadmin/config/content/wysiwyg

選擇tinymce,然後依次設置,

BASIC SETUP: 選擇中文,

?默認情況下,如果選擇中文,會導致button不能出現,只有英文纔可以。解決辦法:

從http://www.tinymce.com/i18n/index.php?ctrl=lang&act=index&pr_id=7下載簡體中文語言包,按目錄覆蓋到tinymce對應文件夾。

在drupal安裝根目錄/include/iso.inc 下找到 zh-hans --> 改為 zh-cn,就可以了!問題的原因有兩個:一個是缺少中文語言包,一個是drupal中將簡體中文以zh-hans代表,而語言包中時以zh-cn代表,兩者不匹配!將drupal的設置改下就好了!

 

BUTTONS AND PLUGINS:

Bold,italic,underline,align left/center/right,bullet list,numbered list,link,unlink,image,font,font size,forecolor,backcolor,blockquote,cut,copy,paste,character map,adv image,table,word count

 

其它editor的安裝參考:

(ckedit需要下載module和libraries兩個文件,但與wysiwyg衝突,故不選擇)

 

登錄頁面首頁 ? 管理 ? 配置 ? 內容寫作Wysiwyg profiles,下載需要的編輯器,解壓放到:

/usr/local/apache2/htdocs/sites/all/libraries

先要mkdir /usr/local/apache2/htdocs/sites/all/libraries

l在首頁 ? 管理 ? 配置 ? 內容寫作Wysiwyg profiles》INSTALLATION INSTRUCTIONS,可以下載具體的編輯器。(一般安裝3個足夠了:jwysiwyg,fckeditor,tinymce)

ljwysiwyg-0.6.zip

解壓後只將\jwysiwyg的子目錄copy到usr/local/apache2/htdocs/sites/all/libraries,啓用即可。

lfckeditor

http://sourceforge.net/projects/fckeditor/files/FCKeditor/

FCKeditor_2.6.9.tar.gz

解壓後copy到usr/local/apache2/htdocs/sites/all/libraries

在首頁 ? 管理 ? 配置 ? 內容寫作Wysiwyg profiles編輯啓用。

 

 

 

n安裝動態表情

http://drupal.org/project/smiley

smiley-7.x-1.0-beta2.tar

 

nadmin/modules,啓用它

nadmin/config/content/formats/filtered_html,勾選並移動位置"Smileys filter" 放到 "Limit allowed HTML tags"下面。

 

nadmin/config/content/formats/full_html,admin/config/content/formats/plain_text都勾選。

nadmin/config/content/wysiwyg/profile/full_html/edit

在editor配置中啓用動態表情。

 

 

下載新的表情:

http://www.en.kolobok.us/download.php?view.1

如:kolobok_full_archive.rar,

解壓後將aiwan/artists/user目錄放到sites/all/modules/smiley/packs,導入admin/config/content/smiley/import,

 

按需選擇。

 

/*

insert

insert-7.x-1.2.tar.gz

安裝此module,與imce集成,可以隨意插入圖片。

*/

2.7imce

imce-7.x-1.6.tar.gz

imce_wysiwyg-7.x-1.0.tar.gz

解壓後放到modules目錄,在管理臺enable即可。

nadmin/config/content/wysiwyg/profile/filtered_html/edit,將 imce啓用。

 

nadmin/config/media/imce,

管理員user-1,註冊用戶sample profile,Disable serving of private files勾選。

nadmin/structure/types/manage/article/fields/field_image, 可進行更多設置,如

upload時能夠上傳的圖片數量。

//啓用 blog、book、forum模塊。

 

2.8安裝libraries api/transliteration

下載libraries api module:http://drupal.org/project/libraries

libraries-7.x-2.0.tar.gz,enable。

transliteration:transliteration-7.x-3.1.tar

 

nadmin/config/media/imce/profile/edit/2

編輯Sample profile,目錄quota改爲20M,文件擴展名增加pdf

 

 

 

2.9用戶相關簡單模塊

 

navatar_selection   http://drupal.org/project/avatar_selection     avatar_selection-7.x-1.0.tar

exact to module,enable

set permission:

 

imagecache_profiles    http://drupal.org/project/imagecache_profiles  imagecache_profiles-7.x-1.0.tar

admin/config/people/avatar_selection/upload

必須通過頁面上傳,必須是同樣大小的png文件。

 

nimagefield_crop    http://drupal.org/project/imagefield_crop imagefield_crop-7.x-1.1.tar

處理用戶上傳頭像

 

n用戶字段增加:

頭像:admin/config/people/accounts/fields, 添加新字段:用戶頭像, field_user_face, image, Image with cropping.

繼續設置:用戶頭像,不是必填,在用戶註冊表單中顯示。請上傳您的頭像文件。

Warning: Illegal string offset 'x' in _imagefield_crop_widget_enforce_ratio_validate()…

改爲使用imagefield_crop-7.x-2.0.tar,將此模塊取消,將模塊文件刪除,替換新模塊文件,再enable,會引發數據庫更新,跟着指引做即可。

admin/config/people/accounts/fields/field_user_face設置:

The resolution to crop the image onto:90*90, 其它默認,準備好一個默認頭像。

重要設置:

admin/config/people/accounts,頭像目錄:sites/default/files,樣式全部選擇thumbnail。

admin/config/people/accounts/fields/field_user_face,文件目錄:[current-user:uid],以便不同用戶不同文件夾。本處的文件目錄上上面頭像目錄的子目錄。

admin/config/people/user_picture_field,用戶,field_user_face。(這是給用戶增加的image字段的machine name)

 

取消Avatar Selection模塊。(因爲有上傳頭像和默認頭像設置就夠了)

 

nRealname模塊

realname-7.x-1.1.tar

解釋:realname字段是用戶實際字段的視圖,它會在所有體現用戶名字的地方出現,默認是與Raw name即賬號一樣,但賬號展現出來不合適,因此要另外增加一個暱稱,讓暱稱與realname對應上。

admin/config/people/accounts/fields,

添加新字段:暱稱, nickname, 文本, 文字字段。

必填。

 

admin/config/people/realname,

在 realname pattern,刪除[user:name-raw],增加[user:field-nicknme]。

 

 

 

 

 

 

 

ban_user http://drupal.org/project/ban_user   ban_user-7.x-1.0.tar

login_destination  http://drupal.org/project/login_destination    login_destination-7.x-1.1.tar

terms_of_use  http://drupal.org/project/terms_of_use    terms_of_use-7.x-1.2.tar

user_picture_field http://drupal.org/project/user_picture_field   user_picture_field-7.x-1.0-rc1.tar

username_check     http://drupal.org/project/username_check  username_check-7.x-1.x-dev.tar

flood_control http://drupal.org/project/flood_control   flood_control-7.x-1.0.tar

 

2.10數學公式

 

數學置標語言(Mathematical Markup Language,MathML)

mathjax  http://drupal.org/project/mathjax    mathjax-7.x-1.0-beta3.tar

extract to module,

Download MathJax 1.1 source from MathJax website (e.g. https://github.com/mathjax/MathJax/zipball/v1.1a)

mathjax-MathJax-24a378e.zip

Unarchive it into your "libraries" directory (e.g. sites/all/libraries).

Rename it to "mathjax" (lower case).

 

Enable the MathJax module under Administration >> Modules.

Disable the "Use MathJax CDN" checkbox in Administration >> Configuration >> MathJax (in the Content Authoring section, admin/config/content/mathjax)

 

Test it by adding a LaTeX formula between '$' in any node body :

$\Large f=b_o+\frac{a_1}{b_1+\frac{a_2}{b_2+\frac{a_3}{b_3+a_4}}}$

或者使用

\(  \)

 \[  \]

行內、行間,\是反斜杆。

 

2.11評價模塊

rate-7.x-1.6.tar + votingapi-7.x-2.10.tar

配置要點:

admin/structure/rate 增加widget,如選擇fivestar:

標題:五星評級,機讀名字fivestar

Tag:Vote

Value Type : Percentage

Translate options: SELECTED

Node Types: 手冊頁、文章

展示設置:above the content,display in teaser SELECTED,Appearance in full node:FULL widget,Appearance in teaser:display only,compact,評論顯示:Do not add automatically,描述:留空

Interaction:average,average,是。

權限:認證用戶,不允許評價自己,Redirect to login and show message

Use source translation:不能勾選。

Rate模塊權限設置:View rate results page全都允許。

評論框不要標題:

admin/structure/types,選擇內容類型,edit, 評論設置,取消“允許評論標題“。

還存在評論顯示重複和“新建“兩字的問題。

 

 

 

 

2.12定時備份mysql和drupal主頁內容到u盤

 

創建mysql備份專用賬號:()

/usr/local/mysql/bin/mysql -u root -p

mysql> grant select on *.* to 'bkuser'@localhost identified by 'pAssw0rd';

映射備份目錄到u盤:

mount -t vfat /dev/sdb1 /mnt/usb

編輯備份腳本:

vi /usr/sbin/mywebbak

mount -t vfat /dev/sdb1 /mnt/usb

find /mnt/usb -name "mysqldb*" -type f -mtime +7 -exec rm {} \;

find /mnt/usb -name "drupal*" -type f -mtime +7 -exec rm {} \;

rq=`date +%Y%m%d`

tar zcvf /mnt/usb/htdocs$rq.tar.gz /usr/local/apache2/htdocs

/usr/local/mysql/bin/mysqldump --all-databases --single-transaction -ubkuser –ppAssw0rd > /mnt/usb/mysqldb$rq.sql

(前面2行是刪除7天前的文件,-u –p 後面緊跟賬號密碼,不能有空格,--single-transaction參數需要有,否則會報LOCK錯誤。不能隨意增加空格)

更改文件權限:

chmod 500 /usr/sbin/mywebbak

修改/etc/crontab

#vi /etc/crontab

在下面添加

01 3 * * * root /usr/sbin/mywebbak

這樣就做到了每天3點備份。

 

2.13擴展支持性模塊

ctools-7.x-1.2.tar.gz       rules-7.x-2.2.tar.gz

ddblock-7.x-1.0.tar.gz      token-7.x-1.5.tar.gz

entity-7.x-1.0.tar.gz       views-7.x-3.5.tar.gz

insert-7.x-1.3.tar.gz

ncumulus-7.x-1.x-dev.tar.gz  tagadelic-7.x-1.x-dev.tar.gz

需要從http://pratul.in/files/cumulus.js下載cumulus.js文件,

需要從http://xdrupal.org/chinese-cumuls下載支持中文的cumulus.swf文件。

需要修復一個bug:

tagadelic.module 334行,增加一個判斷條件:

if(isset($vars['voc'])){

  if (count($terms) >= variable_get('tagadelic_block_tags_' . $vars['voc']->vid, 12)) {

    $output .= theme('more_link', array('title' => t('more tags'), 'url' => "tagadelic/chunk/{$vars['voc']->vid}"));

  }

  return $output;

}

admin/structure/block/add-cumulus-block 初始增加tag雲block。

admin/structure/block/manage/cumulus/1/configure具體設置:

<none>,tags cloud, 1, 6, 24, 168, 168, ffffff, 否, ff0000, 000000, da70d6, 100, 是, 20, 2, 邊欄第一。只在 <front> 出現。

 

增加一個views,對應上“更多標籤”對應的uri: tagadelic/chunk/1, 

 

 

 

 

2.14Ddblock 安裝動態展示圖片模塊

Download:

http://drupal.org/project/ddblock

ddblock-7.x-1.0.tar.gz

解壓到sites/all/modules目錄,enable。

http://malsup.com/jquery/cycle/download.html 

jquery.cycle.all.js

創建目錄:/sites/all/libraries/jquery.cycle/,將上面的js文件放進去。

試用:

在“首頁 ? 管理 ? 結構Dynamic display block”,新添加一個DDblock,如“美景”,在“首頁 ? 管理 ? 結構 ? 區塊'美景' 區塊”,進行設置,將需要展示的圖片copy到images/ddblock(需要mkdir),該目錄存在是如下目錄的子目錄:

 

首頁 ? 管理 ? 用戶 用戶權限

在這裏設置允許匿名用戶訪問DDblock。

設置只在主頁出現:

 

 

2.15smart_paging

conf: admin/config/content/formats/filtered_html, admin/config/content/formats/full_html,

ü勾選 smart paging

ü將<!—pagebreak--> 增加到允許的標籤(full_html不需要)

üadmin/config/content/smart_paging,

 

üadmin/config/regional/translate/translate,找Page,”Page:sites/all/modules/smart_paging/js/smart_paging-pager.js”,翻譯成”頁:”,可使頁數選擇框的”Page:”變爲”頁:”

 

 

2.16用戶的鎖定機制設置flood_control

 

nDrupal的機制是:輸錯密碼5次,將被鎖定6小時。

安裝http://drupal.org/project/flood_control module後,可以更改鎖定次數、時長等設置。

如果帳戶因爲密碼錯誤次數超過5次被lock,在DB執行:

mysql>use drdb;

mysql> select * from flood;

mysql> delete * from flood;

 

n解鎖管理員賬號

update users set status = 1 where uid = 1;

 

2.17內容類型

首頁 ? 管理 ? 結構 ? 內容類型手冊頁,可以禁止評論等設置,對新內容生效。對於已經創建好的此類型的內容,則需要逐項去修改設置。

內容的發佈選項中,可以決定是否發佈到主頁。

 

2.18驗證碼模塊

Download:http://drupal.org/project/captcha

captcha-7.x-1.0-beta2.tar.gz

enable後進行具體的設置,可以登錄選擇圖片方式,回帖使用數學方式。

如果此模塊不能正常工作,導致管理員也無法登錄,在服務器將此module文件夾刪除即可。

未解決問題:jpeg驗證碼圖片不能顯示,是因爲ipeg模塊安裝於gd2有問題,數學公式可以正常執行。

增加image_captcha_refresh-7.x-1.5.tar,可以換一張圖片。

 

2.19用戶積分控制模塊

http://drupal.org/project/userpoints

 

2.20產品與購買模塊

http://drupal.org/project/ubercart

依賴於以下模塊:

Rules:rules-7.x-2.2.tar.gz

Views:views-7.x-3.5.tar.gz

Ctools:ctools-7.x-1.2.tar.gz

Entity API/tokens:entity-7.x-1.0.tar.gz

 

建議安裝如下模塊:

Colorbox

Google Analytics

Token: token-7.x-1.4.tar.gz

 

安裝:

1.Ctools

Chaos tool suite,紊亂工具套件。

ctools-7.x-1.2.tar.gz

只勾選Chaos tools。

 

2.Views

靈活的定製各種動態頁面。

views-7.x-3.5.tar.gz

Enable Views and Views UI

詳細參閱:

http://drupal.org/taxonomy/term/89

設置:

首頁 ? 管理 ? 結構Views,可以從第一個模板開始,點擊“啓用”,然後“編輯”,

 

設置好菜單:

 

保存。

3.Entity api

擴展對象的控制,The module provides API functions allowing modules to create, save, delete

    or to determine access for entities based on any entity type。

http://drupal.org/project/entity

entity-7.x-1.0.tar.gz

勾選entity api,entity tokens。

 

 

4.Rules

rules-7.x-2.2.tar.gz

勾選 rules和rules UI。

 

 

5. Ubercart

ubercart-7.x-3.4.tar.gz

先啓用Ubercart – core:store,product,order,cart.

n結合阿里支付平臺

http://drupal.org/project/uc_alipay

在ubercart – payment勾選alipay。

 

啓用catalog和file downloads

 

 

在首頁 ? 管理 ? Store ? 配置Countries and addresses可以設置國家。

 

2.21Ubercart設置

Product

 

 

 

Country

 

 

 

 

問題:私有文件系統下,圖片不能在商品的views正常顯示。

 

 

2.22PHP mail

Suport mail send to user’s mailbox for register,etc

From: http://drupal.org/project/PHPmailer

Download:phpmailer-7.x-3.x-dev.tar.gz, extract to drupal/sites/all/modules

From: http://code.google.com/a/apache-extras.org/p/phpmailer/downloads/list

Download: PHPMailer_5.2.2, extract to drupal/sites/all/libraries,rename the folder to “phpmailer”

 

在 /usr/local/php/lib/php.ini, 增加一行:extension=/usr/local/php/lib/php/extensions/no-debug-zts-20100525/openssl.so

如果此文件沒有,參見:

 

Logon the website as web administrator, enable the module, and configure,such as:

 

 

 

(幸運succor)

 

(give a recipient mailbox for testing)

Thus, the test mailbox will receive a test mail. That’s all.

When a user first register using a valid mailbox,he will receive a letter from the website. When administrator set the new user alive,a new letter guiding user how to set his password is sent.

 

權限發生問題的應急措施:重建權限

 

 

2.23分享到社交網站模塊

jiathis-7.x-1.0-alpha2.tar

admin/config/services/jiathis/page

選擇“手冊頁”、“文章”兩種類型。

 

 

 

2.24Files下載積分控制

nUserpoints

userpoints-7.x-1.0.tar.gz

 

admin/structure/taxonomy/userpoints/add

新建一個術語:下載積分,用於管理專用於下載文件的積分,以區別於其他的積分。

 

Permission setting

 

nprivatefiles

/privatefiles預先創建,並且設置權限爲766.

admin/config/media/file-system

添加私有文件系統絕對目錄,默認下載方式仍然選擇“公共…”,以免影響普通文件存放。

 

 

nModule download_userpoints

Install & enable this module

admin/config/people/userpoints/settings

set the points per download

 

 

 

 

 

cck-7.x-2.x-dev.tar.gz

flag-7.x-2.0.tar.gz

rules_better_message-7.x-1.0.tar.gz

taxonomy_menu-7.x-1.4.tar.gz

userpoints-7.x-1.0.tar.gz

 

1.1userpoints

userpoints-7.x-1.0.tar

 

1.2重點

Userpoints/rules/downloadfiles/purchase如何配合起來使用:

目標:用戶可以使用積分下載文章,用戶可以購買積分。

私有文件系統同公有文件系統的區別於設置要訣。

Memcache的用途:能否將靜態圖片存放在內存?

 

 

1.3支付寶接口模塊

暫不能開通,需要申請虛擬主機、進行認證之後纔可以。

 

1.4QQ登錄模塊

暫不能開通,需要申請虛擬主機、進行認證之後纔可以。

 

 

2.25網站花生殼解析服務

將申請的域名,設置域名服務器爲:

ns1.oray.net

ns2.oray.net

 

 

 

如果是機器,則安裝花生殼客戶端;

如果是路由器,則在啓界面啓用花生殼服務。

 

2.26在線考試用的模塊

http://drupal.org/project/quiz

 

 

 

 

 

先下載並安裝如下module:

cck-7.x-2.x-dev.tar.gz

ctools-7.x-1.2.tar.gz

entity-7.x-1.0.tar.gz

flag-7.x-2.0.tar.gz

rules-7.x-2.2.tar.gz

rules_better_message-7.x-1.0.tar.gz

taxonomy_menu-7.x-1.4.tar.gz

token-7.x-1.4.tar.gz

userpoints-7.x-1.0.tar.gz

views-7.x-3.5.tar.gz

 

2.27hook and module

A hook is a PHP function that is named foo_bar(), where "foo" is the name of the module (whose filename is thus foo.module) and "bar" is the name of the hook.

(hook就是遵循約定命名規則的函數,有點是)

 

Samples of core hook:

hook_form   modules/node/node.api.php   Display a node editing form.   

hook_file_download   modules/system/system.api.php   Control access to private file downloads and specify HTTP headers.   

hook_menu   modules/system/system.api.php   Define menu items and page callbacks.   

hook_user_login   modules/user/user.api.php   The user just logged in.   

                        

 

3網站內容 

3.1功能

n功能需求:

書籍閱讀

動態圖形展示

五星評價

用戶積分

數學公式展示

論壇

下載受控文章扣積分模塊

驗證碼

郵箱註冊

分享到社交網站模塊

 

n改進需求:

Logo

個性化頁眉頁腳

用戶密碼錯誤驗證碼缺失問題解決

數學公式展示時需要加快速度

n高級需求(網站認證之後):

Ubercart模塊

支付寶接口模塊

QQ登錄

3.2內容

主菜單:主頁/學習方法/數學文章/精華文章下載/在線測驗/積分管理/用戶指引/聯繫我們/關於我們

Tag:初一/初二/初三/方法/試題/精華

主頁:動態圖展示/最新文章/最新評論

學習方法:書本

數學文章:書本

精華文章下載:列表

在線測驗:記時/評卷/回顧

積分管理:積分說明/積分明細/積分歷史/購買積分(高級)

用戶指引:數學公式錄入辦法

 

3.3安裝記錄

生產機(192.168.1.88):

2013-3-9 P22,2.4 初始安裝drupal並翻譯中文

2013-3-10 動態表情/ imce OK,設定備份腳本備份到u盤。

2013-3-19繼續,

#解決jpeg未被GD支持,參考意外案例解決。

#安裝vim, yum install vim

#更換logo,不顯示drupal頁腳。

#transliteration,點擊:Fix existing file names.

#insert

#libraries

#Ctools, Chaos tools

#entity, Entity tokens/Entity API

#token

#views, Views UI/Views content panes/Views

#rules,Rules/Rules Scheduler/Rules UI

#ddblock, Dynamic display block

#tagadelic, 

#cumulus, 具體設置參見cumulus

#pathauto, 

#metatag, Meta tags

#smart_paging

#date, 能啓用的都啓用。

# FCKeditor 2.6.9

Filtered HTML FCKeditor 2.6.9

Full HTML TinyMCE 3.5.8

Plain text    no editor

#realname

 

 

 

 

 

測試機(192.168.1.55):

2013-3-9 P27,安裝動態表情OK。

2013-3-10, imce OK,

30頁,剛設置好avatar,其餘用戶模塊還需挨個設置。

下一步:驗證碼,用戶郵件註冊,會員默認頭像/avatar selection,會員頭像上傳,會員註冊協議/terms of use,檢測用戶名是否可用,imce支持文件圖片處理、數學公式支持、ddblock、userpoint、fivestar、分享到、短消息

 

難點:考試模塊、懸賞解答模塊、下載文檔積分模塊、QQ登錄模塊、支付寶模塊、常用文件圖片緩存實現、

 

表單美化

http://drupal.org/project/rel

rel-7.x-1.0-alpha2.tar

 

旅店系統

http://drupal.org/project/uc_hotel

QA:

http://drupal.org/project/answers

http://drupal.org/project/eva

http://drupal.org/project/features

http://drupal.org/project/references

http://drupal.org/project/nodereference_count

http://drupal.org/project/nodereference_url

http://drupal.org/project/strongarm

http://drupal.org/project/aup

http://drupal.org/project/relevant_answers

 

數海網管理條例

在註冊賬號、發表文章和評論之前,請您仔細閱讀並遵守本管理條例:

·法律法規遵從

    1. 遵守中華人民共和國有關法律、法規,承擔一切因您的行爲而直接或間接引起的法律責任。

    2. 不得發表違反中華人民共和國憲法和法律、違反改革開放和四項基本原則的言論;

    3. 不得發表造謠、誹謗他人、煽動顛覆國家政權的言論,不得泄露國家祕密;

    4. 不得發表暴力、色情、迷信的言論;

    5. 不得發表宣揚種族歧視、破壞民族團結的言論和消息;

    6. 使用文明用語,不得發佈對任何人進行人身***、謾罵、詆譭的言論。

·內容相關性

    1. 請勿發表與本站主題(數學)無關的材料和言論;

    2. 未經本站同意,請勿發佈任何形式的廣告;

    3. 凡轉摘文章,應註明原始出處和時間,注意原發表單位的版權聲明,並負擔由此可能產生的版權責任。

·賬號註冊注意事項

    1. 禁止以黨和國家領導人真實姓名、國家機構或其他機構的名稱註冊;

    2. 請勿以其他名人的真實姓名、字號、藝名、筆名註冊;

    3. 請勿註冊不文明、不健康之賬號;

·權利申明

本站擁有管理頁面和賬號的一切權利,請網友服從管理。

本站保留本條例最終解釋權,並會根據需要進行修訂,恕不另行通知。

數海網

Filter-html允許align-left的設置?

Tinymce下的filter-html無法讓用戶設置字體、大小、顏色。FCKedit可以,但需要修改代碼才能支持。

 

username_check-7.x-1.x-dev.tar

terms_of_use-7.x-1.2.tar

 

 

navatar_selection-7.x-1.0.tar.gz

(暫不採用,因爲有用戶上傳頭像模塊和默認頭像設置)

(bug及修復:

Notice: Undefined index: picture in avatar_selection_form_user_profile_form_alter() (line 266.... in avatar_selection.module

 

I checked this line and there is check:

if (is_array($form['picture'])) {

....

in this case $form['picture'] does not exist

simple fix - change this line to :

if (isset($form['picture']) && is_array($form['picture'])) {)

(access avatars權限,public://avatar_selection位置)

login_destination-7.x-1.1.tar

(設置爲登錄到本頁,便於匿名者登錄到其當前頁面)

privatemsg-7.x-1.3.tar(暫不採用)

survey_builder-7.x-1.0-beta1.tar(暫不採用)

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章