Plugins
Weird Block Issue?!

Hello all, I have been messing with this software for a few days now, and I have to say, I love it, thank you.


I have crated a block to query Steam servers and it works as expected. However, it show up on the bottom of the page, no matter what theme I use. Even if I haven't added to any blocks, it's just there.


My website is; beee.uk and if you scroll down a little, you can see what is going on. It shows in the block I selected, but it shows below too.


Any help would be greatly appreciated.


Thank you.


Hello all, I have been messing with this software for a few days now, and I have to say, I love it, thank you. I have crated a block to query Steam servers and it works as expected. However, it show up on the bottom of the page, no matter what theme I use. Even if I haven't added to any blocks, it's just there. My website is; beee.uk and if you scroll down a little, you can see what is going on. It shows in the block I selected, but it shows below too. Any help would be greatly appreciated. Thank you.

Hi,


That's strange. Can you tell us the position which you have set for this block?


Hi, That's strange. Can you tell us the position which you have set for this block?
Necessity is the mother of all inventions!

This show here when I just install it, not when I even add it to any block (like I said in my initial post). As this is a custom theme, I created a block to add it where I wanted.


I have included the code that I'm using as I'm only using the echo method to show the information.


$ip = 'beee.online'; // Edit with your server info
$queryport = 26900; // Add your server port
$socket = @fsockopen("udp://".$ip, $queryport , $errno, $errstr, 1);
stream_set_timeout($socket, 1);
stream_set_blocking($socket, TRUE);
fwrite($socket, "\xFF\xFF\xFF\xFF\x54Source Engine Query\x00");
$response = fread($socket, 4096);
@fclose($socket);$packet = explode("\x00", substr($response, 6), 5);
$server = array();
$server['name'] = $packet[0];
$server['map'] = $packet[1];
$server['game'] = $packet[2];
$server['description'] = $packet[3];
$inner = $packet[4];
$server['players'] = ord(substr($inner, 2, 1));
$server['playersmax'] = ord(substr($inner, 3, 1));
$object = (object) $server;
echo "<a href='steam://connect/beee.online:26900'>$object->name</a><br />
$object->map<br />
$object->players/$object->playersmax"
;
This show here when I just install it, not when I even add it to any block (like I said in my initial post). As this is a custom theme, I created a block to add it where I wanted. I have included the code that I&#039;m using as I&#039;m only using the echo method to show the information. ```` $ip = &#039;beee.online&#039;; // Edit with your server info $queryport = 26900; // Add your server port $socket = @fsockopen(&quot;udp://&quot;.$ip, $queryport , $errno, $errstr, 1); stream_set_timeout($socket, 1); stream_set_blocking($socket, TRUE); fwrite($socket, &quot;\xFF\xFF\xFF\xFF\x54Source Engine Query\x00&quot;); $response = fread($socket, 4096); @fclose($socket);$packet = explode(&quot;\x00&quot;, substr($response, 6), 5); $server = array(); $server[&#039;name&#039;] = $packet[0]; $server[&#039;map&#039;] = $packet[1]; $server[&#039;game&#039;] = $packet[2]; $server[&#039;description&#039;] = $packet[3]; $inner = $packet[4]; $server[&#039;players&#039;] = ord(substr($inner, 2, 1)); $server[&#039;playersmax&#039;] = ord(substr($inner, 3, 1)); $object = (object) $server; echo &quot;&lt;a href=&#039;steam://connect/beee.online:26900&#039;&gt;$object-&gt;name&lt;/a&gt;&lt;br /&gt; $object-&gt;map&lt;br /&gt; $object-&gt;players/$object-&gt;playersmax&quot;; ````

Hi,


The block doesn't actually support PHP code. If you need PHP you usually do it with a plugin.
I am not sure how is this code working for you since it would probably come as commented due to security in the template engine.


Even if I haven't added to any blocks, it's just there.


This seems like you created a plugin and set the block output as that plugin?


Hi, The block doesn&#039;t actually support PHP code. If you need PHP you usually do it with a plugin. I am not sure how is this code working for you since it would probably come as commented due to security in the template engine. [quote=&quot;pid:24607, uid:14386&quot;]Even if I haven&#039;t added to any blocks, it&#039;s just there.[/quote] This seems like you created a plugin and set the block output as that plugin?
Necessity is the mother of all inventions!

Umm, this is a plugin I just used the $info['plugin_type']= 'block'; - I followed the "hello world" example on your website?


I did post in the plugins section, so I assumed that this was a given, that it was a plugin?


Umm, this is a plugin I just used the $info[&#039;plugin_type&#039;]= &#039;block&#039;; - I followed the &quot;hello world&quot; example on your website? I did post in the plugins section, so I assumed that this was a given, that it was a plugin?
edited Oct 27 at 10:32 pm

Yes, you did. Sorry I missed to notice that.


We will just have a look at the plugin output code and see if this is due to any bug and let you know.


Yes, you did. Sorry I missed to notice that. We will just have a look at the plugin output code and see if this is due to any bug and let you know.
Necessity is the mother of all inventions!

Hi,


There can be one possible cause behind this weird behaviour.
If your plugin type is set as 'plugin' instead of 'block' then it will always load that plugin irrespective of if a block is selected or not.


Can you check the codo_plugins table for the column plg_type against your plugin name and see if it is set as 'block' or not?


Hi, There can be one possible cause behind this weird behaviour. If your plugin type is set as &#039;plugin&#039; instead of &#039;block&#039; then it will always load that plugin irrespective of if a block is selected or not. Can you check the codo_plugins table for the column plg_type against your plugin name and see if it is set as &#039;block&#039; or not?
Necessity is the mother of all inventions!
edited Oct 28 at 1:18 pm

It is set as block in the mysql. I removed it from the database, deleted the folder and started again. But the results are the same. If I create a new plugin and just create the basic "Hello World" plugin and that works as expected. As soon as I edit the code with my code, I get the same result, so I assume my code is causing an issue so I will take a look further into what I have done.


It is set as block in the mysql. I removed it from the database, deleted the folder and started again. But the results are the same. If I create a new plugin and just create the basic &quot;Hello World&quot; plugin and that works as expected. As soon as I edit the code with my code, I get the same result, so I assume my code is causing an issue so I will take a look further into what I have done.
55
8
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