Thursday, November 24, 2011

เพิ่ม virtual path ให้กับ apache

ตัวอย่างการสร้าง
path ย่อย ที่ไม่ได้อยู่ใน Apache folder
กรณีนี้ใช้ C:\AppServ\www
ถ้าต้องการให้อยู่นอก www แก้ไขโดยเพิ่ม
ท้ายไฟล์ C:\AppServ\apache2.2\conf\httpd.conf

ตัวอย่าง path ที่เก็บข้อมูลคือ

Alias /doc1/www "C:/doc1/www"
<directory "C:/doc1/www">
Options Indexes FollowSymLinks MultiViews ExecCGI
       AllowOverride All
       Order allow,deny
       Allow from all
</directory>


จะเปิดดูข้อมูลได้ที่ http://127.0.0.1/doc1/www/ ที่เครื่องของตัวเอง 
โดยถ้าไม่มี index.html
จะแสดง เป็น List รายการไฟล์ให้

Tuesday, November 22, 2011

How to Change Database Collation to UTF-8

How to Change Database Collation to UTF-8


In some web hosting, They use Cpanel and Fantastico installer. It will automatic install your website and database. So You can not set your database collation by yourseft.

How to Change Database Collation 01 

Cpanel Interface



Bad luck, Some web hosting set the default database collation to Latin Swedish. But if you wanna do Thai, Chinese, Korean Website. You need to set the collation of database to UTF-8.

How to Change Database Collation 02

How to change this!!!!



If the database is not UTF-8, The display of your language will not display correctly.

How to Change Database Collation 03

As you can see in this picture.



Don't worry there's a way :)


For changing the collation of database, You can manually do it in notepad or dreamweaver.
But it's not very easy to do. So I will explain you the easiest way:

Step 1. You have to download Tool from Phoca for Changing Collation (Click here to Download). It's very great.

Step 2. After finish downloading, Right click and extract the file to your PC. (If you have WinZip, orWinRAR, etc.)

How to Change Database Collation 04

Step 3. You will see the folder name tool_phoca_changing_collation.... (Tooooo long name). Rename the folder to collation.

How to Change Database Collation 05

How to Change Database Collation 06

Rename the folder name to collation



Step 5. Uploading the folder to the root of your website.

How to Change Database Collation 07


Step 6. Okay, It's almost finish... Open your web browser and enter this URL: (Yourdomainname/collation/index.php)

How to Change Database Collation 08


Step 7. You will see this screen appear.

How to Change Database Collation 09

Step 8. Enter the field and click Submit
  • Database Host: Enter your host name
  • Database User: Enter your username for connecting to database
  • Database Password: Enter your password
  • Database Name: Enter your database name
  • Database Collation: utf8_general_ci


Step 9. Finish!!! Now the database change to UTF-8, Check your website and see the language display!

How to Change Database Collation 10
How to Change Database Collation 11


Thanks, Phoca Team Developer for this great stuff!!! :)

How to Enlarge Jcomments Avatar

How to Enlarge Jcomments Avatar



Jcomments is one of the best joomla comments system.

Many great features:
-Multi Language
-Simple to use
-Support Smilies
-Custom BBCode
-Import comments from others components
-etc.

You can try it here:
Demo JComments

Download JComments here:
Download JComments

This component is working almost perfectly. But the default JComments' Avatar is too small (just 32x32 px)
Jcomments Avatars is too small

See how small it is



If you want to enlarge it, Just follow my step here:



Step 1: Open the file style.css
(/components/com_jcomments/tpl/default/style.css)

Step 2: Looking for this line:

/* Avatar */
#comments .comment-avatar img {width: 32px}


Step 3: Change 32px to the size you want: (I prefer 48px)
/* Avatar */
#comments .comment-avatar img {width: 48px}


Finish: Save the file style.css, upload it back to its location, open your page and see the results!!
JComments Avatar 48X48 px

Now, JComments' Avatar is 48x48 px


How to Display Avatar in JComments

How to Display Avatar in JComments


How to Display Avatar in JComments

If you make the website with Joomla and you wanna have the comments in an article...

I recommend you to use JComments.

But if some of you have ever used JComments but you still don't know why the Avatar is not showing?...

Don't worry, this article will show you how to do it!



Step 1: If you don't have JComments, Install JComments first. Click here to download JComments

Step 2: And You have to Install this plugin too. JComments Avatars available here
How to Display Avatar in JComments

Step 3: After you finish install JComments and Plugin JComments Avatars. Then you have to set some parameters.

Go to Admin Page =>Extensions=>Plugin Manager and looking for JComment Avatars

-Details - Enable Choose Yes

How to Display Avatar in JComments

-Parameters - Avatar Source You can choose any of them (depend on you)

How to Display Avatar in JComments

Step 4: Go to JComments Settings=> at the tab Permissions

User Groups here you can choose which user level can see the avatars

- And if you want them to see the avatars , just tick Show Gravatar

How to Display Avatar in JComments



Done!!!

How to Display Avatar in JComments

How to Remove Community Builder Button on User Profile Page

How to Remove Community Builder Button on User Profile Page

If you use community builder extension on your joomla or mambo site. There is a community builder button on user profile page which link to community builder's team credits page. This button you can't remove it in its configuration. This article will show you how to remove it!

Community Builder01


This picture Show you where is the community builder button

Step 1. Go to Admin page=> Component=>Community Builder=>Tab Management

Community Builder02


Step 2. On Tab Management, Click on Menu


Community Builder03


Step 3.
 You will see the parameters setting on your right hand. In the field first menu name:
_UE_MENU_CB just leave it blank. (see the picture below)

Community Builder04

Finish. Just click save and then finish. You can check out on the user profile page. There is no Community Builder button now!!

Community Builder05

No Community Builder button now!


Convert em,px,pt and % in css

Thanks to this site: http://reeddesign.co.uk/test/points-pixels.html
Conversion from Points to Pixels (and Ems and %)
Here’s a chart that converts points to pixels (and ems and %). It’s an approximation, which will depend on font, browser and OS, but it’s a good starting point.
PointsPixelsEmsPercent
6pt8px0.5em50%
7pt9px0.55em55%
7.5pt10px0.625em62.5%
8pt11px0.7em70%
9pt12px0.75em75%
10pt13px0.8em80%
10.5pt14px0.875em87.5%
11pt15px0.95em95%
12pt16px1em100%
13pt17px1.05em105%
13.5pt18px1.125em112.5%
14pt19px1.2em120%
14.5pt20px1.25em125%
15pt21px1.3em130%
16pt22px1.4em140%
17pt23px1.45em145%
18pt24px1.5em150%
20pt26px1.6em160%
22pt29px1.8em180%
24pt32px2em200%
26pt35px2.2em220%
27pt36px2.25em225%
28pt37px2.3em230%
29pt38px2.35em235%
30pt40px2.45em245%
32pt42px2.55em255%
34pt45px2.75em275%
36pt48px3em300%