2007-07-16
Problems with IMG html tag in Flash 8
After long long time with try-error and searching in the net, finally I found the reason for such problems. There are some bugs with IMG html tag in Flash 8. My solution is: After the img tag, insert at least 8 <br /> tags.
To be careful: The support of img tag is only available from Flash v7 and ActionScript 2.0. So please pay attention to your publish settings too.
2007-07-14
Ajax RSS News Ticker
You only need to download this and extract the zip into your web directory. Try the demo.htm within it, it is that easy!
There is also another PHP RSS News Parser. Since I didn't try it, I left it to you to compare this with the other two. ;-)
2007-07-09
Problem with Windows Time Update
I tried to use the tab "Internet time" after clicking on the clock to select "Adjust Date / Time". When I selected the server "time.windows.com", then clicked "update now" on the right. Ok, error came! I got an error message "An error occurred while Windows was synchronizing with time.windows.com". Great, then I tried it with other time servers. Nothing different.
How to fix this up? Here are some steps I found in the internet.
1. Press Winkey+R, or select "Run..." from the start menu, and type "cmd" in the box;
2. After the command window shows up, type the following commands:
net stop w32time
w32tm /unregister [ignore error message]
w32tm /unregister [enter a second time]
w32tm /register
reg add hklm\system\currentcontrolset\services\w32time\parameters\ /v NtpServer /t reg_sz /d time.nist.gov /f
net start w32time3. Try the "Internet time" update again. It should work now.
2007-07-05
strange problem with Node Template
After long long time with try-error, finally I found the cause of the problem. In the .htaccess which is in the root folder of Drupal, there are some lines looked like this:
# Protect files and directories from prying eyes.
<FilesMatch "(\.(engine|inc|install|module|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|Entries.*|
Repository|Root|Tag|Template)$">
Order deny,allow
Deny from all
</FilesMatch>
Since I used "/nodetemplate" as the path for the menu item "my node templates", then the server will block this path only because the path "/nodetemplate" ends with the string "template". That's really a dreadful setting! I cannot suggest all the users to change their .htaccess file, so I changed my path to "/nodetemplates". BOOM! Everything works like a charm now.
Indeed, such kind of FilesMatch settings are intended to protect the unauthorized access to those files. But, it has so many side-effects. For example, you cannot use any string which ends with "template" or "root", etc. to name your shortcuts as your path in Drupal. If you did this, you will get the strange problem too!
2007-07-04
New features in Node Template
New features include:
- Now automatic node creation is optional from version 1.3.
- Share template with others is possible from version 1.4.
The reason why I don't want to release v1.6 today is because a strange problem on my computer. if I enable the "clean URLs" in Drupal, clicking the menu item "my node templates" will cause a page that says "Access forbidden" with "error 403". I guess it can be some setting problems of my web server. Currently I am using xampp 1.6.2. When I figure out what happens, I'll release v.1.6 of the module "Node Template".
2007-07-03
Difference between German and Chinese
Found some very interesting art works from an Chinese artist in Germany that reflect the difference between German and Chinese.
Left (Blue): German & Right (Red): Chinese
Three Meals 一日三餐
Contacts 人际关系
Moods and Weather 心情和天气
Transport 交通工具
References 参考:http://www.uni-ulm.de/acssu/cgi-bin/topic.cgi?forum=18&topic=933
作者介绍:刘扬,一九七六年生于北京。十三岁随家人迁居德国。十七岁时被德国柏林艺术大学设计系录取,师从于霍尔格马蒂斯,获硕士及大师班学位。毕 业后曾先后在新加坡,伦敦,柏林,纽约工作及生活。零四年在柏林开始自己的设计工作室。曾任教于荷兰设计中心,中国中央美术学院设计系,英国格拉斯歌美术 学院,并在国际设计研讨会及博览会讲座。刘杨的作品曾多次在国际设计大赛中获重要奖项,作品被国际多家博物馆展览并收藏。
Yang Liu is born in 1976 in Beijing. She came to Germany with her family at the age of 13. She was 17 years old when she studied in the Art University of Berlin (Universitaet der Kuenste Berlin). After her study she made his career as a Designer in Singapur, London, Berlin and New York. In the year of 2004 she founded her own Design Studio. Besides Workshops and Lectures on international conferences she tought in the Central Academy of Fine Art Beijing and the Glasgow School of Art. Her works are presented in many international contests, worldwide can be seen in Musums and bought for collections.
2007-06-12
Tips for Multisite in Drupal
- If you want to use a new theme for the new site with the configuration,
$conf =
array('site_name' => 'My Drupal site',
'theme_default' => 'pushbutton',
'anonymous' => 'Visitor',);
please be sure give the parameter "theme_default" a new name such as "newtheme". Then copy the whole folder of your current main theme as a new folder called "newtheme" under "/themes".
This gives the grantee of the maximal compatibility of your new theme which is to be modified. - Just remember to activate your "newtheme" in your main site, otherwise Drupal will not use the new theme.
2007-05-30
5 Steps to implement multisite in Drupal
Here is just another typical one:
The customer needs two kinds of presentations of the same content, and such presentations should be decided by different URL.
More concretely, assumed that we have a domain named "http://www.example.com". This is the main site used for some people. At the same time, "http://www.example.com/show/" will be used for some other purpose, e.g. as a content provider with different front page.
Let's do it step by step:
- Find the configuration file httpd.conf of your Apache server. Add the following line at the end of the file.
It maps the path to your drupal installation directory.Alias /show "C:/Programme/xampp/htdocs/drupal/" #<- The path to your drupal directory. It can be "/var/www/htdocs/" on a linux server or alike. - Go to the /sites directory under the drupal installation directory. Copy the /default directory to a new directory with all the containing files. The new directory can be called "/www.example.com.show" or "/localhost.show". It depends on where you install your drupal.
- Make changes to the settings.php in the new directory.
- Since we use the same database and don't want to create new tables, we use:
$db_url = 'mysql://name:password@localhost/drupal';
$db_prefix = ''; - For the URL we use, change the base URL:
$base_url = 'http://localhost/show'; // NO trailing slash! - Something we want to change is the theme and front page, etc. It can be achieved by:
$conf = array(
'site_name' => 'My Drupal site',
'theme_default' => 'pushbutton',
'anonymous' => 'Visitor',
); - To get clean URL's with multi-site I added the following to the .htaccess file
# rewrite commands for drupal dev sites
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/show/.*
RewriteRule ^(.*)$ /show/index.php?q=$1 [L,QSA] - restart the Apache server and go to the URL "http://www.example.com/show/" to see what happens.
Another "internal error occured during: Initializing Java tooling"
Today I wanted to help someone to install the jBPM Graphical Design plug-in for Eclipse. I used the same version Eclipse and the plug-in as those on my own computer. Everything is fine until I tried to import a project from a CVS server. Then comes the error "An internal error occured during: Initializing Java tooling". It really makes me frustrated after I tried again and again and made 100% sure that all the software version are the same.
So where is the problem?
The bad guy is the setting in Eclipse! After going to "Window"->"Preferences...", you can see the following dialog:

Click the option "JBoss jBPM", you will see your installation directory of jBPM library and the name of installation. If you give a new name, exactly saying, a different name from the original name which you gave in your previous Eclipse. BOOM, you got the error!
The reason: Eclipse saves every project settings in a file called .classpath. It's a xml file. You can find a line like this:
<classpathentry kind="con" path="JBPM/JBoss jBPM 3.1.2"></classpathentry>
See? The name which is used here is the convenient name! So if you change this name, Eclipse doesn't know where to find the library again.
Solution:
1. Keep using the same convenient name in the preferences settings.
2. Change the entry in the .classpath file to the name you used.
2007-05-29
Node Template has been updated!
The issue is about the version for Drupal 5.x. Since I didn't make any test on Drupal 5, I didn't even know it doesn't work for Drupal 5. All I have done is doing a conversion or update of my module from version for 4.7.x to version for 5.x according to a page called "Converting 4.7.x modules to 5.x", but without test it doesn't even work!
So after looking at the completely new API of Drupal 5, I fixed all the strange problems. Best of all, it helps me a lot because I'll develop another module called "Version table" in the very near future.
And here is also a screenshot of the module:
2007-05-23
Node template in Drupal
I've looked at so many modules of Drupal, but none of them meets my requirements. So...sadly I must do it myself. The result is, I wrote a module called "node template", which can be found at http://drupal.org/project/node_template.
It's my first module project for Drupal. So I hope I have more free time to make it better. Although setting up a CVS release of that module cost me already 30 minutes to figure it out, finally is it there. :)
2007-05-15
Best tutorials on Sending Email from Flash using PHP
The best part of that tutorial is: it points out tons of tips which could drive man crazy without. For example, you'd better hide the send button in a Movie Clip, so that everything works. Why? because otherweise
Note: note that [ send ] is a Movie Clip with inside a button. This is useful for us while with the loadVariables() our vars to PHP without sending all _root variables...Reading such kind of tutorials is really an enjoy. Keep going on, Alessandro Crugnola!
2007-05-14
Using the UIScrollBar component of Flash
If you do that step by step, it works. BUT, if you create a new text box with the type of dynamic text, use LoadVars to load a text file on the fly and add a UIScrollBar component to it, then publish it, you will see a blank vertical bar on the right of the text box. So what's wrong?
There are also people writing comments on the Adobe livedocs. Such things cost me at least one hour to find what happens.
The key to the solution is: you must enter something long enough in the text box before loading anything into it! I guess the UIScrollBar component just caculates the behavior before it's published. The only size it knows is your text size in the design phase.
So, don't forget to paste some dummy text in your text box and give it an instance name before you use the UIScrollBar component!
2007-05-13
JavaScript based google customized search
The idea is: using the format of a search string with "site:"+"yousite.com"+" "+"query value"
With the form you can use the following:
<form action="http://www.google.com/search" method="get" onSubmit="jssearch(this)">
2007-05-03
Sending Email in Flash
Contact form is used widely on a website. If the website is powered by Flash, find a better way to build a flexible contact form is also very important.
There are probably 3 ways:
1. Use the "mailto:" protocol
Namely set a button event with
on (release) {The three variables are self defined in Flash according to the form fields. A tutorial can be found here.
getURL("mailto:" + to + "?subject=" +subject+ "&body=" + body);
}
The advantage of this method is that man doesn't need complex programming things. The flash will call the email client in the system to send the mail.
The shortcoming is also related to the advantage: If an email client isn't setup well or doesn't exist on the system, then we have a problem.
2. Use FLASH and PHP
It's used widely. So I don't want to talk more abut it. ;-)
The principle is: Flash posts Variables to a PHP file, then the PHP sends email using mail() function and returns the result to flash.

A tutorial can be found at kirupa.com
3. Load a HTML into FLASH
The principle here is trying to load a html with contact form in Flash.
Firstly just use a textfield in Flash, set it to dynamic. Then click Render Text as HTML in properties or set the .html property to true. Then use Loadvars to load the html file and assign the variable into the textfield.htmlText property. Here's an example:
loadText = new LoadVars();Just remember the following: You don't need all that header junk like tags and such. At the beginning of your html file, above everything else put something like:
loadText.onLoad = function()
{
_root.helpText_txt.html = true;
_root.helpText_txt.htmlText = this.testText;
}
loadText.load("text.htm");
testText =
where testText can be any variable name you choose. You can only use jpg and swf's for graphics embedded in the html. And the jpg's can't be progressive jpg's.
Finally anchors "<a href="http://www2.blogger.com/bla.html">" will work but won't show as a different color unless you use font tags around them and specify to change the color of the text. ie. "<span></a><a href="http://www.blogger.com/bla.html">Bla</a></span>"
More infos about "Formatting text with Cascading Style Sheets" can be found here.
P.S. According to this article, there are many ways to link a html in Flash.
2007-05-02
To use Firefox or not to, it's a question
An internal error occured during: Initializing Java tooling
The reason is that the new version has changed the file structures and didn't provide the coresponding convension tools. So here is endly the solution:
- Backup the whole workspace before upgrading;
- You can enable or disable a new version jBPM plugin under "help"->"software updates"->"manage configurations";
- After the new version is running, create a blank process project, then create a blank process definition;
- Close eclipse, find the folder where the new created process files are;
- Open gpd.xml and processdefiniton.xml of the new process and your old process in an editor;
- Just compare the difference between those files. Mostly the new version of jBPM changes the structure of gpd.xml;
- So change the xml structure manually and save them;
- Maybe the file .classpath should alse be compared and changed.
- Open it in eclipse. If you are lucky, you will never see the error message again.
2007-04-25
jBPM Process Designer Upgrade Problem
After thousands of tries I've find this alpha version cannot convert the process files from old versions correctly. The result is, you will lost all transition lines on the process image. So just be careful to do the update!
The issue is here: http://jira.jboss.com/jira/browse/GPD-64
