- 主题:wForum贴附件碰到些问题
一是附件得文件夹好像创建不料
然后直接使用了一个已存在得文件夹
,说是附件粘贴成功,但是实际上文件夹中什么也没有
前辈帮说说?
--
FROM 210.26.57.*
检查你wForum/inc/site.php里面getattachtmppath的定义。
【 在 luobeng@lzusiyu.org (罗嘣) 的大作中提到: 】
: 一是附件得文件夹好像创建不料
: 然后直接使用了一个已存在得文件夹
: ,说是附件粘贴成功,但是实际上文件夹中什么也没有
: 前辈帮说说?
--
开始shi
$attachdir="cache/home/" . strtoupper(substr($userid,0,1)) . "/" . $userid . "/" . $utmpnum ."/upload";
但是这个建立不料
后来我 改成了
$attachdir="cache/upload";
说上传成功了,但是实际上没有东西
也引用不出来
【 在 atppp@bbs.stanford.edu-SPAM.no (Big Mouse) 的大作中提到: 】
: 检查你wForum/inc/site.php里面getattachtmppath的定义。
--
FROM 210.26.57.*
这个问题以前说过了,我在重提一次希望smth能改吧。
bbs2www/phplib/phplibbbs.c bbs_postarticle()函数是这样写的:
#if USE_TMPFS==1
snprintf(buf,MAXPATH,"%s/home/%c/%s/%d/upload",TMPFSROOT,toupper(currentuser->userid[0]),
currentuser->userid,getcurrentuinfo_num());
#else
snprintf(buf,MAXPATH,"%s/%s_%d",ATTACHTMPPATH,currentuser->userid,getcurrentuinfo_num());
#endif
这个地方是获取上传文件目录的,和site.php里面的getattachtmppath()函数完全没有关系,但是,这两个地方必须严格一致才能保证上传文件运行正常。我设想的一种改法是,把
getattachtmppath()放进phplibbbs.c里面,然后bbs_postarticle()也调用这个函数,
site.php里面去掉这个函数。
但是这个改动似乎有点大了,反正如果大家碰到问题知道是这里要调整就好了。
【 在 luobeng@lzusiyu.org (罗嘣) 的大作中提到: 】
: 开始shi
: $attachdir="cache/home/" . strtoupper(substr($userid,0,1)) . "/" . $userid . "/" . $utmpnum ."/upload";
: 但是这个建立不料
: 后来我 改成了
: $attachdir="cache/upload";
: 说上传成功了,但是实际上没有东西
: 也引用不出来
: 【 在 atppp@bbs.stanford.edu-SPAM.no (Big Mouse) 的大作中提到: 】
: : 检查你wForum/inc/site.php里面getattachtmppath的定义。
--
我得phplibbbs.c中
snprintf(buf, MAXPATH, "%s/%s_%d", ATTACHTMPPATH, currentuser->userid, getcurrentuinfo_num());
然后site.php
$attachdir="/home/bbs/boards/_attach/" . $userid . "_" . $utmpnum ;
发附件了以后,能显示有附件,但是附件,例如,图片,显示不出来,
点击以后出现下面若干错误
Warning: unpack(): Type N: not enough input, need 4, have 0 in /home/siyuwww/htdocs/wForum/bbscon.php on line 133
Warning: Cannot modify header information - headers already sent by (output started at /home/siyuwww/htdocs/wForum/bbscon.php:133) in /home/siyuwww/htdocs/wForum/bbscon.php on line 135
Warning: Cannot modify header information - headers already sent by (output started at /home/siyuwww/htdocs/wForum/bbscon.php:133) in /home/siyuwww/htdocs/wForum/bbscon.php on line 137
Warning: Cannot modify header information - headers already sent by (output started at /home/siyuwww/htdocs/wForum/bbscon.php:133) in /home/siyuwww/htdocs/wForum/bbscon.php on line 138
Warning: Cannot modify header information - headers already sent by (output started at /home/siyuwww/htdocs/wForum/bbscon.php:133) in /home/siyuwww/htdocs/wForum/bbscon.php on line 139
Warning: fread(): Length parameter must be greater than 0. in /home/siyuwww/htdocs/wForum/bbscon.php on line 140
你是怎么解决这个得
【 在 atppp@bbs.stanford.edu-SPAM.no (Big Mouse) 的大作中提到: 】
: 这个问题以前说过了,我在重提一次希望smth能改吧。
: bbs2www/phplib/phplibbbs.c bbs_postarticle()函数是这样写的:
: #if USE_TMPFS==1
: snprintf(buf,MAXPATH,"%s/home/%c/%s/%d/upload",TMPFSROOT,toupper(currentuser->userid[0]),
: currentuser->userid,getcurrentuinfo_num());
: #else
: snprintf(buf,MAXPATH,"%s/%s_%d",ATTACHTMPPATH,currentuser->userid,getcurrentuinfo_num());
: #endif
: 这个地方是获取上传文件目录的,和site.php里面的getattachtmppath()函数完全没有关系,但是,这两个地方必须严格一致才能保证上传文件运行正常。我设想的一种改法是,把
: getattachtmppath()放进phplibbbs.c里面,然后bbs_postarticle()也调用这个函数,
: site.php里面去掉这个函数。
: ...................
--
FROM 210.26.57.*
那在普通bbs2www界面里面这个附件能显示吗?我没有这个问题。
【 在 luobeng@lzusiyu.org (罗嘣) 的大作中提到: 】
: 我得phplibbbs.c中
: snprintf(buf, MAXPATH, "%s/%s_%d", ATTACHTMPPATH, currentuser->userid, getcurrentuinfo_num());
: 然后site.php
: $attachdir="/home/bbs/boards/_attach/" . $userid . "_" . $utmpnum ;
: 发附件了以后,能显示有附件,但是附件,例如,图片,显示不出来,
: 点击以后出现下面若干错误
: Warning: unpack(): Type N: not enough input, need 4, have 0 in /home/siyuwww/htdocs/wForum/bbscon.php on line 133
: Warning: Cannot modify header information - headers already sent by (output started at /home/siyuwww/htdocs/wForum/bbscon.php:133) in /home/siyuwww/htdocs/wForum/bbscon.php on line 135
: Warning: Cannot modify header information - headers already sent by (output started at /home/siyuwww/htdocs/wForum/bbscon.php:133) in /home/siyuwww/htdocs/wForum/bbscon.php on line 137
: Warning: Cannot modify header information - headers already sent by (output started at /home/siyuwww/htdocs/wForum/bbscon.php:133) in /home/siyuwww/htdocs/wForum/bbscon.php on line 138
: ...................
--
可以,
在wforum上面贴了
以后在bbs2www上面能够正常得看到
真是郁闷
汗
【 在 atppp@bbs.stanford.edu-SPAM.no (Big Mouse) 的大作中提到: 】
: 那在普通bbs2www界面里面这个附件能显示吗?我没有这个问题。
--
FROM 210.26.57.*
cvs diff -up -r 1.230 -r 1.231 bbs2www/lib/bbslib.c
【 在 luobeng@lzusiyu.org (罗嘣) 的大作中提到: 】
: 可以,
: 在wforum上面贴了
: 以后在bbs2www上面能够正常得看到
: 真是郁闷
: 汗
: 【 在 atppp@bbs.stanford.edu-SPAM.no (Big Mouse) 的大作中提到: 】
: : 那在普通bbs2www界面里面这个附件能显示吗?我没有这个问题。
--
上课去先,
中午回来yong ,呵呵
【 在 atppp@bbs.stanford.edu-SPAM.no (Big Mouse) 的大作中提到: 】
: cvs diff -up -r 1.230 -r 1.231 bbs2www/lib/bbslib.c
--
FROM 210.26.57.*