OSDN Git Service

だいぶ間違いに気づけましたがまだです
authoryamat0jp <terukohietori@gmail.com>
Fri, 17 Jan 2020 11:22:13 +0000 (20:22 +0900)
committeryamat0jp <terukohietori@gmail.com>
Fri, 17 Jan 2020 11:22:13 +0000 (20:22 +0900)
WebModuleUnit1.dfm
WebModuleUnit1.pas
newbbs.dproj
tool/Unit2.dfm

index 4cd6a72..eab0661 100644 (file)
@@ -108,8 +108,8 @@ object WebModule1: TWebModule1
     HTMLDoc.Strings = (
       '                                            <hr size=1>'
       
-        #9'<section id=number><a name=<#number>></a><a href=/jump?num=<#nu' +
-        'mber> style=text-decoration:none>'
+        #9'<section id=number><a name=<#number>></a><a href=<#uri>/jump?nu' +
+        'm=<#number> style=text-decoration:none>'
       #9#9'[<#number>]</a></section>'
       #9'<section id=title><#title></section>'
       #9'<section id=name>'#12288'Name:<h1><#name></h1></section>'
@@ -117,8 +117,8 @@ object WebModule1: TWebModule1
       #9'<p>'#9661#9650#9661#9650#9661#9650#9661
       #9'<section id=comment><#comment></section>'
       
-        '<section id=master style=text-align:right><a href=/alert?db=<#db' +
-        'num>&num=<#number>>'#22577#21578'</a></section>'
+        '<section id=master style=text-align:right><a href=<#uri>/alert?d' +
+        'b=<#dbnum>&num=<#number>>'#22577#21578'</a></section>'
       #9'<p>'#9651#9660#9651#9660#9651#9660#9651)
     OnHTMLTag = articlesHTMLTag
     Left = 112
@@ -155,23 +155,25 @@ object WebModule1: TWebModule1
       '  </head>'
       '  <body>'
       '<#pr>'
-      '    <a href=/ style=text-decoration:none><#title2></a>'
+      '    <a href=<#uri>/ style=text-decoration:none><#title2></a>'
       ''
       '    <#header>'
       ''
       '    <hr size="1" width="100%">'
-      '    <form action=/userdel?db=<#dbnum> method="post" id=search>'
+      
+        '    <form action=<#uri>/userdel?db=<#dbnum> method="post" id=sea' +
+        'rch>'
       '      <label><p>'#35352#20107'No</p><input name="num"></label>'
       
         '      <label><p>Pass</p><input type="password" name="password"><' +
         '/label>'
       '      <input type="submit" value="'#21066#38500'">'
       '    </form>'
-      '    <form action=/jump?db=<#dbnum> method=post id=search>'
+      '    <form action=<#uri>/jump?db=<#dbnum> method=post id=search>'
       '      <label><p>'#35352#20107'No</p><input name=num></label>'
       '      <input type=submit value='#31227#21205'>'
       '    </form>'
-      '    <p><a href=/search?db=<#dbnum>>'#26908#32034#12506#12540#12472'</a></p>'
+      '    <p><a href=<#uri>/search?db=<#dbnum>>'#26908#32034#12506#12540#12472'</a></p>'
       '    <p style=text-align:right><a href=#article>'#19979#12408#31227#21205'</a></p>'
       '    <p style=text-align:center><#database></p>'
       '    <#footer>'
@@ -180,8 +182,8 @@ object WebModule1: TWebModule1
       #9'<p style=text-align:right><a href=#top>Top'#12408#31227#21205'</a></p>'
       '  <#footer>'
       
-        '    <p style=text-align:center><a href="/admin?db=<#dbnum>">'#31649#29702#32773#29992 +
-        #12525#12464#12452#12531'</a></p>'
+        '    <p style=text-align:center><a href="<#uri>/admin?db=<#dbnum>' +
+        '">'#31649#29702#32773#29992#12525#12464#12452#12531'</a></p>'
       '  </body>'
       '</html>')
     OnHTMLTag = indexHTMLTag
@@ -208,6 +210,7 @@ object WebModule1: TWebModule1
     Footer.Strings = (
       '')
     MaxRows = 30
+    DataSet = FDTable2
     OnFormatCell = adminFormatCell
     Left = 176
     Top = 32
@@ -229,7 +232,7 @@ object WebModule1: TWebModule1
       ''
       '  <body>'
       '<#pr>'
-      '    <form action="/search<#query>" method="post">'
+      '    <form action="<#uri>/search<#query>" method="post">'
       '    <p align="center"><strong>'#25237#31295#26908#32034
       '</strong>'
       '    </p>'
@@ -256,7 +259,7 @@ object WebModule1: TWebModule1
       '      <p>'
       '    <input type="submit" value="'#26908#32034'"></p>'
       '    </form>'
-      '      <p><a href="/index?db=<#dbnum>">'#25522#31034#26495#12408#25147#12427
+      '      <p><a href="<#select>">'#25522#31034#26495#12408#25147#12427
       '</a></p>'
       '    <#items>'
       '  </body>'
@@ -297,7 +300,7 @@ object WebModule1: TWebModule1
       '<p>'
       '<p>'#21033#29992#35215#32004
       '<p>'#12371#12428#12363#12425#26360#12365#12414#12377
-      '<p style=text-align:center><a href=/>'#25147#12427'</a>'
+      '<p style=text-align:center><a href=<#uri>/>'#25147#12427'</a>'
       '</body>'
       '</html>')
     OnHTMLTag = helpHTMLTag
@@ -325,8 +328,8 @@ object WebModule1: TWebModule1
       
         ' <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jq' +
         'uery-ui.min.js"></script>'
-      '<script src="/file?type=js&id=3">org</script>'
-      '<script src="/file?type=js&id=4">moder</script>'
+      '<script src="<#uri>/file?type=js&id=3">org</script>'
+      '<script src="<#uri>/file?type=js&id=4">moder</script>'
       '</head>'
       '<body>'
       '<#pr>'
@@ -359,8 +362,8 @@ object WebModule1: TWebModule1
       '</div>'
       '<p>'#12288'<em style="background-color: aqua;">'#12288#12288#12288#12288'</em>'#12539#12539#12539'new!'
       
-        '        <p>[ <a href=/index?db=<#dbnum>><#info></a> ] ='#12362#30693#12425#12379' <p>[' +
-        ' <a href="/master">master'
+        '        <p>[ <a href=<#uri>/index?db=<#dbnum>><#info></a> ] ='#12362#30693#12425 +
+        #12379' <p>[ <a href="<#uri>/master">master'
       
         '</a> ] ='#31649#29702#20154'<div class="fb-like" data-href="http://pybbs.herokuap' +
         'p.com" data-layout="box_count" data-action="like" data-size="sma' +
@@ -371,10 +374,10 @@ object WebModule1: TWebModule1
         'counter.php?id=pybbs" border="0"></a>'
       '<footer>'
       '<p><br>'
-      '<p><a href=/title>'#12479#12452#12488#12523#34920#31034'</a>'
-      '<p><a href="/help">'#20351#12356#26041#26696#20869
+      '<p><a href=<#uri>/title>'#12479#12452#12488#12523#34920#31034'</a>'
+      '<p><a href="<#uri>/help">'#20351#12356#26041#26696#20869
       '</a>'
-      '<p><a href=/search>'#26908#32034'</a>'
+      '<p><a href=<#uri>/search>'#26908#32034'</a>'
       '<p>PR '#12522#12531#12463'<br>'
       
         '<p><a href="https://www.amazon.co.jp/%E9%AB%98%E6%A0%A1%E5%8D%92' +
@@ -409,14 +412,14 @@ object WebModule1: TWebModule1
       '</head>'
       '<body>'
       '<#pr>'
-      '<form action=/master method=post>'
+      '<form action=<#uri>/master method=post>'
       '<p><#request>'
       '<input type=radio name=delete value=some checked>'#21066#38500#28168#12415#12434#28040#21435#12288
       '<input type=radio name=delete value=all>'#12377#12409#12390#28040#21435
       '<input type=submit value="'#36865#20449'">'
       '</form>'
-      '<p style=text-align:center><a href=/logout>'#12525#12464#12450#12454#12488'</a>'
-      '<p style=text-align:center><a href=/>'#25147#12427'</a>'
+      '<p style=text-align:center><a href=<#uri>/logout>'#12525#12464#12450#12454#12488'</a>'
+      '<p style=text-align:center><a href=<#uri>/>'#25147#12427'</a>'
       '</body></html>')
     OnHTMLTag = masterHTMLTag
     Left = 48
@@ -446,11 +449,11 @@ object WebModule1: TWebModule1
       '<head><meta charset=utf-8></head>'
       '<body>'
       '<#pr>'
-      '<form action=/alert<#query>  method=post>'
+      '<form action=<#uri>/alert<#query>  method=post>'
       '  <#content>'
       '<textarea name=request></textarea>'
       '<input type=submit>'
-      '<p style=text-align:center><a href=/jump<#query>>'#25147#12427'</a>'
+      '<p style=text-align:center><a href=<#uri>/jump<#query>>'#25147#12427'</a>'
       '</form>'
       '</body></html>')
     OnHTMLTag = mailHTMLTag
@@ -529,7 +532,7 @@ object WebModule1: TWebModule1
       ''
       '.slideshow-nav a:before,'
       '.slideshow-indicator a:before {'
-      #9'content:url("/src?name=sprites.png");'
+      #9'content:url("<#uri>/src?name=sprites.png");'
       #9'display:inline-block;'
       #9'font-size:0;'
       #9'line-height:0'
@@ -610,6 +613,7 @@ object WebModule1: TWebModule1
       '.no-js .slideshow-indicator {'
       #9'display:none'
       '}')
+    OnHTMLTag = css1HTMLTag
     Left = 360
     Top = 96
   end
@@ -1314,7 +1318,7 @@ object WebModule1: TWebModule1
     HTMLDoc.Strings = (
       '    <header>'
       '    <a name=top></a>'
-      '    <form action=/regist?db=<#dbnum> method="post">'
+      '    <form action=<#uri>/regist?db=<#dbnum> method="post">'
       '      <table>'
       '        <tr><td>'
       
@@ -1366,14 +1370,16 @@ object WebModule1: TWebModule1
       '    <p style=text-align:center>'#31649#29702#32773#29992#12525#12464#12452#12531#30011#38754
       '</p>'
       '    <br>'
-      '    <form action=/login method="post">'
+      '    <form action=<#uri>/login method="post">'
       '    <p style=text-align:center>'
       '      <input type=text name=record value=<#database>>'
       '    '#9'  <input style=height:25px type="password" name="password">'
       '      <input type="submit" value="'#12525#12464#12452#12531'">'
       '    </p>'
       '    </form>'
-      '      <p style=text-align:center><br><a href=/ >TOP'#12408#31227#21205'</a></p>'
+      
+        '      <p style=text-align:center><br><a href=<#uri>/ >TOP'#12408#31227#21205'</a>' +
+        '</p>'
       '  </body>'
       '</html>')
     OnHTMLTag = loginHTMLTag
@@ -1814,7 +1820,9 @@ object WebModule1: TWebModule1
   object adhead: TPageProducer
     HTMLDoc.Strings = (
       '<#pr>'
-      '<form method=post action=/adminset style=text-align:center>'
+      
+        '<form method=post action=<#uri>/adminset style=text-align:center' +
+        '>'
       '    <label><p>'#12497#12473#12527#12540#12489#12398#22793#26356
       
         '      <input type="password" style="HEIGHT: 23px; WIDTH: 85px" n' +
@@ -1826,9 +1834,11 @@ object WebModule1: TWebModule1
         '    <input type="checkbox" value="on" name="mente" <#mente>>'#12513#12531#12486#12490 +
         #12531#12473#34920#31034'</p>'
       '    <p><input type="submit" value="'#22793#26356'"></p>'
-      '    <p><a href="/logout?db=<#database>">'#12525#12464#12450#12454#12488'</a></p>'
+      '    <p><a href="<#uri>/logout?db=<#database>">'#12525#12464#12450#12454#12488'</a></p>'
       '</form>'
-      '<form action=/admindel method=post style=text-align:center>')
+      
+        '<form action=<#uri>/admindel method=post style=text-align:center' +
+        '>')
     OnHTMLTag = adheadHTMLTag
     Left = 176
     Top = 88
@@ -1894,7 +1904,7 @@ object WebModule1: TWebModule1
       '<body>'
       '<#pr>'
       '<#main>'
-      '<p style=text-align:center><a href=/>'#25147#12427'</a>'
+      '<p style=text-align:center><a href=<#uri>/>'#25147#12427'</a>'
       '</body>'
       '</html>')
     OnHTMLTag = titleHTMLTag
@@ -1904,8 +1914,8 @@ object WebModule1: TWebModule1
   object ti: TDataSetPageProducer
     HTMLDoc.Strings = (
       
-        '<p style=font-weight:bold><a href=/index?db=<#dbnum>><#database>' +
-        '</a>'#8595'</p>'
+        '<p style=font-weight:bold><a href=<#uri>/index?db=<#dbnum>><#dat' +
+        'abase></a>'#8595'</p>'
       '<div>'#12479#12452#12488#12523': <#title> ; '#35352#20107#25968': <#count> ; '#26356#26032#26178#21051': <#date></div><p>'
       '')
     OnHTMLTag = tiHTMLTag
@@ -2073,7 +2083,7 @@ object WebModule1: TWebModule1
   end
   object FDConnection1: TFDConnection
     Params.Strings = (
-      'ConnectionDef=first_sql')
+      'ConnectionDef=test_server')
     Left = 632
     Top = 56
   end
index 3dfc023..f52f70b 100644 (file)
@@ -141,6 +141,8 @@ type
       TagParams: TStrings; var ReplaceText: string);
     procedure loginHTMLTag(Sender: TObject; Tag: TTag; const TagString: string;
       TagParams: TStrings; var ReplaceText: string);
+    procedure css1HTMLTag(Sender: TObject; Tag: TTag; const TagString: string;
+      TagParams: TStrings; var ReplaceText: string);
   private
     { private \90é\8c¾ }
     ss: TStringList;
@@ -177,6 +179,8 @@ procedure TWebModule1.adheadHTMLTag(Sender: TObject; Tag: TTag;
 begin
   if TagString = 'pr' then
     ReplaceText := promotion
+  else if TagString = 'uri' then
+    ReplaceText := Request.ScriptName
   else if (TagString = 'mente') and
     (FDTable3.FieldByName('mente').AsBoolean = true) then
     ReplaceText := 'checked'
@@ -200,8 +204,8 @@ var
   i: Integer;
 begin
   if (TagString = 'plus') and (alert.Tag = 0) then
-    ReplaceText :=
-      '<a href=/jump?db=<#dbname>&num=<#posnum>>[ <#dbname>-<#posnum> ]</a>'
+    ReplaceText := '<a href=' + Request.ScriptName +
+      '/jump?db=<#dbname>&num=<#posnum>>[ <#dbname>-<#posnum> ]</a>'
   else if TagString = 'article' then
   begin
     if (FDTable1.Locate('dbnum', FDTable4.FieldByName('dbname').AsInteger)
@@ -234,10 +238,19 @@ end;
 procedure TWebModule1.articlesHTMLTag(Sender: TObject; Tag: TTag;
   const TagString: string; TagParams: TStrings; var ReplaceText: string);
 begin
-  if TagString = 'comment' then
+  if TagString = 'uri' then
+    ReplaceText := Request.ScriptName
+  else if TagString = 'comment' then
     ReplaceText := FDTable2.FieldByName('comment').AsString;
 end;
 
+procedure TWebModule1.css1HTMLTag(Sender: TObject; Tag: TTag;
+  const TagString: string; TagParams: TStrings; var ReplaceText: string);
+begin
+  if TagString = 'uri' then
+    ReplaceText := Request.ScriptName;
+end;
+
 function TWebModule1.detail(ts, pid: string): string;
 var
   i: Integer;
@@ -260,15 +273,16 @@ begin
       else
         ReplaceText := ReplaceText +
           Format(' <a style=text-decoration-line:none href="%s?db=%d&num=%d">%d</a> ',
-          [PString(Self.Tag)^, FDTable1.FieldByName('dbnum').AsInteger, i, i]);
+          [Request.ScriptName + PString(Self.Tag)^,
+          FDTable1.FieldByName('dbnum').AsInteger, i, i]);
   end
   else if TagString = 'recent' then
     if index.Tag = -1 then
       ReplaceText := TagString
     else
       ReplaceText := '<a style=text-decoration-line:none href="' +
-        PString(Self.Tag)^ + '?db=' + FDTable1.FieldByName('dbnum').AsString +
-        '">recent</a>';
+        Request.ScriptName + PString(Self.Tag)^ + '?db=' +
+        FDTable1.FieldByName('dbnum').AsString + '">recent</a>';
 end;
 
 function TWebModule1.hash(str: string): string;
@@ -288,7 +302,9 @@ procedure TWebModule1.headerHTMLTag(Sender: TObject; Tag: TTag;
 var
   s: string;
 begin
-  if TagString = 'cookie' then
+  if TagString = 'uri' then
+    ReplaceText := Request.ScriptName
+  else if TagString = 'cookie' then
   begin
     s := TagParams.Values['param'];
     ReplaceText := TNetEncoding.URL.Decode(Request.CookieFields.Values[s]);
@@ -311,12 +327,15 @@ procedure TWebModule1.helpHTMLTag(Sender: TObject; Tag: TTag;
 begin
   if TagString = 'pr' then
     ReplaceText := promotion
+  else if TagString = 'uri' then
+    ReplaceText := Request.ScriptName
   else if TagString = 'area' then
     if help.Tag = 0 then
     begin
       ss := TStringList.Create;
       try
-        ss.Add('<form action=/help method=post><p>\82¨\96â\82¢\8d\87\82í\82¹<\8dí\8f\9c\88Ë\97\8a\82È\82Ç\89½\82Å\82à></p>');
+        ss.Add('<form action=' + Request.ScriptName +
+          '/help method=post><p>\82¨\96â\82¢\8d\87\82í\82¹<\8dí\8f\9c\88Ë\97\8a\82È\82Ç\89½\82Å\82à></p>');
         ss.Add('<textarea name=help style=height:100px;width:250px>\93\8a\8de\8eÒ\96¼\82È\82Ç\81F');
         ss.Add('\91\8a\92k\93à\97e\81F');
         ss.Add('\82»\82Ì\91¼\81F</textarea><br>');
@@ -338,6 +357,8 @@ var
 begin
   if TagString = 'pr' then
     ReplaceText := promotion
+  else if TagString = 'uri' then
+    ReplaceText := Request.ScriptName
   else if TagString = 'article' then
   begin
     for i := 1 to FDTable3.FieldByName('count').AsInteger do
@@ -404,10 +425,11 @@ begin
         j := FieldByName('number').AsInteger;
         str := Request.QueryFields.Values['db'];
         if str = '' then
-          t := Format('<a href="/jump?db=%d&num=%d">[ %d-%d ]</a>',
-            [i, j, i, j])
+          t := Format('<a href="%s/jump?db=%d&num=%d">[ %d-%d ]</a>',
+            [Request.ScriptName, i, j, i, j])
         else
-          t := Format('<a href="/jump?db=%s&num=%d">[ %d ]</a>', [str, j, j]);
+          t := Format('<a href="%s/jump?db=%s&num=%d">[ %d ]</a>',
+            [Request.ScriptName, str, j, j]);
       end;
       ReplaceText := t + s.Text;
     finally
@@ -426,7 +448,9 @@ procedure TWebModule1.loginHTMLTag(Sender: TObject; Tag: TTag;
   const TagString: string; TagParams: TStrings; var ReplaceText: string);
 begin
   if TagString = 'pr' then
-    ReplaceText := promotion;
+    ReplaceText := promotion
+  else if TagString = 'uri' then
+    ReplaceText := Request.ScriptName;
 end;
 
 procedure TWebModule1.masterHTMLTag(Sender: TObject; Tag: TTag;
@@ -434,6 +458,8 @@ procedure TWebModule1.masterHTMLTag(Sender: TObject; Tag: TTag;
 begin
   if TagString = 'pr' then
     ReplaceText := promotion
+  else if TagString = 'uri' then
+    ReplaceText := Request.ScriptName
   else if TagString = 'request' then
     with FDTable4 do
     begin
@@ -459,7 +485,8 @@ begin
     result := true;
     Response.Content :=
       '<p><br><h1 style=text-align:center>\82½\82¾\82¢\82Ü\83\81\83\93\83e\83i\83\93\83X\92\86\82Å\82·^_^</h1>' +
-      '<p style=text-align:center><a href=/admin>\8aÇ\97\9d\8eÒ\97p\83\8d\83O\83C\83\93</a>'
+      Format('<p style=text-align:center><a href=%s/admin>\8aÇ\97\9d\8eÒ\97p\83\8d\83O\83C\83\93</a>',
+      [Request.ScriptName]);
   end
   else
     result := false;
@@ -493,6 +520,8 @@ procedure TWebModule1.mailHTMLTag(Sender: TObject; Tag: TTag;
 begin
   if TagString = 'pr' then
     ReplaceText := promotion
+  else if TagString = 'uri' then
+    ReplaceText := Request.ScriptName
   else if TagString = 'content' then
     ReplaceText := articles.Content
   else if TagString = 'query' then
@@ -505,6 +534,7 @@ procedure TWebModule1.searchHTMLTag(Sender: TObject; Tag: TTag;
   const TagString: string; TagParams: TStrings; var ReplaceText: string);
 var
   s: TStringList;
+  str: string;
   procedure sub;
   var
     i: Integer;
@@ -544,6 +574,16 @@ var
 begin
   if TagString = 'pr' then
     ReplaceText := promotion
+  else if TagString = 'uri' then
+    ReplaceText := Request.ScriptName
+  else if TagString = 'select' then
+  begin
+    str:=Request.QueryFields.Values['db'];
+    if str = '' then
+      ReplaceText:=Request.ScriptName+'/'
+    else
+      ReplaceText:=Request.ScriptName+'/index?db='+str;
+  end
   else if (Request.MethodType = mtPost) and (TagString = 'items') then
   begin
     if Request.ContentFields.Values['type'] = 'OR' then
@@ -615,7 +655,9 @@ end;
 procedure TWebModule1.tiHTMLTag(Sender: TObject; Tag: TTag;
   const TagString: string; TagParams: TStrings; var ReplaceText: string);
 begin
-  if TagString = 'count' then
+  if TagString = 'uri' then
+    ReplaceText := Request.ScriptName
+  else if TagString = 'count' then
     ReplaceText := FDTable2.RecordCount.ToString
   else if TagString = 'database' then
     ReplaceText := FDTable1.FieldByName('database').AsString
@@ -632,6 +674,8 @@ procedure TWebModule1.titleHTMLTag(Sender: TObject; Tag: TTag;
 begin
   if TagString = 'pr' then
     ReplaceText := promotion
+  else if TagString = 'uri' then
+    ReplaceText := Request.ScriptName
   else if TagString = 'js' then
     ReplaceText := detail(TagString, TagParams.Values['id'])
   else if TagString = 'main' then
@@ -667,6 +711,8 @@ var
 begin
   if TagString = 'pr' then
     ReplaceText := promotion
+  else if TagString = 'uri' then
+    ReplaceText := Request.ScriptName
   else if TagString = 'list' then
   begin
     i := FDTable3.FieldByName('info').AsInteger;
@@ -692,8 +738,8 @@ begin
       if t <> '' then
         t := ' style=' + t;
       ReplaceText := ReplaceText +
-        Format('<p><a%s target=_blank href="/index?db=%d">%s</a><br></p>',
-        [t, j, s]);
+        Format('<p><a%s target=_blank href="%s/index?db=%d">%s</a><br></p>',
+        [t, Request.ScriptName, j, s]);
       FDTable1.Next;
     end;
   end
@@ -708,8 +754,10 @@ begin
   begin
     for i := 1 to (FDTable1.RecordCount div tcnt) + 1 do
       ReplaceText := ReplaceText +
-        '<div class="slide"><img src="/src?name=slide' + i.ToString +
-        '.jpg" style=float:right;height:465px><#list></div>';
+        Format('<div class="slide"><img src="%s/src?name=slide%d.jpg"',
+        [Request.ScriptName, i]) +
+        ' style=float:right;height:465px><#list></div>';
+
   end;
 end;
 
@@ -767,8 +815,9 @@ begin
   admin.footer.Add(footer.Content);
   if t <> '' then
     t := '?db=' + t;
-  admin.footer.Add('<p style=text-align:center><a href="/index' + t +
-    '">\96ß\82é</a>');
+  admin.footer.Add
+    (Format('<p style=text-align:center><a href="%s/index%s">\96ß\82é</a>',
+    [Request.ScriptName, t]));
   admin.Tag := FDTable2.RecNo;
   Response.ContentType := 'text/html;charset=utf-8';
   Response.Content := admin.Content;
@@ -830,8 +879,8 @@ begin
       AppendRecord([i, num1, num2, Now, s]);
     end;
     if num1 > -1 then
-      Response.SendRedirect(Format('/index?db=%d&num=%d#%d',
-        [num1, num2, num2]))
+      Response.SendRedirect(Format('%s/index?db=%d&num=%d#%d',
+        [Request.ScriptName, num1, num2, num2]))
     else
       Response.SendRedirect('/top');
   end;
@@ -956,7 +1005,8 @@ begin
   FDTable2.Locate('number', s.ToInteger, []);
   page := 10;
   pages(FDTable2.RecNo, page);
-  Response.SendRedirect(Format('/index?db=%s&num=%d#%s', [DB, page, s]));
+  Response.SendRedirect(Format('%s/index?db=%s&num=%d#%s', [Request.ScriptName,
+    DB, page, s]));
 end;
 
 procedure TWebModule1.WebModule1linkAction(Sender: TObject;
@@ -1002,9 +1052,9 @@ begin
     end;
     i := v;
     if s = 'master' then
-      Response.SendRedirect('/master')
+      Response.SendRedirect(Request.ScriptName + '/master')
     else
-      Response.SendRedirect('/admin?db=' + i.ToString);
+      Response.SendRedirect(Request.ScriptName + '/admin?db=' + i.ToString);
   end
   else
   begin
@@ -1031,9 +1081,9 @@ begin
   if (x = true) and (FDTable1.FieldByName('database').AsString = 'master') then
     x := false;
   if x = false then
-    Response.SendRedirect('/')
+    Response.SendRedirect(Request.ScriptName+ '/')
   else
-    Response.SendRedirect('/index?db=' + s);
+    Response.SendRedirect(Request.ScriptName + '/index?db=' + s);
 end;
 
 procedure TWebModule1.WebModule1masterAction(Sender: TObject;
@@ -1106,8 +1156,8 @@ var
       Delete(Text, coll[j].index, coll[j].Length);
       t := Copy(coll[j].Value, Length(s) + 1, coll[j].Length);
       result := Format
-        ('<a class=minpreview data-preview-url=/link?num=%s href=/jump?num=%s>>>%s</a>',
-        [t, t, t]);
+        ('<a class=minpreview data-preview-url=%s/link?num=%s href=/jump?num=%s>>>%s</a>',
+        [Request.ScriptName, t, t, t]);
       Insert(result, Text, coll[j].index);
     end;
     result := Text;
@@ -1165,7 +1215,8 @@ begin
       i := FDTable1.FieldByName('dbnum').AsInteger;
       FDTable2.AppendRecord([i, number, title, na, comment.Text, raw,
         Now, pass]);
-      Response.SendRedirect('index?db=' + i.ToString + '#article');
+      Response.SendRedirect(Request.ScriptName + '/index?db=' + i.ToString +
+        '#article');
       Exit;
     end;
   finally
index dfe8a2f..468d020 100644 (file)
@@ -5,7 +5,7 @@
         <FrameworkType>VCL</FrameworkType>
         <MainSource>newbbs.dpr</MainSource>
         <Base>True</Base>
-        <Config Condition="'$(Config)'==''">Release</Config>
+        <Config Condition="'$(Config)'==''">Debug</Config>
         <Platform Condition="'$(Platform)'==''">Win32</Platform>
         <TargetedPlatforms>3</TargetedPlatforms>
         <AppType>Application</AppType>
index a441753..30387cf 100644 (file)
@@ -86,8 +86,7 @@ object Form1: TForm1
   end
   object FDConnection1: TFDConnection
     Params.Strings = (
-      'Database=F:\web\cgi-bin\MYDATA.FDB'
-      'ConnectionDef=test_server')
+      'ConnectionDef=first_sql')
     Connected = True
     Transaction = FDTransaction1
     Left = 144
@@ -96,6 +95,7 @@ object Form1: TForm1
   object FDTable1: TFDTable
     Active = True
     CachedUpdates = True
+    IndexFieldNames = 'id'
     Connection = FDConnection1
     Transaction = FDTransaction1
     FetchOptions.AssignedValues = [evDetailCascade, evDetailServerCascade]