Calling MathJax
October 11th, 2018Added the script
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML' async></script>
to [/skin/_body_header.inc.php]
Then the text
Where a is not zero.
$$a \ne 0$$
$$(ax^2 + bx + c = 0)$$
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$
becomes
Where a is not zero. $$a \ne 0$$ $$ (ax^2 + bx + c = 0)$$ $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$
Passing php variables
October 10th, 2018In making a widget to show the current user's posts, I had to get the php $current_User->.
This was achieved by
1. adding code to the header so that it was global and could be called from anywhere.
<script>
var uid = "<?php echo $current_User->ID; ?>";
</script>
2) then a FreeHTML widget called the javascript variable: javascript being usable in the FreeHTML widget
<script>
url="https://calstock.org.uk/?disp=useritems&user_ID=" + uid;
document.write("<a href=" + url + ">My Posts :: <em>All collections/a>");
</script>







