Plugin hooks issues

ClayRabbit

Verified User
Joined
Jan 3, 2004
Messages
260
Location
Russia
Hello

1) For example, from this hook file new skin produces incorrect string: "\n\n\n Virus & Malware Scan \n\n" instead of "Virus & Malware Scan"
https://bitbucket.org/ruweb/site_sc...86d10d175d830c012b131dcd5/hooks/user_txt.html

This can be solved by putting all hook content in one line - but this is not very convient solution.

2) While i trying to solve that, I have found "<!--" is also processed incorrectly
From this hook file new skin doesn't display anything at all:
https://bitbucket.org/ruweb/site_sc...e373a5f745ada1321b80c8051/hooks/user_txt.html

3) I'm noticed html-entities (&#-sequences) also not displayed correctly.

4) I'm also noticed |DOMAIN|, |LANGUAGE| and |DOCUMENT_ROOT| tokens used inside hook file doesn't work in new skin.

5) And BTW, I haven't found any way to switch skin inside user interface.
 
Last edited:
Hello,

Thanks for the report!

1) For the \n\n\n, if you manually view the html when viewing the plugin hook in the skin, is that shown? It's html, so newline wouldn't do anything anyway... I'm not sure it should be up to DA to alter the hook contents, eg: What if the newlines were desired?
As you've mentioned, the multi-line |*TOKEN| can be shrunk into single lines to prevent that. It's no different than putting the control |*TOKENS| in any other part of the skin.

2+3) Hmm... check the html source of the skin itself to see what it's showing.
I used enhanced, and added it to the hello_world user_txt hook like this:

which worked on my end:
Code:
<a href="/CMD_PLUGINS/hello_world">Hello World Plugin</a>
<a href="/CMD_PLUGINS/site_scan/?domain=|DOMAIN|&skin=|SKIN|" onclick="this.href=this.href+'&charset='+document.characterSet"><!--
|*if DOCUMENT_ROOT="/usr/local/directadmin/data/skins/enhanced"|
|?LANGUAGE=ru|
|*endif|
|*if LANGUAGE="ru"|
-->********ровер********а ********а в********русы<!--
|*else|
-->Virus & Malware Scan |LANGUAGE|<!--
|*endif|
--></a>
showing
Code:
[URL="http://192.168.1.170:2222/CMD_PLUGINS/hello_world"]Hello World Plugin[/URL][URL="http://192.168.1.170:2222/CMD_PLUGINS/site_scan/?domain=es5.com&skin=enhanced"]********ровер********а ********а в********русы[/URL]
So not quite sure in your case. Please test with enhanced too, to see what's up.
(Sorry, the forum is swapping some characters with ***... but it does seem to be showing the character in the enhanced skin... it's also swapping the html entities with the actual characters... but in short, it seems to work in enhanced)

4) If you add |DUMPTOKENS| what values are you seeing vs enhanced?
Although, I'm not actually seeing any plugins in evolution. Going to see if Marytnas can duplicate that.
5) Noted, will let them know :)

John
 
There is no issues with enhanced or power_user skins - all works as intended.
This is only evolution skin issues. And i'm not sure how we can check "html source" in this case while all pages filled dynamically by javascript.

Another example user_txt.html:
Code:
<a href="/">
тест
<br>
</a>
123
Result: https://imgur.com/LRIZ2Cd

So hook file content inside <a>...</a> doesn't treated as html anymore: html-entities and html-tags didn't work - they are displayed as is, newlines converted to "\n". Content outside <a>...</a> is ignored.

If I put something like "<!-- test -->" _anywhere_ inside hook file - hook content doesn't displayed at all: https://imgur.com/Y2RU05C

If I put |DUMPTOKENS| anywhere inside hook file - skin failed to display anything at all: https://imgur.com/wWZklRy

And, BTW, can you add some default font formatting and add css classes which was present in other skins for backward compatibility because some of our plugins content is relying on those css-classes (list,list2,listwrap,listwrap2,listtitle,tab,tabs,tabspace,tabtext,tree).
 
Last edited:
#4 should be fixed in DA pre-release binaries now as well. Thank you for the report!
 
Back
Top