Connecting the world…

superlinks

Cacti – Superlinks not working

After upgrading Cacti, like shown in the previous post, the Superlinks plugin stopped working correctly. When opening a Superlink tab I got a blank page in Google Chrome or a half page in Internet Explorer and Opera, like shown below.

superlinks-cacti

After some Googling I found the solution for this problem on a Cacti forum. The solution describes change some scripting within the file superlinks.php. The changes are displayed below.

Replace

print ‘<iframe src=”‘ . $page[‘contentfile’] . ‘” width=”100%” height=”100%” frameborder=”0″></iframe>’;

by

print ‘<iframe id=”frame” src=”‘ . $page[‘contentfile’] .'” width=”100%” height=”100%” frameborder=”0″></iframe>’;
print “<script type=’text/javascript’>
function resizeIframe() {
var height=window.innerWidth;//Firefox
if (document.documentElement.clientHeight) {
height=document.documentElement.clientHeight;//IE
};
document.getElementById(‘frame’).style.height=parseInt(height-document.getElementById(‘frame’).offsetTop-72)+’px’;
};
document.getElementById(‘frame’).onload = resizeIframe;
window.onresize = resizeIframe;
</script>”;

Superlinks is working fine again after applying the change.