Sunday, December 20, 2009

Drupal brief history and what's drupal

This is a reply to a friend's question: what's drupal?

"
In one sentence, drupal is a web-based CMS(content management system) written in php.

Instead of explaining the key terms in the above sentence, i recommend you to read the history of drupal in http://drupal.org/node/769 , which is more human than technical. i think you'll be more interested in that since you are named by 'Thucydides'.

I'd like to brief the 'name' history in case you have no time to visit drupal.org:

When the authors of Drupal were still University students, they need a "small news site with a built-in web board, allowing the group of friends to leave each other notes ... where they were having dinner ... share some noteworthy news items."

And they created one!

The initial website for the study group had been unamed(?) and in private network before the authors graduated. After graduation, they need a web site in public domain to "stay in touch, keep sharing ...". That was called "drop.org".

The software behind the website was released with the name "Drupal", which came from the Dutch word "druppel".

"

Thursday, November 12, 2009

PHP config change for Drupal in bluehost

在安裝Services module時出現底下的錯誤訊息:
"Fatal error: Allowed memory size of 33554432 bytes exhausted"

此一錯誤訊息 指出PHP需要分配更多的記憶體以完成Drupal 模組的安裝工作
The error message occurred during installing/enabling some modules.
It indicates that more memory is needed for PHP engine to process the requests.

[try]
  1. set your site to the php5 (single php.ini) settings in the PHP config of Bluehost's CPanel
  2. change to "memory_limit = 64M ;" in the php.ini
  3. change to "ini_set('memory_limit', '64M');" in ../sites/default/settings.php file or
    just remove it from ../sites/default/settings.php
  4. check Administer/Reports/Status report to verify that PHP's memory limit is increased to 64M


[ref] http://drupal.org/node/283579

Monday, November 9, 2009

Flashnode and AmfPhp for Drupal

3H ITek Studio: Flashnode and AmfPhp for Drupal

Flashnode : a drupal module to ease the placement of swf file into the contents

Amfphp source files: server side main program to help creating rich contents

Amfphp plug-in files: plug-in shell to embed the Amfphp source files into the "Services" module

Services : a drupal module for web services related tasks
..\services\servers\amfphp :plug-in files
..\services\servers\amfphp\amfphp : source files

[ref]
"Flash with drupal," by Travis Tidwell, [Packt], 2009

Sunday, May 31, 2009

File Extentsion Add for File Upload setting

Site configuration -> File uploads ->

  • Maximum width and height for uploaded images(w*h)
  • Default permitted file extensions
  • Default maximum file size per upload

  • 可以限縮上傳影像大小 (e.g. 640x480)
  • 可以增/刪/修 允許上傳的檔案副檔名
  • 可以改變 上傳檔案的容量限制

Monday, April 13, 2009

How to quickly add reference to internal links ?

[Q] How to quickly add reference to internal links in an article?

[try]
  • node reference explorer [ http://drupal.org/project/nodereference_explorer ]

  • http://drupal.org/project/freelinking
    install "FreeLinking" module, enable it, configure it,  Permission,  and
    Filter(InputFormat) : 
    Site Configuration -> Input Format -> Configure to add FreeLinking filter

  • http://drupal.org/project/linktocontent
    [need TinyMCE and not applicable to drupal 6.x yet]

Sunday, February 8, 2009

SwfObject related links and digest

//===
SWFObject javascript library, http://code.google.com/p/swfobject/
SWFObjectAPI module, http://drupal.org/project/swfobject_api

To add flash blocks, still need swfobject module
http://drupal.org/project/swfobject [no release for drupal 6 yet?]


Step by step guide to use swfobject.js with cck
http://openconcept.ca/blog/varun/creating_a_flash_cck_content_type_with_swfobjectjs


//===
http://code.google.com/p/swfobject/wiki/documentation

http://www.alistapart.com/articles/flashembedcagematch/
[February 06, 2007]




"...
look into the complexities and subtleties of embedding Flash content and
examine the most popular embedding methods to see how good they really are.
...
Opera also introduced a similar click-to-activate mechanism. These mechanisms work like speed bumps in the road: you have to break, slowly drive over it, and push the gas pedal again.
...

'object' method is not browser-specific and is therefore the preferred implementation.
...

'embed' simply has never been a W3C recommendation and it never will be, because of patent issues. However in reality it does have better cross-browser support than each single implementation of the object element alone

...
Flash Satay

Another option is the Flash Satay method, which ... includes an additional movie parameter to avoid the bug that causes Flash content not to display in Internet Explorer. ...

It also includes a container Flash movie to fix the Internet Explorer streaming bug

<object type="application/x-shockwave-flash" »
data="c.swf? path=myContent.swf" width="300" height="120">
<param name="movie" value="c.swf?path="myContent.swf" />
<p>Alternative content</p>
</object>


...

DOM scripting

..."

DOM scripting: UFO, SWFObject, ObjectSwap --> SWFObject2.0

Tuesday, January 13, 2009

node_revisions concept digest

"...
Can I assume that the node_revisions record with the latest timestamp is the most current?

No. Drupal core does this and it can cause problems: http://drupal.org/node/300714

Or should I assume that the node_revisions record with the largest vid is the most current?
No.

If neither of the prior two how can I tell which node_revisions record is the most current for a node?
By the value of vid in the node table.

What is the node_revisions.log field used for? Mine are always blank?
This is the value of the log field on the node edit form.

Where do I set revision tracking in the UI? Do I do it on a per content-type basis? Globally? Other?
It is configured on the content-type settings page.

And finally, is there anything else I should know about working with the node_revisions using raw SQL?
Probably. You should have a good understanding of the hook_nodeapi function if you are planning on modifying nodes and directly manipulating the node_revisions table.
..."

Q from MikeSchinkel - December 24, 2007 - 21:48
A by imrook - September 7, 2008 - 18:27
[ref] http://drupal.org/node/203697

tables: node, node_revisions

node:
+-----------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+------------------+------+-----+---------+----------------+
| nid | int(10) unsigned | NO | PRI | NULL | auto_increment |
| vid | int(10) unsigned | NO | UNI | 0 | |
| type | varchar(32) | NO | MUL | | |
| language | varchar(12) | NO | | | |
| title | varchar(255) | NO | MUL | | |
| uid | int(11) | NO | MUL | 0 | |
| status | int(11) | NO | MUL | 1 | |
| created | int(11) | NO | MUL | 0 | |
| changed | int(11) | NO | MUL | 0 | |
| comment | int(11) | NO | | 0 | |
| promote | int(11) | NO | MUL | 0 | |
| moderate | int(11) | NO | MUL | 0 | |
| sticky | int(11) | NO | | 0 | |
| tnid | int(10) unsigned | NO | MUL | 0 | |
| translate | int(11) | NO | MUL | 0 | |
+-----------+------------------+------+-----+---------+----------------+
15 rows in set (0.00 sec)



node_revisions:
+-----------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+------------------+------+-----+---------+----------------+
| nid | int(10) unsigned | NO | MUL | 0 | |
| vid | int(10) unsigned | NO | PRI | NULL | auto_increment |
| uid | int(11) | NO | MUL | 0 | |
| title | varchar(255) | NO | | | |
| body | longtext | NO | | NULL | |
| teaser | longtext | NO | | NULL | |
| log | longtext | NO | | NULL | |
| timestamp | int(11) | NO | | 0 | |
| format | int(11) | NO | | 0 | |
+-----------+------------------+------+-----+---------+----------------+
9 rows in set (0.00 sec)

Sunday, January 11, 2009

Often used API functions

$modulepath= drupal_get_path('module', 'nameofmodule');
drupal_add_css($modulepath. '/cssname.css');
drupal_add_js($modulepateh. '/jsname.css');

Drupal javascript namespace
Drupal.t()
Drupal.checkPlain()

Drupla php has no namespace???
t()
l()
check_plain()

Friday, January 9, 2009

Set the label of a field with t() function?

[Q] How to set the label of a field with t() function?

Cannot see "edit field/manage field"

[Symptom] Cannot see "edit field/manage field" after installing CCK
[sol] check "User management" -> Permission