Page 1 of 1

own custom block with javascript

Posted: 14. January 2015 08:53
by Harledir
Your Portal Version: 2.1.0-RC1
Your phpBB Type: Standard phpBB3
MODs installed: Yes
Your knowledge: Basic Knowledge
Boardlink: http://legion-of-lost-souls.eu

What have you done before the problem was there?


What have you already tryed to solve the problem?


Description and Message
hi all,

i am trying to get 2 custom blocks to work within the portal. Both of these have a javascript for the actual content. The javascript pulls the information off a remote site (to show server status and teamspeak3 server).

Both blocks are showing up fine on the portal. The javascript is not being excuted or shown. If i add a <p>Hello World!</p> to the content it is being shown fine.

Server status block:

Code: Select all

{$LR_BLOCK_H_L}LotRO Server Status{$LR_BLOCK_H_R}
             <div style="text-align: center;">

<p>Hello World!</p>
<script type="text/javascript" src="http://lux-hdro.de/serverstatus-widget.php?snowbourn=1"></script>

 </div>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
teamspeak server block

Code: Select all

{$LR_BLOCK_H_L}Teamspeak3 Server{$LR_BLOCK_H_R}
             <div style="text-align: center;">

<p>Hello World!</p>
<div id="ts3viewer_1057264" style="width:; background-color:;"> </div>

<script type="text/javascript" src="http://static.tsviewer.com/short_expire/js/ts3viewer_loader.js"></script>

<script type="text/javascript">
<!--
var ts3v_url_1 = "http://www.tsviewer.com/ts3viewer.php?ID=1057264&text=000000&text_size=12&text_family=1&js=1&text_s_weight=bold&text_s_style=normal&text_s_variant=normal&text_s_decoration=none&text_s_color_h=525284&text_s_weight_h=bold&text_s_style_h=normal&text_s_variant_h=normal&text_s_decoration_h=underline&text_i_weight=normal&text_i_style=normal&text_i_variant=normal&text_i_decoration=none&text_i_color_h=525284&text_i_weight_h=normal&text_i_style_h=normal&text_i_variant_h=normal&text_i_decoration_h=underline&text_c_weight=normal&text_c_style=normal&text_c_variant=normal&text_c_decoration=none&text_c_color_h=525284&text_c_weight_h=normal&text_c_style_h=normal&text_c_variant_h=normal&text_c_decoration_h=underline&text_u_weight=bold&text_u_style=normal&text_u_variant=normal&text_u_decoration=none&text_u_color_h=525284&text_u_weight_h=bold&text_u_style_h=normal&text_u_variant_h=normal&text_u_decoration_h=none";
ts3v_display.init(ts3v_url_1, 1057264, 100);
-->
</script>

 </div>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}

i tried using the builtin custom block/module function from the ACP and copy&pasted the javascript into the content part with the same result - it does not work.

Any idea how this should be done? Thanks for any help![/i]

Re: own custom block with javascript

Posted: 15. January 2015 10:48
by Harledir
i have no idea why, but this morning the blocks are showing the excuted javascript.

(i did delete cache etc...) oh well, at least it works. Please close this as resolved.

Re: own custom block with javascript

Posted: 15. January 2015 14:29
by Harledir
just noticed what happened, but donĀ“t have a solution.

when viewing the site with HTTP everything works (javascript in the blocks is being executed)
when viewing it with HTTPS the blocks stay empty (javascript is not being executed / or the results are not being displayed)

How can i get this to work with HTTPS as well?

Re: own custom block with javascript

Posted: 15. January 2015 18:22
by talonos
in your code try changing

Code: Select all

http://
to

Code: Select all

https://
and see if it still loads on your site with using HTTP:// and if it does then try it on HTTPS://

if its works on http but not https then theres not much you can does as its the source that is at fault for which you have no control of (Teamviewer will proberly have this problem)