Category: Programming
CakePHP
CakePHP คือ Framework ที่พัฒนาด้วยภาษา PHP ที่เป็น Free,Open-Source โดยการออกแบบโปรแกรม(design patterns) แบบ MVC (Model-view-controller) และ ORM (Object-relational_mapping) เข้ามาเป็นมาตรฐานหรือข้อตกลงในการพัฒนาโปรแกรม ส่วนเรื่อง MVC และ ORM สำหรับคนที่ยังไม่รู้ความหมายและหลักการทำงาน สามารถอ่านคำอธิบายในหัวข้อถัดไปได้นะครับ แต่ตอนนี้เรามาทำความเข้าใจกับ CakePHP framework ตัวนี้กันก่อน
ความหมายของ Framework ก็คือ กรอบของการทำงาน แปลตรงตัวเลยครับ Frame + work แต่ถ้ามองในแง่โปรแกรม ก็จะเป็น ข้อกำหนดหรือขอบเขตในการเขียนโปรแกรมให้เป็นไปในรูปแบบเดียวกัน และสามารถนำไปเขียนเพิ่มเพื่อตอบสนองความต้องการอย่างใดอย่างหนึ่งได้ ดังนั้น CakePHP framework ก็จะมี class และ function ต่างๆ ให้เราได้เรียกใช้ โดยที่เราไม่ต้องไปเสียเวลาเขียนขึ้นมาเอง ซึ่งจะทำให้เกิดความรวดเร็วในการพัฒนา Web Application
ความสามารถใน CakePHP framework
- มีลิขสิทธิ์ที่ยืดหยุ่น
- ทำงานร่วมกับ PHP [...]
VirtueMart fixed number of products in main level category
มีปัญหากับลูกค้ามานานแก้ไม่จบซะที เรื่องการนับจำนวนสินค้าในหมวดหมู่หลักของโปรแกรม VirtueMart component ของ Mambo วันนี้ไปเจอวิธีแก้ไขมาแล้วครับ จากเว็บ http://forum.virtuemart.net/index.php?topic=44319.msg141578
ขั้นตอนแรกไปที่administrator\components\com_virtuemart\classes\ps_product_category.php เปิดไฟล์ ps_product_category.php ขึ้นมา ค้นหาฟังก์ชั่น products_in_category ดังโค้ดด้านล่างนี้
function products_in_category( $category_id ) {
if( PSHOP_SHOW_PRODUCTS_IN_CATEGORY == ‘1′ ) {
$num = ps_product_category::product_count($category_id);
if( empty($num) && ps_product_category::has_childs( $category_id )) {
$db = new ps_DB;
$q = "SELECT category_child_id FROM #__{vm}_category_xref ";
$q .= "WHERE category_parent_id=’$category_id’ ";
$db->query($q);
while( $db->next_record() ) {
$num += ps_product_category::product_count($db->f("category_child_id"));
}
}
return " ($num) ";
}
else
return ( "" [...]
PHP Robot visit
วันนี้มีโค้ด php แนะนำมาฝาก สำหรับเช็ค robot ที่เข้ามาเก็บข้อมูลจากเว็บไซต์เราไป Index ลง Search Engine เหมาะสำหรัับคนที่ทำ SEO อย่างยิ่งครับ รายละเอียดและชื่อโปรแกรม วิธีการติดตั้ง อยู่ด้านล่างนี้ครับ
PHP Robot Visit
http://www.stevedawson.com/downloads/robotvisit.zip
Check when the search engines are visiting your website
Author: Steve Dawson ผู้พัฒนา
Download PHP Robot Visit Script
MySQL SUM – Totaling Groups
ตัวอย่างตาราง
id
name
type
price
123451
Park’s Great Hits
Music
19.99
123452
Silly Puddy
Toy
3.99
123453
Playstation
Toy
89.95
123454
Men’s T-Shirt
Clothing
32.50
123455
Blouse
Clothing
34.97
123456
Electronica 2002
Music
3.99
123457
Country Tunes
Music
21.55
123458
Watermelon
Food
8
MySQL SUM – Totaling Groups
SUM is an aggregate function that totals a specific column for a group. The “products” table that is displayed above has several products of various types. One use of SUM might be to find the total of all the items’ price for each product type.
Just [...]
How to disable right-click & Save As
Disable right mouse click Script
By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
For full source code, visit http://www.dynamicdrive.com
CODE: [place a header tag]
<script language=JavaScript>
var message="Function Disabled!";
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
</script>
ขั้นตอนการลง AppServ + Eclipse + Zenddebugger สำหรับคนที่ต้องการเริ่มเขียน PHP
Quote
1. ขั้นตอนการลง AppServ + Eclipse + Zenddebugger สำหรับคนที่ต้องการเริ่มเขียน PHP
2. สอนเขียน PHP
3. help file
http://www.zend.com/en/community/pdt
http://www-128.ibm.com/developerworks/ibm/…&ca=dkw-php
สมัยก่อนใช้แต่ editplus ตอนนี้มี debugger ใช้แล้วเท่ห์จิงๆ
แหล่งที่มา http://www.witcomram.com/webboard/index.php?showtopic=6260
โดยคุณ dragon_html [at] witcomram.com
http://www.thaihosttalk.com/th1/index.php?topic=10333.0
Developing Life Cycle ความจริงของวงการ Developer
เครดิตจาก http://www.beartai.com/2007/?p=478
รูปนี้ไปเจอมาที่ http://www.thaimacdev.com ขอขอบคุณมากนะครับ
ผมดูรูปนี้แล้วผมขำก๊ากเลย เพราะนี่คือ การตีแผ่วงการเขียนโปรแกรมขายอย่างแท้จริง..
รูปที่หนึ่ง : ลูกค้าอยากจะได้โปรแกรมอะไรซักอย่าง ก็เลยอธิบายให้กับ Project Leader ฟัง (ชิงช้าสามที่นั่ง)
รูปที่สอง : อีตา Project Leader ดันไปเข้าใจว่าลูกค้าอยากได้อย่างงี้ (แกว่งไม่ได้ ทำได้แค่นั่งพิงต้นไม้)
รูปที่สาม : อีตา System Analyst ฟังจาก Project Leader มาดันดีไซน์ออกมาเป็นแบบนี้ (แก้ปัญหาชิงช้าแกว่งไม่ได้ ด้วยการดัดแปลงแบบขอไปที)
รูปที่สี่ : ไอ้โปรแกรมเมอร์ดันเขียนชุ่ยๆออกมาเป็นแบบนี้ (แล้วตูจะแกว่งยังไงฟระ)
รูปที่ห้า : อีตา Business Consult ก็ดันโม้กะลูกค้าซะเต็มที่เลย ว่าโปรแกรมที่ท่านสั่ง มันจะทำได้ขนาดนี้ครับท่าน (ล่อเก้าอี้โซฟาพระราชทานกันเลย)
รูปที่หก : และนี่คือร่างเอกสารของโปรแกรมที่ทำมา (โล่งโจ้ง เพราะไม่มีใครอ่าน)
รูปที่เจ็ด : แต่จริงๆไอ้ที่ติดตั้งไป มันทำได้แค่นี้เอง (เหลือเชือกแค่เส้นเดียวเนี่ยนะ)
รูปที่แปด : แต่ลูกค้าโดนคิดตังค์ไปขนาดนี้ (สั่งชิงช้า โดนคิดเงินเท่าสร้างสวนสนุก)
รูปที่เก้า : แถม [...]
