Drupal

Text CAPTCHA is not efficient

หลังจากทดลองใช้ Text CAPTCHA มาตั้งแต่เปิด blog ก็พบว่ามันป้องกัน spam comment ได้ไม่ดีเอาเสียเลย (มี 30 กว่า spam comment)

วันนี้อารมณ์ดี เลยทำการกวาดบ้าน (ลบ spam comment ทั้งหมด) และลองเปลี่ยนไปใช้ image CAPTCHA แทน
(มาพร้อมกับ drupal captcha module ตัวเดิมนี่หละ แต่ตอนแรกไม่ได้ enable ไว้)

ถ้ายังไม่ดีขึ้นอีก เดี๋ยวจะไปลอง Mollom

Drupal : Attach image to node

Looking for WYSIWYG editor and found that FCKeditor is not working well and also outdated ! CKeditor is the successor, installation does not require WYSIWYG module.

To get you WYSIWYG editor with image attachable feature (well, IMHO attaching image is must have feature!) you need

Setting up IMCE to use with CKEditor, here is steps

  • Go to Home > Administer > Site configuration > IMCE
  • At "Role-profile assignments", assign Role that is allowed to use IMCE profile (e.g. only Authenticated user that is allow to use IMCE)
  • Go to Home > Administer > Site configuration > CKEditor
  • Select CKEditor profile you want to configure
  • At "Basic setup", select "Role" that will be allowed to use this profile
  • At "File browser settings", select "File browser type (Link dialog) = IMCE"
  • Done !

Attaching image is a bit tricky, not friendly at all. You need following steps to upload file from your PC for using in CKEditor

  • Click "image" icon
  • Click "Browser" button, new window wil be opened
  • Click "Upload" link (the link at is middle top of new window)
  • Click "Choose" button, this is to browse for a file in you PC
  • Click "Upload" button, it will say that "Uploading ..." in log window below
  • Hit F5 button to refresh (yes, it does not have auto-refresh)
  • Your image should be in the list in IMCE window, select it and click "Send to ckeditor" link
  • Done ! you are back to CKEditor with you image

Thanks Drupal Community for suggestion.

Drupal : Views slideshow does not slide

Recently I have just install Views slideshow module into one of my Drupal side, I am sure I have configured correctly - but it DOES NOT slide ! Even it is working fine my another site !

I scratched my head for a week, until the light is brought by one of my good friend. He said,

Disable Devel module, seems like jQuery goes wrong somehow when this module is on

Thanks to Mr.Yuttana ! it works like a charm, woopie !!!

Drupal on localhost (test machine)

ลง Windows ใหม่มาสักพัีก เพิ่งจะมาได้ติดตั้ง test environment ใหม่บนเครื่อง
ไว้ทำงาน Drupal แบบ offline ได้
ก็จดไว้คร่าวๆ ว่าลงอะไร และติดปัญหาอะไรบ้าง

Apache, MySQL, PHP

CMS

Theme

Drupal - Users can't edit some content

  • Cause Problematic content has a special (non-default) input format, e.g. Rich Text and user does not have a grant to access this format type.

  • Solution Grant following permission to that user role
    filter -> administer filters

source : http://drupal.org/node/226968

Spam is attacking my blog

[TH] ห่างหายจากการ update เว็บไปพักใหญ่ กลับมาอีกทีเว็บโดน spam เล่นงาน ทุกโพสโดน spam ไป 10 กว่า comment นั่งลบกันจนเซ็ง ได้ฤกษ์ install captcha module เสียที

ตอนแรกนี้ตั้งไว้เป็นแบบ text captcha เพราะคิดว่าน่าจะโหลดน้อยกว่า image captcha นิดหนึ่ง ลองดูผลก่อนว่าเป็นอย่างไร ถ้าไม่ work ค่อยขยับไปลอง image capthca อีกที (ทั้ง text และ image captcha มาใน package เดียวกัน เลือกได้ว่าจะใช้อันไหน ที่จุดใด)

ป.ล. ถ้ามองในแง่ดี คือเว็บเริ่มมีคน (พวก spammer) รู้จักมากขึ้น ... ฮา

[EN]

Build Drupal Taxonomy list into a Block

  • Create new block (Home › Administer › Site building › Blocks › Add block)
  • Put following code into "Block body", set $vid as mentioned in the comment
  • Set "input format" to "PHP code"

`<?php $vid = 1; // Set the vid to the vocabulary id of the vocabulary you wish to list the terms from $items = array(); $terms = taxonomy_get_tree($vid); foreach ( $terms as $term ) { $count = db_result(db_query("SELECT COUNT(nid) FROM {term_node} WHERE tid = %d", $term->tid)); $items[] = l($term->name, "taxonomy/term/$term->tid") . " ($count)"; }

Move Drupal to sub-directory

One of my production site have just been installed Drupal in the root directory, i.e. visitor browse to www.mysite.com will be brought to Drupal main page. Anyway, our Drupal configuration and contents are not ready yet, so we decide to pull it back - create other few pages as temporary, visitor will see this instead when browse to www.mysite.com. And then, move all Drupal files to new sub-directory, called "drupal", that we can access by pointing to www.mysite.com/drupal. This will let us have a test environment - on a live server, and continue development work at background.

Product image not show up in Ubercart

Problem

  • Upload images for product, it show up on the product "edit" page. (correct)
  • But product image does not show up in Store Administration -> Products (incorrect !)
  • All of the products are listed, but the column for IMAGE says "n/a" for each product (incorrect)

Resolution (thanks to source)

  • Go to Content management -> Content type -> Field
  • Delete "image" field from "Product"
  • Go to Store administration -> status message -> images
Syndicate content