rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: D on September 08, 2023, 12:45:02 PM

Title: decodeuri doesn't always work correctly, how can I fix?
Post by: D on September 08, 2023, 12:45:02 PM
I am using a script for displaying folder previews
Code: [Select]
{. if|{. exists|%item-folder%{.decodeuri|%item-url%.}.jpg .}| <img src="%item-url%.jpg" /> |  .}It doesn't work for some folders using cyrillic names. What can I do about it?
Title: Re: decodeuri doesn't always work correctly, how can I fix?
Post by: rejetto on September 08, 2023, 12:56:33 PM
try to have on screen the result, so maybe the problem will be clearer.
The easier way is to have {.decodeuri|%item-url%.} duplicated, after your code. That should make it visible.

Did you consider using HFS 3?
Title: Re: decodeuri doesn't always work correctly, how can I fix?
Post by: D on September 08, 2023, 03:38:28 PM
Quote
The easier way is to have {.decodeuri|%item-url%.} duplicated, after your code. That should make it visible.
Only worked for already good folders.
Quote
Did you consider using HFS 3?
What scares me is that I'll need to rebuild everything from scratch.
Title: Re: decodeuri doesn't always work correctly, how can I fix?
Post by: rejetto on September 08, 2023, 03:42:20 PM
Only worked for already good folders (attached a pic)

ok but what do you see on "bad" folders ?

Quote
What scares me is that I'll need to rebuild everything from scratch.
if you want I can try to help you with that
Title: Re: decodeuri doesn't always work correctly, how can I fix?
Post by: D on September 08, 2023, 03:54:30 PM
Quote
ok but what do you see on "bad" folders ?
Nothing at all.
Quote
if you want I can try to help you with that
How?
Title: Re: decodeuri doesn't always work correctly, how can I fix?
Post by: rejetto on September 08, 2023, 04:18:18 PM
what is the URL of the folder?
you can omit the server/IP part, to keep it private

How?
You can contact me on telegram or gmail chat, and we can have a closer look at what you need
Title: Re: decodeuri doesn't always work correctly, how can I fix?
Post by: rejetto on September 08, 2023, 04:32:19 PM
Did you try removing the decodeuri? like this
{.exists|%item-folder%%item-url%.jpg .}

but command "exists" works both with url and with path on disk, so you can also try
{.exists|%item-resource%.jpg .}
or something like this, i'm not sure if item-resource has a final \
Title: Re: decodeuri doesn't always work correctly, how can I fix?
Post by: D on September 08, 2023, 06:11:07 PM
Quote
Did you try removing the decodeuri? like this
{.exists|%item-folder%%item-url%.jpg .}
Yes, it's even worse, almost no pics appear.
Quote
but command "exists" works both with url and with path on disk, so you can also try
{.exists|%item-resource%.jpg .}
or something like this, i'm not sure if item-resource has a final \
Yes it does: {.exists|%item-resource%\.jpg.} - this one works perfectly, thank you.
Quote
You can contact me on telegram or gmail chat, and we can have a closer look at what you need
Telegram - @rejetto ?
Title: Re: decodeuri doesn't always work correctly, how can I fix?
Post by: rejetto on September 09, 2023, 09:30:55 AM
this one works perfectly, thank you.
nice. btw, are you using 2.3 or 2.4?

Quote
Telegram - @rejetto ?
yes, if you'd like to use version 3 in the future, consider contacting me anyway, as I'm interested in understanding what are real customization needs, I'm still "shaping" version 3.