16

1、启用:php_openssl.dll

2、新建目录:c:\openldap\sysconf(c是系统盘);

3、在sysconf下新建文件:ldap.conf,文件内容:TLS_REQCERT never

4、重启apache(IIS我没有试过,估计也是这样做)

测试:

1
2
3
4
5
6
$con = @ldap_connect('ldaps://base_dn', 636);
ldap_set_option($con, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($con, LDAP_OPT_REFERRALS, 0);
var_dump(@ldap_bind($con, 'user', 'password'));
 
输出:<strong>bool(true)</strong>

By 馒头 \\ tags: ,

06

从这里看到的:

http://www.adayinthelifeof.nl/2010/01/14/handling-binary-data-in-php-with-pack-and-unpack/

http://www.garykessler.net/library/file_sigs.html

文中给了PNG示例。我仿了一下,给了JPG示例。

1
2
3
4
5
$fh = fopen('e:/temp/d3.jpg', 'rb');
$jpg =  fread ($fh, 14);
$header = unpack ("C4header/C2length/A4identifier/C1?/C2version/C1units/", $jpg);
fclose($fh);
print_r($header);

格式如下

Start of Image (SOI) marker — two bytes (FFD8)
JFIF marker (FFE0)

  • length — two bytes
  • identifier — five bytes: 4A, 46, 49, 46, 00 (the ASCII code equivalent of a zero terminated “JFIF” string)
  • version — two bytes: often 01, 02
    • the most significant byte is used for major revisions
    • the least significant byte for minor revisions
  • units — one byte: Units for the X and Y densities
    • 0 => no units, X and Y specify the pixel aspect ratio
    • 1 => X and Y are dots per inch
    • 2 => X and Y are dots per cm
  • Xdensity — two bytes
  • Ydensity — two bytes
  • Xthumbnail — one byte: 0 = no thumbnail
  • Ythumbnail — one byte: 0 = no thumbnail
  • (RGB)n — 3n bytes: packed (24-bit) RGB values for the thumbnail pixels, n = Xthumbnail * Ythumbnail

identifier无法5个一起取出,我就先取了4个,然后再取一个。

By 馒头

30

这个需求很另类啊,不过已经基本实现了(基于wordpress自带的xmlrpc.php而成)。可用的功能有:

  1. 使用dedecms自己的模板、CSS;
  2. 发表带图片的文章;
  3. 列出最近发表的文章;
  4. 指定分类(取消了live writer新建分类的功能);
  5. 标签;
  6. 文章来源;
  7. 文章作者;
  8. 文章简介;
  9. 设置发表时间

待实现功能:编辑已经发表的文章。

//****

相关文章:

Windows Live Writer Provider Customization API

WordPress themes on Live Writer

Weblog Client

By 馒头 \\ tags: , ,

十一 16

* 将文件作为Gmail附件备份到Gmail中
* ver 1.0
* 2008-11-15 zGia!
* wuliuqiba@gmail.com

PHPMailer:

http://phpmailer.codeworxtech.com/

http://sourceforge.net/projects/phpmailer

PHP email transport class featuring file attachments, SMTP servers, CCs, BCCs, HTML messages, word wrap, and more. Sends email via sendmail, PHP mail(), QMail, or with SMTP.

更多…

By 馒头 \\ tags: , , ,

24

function fetch_prefix_bar($forumid, $selectedid = '')
{
global
$vbulletin, $stylevar, $vbphrase;

$prefix_bar = ;
if (
$prefixsets = fetch_prefix_array($forumid))
{
foreach (
$prefixsets AS $prefixsetid => $prefixes)
{
foreach (
$prefixes AS $prefixid)
{
if (
$prefixid == $selectedid)
{
$prefix_bar .= “<td>”.htmlspecialchars_uni($vbphrase["prefix_{$prefixid}_title_plain"]).“</td>”;
}
else
{
$prefix_bar .= “<td><a href=\”forumdisplay.php?” . $vbulletin->session->vars['sessionurl'] . “f=$forumid&amp;prefixid=$prefixid\”>”.htmlspecialchars_uni($vbphrase["prefix_{$prefixid}_title_plain"]).“</a></td>”;
}
}
}
}

$x = ;
if (!empty(
$prefix_bar))
{
$x = “<td><a href=\”forumdisplay.php?” . $vbulletin->session->vars['sessionurl'] . “f=$forumid\”>$vbphrase[any_prefix_meta]</a></td><td><a href=\”forumdisplay.php?” . $vbulletin->session->vars['sessionurl'] . “f=$forumid&amp;prefixid=-1\”>$vbphrase[no_prefix_meta]</a></td>”;
}

return ‘<table class=”tborder” cellpadding=”6″ cellspacing=”1″ border=”0″><tr class=”thead”>’ . $x . $prefix_bar . ‘</tr></table>’;
}

$prefix_bar = fetch_prefix_bar($foruminfo['forumid'], $vbulletin->GPC['prefixid']);

钩子位置:forumdisplay_query_threadscount。

编辑模板:FORUMDISPLAY,在<!– / controls above thread list –>下面增加:$prefix_bar

效果如图:

前缀示例图

前缀示例图

By 馒头 \\ tags:

23

其实很简单,分类-图集-图片。

分类有图集A,B,C……每个图集有若干图片;

浏览图集时,只显示一张图片,点击图片浏览图集中的另一张图片;通过链接切换到前一个、后一个图集;

在分类中上传图片(GIF,PNG,JPG),则生成图集;可以上传ZIP文件;

在浏览图集时,上传图片,则将图片上传到当前图集中;

可以使用幻灯片方式浏览分类、图集中的图片,提供了多种特效(浏览器支持才行);

评论、评分、下载图片、显示图片的EXIF信息等等都是基本功能啦。

By 馒头

07

上周二编码结束,周五结束α测试,本周开始β测试了。

By 馒头

26


====================================
 员工申请物品流程
====================================
————————————————————-
1 申请
————————————————————-
1.1 选择物品
1.2 选择审批人
1.3 提交申请
1.3.1 request表存放每个申请
1.3.2 requestitem表存放申请的物品
1.3.3 requestflow表存放申请流程处理
————————————————————-
2 部门内部处理申请
————————————————————-
2.1 审批人接到通知:短信
2.2 审批人审批,并给出意见(会签)
2.3 转交下一步
2.3.1 更高级审批人
2.3.2 库房
————————————————————-
3 库房处理
————————————————————-
有3个库房:IT库、非IT库、宣传品库。
3.1 物资负责人
3.1.1 没有物品:转采购流程
3.1.2 有相关物品:审批后,转物品库房管理员
3.2 库房管理员
3.2.1 出库,结束流程。

By 馒头 \\ tags: , ,

04

这2个月一直在做一个产品,php+mysql。有个很好听的名字:企业资产管理,Enterprise Assets Management(EAM)。

目前已经完成:

1、固定资产、非固定资产,这2种分类方式仅面向实物,而非财务;
2、计算机整机和零部件处理;
3、资产在员工之间的转移;
4、统计,使用了open flash chart提供的flash图表;
5、权限

下一步:
1、资产申请的工作流;
2、更完善的统计、报表功能。

By 馒头 \\ tags: , , ,

28

./configure –prefix=/bwserver/php525 –with-apxs2=/bwserver/apache228/bin/apxs –enable-sockets –enable-mbstring –with-zlib –with-png-dir –with-gd –with-jpeg-dir –with-freetype-dir –with-libxml-dir=/usr/local/libxml –with-mysql=/usr/local/mysql –with-mysqli=/usr/local/mysql/bin/mysql_config

发现启用mysqli后,显示:Call to undefined function mysqli_init()。

mysql.com上找到了解决方案。
http://dev.mysql.com/doc/refman/5.0/en/php-mysql-mysqli.html

Edit the Makefile and search for a line that starts with EXTRA_LIBS. It might look like this (all on one line):

EXTRA_LIBS = -lcrypt -lcrypt -lmysqlclient -lz -lresolv -lm -ldl -lnsl
-lxml2 -lz -lm -lxml2 -lz -lm -lmysqlclient -lz -lcrypt -lnsl -lm
-lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lcrypt

Remove all duplicates, so that the line looks like this (all on one line):

EXTRA_LIBS = -lcrypt -lcrypt -lmysqlclient -lz -lresolv -lm -ldl -lnsl
-lxml2

By 馒头