show plugin with condition

bit

Verified User
Joined
Apr 23, 2015
Messages
57
Hello, I create a skin and I want that at absence |PLUGIN_0_IMG | was displayed |PLUGIN_0_TXT | with a custom icon. Not all plugins have user_img.html and its problem.

Its work well but i dont have link if plugin dont have user_img.html
|*if PLUGIN_0_IMG!=""|
|PLUGIN_0_IMG|
|*endif|

For fix it im try check it. Its my variant but not work (why?):

|?PLUGIN_0="0"|

|*if PLUGIN_0_TXT!=""|
|?PLUGIN_0="1"|
|*endif|
|*if PLUGIN_0_IMG!=""|
|?PLUGIN_0="2"|
|*endif|
|*if PLUGIN_0="2"|
|PLUGIN_0_IMG|
|*endif|
|*if PLUGIN_0="1"|
|PLUGIN_0_TXT|
|*endif|

how add custom icon for |PLUGIN_0_TXT| ?

ideal be if i can make this construction:

|*if PLUGIN_0="1"|
<a href="/|PLUGIN_0_URL|"><img src="/IMG_CUSTOM_PLUGIN"><br>|PLUGIN_0_NAME|</a>
|*endif|

Please help.
 
Last edited:

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
13,853
Location
GMT +7.00
Hello,

In enhanced skin we have this code:

PHP:
|$/usr/local/bin/php
<?php
$data = <<<END
|PLUGIN_0_TXT|
END;
if (strlen($data) > 1)
{
echo <<<END
|PLUGIN_0_TXT|<br>
|PLUGIN_1_TXT|<br>
|PLUGIN_5_TXT|<br>
|PLUGIN_7_TXT|<br>
|PLUGIN_9_TXT|
END;
}
?>
DONE|
So use PHP and change the code to whatever you need ;)
 

bit

Verified User
Joined
Apr 23, 2015
Messages
57
Hello,

In enhanced skin we have this code:

PHP:
|$/usr/local/bin/php
<?php
$data = <<<END
|PLUGIN_0_TXT|
END;
if (strlen($data) > 1)
{
echo <<<END
|PLUGIN_0_TXT|<br>
|PLUGIN_1_TXT|<br>
|PLUGIN_5_TXT|<br>
|PLUGIN_7_TXT|<br>
|PLUGIN_9_TXT|
END;
}
?>
DONE|
So use PHP and change the code to whatever you need ;)
enhanced skin dont have icon for plugin... Use php function str_replace is easy but im try make with minimal PHP code... Now use simple:

Code:
|PLUGIN_0_IMG|
|PLUGIN_1_IMG|
|PLUGIN_2_IMG|
|PLUGIN_3_IMG|
|PLUGIN_4_IMG|
|PLUGIN_5_IMG|
|PLUGIN_6_IMG|
|PLUGIN_7_IMG|
|PLUGIN_8_IMG|
|PLUGIN_9_IMG|
for enhanced skin more optimal use:
Code:
|PLUGIN_0_TXT|<br>
|PLUGIN_1_TXT|<br>
|PLUGIN_5_TXT|<br>
|PLUGIN_7_TXT|<br>
|PLUGIN_9_TXT|
its work always correct and more faster...
 
Top