锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲人精品亚洲人成在线,国产成人精品亚洲精品,国产亚洲精品高清在线http://m.tkk7.com/rain1102/category/37651.html<br/><font color="green" style="font-family: 鍗庢枃琛屾シ;font-size:16px;">瀛愭洶錛氬嵄閭︿笉鍏ワ紝涔遍偊涓嶅眳銆傚ぉ涓嬫湁閬撳垯瑙侊紝鏃犻亾鍒欓殣銆?lt;/font><font color="#3C1435"></font>zh-cnFri, 20 Feb 2009 09:44:56 GMTFri, 20 Feb 2009 09:44:56 GMT60Windows涓婭IS+PHP 5.2鐨勫畨瑁呬笌閰嶇疆http://m.tkk7.com/rain1102/archive/2009/01/07/250374.htmlEric.ZhouEric.ZhouWed, 07 Jan 2009 09:05:00 GMThttp://m.tkk7.com/rain1102/archive/2009/01/07/250374.htmlhttp://m.tkk7.com/rain1102/comments/250374.htmlhttp://m.tkk7.com/rain1102/archive/2009/01/07/250374.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/250374.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/250374.htmlWindows涓婸HP鐨勫畨瑁呰櫧鐒剁畝鍗曪紝浣嗗鏋滀笉娉ㄦ剰鏂規硶錛屼粛鐒朵細璁╀綘澶寸柤銆傛澶栵紝PHP 5.2鐗堟湰涓庝箣鍓?.x鐗堟湰涔熸湁涓浜涗笉鍚岋紝鎵浠ユ湁蹇呰璁板綍涓涓嬶紝閬垮厤涓嬫蹇樿浜嗚繖鏍風殑瀹夎閰嶇疆鏂規硶銆?br />
姝ラ涓錛氫笅杞絧hp 5.2 for windows鐨勫畨瑁呭寘錛岃В鍘嬭嚦C:\php銆傛敞鎰忔瑙e帇鐩綍鍙互鏄湪浠諱綍鐩樹笅錛岀劧鑰岀洰褰曞悕涓嶈兘鍖呭惈絀烘牸錛?br /> 浠ヤ笅鏄痯hp5.2鐨勬枃浠剁洰褰曪細
c:\php
   |
   +--dev
   |  |
   |  |-php5ts.lib
   |
   +--ext                 -- extension DLLs for PHP
   |  |
   |  |-php_bz2.dll
   |  |
   |  |-php_cpdf.dll
   |  |
   |  |-..
   |
   +--extras
   |  |
   |  +--mibs             -- support files for SNMP
   |  |
   |  +--openssl          -- support files for Openssl
   |  |
   |  +--pdf-related      -- support files for PDF
   |  |
   |  |-mime.magic
   |
   +--pear                -- initial copy of PEAR
   |
   |
   |-go-pear.bat          -- PEAR setup script
   |
   |-fdftk.dll
   |
   |-..
   |
   |-php-cgi.exe          -- CGI executable
   |
   |-php-win.exe          -- executes scripts without an opened command prompt
   |
   |-php.exe              -- CLI executable - ONLY for command line scripting
   |
   |-..
   |
   |-php.ini-dist         -- default php.ini settings
   |
   |-php.ini-recommended  -- recommended php.ini settings
   |
   |-php5activescript.dll
   |
   |-php5apache.dll
   |
   |-php5apache2.dll
   |
   |-..
   |
   |-php5ts.dll           -- core PHP DLL
   |
   |-...

姝ラ浜岋細灝哻:\php鐩綍涓嬬殑php.ini-recommended錛堟垨php.ini-dist鏂囦歡錛屽畼鏂規帹鑽愪負鍓嶈咃級澶嶅埗鍒板綋鍓嶇洰褰曪紝騫朵慨鏀規枃浠跺悕涓簆hp.ini錛?br />
姝ラ涓夛細緙栬緫php.ini銆備富瑕佷慨鏀瑰涓嬩袱琛岀殑鍊鹼細
extension_dir = "c:\php\ext"
doc_root = "c:\inetpub\wwwroot"

淇敼鏃墮渶瑕佸垹闄ゆ帀榪欎袱琛岃棣栫殑;娉ㄩ噴銆俥xtension_dir鐨勫間負php瀹夎鐩綍涓嬬殑ext鐩綍錛宒oc_root鐨勫間負IIS璁劇疆鐨勪富鐩綍錛?br />
姝ラ鍥涳細璁劇疆鐜鍙橀噺銆傚湪Path鍚庢坊鍔犲涓嬬殑鍊鹼細
;:\php
鐒跺悗閲嶅惎璁$畻鏈恒?br />
姝ラ浜旓細鎵撳紑Internet淇℃伅鏈嶅姟錛屾壘鍒?#8220;榛樿緗戠珯”錛屽皢緗戠珯鍋滄銆傜劧鍚庢墦寮“灞炴?#8221;欏點傚湪“灞炴?#8221;欏典腑鎵懼埌“涓葷洰褰?#8221;鏍囩錛屽崟鍑?#8220;閰嶇疆”鎸夐挳錛屾坊鍔犲簲鐢ㄧ▼搴忔槧灝勩傚叾鍊煎垎鍒負錛?br /> 鍙墽琛屾枃浠訛細c:\php\php5isapi.dll
鎵╁睍鍚嶏細.php
鍏朵綑涓嶇敤淇敼錛岀‘瀹氬悗錛岄噸鏂板惎鍔ㄩ粯璁ょ綉绔欙紱

姝ラ鍏細鍦╟:\inetpub\wwwroot涓嬫柊寤轟竴涓枃浠秇ello.php銆傝緭鍏ュ唴瀹癸細
<html>
  <head>
    <title>World</title>
  </head>

  <body>
    <?php echo "Hello world" ?>
   
  </body>
</html>
淇濆瓨鍚庯紝鎵撳紑嫻忚鍣紝杈撳叆鍦板潃錛?a href="http://localhost/hello.php">http://localhost/hello.php銆傚鏋滅綉欏典腑鏄劇ずHello world鍒欒鏄庡畨瑁呮紜傛垜浠篃鍙互鍦ㄧ綉欏典腑閫氳繃鏌ョ湅hello.php鐨勬簮浠g爜錛屽鏋滄簮浠g爜涓病鏈塸hp浠g爜錛屼篃璇存槑瀹夎鏄紜殑銆?br />



Eric.Zhou 2009-01-07 17:05 鍙戣〃璇勮
]]>
OG(Organic Group) 妯″潡浠嬬粛http://m.tkk7.com/rain1102/archive/2007/12/20/168950.htmlEric.ZhouEric.ZhouThu, 20 Dec 2007 02:21:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/20/168950.htmlhttp://m.tkk7.com/rain1102/comments/168950.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/20/168950.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/168950.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/168950.htmlDescription
璁╀嬌鐢ㄨ呭彲浠ュ緩绔嬪茍綆$悊浠栦滑鑷繁鐨勭兢緇勩傛瘡涓涓兢緇勫彲浠ユ嫢鏈夎嚜宸辯殑鎴愬憳錛屽茍鏈変竴涓兢緇勯欏碉紝璁╃兢緇勬垚鍛樺彲浠ュ湪姝ゅ紶璐存枃绔犮佸郊姝や氦嫻併?br /> 鏈夌殑緹ょ粍闇瑕佺鐞嗚呭鏍稿悗鎵嶈兘鍔犲叆錛屾垨鐢氳嚦闇瑕侀忚繃閭璇鋒墠鑳藉姞鍏ャ傜兢緇勫彲浠ユ嫢鏈夎嚜宸辯殑鐗堝瀷銆佽緋匯佸垎綾葷瓑錛屾湁澶氫釜璁懼畾欏圭洰錛屽茍鍙笌View妯″潡鏁村悎銆?br /> Enable users to create and manage their own 'groups'. Each group can have subscribers, and maintains a group page where subscribers can post into. Posts may be placed into multiple groups (i.e. cross-posting) and individual posts may be shared with non-subscribers or not. Membership to groups may be open, closed, moderated, or invitation only. Add-on modules are available for group image galleries, group calendars, group vocabulary, group stores, and so on.

Groups may choose their own theme and language. Groups have RSS feeds, and so on.

Installation
瀹夎浠ュ悗錛岄渶瑕佹柊寤轟竴涓唴瀹圭被鍨嬶紝姣斿錛歡roups錛岀劧鍚庢妸榪欎釜groups鍐呭綾誨瀷涓嶰G鍏寵仈錛堣繘鍏rganic groups configuration錛岃緗瓽roup home page 涓篻roups 鍐呭綾誨瀷錛夈?/p>

 

鐩稿叧妯″潡錛?br /> ------------------------------------------------------------------
OG Actions
  1. http://drupal.org/project/og_actions
  2. The og_actions module is a collection of 5 actions for use with the actions module and workflow module. These actions facilitate the use of organic groups with the actions and workflow modules, allowing administrators to create rules to modify the organic group information for specific nodes.

---------------------------------------------------------------------------------
OG Aggregator

  1. http://drupal.org/project/og_aggregator
  2. 鍙互璁?Organic Groups 鎷ユ湁鑷繁鐨?RSS Aggregator銆?
  3. A module to create individual aggregator for Organic Groups using Aggregator.
    Key features
    ------------------
    - Feed content filter (including keyword filter and excluding keyword filter)
    - An individual feed page of every feed source is available
    Requirements
    ------------------
    - Aggregator module
    - OG module

---------------------------------------------------------------------------------
OG Audience

  1. http://drupal.org/project/og_audience
  2. The OG Audience module provides an "audience" tab and/or a block on node pages that allows Organic Groups (OG) users to change the audience of existing content. A user can add a node to one or more of his subscribed groups. A group administrator can remove a node from his group(s).
    Users with the proper permission can change the audience of a node even if they do not have the permission to edit the node.

---------------------------------------------------------------------------------
OG Author

  1. http://drupal.org/project/og_author
  2. This is a small module to set the authoring group for any group post.
    This module has been sponsored by http://www.wiki9999.org/

---------------------------------------------------------------------------------
OG Block Visibility

  1. http://drupal.org/project/og_block_visibility
  2. 鍙互璁懼畾鍖哄潡浠呭嚭鐜板湪鏌愪釜緹ょ粍閲岋紝渚嬪鍙互鐢ㄦ潵璁╂瘡涓兢緇勬嫢鏈夎嚜宸辯殑瀵艱閫夊崟錛屾垨鏄緹ょ粍鍙互寮鴻皟鑷繁鎺ㄨ崘鐨勫唴瀹圭瓑銆?
  3. This module allows you to specify that a block should be visible only within a selected group. This can be used for many purposes, from providing each organic group with its own navigation menu, to allowing a group to highlight its own featured content, etc.

---------------------------------------------------------------------------------
OG Calendar

  1. http://drupal.org/project/og_calendar
  2. 璁╂瘡涓兢緇勯兘鍙互鎷ユ湁涓涓椿鍔ㄨ浜嬪巻錛屼粎鏄劇ず璇ョ兢緇勭殑媧誨姩銆?
  3. This module provides each group with a calendar showing only the group's events.
    Sponsored by Raven Brooks of BuyBlue.
    Developed by CivicSpace Labs.

---------------------------------------------------------------------------------
OG Forum

  1. http://drupal.org/project/og_forum
  2. 璁╂瘡涓兢緇勯兘鎷ユ湁涓涓璁虹増錛屽茍闄愬埗涓轟粎鏈夌兢緇勬垚鍛樺彲浠ユ瑙嗚璁ㄨ鍖洪噷鐨勬枃绔犮?
  3. Creates a forum per organic group and restricts viewing forum nodes by group membership.
    Go ahead and use the dev release from the 30th of August. It contains a bug fix to 2.0.

---------------------------------------------------------------------------------
OG Galleries

  1. http://drupal.org/project/og_galleries
  2. A module to create individual image galleries for Organic Groups using Taxonomy and Views. A public gallery is created, along with galleries for each group which are private to that group. Your galleries are controlled by a Views view, and you can set the url, fields, and filters as you like by changing the view. Node types can be image nodes, CCK nodes, or any other content type. Add items to the galleries by selecting a gallery when the node is edited.

---------------------------------------------------------------------------------
OG Gradebook

  1. http://drupal.org/project/og_gradebook
  2. Creates a gradebook per organic group and restricts viewing grades by group membership.

---------------------------------------------------------------------------------
OG Join Role

  1. http://drupal.org/project/og_joinrole
  2. The OG Join Role module simply adds a "join organic groups" permission to the Organic Groups module. A use case for this would be if you have a site where only members of a certain role are allowed to join an organic group.
    The module is written in an all-or-nothing sort of way - either certain roles can join any and all groups or they can join no groups. It will not work on a per-group basis.
    In addition to granting/denying permission to join a group, the module also modifies any text and/or links to join a group unless the user has the proper role. For example, the module removes any "og/subscribe" links on the page and replaces them with "nicer" text that you define in the admin settings.

---------------------------------------------------------------------------------
OG Minutes

  1. http://drupal.org/project/og_minutes
  2. This module makes Organic groups and Minutes work together. It allows to filter users so that the list of potential attendees in Minutes shows only the members of the group(s) to which the related event belongs.

---------------------------------------------------------------------------------
OG moderated posts

  1. http://drupal.org/project/og_moderate
  2. This module moderates public posts from organic groups module. Moderated posts will be hidden from anonymous visitors. Moderation needs to be done by node administrators or another module.

---------------------------------------------------------------------------------
OG Project

  1. http://drupal.org/project/og_project
  2. Allows the Project issue tracking module to function properly on a site that has Organic groups enabled. Without this module, the issue tracker does not work if you enable organic groups.

---------------------------------------------------------------------------------
OG promote

  1. http://drupal.org/project/og_promote
  2. Promote users that join certain groups to a special role.
    Choose one role that all users who join the groups you select will be promoted to. Should a user leave that group, he will be demoted again.

---------------------------------------------------------------------------------
OG Public Access

  1. http://drupal.org/project/og_public_access
  2. The OG Public Access module allows Organic Groups (OG) administrators to control public access to their groups' content. This module does not require group administrators to be granted the site-wide administer nodes permission.
    The use case for this module is for a site with teams of writers submitting content privately in their groups, and editors controlling what is allowed to go public in specific groups.

---------------------------------------------------------------------------------
OG Roles

  1. http://drupal.org/project/og_roles
  2. This module allows you to, for each group type, specify a list of roles that group administrators are allowed to assign.

---------------------------------------------------------------------------------
OG Teampage

  1. http://drupal.org/project/og_teampage
  2. This module provides a table view with all members (subscribers) of an organic group.

---------------------------------------------------------------------------------
OG User Roles

  1. http://drupal.org/project/og_user_roles
  2. This module allows you to assign group-specific roles to users which are restricted to the groups they are in. In other words, using this module, you can assign the role "contributor" to a user in a group, and the user will only have the permissions of that role while he is in that particular group.
    Requires og.module and og_forums.module.
    Read the history of this module: http://drupal.org/node/87679
    Other features of this module allow you to:

     

    1. Assign a default role to all new users who sign up to your site.
    2. Notify group admin of new group subscribers. Requires mimemail.module.
    3. Set a default "Founder" group role for users who create groups.
    4. Set a default group role for new subscribers to a group.
    5. Create subgroups. Requires og_subgroups.module.
    6. Comes with it's own access control for optionally integrating the taxonomy access control (TAC) and organic groups (OG) modules. See: http://groups.drupal.org/node/3700.
    7. Supports Content Access (http://www.drupal.org/project/content_access) and Access Control List (http://www.drupal.org/project/acl) access control modules. See http://groups.drupal.org/node/5392
    8. Works with OG Vocabulary (http://www.drupal.org/project/og_vocab) module. See this issue: http://drupal.org/node/162649

---------------------------------------------------------------------------------
OG Vocab

  1. http://drupal.org/project/og_vocab
  2. 璁╂瘡涓兢緇勯兘鍙互鎷ユ湁鑷繁鐨勫垎綾伙紙vocabularies錛夈?
  3. Provide each organic group with its own vocabularies.



Eric.Zhou 2007-12-20 10:21 鍙戣〃璇勮
]]>
妯″潡浠嬬粛錛欱ook Reviewhttp://m.tkk7.com/rain1102/archive/2007/12/19/168775.htmlEric.ZhouEric.ZhouWed, 19 Dec 2007 08:17:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/19/168775.htmlhttp://m.tkk7.com/rain1102/comments/168775.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/19/168775.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/168775.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/168775.html
  • http://drupal.org/project/bookreview
  • 涓涓柊鐨勮妭鐐圭被鍨嬶紝鍐呭緩澶氫釜涓庝功綾嶆暟鎹浉鍏崇殑瀛楁錛屽寘鎷功鍚嶃佸皝闈㈠浘鐗囥佸嚭鐗堣呫佷綔鑰呫佺綉绔欒繛緇撱佺増鏉冦両SBN銆侀〉鏁般佷環鏍箋佹憳瑕併佺洰褰曘佽瘎璁虹瓑錛屽茍鍙繛緇撳埌澶栭儴鐨勭綉緇滀功搴椼?br /> 瀹氫箟浜嗙壒孌婄殑涔﹁瘎鑺傜偣錛屾柟渚垮彂甯冨浘涔﹁瘎璁恒?
  • The book review module allows a site to publish book reviews. A book review is simply a glorified node, providing custom fields that are appropriate to writing a book review.


  • Eric.Zhou 2007-12-19 16:17 鍙戣〃璇勮
    ]]>
    妯″潡浠嬬粛錛欰rticlehttp://m.tkk7.com/rain1102/archive/2007/12/19/168698.htmlEric.ZhouEric.ZhouWed, 19 Dec 2007 03:59:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/19/168698.htmlhttp://m.tkk7.com/rain1102/comments/168698.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/19/168698.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/168698.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/168698.html
  • http://drupal.org/project/article
  • 灝嗕換鎰忕被鍨嬬殑鑺傜偣鏍規嵁綾誨埆錛坱axonomy錛夋暣鐞嗗湪涓璧烽泦涓樉紺猴紝濡傜敓媧葷被鏈?綃囷紝鎶鏈被鏈?綃囩瓑銆傜敤鎴峰彲浠ユ寜鐓у垎綾繪祻瑙堛?
  • The article module allows for nodes of any type to be organized and displayed in a centralized location. This allows the site administrator to organize nodes of several different types in one place. The user can navigate the nodes by selecting different categories in the taxonomy tree associated with the article module.


  • Eric.Zhou 2007-12-19 11:59 鍙戣〃璇勮
    ]]>
    妯″潡浠嬬粛錛欰dmin RSShttp://m.tkk7.com/rain1102/archive/2007/12/19/168694.htmlEric.ZhouEric.ZhouWed, 19 Dec 2007 03:48:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/19/168694.htmlhttp://m.tkk7.com/rain1102/comments/168694.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/19/168694.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/168694.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/168694.html
  • http://drupal.org/project/adminrss
  • 鎻愪緵鍖呭惈寰呭鏍哥殑鑺傜偣鍜屽搷搴旂殑RSS feed錛屾柟渚跨鐞嗚呴殢鏃跺緱鐭ョ綉绔欑殑鏈鏂扮姸鍐碉紝蹇熷仛鍑哄弽搴斻?
  • The AdminRSS module creates RSS feeds for the administrative information for Drupal websites.
    These feeds are protected with a keystring that must be set in admin/settings/adminrss page.
    The resulting pages can then be read at:
    adminrss/node/keystring - RSS feed for unapproved nodes
    adminrss/comment/keystring - RSS feed for unapproved comments
    This can be most useful if you are managing a number of different drupal websites and rather than visiting each one to see if there are comments/nodes that need to be approved you can use an RSS reader to find out.
    Thanks to Fredrik Jonsson and Gabor Hojtsy for their modules adminblock and commentrss which were heavily cribbed from to develop this module.


  • Eric.Zhou 2007-12-19 11:48 鍙戣〃璇勮
    ]]>
    妯″潡浠嬬粛錛欰dmin blockhttp://m.tkk7.com/rain1102/archive/2007/12/19/168692.htmlEric.ZhouEric.ZhouWed, 19 Dec 2007 03:45:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/19/168692.htmlhttp://m.tkk7.com/rain1102/comments/168692.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/19/168692.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/168692.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/168692.html
  • http://drupal.org/project/adminblock
  • 鐢ㄤ簬甯姪綆$悊鍛樻柟渚跨殑鐩戠璇勮鍜屾枃绔犮傚鏋滀綘鐨勭珯鐐硅緗垚鍙戞枃闇瑕佸鎵癸紝閭d箞綆$悊鍛樻瘡嬈¢兘瑕佽繘鍏ュ唴瀹圭鐞嗘煡鐪嬪鎵歸槦鍒椼傝屾妯″潡灝嗛氳繃鍖哄潡鏄劇ず鎵鏈夌瓑寰呭鎵圭殑璇勮鍜屾枃绔犻槦鍒楋紝涓鐩簡鐒訛紝鍙互鏂逛究蹇熷湴瀹屾垚瀹℃壒
    鎻愪緵涓涓尯鍧楋紝鐢ㄦ潵鏄劇ず鎵鏈夊緟瀹℃牳鐨勫搷搴斿拰鑺傜偣銆傛瘡涓涓」鐩兘鏈夎嚜宸辯殑緙栬緫涓庡垹闄よ繛緇擄紝渚夸簬蹇熺鐞嗐?
  • The adminblock module enables admins to display a block with the comments approval queue and the node moderation queue. Each item gets their own edit link and delete link for quick administration.


  • Eric.Zhou 2007-12-19 11:45 鍙戣〃璇勮
    ]]>
    妯″潡浠嬬粛錛歠reelinkinghttp://m.tkk7.com/rain1102/archive/2007/12/18/168545.htmlEric.ZhouEric.ZhouTue, 18 Dec 2007 09:38:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/18/168545.htmlhttp://m.tkk7.com/rain1102/comments/168545.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/18/168545.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/168545.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/168545.html
    綆浠嬶細
    freelinking 妯″潡涓鴻緭鍏ユ牸寮忓鍔犱竴涓繃婊わ紝涓哄凡緇忓瓨鍦ㄦ垨鑰呭皢瑕佸瓨鍦ㄧ殑鍐呭寤虹珛閾炬帴錛屽畠鑳藉鑷姩鍦頒負鍏抽敭璇嶅緩绔嬮摼鎺ワ紝鑳藉閫氳繃 “wiki 椋庢牸” 涓哄唴瀹規彁渚涢摼鎺ャ?br />
    閾炬帴錛?/strong>
    http://drupal.org/project/freelinking


    Eric.Zhou 2007-12-18 17:38 鍙戣〃璇勮
    ]]>
    妯″潡浠嬬粛錛欶orum Accesshttp://m.tkk7.com/rain1102/archive/2007/12/18/168543.htmlEric.ZhouEric.ZhouTue, 18 Dec 2007 09:37:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/18/168543.htmlhttp://m.tkk7.com/rain1102/comments/168543.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/18/168543.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/168543.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/168543.html綆浠嬶細
    榪欎釜妯″潡璁╀綘鍙互灝嗘煇涓鍧涜緗負縐佹湁錛屼綘鍙互鍐沖畾閭d釜鐢ㄦ埛瑙掕壊鍙互嫻忚銆佺紪杈戙佸垹闄ゅ拰鍙戣〃甯栧瓙錛岃繕鍙互涓烘瘡涓鍧涚増闈㈣緗増涓匯?

     

    榪欎釜妯″潡闇瑕?ACL 妯″潡銆?

     

    閾炬帴錛?/strong>

     

    http://drupal.org/project/forum_access


    Eric.Zhou 2007-12-18 17:37 鍙戣〃璇勮
    ]]>
    涓哄垎綾諱互鍙婂垎綾諱俊鎭殑CRUD鎿嶄綔娣誨姞閭歡閫氱煡鍔熻兘http://m.tkk7.com/rain1102/archive/2007/12/18/168474.htmlEric.ZhouEric.ZhouTue, 18 Dec 2007 06:03:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/18/168474.htmlhttp://m.tkk7.com/rain1102/comments/168474.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/18/168474.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/168474.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/168474.html<?php

    /**
    * Implementation of hook_taxonomy().
    *
    * Sends email when changes to vocabularies or terms occur.
    */
    function taxonomymonitor_taxonomy($op, $type, $array = array()) {
     $to = 'vipzhour@163.com';
     $name = check_plain($array['name']);

     // $type is either 'vocabulary' or 'term'.
     switch ($type) {
      case 'vocabulary':
       switch($op) {
        case 'insert':
         $subject = t('Vocabulary @voc was added.', array('@voc'=>$name));
         break;
        case 'update':
         $subject = t('Vocabulary @voc was changed.', array('@voc'=>$name));
         break;
        case 'delete':
         $subject = t('Vocabulary @voc was deleted.', array('@voc'=>$name));
         break;
       }
       break;
      case 'term':
       switch($op) {
        case 'insert':
         $subject = t('Term @term was added.', array('@term'=>$name));
         break;
        case 'update':
         $subject = t('Term @term was changed.', array('@term'=>$name));
         break;
        case 'delete':
         $subject = t('Term @term was deleted.', array('@term'=>$name));
         break;
       }
     }

     // Dump the vocabulary or term information out and send it along.
     $body = print_r($array, TRUE);

     // Send the email.
     drupal_mail('taxonomymonitor-notify', $to, $subject, $body);
    }



    Eric.Zhou 2007-12-18 14:03 鍙戣〃璇勮
    ]]>
    妯″潡浠嬬粛錛歛udiohttp://m.tkk7.com/rain1102/archive/2007/12/17/168237.htmlEric.ZhouEric.ZhouMon, 17 Dec 2007 07:25:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/17/168237.htmlhttp://m.tkk7.com/rain1102/comments/168237.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/17/168237.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/168237.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/168237.html綆浠嬶細
    audio 妯″潡鍏佽鏈夋潈闄愮殑鐢ㄦ埛涓婁紶闊抽鏂囦歡錛屽畠浣跨敤 getID3 library 鏉ヨ鍐?ID3 meta-tag 淇℃伅銆?

              榪欎釜妯″潡榪橀檮甯︿竴涓?XSPF Flash 鎾斁鍣?/a>銆?

    閾炬帴錛?/strong>

     http://drupal.org/project/audio

    To install the audio module
    ---------------------------

    1. Extract the 'audio' module directory, including all its subdirectories, into
       your sites/all/modules directory.


    2. Install the getID3 package - optional but recommended. MAKE SURE YOU READ
       THE SECURITY NOTE BELOW!

       a. Download the project getId3 version from SourceForge.net. The latest
          version tested with the audio module is 1.7.7. Earlier versions contain
          bugs that will cause you headaches.

       b. Extract the archive into the sites/all/modules/audio/getid3 directory. When you're
          finished the directory structure should look something like:

            drupal/
              sites/
                all/
                  modules/
                    audio/
                      getid3/
                        README.txt
                        [...]
                        getid3/
                          getid3.php
                          write.php

      c. *** IMPORTANT ***
         YOU MUST DELETE THE 'demos' FOLDER OF THE ID3 LIBRARY. FAILURE TO DO SO
         OPENS UP A MASSIVE SECURITY HOLE AND MAKES YOUR SITE EXTREMELY VULNERABLE
         TO ATTACKS!

    3. Enable the audio, audio_getid3 and audio_image modules on the
       admin >> build >> modules page. The database tables will be created
       automagically for you at this point.

    4. Go to admin >> settings >> audio and check that the path to the getID3
       package is configured correctly. If you follow the above directory
       structure, the path should be "sites/all/modules/audio/getid3/getid3/".



    Eric.Zhou 2007-12-17 15:25 鍙戣〃璇勮
    ]]>
    The Filter Systemhttp://m.tkk7.com/rain1102/archive/2007/12/13/167400.htmlEric.ZhouEric.ZhouThu, 13 Dec 2007 02:05:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/13/167400.htmlhttp://m.tkk7.com/rain1102/comments/167400.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/13/167400.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/167400.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/167400.html<?php
    // $Id$

    /**
     * @file
     * A silly module to assist whizbang novelists who are in a rut by providing a
     * random sentence generator for their posts.
     */

    /**
     * Implementation of hook_filter().
     */
    function creativejuice_filter($op, $delta = 0, $format = -1, $text = '') {
      switch ($op) {
        case 'list':
          return array(
            0 => t('Creative Juices filter'),
            1 => t('The name of my second filter'),
          );

        case 'description':
          switch ($delta) {
            case 0:
              return t('Enables users to insert random sentences into their posts.');
            case 1:
              return t('If this module provided a second filter, the description for that second filter would go here.');
            // Should never return here as value of $delta never exceeds the last index of the 'list' array.
            default:
              return;
          }
          break;

        case 'settings':
            // No settings user interface for this filter.
          break;

        case 'no cache':
          return FALSE;

        case 'prepare':
          return $text;

        case 'process':
          return preg_replace_callback("|\[juice!\]|i", 'creativejuice_sentence', $text);

        default:
          return $text;
      }
    }

    /**
     * Generate a random sentence.
     */
    function creativejuice_sentence() {
      $phrase[0][] = t('A majority of us believe');
      $phrase[0][] = t('Generally speaking,');
      $phrase[0][] = t('As times carry on');
      $phrase[0][] = t('Barren in intellect,');
      $phrase[0][] = t('Deficient in insight,');
      $phrase[0][] = t('As blazing blue sky poured down torrents of light,');
      $phrase[0][] = t('Aloof from the motley throng,');
      $phrase[1][] = t('life flowed in its accustomed stream');
      $phrase[1][] = t('he ransacked the vocabulary');
      $phrase[1][] = t('the grimaces and caperings of buffoonery');
      $phrase[1][] = t('the mind freezes at the thought');
      $phrase[1][] = t('she reverted to another matter');
      $phrase[1][] = t('he lived as modestly as a hermit');

      $phrase[2][] = t('through the red tape of officialdom.');
      $phrase[2][] = t('as it set anew in some fresh and appealing form.');
      $phrase[2][] = t('supported by evidence.');
      $phrase[2][] = t('as fatal as the fang of the most venomous snake.');
      $phrase[2][] = t('as full of spirit as a gray squirrel.');
      $phrase[2][] = t('as dumb as a fish.');
      $phrase[2][] = t('like a damp-handed auctioneer.');
      $phrase[2][] = t('like a bald ferret.');

      foreach ($phrase as $key => $value) {
        $rand_key = array_rand($phrase[$key]);
        $sentence[] = $phrase[$key][$rand_key];
      }

      return implode(' ', $sentence);
    }

    /**
     * Implementation of hook_filter_tips().
     */
    function creativejuice_filter_tips($delta, $format, $long = FALSE) {
      if ($long) {
        // Detailed explanation for http://example.com/?q=filter/tips page.
        return t('The Creative Juices filter is for those times when your brain is incapable of being creative. These time comes for everyone, when even strong coffee and a barrel of jelly beans does not create the desired effect. When that happens, you can simply enter the [juice!] tag into your posts...');
      }
      else {
        // Short explanation for underneath a post's textarea.
        return t('Insert a random sentence into your post with the [juice!] tag.');
      }
    }



    Eric.Zhou 2007-12-13 10:05 鍙戣〃璇勮
    ]]>
    Poormanscron錛堣皟鐢╟ron浠誨姟錛?/title><link>http://m.tkk7.com/rain1102/archive/2007/12/11/167035.html</link><dc:creator>Eric.Zhou</dc:creator><author>Eric.Zhou</author><pubDate>Tue, 11 Dec 2007 11:58:00 GMT</pubDate><guid>http://m.tkk7.com/rain1102/archive/2007/12/11/167035.html</guid><wfw:comment>http://m.tkk7.com/rain1102/comments/167035.html</wfw:comment><comments>http://m.tkk7.com/rain1102/archive/2007/12/11/167035.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/rain1102/comments/commentRss/167035.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/rain1102/services/trackbacks/167035.html</trackback:ping><description><![CDATA[<span lang="EN-US" style="font-size: 9pt; color: #003150; font-family: Verdana; mso-fareast-font-family: 瀹嬩綋; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">Poormanscron:<br /> </span><span style="font-size: 9pt; color: #003150; font-family: 瀹嬩綋; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">閫氳繃鐢ㄦ埛鐨勬祻瑙堟潵璋冪敤</span><span lang="EN-US" style="font-size: 9pt; color: #003150; font-family: Verdana; mso-fareast-font-family: 瀹嬩綋; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">cron</span><span style="font-size: 9pt; color: #003150; font-family: 瀹嬩綋; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">浠誨姟錛屼嬌涓嶈兘璁劇疆</span><span lang="EN-US" style="font-size: 9pt; color: #003150; font-family: Verdana; mso-fareast-font-family: 瀹嬩綋; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">crontab</span><span style="font-size: 9pt; color: #003150; font-family: 瀹嬩綋; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">鐨勭珯鐐逛篃鑳界畝鍗曞湴瑙e喅</span><span lang="EN-US" style="font-size: 9pt; color: #003150; font-family: Verdana; mso-fareast-font-family: 瀹嬩綋; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">cron</span><span style="font-size: 9pt; color: #003150; font-family: 瀹嬩綋; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">榪愯鐨勯棶棰樸?br /> <p>A module which runs the Drupal cron operations without needing the cron application. </p> <p>For every page view, this module checks to see if the last cron run was more than 1<br /> hour ago (this period is configurable). If so, the cron hooks are executed,<br /> and Drupal is happy. These cron hooks fire after all HTML is returned to the browser,<br /> so the user who kicks off the cron jobs should not notice any delay.</p> </span><img src ="http://m.tkk7.com/rain1102/aggbug/167035.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/rain1102/" target="_blank">Eric.Zhou</a> 2007-12-11 19:58 <a href="http://m.tkk7.com/rain1102/archive/2007/12/11/167035.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Taxonomy Access Control錛堢鐞嗙敤鎴峰涓嶅悓綾誨埆鏂囩珷鐨勮闂潈闄愶級http://m.tkk7.com/rain1102/archive/2007/12/11/167031.htmlEric.ZhouEric.ZhouTue, 11 Dec 2007 11:47:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/11/167031.htmlhttp://m.tkk7.com/rain1102/comments/167031.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/11/167031.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/167031.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/167031.htmlTaxonomy Access Control:
    綆$悊鐢ㄦ埛瀵逛笉鍚岀被鍒枃绔犵殑璁塊棶鏉冮檺銆?/span>

    Access control for user roles based on taxonomy categories (vocabulary, terms).

    • Automatically controls access to taxonomy terms and nodes (based on their category terms)
    • Configuration page for each user roles
    • Five permission types (View, Update, Delete, Create, List)

    http://drupal.org/project/taxonomy_access



    Eric.Zhou 2007-12-11 19:47 鍙戣〃璇勮
    ]]>
    Smiley錛堣〃鎯呯錛?/title><link>http://m.tkk7.com/rain1102/archive/2007/12/11/167020.html</link><dc:creator>Eric.Zhou</dc:creator><author>Eric.Zhou</author><pubDate>Tue, 11 Dec 2007 11:15:00 GMT</pubDate><guid>http://m.tkk7.com/rain1102/archive/2007/12/11/167020.html</guid><wfw:comment>http://m.tkk7.com/rain1102/comments/167020.html</wfw:comment><comments>http://m.tkk7.com/rain1102/archive/2007/12/11/167020.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/rain1102/comments/commentRss/167020.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/rain1102/services/trackbacks/167020.html</trackback:ping><description><![CDATA[<span lang="EN-US" style="font-size: 9pt; color: #003150; font-family: Verdana; mso-fareast-font-family: 瀹嬩綋; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">Smiley:<br /> </span><span style="font-size: 9pt; color: #003150; font-family: 瀹嬩綋; mso-bidi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">浣跨敤琛ㄦ儏絎︼紝鑷甫浜嗕竴浜涘熀鏈殑琛ㄦ儏絎︼紝鐢ㄦ埛鍙互鑷繁娣誨姞銆?/span><img src ="http://m.tkk7.com/rain1102/aggbug/167020.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/rain1102/" target="_blank">Eric.Zhou</a> 2007-12-11 19:15 <a href="http://m.tkk7.com/rain1102/archive/2007/12/11/167020.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Excerpt錛堟憳瑕佹ā鍧楋級鍜孲ide Content錛堣竟鏍忓璇伙級http://m.tkk7.com/rain1102/archive/2007/12/11/167018.htmlEric.ZhouEric.ZhouTue, 11 Dec 2007 11:05:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/11/167018.htmlhttp://m.tkk7.com/rain1102/comments/167018.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/11/167018.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/167018.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/167018.htmlExcerpt:
    鎽樿妯″潡銆?/span>Drupal鍙戝竷鍐呭鏃跺彧鑳界敤姝f枃鐨勫紑澶翠綔鎽樿錛岀劧鍚庢牴鎹瀹氳嚜鍔ㄦ埅鍙栨憳瑕併傚惎鐢ㄦ憳瑕佹ā鍧楀氨鍙互涓嶅彈姝ら檺鍒訛紝鍙戝竷鍐呭鏃跺皢鍗曠嫭鏈変竴涓憳瑕佹爮渚涗綔鑰呴殢鎰忓~鍐欍?br /> Side Content:
    鍦ㄥ彂甯冭妭鐐瑰唴瀹規椂鍙互灝嗛儴鍒嗗唴瀹歸夋嫨鎬х殑鏄劇ず鍦ㄨ竟鏍忕殑鍖哄潡閲岋紝鍙互鐢ㄤ簬寮鴻皟鏌愰儴鍒嗗唴瀹癸紝綾諱技鏈夌殑涔︾睄鎴栨潅蹇楃殑杈規爮瀵艱銆?/span>

    Eric.Zhou 2007-12-11 19:05 鍙戣〃璇勮
    ]]>
    Working with Blockshttp://m.tkk7.com/rain1102/archive/2007/12/04/165125.htmlEric.ZhouEric.ZhouTue, 04 Dec 2007 03:50:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/04/165125.htmlhttp://m.tkk7.com/rain1102/comments/165125.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/04/165125.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/165125.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/165125.html1
    錛?/span>Understanding How Blocks Are Themed

    During a page request, the theme system will ask the block system to return a list of blocks for

    each region. It does this when generating the variables to send to the page template (usually

    page.tpl.php). To gather the themed blocks for the left and right sidebars, Drupal executes the

    following:

    $sidebar_left = theme('blocks', 'left');

    $sidebar_right = theme('blocks', 'right');

    // And any other regions exposed by hook_regions().

    You might remember that theme('blocks') is actually a call to theme_blocks(). Here’s what theme_blocks() actually does:

    function theme_blocks($region) {

    $output = '';

    if ($list = block_list($region)) {

    foreach ($list as $key => $block) {

    $output .= theme('block', $block);

    }

    }

    return $output;

    }

    2錛?/span>Using the Block Hook

    function hook_block($op = 'list', $delta = 0, $edit = array())

    <?php

    // $Id$

    /**

     * @file

     * Implements various blocks to improve pending content workflow.

     */

     

    /**

     * Implementation of hook_block().

     */

    function approval_block($op = 'list', $delta = 0, $edit = array()) {

     switch ($op) {

        case 'list':

          $blocks[0]['info'] = t('Pending comments');

          $blocks[1]['info'] = t('Unpublished nodes');

          return $blocks;

        case 'configure':

          // Only in block 0 (the Pending comments block) can one

          // set the number of comments to display.

          if ($delta == 0) {

            $form['approval_block_num_posts'] = array(

              '#type' => 'textfield',

              '#title' => t('Number of pending comments to display'),

              '#default_value' => variable_get('approval_block_num_posts', 5),

            );

          }

          return $form;

        case 'save':

          if ($delta == 0) {

            variable_set('approval_block_num_posts', (int) $edit['approval_block_num_posts']);

          }

          break;

        case 'view':

          if ($delta == 0 &&user_access('administer comments')) {

            // Retrieve the number of pending comments to display that

            // we saved earlier in the 'save' op, defaulting to 5.

            $num_posts = variable_get('approval_block_num_posts', 5);

            // Query the database for unpublished comments.

            $result = db_query_range('SELECT c.* FROM {comments} c WHERE c.status = %d ORDER BY c.timestamp', COMMENT_NOT_PUBLISHED, 0, $num_posts);

            // Preserve our current location so user can return after editing.

            $destination = drupal_get_destination();

            $items = array();

            while ($comment = db_fetch_object($result)) {

              $items[] = l($comment->subject, 'node/'. $comment->nid, array(), NULL, 'comment-'. $comment->cid). ' '. l(t('[edit]'), 'comment/edit/'. $comment->cid, array(), $destination);

            }

            $block['subject'] = t('Pending comments');

            // We theme our array of links as an unordered list.

            $block['content'] = theme('item_list', $items);

          }

          elseif ($delta == 1 && user_access('administer nodes')) {

            // Query the database for the 5 most recent unpublished nodes.

            // Unpublished nodes have their status column set to 0.

            $result = db_query_range('SELECT title, nid FROM {node} WHERE status = 0 ORDER BY changed DESC', 0, 5);

            $destination = drupal_get_destination();

            while ($node = db_fetch_object($result)) {

              $items[] = l($node->title, 'node/'. $node->nid). ' '. l(t('[edit]'), 'node/'. $node->nid .'/edit', array(), $destination);

            }

            $block['subject'] = t('Unpublished nodes');

            // We theme our array of links as an unordered list.

            $block['content'] = theme('item_list', $items);

          }

          return $block;

     }   

    }

    drupal_get_destination()

    This function remembers the page you were on before you submitted a form, so after you update the comment form to publish or delete a comment, you’ll be automatically redirected from whence you came.



    Eric.Zhou 2007-12-04 11:50 鍙戣〃璇勮
    ]]>The Theme Systemhttp://m.tkk7.com/rain1102/archive/2007/12/04/165075.htmlEric.ZhouEric.ZhouTue, 04 Dec 2007 01:29:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/04/165075.htmlhttp://m.tkk7.com/rain1102/comments/165075.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/04/165075.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/165075.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/165075.htmltheme-name_breadcrumb()

    theme-engine_ breadcrumb()

    theme_ breadcrumb()

    Defining Additional Template Files

    First, create a file within your theme directory named breadcrumb.tpl.php. This is the new template file for breadcrumbs. Because we wanted to change the <div> tag to a <span> tag, go ahead and populate the file with the following:

    <span class="breadcrumb"><?php print $breadcrumb ?></span>

    That’s easy enough for a designer to edit. Now you need to let Drupal know to call

    this template file when looking to render its breadcrumbs. Inside template.php, override theme_breadcrumb() as you did previously, but this time you’re going to tell this function to use the template file instead of just the function:

    function mytheme_breadcrumb($breadcrumb) {

     if (!empty($breadcrumb)) {

           $variables = array(

                  'breadcrumb' => implode(' -> ', $breadcrumb)

           );

           return _phptemplate_callback('breadcrumb', $variables);

     }

    }

    The magic inside this function is happening with _phptemplate_callback(). Its first parameter is the name of the template file to look for, and the second parameter is an array of variables to pass to the template file. You can create and pass along as many variables as you need into your template files.

    Defining New Block Regions

    function mytheme_regions() {

           return array(

                  'left' => t('left sidebar'),

                  'right' => t('right sidebar'),

                  'content_top' => t('content top'),

                  'content_bottom' => t('content bottom'),

                  'header' => t('header'),

                  'footer' => t('footer')

           );

    }

    To print out the content top region in your page template, use <?php print $content_top ?>.



    Eric.Zhou 2007-12-04 09:29 鍙戣〃璇勮
    ]]>Working with Nodeshttp://m.tkk7.com/rain1102/archive/2007/12/04/165071.htmlEric.ZhouEric.ZhouTue, 04 Dec 2007 01:28:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/04/165071.htmlhttp://m.tkk7.com/rain1102/comments/165071.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/04/165071.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/165071.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/165071.htmlCreating a Node Module

    1錛?/span>Creating the .info File

    Let’s also create the joke.info file and add it to the joke folder.

    ; $Id$

    name = Joke

    description = Provides a joke node type with a punchline.

    version = "$Name$"

    2錛?/span>Creating the .install File

    <?php

    function joke_install() {

           switch ($GLOBALS['db_type']) {

                  case 'mysql':

                  case 'mysqli':

                         db_query("CREATE TABLE {joke} (

                                nid int unsigned NOT NULL default '0',

                                vid int unsigned NOT NULL default '0',

                                punchline text NOT NULL,

                                PRIMARY KEY (nid,vid),

                                UNIQUE KEY vid (vid),

                                KEY nid (nid)

                         ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");

                         break;

                  case 'pgsql':

                         db_query("CREATE TABLE {joke} (

                                nid int unsigned NOT NULL default '0',

                                vid int unsigned NOT NULL default '0',

                                punchline text NOT NULL,

                                PRIMARY KEY (nid,vid),

                                UNIQUE KEY vid (vid),

                                KEY nid (nid)

                         )");

                  break;

           }

    }

    function joke_uninstall() {

           db_query('DROP TABLE {joke}');

    }

    3錛?/span>Creating the .module File

    <?php

    function joke_perm() {

           return array('create joke', 'edit joke', 'delete joke');

    }

    /**

    * @file

    * Provides a "joke" node type.

    */

    /**

    * Implementation of hook_node_info().

    */

    function joke_node_info() {

           // We return an array since a module can define multiple node types.

           // We're only defining one node type, type 'joke'.

           return array(

                  'joke' => array(

                         'name' => t('Joke'), // Required.

                         'module' => 'joke', // Required.

                         'description' => t('Tell us your favorite joke!'), // Required.

                         'has_title' => TRUE,

                         'title_label' => t('Title'),

                         'has_body' => TRUE,

                         'body_label' => t('Joke'),

                         'min_word_count' => 2,

                         'locked' => TRUE

                  )

           );

    }

    function joke_menu($may_cache) {

           $items = array();

           if ($may_cache) {

                  $items[] = array(

                         'path' => 'node/add/joke',

                         'title' => t('Joke'),

                         'access' => user_access('create joke'),

                  );

           }

           return $items;

    }

    function joke_access($op, $node) {

           global $user;

           if ($op == 'create') {

                  return (user_access('create joke'));

           }

           if ($op == 'update') {

                  return (user_access('edit joke') && ($user->uid == $node->uid));

           }

           if ($op == 'delete') {

                  return (user_access('delete joke') && ($user->uid == $node->uid));

           }

    }

    function joke_form($node) {

           // Get metadata for this node type

           // (we use it for labeling title and body fields).

           // We defined this in joke_node_info().

           $type = node_get_types('type', $node);

           $form['title'] = array(

                  '#type' => 'textfield',

                  '#title' => check_plain($type->title_label),

                  '#required' => TRUE,

                  '#default_value' => $node->title,

                  '#weight' => -5

           );

           $form['body_filter']['body'] = array(

                  '#type' => 'textarea',

                  '#title' => check_plain($type->body_label),

                  '#default_value' => $node->body,

                  '#rows' => 7,

                  '#required' => TRUE

           );

           $form['body_filter']['filter'] = filter_form($node->format);

           $form['punchline'] = array(

                  '#type' => 'textfield',

                  '#title' => t('Punchline'),

                  '#required' => TRUE,

                  '#default_value' => $node->punchline,

                  '#weight' => 5

           );

           return $form;

    }

    function joke_validate($node) {

           //Enforce a minimum word length of 3.

           if (isset($node->punchline) && str_word_count($node->punchline) <= 3) {

                  $type = node_get_types('type', $node);

                  form_set_error('punchline', t('The punchline of your @type is too short. You need at least three words.', array('@type'=> $type->name)));

           }

    }

    function joke_insert($node) {

           db_query("INSERT INTO {joke} (nid, vid, punchline) VALUES (%d, %d, '%s')",

           $node->nid, $node->vid, $node->punchline);

    }

    function joke_update($node) {

           if ($node->revision) {

                  joke_insert($node);

           } else {

                  db_query("UPDATE {joke} SET punchline = '%s' WHERE vid = %d", $node->punchline, $node->vid);

           }

    }

    /**

    * Implementation of hook_delete().

    */

    function joke_delete(&$node) {

           // Delete the related information we were saving for this node.

           db_query('DELETE FROM {joke} WHERE nid = %d', $node->nid);

    }

    /**

    * Implementation of hook_load().

    */

    function joke_load($node) {

           drupal_add_js('misc/collapse.js');

           return db_fetch_object(db_query('SELECT punchline FROM {joke} WHERE vid = %d', $node->vid));

    }

    function joke_view($node, $teaser = FALSE, $page = FALSE) {

           if (!$teaser) {

                  // Use Drupal's default node view.

                  $node = node_prepare($node, $teaser);

                  $node->guffaw = str_repeat(t('Ha!'), mt_rand(0, 10));

                  // Now add the punchline.

                  /**

                  $node->content['punchline'] = array(

                         '#value' => theme('joke_punchline', $node),

                         '#weight' => 2

                  );

                  */

           }

           if ($teaser) {

                  // Use Drupal's default node view.

                  $node = node_prepare($node, $teaser);

           }

           return $node;

    }

    function theme_joke_punchline($node) {

           $output = '<div class="joke-punchline">'.check_plain($node->punchline). '</div><br />';

           $output .= '<div class="joke-guffaw">'.check_plain($node->guffaw). '</div>';

           return $output;

    }



    Eric.Zhou 2007-12-04 09:28 鍙戣〃璇勮
    ]]>Working with Usershttp://m.tkk7.com/rain1102/archive/2007/12/03/164862.htmlEric.ZhouEric.ZhouMon, 03 Dec 2007 06:32:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/03/164862.htmlhttp://m.tkk7.com/rain1102/comments/164862.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/03/164862.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/164862.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/164862.html1錛嶪ntroduction to hook_user()

    Implementing hook_user() gives your modules a chance to react to the different operations performed on a user account, and to modify the $user object. Let’s examine the function signature:

    function hook_user($op, &$edit, &$user, $category = NULL)

    The $op parameter is used to describe the current operation being performed on the user account and can have many different values:

    • after_update: Called after the $user object has been saved to the database.

    • categories: Returns an array of categories that appear as Drupal menu local tasks when the user edits the user account. See profile_user() in profile.module for an implementation.

    • delete: A user has just been deleted from the database. This is an opportunity for the module to remove information related to the user from the database.

    • form: Inject an additional form field element into the user edit form being displayed.

    • insert: The new user account is about to be created and inserted into the database.

    • login: The user has successfully logged in.

    • logout: The user just logged out and his or her session has been destroyed.

    • load: The user account was successfully loaded. The module may add additional information into the $user object.

    • register: The user account registration form is about to be displayed. The module may add additional form elements to the form.

    • submit: The user edit form has been submitted. Modify the account information before it is sent to user_save().

    • update: The existing user account is about to be saved to the database.

    • validate: The user account has been modified. The module should validate its custom

    data and raise any necessary errors.

    • view: The user’s account information is being displayed. The module should return

    its custom additions to the display as an array. The view operation ultimately calls

    theme_user_profile to format the user profile page. More details on this shortly.

    The $edit parameter is an array of the form values submitted when a user account is being created or updated. Notice that it’s passed by reference, so any changes you make will actually change the form values.

    The $user object is also passed by reference, so any changes you make will actually change the $user information.

    The $category parameter is the active user account category being edited.

    鈻?strong>Caution Don’t confuse the $user parameter within hook_user() with the global $user object. The $user parameter is the user object for the account currently being manipulated. The global $user object is the user currently logged in.

    2.The User Registration Process

    Add a legalagree.module

    <?php

    function legalagree_user($op, &$edit, &$user, $category = NULL) {

           switch ($op) {

                  // User is registering

                  case 'register':

                         //Add a fieldset containing radio buttons to the user registration form

                         $fields['legal_agreement'] = array(

                                '#type' => 'fieldset',

                                '#title' => t('Legal Agreement')

                         );

                         $fields['legal_agreement']['decision'] = array(

                                '#type' => 'radios',

                                '#options' => array(t('I disagree'), t('I agree')),

                                '#default_value' => 0,

                                '#description' => t('By registering at %site-name, you agree that

                                at any time, we (or our surly, brutish henchmen) may enter your place of

                                residence and smash your belongings with a ball-peen hammer.',

                                array('%site-name' => variable_get('site_name', 'drupal')))

                         );

                         return $fields;

                  case 'validate':

                         // Make sure the user selected radio button 1 ('I agree').

                         // the validate op is reused when a user updates information on

                         // The 'my account' page, so we use isset() to test whether we are

                         // on the registration page where the decision field is present.

                         if (isset($edit['decision']) && $edit['decision'] != '1') {

                                form_set_error('decision', t('You must agree to the legal agreement before

                                registration can be completed.'));

                         }

                         return;

                  case 'insert':

                         // Record information for future lawsuit.

                         watchdog('user', t('User %user agreed to legal terms', array('%user' => $user->name)));

                         return;

           }

    }

    3錛嶢dding Data to the $user Object

    Loginhistory.module

    <?php

    function loginhistory_user($op, &$edit, &$account, $category = NULL) {

           switch($op) {

                  case 'login':

                         // Record timestamp in database

                         db_query("INSERT INTO {login_history} (uid, timestamp) values (%d, %d)", $account->uid, $account->login);

                         break;

                  case 'load':

                         // Add the number of times user has logged in.

                         $account->loginhistory_count = db_result(db_query("SELECT COUNT(timestamp) as count FROM {login_history} WHERE uid = %d", $account->uid));

                         break;

                  case 'view':

                         // Add a field displaying number of logins.

                         $items['login_history'] = array(

                                'title' => t('Number of logins'),

                                'value' => $account->loginhistory_count,

                                'class' => 'member'

                         );

                         return array(t('History')=>$items);

           }

    }

    Loginhistory.install

    <?php

    function loginhistory_install() {

           switch ($GLOBALS['db_type']) {

                  case 'mysql':

                  case 'mysqli':

                         db_query("CREATE TABLE {login_history} (

                                uid int NOT NULL default '0',

                                timestamp int NOT NULL default '0',

                                KEY (uid)

                         )/*!40100 DEFAULT CHARACTER SET UTF8 */");

                         break;

                  case 'pgsql':

                         db_query("CREATE TABLE {login_history} (

                                uid int_unsigned default '0',

                                timestamp int_unsigned NOT NULL default '0',

                                KEY (uid)

                         )");

                         break;

           }

    }

    function loginhistory_uninstall() {

           db_query("DROP TABLE {login_history}");

    }

    4錛嶴imple External Authentication

    Let’s implement a very simple external authentication module that might be used inside a company where simple usernames are used. Suppose your company only hires people named Dave, and usernames are assigned based on first and last names. This module authenticates anyone whose username begins with the string dave, so the users davebrown, davesmith, and davejones will all successfully log in.

    <?php

    /**

    * Implementation of hook_auth()

    */

    function authdave_auth($username, $pass, $server) {

           // Does username begin with 'dave'?

           if (substr(drupal_strtolower($username), 0, 4 ) == 'dave') {

                  // Make a global variable to note that we did the authentication.

                  global $authdave_authenticated;

                  $authdave_authenticated = TRUE;

                  return TRUE;

           }

           else {

                  return FALSE;

           }

    }

    If a row in the users table does not exist for this user, one will be created. However, no e-mail address has been provided at login like it was for Drupal’s default local user registration, so a module this simple is not a real solution if your site relies on sending e-mail to users. You’ll want to set the mail column of the users table so you will have an e-mail address associated with the user. To do this, you can have your module respond to the insert operation of the user hook, which is fired whenever a new user is inserted:

    /**

    * Implementation of hook_user()

    */

    function authdave_user($op, &$edit, &$account, $category = NULL) {

           switch($op) {

                  case 'insert':

                         // New user was just added; if we did authentication,

                         // look up email address of user in a legacy database.

                         global $authdave_authenticated;

                         if ($authdave_authenticated) {

                                $email = mycompany_email_lookup($account->name);

                                // Set email address in the user table for this user.

                                db_query("UPDATE {users} SET mail = '%s' WHERE uid = %d", $email,

                                $account->uid);

                         }

                         break;

           }

    }



    Eric.Zhou 2007-12-03 14:32 鍙戣〃璇勮
    ]]>
    Working with Databaseshttp://m.tkk7.com/rain1102/archive/2007/12/03/164780.htmlEric.ZhouEric.ZhouMon, 03 Dec 2007 02:02:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/03/164780.htmlhttp://m.tkk7.com/rain1102/comments/164780.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/03/164780.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/164780.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/164780.htmlDefining Database Parameters

    $db_url = 'mysql://username:password@localhost/databasename';

    鈻?/span>NoteIf you are in a situation where you are writing a stand-alone PHP script or you have existing PHP code outside of Drupal that needs access to Drupal’s database, you will want to want to call include_once ('includes/bootstrap.inc') and then call drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE) to generate an active connection. At that point, you can use db_query(), as explained in the next section.

    Performing Simple Queries

    db_query('SELECT * FROM {joke} WHERE vid = %d', $node->vid);

    db_query("INSERT INTO {joke} (nid, vid, punchline) VALUES (%d, %d, '%s')",

    $node->nid, $node->vid, $node->punchline);

    db_query("UPDATE {joke} SET punchline = '%s' WHERE vid = %d", $node->punchline,

    $node->vid);

    db_query('DELETE FROM {joke} WHERE nid = %d', $node->nid);

    Retrieving Query Results

    There are various ways to retrieve query results depending on whether you need a single row or the whole result set, or you are planning to get a range of results for internal use or for display as a paged result set.

    1錛?/span>Getting a Single Value

    $sql = "SELECT COUNT(*) FROM {node} WHERE type = 'blog' AND status = 1";

    $total = db_result(db_query($sql));

    2錛?/span>Getting Multiple Rows

    $sql = "SELECT * FROM {node} WHERE type = 'blog' AND status = 1";

    $result = db_query(db_rewrite_sql($sql));

    while ($data = db_fetch_object($result)) {

           $node = node_load($data->nid);

           print node_view($node, TRUE);

    }

    The preceding code snippet will print out all published nodes that are of type blog. (The status field in the node table is 0 for unpublished nodes and 1 for published nodes.) We will cover db_rewrite_sql()shortly. The db_fetch_object()function grabs a row from the result set as an object. To retrieve the result as an array, use db_fetch_array(). The practice of retrieving rows as objects is common since most developers prefer its less verbose syntax.

    3錛?/span>Getting a Limited Range of Results

    $type = 'blog';

    $status = 1;

    $sql = "SELECT * FROM {node} n WHERE type = '%s' AND status = %d ORDER BY

    n.created DESC";

    $result = db_query_range(db_rewrite_sql($sql), $type, $status, 0, 10);

    4錛?/span>Getting Results for Paged Display

    $sql = "SELECT * FROM {node} n WHERE type = 'blog' AND status = 1 ORDER BY

    n.created DESC"

    $result = pager_query(db_rewrite_sql($sql), 0, 10);

    while ($data = db_fetch_object($result)) {

    $node = node_load($data->nid);

    print node_view($node, TRUE);

    }

    // Add links to remaining pages of results.

    print theme('pager', NULL, 10);

    Although pager_query() is not really part of the database abstraction layer, it is good to know when you need to create a paged result set with navigation. A call to theme('pager') at the end will display the navigation links to the other pages. You don’t need to pass the total number of results to theme('pager') because the number of results is remembered internally from the pager_query() call.

    5錛?/span>Deleting Tables on Uninstall

    The Administer 鉃?Modules page has an Uninstall tab that not only allows modules to be disabled,but also removes their data from the database. If you want to enable the deletion of your module’s tables on this page, implement the uninstall hook in your module’s .install file. You might want to delete any variables you’ve defined at the same time.

    function annotate_uninstall() {

    db_query("DROP TABLE {annotations}");

    variable_del('annotate_nodetypes');

    }

    6錛?/span>Writing Your Own Database Abstraction Layer

    First, we make a copy of includes/database.mysql.inc and rename it as

    includes/database.dnabase.inc. Then we change the logic inside each wrapper function to map to DNAbase’s functionality instead of MySQL’s functionality. When all is said and done, we have the following functions declared in our file:

    _db_query($query, $debug = 0)

    db_affected_rows()

    db_connect($url)

    db_decode_blob($data)

    db_distinct_field($table, $field, $query)

    db_encode_blob($data)

    db_error()

    db_escape_string($text)

    db_fetch_array($result)

    db_fetch_object($result)

    db_lock_table($table)

    db_next_id($name)

    db_num_rows($result)

    db_query_range($query)

    db_query_temporary($query)

    db_result($result, $row = 0)

    db_status_report($phase)

    db_table_exists($table)

    db_unlock_tables()

    db_version()



    Eric.Zhou 2007-12-03 10:02 鍙戣〃璇勮
    ]]>
    The Menu Systemhttp://m.tkk7.com/rain1102/archive/2007/12/03/164779.htmlEric.ZhouEric.ZhouMon, 03 Dec 2007 02:01:00 GMThttp://m.tkk7.com/rain1102/archive/2007/12/03/164779.htmlhttp://m.tkk7.com/rain1102/comments/164779.htmlhttp://m.tkk7.com/rain1102/archive/2007/12/03/164779.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/164779.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/164779.htmlAccess Control

    Usually menu access is controlled by defining permissions inside the

    module using hook_perm() and testing those permissions using user_access().

    function mymenu_perm() {

           return array('receive greeting', 'receive goodbye');

    }

    function mymenu_menu($may_cache) {

           $items = array();

           if ($may_cache) {

                  // Define a static menu item.

                  $items[] = array(

                         'title' => t('Greeting'),

                         'path' => 'mymenu',

                         'weight' => -10,

                         'callback' => 'mymenu_hello',

                         'callback arguments' => array(t('Hi!'), t('Ho!')),

                         'access' => user_access('receive greeting')

                  );

                  $items[] = array(

                         'title' => t('Farewell'),

                         'path' => 'mymenu/goodbye',

                         'callback' => 'mymenu_goodbye',

                         'access' => user_access('receive goodbye')

                  );

           }

           return $items;

    }

    Assigning Callbacks Without Adding a Link to the Menu

    Often you may want to map a URL to a function without creating a visible menu item. You

    can do this by assigning the MENU_CALLBACK type to your menu item, as in this example from

    node.module:

    $items[] = array(

           'path' => 'rss.xml',

           'title' => t('RSS feed'),

           'callback' => 'node_feed',

           'access' => user_access('access content'),

           'type' => MENU_CALLBACK

    );

    Displaying Menu Items As Tabs

    In Drupal’s admittedly obscure menu lingo, a callback that is displayed as a tab is known as a

    local task and has the type MENU_LOCAL_TASK or MENU_DEFAULT_LOCAL_TASK. The title of a local

    task should be a short verb, such as “add” or “list.” Local tasks usually act on some kind of

    object, such as a node, user, or workflow.

    Local tasks must have a parent item in order for the tabs to be rendered. A common practice

    is to assign a callback to a root path like milkshake, and then assign local tasks to paths that

    extend that path, like milkshake/prepare, milkshake/drink, and so forth. Drupal has built-in

    support for two levels of tabbed local tasks.

    function milkshake_menu($may_cache) {

           $items = array();

           if ($may_cache) {

                  $items[] = array(

                         'path' => 'milkshake',

                         'title' => t('Milkshake flavors'),

                         'callback' => 'milkshake_overview',

                         'access' => TRUE

                  );

                  $items[] = array(

                         'path' => 'milkshake/list',

                         'title' => t('List flavors'),

                         'type' => MENU_DEFAULT_LOCAL_TASK, //榛樿閫変笂姝?/span>menu

                         'access' => TRUE,

                         'weight' => 0

                  );

                  $items[] = array(

                         'path' => 'milkshake/add',

                         'title' => t('Add flavors'),

                         'callback' => 'milkshake_add',

                         'type' => MENU_LOCAL_TASK,

                         'access' => TRUE,

                         'weight' => 1

                  );

                  $items[] = array(

                         'path' => 'milkshake/list/fruity',

                         'title' => t('Fruity flavors'),

                         'callback' => 'milkshake_list',

                         'type' => MENU_LOCAL_TASK,

                         'access' => TRUE,

                  );

                  $items[] = array(

                         'path' => 'milkshake/list/candy',

                         'title' => t('Candy flavors'),

                         'callback' => 'milkshake_list',

                         'type' => MENU_LOCAL_TASK,

                         'access' => TRUE,

                  );

           }

           return $items;

    }

    function milkshake_overview() {

           $output = t('The following flavors are available...');

           // ... more code here

           return $output;

    }

    function milkshake_add() {

           return t('milkshake add');

    }

    If you want the menu item to show up in the administrative menu block, you have to make

    the type a MENU_NORMAL_ITEM instead of a MENU_LOCAL_TASK. And if you want it to show up in both

    places, use the following:

    'type' => MENU_NORMAL_ITEM | MENU_LOCAL_TASK

    Programmatically Modifying Existing Menus

    1錛?/span>Wrapping Calls to Menu Items

    /**

    * Implementation of hook_menu().

    */

    function mymodule_menu($may_cache) {

           $items = array();

           if (!$may_cache && module_exist('devel')) { // Make sure devel.module is enabled.

                  $items[] = array(

                         'path' => 'devel/cache/clear', // Same path that devel.module uses.

                         'title' => t('Wrap cache clear'),

                         'callback' => 'mymodule_clear_cache',

                         'type' => MENU_CALLBACK,

                         'access' => user_access('access devel information') // Same as devel.module.

                  );

           }

    }

    function mymodule_clear_cache() {

           drupal_set_message('We got called first!');

           // Wrap the devel function normally called.

           devel_cache_clear();

    }

    2錛?/span>Deleting Existing Menus

    $items[] = array(

           'path' => 'node/add',

           'title' => t('This should not show up'),

           'callback' => 'drupal_not_found',

           'type' => MENU_CALLBACK

    );

    Adding to Existing Menus

    $items[] = array(

           'path' => 'admin/user/user/eradicate',

           'title' => t('Eradicate all users'),

           'callback' => 'mymodule_eradicate_users',

           'type' => MENU_LOCAL_TASK,

           'access' => TRUE

    );



    Eric.Zhou 2007-12-03 10:01 鍙戣〃璇勮
    ]]>
    鍒涘緩annotate modulehttp://m.tkk7.com/rain1102/archive/2007/11/29/164010.htmlEric.ZhouEric.ZhouThu, 29 Nov 2007 07:41:00 GMThttp://m.tkk7.com/rain1102/archive/2007/11/29/164010.htmlhttp://m.tkk7.com/rain1102/comments/164010.htmlhttp://m.tkk7.com/rain1102/archive/2007/11/29/164010.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/164010.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/164010.html         鍦?/span>sites/all/modules涓嬮潰鍒涘緩涓涓?/span>annotate鏂囦歡澶?/span>

    2.         鍒涘緩annotate module鐨勪俊鎭枃浠?/span>(annotate.info)

    ; $Id: annotate.info v 1.1.2.3 2007/06/18 23:06:32 dww Exp $

    name = Annotate

    description = Allows users to annotate nodes.

    package = Example

    version = 5.5

    //dependencies = node blog

    project = "annotate"

    datestamp = "1193367002"

    3.         鍒涘緩annotate module鐨勫疄闄呯殑module鍔熻兘鏂囦歡(annotate.module),鎵浠ョ殑鍔熻兘閮藉湪姝ゆ枃浠朵腑瀹氫箟.

    <?php

    // $Id$

    /**

    * @file

    * Lets users add private annotations to nodes.

    *

    * Adds a text field when a node is displayed

    * so that authenticated users may make notes.

    */

    4.         榪欐椂鍊欏埌Administer鉃?/span> Site building鉃?/span> Modules涓氨鍙互鐪嬪埌鍒氭墠娣誨姞鐨?/span>annotate妯$粍.浣嗚繖鏃跺欐縺媧誨畠鍦ㄥ鑸爮閲岄潰鏄湅涓嶅埌annotate璁劇疆鑿滃崟鐨?/span>.

    5.         瀹炵幇Hook(閽╁瓙),娣誨姞涓涓嬩唬鐮?/span>,閲嶆柊嬋媧?/span>annotate妯$粍,榪欐牱灝卞彲浠ョ湅鍒板湪Administer鉃?/span> Site configuration涓嬪浜嗕竴涓?/span>Annotation settings鑿滃崟

    /**

    * Implementation of hook_menu().

    */

    function annotate_menu($may_cache) {

        $items = array();

        if ($may_cache) {

                  $items[] = array(

                  'path' => 'admin/settings/annotate',

                  'title' => t('Annotation settings'),

                  'description' => t('Change how annotations behave.'),

                  'callback' => 'drupal_get_form',

                  'callback arguments' => array('annotate_admin_settings'),

                  'access' => user_access('administer site configuration')

                  );

           }

           return $items;

    }

    6.         涓婇潰鏈夎'callback' => 'drupal_get_form'浠g爜,榪樻湁涓琛?/span> 'callback arguments' => array('annotate_admin_settings'). 榪欓噷褰撶敤鎴烽氳繃http://www.example.com/?q=admin/settings/annotate璁塊棶鐨勬椂鍊?/span>,灝嗕細璋冪敤drupal_get_form()鍑芥暟,騫朵笖閫氳繃瀹冪殑form ID annotate_admin_settings鏉ヨ皟鐢?/span>annotate_admin_settings()鍑芥暟.鎵浠ユ垜浠鑷繁瀹氫箟榪欎釜鏂規硶.

    /**

    * Define the settings form.

    */

    function annotate_admin_settings() {

           $form['annotate_nodetypes'] = array(

                  '#type' => 'checkboxes',

                  '#title' => t('Users may annotate these node types'),

                  '#options' => node_get_types('names'), //榪斿洖鎵鏈?/span>node綾誨瀷緇勬垚鐨勬暟緇?/span>

                  '#default_value' => variable_get('annotate_nodetypes', array('story')),

                  '#description' => t('A text field will be available on these node types to make

                  user-specific notes.'),

           );

           $form['array_filter'] = array('#type' => 'hidden');

           return system_settings_form($form);

    }

    7.         瀹炵幇hook_nodeapi(),褰?/span>Drupal瀵?/span>node鍋氬悇縐嶅悇鏍風殑鎿嶄綔鐨勬椂鍊欏璋冪敤姝ゅ嚱鏁?/span>.

    /**

    * Implementation of hook_nodeapi().

    */

    function annotate_nodeapi(&$node, $op, $teaser, $page) {

           switch ($op) {

                  case 'view':

                         global $user;

                         // If only the node summary is being displayed, or if the

                         // user is an anonymous user (not logged in), abort.

                         if ($teaser || $user->uid == 0) {

                                break;

                         }

                         $types_to_annotate = variable_get('annotate_nodetypes', array('story'));

                         if (!in_array($node->type, $types_to_annotate)) {

                                break;

                         }

                         // Add our form as a content item.

                         $node->content['annotation_form'] = array(

                                '#value' => drupal_get_form('annotate_entry_form', $node),

                                '#weight' => 10

                         );

           }

    }

    8.         涓嬮潰鎴戜滑瑕佸畾涔?/span>annotate form,浣滀負欏甸潰鐜板疄鍐呭

    /**

    * Define the form for entering an annotation.

    */

    function annotate_entry_form($node) {

           $form['annotate'] = array(

                  '#type' => 'fieldset',

                  '#title' => t('Annotations')

           );

           $form['annotate']['nid'] = array(

                  '#type' => 'value',

                  '#value' => $node->nid

        );

           $form['annotate']['note'] = array(

                  '#type' => 'textarea',

                  '#title' => t('Node'),

                  '#default_value' => $node->annotation,

                  '#description' => t('Make your personal annotations about this content

    here. Only you (and the site administrator) will be able to see them.')

           );

           $form['annotate']['submit'] = array(

                  '#type' => 'submit',

                  '#value' => t('Update')

           );

           return $form;

    }

    9.         鍒扮洰鍓嶄負姝㈠浜?/span>annotate鐨勫唴瀹規垜浠繕鏈夊仛澶勭悊.浠庤繖閲屽紑濮?/span>,鎴戜滑灝辮鎶?/span>annotate鐨勬暟鎹瓨鍌ㄥ埌鏁版嵁搴撻噷闈?/span>,寰堝module閲岄潰閮芥湁.install鏂囦歡,璇ユ枃浠跺氨鏄垱寤烘暟鎹簱琛ㄦ枃浠?/span>.鎴戜滑瑕佸垱寤轟竴涓?/span>annotate.install鏂囦歡

    <?php

    // $Id$

    function annotate_install() {

           drupal_set_message(t('Beginning installation of annotate module.'));

           switch ($GLOBALS['db_type']) {

                  case 'mysql':

                  case 'mysqli':

                         db_query("CREATE TABLE annotations (

                                uid int NOT NULL default 0,

                                nid int NOT NULL default 0,

                                note longtext NOT NULL,

                                timestamp int NOT NULL default 0,

                                PRIMARY KEY (uid, nid)

                                ) /*!40100 DEFAULT CHARACTER SET utf8 */;"

                         );

                         $success = TRUE;

                         break;

                  case 'pgsql':

                         db_query("CREATE TABLE annotations (

                                uid int NOT NULL DEFAULT 0,

                                nid int NOT NULL DEFAULT 0,

                                note text NOT NULL,

                                timestamp int NOT NULL DEFAULT 0,

                                PRIMARY KEY (uid, nid)

                                );"

                         );

                         $success = TRUE;

                         break;

                  default:

                         drupal_set_message(t('Unsupported database.'));

           }

           if ($success) {

                  drupal_set_message(t('The module installed tables successfully.'));

           } else {

                  drupal_set_message(t('The installation of the annotate module was unsuccessful.'),'error');

           }

    }

    10.     榪欓噷瑕佸埌鏁版嵁搴?/span>system琛ㄩ噷鎶?/span>annotate緇欏垹浜?/span>,鐒跺悗閲嶆柊嬋媧?/span>annotate妯$粍.娣誨姞鎻愪氦浜嬩歡.

    /*

    * Save the annotation to the database.

    */

    function annotate_entry_form_submit($form_id, $form_values) {

           global $user;

           $nid = $form_values['nid'];

           $note = $form_values['note'];

           db_query("DELETE FROM {annotations} WHERE uid = %d and nid = %d", $user->uid, $nid);

           db_query("INSERT INTO {annotations} (uid, nid, note, timestamp) VALUES (%d, %d, '%s', %d)", $user->uid, $nid, $note, time());

           drupal_set_message(t('Your annotation was saved.'));

    }

    11.     涓轟簡瀹炵幇鍦ㄧ幇瀹?/span>annotate鐨勬椂鍊欒鍙栨暟鎹簱閲岄潰鐨勬暟鎹幇瀹?/span>,榪欓噷瑕佷慨鏀逛竴涓嬪墠闈㈢殑hook_nodeapi鍑芥暟.淇敼浠ュ悗鐨勪負:

    /**

    * Implementation of hook_nodeapi().

    */

    function annotate_nodeapi(&$node, $op, $teaser, $page) {

           switch ($op) {

                  case 'view':

                         global $user;

                         // If only the node summary is being displayed, or if the

                         // user is an anonymous user (not logged in), abort.

                         if ($teaser || $user->uid == 0) {

                                break;

                         }

                         $types_to_annotate = variable_get('annotate_nodetypes', array('story'));

                         if (!in_array($node->type, $types_to_annotate)) {

                                break;

                         }

                         // Get previously saved note, if any.

                         $result = db_query("SELECT note FROM {annotations} WHERE uid = %d AND nid = %d", $user->uid, $node->nid);

                         $node->annotation = db_result($result);

                         // Add our form as a content item.

                         $node->content['annotation_form'] = array(

                                '#value' => drupal_get_form('annotate_entry_form', $node),

                                '#weight' => 10

                         );

           }

    }

    榪欐牱鍦ㄩ噸鏂版縺媧諱嬌鐢ㄤ竴涓嬪氨鍙互浜?/span>!



    Eric.Zhou 2007-11-29 15:41 鍙戣〃璇勮
    ]]>
    鎶婄帺Drupal妯$祫錛?Hook System閬嬩綔綈′粙 http://m.tkk7.com/rain1102/archive/2007/11/29/163972.htmlEric.ZhouEric.ZhouThu, 29 Nov 2007 05:23:00 GMThttp://m.tkk7.com/rain1102/archive/2007/11/29/163972.htmlhttp://m.tkk7.com/rain1102/comments/163972.htmlhttp://m.tkk7.com/rain1102/archive/2007/11/29/163972.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/163972.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/163972.html閫變簩, 2006-05-09 20:07 鈥?jimmy
    妯$祫緋葷當鏄痙rupal寰堥噸瑕佺殑閬嬩綔鏂瑰紡錛宒rupal渚濋潬钁楀皯灝戠殑鏍稿績紼嬪紡錛屼究鑳借畵妯$祫鑳藉仛鍒頒換浣曚簨鎯呫?/p>

    drupal鍙湁21鍊嬫獢妗堝湪include瑁¢牠錛屾瘡嬈″繀鏈僱oading閫蹭締錛屽叾浠栫殑鍏ㄩ兘鏀懼湪modules銆?br /> 涔熷氨鏄錛岄櫎浜嗛偅騫鵑毣妾旀浠ュ錛屽叏閮ㄧ殑鏉辮タ閮芥妸浠栫暥鎴恗odule鍦ㄥ銆傝濡侰MS鏈鍩烘湰鐨勫姛鑳斤紝鏂囩珷綆$悊銆佽⿻璜栥佽◣璜栧崁銆佸垎欏?..絳夌殑鍔熻兘錛屽叏閮ㄩ兘瀵湪module瑁★紝include瑁¢牠鎵鎻愪緵鐨勬槸鍚勭óapi錛屾獢妗堣檿鐞嗗嚱寮忋佽硣鏂欏韓瀛樺彇銆佽〃鍠敓鎴?..絳夌瓑錛岄欐ǎ鐨勫垎灞わ紝module渚垮彲浠ュ皥蹇冪殑闁嬬櫦鍚勭ó鍔熻兘銆?/p>

    鐣剁劧錛岄欐ǎ鐨勬灦妲嬩笉澶犱護浜烘敞鐩傛湁璦卞web app鏋舵錛屽皪鏂兼ā緄?錛坢odule錛夈佹彃浠訛紙plug-in錛?..絳夌殑閬嬩綔錛岄氬父鏄畵浠栧戝悇鑷偤鏀匡紝鑷繁騫硅嚜宸辯殑浜嬫儏銆傚鏄敤鏍稿績鎻愪緵鐨刼bject鍜宖unction錛屽姞涓妋odule鑷繁欏嶅鐨刢ode錛岄仈鍒癿odule瑕佸仛鍒扮殑欏嶅鍔熻兘銆備絾鏄痙rupal鐨勬牳蹇冮亱浣滃嵒涓嶆槸濡傛銆?/p>

    drupal铏曠悊浣跨敤鐨勭▼寮忕偤modules/user.module銆傚鏋滀粖澶╂兂瑕佸湪鐪嬩嬌鐢ㄨ呰硣鏂欑殑鍚屾檪錛屼篃鎯崇湅鐪嬫墍鏈変嬌鐢ㄨ呴亷鍘葷櫦琛ㄦ枃绔犵殑list錛岄偅瑭叉庨杭瀵憿錛?/p>

    鐩存帴涓榛?/strong>錛屾洿鏀箄ser.modue錛屽湪欏ず鏅傦紝闋嗕究鍘繪枃绔犺硣鏂欏韓鎶撶浉闂滅殑璩囨枡錛熺劧鑰岄欐ǎ鍗諱笉鏄竴鍊嬪ソ鏂瑰紡錛屼粖澶╀換浣曟兂瑕佸皪浣跨敤鑰呭鍔犳柊鍔熻兘鐨勬檪鍊欙紝閮藉緱trace涓嬈ser.module鐨刢ode錛岀湅鎳備粬鍦ㄥ構鍟ワ紝鐒跺緦鎶婃柊鐨刢ode瀹夋彃鍦ㄥ悎閬╃殑鍦版柟... 鏈寰屽彲鑳藉鍔爑ser.module鐨勮闆滃害錛屽鍔犵董璀烽偅鏀痬odule鐨勯洠搴︼紝鍏卞悓闁嬬櫦鏅傦紝鏇存槸涓鍊嬪嵄闅殑鏂瑰紡銆?/p>

    絎簩紼柟寮?/strong>錛岄噸瀵竴鍊嬫柊鐨勭忚闋侀潰錛岄噸鏂板涓鍊婼ELECT鐨勮獮鍙ワ紝璁揝ELECT鐨勬檪鍊欓櫎浜嗕嬌鐢ㄨ呰硣璦婏紝涔熸妸鏂囩珷璩囨枡涓璧鋒姄鍑轟締錛岀劧寰岄’紺哄埌涓嶅悓鐨勯爜闈€備絾鏄欐ǎ寰堟氮璨伙紝鏄庢槑璺焨ser.module閲嶈鐨勫姛鑳介仈鍒頒竴鍗婁互涓婏紝閭f槸涓嶆槸涔嬪緦瑕佹柊澧炲姛鑳斤紝閮藉緱閲嶅涓嬈″憿錛?/p>

    涓婇潰鍏╃ó鏂瑰紡鍦╠rupal涓篃閮藉彲浠ラ仈鎴愶紝鐒惰岀啛鎮塂rupal鐨勪漢鍗諱笉鏈冨姝ゃ侱rupal鐨勯枊鐧艱呭緢鑱版槑錛屼粬鐨勬ā緄勭郴緄憋紙module system錛夎冩叜鍒頒簡妯$祫鍐嶅埄鐢ㄩ欎竴榛烇紝姣忓嬫ā緄勯兘瑕栫偤鍙互鍐嶅埄鐢ㄧ殑璩囨簮錛屽彧瑕佸module鐨勪漢鎯沖錛岄忛亷妯$祫緋葷當渚垮彲浠ヨ窡鎵鏈夌殑module浜や簰浣滅敤銆?/p>

    絎笁紼柟寮?/strong>浠?code>modules/user.module鐐轟緥錛屼粬鍗蟲槸铏曠悊鍖呭惈鏂板銆佷慨鏀廣佸埅闄ゃ佽ɑ鍐娿佺櫥鍏?...絳夋墍鏈夎垏浣跨敤鑰呯浉闂滅殑鍔熻兘銆傚湪閫茶姣忓嬮噸瑕佺殑鍔熻兘鏅傦紝user.module閮芥渻鍛煎彨涓鍊嬪嚱寮忓幓鎺冩墍鏈夌殑module錛岀湅鐪嬫槸鍚︽湁鍏朵粬鐨刴odule瑕佸湪user.module閫茶姝ゅ嫊浣滄檪錛屼篃閫茶涓浜涘叾浠栨兂瑕佸仛鐨勪簨鎯咃紝閫欏氨鏄痙rupal閲嶈鐨?a rel="nofollow">Hook System銆?br /> example:
    鍦╠rupal user.module瑁¢牠鍙互鎵懼埌濡備笅鐨勭▼寮忕⒓

    function user_view($uid = 0) {
    // ... skip
    // moudle_invoke鎺冩弿鎵鏈夌殑module
    // 鐪嬬湅鏈夋矑鏈塵odulename_user閫欏媐unction
    // 鏈夊嬭┍灝辯湅'view'閫欏嬪姛鑳界殑閮ㄤ喚瑕佸姞涓婁粈楹?
    foreach (module_list() as $module) {
    if ($data = module_invoke($module, 'user', 'view', '', $account)) {
    // do something...
    }
    }
    // ... skip
    }
    

    鎵浠ワ紝絎笁紼柟寮忥紝涓嶇敤閲嶅錛屼篃涓嶇敤鏀瑰埌user.module錛屽彧瑕佽嚜宸辨柊澧瀖odule鍜屽涓鍊媐unction錛屼究鍙互杓曢瑔璁撶忚浣跨敤鑰呰硣璦婃檪錛屽姞涓婇亷寰鏂囩珷銆?br /> example:
    鏂板鑷繁鐨刴odule錛岃垏hook system綬婂瘑閬嬩綔
    鏂板sample.module

    function sample_user($type, &$edit, &$user, $category = NULL) {
    if ($type == 'view') {
    return /*閬庡線鏂囩珷錛屽瀷鍒ョ偤涓闄e垪*/;
    }
    }
    

    閫欏氨鏄痙rupal鎶婄溇澶氫富瑕佸姛鑳介兘瀵垚module鐨勫師鍥狅紝璁撴墍鏈夋ā緄勪箣闁撻兘鍙互浜や簰鍒╃敤錛屾垨鏄緄﹀垾浜哄埄鐢紝鎴栨槸鍒╃敤鍒ヤ漢鐨刴odule錛屽儚絀嶆湪涓妯f帹鐮屾垚鎯寵鐨勫姛鑳斤紝鍗誨張涓嶆氮璨昏硣婧愩?/p>

    鍙冭冭硣婧愶細
    瑭崇窗鐨勭敤娉曞湪錛?br /> http://drupaldocs.org/api/head/function/hook_user
    Module developer's guide錛?br /> http://drupal.org/node/508



    Eric.Zhou 2007-11-29 13:23 鍙戣〃璇勮
    ]]>
    妯″潡浠嬬粛錛歫Ratinghttp://m.tkk7.com/rain1102/archive/2007/11/29/163956.htmlEric.ZhouEric.ZhouThu, 29 Nov 2007 03:49:00 GMThttp://m.tkk7.com/rain1102/archive/2007/11/29/163956.htmlhttp://m.tkk7.com/rain1102/comments/163956.htmlhttp://m.tkk7.com/rain1102/archive/2007/11/29/163956.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/163956.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/163956.html綆浠嬶細
    榪欎釜妯″潡浣跨敤 jQuery 鎶鏈負鑺傜偣鎻愪緵璇勫垎鍔熻兘錛屽綋 javascript 琚姝㈡椂錛屼嬌鐢ㄦ爣鍑嗗艦寮忥紝濡傛灉鍚敤 javascript 灝卞彲浠ラ氳繃鍥劇墖 (濡備簲鏄? 鍔ㄦ佽繘琛岃瘎鍒嗐?

     

    榪欎釜妯″潡鑳藉涓?views 妯″潡鍗忎綔錛屽畠鎻愪緵涓涓?views 瀛楁錛岃璇勫垎緇撴灉鍙互閫氳繃 views 鏄劇ず銆?

     

    閾炬帴錛?/strong>

     

    http://drupal.org/project/jrating


    Eric.Zhou 2007-11-29 11:49 鍙戣〃璇勮
    ]]>
    Drupal鐨凜aptchahttp://m.tkk7.com/rain1102/archive/2007/11/29/163957.htmlEric.ZhouEric.ZhouThu, 29 Nov 2007 03:49:00 GMThttp://m.tkk7.com/rain1102/archive/2007/11/29/163957.htmlhttp://m.tkk7.com/rain1102/comments/163957.htmlhttp://m.tkk7.com/rain1102/archive/2007/11/29/163957.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/163957.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/163957.html澶у鍦ㄨ闂垜鐨勫崥瀹㈢暀璦鐨勬椂鍊欙紝鎬繪槸浼氬彂鐜版湁涓涓?#8220;鑰冭冩櫤鍟?#8221;錛屽緢澶氫漢鍜屾垜璇達紝“榪欎釜澶井杈辨垜鐨勬櫤鍟嗕簡錛?#8221;錛屽叾瀹炶繖涓鐩彧鏄拰澶у寮涓涓帺絎戯紝浣嗘槸鏀捐繖涓殑鐪熸鐩殑鏄負浜嗛槻spam銆?br /> 鍟ユ槸Sapm鍛紵鐧懼害鐧劇鐨勮В閲婃槸錛?br /> -----------------------------------
    SPAM鏄痵tupid person advertesing method鐨勭畝縐?鎰忔濅負鍏滃敭淇℃伅[閭歡錛屽箍鍛婏紝鏂伴椈錛屾枃绔燷錛岄潪绱㈣淇℃伅銆傚熀鏈笌鍨冨溇閭歡錛坖unk mail錛夊悓涔?/p>

    鍗蟲槸鎸囧湪Internet涓婂埄鐢‥mail榪涜騫挎挱寮忕殑騫垮憡瀹d紶鐨勮涓恒傝繖縐嶈涓虹粰寰堝浜虹殑淇$閲屽鍏ュぇ閲忔棤鍏蟲垨鏃犵敤鐨勪俊鎭紝鍥犳瓚婃潵瓚婂彈鍒頒漢浠殑鍘屾伓錛屽湪緹庡浗榪欏凡緇忓睘闈炴硶琛屼負銆?/p>

    Spam鏈鍒濇潵鍘?
    spam鍗砈PAM錛屽師鏄竴涓綈瑁呰倝鐨勭墝瀛愩傚浜庤繖涓墝瀛愬悕瀛楃殑鏉ユ簮鏈夊緢澶氳В閲婏紝瀹樻柟鐗堟湰璇達紝瀹冩槸”Specially Processed Assorted Meat”鐗規畩鍔犲伐榪囩殑娣峰拰鑲夈?br /> 榪欑SPAM鑲夋湁孌墊椂闂撮潪甯告櫘鍙婏紝鍒頒簡鏃犲涓嶅湪錛屼護浜鴻鍘岀殑紼嬪害銆傚悗鏉ワ紙1970騫達級Monty Python鍓у洟鏈変釜寰堟祦琛岀殑Sketch comedy錛堜竴縐嶇煭灝忕殑緋誨垪鍠滃墽錛夊彨Spam錛屽墽涓袱浣嶉【瀹㈣瘯鍥劇偣涓浠芥病鏈塖PAM鐨勬棭槨愶紝浣嗘渶鍚庡嵈娌¤兘鎴愬姛銆?br /> 浜庢槸錛岃澶氬勾鍚庣殑鐜板湪錛孲pam琚敤鏉ョ粺縐頒簰鑱旂綉涓婂埌澶勬暎甯冨瀮鍦懼箍鍛婃秷鎭殑鐜拌薄
    -------------------------
    鍏跺疄璇寸櫧浜嗗氨鏄嬌鐢ㄨ嚜鍔ㄥ寲鐨勫伐鍏鳳紝鍦ㄧ綉涓婃壒閲忕殑鍙戝竷涓浜涘箍鍛婁俊鎭紝鐢‥mail錛屾垨鑰呰鍧涳紝鎴栬呭崥瀹€?br /> 鐜板湪璁哄潧鍦ㄥ彂甯栫殑鏃跺欙紝閮戒細鏈夐獙璇佺爜涔嬬被鐨勶紝涔熸槸涓轟簡闃叉Spam銆?br /> Drupal浣滀負鎴愮啛鐨凜MS錛岃嚜鐒舵湁寰堝浜哄鍏惰繘琛孲pam楠氭壈錛岃孌rupal涔熸湁寰堝鐨勬彃浠跺弽Spam銆?/p>

    鏈甯哥敤鐨勬槸Captcha妯″潡銆?br /> 瀹夎濂紺aptcha妯″潡浠ュ悗錛屾垜浠細鍦ㄧ敤鎴風鐞嗙洰褰曚笅鎵懼埌涓涓狢aptcha綆$悊銆傝繖涓鐞嗙湅璧鋒潵寰堢畝鍗曪紝鍙湁綆綆鍗曞崟鐨勫嚑欏廣?/p>

    絎竴欏圭殑鎰忔濇槸錛屽湪鏈塧dmin captcha鏉冮檺鐨勭敤鎴風殑Form涓嬮潰鍔犱笂Captcha綆$悊閾炬帴銆傝繖鏍蜂竴鑸鍕句笂錛岃繖鏍風殑璇濓紝浣犲氨鍙互鏂逛究鐨勪慨鏀規瘡涓澶勮鍔燙aptcha鐨勫湴鏂逛簡銆?br /> 鎺ヤ笅鏉ョ殑閫夐」灝辨槸璁劇疆鍚勪釜鍦版柟鐨凜aptcha銆傚浜嶤aptcha榪樻湁寰堝鐩稿叧鐨勬ā鍧楋紝澶у鍙互鍘籇rupal涓婃煡鍒般傛湁寰堝縐嶏紝姣斿鍥劇墖錛屾瘮濡傜畻鏈紝榪樻湁Riddler鍙互璁劇疆涓浜涢棶棰橈紝姣斿涓騫存湁鍑犱釜鏈堜箣綾葷殑銆傚彲浠ュ姣忎竴涓狢aptcha Point璁劇疆涓縐岰aptcha媯鏌ユ柟娉曘?br /> 鍦ㄨ繖閲岋紝瑕佹敞鎰忕殑鍦版柟鏄紝濡傛灉鎯沖鍔犱竴涓狢aptcha Point鐨勮瘽錛屽氨瑕佹妸絎竴欏規墦鍕撅紝鐒跺悗浠ョ鐞嗗憳韜喚鍘諱綘瑕佹坊鍔燙aptcha鐨凢orm錛屼笅闈細鏈変竴涓摼鎺ワ紝鐐逛竴涓嬪氨濂戒簡銆傝繖涓綋鏃舵垜鎵句簡濂戒箙錛屾渶濂介煎埌浜嗙湅浜咰aptcha浠g爜錛屽噯澶囧幓淇敼鏁版嵁搴撶殑鏃跺欐墠鍙戠幇錛屽懙鍛點?br /> 涓嬮潰灝辨槸涓浜涙弿榪幫紝榪樻湁鍙︿竴涓夐」錛岄変笂浠ュ悗錛岀敤鎴烽渶瑕佸湪姣忎竴嬈¤緭鍏ョ殑鏃跺欓兘杈撳叆Captcha銆?br /> 鎴戜滑鐪嬪埌Captcha榪樻湁寰堝鍏朵粬鐨勮緗俊鎭紝姣斿鍥劇墖媯鏌ヨ緗紝Riddler璁劇疆錛岄兘姣旇緝綆鍗曪紝鐐瑰嚑涓嬪氨鏄庣櫧浜嗐?br /> 瀵逛簬Captcha鐨勬潈闄愶紝鏈変互涓嬩袱涓細涓涓槸綆$悊Captcha錛屼竴涓槸璺寵繃Captcha媯鏌ャ?/p>

    Eric.Zhou 2007-11-29 11:49 鍙戣〃璇勮
    ]]>
    E-Mail field(cck閭歡鏍忎綅)http://m.tkk7.com/rain1102/archive/2007/11/28/163796.htmlEric.ZhouEric.ZhouWed, 28 Nov 2007 12:18:00 GMThttp://m.tkk7.com/rain1102/archive/2007/11/28/163796.htmlhttp://m.tkk7.com/rain1102/comments/163796.htmlhttp://m.tkk7.com/rain1102/archive/2007/11/28/163796.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/163796.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/163796.html榪欎釜妯″潡浼氫負cck澧炲姞涓涓仛鍚堟爮浣嶏紝鐢ㄦ埛鍙互鍦ㄩ偅鍎挎坊鍔爁eed錛岃繖涓猣eed浼氬姞鍏ュ埌鍏ㄧ珯鑱氬悎閲屻?br /> 瀹樻柟鍙戝竷欏碉細 http://drupal.org/project/feedfield



    Eric.Zhou 2007-11-28 20:18 鍙戣〃璇勮
    ]]>
    CCK Field Permissions(cck鏍忎綅鏉冮檺)http://m.tkk7.com/rain1102/archive/2007/11/28/163794.htmlEric.ZhouEric.ZhouWed, 28 Nov 2007 12:07:00 GMThttp://m.tkk7.com/rain1102/archive/2007/11/28/163794.htmlhttp://m.tkk7.com/rain1102/comments/163794.htmlhttp://m.tkk7.com/rain1102/archive/2007/11/28/163794.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/163794.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/163794.html 姣斿浣跨敤video_cck(cck瑙嗛鏍忎綅)緇欎竴涓被鍨嬬殑node娣誨姞涓涓獀ideo field錛岃繖鏃跺欏氨鍙互鎺у埗涓浜涚敤鎴峰彲浠ユ坊鍔犺棰戯紝涓浜涗笉鍙互娣誨姞瑙嗛銆備嬌鐢–CK Field Permissions錛屽紑鍚互鍚庡埌Administer->Site configuration->CCK Field Permissions鏉ヨ緗鍝簺node璧蜂綔鐢紝鐒跺悗璁劇疆姣忎釜node鐨刦ields錛佹兂閫氳繃CCK Field Permissions鎺у埗鐨勫氨鎵撳嬀錛佷繚瀛橈紒鐒跺悗鍒癠ser management->Access control閲岄潰璁劇疆鎺у埗錛?br />
    涓嬭澆鍦板潃錛?a >http://drupal.org/project/cck_field_perms

    Eric.Zhou 2007-11-28 20:07 鍙戣〃璇勮
    ]]>
    video_cck(cck瑙嗛鏍忎綅)http://m.tkk7.com/rain1102/archive/2007/11/28/163790.htmlEric.ZhouEric.ZhouWed, 28 Nov 2007 11:55:00 GMThttp://m.tkk7.com/rain1102/archive/2007/11/28/163790.htmlhttp://m.tkk7.com/rain1102/comments/163790.htmlhttp://m.tkk7.com/rain1102/archive/2007/11/28/163790.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/163790.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/163790.html榪欎釜妯″潡鎻愪緵涓涓濯掍綋鏍忎綅錛屽彧瑕佸~鍏ヨ棰戠綉鍧錛屽嵆鍙嚜鍔ㄦ挱鏀俱傜洰鍓嶉粯璁ゆ敮鎸佸ぇ澶氭暟鑻辮瑙嗛緗戠珯錛屽錛歽outube銆傜◢鍋氫慨鏀癸紝涔熷彲浠ユ敮鎸佸浗鍐呰棰戠綉绔欑殑瑙嗛銆?/p> 闇瑕佺粨鍚圕CK妯″潡涓璧蜂嬌鐢紒
    鍚姩浠ュ悗鍒?Administer->Content management->Video CCK configuration涓嬭緗敮鎸佸摢浜涚綉绔欒棰戯紒
    涓嬭澆鍦板潃錛歨ttp://drupal.org/project/video_cck


    Eric.Zhou 2007-11-28 19:55 鍙戣〃璇勮
    ]]>
    ApacheBench(ab)鍜宔Accelerator浣跨敤閰嶇疆http://m.tkk7.com/rain1102/archive/2007/11/28/163757.htmlEric.ZhouEric.ZhouWed, 28 Nov 2007 09:33:00 GMThttp://m.tkk7.com/rain1102/archive/2007/11/28/163757.htmlhttp://m.tkk7.com/rain1102/comments/163757.htmlhttp://m.tkk7.com/rain1102/archive/2007/11/28/163757.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/163757.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/163757.htmlApacheBench(ab)

    鏈嶅姟鍣ㄨ礋杞藉お澶ц屽獎鍝嶇▼搴忔晥鐜囦篃鏄緢甯歌鐨勶紝Apache鏈嶅姟鍣ㄨ嚜甯︽湁涓涓彨AB(ApacheBench)鐨勫伐鍏鳳紝鍦╞in鐩綍涓嬨備嬌鐢ㄨ繖涓交宸х殑宸ュ叿鎴戜滑鍙互瀵規湇鍔″櫒榪涜璐熻澆嫻嬭瘯錛?br />
    鍩烘湰鐢ㄦ硶:

    ab -n 鍏ㄩ儴璇鋒眰鏁?-c 騫跺彂鏁?嫻嬭瘯url


    渚?ab -n 1000 -c 50 http://www.abc.com/a.php

    寰楀埌緇撴灉綾諱技浜?鍚庨潰棰滆壊瀛椾負涓枃緲昏瘧):

    Server Software:        Apache/2.0.55
    Server Hostname:        localhost
    Server Port:            80

    Document Path:          /1.php
    Document Length:        82522 bytes  #璇鋒眰鏂囨。澶у皬

    Concurrency Level:      50           #騫跺彂鏁? 
    Time taken for tests:   92.76140 seconds #鍏ㄩ儴璇鋒眰瀹屾垚鑰楁椂
    Complete requests:      10000          #鍏ㄩ儴璇鋒眰鏁?br /> Failed requests:        1974           #澶辮觸鐨勮姹?br />   (Connect: 0, Length: 1974, Exceptions: 0)
    Write errors:           0
    Total transferred:      827019400 bytes #鎬諱紶杈撳ぇ灝?br /> HTML transferred:       825219400 bytes
    Requests per second:    108.61 [#/sec] (mean) #姣忕璇鋒眰鏁?騫沖潎)
    Time per request:       460.381 [ms] (mean) #姣忔騫跺彂璇鋒眰鏃墮棿(鎵鏈夊茍鍙?
    Time per request:       9.208 [ms] (mean, across all concurrent requests)  #姣忎竴璇鋒眰鏃墮棿(騫跺彂騫沖潎)  
    Transfer rate:          8771.39 [Kbytes/sec] received #浼犺緭閫熺巼

    Connection Times (ms) #榪炴帴鏃墮棿
                 min  mean[+/-sd] median   max
    Connect(#榪炴帴):        0    0   2.1      0      46
    Processing(#澶勭悊):    31  458  94.7    438    1078
    Waiting(#絳夊緟):       15  437  87.5    422     938
    Total:         31  458  94.7    438    1078


    鍏跺畠鍙傛暟:

    -n requests     鍏ㄩ儴璇鋒眰鏁?br /> -c concurrency  騫跺彂鏁?br /> -t timelimit    鏈浼犵瓑寰呭洖搴旀椂闂?br /> -p postfile     POST鏁版嵁鏂囦歡
    -T content-type POST Content-type
    -v verbosity    How much troubleshooting info to print
    -w              Print out results in HTML tables
    -i              Use HEAD instead of GET
    -x attributes   String to insert as table attributes
    -y attributes   String to insert as tr attributes
    -z attributes   String to insert as td or th attributes
    -C attribute    鍔犲叆cookie, eg. 'Apache=1234. (repeatable)
    -H attribute    鍔犲叆http澶? eg. 'Accept-Encoding: gzip'
                    Inserted after all normal header lines. (repeatable)
    -A attribute    http楠岃瘉,鍒嗛殧浼犻掔敤鎴峰悕鍙婂瘑鐮?br /> -P attribute    Add Basic Proxy Authentication, the attributes
                    are a colon separated username and password.
    -X proxy:port   浠g悊鏈嶅姟鍣?br /> -V              鏌ョ湅ab鐗堟湰
    -k              Use HTTP KeepAlive feature
    -d              Do not show percentiles served table.
    -S              Do not show confidence estimators and warnings.
    -g filename     Output collected data to gnuplot format file.
    -e filename     Output CSV file with percentages served
    -h              Display usage information (this message)


    About eAccelerator
    eAccelerator鏄竴涓殑鍏嶈垂銆佸紑婧愮殑PHP妯″潡錛屽畠鑳藉涓烘彁渚汸HP鍔犻熴佷紭鍖栥佸姞鐮併佸拰鍔ㄦ佸唴瀹圭紦瀛樺姛鑳姐傚畠閫氳繃瀛樺偍PH鑴氭湰緙栬瘧鍚庣殑鐘舵佽屽姞蹇墽琛孭HP鑴氭湰鐨勯熷害錛岃屼笉闇瑕侀綣佺殑緙栬瘧榪欎釜PHP鑴氭湰銆傝屼笖瀹冭兘浼樺寲PHP鑴氭湰錛屼互鎻愰珮鎵цPHP鐨勯熷害銆俥Accelerator鐗硅壊鏄噺灝戜簡鏈嶅姟鍣?/span>璐熻澆銆佷嬌PHP鑴氭湰鍔犻?-10鍊嶃?br /> 瀵瑰簲浣犵殑php鐗堟湰涓嬭澆鐩稿簲鐨刣ll鏂囦歡錛庡鏋滄槸PHP 5.2.5璇蜂笅杞?a target="_blank">eAccelerator 0952 for PHP 5.2.5 eLoader 0952 for PHP 5.2.5

    Attachment Size
    eAccelerator 095 Final for PHP 5.1.6 120 KB
    095_final_useful _files.zip 41.97 KB
    eAccelerator 0.9.5 Final for PHP 5.1.5 120 KB
    eAccelerator 095 Final for PHP 5.1.6 Optimized for Size 108 KB
    eAccelerator 095 Final for PHP 5.2.0 120 KB
    eAccelerator 095 Final for PHP 5.0.5 120 KB
    eAccelerator 095 for PHP 5.0.4 (OLDER PHP VERSION) 120 KB
    eAccelerator 0951 for PHP 5.2.2 120 KB
    eAccelerator 0951 for PHP 5.2.1 120 KB
    eAccelerator 0951 for PHP 5.2.2 Built with VC2005 SP1 128 KB
    eAccelerator 0951 for PHP 5.1.4 120 KB
    eAccelerator 0951 for PHP 5.2.3 120 KB
    eAccelerator 0951 for PHP 5.2.0 (OLDER PHP VERSION) 120 KB
    eAccelerator 0951 for PHP 5.2.4 120 KB
    eLoader 0951 for PHP 5.2.4 28 KB
    0952_final_useful _files.zip 42.27 KB
    eLoader 0952 for PHP 5.2.3 28 KB
    eAccelerator 0952 for PHP 5.2.3 120 KB
    eLoader0952_5.2.4.dll 28 KB
    eAccelerator 0952 for PHP 5.2.4 120 KB
    eAccelerator 0952 for PHP 5.2.5 120 KB
    eLoader 0952 for PHP 5.2.5 28 KB


    We have been using this PHP accelerator (0.9.5), on multiple servers, for a long time. It's used on some high traffic sites without any problem.
    Install:
    a) Download a copy of eAccelerator that is compatible with your version of PHP.
    This can be an issue with eAccelerator. Sometimes it can take a little time before the Windows binaries are available for the most recent version of PHP.
    b) Copy a compatible eaccelerator.dll to your PHP extensions folder (like:D:\php\ext replace with your actual folder location).
    Make sure the configuration directive extension_dir in your php.ini is properly pointing to your extensions folder.
    Like: extension_dir = "D:/php/ext"
    //灝哾ll鏂囦歡澶嶅埗鍒癉:/php/ext涓嬶紟
    c) Create a folder (with the appropriate permissions) for the temporary cached files.
    For example: D:\temp\eaccelerator
    //鍒涘緩tmp鐩綍銆鏉冮檺鍙啓
    d) Add the following to your php.ini (as the first loaded extension):
    .
    ;extension=php_yaz.dll
    ;extension=php_zip.dll
    //緙栬緫php.ini 鍦╡xtension=php_zip.dll涔嬪悗娣諱互綰㈠瓧閮ㄥ垎

    [eaccelerator]
    zend_extension_ts="D:\php\ext\eAccelerator0952_5.2.3.dll"
    zend_extension="D:\php\ext\eAccelerator0952_5.2.3.dll"
    eaccelerator.cache_dir = "D:\temp\eaccelerator"
    eaccelerator.shm_size="64"
    eaccelerator.enable="1"
    eaccelerator.optimizer="1"
    eaccelerator.debug ="0"
    eaccelerator.check_mtime="1"
    eaccelerator.filter=""
    eaccelerator.shm_max="0"
    eaccelerator.shm_ttl ="0"
    eaccelerator.shm_prune_period="0"
    eaccelerator.shm_only="0"
    eaccelerator.compress="1"
    eaccelerator.compress_level="9"
    eaccelerator.keys= "shm"
    eaccelerator.sessions="shm"
    eaccelerator.c
    zend_extension="D:\php\ext\eLoader0952_5.2.3.dll"
    ;;;;;;;;;;;;;;;;;;;
    ; Module Settings ;
    ;;;;;;;;;;;;;;;;;;;
    .
    .
    e) Restart your Web Server.You can see..

    Eric.Zhou 2007-11-28 17:33 鍙戣〃璇勮
    ]]>緗戠珯澶氳璦鐗堟湰錛嶏紞Drupalhttp://m.tkk7.com/rain1102/archive/2007/11/22/162379.htmlEric.ZhouEric.ZhouThu, 22 Nov 2007 06:53:00 GMThttp://m.tkk7.com/rain1102/archive/2007/11/22/162379.htmlhttp://m.tkk7.com/rain1102/comments/162379.htmlhttp://m.tkk7.com/rain1102/archive/2007/11/22/162379.html#Feedback0http://m.tkk7.com/rain1102/comments/commentRss/162379.htmlhttp://m.tkk7.com/rain1102/services/trackbacks/162379.html鍦ㄥ畼鏂圭綉绔欎笂鐪嬪埌鏈変袱涓猰odule鍙互瀹炵幇鍥介檯鍖栧璇█鐗堟湰錛岄鍏堢湅鍒扮殑鏄痬enutranslation錛岃屾module鍙槸瀹炵幇浜嗗menu瀹炵幇鐨勫浗闄呭寲澶氳璦鎺у埗錛屾樉鐒朵笉閫傚悎涓鑸殑瑕佹眰錛屼絾榪欎釜module閰嶇疆寰堢畝鍗曪紝鍙渶瑕佸姞鍏18n灝卞彲浠ヤ簡錛屽熀鏈笉闇瑕侀厤緗粈涔堢殑銆?br /> 涓庢槸灝辯戶緇湅浜嗕竴涓嬪姛鑳藉己澶х殑localizer銆傛module闇瑕佽嚜宸遍厤緗緢澶氥?br />

    Installation instructions (New installation: Localizer 1.10 on Drupal 5.1 and Drupal 5.2)

    1. Download the latest Localizer module from http://drupal.org/project/localizer
    2. Download the flags icons from http://www.speedtech.it/files/localizer-flags.tgz
    3. Download pre-patched core files from
       http://www.speedtech.it/files/localizer-sites-all-5.1-1.10.tgz (Drupal 5.1)
       http://www.speedtech.it/files/localizer-sites-all-5.2-1.10.tgz (Drupal 5.2)  
    4. Extract localizer-5.x-1.10.tgz archive under sites/all/modules (create the modules directory if needed)
       This will create sites/all/modules/localizer that contains the Localizer-related module code.
    5. Extract localizer-flags.tgz under sites/all/modules/localizer. This
       will create sites/all/modules/localizer/flags with the flag files in it.
    6. Extract localizer-sites-all-5.1-1.10.tgz (or localizer-sites-all-5.2-1.10.tgz) under sites/all (it already
       has the modules and localizer directory, so the contents will go into
       sites/all/modules/localizer.
    7. To the end of your sites/default/settings.php file, append and save
       (overwrite the file):
       $conf= array
       (
          'cache_inc' =>
          'sites/all/modules/localizer/system/includes/cache.inc',
       );
    8. Login to your site as administrator (UID=1)
    9. Under Administer > Site building > modules, enable all the
       Localizer-related modules you need. Click Save configuration.
    10. Visit www.yoursite.com/update.php and run the update script.
    11. Under Administer > Site configuration > Localizer to configure options.
    12. Enjoy!


    Upgrade instructions (Upgrade from older versions of Localizer to Localizer
    1.10 on Drupal 5.1 and Drupal 5.2)

    1. Download the latest Localizer module from http://drupal.org/project/localizer
    2. Download the flags icons from http://www.speedtech.it/files/localizer-flags.tgz
    3. Download pre-patched core files from
       http://www.speedtech.it/files/localizer-sites-all-5.1-1.10.tgz (Drupal 5.1)
       http://www.speedtech.it/files/localizer-sites-all-5.2-1.10.tgz (Drupal 5.2)  
    4. Login to your site as administrator and under Administer > Site
       building > modules, disable all the Localizer-related modules
    5. Delete the old module/localizer directory (could be sites/all/modules/localizer)
    6. Return the Drupal 5.x modules that you previously patched for
       Localizer versions prior to 1.10 to their original state. (In other
       words, download Drupal 5.x and extract the the following files from
       the tarball: block.module, menu.module, taxonomy.module, bootstrap.inc,
       and common.inc. Upload these to your site, overwriting the existing
       modules.)
    7. Extract localizer-5.x-1.10.tgz archive under sites/all/modules
       (create the modules directory if needed) This will create
       sites/all/modules/localizer that contains the Localizer-related module code.
    8. Extract localizer-flags.tgz under sites/all/modules/localizer. This
       will create sites/all/modules/localizer/flags with the flag files in it.
    9. Extract localizer-sites-all-5.1-1.10.tgz (or localizer-sites-all-5.2-1.10.tgz) under sites/all (it already
       has the modules and localizer directory, so the contents will go into
       sites/all/modules/localizer.
    10. To the end of your sites/default/settings.php file, append and
       save (overwrite the file):
       $conf= array
       (

           'cache_inc' =>
       'sites/all/modules/localizer/system/includes/cache.inc',

       );
    11. Login to your site as administrator (UID=1)
    12. Under Administer > Site building > modules, enable all the
        Localizer-related modules you need. Click Save configuration.
    13. Visit www.yoursite.com/update.php and run the update script.
    14. Under Administer > Site configuration > Localizer to configure
        options.
    15. Enjoy!

    鎸夌収瀹冪殑璇存槑鏂囦歡錛屽緢蹇氨鍙互瀹炵幇鍥介檯鍖栧璇█鐗堟湰鐨勭綉绔欎簡!姝odule鍙互瀵筺ode錛宐lock絳夌瓑瀹炵幇鍥介檯鍖?

    Eric.Zhou 2007-11-22 14:53 鍙戣〃璇勮
    ]]>
    主站蜘蛛池模板: 免费无码精品黄AV电影| 亚洲熟女一区二区三区| 国内成人精品亚洲日本语音 | 免费无码作爱视频| 一区二区三区亚洲| 亚洲乱色伦图片区小说| 亚洲成av人在片观看| 99在线观看免费视频| 最新亚洲人成网站在线观看| 亚洲AV无码成人专区片在线观看| 成人免费午间影院在线观看| 三年片在线观看免费| 亚洲熟妇av午夜无码不卡| 国产国拍精品亚洲AV片| 免费在线观看的网站| 国产一级黄片儿免费看| 亚洲欧美综合精品成人导航| 亚洲AV无码专区电影在线观看 | 久久久久国产精品免费网站| 亚洲av最新在线观看网址| 精品亚洲一区二区| 国产乱子影视频上线免费观看| 一级毛片免费观看| 产传媒61国产免费| 亚洲精品无码久久久久久| 亚洲AV无码不卡无码| 亚洲精品456播放| 大地资源二在线观看免费高清 | 麻豆精品国产免费观看| 午夜视频免费在线观看| 日韩a毛片免费观看| 亚洲香蕉在线观看| 亚洲国产一区二区a毛片| 亚洲人成色77777在线观看大| 免费黄色大片网站| 国产电影午夜成年免费视频| 黄网站免费在线观看| 一级毛片在线播放免费| 久久亚洲精品无码gv| 亚洲国产系列一区二区三区| 亚洲综合激情视频|