form_command_4::form_command_4(QWidget *parent) : QWidget(parent), ui(new Ui::form_command_4) { ui->setupUi(this); timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(update_form())); timer->start(200); clipboard = QApplication::clipboard(); }
ui_edit_articulo::ui_edit_articulo(object_e_articulo *ar, QWidget *parent) : QDialog(parent), ui(new Ui::ui_edit_articulos) { ui->setupUi(this); update_form(); //ui->l_grupo_2->setVisible(false); // ui->cb_grupo->setVisible(false); //ui->btn_add_grupo->setVisible(false); load_selected_articulo(ar); }
int main() { FILE *fp; int type=0, i, num, l; char userid[80], buf[512], path[512], file[512], board[512], title[80]=""; //struct shortfile *brd; struct fileheader *x; char c;//huangxu@060331 init_all(); modify_mode(u_info,EDIT+20000); //bluetent if(!loginok) http_fatal("匆匆过客不能修改文章,请先登录"); strsncpy(board, getparm("board"), 20); type=atoi(getparm("type")); brd=getbcache(board); if(brd==0) http_fatal("错误的讨论区!"); strcpy(board, brd->filename); strsncpy(file, getparm("file"), 20); if(!has_post_perm(¤tuser, board)) http_fatal("错误的讨论区或者您无权在此讨论区发表文章"); x=get_file_ent(board, file); if(strstr(file, "..") || strstr(file, "/")) http_fatal("错误的参数"); if(x==0) http_fatal("错误的参数"); if(strcmp(x->owner, currentuser.userid)) if(!has_BM_perm(¤tuser, board)) http_fatal("你无权修改此文章"); printf("<center>%s -- 修改文章 [使用者: %s]<hr color=green>\n", BBSNAME, currentuser.userid); if(type!=0) return update_form(board, file); printf("<table border=1>\n"); printf("<tr><td>"); printf("<tr><td><form method=post action=bbsedit>\n"); hsprintf(buf, "%s", x->title); printf("使用标题: %s 讨论区: %s<br>\n", buf, board); printf("本文作者:%s<br>\n", currentuser.userid); sprintf(path, "boards/%s/%s", board, file); fp=fopen(path, "r"); if(fp==0) http_fatal("文件丢失"); fseek(fp,0,2); l=ftell(fp); fseek(fp,0,0); for (i=4;l>0&&i>0;l--)//huangxu@060331 { c=fgetc(fp); if (c==0x0a) i--; } if (l<=0) http_fatal("错误的文件"); printf("<textarea name=text rows=20 cols=80 wrap=physicle>"); while(1) { if(fgets(buf, 500, fp)==0) break; //为什么这些代码无法工作? /*for (;i>0;i--) { printf("CHAR::%d::",*(buf+44)); pbuf++; pbuf=strchr(pbuf,0x0a); if (!pbuf) { printf("NOTFOUND%d",i); break; } printf("FOUND:%d,Length:%d,str=%s::",pbuf-buf,strlen(buf),buf); }*/ if(!strcasestr(buf, "</textarea>")) printf("%s", buf); } fclose(fp); printf("</textarea>\n"); printf("<tr><td class=post align=center>\n"); printf("<input type=hidden name=type value=1>\n"); printf("<input type=hidden name=board value=%s>\n", board); printf("<input type=hidden name=file value=%s>\n", file); printf("<input type=submit value=存盘> \n"); printf("<input type=button value=放弃编辑 onclick=javascript:history.go(-1)></form>\n"); printf("</table>"); http_quit(); }