Drupal常用模块(Module)列表

1.CCK (Content Construction Kit ) 用途: 添加字段模块
2. Views 用途:生成列表
3. Phptemplate Theme Engine (continue reading…)

1 Comment more...

drupal_load加载时的内存占用量(drupal 6.x) 一览表

drupal占用的资源中1/3以上耗在加载模块的module文件上。加inc文件应该也占去不少。然后tpl.php模块文件加载几十次,加上各种各样的静态变量,全局变量,局部变量,用个四五十mb的内存也就不奇怪了 (continue reading…)


Incompatible with this version of Drupal core

; $Id$
name = Annotate

description = Allows users to annotate nodes.
package = Example
version = “$Name$” (continue reading…)


typo3 – SSL

下载插件: https_enforcer
http://typo3.org/extensions/repository/view/https_enforcer/current/
 (continue reading...)

typo3插件添加后台配置

1. 建立文件 ext_conf_template.txt
内 容: (continue reading…)


array转化为ul li

function recursion($multi_dimensional_array)
{
$m = $multi_dimensional_array;
$keys = array();
foreach($m as $key=>$value)
{
$keys[] = $key;
}
$i = 0;
while($i < count($multi_dimensional_array))
{
echo ‘<li><a href=”#”>’.$keys[$i].'</a>’;
if(is_array($multi_dimensional_array[$keys[$i]]))
{
echo ‘<ul>’;
recursion($multi_dimensional_array[$keys[$i]]);
echo ‘</ul>’;
}
echo ‘</li>’;
$i++;
}
}

配合jquery-treeview效果如下:


divider使用方法

TS中加入:
tt_content.div >
tt_content.div = TEXT
tt_content.div.value = <hr />


php遍历文件夹并存入数组

<?php
$dir = dirname(__FILE__);
function read_dir_all($dir) {
$ret = array(‘dirs’=>array(), ‘files’=>array());
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if($file != ‘.’ && $file !== ‘..’) {
$cur_path = $dir . DIRECTORY_SEPARATOR . $file;
if(is_dir($cur_path)) {
$ret[‘dirs’][$cur_path] = read_dir_all($cur_path);
} else {
$ret[‘files’][] = $cur_path;
}
}
}
closedir($handle);
}
return $ret;
}

$p = read_dir_all($dir);
echo ‘<pre>’;
var_dump($p);
echo ‘</pre>’;
?>

优化版:

function read_dir_all($dir) {
$ret = array();
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if($file != ‘.’ && $file !== ‘..’) {
$cur_path = $dir . DIRECTORY_SEPARATOR . $file;
if(is_dir($cur_path)) {
$ret[$cur_path] = read_dir_all($cur_path);
} else {
$ret[$cur_path] = $cur_path;
}
}
}
closedir($handle);
}
return $ret;
}
(continue reading…)


php文件搜索

<?php
set_time_limit(0);

function searchfromtime($dir,$fromtime,$totime) {
    $handle=opendir($dir);
    if($handle){

        while(($file=readdir($handle))!==false){

            if($file!=”.” && $file!=”..”){

                $file=$dir .’\\’. $file;

                if(is_dir($file)){

                    searchfromtime($file,$fromtime,$totime);
                }else{
     $time = filemtime($file);
     if(strtotime($fromtime)<=$time&&$time<=($totime?strtotime($totime):time())){
      echo $file.'<br/>’;
     }
                }
            }
        }
    }
}

echo searchfromtime(dirname(__FILE__),’2010-05-24′,’2010-06-07′);
?>

1 Comment more...

TS-tt_content

# ***************************************************************************
# Notice: “styles.” (and “temp.”) objects are UNSET after template parsing!
# Use “lib.” for persisting storage of objects.
# *************************************************************************** (continue reading…)


Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress