欢迎各位兄弟 发布技术文章
这里的技术是共享的
这里有一个模块,使设计Drupal简单得多。这是Theme Developer主题开发模块。它可以让你点击你的网站上的几乎任何部分,看看它是如何构建的。
dede/content_list.php?channelid=1&cid=14
刚开始的时候 (一小时之内 )最下面的计数是 递加 1
也就是缓存 文件 让计数为0 在最初的一个时候 是递加的
content_list.php 大约100行左右
这种东西 好像是超过一个小时 之后 才从缓存中取数据
不过 如果从缓存中取的话 就有个问题 就是
最下面的计算 过了一个小时 它才有更新
<?phpheader('Content-Type: text/html; charset=UTF-8');header('Content-Type: image/jpeg; charset=UTF-8');header('Content-Type: image/jpg; charset=UTF-8');header('LOCATION:./index.php');//或者,如下 也可以header('LOCATION: ./list.php'); header("Content-Type: image/bmp"); header("Content-Type: image/jpeg");?>
<?PHP//这是史平忠找来的验证码session_start();//session_register('SafeCode');$type = 'gif';$width= 50;$height= 20;header("Content-type: image/".$type);srand((double)microtime()*1000000);$randval = randStr(4,"");if($type!='gif' && function_exists('imagecreatetruecolor')){ $im = @imagecreatetruecolor($width,$height);}else{ $im = @imagecreate($width,$height);} $r = Array(225,211,255,223); $g = Array(225,236,237,215); $b = Array(225,236,166,125);
PHP函数篇详解十进制、二进制、八进制和十六进制互相转换函数说明,主要掌握各进制转换的方法,以应用于实际开发。
<?php//把时间串转成unix时间戳echo strtotime("2009-08-06 00:00:02");$aaa = "2011-03-02 23:00".':00';var_dump(strtotime($aaa));?>
$test = sprintf("SELECT * FROM `table` WHERE `text` LIKE '%%%s%%'", mysql_real_escape_string('test'));
String.prototype.ltrim=function(){ return this.replace(/^\s+/,"");}String.prototype.rtrim=function(){ return this.replace(/\s+$/,"");}String.prototype.trim=function(){ return this.ltrim().rtrim();}function checkDate(){ var $dtTimeStart = $('#stime_search').val().trim(); var $dtTimeEnd = $('#etime_search').val().trim();
$(function(){ $("#stime_search").datepicker({dateFormat: 'yy-mm-dd',showOn: 'button', buttonImage: '../css/le-frog/images/calendar.gif', buttonImageOnly: true}); $("#etime_search").datepicker({dateFormat: 'yy-mm-dd',showOn: 'button', buttonImage: '../css/le-frog/images/calendar.gif', buttonImageOnly: true}); });
模板中的注释是星号开头,然后外面包含着
解压 tar -xf all.tartar -xzvf file.tar.gz //解压tar.gztar -zxvf onepackage.tgz或者 tar -zxvf onepackage.tar.gztar -zxvf VMwareTools-5.0.0-12124.i386.tar.gz -C /tmp (把安装文件解压到/tmp)如果您看到 .gz, (.tar.gz)(好像不对) 的文件,都是 gzip 程序压缩的杰作。 gunzip big1.gz //解压.gz的文件gunzip 有几个选项较常使用: l -f 当解压时如果遇到有同名的文件存在,就直接覆盖,不必再询问。 l -r 将子目录中的文件全部解压缩。 l -v 解压缩过程当中显示进度。.tar.bz2的解压老版本的linux要两步,一步是解压缩,一步是解包bzip2 -d **.tar.bz2 //将文件解压成**.tartar -xf **.tar //解包
//这两个好像是有区别的window.location.href=location.href;window.location.reload();//指的是 在浏览器上的 url,,,当然在 浏览器上是伪静态,得出的 location.href 也是伪静态alert(location.href);<script> alert("1: " + window.location.href); alert("2: " + window.location); alert("3: " + location.href); alert("4: " + parent.location.href); alert("5: " + top.location.href); alert("6: " + document.location.href); </script>
时间 {$row.senddate|date_format:"%Y-%m-%d %H:%M:%S"} //以年月(有前导0)日(有前导0)时(24时制)分秒显示
pubdate:发布时间(前台可更改) 好像前台默认是pubdate倒序的 让它进行时间倒序{dede:arclist}和 {dede:list}都是如此的pubdate:发布时间(前台可更改) 在后台如果改一下它 那么 pubdate 和 sortrank 同时更改senddate:入库时间 (就是录入时间) 第一次增加这个文章时的时间 理论上后台是不可以修改的sortrank:前台调用最新文章。实际上是用这个时间。select sortrank,pubdate , senddate from dede_archives where id=7211351143848 1351143848 1350999351当更改之后 ,sortrank,pubdate两者相等,senddate(录入时间)是不变的
在使用smarty的时候,如果没有更改smarty配置,smarty的定界符是{ },大家经常可能碰到模板页中js无法正确执行的问题。
这就是因为smarty引擎把js中{ }之间的内容也当做smarty语句来处理,本人总结的解决这个问题主要有三个:
1.更改smarty配置文件中的定界符。(就我而言,已经习惯了用{ },所以一般不用这种方法。)
2.把javascript代码写到一个js文件中,在模板页中引用即可。
3.使用smarty内置的literal标签,此标签内的数据将会被当做文本处理。例如
{literal}
<script language=javascript>
........
</script>
{/literal}
有时,我们需要输出定界符{ },则可以使用{ldelim}和{rdelim}标签来输出左右定界符。
preg_ split() 函数用于正则表达式分割字符串。
语法:
array preg_split( string pattern, string subject [, int limit [, int flags]] )
返回一个数组,包含 subject 中沿着与 pattern 匹配的边界所分割的子串。
http://sunlogin.oray.com/zh_CN/
http://sunlogin.oray.com/zh_CN/help/1186.html
这两个是 向日葵主网站 有下载 有使用方法
第一种方法 这种方法 中文不会突出显示 即不会有 strong
warning: Parameter 2 to node_limit_interval_node_limit_applies_in_context() expected to be a reference, value given可能是由于开启 西部数码的php.ini的缘故 具体是什么原因 暂时还不知道
快捷键有冲突,可以将快捷键设置为Fn F1-12来解决。
hook_views_pre_view
hook_views_pre_render https://api.drupal.org/api/views/docs%21docs.php/function/hook_views_pre_render/6
hook_views_data_alter https://api.drupal.org/api/views/docs%21docs.php/function/hook_views_data_alter/6