rejetto forum

"up" button is bug

0 Members and 1 Guest are viewing this topic.

Offline catgirl

  • Occasional poster
  • *
    • Posts: 17
    • View Profile
"up" button is bug.
no support chinese encode.(Only "UP"button)



Offline catgirl

  • Occasional poster
  • *
    • Posts: 17
    • View Profile
press "up" contain chinese character.
404 file not find


Offline Pavel Rus

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
    • http://skeeper.nm.ru
This bug complete fix, if rejetto add in you sources code
this string:
// build up base table
table:=NIL;
addArray(table, [
  '%timestamp%', DateTimeToStr(now()),
  '%version%', VERSION,
  '%uptime%', uptimestr(),
  '%folder%', includeTrailingChar('/', decodeURL(folder.url())),
//************** My modification ********************************
{correct russian or other chars in url in header "Up"  \\hslib.encodeURL\\}
  '%parent-folder%', hslib.encodeURL(includeTrailingChar('/', decodeURL(folder.parenturl())),True,True,False)
//************** End My modification ********************************
]);


Offline catgirl

  • Occasional poster
  • *
    • Posts: 17
    • View Profile

Offline Pavel Rus

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
    • http://skeeper.nm.ru
what is not compile?
I can help you.
I fix bugs in sources code.
If you have any questions please go to my icq 331025557
or my mail skeeper@nm.ru


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13271
    • View Profile
Quote from: "Pavel Rus"
'%parent-folder%', hslib.encodeURL(includeTrailingChar('/', decodeURL(folder.parenturl())),True,True,False)

yes, i get the idea.

it is more desirable to not call the hslib.encodeURL(), but use the hiding function present in main module ... when possible.

i moved fullEncode:=TRUE; before the // build up base table
and inserted a call to encodeURL().
i hope this will work.


Offline Pavel Rus

  • Occasional poster
  • *
    • Posts: 7
    • View Profile
    • http://skeeper.nm.ru
For comlete this problem i add code
i add new key word %efolder%
in template it is
-------------------------------------------------------------------------------
[files]
<div class=label>%number-folders% folders,  %number-files% files - Total: %total-size%</div>
<table cellpadding=5>
<th><a href="%efolder%?sort=n"><span class=column>Filename</span></a>
<th><a href="%efolder%?sort=s"><span class=column>Filesize</span></a>
<th><a href="%efolder%?sort=t"><span class=column>Filetime</span></a>
<th class=column>Hits
%list%
</table>
-------------------------------------------------------------------------------
in programm

// build final page
if list='' then list:=tpl['nofiles']
else
  begin
  table2:=table;
//************** My modification ********************************
  {correct russian chars in url in header "File , Size, Date Time"}
  i:=0;
  while i < length(table2) do
  begin
    if table2='%folder%' then
    begin
      temp:=hslib.encodeURL(table2[i+1],True,True,False);
      addArray(table2, ['%efolder%',temp]);
      break;
    end;
    inc(i,2);
  end;
//************** End My modification *********************
  addArray(table2, ['%list%',list]);
  list:=x_template(tpl['files'], table2);
  end;


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13271
    • View Profile
i introduced the %encoded-folder% symbol as you proposed, but i don't understand why you used a loop to do it.
that's how i did
Code: [Select]
// build up base table
table:=NIL;
addArray(table, [
  '\n', CRLF,
  '%timestamp%', DateTimeToStr(now()),
  '%version%', VERSION,
  '%uptime%', uptimestr(),
  '%folder%', includeTrailingChar('/', decodeURL(folder.url())),
  '%encoded-folder%',
    encodeURL(includeTrailingChar('/', decodeURL(folder.url()))),
  '%parent-folder%',
    encodeURL(includeTrailingChar('/', decodeURL(folder.parenturl())))
]);