ผมใช้เวลานานกว่าจะหาทางทำให้ drupal (4.7.x) แสดง block เฉพาะ user ที่ login แล้วได้
วิธีการง่ายๆ (แต่หา document ยาก) แค่ ใส่คำสั่งต่อไปนี้ในส่วนของ Page specific visibility settings ของ block นั้นๆ (ให้เลือก Show if the following PHP code returns TRUE (PHP-mode, experts only) ก่อนด้วยครับ)
< ?php
global $user;
return (bool) $user->uid;
?>
URL ที่เกี่ยวข้อง:
http://drupal.org/node/60317
http://drupal.org/node/64854
< ?php
/**
* The following simple snippet
* displays different information to anonymous/logged in users within a page.
*
* This works with drupal 4.5 and drupal 4.6
*/
global $user;
if ($user->uid) {
return “This message is only visible for logged-in users.”;
}
วิธีการใส่ external page ใน drupal ครับ แต่รูปภาพอาจไม่มาด้วย
< ?php
ob_start();
include_once “http://www.WebSiteToInclude.com/”;
$output = ob_get_contents();
ob_end_clean();
return $output;
?>
Tags
.htaccess Apache blogspot CentOS codeigniter CSS domain name driver Drupal Flickr Hotmail HTML internet law linux mailing list mailman MICT mod_rewrite monitor MSL MySQL name server Network open source PHP Postfix Security Smarty sony Spammail SPF theme TLS traffic log Universiade UTF-8 UTF8 vbulletin Wordpress การเมือง จตุคาม รูปภาพ สถิติ เรารักในหลวง
