Codoforum related discussions
Use PHP in blocks

As the title states.. Is there a way to use custom PHP in codeblocks?


Whenever I add the PHP it displays as exactly what I wrote.


Regards.


EDIT: problem solved.


As the title states.. Is there a way to use custom PHP in codeblocks? Whenever I add the PHP it displays as exactly what I wrote. Regards. EDIT: problem solved.
edited Dec 20 '20 at 5:28 pm

As far as I know it is not possible to use functional PHP in the widget blocks only HTML / CSS should work.


If You`ll or need to use PHP I think it is better to write a plugin for that reason.
Here you go: https://codoforum.com/documentation/how-to-write-a-hello-world-plugin


Many CMS providers do not allow PHP or JS in the blocks and widgets because there could be security concerns. But it could be that I'm wrong. We'd better ask the Codoforum developer @admin

Kind regards, Andy smile


As far as I know it is not possible to use functional PHP in the widget blocks only HTML / CSS should work. If You`ll or need to use PHP I think it is better to write a plugin for that reason. Here you go: https://codoforum.com/documentation/how-to-write-a-hello-world-plugin Many CMS providers do not allow PHP or JS in the blocks and widgets because there could be security concerns.** But it could be that I'm wrong**. We'd better ask the **Codoforum** developer @admin Kind regards, Andy :)
edited Dec 20 '20 at 6:38 pm

Thanks for the reply,


I did however just copy and reuse an already made plugin.


The plugin i wanted was to view steam connected players on a server aswell as discord member online count.


All of which was achievable within the plugin, as I already knew the php part of it. While I am still learning CODOLogic I was unaware of the link you provided.. I must'nt of checked properly haha.


Thanks


Thanks for the reply, I did however just copy and reuse an already made plugin. The plugin i wanted was to view steam connected players on a server aswell as discord member online count. All of which was achievable within the plugin, as I already knew the php part of it. While I am still learning CODOLogic I was unaware of the link you provided.. I must'nt of checked properly haha. Thanks

Because of the Discord stats - You can use the widget code provided by Discord and create a CF-Block from it. So because of the Discord stats Widget there is no need to work with PHP. You can find the Discord Widget code at your Discord server settings - it is as esay as copy paste.


I already did it: https://cute-but-evil.de/board/


Used Block code:


As block position I used - block_category_list_after


<iframe style="margin-top: 20px;" src="https://discordapp.com/widget?id=218530518143205376&theme=dark" width="350" height="500" allowtransparency="true" frameborder="0"></iframe>

Kind regards, Andy smile


Because of the Discord stats - You can use the widget code provided by Discord and create a CF-Block from it. So because of the Discord stats Widget there is no need to work with PHP. You can find the Discord Widget code at your Discord server settings - it is as esay as copy paste. I already did it: https://cute-but-evil.de/board/ **Used Block code:** As block position I used - **block_category_list_after** ```` &lt;iframe style=&quot;margin-top: 20px;&quot; src=&quot;https://discordapp.com/widget?id=218530518143205376&amp;theme=dark&quot; width=&quot;350&quot; height=&quot;500&quot; allowtransparency=&quot;true&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt; ```` Kind regards, Andy :)
edited Dec 22 '20 at 8:03 pm
33
3
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft