- 主题:写个自动发文的东东,不知道哪里错了。
#include <stdio.h>
#include <time.h>
#include "src/bbs.h"
#include "src/urlencode.c"
int main(int argc, char **argv)
{
time_t now;
struct tm ptime;
time(&now);
ptime = *localtime(&now);
if (ptime.tm_hour == 23) {
char fname[STRLEN];
sprintf(fname, "%d年%2d月%2d日版主考勤", ptime.tm_year + 1900, ptime.tm_mon + 1, ptime.tm_mday);
post_file(NULL, "", "0Announce/bbslists/lazybm", "BBSLists", fname, 0, 1, getSession());
}
}
想把lazybm文件自动发到BBSLists板块,lazybm已经通过/usr/local/bbs/bin/lazybm生成,没有使用autopost主要考虑每周发一次,并不想每天都发。写好好存为/src/postBM.c
然后 [root@bbs kbs_bbs]# gcc src/postBM.c
In file included from src/postBM.c:9:
src/bbs.h:27:24: kbs_config.h: No such file or directory
In file included from src/postBM.c:9:
src/bbs.h:137: warning: redefinition of `sig_t'
/usr/include/signal.h:197: warning: `sig_t' previously declared here
src/bbs.h:141: warning: redefinition of `socklen_t'
/usr/include/unistd.h:243: warning: `socklen_t' previously declared here
In file included from src/bbs.h:330,
from src/postBM.c:9:
src/struct.h:492: field `fromip' has incomplete type
In file included from src/system.h:8,
from src/bbs.h:487,
from src/postBM.c:9:
/usr/include/string.h:257: syntax error before '(' token
/usr/include/string.h:257: syntax error before "const"
/usr/include/string.h:260: syntax error before '(' token
In file included from src/bbs.h:487,
from src/postBM.c:9:
src/system.h:16:24: kbs_config.h: No such file or directory
In file included from src/bbs.h:642,
from src/postBM.c:9:
src/func.h:5:19: mysql.h: No such file or directory
In file included from src/bbs.h:642,
from src/postBM.c:9:
src/func.h:607: syntax error before '*' token
src/func.h:607: syntax error before '*' token
src/func.h:607: warning: data definition has no type or storage class
src/func.h:608: syntax error before '*' token
src/func.h:608: syntax error before '*' token
src/func.h:608: warning: data definition has no type or storage class
src/func.h:609: syntax error before '*' token
src/func.h:609: syntax error before '*' token
src/func.h:609: warning: data definition has no type or storage class
src/postBM.c:10:23: urlencode.c: No such file or directory
请问哪个大哥帮我看看哪里错了?
--
FROM 222.172.221.*
先调用
init_all()
然后 getSsession() 或许有问题,这里没有session啊。
【 在 wchun (别克) 的大作中提到: 】
: #include <stdio.h>
: #include <time.h>
: #include "src/bbs.h"
: ...................
--
FROM 59.66.199.*
直接写在有类似发文函数的地方。
改成你要的样子就可以了,不用单独搞一个:)
【 在 wchun (别克) 的大作中提到: 】
: #include <stdio.h>
: #include <time.h>
: #include "src/bbs.h"
: ...................
--
FROM 221.192.208.*
转每周版面使用统计到BBSLists版
kbbsbbs/local_utl/poststat.c 831 line add
#ifdef SCU_BUILD
/*
* 每周把
* 0Announce/bbslists/board.1
* 0Announce/bbslists/board.2
* 转往BBSLists版一份。
* by paper@lsxk.org 2006.5.15
*/
sprintf(fname, "%d年%2d月%2d日本周各板使用状况统计图", ptime.tm_year +
1900, ptime.tm_mon + 1, ptime.tm_mday);
post_file(NULL, "", "0Announce/bbslists/board.1", "BBSLists", fname, 0,
1, getSession());
sprintf(fname, "%d年%2d月%2d日本周各板使用状况统计表(以总阅读人次排序)
", ptime.tm_year + 1900, ptime.tm_mon + 1, ptime.tm_mday);
post_file(NULL, "", "0Announce/bbslists/board.2", "BBSLists", fname, 0,
1, getSession());
#endif
【 在 wchun@newsmth.net-SPAM.no (别克) 的大作中提到: 】
: 想把lazybm文件自动发到BBSLists板块,lazybm已经通过/usr/local/bbs/bin/lazybm生成,没有使用autopost主要考虑每周发一次,并不想每天都发。写好好存为/src/postBM.c
--
谢谢~ 已经搞定!
谢谢楼上所有帮助我的大哥!
【 在 paper@lsxk.org-SPAM.no (为人而活得人啊:不能死,不成活) 的大作中提到: 】
: 转每周版面使用统计到BBSLists版
: kbbsbbs/local_utl/poststat.c 831 line add
: #ifdef SCU_BUILD
: ...................
--
FROM 222.172.221.*