ギコナビ
修訂 | 1ef4698cd75c4317670ba7c19e2a99aef9c32b15 (tree) |
---|---|
時間 | 2005-11-03 03:10:55 |
作者 | h677 <h677> |
Commiter | h677 |
ConvRes内の最適化
@@ -43,7 +43,6 @@ type | ||
43 | 43 | function LoadFromSkin(fileName: string; ThreadItem: TThreadItem; SizeByte: Integer): string; |
44 | 44 | function SkinedRes(skin: string; Res: TResRec; No: string): string; |
45 | 45 | function ConvRes(const Body, Bbs, Key, ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue : string; DatToHTML: boolean = false): string; overload; |
46 | - function ConvRes(const Body, Bbs, Key, ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue, FullURL : string): string; overload; | |
47 | 46 | procedure CreateHTML2(doc: IDispatch; ThreadItem: TThreadItem; var sTitle: string); |
48 | 47 | procedure CreateHTML3(var html: TStringList; ThreadItem: TThreadItem; var sTitle: string); |
49 | 48 | end; |
@@ -326,7 +325,6 @@ function THTMLCreate.ConvRes(const Body, Bbs, Key, | ||
326 | 325 | const |
327 | 326 | GT = '>'; |
328 | 327 | SN = '0123456789'; |
329 | - ZN = 'OPQRSTUVWX'; | |
330 | 328 | FORMAT_LINK = '<a href="../test/read.cgi?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s" target="_blank">'; |
331 | 329 | var |
332 | 330 | i : integer; |
@@ -341,7 +339,7 @@ var | ||
341 | 339 | token : array[0..5] of string; |
342 | 340 | ch : string; |
343 | 341 | db : boolean; |
344 | - | |
342 | + len : integer; | |
345 | 343 | begin |
346 | 344 | //s É{¶ðSüêé |
347 | 345 | s := Body; |
@@ -356,10 +354,10 @@ begin | ||
356 | 354 | token[5] := '<A '; |
357 | 355 | |
358 | 356 | // |
359 | - while Length(s) > 0 do begin | |
357 | + while Length(s) > 2 do begin | |
360 | 358 | pmin := Length(s) + 1; |
361 | - i := length(token); | |
362 | - for j := 0 to length(token) - 1 do begin | |
359 | + i := Length(token); | |
360 | + for j := 0 to Length(token) - 1 do begin | |
363 | 361 | pos := AnsiPos(token[j], s); |
364 | 362 | if pos <> 0 then begin |
365 | 363 | if pos < pmin then begin |
@@ -375,7 +373,7 @@ begin | ||
375 | 373 | Result := Result + Copy(s, 1, pmin - 1); |
376 | 374 | Delete(s, 1, pmin - 1); |
377 | 375 | |
378 | - if i = length(token) then begin | |
376 | + if i = 6 then begin | |
379 | 377 | //qbgȵ |
380 | 378 | end else if (i = 4) or (i = 5) then begin |
381 | 379 | //'<a ' or '<A' Åqbg '</a>' or '</A>' ÜÅRs[ |
@@ -397,7 +395,8 @@ begin | ||
397 | 395 | No := ''; |
398 | 396 | sw := false; |
399 | 397 | db := false; |
400 | - while j <= Length(s) do begin | |
398 | + len := Length(s); | |
399 | + while j <= len do begin | |
401 | 400 | if (ByteType(s, j) = mbSingleByte) then begin |
402 | 401 | //1byte¶ |
403 | 402 | ch := s[j]; |
@@ -410,7 +409,7 @@ begin | ||
410 | 409 | db := true; |
411 | 410 | end; |
412 | 411 | |
413 | - if AnsiPos(ch, SN) > 0 then begin | |
412 | + if System.Pos(ch, SN) > 0 then begin | |
414 | 413 | No := No + ch; |
415 | 414 | end else if (ch = '-') then begin |
416 | 415 | if sw then break; |
@@ -421,7 +420,7 @@ begin | ||
421 | 420 | end; |
422 | 421 | end; |
423 | 422 | //I[ÜÅsÁÄÌI¹©`FbN |
424 | - if j <= Length(s) then begin | |
423 | + if j <= len then begin | |
425 | 424 | if db then j := j - 2 |
426 | 425 | else j := j - 1; |
427 | 426 | end; |
@@ -433,387 +432,16 @@ begin | ||
433 | 432 | |
434 | 433 | if not DatToHTML then begin |
435 | 434 | Result := Result + Format(FORMAT_LINK, |
436 | - [ParamBBS, Bbs, ParamKey, Key, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) | |
437 | - + Copy(s, 1, j - 1) + '</a>'; | |
435 | + [ParamBBS, Bbs, ParamKey, Key, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]); | |
438 | 436 | end else begin |
439 | - Result := Result + Format('<a href="#%s">', [st]) | |
440 | - + Copy(s, 1, j - 1) + '</a>'; | |
437 | + Result := Result + Format('<a href="#%s">', [st]); | |
441 | 438 | end; |
439 | + Result := Result + Copy(s, 1, j - 1) + '</a>'; | |
442 | 440 | end; |
443 | 441 | Delete(s, 1, j - 1); |
444 | 442 | end; |
445 | 443 | end; |
446 | -end; | |
447 | -{ | |
448 | -function THTMLCreate.ConvRes(const Body, Bbs, Key, | |
449 | - ParamBBS, ParamKey, ParamStart, ParamTo, ParamNoFirst, ParamTrue : string; | |
450 | - DatToHTML: boolean = false): string; | |
451 | -type | |
452 | - PIndex = ^TIndex; | |
453 | - TIndex = record | |
454 | - FIndexFrom : integer; | |
455 | - FIndexTo : integer; | |
456 | - FNo : string; | |
457 | - end; | |
458 | -const | |
459 | - GT = '>'; | |
460 | - SN = '0123456789-'; | |
461 | - ZN = 'OPQRSTUVWX|'; | |
462 | - FORMAT_LINK = '<a href="../test/read.cgi?%s=%s&%s=%s&%s=%s&%s=%s&%s=%s" target="_blank">'; | |
463 | -var | |
464 | - i : integer; | |
465 | - s : string; | |
466 | - b : TMbcsByteType; | |
467 | - sw: boolean; | |
468 | - sp: integer; | |
469 | - No: string; | |
470 | - sx: string; | |
471 | - List: TList; | |
472 | - oc : string; | |
473 | - st, et: string; | |
474 | - chk : boolean; | |
475 | - al : boolean; | |
476 | - procedure Add(IndexFrom, IndexTo: integer; const No: string); | |
477 | - var | |
478 | - FIndex : PIndex; | |
479 | - begin | |
480 | - New(FIndex); | |
481 | - FIndex.FIndexFrom := IndexFrom; | |
482 | - FIndex.FIndexTo := IndexTo; | |
483 | - FIndex.FNo := No; | |
484 | - List.Add(FIndex); | |
485 | - end; | |
486 | - procedure separateNumber(var st: String; var et: String; const Text, Separator: String); | |
487 | - var | |
488 | - p : Integer; | |
489 | - begin | |
490 | - p := Pos(Separator, Text); | |
491 | - if (p > 0 ) then begin | |
492 | - st := Copy(Text, 1, p - 1); | |
493 | - et := Copy(Text, p + Length(Separator), Length(Text)); | |
494 | - end else begin | |
495 | - st := Text; | |
496 | - et := Text; | |
497 | - end; | |
498 | - end; | |
499 | -begin | |
500 | - s := Body; | |
501 | - Result := Body; | |
502 | - i := 1; | |
503 | - sw := False; | |
504 | - No := ''; | |
505 | - List:= TList.Create; | |
506 | - oc := ''; | |
507 | - sp := 0; | |
508 | - chk := False; | |
509 | - al := False; | |
510 | - while true do begin | |
511 | - b := ByteType(s, i); | |
512 | - case b of | |
513 | - mbSingleByte : begin | |
514 | - if (not sw) and (Copy(s,i,8) = GT + GT) then begin | |
515 | - if (Pos('<A HREF', oc) = 0) then begin | |
516 | - sw := True; | |
517 | - sp := i; | |
518 | - i := i + 7; | |
519 | - oc:=''; | |
520 | - chk := True; | |
521 | - end; | |
522 | - end else | |
523 | - if (not sw) and (Copy(s,i,8) = GT + GT) then begin | |
524 | - if (Pos('<A HREF', oc) = 1) then begin | |
525 | - i := i + 7; | |
526 | - oc:=''; | |
527 | - chk := True; | |
528 | - end; | |
529 | - end else | |
530 | - if (not sw) and (Copy(s,i,4) = GT) then begin | |
531 | - if (Pos('<A HREF', oc) = 0) then begin | |
532 | - sw := True; | |
533 | - sp := i; | |
534 | - i := i + 3; | |
535 | - oc:=''; | |
536 | - chk := True; | |
537 | - end; | |
538 | - end else | |
539 | - if ((not sw) and (Copy(s,i,1) = ',')) or | |
540 | - ((not sw) and (Copy(s,i,1) = '=')) then begin | |
541 | - if ((not Chk) and (oc = '</A>')) or | |
542 | - ((Chk) and (oc = '')) or | |
543 | - ((not Chk) and (al)) then | |
544 | - begin | |
545 | - sw := True; | |
546 | - sp := i; | |
547 | - oc:=''; | |
548 | - end; | |
549 | - end else | |
550 | - if (sw) then begin | |
551 | - sx := Copy(s,i,1); | |
552 | - if (AnsiPos(sx, SN) > 0) then begin | |
553 | - No := No + sx; | |
554 | - end else begin | |
555 | - if (No <> '') and (No <> '-') then begin | |
556 | - Add(sp, i, No); | |
557 | - al := True; | |
558 | - end; | |
559 | - sw := False; | |
560 | - Dec(i); | |
561 | - No := ''; | |
562 | - oc:=''; | |
563 | - end; | |
564 | - end else begin | |
565 | - if Copy(s,i,1) = '<' then begin | |
566 | - oc := '<'; | |
567 | - end else begin | |
568 | - oc := oc + AnsiUpperCase(Copy(s,i,1)); | |
569 | - end; | |
570 | - chk := False; | |
571 | - al := False; | |
572 | - end; | |
573 | - end; | |
574 | - mbLeadByte : begin | |
575 | - if (not sw) and (Copy(s,i,4) = '') then begin | |
576 | - sw := True; | |
577 | - sp := i; | |
578 | - i := i + 3; | |
579 | - chk := True; | |
580 | - end else | |
581 | - if (not sw) and (Copy(s,i,2) = '') then begin | |
582 | - sw := True; | |
583 | - sp := i; | |
584 | - Inc(i); | |
585 | - chk := True; | |
586 | - end else | |
587 | - if (sw) then begin | |
588 | - sx := Copy(s,i,2); | |
589 | - if (AnsiPos(sx, ZN) > 0) then begin | |
590 | - No := No + ZenToHan(sx); | |
591 | - end else begin | |
592 | - if (No <> '') and (No <> '-') and (No <> '|') then begin | |
593 | - Add(sp, i, No); | |
594 | - end; | |
595 | - sw := False; | |
596 | - Dec(i); | |
597 | - No := ''; | |
598 | - end; | |
599 | - end else begin | |
600 | - oc := ''; | |
601 | - chk := False; | |
602 | - end; | |
603 | - al := False; | |
604 | - end; | |
605 | - end; | |
606 | - inc(i); | |
607 | - if (i > Length(Body)) then begin | |
608 | - if (sw) then begin | |
609 | - if (No <> '') then Add(sp, i, No); | |
610 | - end; | |
611 | - Break; | |
612 | - end; | |
613 | - end; | |
614 | - for i := List.Count - 1 downto 0 do begin | |
615 | - separateNumber(st, et, PIndex(List[i]).FNo, '-'); | |
616 | - if not DatToHTML then | |
617 | - Result := Copy(Result,1, PIndex(List[i]).FIndexFrom - 1) + | |
618 | - Format(FORMAT_LINK, [ParamBBS, Bbs, ParamKey, Key, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) + | |
619 | - Copy(Result,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' + | |
620 | - Copy(Result,PIndex(List[i]).FIndexTo,Length(Result)) | |
621 | - else | |
622 | - Result := Copy(Result,1, PIndex(List[i]).FIndexFrom - 1) + | |
623 | - Format('<a href="#%s">', [st]) + | |
624 | - Copy(Result,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' + | |
625 | - Copy(Result,PIndex(List[i]).FIndexTo,Length(Result)); | |
626 | - | |
627 | - Dispose(PIndex(List[i])); | |
628 | - end; | |
629 | - List.Free; | |
630 | -end; | |
631 | -} | |
632 | -function THTMLCreate.ConvRes( | |
633 | - const Body, Bbs, Key, ParamBBS, ParamKey, | |
634 | - ParamStart, ParamTo, ParamNoFirst, | |
635 | - ParamTrue, FullURL : string | |
636 | -): string; | |
637 | -type | |
638 | - PIndex = ^TIndex; | |
639 | - TIndex = record | |
640 | - FIndexFrom : integer; | |
641 | - FIndexTo : integer; | |
642 | - FNo : string; | |
643 | - end; | |
644 | -const | |
645 | - GT = '>'; | |
646 | - SN = '0123456789-'; | |
647 | - ZN = 'OPQRSTUVWX|'; | |
648 | -var | |
649 | - i : integer; | |
650 | - s : string; | |
651 | - b : TMbcsByteType; | |
652 | - sw: boolean; | |
653 | - sp: integer; | |
654 | - No: string; | |
655 | - sx: string; | |
656 | - List: TList; | |
657 | - oc : string; | |
658 | - st, et: string; | |
659 | - chk : boolean; | |
660 | - al : boolean; | |
661 | - procedure Add(IndexFrom, IndexTo: integer; const No: string); | |
662 | - var | |
663 | - FIndex : PIndex; | |
664 | - begin | |
665 | - New(FIndex); | |
666 | - FIndex.FIndexFrom := IndexFrom; | |
667 | - FIndex.FIndexTo := IndexTo; | |
668 | - FIndex.FNo := No; | |
669 | - List.Add(FIndex); | |
670 | - end; | |
671 | - function ChooseString(const Text, Separator: string; Index: integer): string; | |
672 | - var | |
673 | - S : string; | |
674 | - i, p : integer; | |
675 | - begin | |
676 | - S := Text; | |
677 | - for i := 0 to Index - 1 do begin | |
678 | - if (AnsiPos(Separator, S) = 0) then S := '' | |
679 | - else S := Copy(S, AnsiPos(Separator, S) + Length(Separator), Length(S)); | |
680 | - end; | |
681 | - p := AnsiPos(Separator, S); | |
682 | - if (p > 0) then Result := Copy(S, 1, p - 1) else Result := S; | |
683 | - end; | |
684 | -begin | |
685 | - { v1.0 b2 - 03 } | |
686 | - s := Body; | |
687 | - Result := Body; | |
688 | - i := 1; | |
689 | - sw := False; | |
690 | - No := ''; | |
691 | - List:= TList.Create; | |
692 | - oc := ''; | |
693 | - sp := 0; | |
694 | - chk := False; | |
695 | - al := False; | |
696 | - while true do begin | |
697 | - b := ByteType(s, i); | |
698 | - case b of | |
699 | - mbSingleByte : begin | |
700 | - if (not sw) and (Copy(s,i,8) = GT + GT) then begin | |
701 | - if (Pos('<A HREF', AnsiUpperCase(oc)) = 0) then begin | |
702 | - sw := True; | |
703 | - sp := i; | |
704 | - i := i + 7; | |
705 | - oc:=''; | |
706 | - chk := True; | |
707 | - end; | |
708 | - end else | |
709 | - if (not sw) and (Copy(s,i,8) = GT + GT) then begin | |
710 | - if (Pos('<A HREF', AnsiUpperCase(oc)) = 1) then begin | |
711 | - i := i + 7; | |
712 | - oc:=''; | |
713 | - chk := True; | |
714 | - end; | |
715 | - end else | |
716 | - if (not sw) and (Copy(s,i,4) = GT) then begin | |
717 | - if (Pos('<A HREF', AnsiUpperCase(oc)) = 0) then begin | |
718 | - sw := True; | |
719 | - sp := i; | |
720 | - i := i + 3; | |
721 | - oc:=''; | |
722 | - chk := True; | |
723 | - end; | |
724 | - end else | |
725 | - if ((not sw) and (Copy(s,i,1) = ',')) or | |
726 | - ((not sw) and (Copy(s,i,1) = '=')) then begin | |
727 | - if ((not Chk) and (AnsiLowerCase(oc) = '</a>')) or | |
728 | - ((Chk) and (oc = '')) or | |
729 | - ((not Chk) and (al)) then | |
730 | - begin | |
731 | - sw := True; | |
732 | - sp := i; | |
733 | - //i := i + 1; | |
734 | - oc:=''; | |
735 | - end; | |
736 | - end else | |
737 | - if (sw) then begin | |
738 | - sx := Copy(s,i,1); | |
739 | - if (Pos(sx, SN) > 0) then begin | |
740 | - No := No + sx; | |
741 | - end else begin | |
742 | - if (No <> '') and (No <> '-') then begin | |
743 | - Add(sp, i, No); | |
744 | - al := True; | |
745 | - end; | |
746 | - sw := False; | |
747 | - // | |
748 | - i := i - 1; | |
749 | - // | |
750 | - No := ''; | |
751 | - oc:=''; | |
752 | - //chk := False; | |
753 | - end; | |
754 | - end else begin | |
755 | - if Copy(s,i,1) = '<' then oc := ''; | |
756 | - oc := oc + Copy(s,i,1); | |
757 | - chk := False; | |
758 | - al := False; | |
759 | - end; | |
760 | - end; | |
761 | - mbLeadByte : begin | |
762 | - if (not sw) and (Copy(s,i,4) = '') then begin | |
763 | - sw := True; | |
764 | - sp := i; | |
765 | - i := i + 3; | |
766 | - chk := True; | |
767 | - end else | |
768 | - if (not sw) and (Copy(s,i,2) = '') then begin | |
769 | - sw := True; | |
770 | - sp := i; | |
771 | - i := i + 1; | |
772 | - chk := True; | |
773 | - end else | |
774 | - if (sw) then begin | |
775 | - sx := Copy(s,i,2); | |
776 | - if (AnsiPos(sx, ZN) > 0) then begin | |
777 | - No := No + ZenToHan(sx); | |
778 | - end else begin | |
779 | - if (No <> '') and (No <> '-') and (No <> '|') then begin | |
780 | - Add(sp, i, No); | |
781 | - end; | |
782 | - sw := False; | |
783 | - i := i - 1; | |
784 | - No := ''; | |
785 | - end; | |
786 | - end else begin | |
787 | - oc := ''; | |
788 | - chk := False; | |
789 | - end; | |
790 | - al := False; | |
791 | - end; | |
792 | - end; | |
793 | - inc(i); | |
794 | - if (i > Length(Body)) then begin | |
795 | - if (sw) then begin | |
796 | - if (No <> '') then Add(sp, i, No); | |
797 | - end; | |
798 | - Break; | |
799 | - end; | |
800 | - end; | |
801 | - for i := List.Count - 1 downto 0 do begin | |
802 | - if (AnsiPos('-', PIndex(List[i]).FNo) > 0) then begin | |
803 | - st := ChooseString(PIndex(List[i]).FNo, '-', 0); | |
804 | - et := ChooseString(PIndex(List[i]).FNo, '-', 1); | |
805 | - end else begin | |
806 | - st := PIndex(List[i]).FNo; | |
807 | - et := PIndex(List[i]).FNo; | |
808 | - end; | |
809 | - Result := Copy(Result,0, PIndex(List[i]).FIndexFrom - 1) + | |
810 | - Format('<a href="%s&%s=%s&%s=%s&%s=%s" target="_blank">', | |
811 | - [FullURL, ParamStart, st, ParamTo, et, ParamNoFirst, ParamTrue]) + | |
812 | - Copy(Result,PIndex(List[i]).FIndexFrom, PIndex(List[i]).FIndexTo - PIndex(List[i]).FIndexFrom) + '</A>' + | |
813 | - Copy(Result,PIndex(List[i]).FIndexTo,Length(Result)); | |
814 | - Dispose(PIndex(List[i])); | |
815 | - end; | |
816 | - List.Free; | |
444 | + Result := Result + s; | |
817 | 445 | end; |
818 | 446 | |
819 | 447 | function THTMLCreate.ConvertResAnchor(res: string): string; |
@@ -881,13 +509,9 @@ begin | ||
881 | 509 | UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
882 | 510 | html.BeginUpdate; |
883 | 511 | try |
884 | - //doc.open; | |
885 | 512 | // wb_ |
886 | - //doc.Write( boardPlugIn.GetHeader( DWORD( threadItem ), | |
887 | 513 | html.Append( boardPlugIn.GetHeader( DWORD( threadItem ), |
888 | 514 | '<style type="text/css">body {' + UserOptionalStyle + '}</style>' )); |
889 | - // '<style type="text/css">body {' + UserOptionalStyle + '}</style>' ) + #13#10 ); | |
890 | - //doc.Write('<p id="idSearch"></p>' + #13#10 ); | |
891 | 515 | html.Add('<p id="idSearch"></p>'); |
892 | 516 | for i := 0 to threadItem.Count - 1 do begin |
893 | 517 | // 1 ÍK¸\¦ |
@@ -911,32 +535,24 @@ begin | ||
911 | 535 | try |
912 | 536 | if GikoSys.Setting.UseSkin then begin |
913 | 537 | if FileExists( GikoSys.GetSkinNewmarkFileName ) then |
914 | - //doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 ) | |
915 | 538 | html.Append( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size )) |
916 | 539 | else |
917 | 540 | //doc.Write( '<a name="new"></a>' + #13#10 ); |
918 | 541 | html.Append( '<a name="new"></a>' ); |
919 | 542 | end else if GikoSys.Setting.UseCSS then begin |
920 | - //doc.Write('<a name="new"></a><div class="new">V X <span class="newdate">' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</span></div>' + #13#10); | |
921 | 543 | html.Append('<a name="new"></a><div class="new">V X <span class="newdate">' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</span></div>'); |
922 | 544 | end else begin |
923 | - //doc.Write('</dl>'); | |
924 | 545 | html.Append('</dl>'); |
925 | - //doc.Write('<a name="new"></a>'); | |
926 | 546 | html.Append('<a name="new"></a>'); |
927 | - //doc.Write('<table width="100%" bgcolor="#3333CC" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#6666FF" valign="middle"><font size="-1" color="#ffffff"><b>V X ' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</b></font></td></tr></table>'); | |
928 | 547 | html.Append('<table width="100%" bgcolor="#3333CC" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#6666FF" valign="middle"><font size="-1" color="#ffffff"><b>V X ' + FormatDateTime('yyyy/mm/dd(ddd) hh:mm', ThreadItem.RoundDate) + '</b></font></td></tr></table>'); |
929 | - //doc.Write('<dl> + #13#10'); | |
930 | 548 | html.Append('<dl>'); |
931 | 549 | end; |
932 | 550 | except |
933 | - //doc.Write( '<a name="new"></a>' + #13#10); | |
934 | 551 | html.Append( '<a name="new"></a>'); |
935 | 552 | end; |
936 | 553 | end; |
937 | 554 | |
938 | 555 | // X |
939 | - //doc.Write( boardPlugIn.GetRes( DWORD( threadItem ), i + 1 ) + #13#10 ); | |
940 | 556 | html.Append( boardPlugIn.GetRes( DWORD( threadItem ), i + 1 ) ); |
941 | 557 | |
942 | 558 | if ThreadItem.Kokomade = (i + 1) then begin |
@@ -944,24 +560,17 @@ begin | ||
944 | 560 | try |
945 | 561 | if GikoSys.Setting.UseSkin then begin |
946 | 562 | if FileExists( GikoSys.GetSkinBookmarkFileName ) then |
947 | - //doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 ) | |
948 | 563 | html.Append( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) ) |
949 | 564 | else |
950 | - //doc.Write( '<a name="koko"></a>' + #13#10 ); | |
951 | 565 | html.Append( '<a name="koko"></a>' ); |
952 | 566 | end else if GikoSys.Setting.UseCSS then begin |
953 | - //doc.Write('<a name="koko"></a><div class="koko">RRÜÅÇñ¾</div>' + #13#10 ); | |
954 | 567 | html.Append('<a name="koko"></a><div class="koko">RRÜÅÇñ¾</div>' ); |
955 | 568 | end else begin |
956 | - //doc.Write('</dl>'); | |
957 | 569 | html.Append('</dl>'); |
958 | - //doc.Write('<a name="koko"></a><table width="100%" bgcolor="#55AA55" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#77CC77" valign="middle"><font size="-1" color="#ffffff"><b>RRÜÅÇñ¾</b></font></td></tr></table>'); | |
959 | 570 | html.Append('<a name="koko"></a><table width="100%" bgcolor="#55AA55" cellpadding="0" cellspacing="1"><tr><td align="center" bgcolor="#77CC77" valign="middle"><font size="-1" color="#ffffff"><b>RRÜÅÇñ¾</b></font></td></tr></table>'); |
960 | - //doc.Write('<dl>' + #13#10 ); | |
961 | 571 | html.Append('<dl>' ); |
962 | 572 | end; |
963 | 573 | except |
964 | - //doc.Write( '<a name="koko"></a>' + #13#10 ); | |
965 | 574 | html.Append( '<a name="koko"></a>' ); |
966 | 575 | end; |
967 | 576 | end; |
@@ -969,10 +578,8 @@ begin | ||
969 | 578 | |
970 | 579 | |
971 | 580 | // XL(tb^) |
972 | - //doc.Write( boardPlugIn.GetFooter( DWORD( threadItem ), '<a name="bottom"></a>' ) + #13#10 ); | |
973 | 581 | html.Append( boardPlugIn.GetFooter( DWORD( threadItem ), '<a name="bottom"></a>' ) ); |
974 | 582 | finally |
975 | - //doc.Close; | |
976 | 583 | html.EndUpdate; |
977 | 584 | end; |
978 | 585 |
@@ -993,10 +600,7 @@ var | ||
993 | 600 | SkinNewRes: string; |
994 | 601 | SkinRes: string; |
995 | 602 | strTmp : string; |
996 | - function ReplaceRes( skin: string ): string; | |
997 | - begin | |
998 | - Result := SkinedRes( skin, Res, No ); | |
999 | - end; | |
603 | + threadKey : string; | |
1000 | 604 | begin |
1001 | 605 | if ThreadItem <> nil then begin |
1002 | 606 | // XLgp |
@@ -1005,7 +609,8 @@ begin | ||
1005 | 609 | // tHgâTCYÌÝè |
1006 | 610 | UserOptionalStyle := GikoSys.SetUserOptionalStyle; |
1007 | 611 | CSSFileName := GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName; |
1008 | - //doc.open; | |
612 | + | |
613 | + threadKey := ChangeFileExt(ThreadItem.FileName, ''); | |
1009 | 614 | html.BeginUpdate; |
1010 | 615 | try |
1011 | 616 | //doc.charset := 'Shift_JIS'; |
@@ -1016,7 +621,6 @@ begin | ||
1016 | 621 | if Length( UserOptionalStyle ) > 0 then |
1017 | 622 | SkinHeader := CustomStringReplace( SkinHeader, '</head>', |
1018 | 623 | '<style type="text/css">body {' + UserOptionalStyle + '}</style></head>'); |
1019 | - //doc.Write( SkinHeader + #13#10); | |
1020 | 624 | html.Append( SkinHeader); |
1021 | 625 | except |
1022 | 626 | end; |
@@ -1031,9 +635,7 @@ begin | ||
1031 | 635 | except |
1032 | 636 | end; |
1033 | 637 | |
1034 | - //doc.Write('<p id="idSearch"></p>' + #13#10); | |
1035 | 638 | html.Append('<p id="idSearch"></p>'); |
1036 | - //doc.Write('<a name="top"></a>' + #13#10); | |
1037 | 639 | html.Append('<a name="top"></a>'); |
1038 | 640 | |
1039 | 641 | for i := 0 to ReadList.Count - 1 do begin |
@@ -1052,18 +654,14 @@ begin | ||
1052 | 654 | Continue; |
1053 | 655 | end; |
1054 | 656 | end; |
1055 | - | |
1056 | 657 | // V }[N |
1057 | 658 | if (NewReceiveNo = i + 1) or ((NewReceiveNo = 0) and (i = 0)) then begin |
1058 | 659 | try |
1059 | 660 | if FileExists( GikoSys.GetSkinNewmarkFileName ) then |
1060 | - //doc.Write( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10) | |
1061 | 661 | html.Append( LoadFromSkin( GikoSys.GetSkinNewmarkFileName, ThreadItem, ThreadItem.Size ) ) |
1062 | 662 | else |
1063 | - //doc.Write( '<a name="new"></a>' + #13#10 ); | |
1064 | 663 | html.Append( '<a name="new"></a>' ); |
1065 | 664 | except |
1066 | - //doc.Write( '<a name="new"></a>' + #13#10 ); | |
1067 | 665 | html.Append( '<a name="new"></a>' ); |
1068 | 666 | end; |
1069 | 667 | end; |
@@ -1072,18 +670,17 @@ begin | ||
1072 | 670 | No := IntToStr(i + 1); |
1073 | 671 | |
1074 | 672 | Res := DivideStrLine(ReadList[i]); |
1075 | - Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, ChangeFileExt(ThreadItem.FileName, ''), 'bbs', 'key', 'st', 'to', 'nofirst', 'true'); | |
673 | + Res.FBody := ConvRes(AddAnchorTag(Res.FBody), ThreadItem.ParentBoard.BBSID, threadKey, 'bbs', 'key', 'st', 'to', 'nofirst', 'true'); | |
1076 | 674 | Res.FDateTime := AddBeProfileLink(Res.FDateTime, i + 1); |
1077 | 675 | |
1078 | 676 | try |
1079 | 677 | if NewReceiveNo <= (i + 1) then |
1080 | 678 | // V X |
1081 | - strTmp := ReplaceRes( SkinNewRes ) | |
679 | + strTmp := SkinedRes( SkinNewRes, Res, No ) | |
1082 | 680 | else |
1083 | 681 | // ÊíÌX |
1084 | - strTmp := ReplaceRes( SkinRes ); | |
682 | + strTmp := SkinedRes( SkinRes, Res, No ); | |
1085 | 683 | |
1086 | - //doc.Write( strTmp + #13#10 ); | |
1087 | 684 | html.Append( strTmp ); |
1088 | 685 | except |
1089 | 686 | end; |
@@ -1093,28 +690,22 @@ begin | ||
1093 | 690 | // ±±ÜÅÇñ¾ |
1094 | 691 | try |
1095 | 692 | if FileExists( GikoSys.GetSkinBookmarkFileName ) then |
1096 | - //doc.Write( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) + #13#10 ) | |
1097 | 693 | html.Append( LoadFromSkin( GikoSys.GetSkinBookmarkFileName, ThreadItem, ThreadItem.Size ) ) |
1098 | 694 | else |
1099 | - //doc.Write( '<a name="koko"></a>' + #13#10 ); | |
1100 | 695 | html.Append( '<a name="koko"></a>' ); |
1101 | 696 | except |
1102 | - //doc.Write( '<a name="koko"></a>' + #13#10 ); | |
1103 | 697 | html.Append( '<a name="koko"></a>' ); |
1104 | 698 | end; |
1105 | 699 | end; |
1106 | 700 | end; |
1107 | 701 | |
1108 | - //doc.Write('<a name="bottom"></a>' + #13#10); | |
1109 | 702 | html.Append('<a name="bottom"></a>' ); |
1110 | 703 | // XL(tb^) |
1111 | 704 | try |
1112 | - //doc.Write( LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, ThreadItem.Size ) + #13#10 ); | |
1113 | 705 | html.Append( LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, ThreadItem.Size ) ); |
1114 | 706 | except |
1115 | 707 | end; |
1116 | 708 | finally |
1117 | - //doc.close; | |
1118 | 709 | html.EndUpdate; |
1119 | 710 | end; |
1120 | 711 | end; |
@@ -1325,6 +916,7 @@ begin | ||
1325 | 916 | |
1326 | 917 | ReadList := TStringList.Create; |
1327 | 918 | try |
919 | + ReadList.BeginUpdate; | |
1328 | 920 | if ThreadItem.IsLogFile then begin |
1329 | 921 | FileName := ThreadItem.GetThreadFileName; |
1330 | 922 | ReadList.LoadFromFile(FileName); |
@@ -1350,6 +942,7 @@ begin | ||
1350 | 942 | CreateDefaultHTML(html, ThreadItem, ReadList, sTitle); |
1351 | 943 | end; |
1352 | 944 | finally |
945 | + ReadList.EndUpdate; | |
1353 | 946 | ReadList.Free; |
1354 | 947 | end; |
1355 | 948 | end; |